An Elegant L TEX Template For Books
An Elegant L TEX Template For Books
An Elegant L TEX Template For Books
1 ElegantLATEX Templates 1
1.1 ElegantBook Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Installation and Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Online Usage of Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 User’s Selected Works Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 About Pull Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 Recruit Support Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.7 Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.8 Donation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 ElegantBook Settings 5
2.1 Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Device Mode Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Color Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Chapter Title Display Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.5 Theorem Class Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.6 Base Hide Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.7 Cover and Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.8 List Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.9 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.10 Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.11 Introduction Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.12 Problem Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Chapter 2 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.13 Margin Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.14 Hyphens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.15 Symbol Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4 FAQ 16
CONTENTS – 2/18 –
A Mathematical Tools 17
A.1 Summation Operator and Description Statistics . . . . . . . . . . . . . . . . . 17
B A Minimal Example 18
Chapter 1 ElegantLATEX Templates
ElegantLATEX Program developers are intended to provide you beautiful, elegant, user-
friendly templates. Currently, the ElegantLATEX is composed of ElegantNote, ElegantBook,
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
issues or email us at elegantlatex2e@gmail.com.
Contact Infos:
Homepage: https://elegantlatex.org/
Github: https://github.com/ElegantLaTeX/
CTAN: https://ctan.org/pkg/elegantbook
Wiki: https://github.com/ElegantLaTeX/ElegantBook/wiki
Download: release, latest version
Weibo: ElegantLaTeX
Wechat: ElegantLaTeX
QQ: 692108391
Email: elegantlatex2e@gmail.com
Both portable version and installation package are available for this template.
For portable version, simply download lastest ElegantBook-master from Github or CTAN
(to be more accurate, download 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
cls now and then.
1.3 Online Usage of Templates – 2/18 –
If you are a TEX Live 2019 user, using the tlshell1 of TEX Live 2019 direct installation
package is strongly recommended. Simply search and open tlshell, click on File -> Load
Default Repository or customize repository by Options. Wait till the repository loads
successfully, search elegantbook by name, installation and update is just a click away.
If you are a TEX Live 2018 user and would like to update to TEX Live 2019, the official
solution is to uninstall 2018. If you want to save the bother of uninstallation and installation,
please copy elegantbook.cls to the installation directory of TEX Live 2018 (default: C:
\texlive\2018\texmf-dist\tex\latex\elegantbook ), run texhash in cmd.
Excuse me? You are a CTEX user? Sorry, this template is incompatible with CTEX.
For more details about the installation and usage of TEX Live 2019, the compatibility of CTEX
and TEX Live, please refer to OG (Official Guide) and/or Install LaTeX v5.1 by OsbertWang.
Considering the online usage of the templates, all the templates are available on Overleaf.
Those who enjoy smooth network may feel free to use the templates without TEX Live and to visit
your documents anywhere anytime. Search elegantlatex on Overleaf or visit search result,
choose the one you prefer and save it to your account, then you can edit yourself or corporate
with others if you like. For more infomation about Overleaf, please refer to Overleaf OG.
Eight years have passed since the found of ElegantLATEX Program. It’s an honor that our
templates are preferred by a lot of users. Hence, in order to promote more interactions among
our users and know more about what you need, we are planning to provide a platform to display
selected works of our users on Github or our homepage. If you want to show us your work(s),
contact us via Email or other ways. Or if you have upload your work(s) on Github or Gitee etc.,
share the URL(s) with us.
Wanted!
For some reasons, pull request is unacceptable since May 20, 2019. For those who want
to help revise the templates, submit issues or clone to your own repository to modify under the
constriction of LPPL-1.3c.
Recruit Support Members for ElegantLATEX to translate template OGs(Chinese -> English),
maintain wiki entries using Markdown, update Wechat articles. No deadline for this recruitment.
So far, ElegantLATEX has four Support Members:
OG Translator: YPY;
Wiki Maintainer: Ingo Zinngo, Xiaohao890809;
QQ Group Manager: Sikouhjw.
1.7 Acknowledgement
The number of stars on Github for ElegantBook reached 100 on May 20, 20192.
Thank ChinaTEX and LATEX studio for their promotion. LATEX studio offers tons of valuable
posts and templates for discovery. It is the most comprehensive website on LATEX in China.
If you like our template, star on Github.
1.8 Donation
To express your love for our templates and/or our developers, please do not hesitate to tip
us. Since last release of 3.08, we have received about a thousand RMB! (The emergence of a
millionaire is on the way. Loading... )
The explanation right of the tip usage belongs to ElegantLATEX with no supervision. Feel
free to tip us. Those who donate more than 10 RMB will be recorded in the Donation List.
Thank all the tippers!
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 device option). The default
encoding is UTF-8 while TEX Live is recommended. The test environment is Win10 + TEX Live
2019, either PDFLaTeX or XeLaTeX works fine.
2.1 Languages
We defined one option named lang which has two alternative values, lang=en (default)
and lang=cn. Different values will alter the captions of figure/table, abstract name, refname,
etc. You can use this option as
\documentclass[en]{elegantbook}
\documentclass[lang=en]{elegantbook}
Remark Chinese Characters are acceptable whenever lang=en or lang=cn. If you would like
to include Chinese characters under (lstlisting) environment, please use XeLaTeX to compile.
The option for device (device) was originally used in ElegantNote, now we include this
option in ElegantBook1 as well. Activate iPad mode in the following way2:
\documentclass[pad]{elegantbook} %or
\documentclass[device=pad]{elegantbook}
This template contains 5 color themes, i.e. green3, cyan, blue(default), gray, black.
You can choose green with
\documentclass[green]{elegantbook} %or
\documentclass[color=green]{elegantbook}
If you want to customize the colors, please select nocolor or use color=none and declare
the main, second, and third colors in the preamble section as follows:
third proposition
\definecolor{structurecolor}{RGB}{60,113,183}
\definecolor{main}{RGB}{0,166,82}%
\definecolor{second}{RGB}{255,134,24}%
\definecolor{third}{RGB}{0,174,247}%
This template contains 2 sets of title display styles,hang(default) and display style. For the
former, chapter title is displayed on a single line (hang). For the latter, chapter title is displayed
on a double line (display).In this guide, we use hang . To change display style
\documentclass[hang]{elegantbook} %or
\documentclass[titlestyle=hang]{elegantbook}
We defined two sets of theorem modes, simple style and fancy style (default). You may
change to simple mode by
\documentclass[simple]{elegantbook} %or
\documentclass[mode=simple]{elegantbook}
Since the template uses the tcolorbox package to customize the theorem class environ-
ments, it is slightly different from the normal theorem environments. The usage is as follows:
\begin{theorem}{<theorem name>}{<label>}
The content of theorem.
\end{theorem}
The first parameter <theorem name> represents the name of the theorem, and the second
parameter label represents the label used in cross-reference with ref{thm:label}. Note that
cross-references must be prefixed with thm:.
Other theorem class environments with the same usage includes:
Table 2.2: Theorem Class Environments
The other three math environments can be called directly since there are no additional option
for them, e.g. example:
\begin{example}
This is the content of example environment.
\end{example}
These are all similar environments with slight differences lies in:
4We also define an option result, which can hide the solution and proof environments. You can switch between
result=answer and result=noanswer
2.6 Base Hide Option – 8/18 –
Hiding the end-of-chapter and end-of-page base is optional, simply type in:
\documentclass[hide]{elegantbook} %or
\documentclass[base=hide]{elegantbook}
The cover image used in this template is from pixabay.com5. The image is completely free
and can be used under any circumstance. The cover image size is 1280 × 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: fotor.com. Feel free to join our QQ Group to get more elegant
covers.
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.
This template uses tikz to customize the list environments, with itemize environment
customized to the third depth and enumerate environment customized to fourth depth. The
effect is as follows
first item of nesti; 1. first item of nesti;
second item of nesti; 2. second item of nesti;
first item of nestii; (a). first item of nestii;
second item of nestii; (b). second item of nestii;
first item of nestiii; I. first item of nestiii;
second item of nestiii. II. second item of nestiii.
2.9 Bibliography
This template uses BIBTEX to generate the bibliography, the default bibliography style is
aer. Let’s take a glance at the citation effect. ? use data from a major peer-to-peer lending
5Thank ChinaTEX for providing free image source, pexels.com is strongly recommended.
2.10 Preface – 9/18 –
marketplace in China to study whether female and male investors evaluate loan performance
differently.
If you want to use BIBTEX, you must create a file named reference.bib, add bib items
(from Google Scholar, Mendeley, EndNote, and etc.) to reference.bib file, then cite the
bibkey in the tex file. The BibTEX will automatically generate the bibliography for the reference
you cited. If you want to add some noncited reference to the bibliography, you can use
\nocite{EINAV2010,Havrylchyk2018} %or include some bibitems
\nocite{*} %include all the bibitems
2.10 Preface
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:
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\markboth{Preface}{}
The content of Preface.
We create a introduction environment to display the structure of chapter. The basic useage
is as follows
\begin{introduction}
\item Definition of Theorem
\item Ask for help
\item Optimization Problem
\item Property of Cauchy Series
\item Angle of Corner
\end{introduction}
2.12 Problem Set – 10/18 –
Introduction
h Definition of Theorem h Property of Cauchy Series
h Ask for help h Angle of Corner
h Optimization Problem
You can change the title of this environment by modifying the optional argument of this
environment:
\begin{introduction}[Brief Introduction]
...
\end{introduction}
The environment problemset is used at the end of each chapter to display corresponding
exercises. Just type in the following sentences:
\begin{problemset}
\item exercise 1
\item exercise 2
\item exercise 3
\end{problemset}
K Chapter 2 Exercise k
1. exercise 1
2. exercise 2
3. exercise 3
Remark If you want to customize the title of problemset, please change the optional argument
like in introduction environment. In this version the problemset environment automatically
appears in the table of contents but not in the header or footer.
Remark
Note that text and equation are both available in the margin notes.
% text
\marginpar{margin paragraph text}
% equation
\marginpar{
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
}
For tables and figures, note that floating environment is not allowed. You have to use
includegraphics or table and use \captionof to name it. To get centralized figures or
tables, use \centerline or center. To learn more, please refer to Caption of Figure in
Marginpar.
% graph with centerline command
\marginpar{
\centerline{
\includegraphics[width=0.2\textwidth]{logo.png}
}
\captionof{figure}{your figure caption}
}
2.14 Hyphens
Since the template uses newtx, please pay attention to the hyphens. For instance,
ˆ
𝑓 (𝑥, 𝑦)𝑑𝑦.off (2.1)
𝑅𝑞
The corresponding code is:
\begin{equation}
\int_{R^q} f(x,y) dy.\emph{of \kern0pt f}
\end{equation}
2.15 Symbol Fonts – 12/18 –
Feedback from some 3.08 users claims that error occurs when using our templates with
yhmath, esvect and other packages.
LaTeX Error:
Too many symbol fonts declared.
The reason is that the template redefines font for math so that no new math font is allowed to
be added. To use yhmath and/or esvect, please locate yhmath or esvect in elegantbook.cls,
uncomment corresponding related code.
%%% use yhmath pkg, uncomment following code
% \let\oldwidering\widering
% \let\widering\undefined
% \RequirePackage{yhmath}
% \let\widering\oldwidering
Introduction
h Theorem Class Envrionments h List Environments
h Cross Reference h Logo and Base
h Math Environments h 𝑎2 + 𝑏2 = 𝑐2
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy
eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant
morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras
viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus
sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc.
Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada
eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus.
Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci
dignissim rutrum.
We will define the integral of a measurable function in three steps. First, we define the
integral of a nonnegative simple function. Let 𝐸 be the measurable set in R 𝑁 .
Definition 3.1. Left Coset
Let 𝐻 be a subgroup of a group 𝐺. A left coset of 𝐻 in 𝐺 is a subset of 𝐺 that is of the
form 𝑥𝐻, where 𝑥 ∈ 𝐺 and 𝑥𝐻 = {𝑥ℎ : ℎ ∈ 𝐻}. Similarly a right coset of 𝐻 in 𝐺 is a
subset of 𝐺 that is of the form 𝐻𝑥, where 𝐻𝑥 = {ℎ𝑥 : ℎ ∈ 𝐻} ℏ
♣
Note Note that a subgroup 𝐻 of a group 𝐺 is itself a left coset of 𝐻 in 𝐺.
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non
justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed
accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et
nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt
urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
3.1 Writing Sample – 14/18 –
Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at, tincidunt tris-
tique, libero. Vivamus viverra fermentum felis. Donec nonummy pellentesque ante. Phasellus
adipiscing semper elit. Proin fermentum massa ac quam. Sed diam turpis, molestie vitae,
placerat a, molestie nec, leo. Maecenas lacinia. Nam ipsum ligula, eleifend at, accumsan nec,
suscipit a, ipsum. Morbi blandit ligula feugiat magna. Nunc eleifend consequat lorem. Sed
lacinia nulla vitae enim. Pellentesque tincidunt purus vel magna. Integer non enim. Praesent
euismod nunc eu purus. Donec bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec
et mi. Nam vulputate metus eu enim. Vestibulum pellentesque felis eu massa.
Proposition 3.1. Size of Left Coset
Let 𝐻 be a finite subgroup of a group 𝐺. Then each left coset of 𝐻 in 𝐺 has the same
number of elements as 𝐻.
♠
Proof Let 𝑧 be some element of 𝑥𝐻 ∩ 𝑦𝐻. Then 𝑧 = 𝑥𝑎 for some 𝑎 ∈ 𝐻, and 𝑧 = 𝑦𝑏 for some 𝑏 ∈ 𝐻.
If ℎ is any element of 𝐻 then 𝑎ℎ ∈ 𝐻 and 𝑎 −1 ℎ ∈ 𝐻, since 𝐻 is a subgroup of 𝐺. But 𝑧ℎ = 𝑥(𝑎ℎ) and
𝑥ℎ = 𝑧(𝑎 −1 ℎ) for all ℎ ∈ 𝐻. Therefore 𝑧𝐻 ⊂ 𝑥𝐻 and 𝑥𝐻 ⊂ 𝑧𝐻, and thus 𝑥𝐻 = 𝑧𝐻. Similarly 𝑦𝐻 = 𝑧𝐻,
and thus 𝑥𝐻 = 𝑦𝐻, as required.
1.0
0.8
0.6
0.4
0.2
0.0
0.0 0.2 0.4 0.6 0.8 1.0
Regression analysis is a powerful statistical method that allows you to examine the rela-
tionship 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.
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
3.1 Writing Sample – 15/18 –
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy
eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant
morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras
viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus
sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc.
Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada
eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus.
Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci
dignissim rutrum.
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non
justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed
accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et
nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt
urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Routing and resource discovery;
Language Models
Vector Space Models
Resilient and scalable computer networks;
Distributed storage and search.
K Chapter 3 Exercise k
Question Hello, we want to use ElegantBook to write a book about machine learning and would
like your authorization.
Solution 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, share the URL with us afterwards.
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.
𝑛
X
𝑥𝑖 ≡ 𝑥1 + 𝑥2 + · · · + 𝑥 𝑛 (A.1)
𝑖=1
Appendix A Minimal Example
\documentclass{elegantbook}
% title info
\title{Title}
\subtitle{Subtitle is here}
% bio info
\author{Your Name}
\institute{XXX University}
\date{\today}
% extra info
\version{1.00}
\extrainfo{Victory won\rq t come to us unless we go to it. --- M. Moore}
\logo{logo.png}
\cover{cover.jpg}
\begin{document}
\maketitle
\tableofcontents
\mainmatter
\hypersetup{pageanchor=true}
% add preface chapter here if needed
\chapter{Example Chapter Title}
The content of chapter one.
\bibliography{reference}
\end{document}