Skip to content

Commit e13bac4

Browse files
authored
[CI] Update to build pdf using pdflatex (#47)
* enable cache, and pdflatex builds * update file name for latex * [test] remove lectures that contain ipywidgets * prepare publish for building LaTeX * upgrade jupyter-book to 0.11.2 which is required for latex improvements
1 parent dcaa8fc commit e13bac4

File tree

4 files changed

+42
-38
lines changed

4 files changed

+42
-38
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
python-version: 3.8
1616
environment-file: environment.yml
1717
activate-environment: quantecon
18-
# - name: Install latex dependencies
19-
# run: |
20-
# sudo apt-get -qq update
21-
# sudo apt-get install -y \
22-
# texlive-latex-recommended \
23-
# texlive-latex-extra \
24-
# texlive-fonts-recommended \
25-
# texlive-fonts-extra \
26-
# texlive-xetex \
27-
# latexmk \
28-
# xindy
18+
- name: Install latex dependencies
19+
run: |
20+
sudo apt-get -qq update
21+
sudo apt-get install -y \
22+
texlive-latex-recommended \
23+
texlive-latex-extra \
24+
texlive-fonts-recommended \
25+
texlive-fonts-extra \
26+
texlive-xetex \
27+
latexmk \
28+
xindy
2929
- name: Display Conda Environment Versions
3030
shell: bash -l {0}
3131
run: conda list
@@ -40,12 +40,12 @@ jobs:
4040
name: build-cache
4141
path: _build
4242
# Build Assets (Download Notebooks and PDF via LaTeX)
43-
# - name: Build PDF from LaTeX
44-
# shell: bash -l {0}
45-
# run: |
46-
# jb build lectures --builder pdflatex --path-output ./ -n --keep-going
47-
# mkdir -p _build/html/_pdf
48-
# cp -u _build/latex/*.pdf _build/html/_pdf
43+
- name: Build PDF from LaTeX
44+
shell: bash -l {0}
45+
run: |
46+
jb build lectures --builder pdflatex --path-output ./ -n --keep-going
47+
mkdir -p _build/html/_pdf
48+
cp -u _build/latex/*.pdf _build/html/_pdf
4949
- name: Build Download Notebooks (sphinx-tojupyter)
5050
shell: bash -l {0}
5151
run: |

.github/workflows/publish.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ jobs:
1919
python-version: 3.8
2020
environment-file: environment.yml
2121
activate-environment: quantecon
22-
# - name: Install latex dependencies
23-
# run: |
24-
# sudo apt-get -qq update
25-
# sudo apt-get install -y \
26-
# texlive-latex-recommended \
27-
# texlive-latex-extra \
28-
# texlive-fonts-recommended \
29-
# texlive-fonts-extra \
30-
# texlive-xetex \
31-
# latexmk \
32-
# xindy
22+
- name: Install latex dependencies
23+
run: |
24+
sudo apt-get -qq update
25+
sudo apt-get install -y \
26+
texlive-latex-recommended \
27+
texlive-latex-extra \
28+
texlive-fonts-recommended \
29+
texlive-fonts-extra \
30+
texlive-xetex \
31+
latexmk \
32+
xindy
3333
- name: Display Conda Environment Versions
3434
shell: bash -l {0}
3535
run: conda list
@@ -44,15 +44,15 @@ jobs:
4444
name: build-cache
4545
path: _build
4646
# Build Assets (Download Notebooks and PDF via LaTeX)
47-
# - name: Build PDF from LaTeX
48-
# shell: bash -l {0}
49-
# run: |
50-
# jb build lectures --builder pdflatex --path-output ./ -n --keep-going
51-
# - name: Copy LaTeX PDF for GH-PAGES
52-
# shell: bash -l {0}
53-
# run: |
54-
# mkdir -p _build/html/_pdf
55-
# cp -u _build/latex/*.pdf _build/html/_pdf
47+
- name: Build PDF from LaTeX
48+
shell: bash -l {0}
49+
run: |
50+
jb build lectures --builder pdflatex --path-output ./ -n --keep-going
51+
- name: Copy LaTeX PDF for GH-PAGES
52+
shell: bash -l {0}
53+
run: |
54+
mkdir -p _build/html/_pdf
55+
cp -u _build/latex/*.pdf _build/html/_pdf
5656
- name: Build Download Notebooks (sphinx-tojupyter)
5757
shell: bash -l {0}
5858
run: |

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- anaconda=2020.11
77
- pip
88
- pip:
9-
- jupyter-book==0.11.1
9+
- jupyter-book==0.11.2
1010
- sphinx-multitoc-numbering==0.1.3
1111
- quantecon-book-theme==0.2.5
1212
- sphinx-tojupyter==0.1.2

lectures/_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ bibtex_bibfiles:
1313
html:
1414
baseurl: https://python-advanced.quantecon.org/
1515

16+
latex:
17+
latex_documents:
18+
targetname: quantecon-python-advanced.tex
19+
1620
sphinx:
1721
extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_tojupyter]
1822
config:

0 commit comments

Comments
 (0)