-
Notifications
You must be signed in to change notification settings - Fork 7
/
notion-darker-enhanced.tex
328 lines (328 loc) · 10.8 KB
/
notion-darker-enhanced.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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
%Typora theme : https://github.com/adrian-fuertes/typora-notion-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
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\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}
\setul{0.175em}{0.06em}
% 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}
%colors
\usepackage[table]{xcolor}
\definecolor{PrimaryColor}{HTML}{C1C1C1}
\definecolor{BackgroundDarkColor}{HTML}{F7F6F3}
\definecolor{DarkTraitColor}{HTML}{393C3F}
\definecolor{LightTrait100Color}{HTML}{3D4145}
\definecolor{LightTrait300Color}{HTML}{72706B}
\definecolor{LightTrait400Color}{HTML}{37352F}
\definecolor{TextColor}{HTML}{C1C0C1}
\definecolor{BackgroundColor}{HTML}{191919}
\definecolor{BackgroundDarkColor}{HTML}{202020}
\definecolor{TextSecondaryColor}{HTML}{73726E}
\definecolor{CodeColor}{HTML}{202020}
\definecolor{InlineCodeBgColor}{HTML}{2A2A28}
\definecolor{QuoteBackgroundColor}{HTML}{252525}
\definecolor{ShadedTextColor}{HTML}{B8BABB}
\definecolor{TableEvenColor}{HTML}{E8E7E7}
\definecolor{CheckedColor}{HTML}{2EAADC}
\usepackage[colorlinks=true,allcolors=TextColor!60!BackgroundColor,hidelinks]{hyperref}
\pagecolor{BackgroundColor}
%metadata
\hypersetup{
$if(subject)$
$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$
pdfsubject={$subject$},
$endif$
pdfcreator={XeLaTeX via Pandoc notion-darker-classic theme},
}
\author{}
\date{}
\usepackage[a4paper,top=30\px,left=30\px,right=30\px,bottom=100\px,textwidth=860\px]{geometry}
%--------underline links
\makeatletter
\begingroup%copied and modified from href-ul.sty
%$$ used as escape sequence
\catcode`\$$=6 %
\catcode`\#=12 %
\gdef\href@split$$1#$$2#$$3\\$$4{%
\hyper@@link{$$1}{$$2}{\ul{$$4}}%
\endgroup%
}
\endgroup
\makeatother
%--------
%fonts
\usepackage{fontspec}
%-------set global color
\makeatletter
\color{TextColor}\global\let\default@color\current@color
\makeatother
%-------https://tex.stackexchange.com/a/29409
\setmainfont[Extension=.ttf,Path=/usr/share/fonts/pandoc-fonts/notion-fonts/segoeui-,UprightFont=regular,ItalicFont=italic,BoldFont=bold,BoldItalicFont=bolditalic]{}
\setmonofont[Extension=.otf,Path=/usr/share/fonts/pandoc-fonts/notion-fonts/sfmono-,UprightFont=medium]{}
\usepackage[fontsize=0.16666672in]{fontsize}%16px
\linespread{1.33}%1.6/1.2
%headings
\usepackage{sectsty}
\usepackage{titlesec}
\titleformat{\section}{\fontsize{2.2em}{1.3\baselineskip}\bfseries}{}{}{}
\titlespacing{\section}{0pt}{2em}{0.3em}
\titleformat{\subsection}{\fontsize{1.75em}{1.225\baselineskip}\bfseries}{}{}{}
\titlespacing{\subsection}{0pt}{2em}{0.3em}
\titleformat{\subsubsection}{\fontsize{1.2em}{1.43\baselineskip}\bfseries}{}{}{}
\titlespacing{\subsubsection}{0pt}{2em}{1em}
\titleformat{\paragraph}{\fontsize{1.2em}{1.4\baselineskip}\bfseries}{}{}{}
\titlespacing{\paragraph}{0pt}{2em}{1em}
\titleformat{\subparagraph}{\fontsize{1em}{1.4\baselineskip}\bfseries}{}{}{}
\titlespacing{\subparagraph}{0pt}{2em}{1em}
\raggedright
\usepackage[most]{tcolorbox}
%quotes
\renewenvironment{quote}{
\begin{tcolorbox}[
notitle,
frame hidden,
interior hidden,
sharp corners,
enhanced,
boxrule=0pt,
colback=QuoteBackgroundColor,
coltext=TextColor,
boxsep=0em,
top=10\px,
right=14\px,
bottom=7\px,
left=22\px,
borderline west={4\px}{0pt}{TextColor}
]
}{
\end{tcolorbox}
\color{TextColor}
}
%code background
\newenvironment{Shaded}{
\begin{tcolorbox}[
notitle,
breakable,
frame hidden,
arc=4\px,
outer arc=4\px,
enhanced,
boxrule=0pt,
colback=BackgroundDarkColor,
coltext=ShadedTextColor,
boxsep=0em,
top=2\px,
right=4\px,
bottom=0\px,
left=4\px,
fontupper=\fontsize{0.975em}{\baselineskip}
]
}{
\end{tcolorbox}
}
%syntax highlighting - taken from CodeMirror
\newcommand{\AlertTok}[1]{#1}
\newcommand{\AnnotationTok}[1]{#1}
\newcommand{\AttributeTok}[1]{\textcolor[HTML]{D1949E}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\BaseNTok}[1]{#1}
\newcommand{\BuiltInTok}[1]{\textcolor[HTML]{BDE052}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\CharTok}[1]{#1}
\newcommand{\CommentTok}[1]{\textcolor[HTML]{998066}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\CommentVarTok}[1]{#1}
\newcommand{\ConstantTok}[1]{#1}
\newcommand{\ControlFlowTok}[1]{#1}
\newcommand{\DataTypeTok}[1]{\textcolor[HTML]{BDE052}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\DecValTok}[1]{\textcolor[HTML]{D1949E}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\DocumentationTok}[1]{#1}
\newcommand{\ErrorTok}[1]{\textcolor[HTML]{D1949E}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[HTML]{D1949E}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\FunctionTok}[1]{\textcolor{TextColor}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{#1}
\newcommand{\KeywordTok}[1]{\textcolor[HTML]{D1949E}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\NormalTok}[1]{\textcolor{TextColor}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\OperatorTok}[1]{\textcolor[HTML]{F5B83D}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\OtherTok}[1]{#1}
\newcommand{\PreprocessorTok}[1]{#1}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[HTML]{BDE052}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\SpecialStringTok}[1]{\textcolor[HTML]{BDE052}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\StringTok}[1]{\textcolor[HTML]{BDE052}{\FancyVerbBreakStart#1\FancyVerbBreakStop}}
\newcommand{\VariableTok}[1]{\textcolor{TextColor}{\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|{
\tcbox[
notitle,
on line,
frame hidden,
arc=4\px,
outer arc=4\px,
enhanced,
boxrule=0pt,
colback=InlineCodeBgColor,
coltext=TextColor,
boxsep=0em,
top=2\px,
right=4\px,
bottom=0\px,
left=4\px,
fontupper=\fontsize{0.975em}{\baselineskip}
]{\Verb[breaklines,breakanywhere,commandchars=\\\{\}]|#1|}
\color{TextColor}
}
\renewcommand{\texttt}[1]{\VERB|#1|}
%tables
%deviation: not stretching table across width for aesthetics
%underline on every row
\makeatletter
\let\Tabularcr\@arraycr
\def\@arraycr{\Tabularcr\hline}
\makeatother
%https://stackoverflow.com/a/3175486 second comment
\usepackage{xstring}
\usepackage{longtable}
\let\Longtable\longtable
\let\EndLongtable\endlongtable
\def\table#1{\Longtable{#1}}
%deviation: not stretching table across width for aesthetics
%deviation: not making table head centered for aesthetics
\arrayrulecolor{DarkTraitColor}
\global\arrayrulewidth=1\px%https://tex.stackexchange.com/a/337790
\setlength{\tabcolsep}{13\px}
\renewenvironment{longtable}[3]{
\gdef\embolden{\bfseries}
\StrGobbleLeft{#3}{2}[\pream]
\newcolumntype{L}{|>{\embolden}l}
\newcolumntype{R}{|>{\embolden}r}
\newcolumntype{C}{|>{\embolden}c}
\StrGobbleRight{\pream}{2}[\pream]
\StrSubstitute{\pream}{l}{L}[\pream]
\StrSubstitute{\pream}{r}{R}[\pream]
\StrSubstitute{\pream}{c}{C}[\pream]
\edef\pream{{\pream|}}
\newcommand{\toprule}[2]{}
\newcommand{\midrule}[2]{}
\def\endhead{\gdef\embolden{}\normalfont}
\newcommand{\bottomrule}[2]{}
\renewcommand{\endlastfoot}{}
\begin{center}
\expandafter\table\pream
\hline
}{
\EndLongtable
\end{center}
}
%lists
%task lists
\usepackage{amssymb}
\newlength{\boxside}
\setlength{\boxside}{0.95em}
\newtcbox{\checkbox}[2]{
enhanced,
notitle,
sharp corners,
on line,
colback=#2,
colframe=#1,
boxrule=1\px,
height=\boxside,
width=\boxside,%doesn't work for some reason
left=0em,
right=0em,
top=0em,
bottom=0em,
boxsep=0em,
}
\renewcommand{\square}{\checkbox{TextColor}{BackgroundColor}{\hspace*{\boxside-2\px}}}
\renewcommand{\boxtimes}{\checkbox{CheckedColor}{CheckedColor}{\hspace*{0.1em}\textcolor{white}{\fontsize{0.75em}{\baselineskip}\bfseries\checkmark}\hspace*{0.1em}}}
%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{LightTrait100Color}{\Rule{\linewidth}{1.5\px}}}
%document
\begin{document}
$body$
\end{document}