Created
July 21, 2022 13:39
-
-
Save RicardoEPRodrigues/78cc435c5e4847ebda5711240690da73 to your computer and use it in GitHub Desktop.
From Latex to Epub with Pandoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script makes use of Pandoc (https://pandoc.org/) to convert from Latex to Epub | |
# While interesting, this solution does require further work on the Latex document. Here follows some suggestions: | |
# | |
# (1) Change document class to memoir. \documentclass{memoir} | |
# (2) Simple figures compile just fine, but subfigures and more complex solutions will be ignored. Convert complex solutions into simple, multiple figures to fix this. | |
# (3) The same applies to tables. Only very simple tables will be rendered. My suggestion is to take a high-resolution screenshot of the table and use a figure instead. | |
set -e | |
set -x | |
SOURCE_FILE="main.tex" | |
TARGET_FILE="output.epub" | |
BIBLIOGRAPHY="references.bib" | |
pandoc --bibliography=${BIBLIOGRAPHY} --filter=pandoc-citeproc -s ${SOURCE_FILE} -o ${TARGET_FILE} --metadata link-citations=true --metadata link-bibliography=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment