-
Notifications
You must be signed in to change notification settings - Fork 0
/
pandoc-template.tex
121 lines (102 loc) · 3.02 KB
/
pandoc-template.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
%! Author = avime
%! Name = template.tex
%! Project = tex
%! Date = 12/31/2020
% For use in pandoc
\documentclass[12pt,letterpaper]{article}
$if(pset)$
\usepackage[links,theorem,thmboxed,footnote]{avimehra}
$elseif(worksheet)$
\usepackage[page,links,theorem,thmboxed,header,footer,$if(wide)$thin,$endif$$if(footnote)$footnote$endif$]{avimehra}
$elseif(default-style)$
\usepackage[page,links,theorem,thmboxed,$if(wide)$thin,$endif$$if(footnote)$footnote$endif$]{avimehra}
$endif$
$if(title)$
\title{$title$$if(subtitle)$\\\large{$subtitle$}$endif$}
$endif$
$if(author)$
\author{$author$}
$endif$
$if(date)$
\date{$date$}
$endif$
$if(graphics)$
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
$if(figure-here)$
% Place figure htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
$endif$
$endif$
$if(highlighting-macros)$
$highlighting-macros$
$endif$
$if(listings)$
\usepackage{listings}
\newcommand{\passthrough}[1]{#1}
\lstset{defaultdialect=[5.3]Lua}
\lstset{defaultdialect=[x86masm]Assembler}
$endif$
$for(package)$
$if(package.name)$
$if(package.options)$
\usepackage[$package.options$]{$package.name$}
$else$
\usepackage{$package.name$}
$endif$
$else$
\usepackage{$package$}
$endif$
$endfor$
$header-includes$
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
$if(csl-refs)$
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
% set entry spacing
\ifnum #2 > 0
\setlength{\parskip}{#2\baselineskip}
\fi
}%
{}
\usepackage{calc}
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$
\begin{document}
$if(title)$
\maketitle
$endif$
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$
$if(toc)$
\tableofcontents
$elseif(table-of-contents)$
\tableofcontents
$endif$
$if(prompt)$
\bluebf{$prompt$}
$endif$
$body$
\end{document}