-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathstyle.sty
More file actions
134 lines (117 loc) · 3.58 KB
/
style.sty
File metadata and controls
134 lines (117 loc) · 3.58 KB
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
\usepackage{polyglossia}
\usepackage{fontspec}
\usepackage[includeheadfoot, a4paper, total={6.5in, 9.8in}, top=0.5cm]{geometry}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{soul}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{array}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{fancyvrb}
\usepackage{verbatim}
\usepackage{longfbox}
\usepackage{setspace}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{xcolor,colortbl}
\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{\setstretch{0.1}}
\pagestyle{fancy}
\fancyhf{}
\chead{\includegraphics[width=4cm]{../../templates/logo.png}}
\rfoot{\lfbox[
padding-top=6pt,
padding-left=12pt,
padding-right=12pt,
border-width=0pt,
border-top-width=1pt,
]{\thepage}}
\renewcommand{\headrulewidth}{1pt}
\setlength{\headheight}{60pt}
\setdefaultlanguage{thai}
\setotherlanguage{english}
\newfontfamily\thaifont[
Scale=1.45,
Path=../../templates/,
BoldFont={THSarabunNew Bold.ttf},
ItalicFont={THSarabunNew Italic.ttf},
BoldItalicFont={THSarabunNew BoldItalic.ttf}
]{THSarabunNew.ttf}
\newfontfamily\thaifonttt[
Path=../../templates/,
Scale=1.2,
BoldFont={Inconsolata-Bold.ttf}
]{Inconsolata-Regular.ttf}
\newfontfamily\englishfonttt[
Path=../../templates/,
Scale=1.2,
BoldFont={Inconsolata-Bold.ttf}
]{Inconsolata-Regular.ttf}
\setstretch{1.2}
\setlength{\parskip}{10pt}
\setlength{\parindent}{0pt}
\XeTeXlinebreaklocale "th"
\XeTeXlinebreakskip = 0pt plus 0.75pt minus 0.5pt
\newenvironment{problem}[5]
{
{\huge \textbf{#1}}
{\large #4, #5} \\ }
{}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=blue
}
\newcommand{\InputFile}{\section*{\linespread{5.1}ข้อมูลนำเข้า}}
\newcommand{\OutputFile}{\section*{ข้อมูลส่งออก}}
\newcommand{\Scoring}{\section*{การให้คะแนน}}
\newcommand{\Examples}{\section*{ตัวอย่างข้อมูลนำเข้าและข้อมูลส่งออก}}
\newcommand{\InputFileName}{ตัวอย่างข้อมูลนำเข้า}
\newcommand{\OutputFileName}{ตัวอย่างข้อมูลส่งออก}
\newcommand{\Note}{\section*{คำอธิบาย}}
\newcommand{\Source}{\section*{แหล่งที่มา}}
% Copied from https://github.com/GassaFM/olymp.sty/blob/master/statements/olymp.sty
\newlength{\thelinewidth}
\thelinewidth=\textwidth
\newlength{\exmpwidinf}
\newlength{\exmpwidouf}
\newlength{\exmpwidewid}
\exmpwidinf=0.43\thelinewidth
\exmpwidouf=0.43\thelinewidth
\exmpwidewid=0.9\thelinewidth
% This is magic, which delete space after verbatiminput
\addto@hook{\every@verbatim}{\topsep=0pt\relax}
\newenvironment{example}[1][]{
\ttfamily\obeylines\obeyspaces\frenchspacing
\newcommand{\exmp}[2]{
\ifdefined\NoExamples\else%
\begin{minipage}[t]{\exmpwidinf}\rightskip=0pt plus 1fill\relax##1\medskip\end{minipage}&
\begin{minipage}[t]{\exmpwidouf}\rightskip=0pt plus 1fill\relax##2\medskip\end{minipage}\\
\hline
\fi%
}
\newcommand{\exmpfile}[2]{
\ifdefined\NoExamples\else%
\exmp{
\verbatiminput{##1}
}{
\verbatiminput{##2}
}%
\fi%
}
\ifdefined\NoExamples\else%
\begin{tabular}{|l|l|}
\hline
\multicolumn{1}{|c|}{\bf\InputFileName}&
\multicolumn{1}{ c|}{\bf\OutputFileName}\\
\hline
\fi%
}{
\ifdefined\NoExamples\else%
\end{tabular}
\fi%
}