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

Add EPUB output option. #31

Open
wants to merge 2 commits into
base: xv6-riscv
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ T=latex.out
TEX=$(wildcard $(T)/*.tex)
SPELLTEX=$(wildcard *.tex)

all: book.pdf
all: book.pdf book.epub
.PHONY: all src clean

$(T)/%.tex: %.tex | src
Expand All @@ -26,9 +26,13 @@ book.pdf: src book.tex $(TEX)
pdflatex book.tex
pdflatex book.tex

book.epub: src book.tex $(TEX) ebook.cfg book.pdf
ebb -x fig/*.pdf
tex4ebook -c ebook.cfg book.tex

clean:
rm -f book.aux book.idx book.ilg book.ind book.log\
book.toc book.bbl book.blg book.out
book.toc book.bbl book.blg book.out book.epub
rm -rf latex.out
rm -rf $(SRC)

Expand Down
10 changes: 10 additions & 0 deletions ebook.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

% Snippet from https://tex.stackexchange.com/a/563314
\Preamble{xhtml}
\makeatletter
\ExplSyntaxOn
\Configure{Gin-dim}{style="width:\fp_eval:n{round(\Gin@req@width/\textwidth*100,2)}\char_generate:nn { `\% } { 12 }"}
\ExplSyntaxOff
\makeatother
\begin{document}
\EndPreamble