Skip to content

Commit 96f0670

Browse files
Render the book in PDF using pandoc and LaTeX. (mainmatter#126)
* Render the book in PDF using `pandoc` and LaTeX. * Fix installs. * Go the apt-get route * Another attempt * Avoid installing twice. * Re-order. * Add more packages. * Minimise deps. Fix link checker. * Missing package. * Missing package. * Missing package. * More packages. * Missing package. * Missing package. * More packages... * Remove. * Fix link checker. * Fix link checker. * Fix path. * Add subtitle. * Avoid running over the right margin. * Avoid running over the right margin. * Formatting
1 parent e732ea8 commit 96f0670

File tree

25 files changed

+401
-213
lines changed

25 files changed

+401
-213
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,47 @@ jobs:
1818
- uses: actions-rust-lang/setup-rust-toolchain@v1
1919
- name: Install plugin
2020
run: cargo install --path helpers/mdbook-exercise-linker
21+
- name: Install mdbook-pandoc and related dependencies
22+
run: |
23+
cargo install mdbook-pandoc --locked --version 0.7.1
24+
sudo apt-get update
25+
sudo apt-get install -y fonts-noto
26+
27+
export PANDOC_VERSION=3.3
28+
curl -LsSf https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz | tar zxf -
29+
echo "$PWD/pandoc-${PANDOC_VERSION}/bin" >> $GITHUB_PATH
30+
shell: bash
31+
- name: Setup TeX Live
32+
uses: teatimeguest/setup-texlive-action@v3
33+
with:
34+
packages:
35+
scheme-basic
36+
luatex
37+
lualatex-math
38+
luacolor
39+
luatexbase
40+
luaotfload
41+
framed
42+
unicode-math
43+
xcolor
44+
geometry
45+
longtable
46+
booktabs
47+
array
48+
lua-ul
49+
etoolbox
50+
fancyvrb
51+
footnote
52+
selnolig
53+
natbib
54+
csquotes
55+
bookmark
56+
xurl
57+
amsmath
58+
setspace
59+
iftex
60+
- name: Check `tlmgr` version
61+
run: tlmgr --version
2162
- uses: taiki-e/install-action@v2
2263
with:
2364
tool: mdbook
@@ -33,12 +74,19 @@ jobs:
3374
--exclude-loopback
3475
--require-https
3576
--no-progress
36-
book/book
37-
# Upload the book as an artifact
77+
book/book/html/
78+
# Upload the HTML book as an artifact
3879
- uses: actions/upload-artifact@v4
3980
with:
4081
name: book
41-
path: book/book
82+
# When you support multiple formats, the output directory changes
83+
# to include the format in its path.
84+
path: book/book/html
85+
# Upload the PDF book as an artifact
86+
- uses: actions/upload-artifact@v4
87+
with:
88+
name: paperback
89+
path: book/book/pandoc/pdf/100-exercises-to-learn-rust.pdf
4290

4391
formatter:
4492
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)