Skip to content
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

pdf: insert cover #65

Merged
merged 2 commits into from
Oct 4, 2023
Merged
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
12 changes: 10 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with: {fetch-depth: 0}
- uses: actions/setup-python@v4
with: {python-version: '3.x'}
Expand Down Expand Up @@ -43,9 +43,17 @@ jobs:
#jupyter-book build --builder linkcheck --warningiserror --nitpick --keep-going .
jupyter-book build --builder dirhtml --warningiserror --nitpick --keep-going .
jupyter-book build --builder latex .
# insert PDF cover
cd _build/latex
curl -fsSLO https://static.premai.io/book/cover.pdf
sed -i -r \
-e 's/(\\usepackage\{geometry\})/\1\n\\usepackage\{pdfpages\}/' \
-e 's/\\sphinxmaketitle/\\includepdf\[pages=-\]\{cover.pdf\}\n\\maketitle/' \
-e 's/\\sphinxtableofcontents//' \
book.tex
env:
PYTHONPATH: .
- uses: xu-cheng/latex-action@v2
- uses: xu-cheng/latex-action@v3
with:
working_directory: _build/latex
root_file: book.tex
Expand Down
Loading