Skip to content

Instantly share code, notes, and snippets.

@shahinism
Created March 18, 2019 15:03
Show Gist options
  • Save shahinism/94f01b1b2662a54eb9b700531d2b6f68 to your computer and use it in GitHub Desktop.
Save shahinism/94f01b1b2662a54eb9b700531d2b6f68 to your computer and use it in GitHub Desktop.
Convert .epub documents to eye friendly PDF
\usepackage[Latin,Mathematics,NumberForms,Punctuation,Symbols]{ucharclasses}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Georgia}
\setsansfont[Ligatures=TeX]{Georgia}
\newfontfamily{\mydefaultfont}{Symbola}
\newfontfamily{\mymainfont}{Georgia}
\setTransitionsForSymbols{\mydefaultfont}{\mymainfont}
\setTransitionsFor{NumberForms}{\mydefaultfont}{\mymainfont}
\setTransitionsForMathematics{\mydefaultfont}{\mymainfont}
\setTransitionTo{Punctuation}{\mymainfont}
\setTransitionTo{Latin}{\mymainfont}
#!/bin/bash
pandoc -s -t latex \
--toc \
--top-level-division=chapter \
--top-level-division=chapter \
-V geometry:margin=1in \
-V fontsize:16pt \
-V documentclass:scrbook \
-V classoption:oneside \
--include-in-header=header.tex \
--pdf-engine=xelatex \
"$1" \
-o "${1%.*}.pdf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment