summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2016-11-06 12:02:47 +1100
committerChris Johns <chrisj@rtems.org>2016-11-06 12:02:47 +1100
commit8330198edc3ec08021f358c3030266194278c5a2 (patch)
treedfab1a147e46f0bc95abfd1d75863da52c1c4e15
parentwaf: note about tex noise when running configure. (diff)
downloadrtems-docs-8330198edc3ec08021f358c3030266194278c5a2.tar.bz2
waf: Add support to handle missing Latex packages on hosts they are not available on.
It appears the support for texlive packages on some hosts is variable. This patch lets us add missing packages to our source tree so a PDF can be built on those hosts. The quality of the PDFs created may vary as some short cuts may have been take. For example lato is a font and only the sty file as been added and not the actual font which means it's use will default to another font.
-rw-r--r--common/latex.py145
-rw-r--r--common/latex/capt-of.sty33
-rw-r--r--common/latex/environ.sty145
-rw-r--r--common/latex/eqparbox.sty280
-rw-r--r--common/latex/ifplatform.sty151
-rw-r--r--common/latex/inconsolata.sty92
-rw-r--r--common/latex/lato.sty47
-rw-r--r--common/latex/slantsc.sty101
-rw-r--r--common/latex/trimspaces.sty58
-rw-r--r--common/latex/upquote.sty40
-rw-r--r--common/waf.py116
11 files changed, 1113 insertions, 95 deletions
diff --git a/common/latex.py b/common/latex.py
new file mode 100644
index 0000000..186a64f
--- /dev/null
+++ b/common/latex.py
@@ -0,0 +1,145 @@
+#
+# Support for Latex used to build the PDF output format.
+#
+
+import os
+import platform
+import re
+
+package_test_preamble = ['\\newif\\ifsphinxKeepOldNames \\sphinxKeepOldNamestrue',
+ '\documentclass[a4paper,11pt,english]{report}']
+package_test_postamble = ['\\begin{document} test \\end{document}']
+package_tests = {
+ 'Bjarne' : ['\\usepackage[Bjarne]{fncychap}'],
+ 'alltt' : ['\\usepackage{alltt}'],
+ 'amsmath' : ['\\usepackage{amsmath}'],
+ 'amssymb' : ['\\usepackage{amssymb}'],
+ 'amstext' : ['\\usepackage{amstext}'],
+ 'array' : ['\\usepackage{array}'],
+ 'atbegshi' : ['\\usepackage{atbegshi}'],
+ 'babel' : ['\\usepackage{babel}'],
+ 'babel' : ['\\usepackage{babel}'],
+ 'calc' : ['\\usepackage{calc}'],
+ 'capt-of' : ['\\usepackage{capt-of}'],
+ 'charter' : ['\\usepackage{charter}'],
+ 'cmap' : ['\\usepackage{cmap}'],
+ 'color' : ['\\usepackage{color}'],
+ 'eqparbox' : ['\\usepackage{eqparbox}'],
+ 'etoolbox' : ['\\usepackage{etoolbox}'],
+ 'fancybox' : ['\\usepackage{fancybox}'],
+ 'fancyhdr' : ['\\usepackage{fancyhdr}'],
+ 'fancyvrb' : ['\\usepackage{fancyvrb}'],
+ 'float' : ['\\usepackage{float}'],
+ 'fncychap' : ['\\usepackage{fncychap}'],
+ 'fontenc' : ['\\usepackage[T1]{fontenc}'],
+ 'footnote' : ['\\usepackage{footnote}'],
+ 'framed' : ['\\usepackage{framed}'],
+ 'graphicx' : ['\\usepackage{graphicx}'],
+ 'hypcap' : ['\\usepackage{hyperref}',
+ '\\usepackage{hypcap}'],
+ 'hyperref' : ['\\usepackage{hyperref}'],
+ 'ifplatform' : ['\\usepackage{ifplatform}'],
+ 'ifthen' : ['\\usepackage{ifthen}'],
+ 'inconsolata' : ['\\usepackage{inconsolata}'],
+ 'inputenc' : ['\\usepackage{inputenc}'],
+ 'keyval' : ['\\usepackage{keyval}'],
+ 'kvoptions' : ['\\usepackage{kvoptions}'],
+ 'lato' : ['\\usepackage{lato}'],
+ 'lineno' : ['\\usepackage{lineno}'],
+ 'longtable' : ['\\usepackage{longtable}'],
+ 'makeidx' : ['\\usepackage{makeidx}'],
+ 'multirow' : ['\\usepackage{multirow}'],
+ 'parskip' : ['\\usepackage{parskip}'],
+ 'pdftexcmds' : ['\\usepackage{pdftexcmds}'],
+ 'textcomp' : ['\\usepackage{textcomp}'],
+ 'threeparttable' : ['\\usepackage{threeparttable}'],
+ 'times' : ['\\usepackage{times}'],
+ 'titlesec' : ['\\usepackage{titlesec}'],
+ 'upquote' : ['\\usepackage{upquote}'],
+ 'utf8' : ['\\usepackage[utf8]{inputenc}'],
+ 'wrapfig' : ['\\usepackage{wrapfig}'],
+ 'xcolor' : ['\\usepackage{xcolor}'],
+ 'xstring' : ['\\usepackage{xstring}'],
+}
+
+#
+# Add per host support. If there is a version clash for the same texlive
+# package create a directory, add to that directory and use the path in this
+# name here.
+#
+hosts = {
+ # All versions of CentOS until told otherwise
+ 'Linux/centos' : { '.*' : ['capt-of.sty',
+ 'eqparbox.sty',
+ 'environ.sty',
+ 'inconsolata.sty',
+ 'ifplatform.sty',
+ 'lato.sty',
+ 'trimspaces.sty',
+ 'slantsc.sty',
+ 'upquote.sty'] }
+}
+
+def tex_test(test):
+ return os.linesep.join(package_test_preamble +
+ package_tests[test] +
+ package_test_postamble)
+
+def host_name():
+ uname = os.uname()
+ if uname[0] == 'Linux':
+ distro = platform.dist()
+ name = '%s/%s' % (uname[0], distro[0])
+ version = distro[1]
+ else:
+ name = uname[0]
+ version = uname[2]
+ return name, version
+
+def local_packages():
+ host, version = host_name()
+ packages = None
+ if host in hosts:
+ for version in list(hosts[host].keys()):
+ if re.compile(version).match(version) is not None:
+ packages = hosts[host][version]
+ return packages
+
+def configure_tests(conf):
+
+ #
+ # Using a hint from ita (thank you) :
+ # https://github.com/waf-project/waf/blob/master/demos/tex/wscript
+ #
+ def build_latex_test(bld):
+ def write_tex_test(tsk):
+ tsk.outputs[0].write(tex_test(tsk.env.TEST))
+
+ test = bld.kw['tex_test']
+ bld.env.TEST = test
+
+ bld.to_log('%s.tex %s' % (test, '=' * (40 - len(test) + 5)))
+ bld.to_log(tex_test(test))
+ bld.to_log('=' * 40)
+
+ bld(rule = write_tex_test, target = 'main.tex')
+ bld(features = 'tex', type = 'pdflatex', source = 'main.tex', prompt = 0)
+
+ tests = sorted(package_tests.keys())
+ excludes = [p[:p.rfind('.')] for p in local_packages()]
+ for e in excludes:
+ if e in tests:
+ tests.remove(e)
+
+ fails = 0
+ for t in tests:
+ r = conf.test(build_fun = build_latex_test,
+ msg = "Checking for Tex package '%s'" % (t),
+ tex_test = t,
+ okmsg = 'ok',
+ errmsg = 'not found (please install)',
+ mandatory = False)
+ if r is None:
+ fails += 1
+ if fails > 0:
+ conf.fatal('There are %d Tex package failures. Please fix.' % (fails))
diff --git a/common/latex/capt-of.sty b/common/latex/capt-of.sty
new file mode 100644
index 0000000..b40978a
--- /dev/null
+++ b/common/latex/capt-of.sty
@@ -0,0 +1,33 @@
+%%
+%% This is file `capt-of.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% capt-of.dtx (with options: `package')
+%% ----------------------------------------------------------------------
+%% The capt-off package -- float-style captions outside of floats
+%% Copyright (c) 2010 Robin Fairbairns
+%%
+%% This work may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License, either version 1.3c of this license or (at
+%% your option) any later version. The latest version of this license is in:
+%% http://www.latex-project.org/lppl.txt, and version 1.3c or later is part
+%% of all distributions of LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of the files capt-of.dtx, capt-of.ins, and README
+%% and the derived files footmisc.sty (not distributed from the archive)
+%% and footmisc.pdf.
+%% -----------------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{capt-of}%
+ [2009/12/29 v0.2
+ standard captions outside of floats%
+ ]% $Id: footmisc.dtx,v 4.20 2005/03/17 13:41:58 rf Exp rf10 $
+\newcommand\captionof[1]{\def\@captype{#1}\caption}
+\endinput
+%%
+%% End of file `capt-of.sty'.
diff --git a/common/latex/environ.sty b/common/latex/environ.sty
new file mode 100644
index 0000000..8cf854b
--- /dev/null
+++ b/common/latex/environ.sty
@@ -0,0 +1,145 @@
+%%
+%% This is file `environ.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% environ.dtx (with options: `package')
+%%
+%% __________________________________
+%% Copyright (C) 2007 Will Robertson
+%%
+%% License information appended.
+%%
+%% ^^A Test that \RenewEnvironment works correctly:
+\ProvidesPackage{environ}[2014/05/04 v0.3 A new way to define environments]
+\RequirePackage{trimspaces}
+\def\environbodyname#1{\def\env@BODY{#1}}
+\environbodyname\BODY
+\def\environfinalcode#1{%
+ \def\env@finalcode{#1}}
+\environfinalcode{\ignorespacesafterend}
+\def\longdef@c#1{%
+ \expandafter\long\expandafter\def\csname#1\endcsname}
+\unless\ifdefined\collect@body
+ \newtoks\@envbody
+ \def\collect@body#1{%
+ \@envbody{\expandafter#1\expandafter{\the\@envbody}}%
+ \edef\process@envbody{\the\@envbody\noexpand\end{\@currenvir}}%
+ \@envbody={}%
+ \def\begin@stack{b}%
+ \begingroup
+ \expandafter\let\csname\@currenvir\endcsname\collect@@body
+ \edef\process@envbody{%
+ \expandafter\noexpand\csname\@currenvir\endcsname}%
+ \process@envbody
+ }
+ \def\push@begins#1\begin#2{%
+ \ifx\end#2\else
+ b\expandafter\push@begins
+ \fi}
+ \def\addto@envbody#1{%
+ \global\@envbody\expandafter{\the\@envbody#1}}
+ \def\collect@@body#1\end#2{%
+ \edef\begin@stack{%
+ \push@begins#1\begin\end \expandafter\@gobble\begin@stack}%
+ \ifx\@empty\begin@stack
+ \endgroup
+ \@checkend{#2}%
+ \addto@envbody{#1}%
+ \else
+ \addto@envbody{#1\end{#2}}%
+ \fi
+ \process@envbody}
+\fi
+\long\def\Collect@Body#1{%
+ \@envbody{\expandafter#1\expandafter{\the\@envbody}}%
+ \edef\process@envbody{\the\@envbody\noexpand\end{\@currenvir}}%
+ \@envbody={}%
+ \def\begin@stack{b}%
+ \begingroup
+ \expandafter\let\csname\@currenvir\endcsname\Collect@@Body
+ \edef\process@envbody{%
+ \expandafter\noexpand\csname\@currenvir\endcsname}%
+ \process@envbody
+}
+\long\def\Push@Begins#1\begin#2{%
+ \ifx\end#2\else
+ b\expandafter\Push@Begins
+ \fi}
+\long\def\Addto@Envbody#1{%
+ \global\@envbody\expandafter{\the\@envbody#1}}
+\long\def\Collect@@Body#1\end#2{%
+ \edef\begin@stack{%
+ \Push@Begins#1\begin\end\expandafter\@gobble\begin@stack}%
+ \ifx\@empty\begin@stack
+ \endgroup
+ \@checkend{#2}%
+ \Addto@Envbody{#1}%
+ \else
+ \Addto@Envbody{#1\end{#2}}%
+ \fi
+ \process@envbody}
+\def\NewEnviron{%
+ \let\env@newenvironment\newenvironment
+ \env@NewEnviron}
+\def\RenewEnviron{%
+ \let\env@newenvironment\renewenvironment
+ \env@NewEnviron}
+\def\env@NewEnviron#1{%
+ \@ifnextchar[
+ {\env@new@i{#1}}
+ {\env@new@iii{#1}{}}}
+\def\env@new@i#1[#2]{%
+ \@ifnextchar[
+ {\env@new@ii{#1}[#2]}
+ {\env@new@iii{#1}{[#2]}}}
+\def\env@new@ii#1[#2][#3]{%
+ \env@new@iii{#1}{[#2][#3]}}
+\long\def\env@new@iii#1#2#3{%
+ \@temptokena={\env@new{#1}{#2}{#3}}%
+ \@ifnextchar[{%
+ \the\@temptokena
+ }{%
+ \expandafter\the\expandafter
+ \@temptokena\expandafter[\env@finalcode]%
+ }}
+\long\def\env@new#1#2#3[#4]{%
+ \longdef@c{env@#1@BODY\expandafter}\expandafter{\env@BODY}%
+ \env@newenvironment{#1}{%
+ \expandafter\Collect@Body\csname env@#1@parse\endcsname
+ }{#4}%
+ \longdef@c{env@#1@parse}##1{%
+ \csname env@#1@save@env\endcsname##1\env@nil
+ \csname env@#1@process\endcsname##1\env@nil}%
+ \expandafter\let\csname env@#1@save@env\endcsname\relax
+ \expandafter\let\csname env@#1@process\endcsname\relax
+ \expandafter\newcommand
+ \csname env@#1@save@env\endcsname#2{%
+ \expandafter\expandafter\expandafter
+ \env@save\csname env@#1@BODY\endcsname}%
+ \expandafter\newcommand
+ \csname env@#1@process\endcsname#2{#3\env@ignore}%
+}
+\long\def\env@save#1#2\env@nil{%
+ \edef#1{%
+ \unexpanded\expandafter
+ \expandafter\expandafter{\trim@spaces{#2}}}}
+\long\def\env@ignore#1\env@nil{}
+%%
+%% Copyright (C) 2007-2014 by Will Robertson <wspr81@gmail.com>
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "maintained" (as per LPPL maintenance status)
+%% by Will Robertson.
+%%
+%% This work consists of the file environ.dtx
+%% and the derived files environ.pdf,
+%% environ.sty, and
+%% environ.ins.
+%%
+%%
+%% End of file `environ.sty'.
diff --git a/common/latex/eqparbox.sty b/common/latex/eqparbox.sty
new file mode 100644
index 0000000..2f9749c
--- /dev/null
+++ b/common/latex/eqparbox.sty
@@ -0,0 +1,280 @@
+%%
+%% This is file `eqparbox.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% eqparbox.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2013 Scott Pakin <scott+eqp@pakin.org>
+%% -------------------------------------------------------
+%%
+%% This package may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.2
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{eqparbox}
+ [2013/03/15 v4.0 Create equal-widthed boxes]
+\newlength{\eqp@tempdima}
+\newlength{\eqp@tempdimb}
+\def\eqp@taglist{}
+\newif\ifeqp@must@rerun
+\RequirePackage{array}
+\newsavebox{\eqp@tabular@box}
+\newsavebox{\eqp@list@box}
+\newlength{\eqp@list@indent}
+\RequirePackage{environ}
+\newcommand*{\eqp@storefont}{%
+ \xdef\eqp@restorefont{%
+ \noexpand\usefont{\f@encoding}{\f@family}{\f@series}{\f@shape}%
+ \noexpand\fontsize{\f@size}{\f@baselineskip}%
+ \noexpand\selectfont
+ }%
+}
+\newcommand{\eqp@settowidth}[2]{%
+ \begingroup
+ \global\setbox\eqp@tabular@box=\hbox{%
+ \def\eqp@endings{}%
+ \ifx\enditemize\endlist
+ \g@addto@macro\eqp@endings{\let\enditemize=\endlist}%
+ \fi
+ \ifx\endenumerate\endlist
+ \g@addto@macro\eqp@endings{\let\endenumerate=\endlist}%
+ \fi
+ \ifx\enddescription\endlist
+ \g@addto@macro\eqp@endings{\let\enddescription=\endlist}%
+ \fi
+ \renewenvironment{list}[2]{%
+ \ifnum \@listdepth >5\relax
+ \@toodeep
+ \else
+ \global\advance\@listdepth\@ne
+ \fi
+ \rightmargin\z@
+ \listparindent\z@
+ \itemindent\z@
+ \csname @list\romannumeral\the\@listdepth\endcsname
+ ##2\relax
+ \renewcommand*{\item}[1][]{%
+ \mbox{}\\
+ \box\eqp@list@box\mbox{} \\
+ \sbox\@tempboxa{\makelabel{####1}}%
+ \ifdim\wd\@tempboxa>\labelwidth
+ \advance\eqp@list@indent by -\labelwidth
+ \advance\eqp@list@indent by \wd\@tempboxa
+ \fi
+ \hspace*{\eqp@list@indent}%
+ }%
+ \hspace*{-\eqp@list@indent}%
+ \advance\eqp@list@indent by \leftmargin
+ \advance\eqp@list@indent by \rightmargin
+ \advance\eqp@list@indent by \itemindent
+ \global\setbox\eqp@list@box=\hbox\bgroup
+ \begin{tabular}{@{}l@{}}%
+ }{%
+ \item[]%
+ \end{tabular}%
+ \egroup
+ \global\advance\@listdepth\m@ne
+ }%
+ \eqp@endings
+ \global\let\eqp@par=\par
+ \eqp@storefont
+ \begin{tabular}{@{}>{\eqp@restorefont}l<{\eqp@storefont}@{}}%
+ \global\@setpar{\\}%
+ #2%
+ \\ \box\eqp@list@box
+ \end{tabular}%
+ \global\@restorepar
+ }%
+ \endgroup
+ \settowidth{#1}{\box\eqp@tabular@box}%
+}
+\long\def\eqp@compute@width#1#2{%
+ \eqp@settowidth{\eqp@tempdimb}{#2}%
+ \@ifundefined{eqp@minwd@#1}{}{%
+ \ifdim\eqp@tempdimb<\csname eqp@minwd@#1\endcsname
+ \eqp@tempdimb=\csname eqp@minwd@#1\endcsname
+ \fi
+ }%
+ \@ifundefined{eqp@maxwd@#1}{}{%
+ \ifdim\eqp@tempdimb>\csname eqp@maxwd@#1\endcsname
+ \eqp@tempdimb=\csname eqp@maxwd@#1\endcsname
+ \fi
+ }%
+ \expandafter
+ \ifx\csname eqp@this@#1\endcsname\relax
+ \global\eqp@must@reruntrue
+ \expandafter\xdef\csname eqp@this@#1\endcsname{\the\eqp@tempdimb}%
+ \expandafter\xdef\csname eqp@next@#1\endcsname{\the\eqp@tempdimb}%
+ \else
+ \eqp@tempdima=\csname eqp@this@#1\endcsname\relax
+ \ifdim\eqp@tempdima<\eqp@tempdimb
+ \expandafter\xdef\csname eqp@this@#1\endcsname{\the\eqp@tempdimb}%
+ \global\eqp@must@reruntrue
+ \fi
+ \eqp@tempdima=\csname eqp@next@#1\endcsname\relax
+ \ifdim\eqp@tempdima<\eqp@tempdimb
+ \expandafter\xdef\csname eqp@next@#1\endcsname{\the\eqp@tempdimb}%
+ \fi
+ \fi
+ \@ifundefined{eqp@seen@#1}{%
+ \expandafter\gdef\csname eqp@seen@#1\endcsname{}%
+ \@cons\eqp@taglist{{#1}}%
+ }{}%
+ \eqp@tempdima=\csname eqp@this@#1\endcsname\relax
+ \eqp@produce@box{\eqp@tempdima}{#2}%
+}
+\DeclareRobustCommand{\eqparbox}{%
+ \@ifnextchar[%]
+ {\eqparbox@i}%
+ {\eqparbox@iii[c][\relax][s]}%
+}
+\def\eqparbox@i[#1]{%
+ \@ifnextchar[%]
+ {\eqparbox@ii[#1]}%
+ {\eqparbox@iii[#1][\relax][s]}%
+}
+\def\eqparbox@ii[#1][#2]{%
+ \@ifnextchar[%]
+ {\eqparbox@iii[#1][#2]}%
+ {\eqparbox@iii[#1][#2][#1]}%
+}
+\def\eqparbox@iii[#1][#2][#3]{%
+ \long\gdef\eqp@produce@box##1##2{%
+ \parbox[#1][#2][#3]{##1}{##2}%
+ }%
+ \eqp@compute@width
+}
+\DeclareRobustCommand{\eqminipage}{%
+ \@ifnextchar[%]
+ {\eqminipage@i}%
+ {\eqminipage@iii[c][\relax][s]}%
+}
+\let\endeqpminipage=\relax
+\long\def\eqminipage@i[#1]{%
+ \@ifnextchar[%]
+ {\eqminipage@ii[#1]}%
+ {\eqminipage@iii[#1][\relax][s]}%
+}
+\def\eqminipage@ii[#1][#2]{%
+ \@ifnextchar[%]
+ {\eqminipage@iii[#1][#2]}%
+ {\eqminipage@iii[#1][#2][#1]}%
+}
+\def\eqminipage@iii[#1][#2][#3]#4{%
+ \long\def\eqminipage@iv##1{%
+ \long\gdef\eqp@produce@box####1####2{%
+ \begin{minipage}[#1][#2][#3]{####1}%
+ ####2%
+ \end{minipage}%
+ }%
+ \eqp@compute@width{#4}{##1}%
+ }%
+ \Collect@Body\eqminipage@iv
+}
+\DeclareRobustCommand{\eqmakebox}{%
+ \@ifnextchar[%]
+ {\eqlrbox@i\makebox}%
+ {\makebox}%
+}
+\DeclareRobustCommand{\eqframebox}{%
+ \@ifnextchar[%]
+ {\eqlrbox@i\framebox}%
+ {\framebox}%
+}
+\DeclareRobustCommand{\eqsavebox}[1]{%
+ \@ifnextchar[%]
+ {\eqlrbox@i{\savebox{#1}}}%
+ {\savebox{#1}}%
+}
+\def\eqlrbox@i#1[#2]{%
+ \@ifnextchar[%]
+ {\eqlrbox@ii{#1}[#2]}%
+ {\eqlrbox@ii{#1}[#2][c]}%
+}
+\def\eqlrbox@ii#1[#2][#3]{%
+ \long\gdef\eqp@produce@box##1##2{%
+ #1[##1][#3]{##2}%
+ }%
+ \eqp@compute@width{#2}%
+}
+\newcommand*{\eqboxwidth}[1]{%
+ \@ifundefined{eqp@this@#1}{0pt}{\csname eqp@this@#1\endcsname}%
+}
+\newcommand{\eqsetminwidth}[2]{%
+ \@tempdima=#2\relax
+ \expandafter\xdef\csname eqp@minwd@#1\endcsname{\the\@tempdima}%
+}
+\newcommand{\eqsetmaxwidth}[2]{%
+ \@tempdima=#2\relax
+ \expandafter\xdef\csname eqp@maxwd@#1\endcsname{\the\@tempdima}%
+}
+\newcommand{\eqsetminwidthto}[2]{%
+ \eqp@settowidth{\@tempdima}{#2}%
+ \expandafter\xdef\csname eqp@minwd@#1\endcsname{\the\@tempdima}%
+}
+\newcommand{\eqsetmaxwidthto}[2]{%
+ \eqp@settowidth{\@tempdima}{#2}%
+ \expandafter\xdef\csname eqp@maxwd@#1\endcsname{\the\@tempdima}%
+}
+\AtEndDocument{%
+ \begingroup
+ \def\@elt#1{%
+ \@ifundefined{eqp@minwd@#1}{}{%
+ \@ifundefined{eqp@maxwd@#1}{}{%
+ \ifdim\csname eqp@minwd@#1\endcsname>\csname eqp@maxwd@#1\endcsname
+ \PackageWarning{eqparbox}{For tag `#1',
+ minimum width (\csname eqp@minwd@#1\endcsname) >
+ maximum width (\csname eqp@maxwd@#1\endcsname)}%
+ \fi
+ }%
+ }%
+ \eqp@tempdima\csname eqp@this@#1\endcsname\relax
+ \eqp@tempdimb\csname eqp@next@#1\endcsname\relax
+ \ifdim\eqp@tempdima=\eqp@tempdimb
+ \else
+ \@latex@warning@no@line{Rerun to correct the width of eqparbox `#1'}%
+ \fi
+ \immediate\write\@auxout{%
+ \string\expandafter\string\gdef\string\csname\space
+ eqp@this@#1\string\endcsname{%
+ \csname eqp@next@#1\endcsname
+ }%
+ ^^J%
+ \string\expandafter\string\gdef\string\csname\space
+ eqp@next@#1\string\endcsname{0pt}%
+ }%
+ \@ifundefined{eqp@minwd@#1}{}{%
+ \immediate\write\@auxout{%
+ \string\expandafter\string\gdef\string\csname\space
+ eqp@minwd@#1\string\endcsname{%
+ \csname eqp@minwd@#1\endcsname
+ }%
+ }%
+ }%
+ \@ifundefined{eqp@maxwd@#1}{}{%
+ \immediate\write\@auxout{%
+ \string\expandafter\string\gdef\string\csname\space
+ eqp@maxwd@#1\string\endcsname{%
+ \csname eqp@maxwd@#1\endcsname
+ }%
+ }%
+ }%
+ }%
+ \eqp@taglist
+ \endgroup
+ \ifeqp@must@rerun
+ \@latex@warning@no@line{Rerun to correct eqparbox widths}
+ \fi
+}
+\endinput
+%%
+%% End of file `eqparbox.sty'.
diff --git a/common/latex/ifplatform.sty b/common/latex/ifplatform.sty
new file mode 100644
index 0000000..7f59f61
--- /dev/null
+++ b/common/latex/ifplatform.sty
@@ -0,0 +1,151 @@
+%%
+%% This is file `ifplatform.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ifplatform.dtx (with options: `package')
+%% ________________________________________________________
+%% Copyright (C) 2007-2010 Will Robertson & Johannes Große
+%% License information appended.
+\ProvidesPackage{ifplatform}
+ [2010/10/22 v0.4 Testing for the operating system]
+\RequirePackage{pdftexcmds,catchfile,ifluatex}
+\newif\ifshellescape
+\newif\ifwindows
+\newif\ifmacosx
+\newif\iflinux
+\newif\ifcygwin
+\newcommand\windowsname{Windows}
+\newcommand\notwindowsname{*NIX}
+\newcommand\linuxname{Linux}
+\newcommand\macosxname{Mac\,OS\,X}
+\newcommand\cygwinname{Cygwin}
+\newcommand\unknownplatform{[Unknown]}
+\edef\ip@file{\jobname.w18}
+\newif\if@ip@nix@
+\ifnum\pdf@shellescape=1\relax
+ \shellescapetrue
+\else
+ \ifluatex\else
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ shell escape is disabled,
+ so I can only detect \@backslashchar ifwindows%
+ }
+ \fi
+\fi
+\def\ip@cantdecide{%
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ I can't tell if this is Windows or *nix;
+ you appear to be both%
+ }%
+}
+\ifluatex
+ \csname\directlua{
+ if os.type == "unix" then
+ tex.sprint("@ip@nix@true")
+ elseif os.type == "windows" then
+ tex.sprint("windowstrue")
+ end
+ }\endcsname
+\else
+\IfFileExists{nul:}{\@ip@nix@false}{\@ip@nix@true}
+\IfFileExists{/dev/null}{\windowsfalse}{\windowstrue}
+\edef\ip@windows@echo@test{echo \string# > "\ip@file"}
+\def\ip@backupplan{%
+ \IfFileExists{\ip@file}{%
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ Please delete the file "\ip@file" and try again%
+ }%
+ \ip@cantdecide
+ }{%
+ \immediate\write18{\ip@windows@echo@test}%
+ \IfFileExists{\ip@file}{%
+ \immediate\write18{del "\ip@file"}%
+ \windowstrue
+ }{%
+ \@ip@nix@true
+ }%
+ }%
+}
+\ifwindows
+ \if@ip@nix@
+ \PackageWarningNoLine{ifplatform}{^^J \space\space\space
+ I can't tell if this is Windows or *nix;
+ you appear to be neither%
+ }
+ \fi
+\else
+ \if@ip@nix@\else
+ \ifshellescape
+ \ip@backupplan
+ \else
+ \ip@cantdecide
+ \fi
+ \fi
+\fi
+\fi
+\def\ip@only@six#1#2#3#4#5#6#7\@nil{#1#2#3#4#5#6}
+\if@ip@nix@
+\ifshellescape
+ \ifwindows\else
+ \immediate\write18{uname -s > "\ip@file"}
+ \CatchFileDef\@tempa{\ip@file}{}
+ \immediate\write18{rm -- "\ip@file"}
+ \edef\@tempa{\expandafter\zap@space\@tempa\@empty}
+ \def\@tempb{Linux}
+ \ifx\@tempa\@tempb
+ \linuxtrue
+ \else
+ \def\@tempb{Darwin}
+ \ifx\@tempa\@tempb
+ \macosxtrue
+ \else
+ \def\@tempb{CYGWIN}
+ \edef\@tempc{\expandafter\ip@only@six\@tempa------\@nil}
+ \ifx\@tempb\@tempc
+ \cygwintrue
+ \else
+ \edef\unknownplatform{\@tempa}
+ \fi
+ \fi
+ \fi
+ \fi
+\fi\fi
+\edef\platformname{%
+ \ifwindows
+ \noexpand\windowsname
+ \else
+ \ifshellescape
+ \iflinux
+ \noexpand\linuxname
+ \else
+ \ifmacosx
+ \noexpand\macosxname
+ \else
+ \ifcygwin
+ \noexpand\cygwinname
+ \else
+ \noexpand\unknownplatform
+ \fi
+ \fi
+ \fi
+ \else
+ \noexpand\notwindowsname
+ \fi
+ \fi
+}
+%% Copyright (C) 2007-2010 by Will Robertson & Johannes Große
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "author-maintained" by Will Robertson.
+%%
+%% This work consists of the file ifplatform.dtx
+%% and the derived files ifplatform.pdf,
+%% ifplatform.sty, and
+%% ifplatform.ins.
+%%
+%% End of file `ifplatform.sty'.
diff --git a/common/latex/inconsolata.sty b/common/latex/inconsolata.sty
new file mode 100644
index 0000000..aeada49
--- /dev/null
+++ b/common/latex/inconsolata.sty
@@ -0,0 +1,92 @@
+% Copyright 2014 Michael Sharpe
+% Based initially on Karl Berry's inconsolata.sty.
+% You may freely use, modify and/or distribute this file.
+
+\def\fileversion{1.10}
+\def\filedate{2016/02/22}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{inconsolata}[\filedate\space v\fileversion]
+\message{`inconsolata-zi4' v\fileversion, \filedate\space Text macros for Inconsolata (msharpe)}
+
+\RequirePackage{textcomp}
+\RequirePackage{keyval}
+
+\newcount\zifour@ocount
+\newif\ifzifour@altzero
+\newif\ifzifour@noupq
+\define@key{zifour}{scaled}[1.0]{\def\zifour@scaled{s*[#1]}}
+
+\DeclareOption*{%
+ \begingroup
+ \edef\x{\endgroup
+ \noexpand\setkeys{zifour}{\CurrentOption}}%
+ \x}
+
+% by default, change \tt to mean zi4.
+\newcommand*{\zifour@default}{%
+ \renewcommand*{\ttdefault}{zi4}%
+}
+
+% option [nott] to avoid changing tt.
+\DeclareOption{nott}{%
+ \renewcommand*{\zifour@default}{}%
+}
+% option [noupquote] to prevent loading upquote.
+\DeclareOption{noupquote}{%
+ \zifour@noupqtrue}%
+
+% option var0---use unslashed zero (slashed is default)
+\DeclareOption{var0}{%
+ \zifour@altzerotrue\advance\zifour@ocount \tw@ %
+}
+\DeclareOption{varl}{%
+ \advance\zifour@ocount \@ne %
+}
+\DeclareOption{varqu}{%
+ \advance\zifour@ocount 4\relax %
+}
+
+\ProcessOptions*
+\zifour@default
+\edef\zifour@opt{\the\zifour@ocount}
+\ifzifour@altzero
+ \advance\zifour@ocount -\tw@
+\else
+ \advance\zifour@ocount \tw@
+\fi
+\edef\zifour@altopt{\the\zifour@ocount}
+% define an \altzero macro which flips to slashed, unslashed
+\def\altzero{{\fontfamily{zi4}%
+ \fontshape{scit}%
+ \selectfont 0}}
+
+\def\zifour@T@ne@nc{T1}
+\def\zifour@OT@ne@nc{OT1}
+\def\zifour@LY@ne@nc{LY1}
+\def\zifour@QX@nc{QX}
+\def\zifour@TQS{%
+\UndeclareTextCommand{\textquotesingle}{\encodingdefault}
+\DeclareTextSymbol{\textquotesingle}{TS1}{39}}
+
+\ifzifour@noupq% do nothing
+ % Try to correct for wrong slots for QX
+ \ifx\encodingdefault\zifour@QX@nc
+ \zifour@TQS
+ \else
+ \ifx\encodingdefault\zifour@LY@ne@nc
+ \zifour@TQS
+ \fi
+ \fi
+\else
+ \AtBeginDocument{%
+ \ifx\encodingdefault\zifour@T@ne@nc % do nothing
+ \else
+ \ifx\encodingdefault\zifour@OT@ne@nc % do nothing
+ \else
+ \zifour@TQS
+ \fi
+ \fi
+ \usepackage{upquote}}
+\fi
+
+\endinput
diff --git a/common/latex/lato.sty b/common/latex/lato.sty
new file mode 100644
index 0000000..ba947cc
--- /dev/null
+++ b/common/latex/lato.sty
@@ -0,0 +1,47 @@
+%% lato.sty
+%% Copyright 2011 Mohamed El Morabity
+%
+% This work may be distributed and/or modified under the conditions of the LaTeX
+% Project Public License, either version 1.3 of this license or (at your option)
+% any later version. The latest version of this license is in
+% http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all
+% distributions of LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Mohamed El Morabity
+%
+% This work consists of all files listed in manifest.txt.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{lato}[2011/08/06 Lato]
+
+\RequirePackage{keyval}
+\RequirePackage{slantsc}
+
+% Taken from inconsolata.sty
+\define@key{lato}{scale}[1.0]{\def\lato@scale{s*[#1]}}
+\DeclareOption*{%
+ \begingroup%
+ \edef\x{\endgroup%
+ \noexpand\setkeys{lato}{\CurrentOption}}%
+ \x%
+}
+
+\DeclareOption{defaultsans}{%
+ \renewcommand*{\sfdefault}{fla}%
+}
+
+\DeclareOption{default}{%
+ \renewcommand*{\familydefault}{fla}%
+ \renewcommand*{\sfdefault}{fla}%
+}
+
+\ProcessOptions*
+
+\newcommand{\flafamily}{%
+ \fontfamily{fla}%
+ \selectfont%
+}
+
+\endinput
diff --git a/common/latex/slantsc.sty b/common/latex/slantsc.sty
new file mode 100644
index 0000000..d9139f6
--- /dev/null
+++ b/common/latex/slantsc.sty
@@ -0,0 +1,101 @@
+%%
+%% This is file `slantsc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% slantsc.dtx (with options: `package')
+%%
+%% slantsc package
+%%
+%% Copyright 2003, 2012 Harald Harders
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt; either
+%% version 1 of the License, or any later version.
+%%
+%% harald.harders@gmx.de
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{slantsc}
+ [2012/01/01 v2.11 Provide Slanted an Italic Small Caps]
+\RequirePackage{ifthen}
+\DeclareFontFamily{T1}{cmr}{}
+\DeclareFontShape{T1}{cmr}{m}{scsl}%
+{<5><6><7><8><9><10><10.95><12><14.4>%
+ <17.28><20.74><24.88><29.86><35.83>genb*ecsc}{}
+\DeclareFontShape{T1}{cmr}{bx}{scsl}%
+{<5><6><7><8><9><10><10.95><12><14.4>%
+ <17.28><20.74><24.88><29.86><35.83>genb*ecoc}{}
+\DeclareFontShape{T1}{cmr}{m}{scit}{<->ssub * cmr/m/scsl}{}
+\DeclareFontShape{T1}{cmr}{bx}{scit}{<->ssub * cmr/bx/scsl}{}
+\providecommand*\scitdefault{\scdefault\itdefault}
+\providecommand*\scsldefault{\scdefault\sldefault}
+\DeclareRobustCommand\upshape{%
+ \not@math@alphabet\upshape\relax
+ \ifthenelse{\equal{\f@shape}{\scdefault}\or
+ \equal{\f@shape}{\scitdefault}\or\equal{\f@shape}{\scsldefault}}{%
+ \fontshape\scdefault
+ }{%
+ \fontshape\updefault
+ }%
+ \selectfont
+}
+\DeclareRobustCommand\slshape{%
+ \not@math@alphabet\slshape\relax
+ \ifthenelse{\equal{\f@shape}{\scdefault}\or
+ \equal{\f@shape}{\scitdefault}\or\equal{\f@shape}{\scsldefault}}{%
+ \fontshape\scsldefault
+ }{%
+ \fontshape\sldefault
+ }%
+ \selectfont
+}
+\DeclareRobustCommand\itshape{%
+ \not@math@alphabet\itshape\relax
+ \ifthenelse{\equal{\f@shape}{\scdefault}\or
+ \equal{\f@shape}{\scitdefault}\or\equal{\f@shape}{\scsldefault}}{%
+ \fontshape\scitdefault
+ }{%
+ \fontshape\itdefault
+ }%
+ \selectfont
+}
+\DeclareRobustCommand\scshape{%
+ \not@math@alphabet\scshape\relax
+ \ifthenelse{\equal{\f@shape}{\scdefault}\or
+ \equal{\f@shape}{\scitdefault}\or\equal{\f@shape}{\scsldefault}}{%
+ }{%
+ \ifthenelse{\equal{\f@shape}{\itdefault}}{%
+ \fontshape\scitdefault
+ }{%
+ \ifthenelse{\equal{\f@shape}{\sldefault}}{%
+ \fontshape\scsldefault
+ }{%
+ \fontshape\scdefault
+ }%
+ }%
+ }%
+ \selectfont
+}
+\DeclareRobustCommand\noscshape{%
+ \not@math@alphabet\noscshape\relax
+ \ifthenelse{\equal{\f@shape}{\scdefault}\or
+ \equal{\f@shape}{\scitdefault}\or\equal{\f@shape}{\scsldefault}}{%
+ \ifthenelse{\equal{\f@shape}{\scitdefault}}{%
+ \fontshape\itdefault
+ }{%
+ \ifthenelse{\equal{\f@shape}{\scsldefault}}{%
+ \fontshape\sldefault
+ }{%
+ \fontshape\updefault
+ }%
+ }%
+ }{%
+ }%
+ \selectfont
+}
+\endinput
+%%
+%% End of file `slantsc.sty'.
diff --git a/common/latex/trimspaces.sty b/common/latex/trimspaces.sty
new file mode 100644
index 0000000..d576156
--- /dev/null
+++ b/common/latex/trimspaces.sty
@@ -0,0 +1,58 @@
+%% LaTeX2e file `trimspaces.sty'
+%% generated by the `filecontents' environment
+%% from source `trimspaces' on 2016/11/06.
+%%
+\ProvidesPackage{trimspaces}[2009/09/17 v1.1
+ Trim spaces around a token list]
+
+% Trimming surrounding spaces:
+\catcode`\Q=3
+\newcommand\trim@spaces[1]{%
+ \romannumeral-`\q\trim@trim@\noexpand#1Q Q%
+}
+\long\def\trim@trim@#1 Q{\trim@trim@@#1Q}
+\long\def\trim@trim@@#1Q#2{#1}
+\catcode`\Q=11
+
+\newcommand\trim@spaces@noexp[1]{%
+ \unexpanded\expandafter\expandafter\expandafter
+ {\trim@spaces{#1}}%
+}
+
+\newcommand\trim@spaces@in[1]{%
+ \edef#1{\expandafter\trim@spaces@noexp\expandafter{#1}}%
+}
+
+% Trimming preceding spaces:
+\newcommand\trim@pre@space[1]{%
+ \romannumeral-`\.\expandafter\noexpand#1%
+}
+
+\newcommand\trim@pre@space@noexp[1]{%
+ \unexpanded\expandafter{%
+ \romannumeral-`\.\expandafter\noexpand#1%
+ }%
+}
+
+\newcommand\trim@pre@space@in[1]{%
+ \expandafter\def\expandafter#1\expandafter{%
+ \romannumeral-`\.\expandafter\noexpand#1%
+ }%
+}
+
+% Trimming trailing space:
+\catcode`\Q=3
+\newcommand\trim@post@space[1]{\trim@trim@#1Q Q}
+\catcode`\Q=11
+
+\newcommand\trim@post@space@noexp[1]{%
+ \unexpanded\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ {\trim@post@space{#1}}%
+}
+
+\newcommand\trim@post@space@in[1]{%
+ \edef#1{\expandafter\trim@post@space@noexp\expandafter{#1}}%
+}
+
+% That's it.
diff --git a/common/latex/upquote.sty b/common/latex/upquote.sty
new file mode 100644
index 0000000..6b9d754
--- /dev/null
+++ b/common/latex/upquote.sty
@@ -0,0 +1,40 @@
+%%
+%% This is file `upquote.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% upquote.dtx (with options: `package')
+%%
+%% Copyright (C) 2000 by Michael A. Covington
+%% Copyright (C) 2003 by Frank Mittelbach
+%% Copyright (C) 2012 by Markus Kuhn (current maintainer)
+%%
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{upquote}
+ [2012/04/19 v1.3 upright-quote and grave-accent glyphs in verbatim]
+\newcommand\upquote@cmtt{cmtt}
+\newcommand\upquote@OTone{OT1}
+\ifx\encodingdefault\upquote@OTone
+ \ifx\ttdefault\upquote@cmtt\else\RequirePackage{textcomp}\fi
+\else
+ \RequirePackage{textcomp}
+\fi
+\begingroup
+\catcode`'=\active
+\catcode``=\active
+\g@addto@macro\@noligs
+ {\let'\textquotesingle
+ \let`\textasciigrave
+ \ifx\encodingdefault\upquote@OTone
+ \ifx\ttdefault\upquote@cmtt
+ \def'{\char13 }%
+ \def`{\char18 }%
+ \fi\fi}
+\endgroup
+\endinput
+%%
+%% End of file `upquote.sty'.
diff --git a/common/waf.py b/common/waf.py
index 25f3d74..0086be0 100644
--- a/common/waf.py
+++ b/common/waf.py
@@ -1,6 +1,8 @@
import sys, os, re
from waflib.Build import BuildContext
+import latex
+
sphinx_min_version = (1, 3)
def cmd_spell(ctx):
@@ -86,6 +88,23 @@ def build_dir_setup(ctx, buildtype):
doctrees = os.path.join(os.path.dirname(output_dir), 'doctrees', buildtype)
return build_dir, output_node, output_dir, doctrees
+def pdf_resources(ctx, buildtype):
+ local_packages = latex.local_packages()
+ if local_packages is not None:
+ packages_base = ctx.path.parent.find_dir('common/latex')
+ if packages_base is None:
+ ctx.fatal('Latex package directory not found')
+ base = packages_base.path_from(ctx.path)
+ srcs = [os.path.join(base, p) for p in local_packages]
+ fnode = ctx.path.get_bld().make_node(buildtype)
+ fnode.mkdir()
+ ctx(
+ features = "subst",
+ is_copy = True,
+ source = srcs,
+ target = [fnode.make_node(p) for p in local_packages]
+ )
+
def html_resources(ctx, buildtype):
for dir_name in ["_static", "_templates"]:
files = ctx.path.parent.find_node("common").ant_glob("%s/*" % dir_name)
@@ -108,100 +127,6 @@ def html_resources(ctx, buildtype):
# target = [x.srcpath().replace("../", "") for x in files]
# )
-def latex_configure_tests(conf):
-
- #
- # Using a hint from ita (thank you) :
- # https://github.com/waf-project/waf/blob/master/demos/tex/wscript
- #
- latex_test_preamble = ['\\newif\\ifsphinxKeepOldNames \\sphinxKeepOldNamestrue',
- '\documentclass[a4paper,11pt,english]{report}']
- latex_test_postamble = ['\\begin{document} test \\end{document}']
- latex_tests = {
- 'Bjarne' : ['\\usepackage[Bjarne]{fncychap}'],
- 'alltt' : ['\\usepackage{alltt}'],
- 'amsmath' : ['\\usepackage{amsmath}'],
- 'amssymb' : ['\\usepackage{amssymb}'],
- 'amstext' : ['\\usepackage{amstext}'],
- 'array' : ['\\usepackage{array}'],
- 'atbegshi' : ['\\usepackage{atbegshi}'],
- 'babel' : ['\\usepackage{babel}'],
- 'babel' : ['\\usepackage{babel}'],
- 'calc' : ['\\usepackage{calc}'],
- 'capt-of' : ['\\usepackage{capt-of}'],
- 'charter' : ['\\usepackage{charter}'],
- 'cmap' : ['\\usepackage{cmap}'],
- 'color' : ['\\usepackage{color}'],
- 'eqparbox' : ['\\usepackage{eqparbox}'],
- 'etoolbox' : ['\\usepackage{etoolbox}'],
- 'fancybox' : ['\\usepackage{fancybox}'],
- 'fancyhdr' : ['\\usepackage{fancyhdr}'],
- 'fancyvrb' : ['\\usepackage{fancyvrb}'],
- 'float' : ['\\usepackage{float}'],
- 'fncychap' : ['\\usepackage{fncychap}'],
- 'fontenc' : ['\\usepackage[T1]{fontenc}'],
- 'footnote' : ['\\usepackage{footnote}'],
- 'framed' : ['\\usepackage{framed}'],
- 'graphicx' : ['\\usepackage{graphicx}'],
- 'hypcap' : ['\\usepackage{hyperref}',
- '\\usepackage{hypcap}'],
- 'hyperref' : ['\\usepackage{hyperref}'],
- 'ifplatform' : ['\\usepackage{ifplatform}'],
- 'ifthen' : ['\\usepackage{ifthen}'],
- 'inconsolata' : ['\\usepackage{inconsolata}'],
- 'inputenc' : ['\\usepackage{inputenc}'],
- 'keyval' : ['\\usepackage{keyval}'],
- 'kvoptions' : ['\\usepackage{kvoptions}'],
- 'lato' : ['\\usepackage{lato}'],
- 'lineno' : ['\\usepackage{lineno}'],
- 'longtable' : ['\\usepackage{longtable}'],
- 'makeidx' : ['\\usepackage{makeidx}'],
- 'multirow' : ['\\usepackage{multirow}'],
- 'parskip' : ['\\usepackage{parskip}'],
- 'pdftexcmds' : ['\\usepackage{pdftexcmds}'],
- 'textcomp' : ['\\usepackage{textcomp}'],
- 'threeparttable' : ['\\usepackage{threeparttable}'],
- 'times' : ['\\usepackage{times}'],
- 'titlesec' : ['\\usepackage{titlesec}'],
- 'upquote' : ['\\usepackage{upquote}'],
- 'utf8' : ['\\usepackage[utf8]{inputenc}'],
- 'wrapfig' : ['\\usepackage{wrapfig}'],
- 'xcolor' : ['\\usepackage{xcolor}'],
- 'xstring' : ['\\usepackage{xstring}'],
- }
-
- def build_latex_test(bld):
- def create_tex(test_data):
- return os.linesep.join(latex_test_preamble +
- test_data +
- latex_test_postamble)
- def write_tex_test(tsk):
- tex = create_tex(tsk.env.TEST_DATA)
- tsk.outputs[0].write(tex)
-
- test = bld.kw['tex_test']
- bld.env.TEST = test
- bld.env.TEST_DATA = latex_tests[test]
-
- bld.to_log('%s.tex %s' % (test, '=' * (40 - len(test) + 5)))
- bld.to_log(create_tex(latex_tests[test]))
- bld.to_log('=' * 40)
-
- bld(rule = write_tex_test, target = 'main.tex')
- bld(features = 'tex', type = 'pdflatex', source = 'main.tex', prompt = 0)
-
- fails = 0
- for t in sorted(latex_tests.keys()):
- r = conf.test(build_fun = build_latex_test,
- msg = "Checking for Tex package '%s'" % (t),
- tex_test = t,
- okmsg = 'ok',
- errmsg = 'not found (please install)',
- mandatory = False)
- if r is None:
- fails += 1
- if fails > 0:
- conf.fatal('There are %d Tex package failures. Please fix.' % (fails))
def cmd_configure(ctx):
ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD", mandatory = True)
@@ -232,7 +157,7 @@ def cmd_configure(ctx):
if 'PDFLATEXFLAGS' not in ctx.env or \
'-shell-escape' not in ctx.env['PDFLATEXFLAGS']:
ctx.env.append_value('PDFLATEXFLAGS', '-shell-escape')
- latex_configure_tests(ctx)
+ latex.configure_tests(ctx)
else:
ctx.msg('Check for Tex packages', 'skipping, already checked')
ctx.env.BUILD_PDF = 'yes'
@@ -248,6 +173,7 @@ def cmd_configure(ctx):
def doc_pdf(ctx, source_dir, conf_dir):
buildtype = 'latex'
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
+ pdf_resources(ctx, buildtype)
rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s -d %s %s %s" % \
(sphinx_verbose(ctx), buildtype, conf_dir,
doctrees, source_dir, output_dir)