-
Notifications
You must be signed in to change notification settings - Fork 7
/
mint.tex
310 lines (310 loc) · 10.1 KB
/
mint.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
%Typora theme : https://github.com/Y1chenYao/typora-mint-theme
\documentclass{article}
% Use upquote if available, for straight quotes in verbatim environments
\usepackage{upquote}
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
\setlength{\parindent}{0pt}
\setlength{\parskip}{0.5em}
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\usepackage{fvextra}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,breakanywhere,commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\makeatother
\usepackage{footnotehyper}
\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}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\usepackage{soul}
% Avoid problems with \sout in headers with hyperref
%\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
%---
\newlength{\px}
\setlength{\px}{0.0104166667in}
\usepackage[colorlinks=true,allcolors=DeepThemeColor]{hyperref}
%metadata
\hypersetup{
$if(title-meta)$
pdftitle={$title-meta$},
$endif$
$if(author-meta)$
pdfauthor={$author-meta$},
$endif$
$if(subject)$
pdfsubject={$subject$},
$endif$
$if(keywords)$
pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
$endif$
$if(subject)$
pdfsubject={$subject$},
$endif$
$if(subject)$
pdfsubject={$subject$},
$endif$
pdfcreator={XeLaTeX via Pandoc mint theme},
}
\author{}
\date{}
\usepackage[a4paper,
top=30\px,
bottom=20\px,
left=50\px,
right=50\px
]{geometry}
%colors
\usepackage[table]{xcolor}
\definecolor{DeepThemeColor}{HTML}{4EB289}
\definecolor{StruckColor}{HTML}{ADADAD}
\definecolor{SubparagraphColor}{HTML}{777777}
\definecolor{BackgroundColor}{HTML}{FFFFFF}
\definecolor{RuleColor}{HTML}{E7E7E7}
\definecolor{QuotelineColor}{HTML}{BABABA}
\definecolor{QuoteColor}{HTML}{777777}
\definecolor{CodeColor}{HTML}{A9B7C6}
\definecolor{CodeBlockBgColor}{HTML}{0F111A}
\definecolor{InlineCodeColor}{HTML}{F1F1F1}
\definecolor{VerbatimColor}{HTML}{A9B7C6}
\definecolor{TableEvenRowColor}{HTML}{F8FCFA}
\definecolor{TableHeadColor}{HTML}{D9EDE5}
%fonts
\usepackage{fontspec}
\setmainfont[Extension=.ttf,Path=/usr/share/fonts/pandoc-fonts/mint-fonts/lexend-,UprightFont=regular,BoldFont=bold]{}
\usepackage[fontsize=0.16666672in]{fontsize}%16px
\setmonofont[Extension=.ttf,Path=/usr/share/fonts/pandoc-fonts/mint-fonts/,UprightFont=sourcecodepro-regular,Scale=0.9]{}
\linespread{1.25}%1.5/1.2
%headings
\usepackage{sectsty}
\usepackage{titlesec}
\titleformat{\section}{\fontsize{1.8em}{1.1em}\bfseries}{}{}{}
\titlespacing{\section}{0pt}{0.67em}{0.67em}
\titleformat{\subsection}{\fontsize{1.5em}{\baselineskip}\bfseries}{}{}{}
\titlespacing{\subsection}{0pt}{0.83em}{0.83em}
\titleformat{\subsubsection}{\fontsize{1.17em}{\baselineskip}\bfseries}{}{}{}
\titlespacing{\subsubsection}{0pt}{1em}{1em}
\titleformat{\paragraph}{\fontsize{1em}{\baselineskip}\bfseries}{}{}{}
\titlespacing{\paragraph}{0pt}{1.33em}{1.33em}
\titleformat{\subparagraph}{\fontsize{1em}{\baselineskip}\bfseries\color{SubparagraphColor}}{}{}{}
\titlespacing{\subparagraph}{0pt}{1.33em}{1.33em}
\raggedright
\usepackage[most]{tcolorbox}
%quotes
\renewenvironment{quote}{
\begin{tcolorbox}[
notitle,
frame hidden,
interior hidden,
sharp corners,
enhanced,
boxrule=0pt,
coltext=QuoteColor,
boxsep=0em,
left=2em,
borderline west={0.18em}{0pt}{TableHeadColor}
]
\fontsize{0.9em}{\baselineskip}
}{
\end{tcolorbox}
}
%code background
\newcommand{\codesize}{\fontsize{0.9em}{\baselineskip}}
\newenvironment{Shaded}{
\begin{tcolorbox}[
notitle,
breakable,
frame hidden,
enhanced,
boxrule=0.2em,
colback=CodeBlockBgColor,
coltext=VerbatimColor,
outer arc=3\px,
boxsep=0.5em,
left=0pt,
right=0pt,
top=0pt,
bottom=0pt,
fontlower=\codesize
]
}{
\end{tcolorbox}
}
%syntax highlighting - taken from CodeMirror
\newcommand{\AlertTok}[1]{#1}
\newcommand{\AnnotationTok}[1]{#1}
\newcommand{\AttributeTok}[1]{\textcolor[HTML]{0000CC}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\BaseNTok}[1]{#1}
\newcommand{\BuiltInTok}[1]{\textcolor[HTML]{FFCB6B}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\CharTok}[1]{\textcolor[HTML]{C3E88D}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\CommentTok}[1]{\textcolor[HTML]{585d6d}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\CommentVarTok}[1]{#1}
\newcommand{\ConstantTok}[1]{#1}
\newcommand{\ControlFlowTok}[1]{#1}
\newcommand{\DataTypeTok}[1]{\textcolor[HTML]{DECB6B}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\DecValTok}[1]{\textcolor[HTML]{FF5370}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\DocumentationTok}[1]{#1}
\newcommand{\ErrorTok}[1]{\colorbox{white}{\textcolor[HTML]{FF5370}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[HTML]{FF5370}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\FunctionTok}[1]{\textcolor[HTML]{F07178}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{#1}
\newcommand{\KeywordTok}[1]{\textcolor[HTML]{C792EA}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\NormalTok}[1]{\textcolor[HTML]{F07178}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\OperatorTok}[1]{\textcolor[HTML]{89DDFF}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\OtherTok}[1]{#1}
\newcommand{\PreprocessorTok}[1]{#1}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[HTML]{AA1111}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\SpecialStringTok}[1]{\textcolor[HTML]{AA1111}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\StringTok}[1]{\textcolor[HTML]{C3E88D}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\VariableTok}[1]{\textcolor[HTML]{F07178}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\VerbatimStringTok}[1]{#1}
\newcommand{\WarngingTok}[1]{#1}
%no highlighting code
\RecustomVerbatimEnvironment{verbatim}{Verbatim}{breaklines,breakanywhere}%https://tex.stackexchange.com/a/469504
\BeforeBeginEnvironment{verbatim}{\begin{Shaded}}
\AfterEndEnvironment{verbatim}{\end{Shaded}}
%inline code behaviour
\def\VERB|#1|{\colorbox{InlineCodeColor}{\codesize\Verb[breaklines,breakanywhere,commandchars=\\\{\}]|#1|}}
\renewcommand{\texttt}[1]{\VERB|#1|}
%tables
%underline on every row
\makeatletter
\let\Tabularcr\@arraycr
\def\@arraycr{\Tabularcr\hline}
\makeatother
%https://stackoverflow.com/a/3175486 second comment
\usepackage{xstring}
\usepackage{longtable}
\def\table#1{\Longtable{#1}}
\let\Longtable\longtable
\let\EndLongtable\endlongtable
%deviation: not making table head bold and capital to give user more freedom
%deviation: not stretching table across width for aesthetics
\arrayrulecolor{TableHeadColor}
\renewenvironment{longtable}[3]{
\StrGobbleLeft{#3}{2}[\pream]
\StrGobbleRight{\pream}{2}[\pream]
\StrSubstitute{\pream}{l}{|l}[\pream]
\StrSubstitute{\pream}{r}{|r}[\pream]
\StrSubstitute{\pream}{c}{|c}[\pream]
\edef\pream{{\pream|}}
\global\arrayrulewidth=1\px%https://tex.stackexchange.com/a/337790
\newcommand{\toprule}[2]{}
\newcommand{\midrule}[2]{}
\def\endhead{}
\newcommand{\bottomrule}[2]{}
\renewcommand{\endlastfoot}{}
\begin{center}
\rowcolors{2}{TableEvenRowColor}{BackgroundColor}%https://tex.stackexchange.com/a/5365
\expandafter\table\pream
\rowcolor{TableHeadColor}
}{
\EndLongtable
\end{center}
}
%lists
%task lists
\newlength{\boxside}
\setlength{\boxside}{1.1em}
\newtcbox{\checkbox}[1]{
enhanced,
notitle,
on line,
coltext=BackgroundColor,
colback=#1,
colframe=DeepThemeColor,
boxrule=1.2\px,
arc=0.5em,%experimentation, using 1.1em produces wierd pattern
outer arc=0.5em,
height=\boxside,
width=\boxside,%doesn't work for some reason
left=0em,
right=0em,
top=0em,
bottom=0em,
boxsep=0em,
}
%-------strikeout item
\def\strike{
\begingroup
\catcode`\^^M=\active
\applystrike
}
\begingroup
\catcode`\^^M=\active
\gdef\applystrike^^M#1^^M{\st{#1}\endgroup}
\endgroup
%-------https://tex.stackexchange.com/a/10437
\usepackage{environ}
\let\Item\item
\AtBeginEnvironment{itemize}{
\gdef\itemformat{}
\renewcommand{\item}[1][]{
\ifx&
\Item
\else
\Item[#1]
\fi
\itemformat
}
}
\usepackage{amssymb}
\renewcommand{\square}{
\checkbox{BackgroundColor}{\hspace*{\boxside-2\px}}
\gdef\itemformat{\color{black}}
}
\renewcommand{\boxtimes}{
\checkbox{DeepThemeColor}{\hspace*{0.3em}\fontsize{0.8em}{0.95em}\checkmark}
\gdef\itemformat{
\color{StruckColor}
\strike
}
}
%unordered lists
%deviation unordered list inside ordered list is not considered as nested
\renewcommand{\labelitemi}{\textbullet\hspace{1.8mm}}%1.8 from eyeballing
\renewcommand{\labelitemii}{\tiny\(\circ\)\hspace{1.5mm}}%1.5 from eyeballing
\renewcommand{\labelitemiii}{\tiny\(\blacksquare\)\hspace{1.5mm}}
\renewcommand{\labelitemiv}{\tiny\(\blacksquare\)\hspace{1.5mm}}
%definition lists
\renewcommand{\descriptionlabel}[1]{#1}%remove bold
\usepackage{enumitem}
\setlist[description]{style=nextline,leftmargin=0pt}
\def\colon{: }
\AtBeginEnvironment{description}{
\AddToHook{para/begin}[colon]{\colon}
\let\Item\item
\renewcommand{\item}[1][\null]{\gdef\colon{}\Item[#1]:\gdef\colon{: }}
}
\AtEndEnvironment{description}{
\RemoveFromHook{para/begin}[colon]
}
%horizontal rules
\let\Rule\rule
\renewcommand{\rule}[2]{\textcolor{RuleColor}{\vspace{2em}\Rule{\linewidth}{1\px}}}
%document
\begin{document}
\fontsize{16\px}{1.5em}
$body$
\end{document}