From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) by dpdk.org (Postfix) with ESMTP id 39C2F9A8B for ; Thu, 19 Mar 2015 12:24:15 +0100 (CET) Received: by webcq43 with SMTP id cq43so54605053web.2 for ; Thu, 19 Mar 2015 04:24:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TuUn0MtCxngxe1ThUh50pXglQX0H0++66FULdajawdo=; b=e/I9gAe1/LdTJoE2lox+ZVKbRsQ5c/Fv3Py3fhAs00uh8Ncu/3YBEfO8yLJjgWtYWe CMTI/VvpGc9JW+Bnb1u6OjmQHIQXt3liYdlBQq/WBowmifJFgl54lC1mAhrtmx1PzJAm JoiPDUsZk6lwTwZeaA+8b+w17GQfUXIqVPC1lTDdeGGogJe/toYFEJJKxPYtzHmKfYb6 8rR/6xXMv4kPN8/W1PIx1hj8mxMtHu8vyMlHLVFPLDHSHB4n0S2wIyu3brJTbDfJVsnB /NraSjuVe/jtGpddij5Q91RdHPbmNKk5jpWa7Mh0dJmpyfqPZixjFNO3sablHyZOvD9W 7YpQ== X-Gm-Message-State: ALoCoQmgsN3nnV4AyhUM6jLgJ6PjsEm9fdQ3FgRJyEi8RV4u1zlIv3zYjM8L+atJlHBNMZnajhN/ X-Received: by 10.194.193.99 with SMTP id hn3mr152512459wjc.148.1426764255082; Thu, 19 Mar 2015 04:24:15 -0700 (PDT) Received: from localhost.localdomain (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id y14sm1537682wjr.39.2015.03.19.04.24.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 04:24:14 -0700 (PDT) From: Thomas Monjalon To: john.mcnamara@intel.com Date: Thu, 19 Mar 2015 12:23:23 +0100 Message-Id: <1426764204-3882-7-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1426764204-3882-1-git-send-email-thomas.monjalon@6wind.com> References: <1422972678-7982-1-git-send-email-john.mcnamara@intel.com> <1426764204-3882-1-git-send-email-thomas.monjalon@6wind.com> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH v5 6/7] doc: tune pdf fonts X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2015 11:24:15 -0000 From: John McNamara This mainly adds metadata but also includes an override to the Latex formatter to control the font size in code blocks. Signed-off-by: John McNamara Acked-by: Bernard Iremonger --- doc/guides/conf.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/doc/guides/conf.py b/doc/guides/conf.py index 7151dfd..168efa6 100644 --- a/doc/guides/conf.py +++ b/doc/guides/conf.py @@ -29,6 +29,8 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import subprocess +from sphinx.highlighting import PygmentsBridge +from pygments.formatters.latex import LatexFormatter project = 'DPDK' @@ -46,3 +48,32 @@ latex_documents = [ '', 'manual') ] + +# Latex directives to be included directly in the latex/pdf docs. +latex_preamble = r""" +\usepackage[utf8]{inputenc} +\usepackage{DejaVuSansMono} +\usepackage[T1]{fontenc} +\usepackage{helvet} +\renewcommand{\familydefault}{\sfdefault} +\RecustomVerbatimEnvironment{Verbatim}{Verbatim}{xleftmargin=5mm} +""" + +# Configuration for the latex/pdf docs. +latex_elements = { + 'papersize': 'a4paper', + 'pointsize': '11pt', + # customize Latex formatting + 'preamble': latex_preamble +} + +# Override the default Latex formatter in order to modify the +# code/verbatim blocks. +class CustomLatexFormatter(LatexFormatter): + def __init__(self, **options): + super(CustomLatexFormatter, self).__init__(**options) + # Use the second smallest font size for code/verbatim blocks. + self.verboptions = r'formatcom=\footnotesize' + +# Replace the default latex formatter. +PygmentsBridge.latex_formatter = CustomLatexFormatter -- 2.2.2