|
6 | 6 | To build the docs you must have all optional dependencies for pandas
|
7 | 7 | installed. See the installation instructions for a list of these.
|
8 | 8 |
|
9 |
| -Note: currently latex builds do not work because of table formats that are not |
10 |
| -supported in the latex generation. |
| 9 | +<del>Note: currently latex builds do not work because of table formats that are not |
| 10 | +supported in the latex generation.</del> |
| 11 | +
|
| 12 | +2014-01-30: Latex has some issues but 'latex_forced' works ok for 0.13.0-400 or so |
11 | 13 |
|
12 | 14 | Usage
|
13 | 15 | -----
|
@@ -134,7 +136,33 @@ def latex():
|
134 | 136 |
|
135 | 137 | # Call the makefile produced by sphinx...
|
136 | 138 | if os.system('make'):
|
137 |
| - raise SystemExit("Rendering LaTeX failed.") |
| 139 | + print("Rendering LaTeX failed.") |
| 140 | + print("You may still be able to get a usable PDF file by going into 'build/latex'") |
| 141 | + print("and executing 'pdflatex pandas.tex' for the requisite number of passes.") |
| 142 | + print("Or using the 'latex_forced' target") |
| 143 | + raise SystemExit |
| 144 | + |
| 145 | + os.chdir('../..') |
| 146 | + else: |
| 147 | + print('latex build has not been tested on windows') |
| 148 | + |
| 149 | +def latex_forced(): |
| 150 | + check_build() |
| 151 | + if sys.platform != 'win32': |
| 152 | + # LaTeX format. |
| 153 | + if os.system('sphinx-build -b latex -d build/doctrees ' |
| 154 | + 'source build/latex'): |
| 155 | + raise SystemExit("Building LaTeX failed.") |
| 156 | + # Produce pdf. |
| 157 | + |
| 158 | + os.chdir('build/latex') |
| 159 | + |
| 160 | + # Manually call pdflatex, 3 passes should ensure latex fixes up |
| 161 | + # all the required cross-references and such. |
| 162 | + os.system('pdflatex -interaction=nonstopmode pandas.tex') |
| 163 | + os.system('pdflatex -interaction=nonstopmode pandas.tex') |
| 164 | + os.system('pdflatex -interaction=nonstopmode pandas.tex') |
| 165 | + raise SystemExit("You should check the file 'build/latex/pandas.pdf' for problems.") |
138 | 166 |
|
139 | 167 | os.chdir('../..')
|
140 | 168 | else:
|
@@ -257,6 +285,7 @@ def _get_config():
|
257 | 285 | 'upload_dev_pdf': upload_dev_pdf,
|
258 | 286 | 'upload_stable_pdf': upload_stable_pdf,
|
259 | 287 | 'latex': latex,
|
| 288 | + 'latex_forced': latex_forced, |
260 | 289 | 'clean': clean,
|
261 | 290 | 'auto_dev': auto_dev_build,
|
262 | 291 | 'auto_debug': lambda: auto_dev_build(True),
|
|
0 commit comments