Skip to content

Commit ed812d0

Browse files
committed
Unbreak pycbf.pdf generation, use pdflatex instead of latex and dvipdfm
Remove unused LaTeX output; out-of-sync pycbf.toc may interfere with LaTeX. Escape underscores in text mode and do not use minipage for long listings. A container must have LaTeX (texlive-latex-recommended in Ubuntu) in order to build pycbf.pdf.
1 parent 0eea7c0 commit ed812d0

26 files changed

+142
-3188
lines changed

CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ if(CBF_ENABLE_FORTRAN)
308308
endif()
309309
endif()
310310

311+
option(CBF_ENABLE_DOC "Build documentation" OFF)
311312
option(CBF_ENABLE_ULP "Enable ULP" OFF)
312313

313314
set (CBF_CMAKE_DEBUG "ON")
@@ -1054,6 +1055,24 @@ if(CBF_ENABLE_PYTHON)
10541055
TARGETS pycbf
10551056
COMPONENT "Runtime"
10561057
DESTINATION "${Python_SITEARCH}")
1058+
1059+
if(CBF_ENABLE_DOC)
1060+
find_program(PDFLATEX pdflatex REQUIRED)
1061+
add_custom_command(
1062+
OUTPUT "pycbf.pdf"
1063+
COMMAND "${PDFLATEX}"
1064+
-interaction batchmode
1065+
-output-directory "${CMAKE_CURRENT_BINARY_DIR}"
1066+
"pycbf.tex"
1067+
COMMAND "${PDFLATEX}"
1068+
-interaction batchmode
1069+
-output-directory "${CMAKE_CURRENT_BINARY_DIR}"
1070+
"pycbf.tex"
1071+
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/pycbf/pycbf.tex"
1072+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/pycbf")
1073+
add_custom_target(pdf ALL
1074+
DEPENDS "pycbf.pdf")
1075+
endif()
10571076
endif()
10581077

10591078

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ $(PY2CBF)/pycbf_testfelaxes.py \
19031903
$(PY2CBF)/xmas/readmarheader.py \
19041904
$(PY2CBF)/xmas/xmasheaders.py \
19051905
$(PY2CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
1906-
(cd $(PY2CBF); $(NUWEB) pycbf.w )
1906+
(cd $(PY2CBF); $(NUWEB) -t pycbf )
19071907

19081908
$(PY2CBF)/_py2cbf.$(PY2CBFEXT): $(PY2CBF) shared \
19091909
$(PY2CBF)/py2setup.py \
@@ -1933,11 +1933,11 @@ $(LIB)/_py2cbf.$(PY2CBFEXT): $(PY2CBF)/_py2cbf.$(PY2CBFEXT)
19331933

19341934
$(PY2CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
19351935
(cd $(PY2CBF); \
1936-
$(NUWEB) pycbf; \
1937-
latex pycbf; \
1938-
$(NUWEB) pycbf; \
1939-
latex pycbf; \
1940-
dvipdfm pycbf )
1936+
$(NUWEB) -o pycbf; \
1937+
pdflatex -interaction batchmode pycbf; \
1938+
pdflatex -interaction batchmode pycbf; \
1939+
$(NUWEB) -o pycbf; \
1940+
pdflatex -interaction batchmode pycbf )
19411941

19421942
$(PY2CBF)/CBFlib.txt: $(DOC)/CBFlib.html
19431943
links -dump $(DOC)/CBFlib.html > $(PY2CBF)/CBFlib.txt
@@ -1973,7 +1973,7 @@ $(PY3CBF)/pycbf_testfelaxes.py \
19731973
$(PY3CBF)/xmas/readmarheader.py \
19741974
$(PY3CBF)/xmas/xmasheaders.py \
19751975
$(PY3CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
1976-
(cd $(PY3CBF); $(NUWEB) pycbf.w )
1976+
(cd $(PY3CBF); $(NUWEB) -t pycbf )
19771977

19781978

19791979
$(PY3CBF)/_pycbf.$(PY3CBFEXT): $(PY3CBF) shared \
@@ -2004,11 +2004,11 @@ $(LIB)/_pycbf.$(PY3CBFEXT): $(PY3CBF)/_pycbf.$(PY3CBFEXT)
20042004

20052005
$(PY3CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
20062006
(cd $(PY3CBF); \
2007-
$(NUWEB) pycbf; \
2008-
latex pycbf; \
2009-
$(NUWEB) pycbf; \
2010-
latex pycbf; \
2011-
dvipdfm pycbf )
2007+
$(NUWEB) -o pycbf; \
2008+
pdflatex -interaction batchmode pycbf; \
2009+
pdflatex -interaction batchmode pycbf; \
2010+
$(NUWEB) -o pycbf; \
2011+
pdflatex -interaction batchmode pycbf )
20122012

20132013
$(PY3CBF)/CBFlib.txt: $(DOC)/CBFlib.html
20142014
links -dump $(DOC)/CBFlib.html > $(PY3CBF)/CBFlib.txt

Makefile_LINUX

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ $(PY2CBF)/pycbf_testfelaxes.py \
18991899
$(PY2CBF)/xmas/readmarheader.py \
19001900
$(PY2CBF)/xmas/xmasheaders.py \
19011901
$(PY2CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
1902-
(cd $(PY2CBF); $(NUWEB) pycbf.w )
1902+
(cd $(PY2CBF); $(NUWEB) -t pycbf )
19031903

19041904
$(PY2CBF)/_py2cbf.$(PY2CBFEXT): $(PY2CBF) shared \
19051905
$(PY2CBF)/py2setup.py \
@@ -1929,11 +1929,11 @@ $(LIB)/_py2cbf.$(PY2CBFEXT): $(PY2CBF)/_py2cbf.$(PY2CBFEXT)
19291929

19301930
$(PY2CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
19311931
(cd $(PY2CBF); \
1932-
$(NUWEB) pycbf; \
1933-
latex pycbf; \
1934-
$(NUWEB) pycbf; \
1935-
latex pycbf; \
1936-
dvipdfm pycbf )
1932+
$(NUWEB) -o pycbf; \
1933+
pdflatex -interaction batchmode pycbf; \
1934+
pdflatex -interaction batchmode pycbf; \
1935+
$(NUWEB) -o pycbf; \
1936+
pdflatex -interaction batchmode pycbf )
19371937

19381938
$(PY2CBF)/CBFlib.txt: $(DOC)/CBFlib.html
19391939
links -dump $(DOC)/CBFlib.html > $(PY2CBF)/CBFlib.txt
@@ -1969,7 +1969,7 @@ $(PY3CBF)/pycbf_testfelaxes.py \
19691969
$(PY3CBF)/xmas/readmarheader.py \
19701970
$(PY3CBF)/xmas/xmasheaders.py \
19711971
$(PY3CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
1972-
(cd $(PY3CBF); $(NUWEB) pycbf.w )
1972+
(cd $(PY3CBF); $(NUWEB) -t pycbf )
19731973

19741974

19751975
$(PY3CBF)/_pycbf.$(PY3CBFEXT): $(PY3CBF) shared \
@@ -2000,11 +2000,11 @@ $(LIB)/_pycbf.$(PY3CBFEXT): $(PY3CBF)/_pycbf.$(PY3CBFEXT)
20002000

20012001
$(PY3CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
20022002
(cd $(PY3CBF); \
2003-
$(NUWEB) pycbf; \
2004-
latex pycbf; \
2005-
$(NUWEB) pycbf; \
2006-
latex pycbf; \
2007-
dvipdfm pycbf )
2003+
$(NUWEB) -o pycbf; \
2004+
pdflatex -interaction batchmode pycbf; \
2005+
pdflatex -interaction batchmode pycbf; \
2006+
$(NUWEB) -o pycbf; \
2007+
pdflatex -interaction batchmode pycbf )
20082008

20092009
$(PY3CBF)/CBFlib.txt: $(DOC)/CBFlib.html
20102010
links -dump $(DOC)/CBFlib.html > $(PY3CBF)/CBFlib.txt

Makefile_MINGW

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ $(PY2CBF)/pycbf_testfelaxes.py \
19131913
$(PY2CBF)/xmas/readmarheader.py \
19141914
$(PY2CBF)/xmas/xmasheaders.py \
19151915
$(PY2CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
1916-
(cd $(PY2CBF); $(NUWEB) pycbf.w )
1916+
(cd $(PY2CBF); $(NUWEB) -t pycbf )
19171917

19181918
$(PY2CBF)/_py2cbf.$(PY2CBFEXT): $(PY2CBF) shared \
19191919
$(PY2CBF)/py2setup.py \
@@ -1943,11 +1943,11 @@ $(LIB)/_py2cbf.$(PY2CBFEXT): $(PY2CBF)/_py2cbf.$(PY2CBFEXT)
19431943

19441944
$(PY2CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
19451945
(cd $(PY2CBF); \
1946-
$(NUWEB) pycbf; \
1947-
latex pycbf; \
1948-
$(NUWEB) pycbf; \
1949-
latex pycbf; \
1950-
dvipdfm pycbf )
1946+
$(NUWEB) -o pycbf; \
1947+
pdflatex -interaction batchmode pycbf; \
1948+
pdflatex -interaction batchmode pycbf; \
1949+
$(NUWEB) -o pycbf; \
1950+
pdflatex -interaction batchmode pycbf )
19511951

19521952
$(PY2CBF)/CBFlib.txt: $(DOC)/CBFlib.html
19531953
links -dump $(DOC)/CBFlib.html > $(PY2CBF)/CBFlib.txt
@@ -1983,7 +1983,7 @@ $(PY3CBF)/pycbf_testfelaxes.py \
19831983
$(PY3CBF)/xmas/readmarheader.py \
19841984
$(PY3CBF)/xmas/xmasheaders.py \
19851985
$(PY3CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
1986-
(cd $(PY3CBF); $(NUWEB) pycbf.w )
1986+
(cd $(PY3CBF); $(NUWEB) -t pycbf )
19871987

19881988

19891989
$(PY3CBF)/_pycbf.$(PY3CBFEXT): $(PY3CBF) shared \
@@ -2014,11 +2014,11 @@ $(LIB)/_pycbf.$(PY3CBFEXT): $(PY3CBF)/_pycbf.$(PY3CBFEXT)
20142014

20152015
$(PY3CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
20162016
(cd $(PY3CBF); \
2017-
$(NUWEB) pycbf; \
2018-
latex pycbf; \
2019-
$(NUWEB) pycbf; \
2020-
latex pycbf; \
2021-
dvipdfm pycbf )
2017+
$(NUWEB) -o pycbf; \
2018+
pdflatex -interaction batchmode pycbf; \
2019+
pdflatex -interaction batchmode pycbf; \
2020+
$(NUWEB) -o pycbf; \
2021+
pdflatex -interaction batchmode pycbf )
20222022

20232023
$(PY3CBF)/CBFlib.txt: $(DOC)/CBFlib.html
20242024
links -dump $(DOC)/CBFlib.html > $(PY3CBF)/CBFlib.txt

Makefile_MSYS2

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,7 @@ $(PY2CBF)/pycbf_testfelaxes.py \
18981898
$(PY2CBF)/xmas/readmarheader.py \
18991899
$(PY2CBF)/xmas/xmasheaders.py \
19001900
$(PY2CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
1901-
(cd $(PY2CBF); $(NUWEB) pycbf.w )
1901+
(cd $(PY2CBF); $(NUWEB) -t pycbf )
19021902

19031903
$(PY2CBF)/_py2cbf.$(PY2CBFEXT): $(PY2CBF) shared \
19041904
$(PY2CBF)/py2setup.py \
@@ -1928,11 +1928,11 @@ $(LIB)/_py2cbf.$(PY2CBFEXT): $(PY2CBF)/_py2cbf.$(PY2CBFEXT)
19281928

19291929
$(PY2CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
19301930
(cd $(PY2CBF); \
1931-
$(NUWEB) pycbf; \
1932-
latex pycbf; \
1933-
$(NUWEB) pycbf; \
1934-
latex pycbf; \
1935-
dvipdfm pycbf )
1931+
$(NUWEB) -o pycbf; \
1932+
pdflatex -interaction batchmode pycbf; \
1933+
pdflatex -interaction batchmode pycbf; \
1934+
$(NUWEB) -o pycbf; \
1935+
pdflatex -interaction batchmode pycbf )
19361936

19371937
$(PY2CBF)/CBFlib.txt: $(DOC)/CBFlib.html
19381938
links -dump $(DOC)/CBFlib.html > $(PY2CBF)/CBFlib.txt
@@ -1968,7 +1968,7 @@ $(PY3CBF)/pycbf_testfelaxes.py \
19681968
$(PY3CBF)/xmas/readmarheader.py \
19691969
$(PY3CBF)/xmas/xmasheaders.py \
19701970
$(PY3CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
1971-
(cd $(PY3CBF); $(NUWEB) pycbf.w )
1971+
(cd $(PY3CBF); $(NUWEB) -t pycbf )
19721972

19731973

19741974
$(PY3CBF)/_pycbf.$(PY3CBFEXT): $(PY3CBF) shared \
@@ -1999,11 +1999,11 @@ $(LIB)/_pycbf.$(PY3CBFEXT): $(PY3CBF)/_pycbf.$(PY3CBFEXT)
19991999

20002000
$(PY3CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
20012001
(cd $(PY3CBF); \
2002-
$(NUWEB) pycbf; \
2003-
latex pycbf; \
2004-
$(NUWEB) pycbf; \
2005-
latex pycbf; \
2006-
dvipdfm pycbf )
2002+
$(NUWEB) -o pycbf; \
2003+
pdflatex -interaction batchmode pycbf; \
2004+
pdflatex -interaction batchmode pycbf; \
2005+
$(NUWEB) -o pycbf; \
2006+
pdflatex -interaction batchmode pycbf )
20072007

20082008
$(PY3CBF)/CBFlib.txt: $(DOC)/CBFlib.html
20092009
links -dump $(DOC)/CBFlib.html > $(PY3CBF)/CBFlib.txt

Makefile_OSX

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,7 +1895,7 @@ $(PY2CBF)/pycbf_testfelaxes.py \
18951895
$(PY2CBF)/xmas/readmarheader.py \
18961896
$(PY2CBF)/xmas/xmasheaders.py \
18971897
$(PY2CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
1898-
(cd $(PY2CBF); $(NUWEB) pycbf.w )
1898+
(cd $(PY2CBF); $(NUWEB) -t pycbf )
18991899

19001900
$(PY2CBF)/_py2cbf.$(PY2CBFEXT): $(PY2CBF) shared \
19011901
$(PY2CBF)/py2setup.py \
@@ -1925,11 +1925,11 @@ $(LIB)/_py2cbf.$(PY2CBFEXT): $(PY2CBF)/_py2cbf.$(PY2CBFEXT)
19251925

19261926
$(PY2CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
19271927
(cd $(PY2CBF); \
1928-
$(NUWEB) pycbf; \
1929-
latex pycbf; \
1930-
$(NUWEB) pycbf; \
1931-
latex pycbf; \
1932-
dvipdfm pycbf )
1928+
$(NUWEB) -o pycbf; \
1929+
pdflatex -interaction batchmode pycbf; \
1930+
pdflatex -interaction batchmode pycbf; \
1931+
$(NUWEB) -o pycbf; \
1932+
pdflatex -interaction batchmode pycbf )
19331933

19341934
$(PY2CBF)/CBFlib.txt: $(DOC)/CBFlib.html
19351935
links -dump $(DOC)/CBFlib.html > $(PY2CBF)/CBFlib.txt
@@ -1965,7 +1965,7 @@ $(PY3CBF)/pycbf_testfelaxes.py \
19651965
$(PY3CBF)/xmas/readmarheader.py \
19661966
$(PY3CBF)/xmas/xmasheaders.py \
19671967
$(PY3CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
1968-
(cd $(PY3CBF); $(NUWEB) pycbf.w )
1968+
(cd $(PY3CBF); $(NUWEB) -t pycbf )
19691969

19701970

19711971
$(PY3CBF)/_pycbf.$(PY3CBFEXT): $(PY3CBF) shared \
@@ -1996,11 +1996,11 @@ $(LIB)/_pycbf.$(PY3CBFEXT): $(PY3CBF)/_pycbf.$(PY3CBFEXT)
19961996

19971997
$(PY3CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
19981998
(cd $(PY3CBF); \
1999-
$(NUWEB) pycbf; \
2000-
latex pycbf; \
2001-
$(NUWEB) pycbf; \
2002-
latex pycbf; \
2003-
dvipdfm pycbf )
1999+
$(NUWEB) -o pycbf; \
2000+
pdflatex -interaction batchmode pycbf; \
2001+
pdflatex -interaction batchmode pycbf; \
2002+
$(NUWEB) -o pycbf; \
2003+
pdflatex -interaction batchmode pycbf )
20042004

20052005
$(PY3CBF)/CBFlib.txt: $(DOC)/CBFlib.html
20062006
links -dump $(DOC)/CBFlib.html > $(PY3CBF)/CBFlib.txt

m4/Makefile.m4

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,7 @@ $(PY2CBF)/pycbf_testfelaxes.py \
22662266
$(PY2CBF)/xmas/readmarheader.py \
22672267
$(PY2CBF)/xmas/xmasheaders.py \
22682268
$(PY2CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
2269-
(cd $(PY2CBF); $(NUWEB) pycbf.w )
2269+
(cd $(PY2CBF); $(NUWEB) -t pycbf )
22702270

22712271
$(PY2CBF)/_py2cbf.$(PY2CBFEXT): $(PY2CBF) shared \
22722272
$(PY2CBF)/py2setup.py \
@@ -2296,11 +2296,11 @@ $(LIB)/_py2cbf.$(PY2CBFEXT): $(PY2CBF)/_py2cbf.$(PY2CBFEXT)
22962296

22972297
$(PY2CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
22982298
(cd $(PY2CBF); \
2299-
$(NUWEB) pycbf; \
2300-
latex pycbf; \
2301-
$(NUWEB) pycbf; \
2302-
latex pycbf; \
2303-
dvipdfm pycbf )
2299+
$(NUWEB) -o pycbf; \
2300+
pdflatex -interaction batchmode pycbf; \
2301+
pdflatex -interaction batchmode pycbf; \
2302+
$(NUWEB) -o pycbf; \
2303+
pdflatex -interaction batchmode pycbf )
23042304

23052305
$(PY2CBF)/CBFlib.txt: $(DOC)/CBFlib.html
23062306
links -dump $(DOC)/CBFlib.html > $(PY2CBF)/CBFlib.txt
@@ -2336,7 +2336,7 @@ $(PY3CBF)/pycbf_testfelaxes.py \
23362336
$(PY3CBF)/xmas/readmarheader.py \
23372337
$(PY3CBF)/xmas/xmasheaders.py \
23382338
$(PY3CBF)/xmas/xmas_cif_template.cif &: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
2339-
(cd $(PY3CBF); $(NUWEB) pycbf.w )
2339+
(cd $(PY3CBF); $(NUWEB) -t pycbf )
23402340

23412341

23422342
$(PY3CBF)/_pycbf.$(PY3CBFEXT): $(PY3CBF) shared \
@@ -2367,11 +2367,11 @@ $(LIB)/_pycbf.$(PY3CBFEXT): $(PY3CBF)/_pycbf.$(PY3CBFEXT)
23672367

23682368
$(PY3CBF)/pycbf.pdf: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
23692369
(cd $(PY3CBF); \
2370-
$(NUWEB) pycbf; \
2371-
latex pycbf; \
2372-
$(NUWEB) pycbf; \
2373-
latex pycbf; \
2374-
dvipdfm pycbf )
2370+
$(NUWEB) -o pycbf; \
2371+
pdflatex -interaction batchmode pycbf; \
2372+
pdflatex -interaction batchmode pycbf; \
2373+
$(NUWEB) -o pycbf; \
2374+
pdflatex -interaction batchmode pycbf )
23752375

23762376
$(PY3CBF)/CBFlib.txt: $(DOC)/CBFlib.html
23772377
links -dump $(DOC)/CBFlib.html > $(PY3CBF)/CBFlib.txt

0 commit comments

Comments
 (0)