Debian Codegraph @

texmf-dist/doc/latex/elegantbook/elegantbook-en.tex

raw
1 \documentclass[11pt]{elegantbook}
2
3 \title{An Elegant \LaTeX\ Template for Books}
4 \subtitle{Classic Elegant\LaTeX\ Template}
5
6 \author{Ethan Deng, Liam Huang, syvshc, sikouhjw \& Osbert Wang}
7 \institute{Elegant\LaTeX\ Program}
8 \date{May 1, 2026}
9 \version{4.7}
10 \bioinfo{Bio}{Information}
11
12 \extrainfo{\textcolor{red}{\bfseries Caution: This template will no longer be maintained since January 1st, 2023. However, due to its large user base, maintenance has resumed and the template has been re-released as of 2026.}}
13
14 \logo{logo-blue.png}
15 \cover{cover.jpg}
16
17 % modify the color in the middle of titlepage
18 \definecolor{customcolor}{RGB}{32,178,170}
19 \colorlet{coverlinecolor}{customcolor}
20 \usepackage{cprotect}
21
22 \addbibresource[location=local]{reference.bib} % bib
23
24 \begin{document}
25
26 \maketitle
27
28 \frontmatter
29 \tableofcontents
30
31 \mainmatter
32
33 \chapter{Elegant\LaTeX\ Templates}
34 Elegant\LaTeX\ Program developers are intended to provide you beautiful, elegant, user-friendly templates. Currently, the Elegant\LaTeX\ is composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper}, designed for typesetting notes, books, and working papers respectively. Latest releases are strongly recommended! This guide is aimed at briefly introducing the 101 of this template. For any other question, suggestion or comment, feel free to contact us on GitHub \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} or email us at \email{[email protected]}.
35
36 Contact Infos:
37 \begin{itemize}
38 \item GitHub: \href{https://github.com/ElegantLaTeX/}{https://github.com/ElegantLaTeX/}
39 \item CTAN: \href{https://ctan.org/pkg/elegantbook}{https://ctan.org/pkg/elegantbook}
40 \item Download: \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{release}, \href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{latest version}
41 \end{itemize}
42
43
44 \section{Online Usage}
45 You can visit \href{https://www.overleaf.com/}{Overleaf} to use our template online anywhere and anytime without local installation. To find our template, search \lstinline{elegantlatex} in the \lstinline{templates} or simply visit \href{https://www.overleaf.com/latex/templates?addsearch=elegantlatex}{search result}, choose the template you prefer and \lstinline{Open as Template} to own a copy yourself to edit freely. To learn more about Overleaf, please refer to \href{https://www.overleaf.com/learn}{Documentation}.
46
47
48 \section{Portable Version}
49 For portable version, simply download lastest ElegantBook-master from GitHub or CTAN (to be more accurate, download \lstinline{elegantbook.cls}) and save the file(s) under your working directory. This way of installation is simple and convenient, but you have to manually update \lstinline{cls} now and then.
50
51
52 \section{Update Templates}
53 You can use cmd/terminal to update the tlmgr itself and all the packages, the commands are:
54 \begin{lstlisting}
55 tlmgr update --self
56 tlmgr update --all
57 \end{lstlisting}
58
59 To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX\ distribution?}
60
61 \section{Other Release Versions}
62
63 If you are using a \TeX~Live version prior to 2025 and wish to update the template, the official solution is to uninstall the previous version.
64 If you want to save the trouble of uninstallation and re-installation, please copy \lstinline{elegantbook.cls} to the installation directory of your \TeX~Live (default for \TeX~Live 2025: \lstinline|C:\texlive\2025\texmf-dist\tex\latex\elegantbook|; replace "2025" with your actual version), and then run \lstinline{texhash} in the command prompt.
65
66 \chapter{ElegantBook Settings}
67
68 This template is based on the Standard \LaTeX\ book class, so the options of book class work as well (Note that the option of papersize has no effect due to \lstinline{device} option). The default encoding is UTF-8 while \TeX~Live is recommended. The test environments are Windows 10/11, Ubuntu 24.04 LTS, and macOS with \TeX~Live 2025/ Mac\TeX\ 2025. Both \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine for \lstinline{lang=en}.
69
70 \section{Languages}
71 We defined one option named \lstinline{lang} which has two basic values, \lstinline{lang=en} (default) , \lstinline{lang=cn}. Different values will alter the captions of figure/table, abstract name, refname, etc. You can use this option as
72
73 \begin{lstlisting}
74 \documentclass[en]{elegantbook}
75 \documentclass[lang=en]{elegantbook}
76 \end{lstlisting}
77
78 Besides the two basic language translation, our user provide more options, here is a short brief introduction to these translation. Since I am not familiar with these languages, I can't guarantee that the translations are correct, please comment on GitHub if you have some questions.
79
80 \begin{itemize}
81 \item Italian translation \lstinline{lang=it}, provided by \href{https://github.com/VincentMVV}{VincentMVV} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation};
82 \item French translation \lstinline{lang=fr}, provided by \href{https://github.com/abfek66}{abfek66} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation};
83 \item Dutch Translation \lstinline{lang=nl}, provided by \href{https://github.com/inktvis75}{inktvis75} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/108}{Dutch Translation};
84 \item Hungarian translation \lstinline{lang=hu}, provided by \href{https://github.com/palkotamas}{palkotamas}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/111}{Hungarian translation};
85 \item Deutsch translation \lstinline{lang=de}, provided by Lisa, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/113}{Deutsch translation};
86 \item Spanish translation \lstinline{lang=es}, provided by Gustavo A. Corradi, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/133}{Spanish translation};
87 \item Mongolian translation \lstinline{lang=mn}, provided by \href{https://github.com/Altantsooj}{Altantsooj}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/137}{Mongolian translation};
88 \item Japanese translation \lstinline{lang=jp}, provided by \href{https://github.com/inusturbo}{inusturbo}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/172}{Japanese translation}.
89 \end{itemize}
90
91 \begin{remark}
92 Chinese Characters are acceptable \textbf{ONLY} in \lstinline{lang=cn}.
93 \end{remark}
94
95 \section{Device Mode Option}
96 The option for device (\lstinline{device}) was originally used in ElegantNote, now we include this option in ElegantBook\footnote{Pictures have to be modified accordingly.} as well. Activate iPad mode in the following way\footnote{Default size: normal, A4 paper.}:
97 \begin{lstlisting}
98 \documentclass[pad]{elegantbook} %or
99 \documentclass[device=pad]{elegantbook}
100 \end{lstlisting}
101
102 \section{Color Themes}
103 This template contains 5 color themes, i.e., \textcolor{structure1}{\lstinline{green}}\footnote{Original default theme.}, \textcolor{structure2}{\lstinline{cyan}}, \textcolor{structure3}{\lstinline{blue}}(default), \textcolor{structure4}{\lstinline{gray}}, \textcolor{structure5}{\lstinline{black}}. You can choose \lstinline{green} with
104 \begin{lstlisting}
105 \documentclass[green]{elegantbook} %or
106 \documentclass[color=green]{elegantbook}
107 \end{lstlisting}
108
109
110 \begin{table}[htbp]
111 \caption{ElegantBook Themes\label{tab:color thm}}
112 \centering
113 \begin{tabular}{ccccccc}
114 \toprule
115 & \textcolor{structure1}{green}
116 & \textcolor{structure2}{cyan}
117 & \textcolor{structure3}{blue}
118 & \textcolor{structure4}{gray}
119 & \textcolor{structure5}{black}
120 & Main Environments\\
121 \midrule
122 structure & \makecell{{\color{structure1}\rule{1cm}{1cm}}}
123 & \makecell{{\color{structure2}\rule{1cm}{1cm}}}
124 & \makecell{{\color{structure3}\rule{1cm}{1cm}}}
125 & \makecell{{\color{structure4}\rule{1cm}{1cm}}}
126 & \makecell{{\color{structure5}\rule{1cm}{1cm}}}
127 & chapter section subsection \\
128 main & \makecell{{\color{main1}\rule{1cm}{1cm}}}
129 & \makecell{{\color{main2}\rule{1cm}{1cm}}}
130 & \makecell{{\color{main3}\rule{1cm}{1cm}}}
131 & \makecell{{\color{main4}\rule{1cm}{1cm}}}
132 & \makecell{{\color{main5}\rule{1cm}{1cm}}}
133 & definition exercise problem \\
134 second & \makecell{{\color{second1}\rule{1cm}{1cm}}}
135 & \makecell{{\color{second2}\rule{1cm}{1cm}}}
136 & \makecell{{\color{second3}\rule{1cm}{1cm}}}
137 & \makecell{{\color{second4}\rule{1cm}{1cm}}}
138 & \makecell{{\color{second5}\rule{1cm}{1cm}}}
139 & theorem lemma corollary\\
140 third & \makecell{{\color{third1}\rule{1cm}{1cm}}}
141 & \makecell{{\color{third2}\rule{1cm}{1cm}}}
142 & \makecell{{\color{third3}\rule{1cm}{1cm}}}
143 & \makecell{{\color{third4}\rule{1cm}{1cm}}}
144 & \makecell{{\color{third5}\rule{1cm}{1cm}}}
145 & proposition\\
146 \bottomrule
147 \end{tabular}
148 \end{table}
149
150 If you want to customize the colors, please select \lstinline{nocolor} or use \lstinline{color=none} and declare the main, second, and third colors in the preamble section as follows:
151 \begin{lstlisting}[frame=single]
152 \definecolor{structurecolor}{RGB}{60,113,183}
153 \definecolor{main}{RGB}{0,166,82}%
154 \definecolor{second}{RGB}{255,134,24}%
155 \definecolor{third}{RGB}{0,174,247}%
156 \end{lstlisting}
157
158 \section{Cover}
159 \subsection{Customized Cover}
160 From v3.10, customized cover is allowed, you can choose or hide any element as you prefer. Current optional elements are:
161 \begin{itemize}
162 \item title: \lstinline{\title}
163 \item subtitle: \lstinline{\subtitle}
164 \item author: \lstinline{\author}
165 \item institute: \lstinline{\institute}
166 \item date: \lstinline{\date}
167 \item version: \lstinline{\version}
168 \item extra information: \lstinline{\extrainfo}
169 \item cover image: \lstinline{\cover}
170 \item logo: \lstinline{\logo}
171 \end{itemize}
172
173 Besides, an extra command \lstinline{\bioinfo} is provided with two options--caption and content. For instance, if you want to display \lstinline{Username: 111520}, just type in
174
175 \begin{lstlisting}
176 \bioinfo{Username}{115520}
177 \end{lstlisting}
178
179 You can change the color of the horizontal bar of the cover by
180 \begin{lstlisting}
181 \definecolor{customcolor}{RGB}{32,178,170}
182 \colorlet{coverlinecolor}{customcolor}
183 \end{lstlisting}
184
185 \subsection{Cover Image}
186 The cover image used in this template is from \href{https://pixabay.com/en/tea-time-poetry-coffee-reading-3240766/}{pixabay.com}. The image is completely free and can be used under any circumstance. The cover image size is $1280 \times 1024$. If you would like to change the cover, please crop it according to the size of the cover picture strictly. One free online image clipping site: \href{https://www.fotor.com/cn}{fotor.com}. Feel free to join our QQ Group to get more elegant covers.
187
188 \subsection{Logo}
189 Aspect ratio of the logo is 1:1 in this guide, i.e. a square picture. To replace the logo, do remember to choose the appropriate picture.
190
191 \subsection{Stylized Cover}
192 Want to use stylized cover?(For instance, A4-sized PDF designed by Adobe Illustrator) Please comment out \lstinline{\maketitle} and use \lstinline{pdfpages} to insert the cover. Similar for using \lstinline{titlepage}. If you would like to use the cover in version 2.x, please refer to \href{https://github.com/EthanDeng/etitlepage}{etitlepage}.
193
194 \section{Chapter Title Display Styles}
195
196 This template contains 2 sets of \textit{title display styles},\lstinline{hang}(default) and \lstinline{display} style. For the former, chapter title is displayed on a single line (\lstinline{hang}). For the latter, chapter title is displayed on a double line (\lstinline{display}).In this guide, we use \lstinline{hang} . To change display style, use:
197 \begin{lstlisting}
198 \documentclass[hang]{elegantbook} %or
199 \documentclass[titlestyle=hang]{elegantbook}
200 \end{lstlisting}
201
202
203 \section{Introduction of Math Environments}
204 We defined two sets of theorem modes, \lstinline{simple} style and \lstinline{fancy} style (default). You may change to \lstinline{simple} mode by
205
206 \begin{lstlisting}
207 \documentclass[simple]{elegantbook} %or
208 \documentclass[mode=simple]{elegantbook}
209 \end{lstlisting}
210
211 In this template, we defined four different theorem class environments
212
213 \begin{itemize}
214 \item \textit{Theorem Environments}, including title and content, numbering corresponding to chapter. Three types depending on the format:
215 \begin{itemize}
216 \item \textcolor{main}{\textbf{definition}} environment, the color is \textcolor{main}{main};
217 \item \textcolor{second}{\textbf{theorem, lemma, corollary, axiom, postulate}} environment, the color is \textcolor{second} {second};
218 \item \textcolor{third}{\textbf{proposition}} environment, the color is \textcolor{third}{third}.
219 \end{itemize}
220 \item \textit{Example Environment}, including \textbf{example, exercise, problem} environment, auto numbering according to chapter.
221 \item \textit{Proof Environment}, including \textbf{proof, note} environment containing introductory symbol (\textbf{note} environment) or ending symbol (\textbf{proof} environment).
222 \item \textit{Conclusion Environment}, including \textbf{conclusion, assumption, property, remark and solution}\footnote{We also define an option \lstinline{result}, which can hide the \lstinline{solution} and \lstinline{proof} environments. You can switch between \lstinline{result=answer} and \lstinline{result=noanswer}.} environments, all of which begin with boldfaced words, with format consistent with normal paragraphs.
223 \end{itemize}
224
225 All of theorem environments have star versions: \textcolor{main}{\textbf{definition*}}, \textcolor{second}{\textbf{theorem*}}, \textcolor{second}{\textbf{lemma*}}, \textcolor{second}{\textbf{corollary*}}, \textcolor{second}{\textbf{axiom*}}, \textcolor{second}{\textbf{postulate*}}, \textcolor{third}{\textbf{proposition*}}. Environments with an asterisk are not numbered.
226
227 \subsection{Theorem Class Environments}
228
229 \subsubsection{\lstinline{fancy} mode}
230
231 In \lstinline{fancy} mode, the template uses the \lstinline{tcolorbox} package to customize the theorem class environments, it is slightly different from the normal theorem environments. The usage is as follows:
232 \begin{lstlisting}
233 % name + label
234 \begin{theorem}{theorem name}{label}
235 The content of a theorem with name and label.
236 Use \ref{thm:label} to refer this theorem.
237 \end{theorem}
238 % no name + label
239 \begin{theorem}{}{label no name}
240 The content of a theorem without name.
241 Use \ref{thm:label no name} to refer this theorem.
242 \end{theorem}
243 % name + no label
244 \begin{theorem}{theorem name}{}
245 The content of a theorem without label.
246 Can't refer this theorem.
247 The last {} can be removed.
248 \end{theorem}
249 % no name + no label
250 \begin{theorem}{}{}
251 The content of a theorem without name and label.
252 Can't refer this theorem.
253 Both of {} can be removed.
254 \end{theorem}
255 \end{lstlisting}
256
257 The first parameter \lstinline{theorem name} represents the name of the theorem. If the current theorem has no name, please use \lstinline|{}|\cprotect\footnote{Unless this theorem has neither no label, you should not omit this \verb|{}|.}, and the second parameter \lstinline{label} represents the label used in cross-reference with \verb|\ref{thm:label}|. Note that cross-references must be prefixed with \lstinline{thm:}.
258
259 Other theorem class environments with the same usage includes:
260
261 \begin{table}[htbp]
262 \centering
263 \caption{Theorem Class Environments}
264 \begin{tabular}{llll}
265 \toprule
266 Environment & Label text & Prefix & Cross-reference \\
267 \midrule
268 definition & label & def & \lstinline|\ref{def:label}| \\
269 theorem & label & thm & \lstinline|\ref{thm:label}| \\
270 postulate & label & pos & \lstinline|\ref{pos:label}| \\
271 axiom & label & axi & \lstinline|\ref{axi:label}|\\
272 lemma & label & lem & \lstinline|\ref{lem:label}| \\
273 corrlary & label & cor & \lstinline|\ref{cor:label}| \\
274 proposition & label & pro & \lstinline|\ref{pro:label}| \\
275 \bottomrule
276 \end{tabular}%
277 \label{tab:theorem-class}%
278 \end{table}%
279
280 From version 4.1, you can write your theorem environments as follows:
281 \begin{lstlisting}
282 \begin{theorem}[theorem name]\label{thm:theorem-label}
283 The content of theorem.
284 \end{theorem}
285 % or
286 \begin{theorem}\label{thm:theorem-without-name}
287 The content of theorem.
288 \end{theorem}
289 \end{lstlisting}
290
291 In this case, cross-reference don't have to be prefixed, i.e. the parameter of \lstinline{\ref} is the same as that of \lstinline{\label}.
292
293 \subsubsection{\lstinline{simple} mode}
294
295 In \lstinline{simple} mode, the template uses the \lstinline{amsthm} package to customize the theorem class environments. The usage is as follows:
296
297 \begin{lstlisting}
298 \begin{theorem}[theorem name]\label{thm:theorem-label}
299 The content of theorem.
300 \end{theorem}
301 % or
302 \begin{theorem}\label{thm:theorem-without-name}
303 The content of theorem without name.
304 \end{theorem}
305 \end{lstlisting}
306
307 \subsection{Counter for Theorem Environments}
308
309 You can use \lstinline{thmcnt} option to control the theorem counter/number display style for the theorem environments, the acceptable options are \lstinline{chapter} (default) and \lstinline{section}:
310
311 \begin{lstlisting}
312 \documentclass[section]{elegantbook} % turn the Theorem 4.1 to Theorem 4.1.1
313 \documentclass[thmcnt=section]{elegantbook}
314 \end{lstlisting}
315
316
317 \subsection{Other Customized Environments}
318 The other three math environments can be called directly since there are no additional option for them, e.g. \lstinline{example}:
319 \begin{lstlisting}
320 \begin{example}
321 This is the content of example environment.
322 \end{example}
323 \end{lstlisting}
324
325 The effect is as follows:
326
327 \begin{example}
328 This is the content of example environment.
329 \end{example}
330
331 These are all similar environments with slight differences lies in:
332
333 \begin{itemize}
334 \item Example, exercise, problem environments number within chapter;
335 \item Note begins with introductory symbol and proof ends with ending symbol;
336 \item Conclusion and other environments are normal paragraph environments with boldfaced introductory words.
337 \end{itemize}
338
339
340 \section{List Environments}
341 This template uses \lstinline{tikz} to customize the list environments, with \lstinline{itemize} environment customized to the third depth and \lstinline{enumerate} environment customized to fourth depth. The effect is as follows\\[2ex]
342 \begin{minipage}[b]{0.49\textwidth}
343 \begin{itemize}
344 \item first item of nesti;
345 \item second item of nesti;
346 \begin{itemize}
347 \item first item of nestii;
348 \item second item of nestii;
349 \begin{itemize}
350 \item first item of nestiii;
351 \item second item of nestiii.
352 \end{itemize}
353 \end{itemize}
354 \end{itemize}
355 \end{minipage}
356 \begin{minipage}[b]{0.49\textwidth}
357 \begin{enumerate}
358 \item first item of nesti;
359 \item second item of nesti;
360 \begin{enumerate}
361 \item first item of nestii;
362 \item second item of nestii;
363 \begin{enumerate}
364 \item first item of nestiii;
365 \item second item of nestiii.
366 \end{enumerate}
367 \end{enumerate}
368 \end{enumerate}
369 \end{minipage}
370
371
372 \section{Fonts}
373 \textcolor{red}{\bfseries Alert} After v3.10, newtx is reset to cm, together with other two options, the \lstinline{math} font option offers:
374 \begin{enumerate}
375 \item \lstinline{math=cm}(default), use \LaTeX\ default math font (recommended).
376 \item \lstinline{math=newtx}, use \lstinline{newtxmath} math font (may bring about bugs).
377 \item \lstinline{math=mtpro2}, use \lstinline{mtpro2} package to set math font.
378 \end{enumerate}
379
380 If you use \lstinline{newtx} fonts, type in:
381 \begin{lstlisting}
382 \documentclass[math=newtx]{elegantbook}
383 \end{lstlisting}
384
385 When you are using \lstinline{newtx}, please pay attention to the hyphens. For instance,
386 \begin{equation}
387 \int_{R^q} f(x,y) dy.\emph{of\kern0pt f} \sin x
388 \end{equation}
389
390 The corresponding code is:
391 \begin{lstlisting}
392 \begin{equation}
393 \int_{R^q} f(x,y) dy.\emph{of \kern0pt f} \sin x
394 \end{equation}
395 \end{lstlisting}
396
397 \subsection{Symbol Fonts}
398 Feedback from some 3.08 users claims that error occurs when using our templates with \lstinline{yhmath}, \lstinline{esvect} and other packages.
399 \begin{lstlisting}
400 LaTeX Error:
401 Too many symbol fonts declared.
402 \end{lstlisting}
403
404 The reason is that the template redefines font for math so that no new math font is allowed to be added. To use \lstinline{yhmath} and/or \lstinline{esvect}, please locate \lstinline{yhmath} or \lstinline{esvect} in \lstinline{elegantbook.cls}, uncomment corresponding related code.
405
406 \begin{lstlisting}
407 %%% use yhmath pkg, uncomment following code
408 % \let\oldwidering\widering
409 % \let\widering\undefined
410 % \RequirePackage{yhmath}
411 % \let\widering\oldwidering
412
413 %%% use esvect pkg, uncomment following code
414 % \RequirePackage{esvect}
415 \end{lstlisting}
416
417 \section{Bibliography}
418
419 This template uses biblatex to generate the bibliography, the default citestyle and bibliography style are both \lstinline{numeric}. Let's take a glance at the citation effect. ~\cite{en1} use data from a major peer-to-peer lending \cite{en3} marketplace in China to study whether female and male investors evaluate loan performance differently \parencite{en2}.
420
421 If you want to use biblatex, you must create a file named \lstinline{reference.bib}, add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{reference.bib} file, then cite the bibkey in the \lstinline{tex} file. The biber will automatically generate the bibliography for the reference you cited.
422
423 In order to get the editors' auto-completion working, you need to add following code in your preamble:
424
425 \begin{lstlisting}
426 \addbibresource[location=local]{reference.bib}
427 \end{lstlisting}
428
429 Then include the print commands where you want to print the bibliography:
430 \begin{lstlisting}
431 \printbibliography[heading=bibintoc, title=\ebibname]
432 \end{lstlisting}
433
434
435
436
437 To change the bibliography style, this version introduces two options: \lstinline{citestyle} and \lstinline{bibstyle}, please refer to \href{https://ctan.org/pkg/biblatex}{CTAN:biblatex} for more detail about these options. You can change your bibliography style as
438
439 \begin{lstlisting}
440 \documentclass[citestyle=numeric-comp, bibstyle=authoryear]{elegantbook}
441 \end{lstlisting}
442
443 We also add the \lstinline{bibend} option to this template, you can choose \lstinline{biber} (default) or \lstinline{bibtex} as you like, \lstinline{biber} is recommended.
444
445 \begin{lstlisting}
446 \documentclass[bibtex]{elegantbook} % or
447 \documentclass[bibend=bibtex]{elegantbook}
448 \end{lstlisting}
449
450 \section{Preface}
451
452 If you want to add a preface before the first chapter with the number of chapter unchanged, please add the preface in the following way:
453 \begin{lstlisting}
454 \chapter*{Introduction}
455 \markboth{Introduction}{Introduction}
456 The content of introduction.
457 \end{lstlisting}
458
459 \section{Content Option and Depth}
460 Option for content \lstinline{toc}, you can choose either one column(\lstinline{onecol}) or two columns(\lstinline{twocol}). For two columns:
461 \begin{lstlisting}
462 \documentclass[twocol]{elegantbook}
463 \documentclass[toc=twocol]{elegantbook}
464 \end{lstlisting}
465
466 Default content depth is 1, use to use \lstinline|\setcounter{tocdepth}{2}|.
467
468 \section{Introduction Environment}
469 We create a introduction environment to display the structure of chapter. The basic useage is as follows:
470 \begin{lstlisting}
471 \begin{introduction}
472 \item Definition of Theorem
473 \item Ask for help
474 \item Optimization Problem
475 \item Property of Cauchy Series
476 \item Angle of Corner
477 \end{introduction}
478 \end{lstlisting}
479 And you will get:
480 \begin{introduction}
481 \item Definition of Theorem
482 \item Ask for help
483 \item Optimization Problem
484 \item Property of Cauchy Series
485 \item Angle of Corner
486 \end{introduction}
487
488 You can change the title of this environment by modifying the optional argument of this environment:
489 \begin{lstlisting}
490 \begin{introduction}[Brief Introduction]
491 ...
492 \end{introduction}
493 \end{lstlisting}
494
495 %\section{Problem Set}
496 The environment \lstinline{problemset} is used at the end of each chapter to display corresponding exercises. Just type in the following sentences:
497 \begin{lstlisting}
498 \begin{problemset}
499 \item exercise 1
500 \item exercise 2
501 \item exercise 3
502 \end{problemset}
503 \end{lstlisting}
504 And you will get:
505 \begin{problemset}
506 \item exercise 1
507 \item exercise 2
508 \item exercise 3
509 \item math equation test:
510 \begin{equation}
511 a^2+b^2=c_{2_{i}} (1,2) [1,23]
512 \end{equation}
513 \end{problemset}
514 \begin{remark}
515 If you want to customize the title of \lstinline{problemset}, please change the optional argument like in introduction environment. In this version the \lstinline{problemset} environment automatically appears in the table of contents but not in the header or footer(to be fixed).
516 \end{remark}
517
518 \begin{solution}
519 If you want to customize the title of \lstinline{problemset}, please change the optional argument like in introduction environment. In this version the \lstinline{problemset} environment automatically appears in the table of contents but not in the header or footer(to be fixed).
520 \end{solution}
521
522 \section{Margin Notes}
523 In 3.08, we introduced \lstinline{marginpar=margintrue} and \lstinline{\elegantpar} (Beta) with piles of bugs. Hence we decide to remove them in 3.09 and will suspend the options till revolutionary optimization. Sorry for all the bugs! However, we retain the option \lstinline{marginpar} for users to get margin motes by activating \lstinline{marginpar=margintrue} and using \lstinline{\marginpar} or \lstinline{marginnote} packages.
524
525 \begin{remark}
526 Note that text and equation are both available in the margin notes.
527 \begin{lstlisting}
528 % text
529 \marginpar{margin paragraph text}
530
531 % equation
532 \marginpar{
533 \begin{equation}
534 a^2 + b^2 = c^2
535 \end{equation}
536 }
537 \end{lstlisting}
538
539 For tables and figures, note that floating environment is not allowed. You have to use \lstinline{includegraphics} or \lstinline{table} and use \lstinline{\captionof} to name it. To get centralized figures or tables, use \lstinline{\centerline} or \lstinline{center}. To learn more, please refer to \href{https://tex.stackexchange.com/questions/5583/caption-of-figure-in-marginpar-and-caption-of-wrapfigure-in-margin}{Caption of Figure in Marginpar}.
540
541 \begin{lstlisting}
542 % graph with centerline command
543 \marginpar{
544 \centerline{
545 \includegraphics[width=0.2\textwidth]{logo.png}
546 }
547 \captionof{figure}{your figure caption}
548 }
549
550 % graph with center environment
551 \marginpar{
552 \begin{center}
553 \includegraphics[width=0.2\textwidth]{logo.png}
554 \captionof{figure}{your figure caption}
555 \end{center}
556 }
557 \end{lstlisting}
558
559 \end{remark}
560
561
562
563 \chapter{ElegantBook Writing Sample}
564
565 \begin{introduction}
566 \item Theorem Class Envrionments
567 \item Cross Reference
568 \item Math Environments
569 \item List Environments
570 \item Logo and Base
571 \item $a^2+b^2=c^2$
572 \end{introduction}
573
574
575 \lipsum[1]
576 % source: https://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/Theorems.html
577
578 \section{Writing Sample}
579
580 We will define the integral of a measurable function in three steps. First, we define the integral of a nonnegative simple function. Let $E$ be the measurable set in $\mathcal{R}^N$.
581
582 \begin{definition}[Left Coset]
583 Let $H$ be a subgroup of a group~$G$. A \emph{left coset} of $H$ in $G$ is a subset of $G$ that is of the form $xH$, where $x \in G$ and $xH = \{ xh : h \in H \}$. Similarly a \emph{right coset} of $H$ in $G$ is a subset of $G$ that is of the form $Hx$, where $Hx = \{ hx : h \in H \} \hbar$
584 \end{definition}
585
586 \begin{note}
587 Note that a subgroup~$H$ of a group $G$ is itself a left coset of $H$ in $G$.
588 \end{note}
589
590 \lipsum[2]
591
592 \begin{theorem}[Lagrange's Theorem] \label{thm:lg}
593 Let $G$ be a finite group, and let $H$ be a subgroup of $G$. Then the order of $H$ divides the order of $G$.
594 \end{theorem}
595
596 As theorem \ref{thm:lg} refered.
597
598 \lipsum[3]
599
600
601 \begin{theorem}{theorem name}{label text}
602 The content of theorem.
603 \end{theorem}
604
605 we can refer this theorem as \ref{thm:label text}.
606
607
608 \begin{proposition}[Size of Left Coset]
609 Let $H$ be a finite subgroup of a group $G$. Then each left coset of $H$ in $G$ has the same number of elements as $H$.
610 \end{proposition}
611
612 \begin{proof}
613 Let $z$ be some element of $xH \cap yH$. Then $z = xa$ for some $a \in H$, and $z = yb$ for some $b \in H$. If $h$ is any element of $H$ then $ah \in H$ and $a^{-1}h \in H$, since $H$ is a subgroup of $G$. But $zh = x(ah)$ and $xh = z(a^{-1}h)$ for all $h \in H$. Therefore $zH \subset xH$ and $xH \subset zH$, and thus $xH = zH$. Similarly $yH = zH$, and thus $xH = yH$, as required.
614 \end{proof}
615
616 \begin{figure}[htbp]
617 \centering
618 \includegraphics[width=0.6\textwidth]{scatter.jpg}
619 \caption{Matplotlib: Scatter Plot Example\label{fig:scatter}}
620 \end{figure}
621
622 Regression analysis is a powerful statistical method that allows you to examine the relationship between two or more variables of interest. While there are many types of regression analysis, at their core they all examine the influence of one or more independent variables on a dependent variable. The process of performing a regression allows you to confidently determine which factors matter most, which factors can be ignored, and how these factors influence each other.
623
624 Let's continue using our application training example. In this case, we'd want to measure the historical levels of satisfaction with the events from the past three years or so, as well as any information possible in regards to the independent variables.
625
626 \section{Second section}
627 This second section\index{S!section} may include some special word,
628 and expand the ones already used\index{keywords!used}.
629
630
631 \begin{table}[htbp]
632 \small
633 \centering
634 \caption{Auto MPG and Price \label{tab:reg}}
635 \begin{tabular}{lcc}
636 \toprule
637 & (1) & (2) \\
638 \midrule
639 mpg & -238.90*** & -49.51 \\
640 & (53.08) & (86.16) \\
641 weight & & 1.75*** \\
642 & & (0.641) \\
643 constant & 11,253*** & 1,946 \\
644 & (1,171) & (3,597) \\
645 obs & 74 & 74 \\
646 $R^2$ & 0.220 & 0.293 \\
647 \bottomrule
648 \multicolumn{3}{l}{\scriptsize Standard errors in parentheses} \\
649 \multicolumn{3}{l}{\scriptsize *** $p < 0.01$, ** $p<0.05$, * $p<0.1$} \\
650 \end{tabular}%
651 \end{table}%
652
653 \lipsum[1-2]
654
655 \begin{itemize}
656 \item Routing and resource discovery;
657 \begin{itemize}
658 \item Language Models
659 \item Vector Space Models
660 \end{itemize}
661 \item Resilient and scalable computer networks;
662 \item Distributed storage and search.
663 \end{itemize}
664
665 %\problemset
666 \begin{problemset}
667 \item Solve the equation $5(- 3x - 2) - (x - 3) = -4(4x + 5) + 13$.
668 \item Find the distance between the points $(-4 , -5)$ and $(-1 , -1)$.
669 \item Find the slope of the line $5x - 5y = 7$.
670 \end{problemset}
671
672
673 \chapter{FAQ}
674 We list some FAQs for users to refer to:
675 \begin{enumerate}
676 \item \question{Why option numbers for natbib fail to take effect in v3.07?}
677 In v3.07, when \lstinline{gbt7714} is introduced, option \lstinline{authoryear} is incompatible with \lstinline{natbib}. In v3.08 and 3.09, \lstinline{numbers}, \lstinline{numbers}, \lstinline{super} and \lstinline{authoryear} are introduced.
678 \item \question{I want to customize font and background color.}
679 Please use \lstinline{pagecolor} to change background color, refer to \href{https://tex.stackexchange.com/questions/278544/xcolor-what-is-the-equivalent-of-default-text-color}{this} to customize font.
680 \item \question{Which version should I choose?}
681 Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX~Live 2025.
682 \item \question{Which editor should I choose?}
683 You can use \TeX~Live 2025 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works autocomplete}. \TeX~Live 2025 + \TeX studio is strongly recommended. Related configurations can be found at \href{https://github.com/EthanDeng/vscode-latex}{vscode-latex} and \href{https://github.com/EthanDeng/sublime-text-latex}{sublime-text-latex}.
684 \item \question{Hello, we want to use ElegantBook to write a book about machine learning and would like your authorization.}
685 Feel free to use our templates by pointing out our copyright. For other issues, please refer to LPPL-1.3c. If you want to show us your work, you can share the URL with us afterwards.
686 \item \question{What is cross reference?}
687 This template is aimed at who are not a complete beginner for \LaTeX. Please learn more about \LaTeX\ before using this template.
688 \item \question{Is the language for code highlighting optional?}
689 Yes, \lstinline{listings} package is used in ElegantBook, hence language is optional(e.g. \lstinline{language=Python}). For global setting, use \lstinline{lstset}. For more information, please refer to package documentations.
690 \item \question{When will Beamer template (ElegantSlide or ElegantBeamer) forthcoming?}
691 Since there is an excellent theme \href{https://github.com/matze/mtheme}{Metropolis}, no plan for Beamer theme.
692 \end{enumerate}
693
694 \chapter{Version History}
695 We revised our templates now and then. This section shows the version story of ElegantBook.
696
697 \datechange{2026/02/27}{release of v4.6} \textcolor{blue}{\bfseries Maintenance Resumed}
698
699 \begin{change}
700 \item Maintenance resumed under new maintainer Osbert Wang.
701 \item Template re-released due to large user base.
702 \item Updated to support \TeX~Live 2025 and current operating systems (Windows 11, Ubuntu 24.04 LTS, macOS).
703 \end{change}
704
705 \datechange{2022/12/31}{release of v4.5.} \textcolor{red}{\bfseries Stop Maintenance}
706
707 \begin{change}
708 \item Add new document option \lstinline|usesamecnt| for same thm counter for all theme environments;
709 \item Add 5-th optional parameter for \lstinline|elegantnewtheorem|.
710 \end{change}
711
712
713 \datechange{2022/08/15}{release of v4.4.}
714
715 \begin{change}
716 \item Add custome theorem definition command \lstinline{\elegantnewtheorem};
717 \item Fix star environment(*) for inner environments (\href{https://github.com/ElegantLaTeX/ElegantBook/issues/167}{issue \#167});
718 \item Change English fonts from TeX Gyre Termes to TeX Gyre TermesX;
719 \item Re-construct some theorem environments to enchance compatibility;
720 \item Remove Gitee repo due the privacy policy;
721 \item Re-open Github pull requests.
722 \end{change}
723
724
725
726
727 \datechange{2022/04/09}{release of v4.3.}
728
729 \begin{change}
730 \item Remove part newtx settings, set TeX Gyre Termes/Heros fonts under \hologo{XeLaTeX}.
731 \item Fix Chinese fonts in the theorem environments.
732 \item Add theorem counter option, \lstinline{thmcnt=section}.
733 \item Add bib option \lstinline{bibend}, which can take value of biber and bibtex.
734 \item \textbf{! Warnings}: The multilingual option may cause some unexpected errors, you can report in this \href{https://github.com/ElegantLaTeX/ElegantBook/issues/170}{issue}.
735 \end{change}
736
737
738
739 \datechange{2022/03/08}{release of v4.2.}
740
741 \begin{change}
742 \item Bug fix due to the update of newtx fonts;
743 \item Add `Chapter' in TOC, and redefine \lstinline{\chaptername} to unify the logic under different languages;
744 \item Add language option for Japanese, \lstinline{lang=jp}.
745 \end{change}
746
747
748 \datechange{2021/05/02}{release of v4.1.}
749
750 \begin{change}
751 \item \textbf{! Big Change}: Change the bibliography method from \hologo{BibTeX} to biblatex(with backend \lstinline{biber});
752 \item \textbf{! Big Change}: Add support for the default theorem writing method (with optional name and label);
753 \item Add left and right space;
754 \item Support hyperlink from the text of TOC;
755 \item Remove the \hologo{pdfLaTeX} compatiblity check for Chinese.
756 \item Add multilingual support, for french \lstinline{lang=fr}, dutch \lstinline{lang=nl}, Hungarian \lstinline{lang=hu}, Spanish \lstinline{lang=es}, Mongolian \lstinline{lang=mn} etc.
757 \end{change}
758
759 \datechange{2020/04/12}{release of v3.11, \textcolor{red}{\textbf{LAST} version of 3.x}.}
760
761
762 \begin{change}
763 \item \textbf{! Fix}: Fix \lstinline{natbib option clash} problems caused by \lstinline{gbt7714} updates.
764 \item Remove \lstinline{base} decorations and its options since \lstinline{pgfornament} package is not included in \TeX~Live 2020.
765 \item Fix spacing problem in some environments.
766 \item Introduce language option for Italian, \lstinline{lang=it}.
767 \end{change}
768
769
770 \datechange{2020/02/10}{release of v3.10}
771
772 \begin{change}
773 \item Introduce \lstinline{math} for math font, optional styles are \lstinline{newtx} and \lstinline{cm}.\\
774 \textbf{Notice}: The math font \lstinline{newtxmath} in previous versions is reset to default \LaTeX\ math font, to keep previous math font, please declare \lstinline{math=newtx}.
775 \item Introduce \lstinline{chinesefont} option, with \lstinline{founder}, \lstinline{ctexfont} and \lstinline{nofont} available.
776 \item Turn author information on the cover optional and add customized command \lstinline{\bioinfo}.
777 \item Add version history with command \lstinline{\datechange} and environment \lstinline{change}.
778 \item Add Chinese chapter style \lstinline{scheme} with option \lstinline{chinese}.
779 \item Since the bug raised by \lstinline{\lvert} is fixed, exchange package positions of \lstinline{ctex} and \lstinline{amsmath}.
780 \item Drop \lstinline{\lastpage} from header to avoid page anchor bug and adding \lstinline{\frontmatter}.
781 \item Revise bibliography option \lstinline{cite} with optional styles \lstinline{numbers},\lstinline{authoryear} and \lstinline{super}.
782 \item Introduce bibliography style option \lstinline{bibstyle}, with default bib style \lstinline{apalike} for English mode and \lstinline{gbt7714} package for Chinese mode.
783 \end{change}
784
785 \datechange{2019/08/18}{release of v3.09}
786
787 \begin{change}
788 \item Remove \lstinline{\elegantpar} temporary and remind users to use \lstinline{\marginnote} and \lstinline{\marginpar} instead.
789 \item Use \lstinline{esint} to display integral operator.
790 \item Add new command \lstinline{toc}, with options \lstinline{onecol} and \lstinline{twocol}.
791 \item Add new option \lstinline{cite} \lstinline{super} for superscript-displayed citation.
792 \item Revise \lstinline{problemset}.
793 \end{change}
794
795
796 \nocite{en2,en3}
797
798 \printbibliography[heading=bibintoc, title=\ebibname]
799 \appendix
800
801
802 \chapter{Mathematical Tools}
803
804 This appendix covers some of the basic mathematics used in econometrics. We briefly discuss the properties of summation operators, study the properties of linear and some nonlinear equations, and review the ratios and percentages. We also introduce some special functions that are common in econometrics applications, including quadratic functions and natural logarithms. The first four sections require only basic algebraic techniques. The fifth section briefly reviews differential Calculus Although Calculus is not necessary to understand much of this book, it is used in some of the end-of-chapter appendices and in some of the more advanced topics in part 3.
805
806 \section{Summation Operator and Description Statistics}
807
808 \textbf{Summation Operator} is an abbreviation used to express the summation of numbers, it plays an important role in statistics and econometrics analysis. If $\{x_i: i=1, 2, \ldots, n\}$ is a sequence of $n$ numbers, the summation of the $n$ numbers is:
809
810 \begin{equation}
811 \sum_{i=1}^n x_i \equiv x_1 + x_2 +\cdots + x_n
812 \end{equation}
813
814
815 \end{document}