Skip to content

A simple and modern LaTeX theme which can be used with pandoc

Notifications You must be signed in to change notification settings

randombenj/modern-latex-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modern LaTeX pdf theme

build

An opinionated modern latex pdf theme for university notes/papers:

Title page Typographic elements Images
title typographics images

Examples of the theme are built and published as releases. Have a look at the example builds.

Installation

You can simply install the latex theme like this:

# install required dependencies
sudo apt install --yes texlive-base \
  texlive-bibtex-extra \
  texlive-binaries \
  texlive-extra-utils \
  texlive-font-utils \
  texlive-fonts-recommended \
  texlive-formats-extra \
  texlive-lang-english \
  texlive-lang-european \
  texlive-lang-german \
  texlive-latex-base \
  texlive-latex-extra \
  texlive-latex-recommended \
  texlive-luatex \
  texlive-pictures \
  texlive-generic-extra \
  texlive-fonts-extra \
  python-pygments
  

# install the template
git clone git@github.com:randombenj/modern-latex-theme.git
sudo cp modern-latex-theme/modern.cls /usr/local/share/texmf/tex/latex/
mktexlsr

If you want to use this theme with pandoc install it like this:

mkdir -p ~/.pandoc/templates
cp modern-latex-theme/latex.template ~/.pandoc/templates

Use from Source

If you don't want to install the theme you need to set the TEXINPUTS environment variable to the location the modern.cls file is in:

git clone git@github.com:randombenj/modern-latex-theme.git
export TEXINPUTS="$(pwd)/modern-latex-theme/:$TEXINPUTS"

Use with selfhosted overleaf

Have a look here: https://github.com/randombenj/modern-latex-theme-overleaf

Write docs

You can use the template in your LaTeX document and build like this:

\documentclass{modern}

\begin{document}

...

\end{document}
lualatex -interaction=nonstopmode -halt-on-error -shell-escape [FILE.tex]

To generate a pdf with pandoc, for example from a markdown file simply run the following command:

pandoc \
  --template=latex.template \
  --pdf-engine=lualatex \
  --pdf-engine-opt="-shell-escape" \
  -o [OUTPUT.pdf] [INPUT.md]