Skip to contentSkip to conversation

fix PDF doc build

PATCH Applied Thomas Monjalon 2 participants 8 messages May 22, 2019 – May 29, 2019

lore
Share & tools
lore
#0 lore raw

cover fix PDF doc build

I found different issues when building the doc as PDF on the server or my laptop.
Debugging pdflatex issues is really hard, so I hope we won't have more.

We could also question why we are bothering with PDF?

Thomas Monjalon (3):
doc: robustify PDF build
doc: fix PDF with greek letter
doc: clean PDF config

 doc/guides/conf.py                        | 8 ++++----
 doc/guides/contributing/documentation.rst | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/3 doc: robustify PDF build

In some environment like the current dpdk.org server, there can be some errors due to symbols in titles, as it was the case before this commit in DPDK 18.05:
551d148944dc ("doc: remove flow API migration section")

! LaTeX Error: Bad math environment delimiter.

It can be avoided thanks to the Latex command \robustify.

---
 doc/guides/conf.py | 3 +++
 1 file changed, 3 insertions(+)
doc/guides/conf.py +3 -0
index a85f6c9d9..6d5001a07 100644
@@ -67,6 +67,9 @@
 \usepackage{helvet}
 \renewcommand{\familydefault}{\sfdefault}
 \RecustomVerbatimEnvironment{Verbatim}{Verbatim}{xleftmargin=5mm}
+\usepackage{etoolbox}
+\robustify\(
+\robustify\)
 """
 
 # Configuration for the latex/pdf docs.
Signature · 1 line
2.21.0
Acked-by on v1 1/3
#2 lore raw

Re: [dpdk-dev] [PATCH 1/3] doc: robustify PDF build

Quoted 10 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, May 22, 2019 9:29 PM
To: [email protected]; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>
Cc: [email protected]
Subject: [PATCH 1/3] doc: robustify PDF build

Quoted 9 lines

In some environment like the current dpdk.org server, there can be some errors due to symbols in titles, as it was the case before this commit in DPDK 18.05:
551d148944dc ("doc: remove flow API migration section")

! LaTeX Error: Bad math environment delimiter.

It can be avoided thanks to the Latex command \robustify.

#3 lore raw

PATCH 2/3 doc: fix PDF with greek letter

In reply to Thomas Monjalon

For an unknown reason, the sign "μ" is not accepted by some environments, probably due to the version of some Latex packages or dependencies.

! Package inputenc Error: Unicode character μ (U+03BC)
(inputenc) not set up for use with LaTeX.

It is fixed by installing texlive-langgreek.

Fixes d0dff9ba445e ("doc: sample application user guide")
---
 doc/guides/conf.py                        | 1 +
 doc/guides/contributing/documentation.rst | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
doc/guides/conf.py +1 -0
index 6d5001a07..94b97dc35 100644
@@ -64,6 +64,7 @@
 custom_latex_preamble = r"""
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}
+\usepackage{textalpha}
 \usepackage{helvet}
 \renewcommand{\familydefault}{\sfdefault}
 \RecustomVerbatimEnvironment{Verbatim}{Verbatim}{xleftmargin=5mm}
doc/guides/contributing/documentation.rst +2 -2
index 9d381919b..27e4b13be 100644
@@ -199,10 +199,10 @@ The main required packages can be installed as follows:
 .. code-block:: console
 
    # Ubuntu/Debian.
-   sudo apt-get -y install texlive-latex-extra
+   sudo apt-get -y install texlive-latex-extra texlive-lang-greek
 
    # Red Hat/Fedora, selective install.
-   sudo dnf     -y install texlive-collection-latexextra
+   sudo dnf     -y install texlive-collection-latexextra texlive-greek-fontenc
 
 `Latexmk <http://personal.psu.edu/jcc8/software/latexmk-jcc/>`_ is a perl script
 for running LaTeX for resolving cross references,
Signature · 1 line
2.21.0
Acked-by on v1 2/3
#4 lore raw

Re: [dpdk-dev] [PATCH 2/3] doc: fix PDF with greek letter

Quoted 10 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, May 22, 2019 9:29 PM
To: [email protected]; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>
Cc: [email protected]
Subject: [PATCH 2/3] doc: fix PDF with greek letter

Quoted 8 lines

For an unknown reason, the sign "μ" is not accepted by some environments, probably due to the version of some Latex packages or dependencies.

! Package inputenc Error: Unicode character μ (U+03BC)
(inputenc) not set up for use with LaTeX.

It is fixed by installing texlive-langgreek.

#5 lore raw

PATCH 3/3 doc: clean PDF config

In reply to Thomas Monjalon

Some font options do not look necessary.

---
 doc/guides/conf.py | 4 ----
 1 file changed, 4 deletions(-)
doc/guides/conf.py +0 -4
index 94b97dc35..e2b52e2df 100644
@@ -62,11 +62,7 @@
 
 # Latex directives to be included directly in the latex/pdf docs.
 custom_latex_preamble = r"""
-\usepackage[utf8]{inputenc}
-\usepackage[T1]{fontenc}
 \usepackage{textalpha}
-\usepackage{helvet}
-\renewcommand{\familydefault}{\sfdefault}
 \RecustomVerbatimEnvironment{Verbatim}{Verbatim}{xleftmargin=5mm}
 \usepackage{etoolbox}
 \robustify\(
Signature · 1 line
2.21.0