\documentclass{elegantbook} \title{An Elegant \LaTeX{} Template for Books} \subtitle{Classic Elegant\LaTeX{} Template} \author{Ethan Deng \& Liam Huang} \institute{Elegant\LaTeX{} Program} \date{\today} \version{3.06} \equote{Victory won\rq t come to us unless we go to it. --- M. Moore} \logo{logo.png} \cover{cover.jpg} \begin{document} \maketitle \tableofcontents \clearpage \thispagestyle{empty} \mainmatter \hypersetup{pageanchor=true} \chapter{Elegant\LaTeX{} Templates} On the occasion of this release, we, Elegant\LaTeX{} Program, want to reintroduce our work to you. We are committed to creating a series of beautiful, elegant, easy to use \LaTeX{} templates for users. The Elegant\LaTeX{} is currently composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} for typesetting notes, books, and working papers respectively. The latest version is available on \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Github:ElegantBook/releases}. This guide describes some settings of this template and how to use it. If you have any other questions, suggestions or comments, please feel free to contact us. \section{ElegantBook Updates} Over these years, we've received a lot of feedback from users, with major issues related to font installation, coding support, theorem class environments floats, theorem cross-page, cross-references, and etc. We really think about these problems, it wasn't elegant to let the user install the font for visual beauty since users got into a lot of trouble, which went against the concept of our template. So we've removed that from the new version, users don't have to install any fonts. Let's take a look at the ElegantBook template 3.x updates: \begin{enumerate} \item Remove custom font settings and use the \lstinline{ctex} package or system font instead; \item Add English and Chinese modes(\lstinline{lang=cn/en}); \item \lstinline{PDFLaTeX} 与 \lstinline{XeLaTeX} Support; \item Use the \lstinline{tcolorbox} package to re-written the theorem class environments, which can span over pages; \item Theorem class environments name updated, and cross-references fixed; \item Color name updated, link color unified; \item New Elegant\LaTeX{} Logo; \item New cover and decorations, remove the watermark; \item Fix appendix; \item Add gray theme: \lstinline{color=plain}; \item Add code highlighting; \item Beautify the list environment. \end{enumerate} \chapter{ElegantBook Settings} \section{Compilation Methods} This template is based on the Standard LaTeX book class, so the options of book class also work. The default encoding is UTF-8, and \TeX{} Live is recommended. The test environment is Win10 + \TeX{} Live 2018. \subsection[Compile with PDFLaTeX]{Compile with \lstinline{PDFLaTeX}} If you choose \lstinline{PDFLaTeX} to process your book, the default article font computer modern has changed to \lstinline{newtx} series, and the default font size is set to \lstinline{11pt}. The fonts are settings with: \begin{itemize} \item \lstinline{newtxtext} package for text fonts, similar to times new roman font. \item \lstinline{newtxmath} package for math fonts, close to \lstinline{times} package. \item \lstinline{FiraMono} package for typewriter fonts, with option \lstinline{scale=0.7}. \item \lstinline{ctex} package for Chinese fonts, with option \lstinline{scheme=plain}. \end{itemize} A full compilation chain:\lstinline[breaklines]{PDFLaTeX -> BibTeX -> PDFLaTeX*2}. \subsection[Compile with XeLaTeX]{Compile with \lstinline{XeLaTeX}} If you choose \lstinline{XeLaTeX} to process your book, we use \lstinline{fontspec} package and \lstinline{xeCJK} package. we used fonts available in Windows, if you are using Linux or Mac OS, please substitute these fonts with that of your system. \begin{lstlisting}[frame=single] \RequirePackage{fontenc} \RequirePackage[no-math]{fontspec} \setmainfont{Times New Roman}[NFSSFamily=ntxtlf] \setsansfont{Arial} %\setmonofont[Scale=0.7]{Courier New} \RequirePackage{xeCJK} \RequirePackage{xunicode} \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun} \setCJKsansfont[BoldFont={SimHei},ItalicFont={KaiTi}]{KaiTi} \setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.7]{Microsoft YaHei} \XeTeXlinebreaklocale "zh" \XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt \RequirePackage{newtxmath} \end{lstlisting} A full compilation chain:\lstinline[breaklines]{XeLaTeX -> BibTeX -> XeLaTeX*2}. \section{Languages} We defined one option named \lstinline{lang}, this option has two alternative values, \lstinline{lang=en} (default) or \lstinline{lang=cn}. \lstinline{lang=cn} will make the caption of figure/table, abstract name, refname etc. Chinese, while \lstinline{lang=en} will keep all these stuff English, as the default article class sets. You can use this option as \begin{lstlisting}[frame=none] \documentclass[cn]{elegantbook} \documentclass[lang=cn]{elegantbook} \documentclass[en]{elegantbook} \documentclass[lang=en]{elegantbook} \end{lstlisting} \begin{remark} You can input Chinese Character in either \lstinline{lang=en} or \lstinline{lang=cn}. If you are using (\lstinline{lstlisting}) environment, and it contains Chinese characters, please use \lstinline{XeLaTeX}. \end{remark} \section{Color Themes} This template contains 4 color themes,they are \textcolor{main1}{\lstinline{green}} (default), \textcolor{main2}{\lstinline{cyan}}, \textcolor{main3}{\lstinline{blue}}, \textcolor{gray}{\lstinline{plain}}, and there is a customization color option \lstinline{nocolor}. You can choose \lstinline{green} with \begin{lstlisting}[frame=single] \documentclass[green]{elegantbook} %or \documentclass[color=green]{elegantbook} \end{lstlisting} where \textcolor{gray}{plain} theme is gray for all theorem class environments and paper structures. If you want to customize the colors, please select \lstinline{nocolor} or use \lstinline{color=none} , then define the main, second, and third colors in the preamble section as follows: \begin{lstlisting}[frame=single] \definecolor{main}{RGB}{70,70,70} \definecolor{second}{RGB}{115,45,2} \definecolor{third}{RGB}{0,80,80} \end{lstlisting} \begin{table}[htp] \caption{ElegantBook Themes\label{tab:color thm}} \centering \begin{tabular}{ccccc} \toprule & \textcolor{main1}{green} & \textcolor{main2}{cyan} & \textcolor{main3}{blue} & Main Environments\\ \midrule main & \makecell{{\color{main1}\rule{1cm}{1cm}}}& \makecell{{\color{main2}\rule{1cm}{1cm}}}&\makecell{ {\color{main3}\rule{1cm}{1cm}}}& definition \\ second &\makecell{ {\color{second1}\rule{1cm}{1cm}}}& \makecell{{\color{second2}\rule{1cm}{1cm}}}&\makecell{ {\color{second3}\rule{1cm}{1cm}}}&theorem \ lemma \ corollary\\ third &\makecell{ {\color{third1}\rule{1cm}{1cm}}}& \makecell{{\color{third2}\rule{1cm}{1cm}}}&\makecell{ {\color{third3}\rule{1cm}{1cm}}}&proposition\\ \bottomrule \end{tabular} \end{table} \section{Chapter Title Display Styles} This template contains 2 sets of \textit{title display styles},which including \lstinline{hang}(default) and \lstinline{display} style, The difference is that the chapter heading is displayed on a single line (\lstinline{hang}) and on a double line (\lstinline{display}) , and this guide uses \lstinline{hang} . To change display style \begin{lstlisting}[frame=single] \documentclass[hang]{elegantbook} %or \documentclass[titlestyle=hang]{elegantbook} \end{lstlisting} \section{Theorem Class Environments} In this template, we defined four categories of theorem class environments \begin{itemize} \item \textit{Theorem Environment}, including title and contents, numbering within chapter. There are three types depending on the format \begin{itemize} \item \textcolor{main}{\textbf{definition}} environment, the color is \textcolor{main}{main}; \item \textcolor{second}{\textbf{theorem, lemma, corollary}} environment, the color is \textcolor{second} {second}; \item \textcolor{third}{\textbf{proposition}} environment, the color is \textcolor{third}{third}. \end{itemize} \item \textit{Example Environments}, including \textbf{example, exercise, problem} environment, auto numering within chapter. \item \textit{Proof Environment}, including \textbf{proof, note} environment, they contain introductory symbol (\textbf{note} environment) or ending symbol (\textbf{proof} environment). \item \textit{Conclusion Environments}, including \textbf{conclusion, assumption, property, remark, solution} environment, all of these begin with boldfaced words, and the contents are the same as a normal paragraph. \end{itemize} \subsection{Theorem Class Environments} 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: \begin{lstlisting}[frame=single] \begin{theorem}{}{