From 128814a838037a92a75d9e632cc3f1650ebdb351 Mon Sep 17 00:00:00 2001 From: Rodrigo Coacci Date: Thu, 18 Aug 2022 12:45:49 -0300 Subject: [PATCH] Add EPUB output option. Simple epub ebook format generation using tex4ebook, alongside PDF. The config file is necessary for correct image sizing. --- Makefile | 8 ++++++-- ebook.cfg | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 ebook.cfg diff --git a/Makefile b/Makefile index 9aaa8e1..a269af2 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ TEX=\ $(T)/lock2.tex\ $(T)/sum.tex\ -all: book.pdf +all: book.pdf book.epub .PHONY: all src clean $(T)/%.tex: %.tex | src @@ -36,9 +36,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) diff --git a/ebook.cfg b/ebook.cfg new file mode 100644 index 0000000..1dc74c6 --- /dev/null +++ b/ebook.cfg @@ -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 \ No newline at end of file