-
Notifications
You must be signed in to change notification settings - Fork 3
/
nankai.tex
260 lines (210 loc) · 8.56 KB
/
nankai.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
% (The MIT License)
%
% Copyright (c) 2021-2024 Yegor Bugayenko
% Copyright (c) 2021-2024 Zhenyu Zhong
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the 'Software'), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included in all
% copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE.
\documentclass{nankai}
\usepackage{ffcode}
\usepackage{href-ul}
\usepackage{listings}
\graphicspath{{figures/}}
\lstdefinestyle{latex}
{
language=[LaTeX]{TeX},
texcsstyle=*\color{NankaiPurple},
basicstyle=\ttfamily,
moretexcs={subtitle, maketitle, PrintCrumb, columnbreak},
frame=single
}
\title{\LaTeX{} Class \ff{nankai}}
\subtitle{User's Guide}
\author{Yegor Bugayenko, Zhenyu Zhong}
\security{Public}
\begin{document}
\maketitle
Version: 1.8.0
Date: \today
\setcounter{tocdepth}{2}
\tableofcontents
\newpage
\section{Overview}
The provided class \ff{nankai} helps you design your work documents and presentations, keeping the code short and the style elegant enough for management and technical papers.
To use the class you simply mention its name in the preamble:
\begin{lstlisting}[style=latex]
\documentclass{nankai}
\begin{document}
Hello, world!
\end{document}
\end{lstlisting}
The document rendered from this \LaTeX{} code will look similar to the document you are reading now.
We recommend you to use \ff{latexmk} to compile your \ff{.tex} files to \ff{.pdf}.
In order to compile the document, just say \ff{latexmk -pdf} on the command line.
\section{Layout Options}
There are a few class options, provided in square brackets after the \ff{\char`\\documentclass}, which can help you fine-tune the layout of your document:
\begin{itemize}
\item \ff{landscape}
makes the document in landscape format, also changing the size of the paper to 16x9 inches (the default page size is \href{https://en.wikipedia.org/wiki/Paper_size}{A4}), making it perfect for presentations.
\item \ff{slides}
makes all headers larger, assuming the document is in landscape mode and presented as a slide deck.
\item \ff{nocover}
avoid printing the cover images on the first page by the \ff{\char`\\PrintFirstPage} command.
\item \ff{anonymous}
removes the name of the author everywhere, including the bottom of the page, where the author's name stays next to the name of the company.
\item \ff{nobrand}
avoid mentioning the name of Nankai anywhere in the document, and removes the logo too.
\item \ff{nosecurity}
avoids mentioning the level of security at the top right corner of the document and also avoids showing the author's ID where it is usually visible.
\item \ff{nodate}
do not show the date and time at the bottom of each page, where they usually are rendered in ISO~8601 format.
\item \ff{nopaging}
avoids page numbers at the bottom of each page.
\item \ff{authordraft}
prints a big ``It is a draft'' message across each page.
\item \ff{cn}
sets the language to simplified Chinese.
\item \ff{breaks}
forces all |\section| to start from a new page.
\end{itemize}
\section{Preamble}
In the preamble, you can specify meta-information about the document, such as its title or author's name.
Here is how:
\begin{lstlisting}[style=latex]
\documentclass{nankai}
\title{Making Compression Faster}
\subtitle{Technical Report}
\author{Zhenyu Zhong}
\begin{document}
\maketitle
Hello, world!
\end{document}
\end{lstlisting}
The following meta-commands are defined:
\begin{itemize}
\item \ff{\char`\\title} is the main title of the document to be used in the text and the PDF document's properties.
\item \ff{\char`\\subtitle} is the subtitle to be printed under the title.
\item \ff{\char`\\author} is the author of the document in ``first-name last-name'' format.
\item \ff{\char`\\id} is the author's internal ID, if applicable.
\item \ff{\char`\\company} is the name of the company/department the author works for.
\item \ff{\char`\\security} is the level of security of the document, which is usually printed at the top right corner of it; usual values are ``Public'', ``Internal'', ``Confidential'', or ``Secret''.
\end{itemize}
\section{Custom Commands}
Inside the document body, you can use these commands:
\begin{itemize}
\item \ff{\char`\\PrintFirstPage\{front-image\}}
prints the first page of a project charter or a similar landscape document, placing the image \ff{front-image.pdf} on the front (the file should be present in the current dir).
If you don't have the front image file, just leave the first argument empty.
\item \ff{\char`\\PrintLastPage\{\}}
prints the last page of a project charter or a similar landscape document.
\item \ff{\char`\\PrintThankYouPage\{\}}
prints the last page with a ``Thank You'' message in the center.
\item \ff{\char`\\PrintDisclaimer\{\}}
prints a paragraph at the bottom of the page with a standard disclaimer.
\end{itemize}
\section{Custom Environments}
The following helper environments are defined:
\ff{\char`\\note} is a text box with a colored background that can highlight important information.
Here is an example:
\begin{note}
This is a note.
\end{note}
\section{Best Practices}
You are free to design your documents any way you want.
However, it will be convenient for you and your readers if you follow the convention we have for business and technical documents.
The rule of thumb is simple: try \emph{not} to format your documents.
Instead, let the class designed by us do this work for you.
Just type the content without changing the layout, adding colors, fonts, etc.
The less you modify the look and feel, the better your readers perceive your documents.
\subsection{Two Columns}
In the landscape format, it is recommended to use two columns for better text readability.
Here is how:
\begin{lstlisting}[style=latex]
\documentclass{nankai}
\begin{document}
\newpage
\begin{multicols}{2}
\section*{First}
Here is the first column's content.
\columnbreak
\section*{Second}
Here is the second column's content.
\end{multicols}
\end{document}
\end{lstlisting}
\subsection{Crumbs}
When you need to put many small information pieces into one page, we recommend you to use ``crumbs'':
\begin{lstlisting}[style=latex]
\documentclass{nankai}
\begin{document}
\newpage
\section*{Project Details}
\begin{multicols}{2}
\raggedright
\PrintCrumb{Budget}{\$100K}
\PrintCrumb{Duration}{5 months}
\end{multicols}
\end{document}
\end{lstlisting}
\section{Examples}
\subsection{Figures}
\begin{figure}[!h]
\includegraphics[width=0.3\linewidth]{example-image-a}
\caption{This is a figure.}
\label{fig:example}
\end{figure}
Figures are usually placed in the \ff{figures} subdirectory.
Here is how you can include a figure:
\begin{lstlisting}[style=latex]
\begin{figure}
\includegraphics[width=0.3\linewidth]{example-image-a}
\caption{This is a figure.}
\label{fig:example}
\end{figure}
\end{lstlisting}
And you can refer to it like this: \ff{\char`\\ref\{fig:example\}}: Figure~\ref{fig:example}.
\subsection{Tables}
\begin{table}[!h]
\begin{tabular}{cc}
\toprule
\textbf{A} & \textbf{B} \\
\midrule
1 & 2 \\
\bottomrule
\end{tabular}
\caption{This is a table.}
\label{tab:example}
\end{table}
Here is how you can include a table:
\begin{lstlisting}[style=latex]
\begin{table}
\begin{tabular}{cc}
\toprule
\textbf{A} & \textbf{B} \\
\midrule
1 & 2 \\
\bottomrule
\end{tabular}
\caption{This is a table.}
\label{tab:example}
\end{table}
\end{lstlisting}
And you can refer to it like this: \ff{\char`\\ref\{tab:example\}}: Table~\ref{tab:example}.
\PrintDisclaimer
\PrintThankYouPage
\end{document}