Skip to content

[pdflatex] Enable book style build of PDF via LaTeX #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ jobs:
python-version: 3.8
environment-file: environment.yml
activate-environment: quantecon
- name: Install latex dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-recommended \
texlive-fonts-extra \
texlive-xetex \
latexmk \
xindy
- name: Display Conda Environment Versions
shell: bash -l {0}
run: conda list
Expand All @@ -28,6 +39,20 @@ jobs:
branch: main
name: build-cache
path: _build
# Build Assets (Download Notebooks and PDF via LaTeX)
- name: Build PDF from LaTeX
shell: bash -l {0}
run: |
jb build lectures --builder pdflatex --path-output ./ -n --keep-going
mkdir -p _build/html/_pdf
cp -u _build/latex/*.pdf _build/html/_pdf
- name: Build Download Notebooks (sphinx-tojupyter)
shell: bash -l {0}
run: |
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter
mkdir -p _build/html/_notebooks
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
# Build HTML (Website)
- name: Build HTML
shell: bash -l {0}
run: |
Expand Down
30 changes: 26 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,33 @@ jobs:
python-version: 3.8
environment-file: environment.yml
activate-environment: quantecon
- name: Install latex dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-recommended \
texlive-fonts-extra \
texlive-xetex \
latexmk \
xindy
- name: Display Conda Environment Versions
shell: bash -l {0}
run: conda list
- name: Display Pip Versions
shell: bash -l {0}
run: pip list
- name: Build HTML
# Build Assets (Download Notebooks and PDF via LaTeX)
- name: Build PDF from LaTeX
shell: bash -l {0}
run: |
jb build lectures --path-output ./
jb build lectures --builder pdflatex --path-output ./ -n --keep-going
- name: Copy LaTeX PDF for GH-PAGES
shell: bash -l {0}
run: |
mkdir _build/html/_pdf
cp _build/latex/*.pdf _build/html/_pdf
- name: Build Download Notebooks (sphinx-tojupyter)
shell: bash -l {0}
run: |
Expand All @@ -41,8 +58,13 @@ jobs:
- name: Copy Download Notebooks for GH-PAGES
shell: bash -l {0}
run: |
mkdir _build/html/_notebooks
cp _build/jupyter/*.ipynb _build/html/_notebooks
mkdir -p _build/html/_notebooks
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
# Build HTML (Website)
- name: Build HTML
shell: bash -l {0}
run: |
jb build lectures --path-output ./
- name: Deploy website to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions lectures/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ bibtex_bibfiles:
html:
baseurl: https://python.quantecon.org/

latex:
latex_documents:
targetname: quantecon-python.tex

sphinx:
extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_tojupyter]
config:
Expand Down