This set of scripts and templates provides a simple workflow for converting LaTeX projects into ePUB files.
If you need to sync content from LaTeX with ebook, this project gives you a template to start with. The content is developed in LaTeX, converted into Markdown, and next into ePub format. This enables you to produce high-quality PDF version and eBook version a the same time, and to control the structure of the resulting ebook.
- Perl for converting LaTeX into Markdown, takes care of translating LaTeX commands into MD and needs to know what command it has to convert.
- Pandoc for converting Markdown into ePub.
- Pybtex for convering BibTeX into Markdown if you need fancy bibliographies.
- Bash for running the scripts.
The scripts were testes and used under:
- Ubuntu 18.04, with Pandoc 2.5 and Perl 5.
- Ubuntu 20.04, with Pandoc 2.11 and Perl 5.30.
Converions from LaTeX into eBook requires running
./latex2epub.sh metadata
in the ebook
directory. You can alter latexDir
and resEbook
in this file
to point to your source LaTeX files and resultig ePub.
List of files processed by latex2epub.sh
is in files.txt
.
Image used as a ePub cover is defined in metadata.yaml
.
Markdown directory contains some files needed during the conversion.
files.txt
- list of LaTeX files (without extension) used to produce Markdown. This list is also used to assemble ePub, hence it should be ordered according to the desired order of chapters in the final ebook.metadata.yaml
- metadata used by Pandoc to produce ePub. You need to consult https://pandoc.org/MANUAL.html for more info.