generated from TNFSH-Programming-Contest/tps-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.tex
164 lines (140 loc) · 4.79 KB
/
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
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
\documentclass[a4paper]{article}
\def \problemLabel {$if(problem_label)$$problem_label$$else$(空白)$endif$}
\def \problemName {$if(title)$$title$$else$(空白)$endif$}
\def \problemId {$if(name)$$name$$else$(空白)$endif$}
\def \contestName {$if(contest_name)$$contest_name$$else$(空白)$endif$}
\def \timeLimit {$if(time_limit)$$time_limit$$else$(空白)$endif$}
\def \memLimit {$if(memory_limit)$$memory_limit$$else$(空白)$endif$}
\message{label is "\problemLabel"}
\message{name is "\problemName"}
\message{id is "\problemId"}
\message{contestName is "\contestName"}
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$
$if(linestretch)$
\usepackage{setspace}
\setstretch{$linestretch$}
$endif$
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\usepackage{mathspec}
\usepackage{titlesec}
\usepackage{array}
\usepackage{etoolbox}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage{color}
\usepackage[normalem]{ulem}
\usepackage{fontspec}
\usepackage{fancyhdr}
\usepackage{longtable,booktabs}
\usepackage{verbatim}
\usepackage[left=2cm,right=2cm,top=3cm,bottom=2cm]{geometry}
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\usepackage{xeCJK}
\setCJKmainfont[]{Noto Sans Mono CJK TC}
%\setCJKmainfont[]{標楷體}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\renewcommand{\familydefault}{\sfdefault}
\makeatletter
\preto{\@verbatim}{\topsep=0pt \partopsep=0pt }
\makeatother
\pagestyle{fancyplain}
\setlength{\headheight}{18pt}
\fancyhead[l]{\Large \contestName}
\fancyhead[r]{\Large \problemLabel. \problemName}
\usepackage{graphicx}
\graphicspath{{$statement_path$/}}
\renewcommand{\thepage}{\problemLabel \ -\;\arabic{page}}
\renewcommand{\subsection}[1]{\noindent \textbf{\LARGE -- #1 -- }}
\renewcommand{\subsubsection}[1]{\noindent \textbf{\Large #1 }}
\renewcommand{\section}[1]{\begin{center}
\begin{spacing}{1.5} {\Huge \problemLabel. \problemName} \\ \end{spacing} \begin{spacing}{1.0} Problem ID: \problemId \\ Time Limit: \timeLimit s \\ Memory Limit: \memLimit MiB \end{spacing}\vspace*{-0.1cm}
\end{center}}
% use upquote if available, for straight quotes in verbatim environments
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
$if(verbatim-in-note)$
\usepackage{fancyvrb}
$endif$
\usepackage[unicode=true]{hyperref}
$if(colorlinks)$
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
$endif$
\hypersetup{
pdfborder={0 0 0},
breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
$if(verbatim-in-note)$
\VerbatimFootnotes % allows verbatim text in footnotes
$endif$
$if(listings)$
\usepackage{listings}
$endif$
$if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$endif$
$if(highlighting-macros)$
$highlighting-macros$
$endif$
$if(tables)$
\usepackage{longtable,booktabs}
% Fix footnotes in tables (requires footnote package)
\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{long table}}{}
$endif$
\usepackage{grffile}
\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(links-as-notes)$
% Make links footnotes instead of hotlinks:
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
$endif$
$if(strikeout)$
\usepackage[normalem]{ulem}
% avoid problems with \sout in headers with hyperref:
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
$endif$
\setlength{\parindent}{0pt}
\setlength{\parskip}{15pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
% set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\newcommand{\subtasks}{
\begin{longtable}[]{>{\centering}p{1cm}>{\raggedleft}p{1cm}p{13cm}}
\toprule
編號 & 分數 & 額外限制\tabularnewline
\midrule
\endhead
$for(subtasks)$
$subtasks.index$ & $subtasks.score$ & $subtasks.text$ \tabularnewline
$endfor$
\bottomrule
\end{longtable}}
\newcommand{\testfile}[1]{
\verbatiminput{tests/#1}
}
\begin{document}
\Large
$body$
\end{document}