Skip to content

Instantly share code, notes, and snippets.

@tommyvn
Last active March 12, 2019 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommyvn/58d7c89b3afe879e791f6b7d4df1069e to your computer and use it in GitHub Desktop.
Save tommyvn/58d7c89b3afe879e791f6b7d4df1069e to your computer and use it in GitHub Desktop.
pandoc variable tex
pandoc --template test.tex --variable NAME=tom --variable checkedvar -o test.pdf /dev/null
\documentclass{article}
\usepackage{enumitem}
\usepackage{wasysym}
\newlist{todolist}{itemize}{2}
\setlist[todolist]{label=\Square}
\def\true{true}
\def\checkbox#1{
\def\temp{#1}
\ifx \temp\true
\CheckedBox
\else
\Square
\fi
}
\begin{document}
Hello $NAME$!
\begin{todolist}
\item[\checkbox{$checkedvar$}] checked
\item[\checkbox{$notcheckedvar$}] not checked
\end{todolist}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment