From 5b9ad3687e3315a46e19e1b3fd31b74967244afb Mon Sep 17 00:00:00 2001 From: jfbu Date: Mon, 2 Dec 2019 15:00:44 +0100 Subject: [PATCH 1/3] [DOC] LaTeX: Fix preamble Memo: latex_preamble got removed from Sphinx at 1.6.1, and old LaTeX package expdlist requires a fix else it breaks LaTeX if a description list is in a table cell, and it causes anyhow many LaTeX complaints about Underfull box (badness 10000). The fix for these complaints is copied over from https://github.com/scipy/scipy/commit/c881fdea7a7ef7c518b789 and it turns out it is also a fix for the crash in case a description list is in a table.. --- doc/source/conf.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 83cecc917ea8..09770535b698 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -178,15 +178,28 @@ def setup(app): } # Additional stuff for the LaTeX preamble. -latex_preamble = r''' -\usepackage{amsmath} -\DeclareUnicodeCharacter{00A0}{\nobreakspace} - +latex_elements['preamble'] = r''' % In the parameters section, place a newline after the Parameters % header \usepackage{expdlist} \let\latexdescription=\description \def\description{\latexdescription{}{} \breaklabel} +% but expdlist old LaTeX package requires fixes: +% 1) remove extra space +\usepackage{etoolbox} +\makeatletter +\patchcmd\@item{{\@breaklabel} }{{\@breaklabel}}{}{} +\makeatother +% 2) fix bug in expdlist's way of breaking the line after long item label +\makeatletter +\def\breaklabel{% + \def\@breaklabel{% + \leavevmode\par + % now a hack because Sphinx inserts \leavevmode after term node + \def\leavevmode{\def\leavevmode{\unhbox\voidb@x}}% + }% +} +\makeatother % Make Examples/etc section headers smaller and more compact \makeatletter From f343dc0e5cf9eca84abc427277c7784b980637f6 Mon Sep 17 00:00:00 2001 From: jfbu Date: Mon, 2 Dec 2019 20:34:49 +0100 Subject: [PATCH 2/3] [DOC] LaTeX: do PDF build with --halt-on-error option --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 3c32cb811943..74272fa50db6 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -217,7 +217,7 @@ latex-build: generate mkdir -p build/latex build/doctrees $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex $(FILES) $(PYTHON) postprocess.py tex build/latex/*.tex - perl -pi -e 's/\t(latex.*|pdflatex) (.*)/\t-$$1 -interaction batchmode $$2/' build/latex/Makefile + perl -pi -e 's/LATEXOPTS =/LATEXOPTS ?= --halt-on-error/' build/latex/Makefile @echo @echo "Build finished; the LaTeX files are in build/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ From aed6f9b38b8785c4b583fef13fb9f391d73b69d0 Mon Sep 17 00:00:00 2001 From: jfbu Date: Wed, 4 Dec 2019 09:56:46 +0100 Subject: [PATCH 3/3] Update LaTeX build instructions --- doc/source/docs/howto_build_docs.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/source/docs/howto_build_docs.rst b/doc/source/docs/howto_build_docs.rst index 6deacda5cc93..f46070d78147 100644 --- a/doc/source/docs/howto_build_docs.rst +++ b/doc/source/docs/howto_build_docs.rst @@ -5,7 +5,7 @@ Building the NumPy API and reference docs ========================================= We currently use Sphinx_ for generating the API and reference -documentation for NumPy. You will need Sphinx 1.8.3 <= 1.8.5. +documentation for NumPy. You will need Sphinx >= 2.0.0. If you only want to get the documentation, note that pre-built versions can be found at @@ -57,7 +57,9 @@ To build the PDF documentation, do instead:: make latex make -C build/latex all-pdf -You will need to have Latex installed for this. +You will need to have Latex installed for this, inclusive of support for +Greek letters. For example, on Ubuntu xenial ``texlive-lang-greek`` and +``cm-super`` are needed. Also ``latexmk`` is needed on non-Windows systems. Instead of the above, you can also do::