diff --git a/elegantbook-cn.tex b/elegantbook-cn.tex index d0bdaff..14858e6 100644 --- a/elegantbook-cn.tex +++ b/elegantbook-cn.tex @@ -1,4 +1,4 @@ -\documentclass[lang=cn,10pt,founder]{elegantbook} +\documentclass[lang=cn,10pt]{elegantbook} \title{ElegantBook:优美的 \LaTeX{} 书籍模板} @@ -21,6 +21,7 @@ \usepackage{array} \newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}} +% 修改标题页的橙色带 % \definecolor{customcolor}{RGB}{32,178,170} % \colorlet{coverlinecolor}{customcolor} @@ -76,9 +77,9 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 安装 \TeX{} Live 之后,安装后建议升级全部宏包,升级方法:使用 cmd 或 terminal 运行 \lstinline{tlmgr update --all},如果 tlmgr 需要更新,请使用 cmd 运行 \lstinline{tlmgr update --self},如果更新过程中出现了中断,请改用 \lstinline{tlmgr update --self --all --reinstall-forcibly-removed} 更新,也即 \begin{lstlisting} - tlmgr update --self - tlmgr update --all - tlmgr update --self --all --reinstall-forcibly-removed +tlmgr update --self +tlmgr update --all +tlmgr update --self --all --reinstall-forcibly-removed \end{lstlisting} 更多的内容请参考 \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?} @@ -214,8 +215,8 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 封面中间位置的色块的颜色可以使用下面命令进行修改: \begin{lstlisting} - \definecolor{customcolor}{RGB}{32,178,170} - \colorlet{coverlinecolor}{customcolor} +\definecolor{customcolor}{RGB}{32,178,170} +\colorlet{coverlinecolor}{customcolor} \end{lstlisting} \subsection{封面图} @@ -397,12 +398,18 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 \end{minipage} \section{参考文献} +文献部分,本模板调用了 biblatex 宏包,并提供了 biber(默认) 和 bibtex 两个后端选项,可以使用 \lstinline{bibend} 进行修改: -此模板使用了 \hologo{biber} 来生成参考文献,也即使用 \lstinline{biblatex} 宏包,在中文示例中,使用了 \lstinline{gbt7714} 宏包。参考文献示例:\cite{cn1,en2,en3} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。 +\begin{lstlisting} + \documentclass[bibtex]{elegantbook} + \documentclass[bibend=bibtex]{elegantbook} +\end{lstlisting} -你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(bib item),然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。注意需要在编译的过程中添加 \hologo{biber} 编译。 +关于文献条目(bib item),你可以在谷歌学术,Mendeley,Endnote 中取,然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。 -为了方便文献样式修改,模板引入了 \lstinline{bibstyle} 和 \lstinline{citestyle} 选项,默认均为数字格式(numeric),如果需要设置为国标 GB7714-2015,需要使用: +为了方便文献样式修改,模板引入了 \lstinline{bibstyle} 和 \lstinline{citestyle} 选项,默认均为数字格式(numeric),参考文献示例:\cite{cn1,en2,en3} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。 + +如果需要设置为国标 GB7714-2015,需要使用: \begin{lstlisting} \documentclass[citestyle=gb7714-2015, bibstyle=gb7714-2015]{elegantbook} \end{lstlisting} @@ -617,12 +624,12 @@ LaTeX Error: 如果你想完全自定义字体\footnote{这里仍然以方正字体为例。},你可以选择 \lstinline{chinesefont=nofont},然后在导言区设置 \begin{lstlisting} \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} -\setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01} -\setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02} +\setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03} +\setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02} \setCJKfamilyfont{zhsong}{FZShuSong-Z01} \setCJKfamilyfont{zhhei}{FZHei-B01} -\setCJKfamilyfont{zhkai}{FZKai-Z03} -\setCJKfamilyfont{zhfs}{FZFangSong-Z02} +\setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03} +\setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02} \newcommand*{\songti}{\CJKfamily{zhsong}} \newcommand*{\heiti}{\CJKfamily{zhhei}} \newcommand*{\kaishu}{\CJKfamily{zhkai}} diff --git a/elegantbook-en.tex b/elegantbook-en.tex index 1f940f7..00e7f67 100644 --- a/elegantbook-en.tex +++ b/elegantbook-en.tex @@ -1,4 +1,4 @@ -\documentclass[11pt,fancy,newtx]{elegantbook} +\documentclass[11pt]{elegantbook} \title{An Elegant \LaTeX{} Template for Books} \subtitle{Classic Elegant\LaTeX{} Template} @@ -14,10 +14,10 @@ \logo{logo-blue.png} \cover{cover.jpg} +% modify the color in the middle of titlepage \definecolor{customcolor}{RGB}{32,178,170} \colorlet{coverlinecolor}{customcolor} - \begin{document} \maketitle @@ -38,34 +38,15 @@ Contact Infos: \end{itemize} - -\section{ElegantBook Updates} - -Version 4.2 is the \textit{temporary} version before v4.3 which will be released when \TeX Live 2022 is ready, we add quick bug fix caused by newtx package updates, and multilingual translation \lstinline{lang=jp}. What\rq s new in this version: - -\begin{change} - \item Bug fix due to the update of newtx fonts; - \item Add `Chapter' in TOC, and redefine \lstinline{\chaptername} to unify the logic under different languages; - \item Add language option for Japanese, \lstinline{lang=jp}. - \item \textbf{! Warnings}: Due to this `urgent' fonts bug and TOC modification, the multilingual option may cause some unexpected errors, you can report in this \href{https://github.com/ElegantLaTeX/ElegantBook/issues/170}{issue}, I will fix it after the releases of \TeX{} Live 2022. -\end{change} +\section{Online Usage} +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}. -\section{Installation and Update} -Both portable version and installation package are available, online usage is optional as well. - -\subsection{Online Usage} -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}. - -\begin{remark} - On Overleaf, please use \hologo{XeLaTeX} to compile articles in Chinese and \hologo{pdfLaTeX} to compile articles in English. -\end{remark} - -\subsection{To Use Portable Version} +\section{Portable Version} 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. -\subsection{Update Templates} +\section{Update Templates} You can use cmd/terminal to update the tlmgr itself and all the packages, the commands are: \begin{lstlisting} tlmgr update --self @@ -74,16 +55,14 @@ tlmgr update --all 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?} -\subsection{Other Release Versions} -If you are a \TeX{} Live 2018/2019/2020 user and would like to update, the official solution is to uninstall the previous version. If you want to save the bother of uninstallation and re-installation, please copy \lstinline{elegantbook.cls} to the installation directory of \TeX{} Live 2021 (default: \lstinline|C:\texlive\2021\texmf-dist\tex\latex\elegantbook| ), run \lstinline{texhash} in cmd. +\section{Other Release Versions} +If you are a \TeX{} Live 2018/2019/2020/2021 user and would like to update, the official solution is to uninstall the previous version. If you want to save the bother of uninstallation and re-installation, please copy \lstinline{elegantbook.cls} to the installation directory of \TeX{} Live 2022 (default: \lstinline|C:\texlive\2022\texmf-dist\tex\latex\elegantbook| ), run \lstinline{texhash} in cmd. -\section{About Pull Request} -For some reasons, pull requests will NOT by accepted since May 20, 2019. For those who want to help improve the templates, submit issues or clone to your own repository to modify under LPPL-1.3c. \chapter{ElegantBook Settings} -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 environment is Win10 + \TeX{} Live 2021, either \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine. \hologo{XeLaTeX} is preferred for Chinese articles. +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 environment is Win10/Ubuntu 20.04/macOS + \TeX{} Live 2022/ Mac\TeX{} 2022, either \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine. \section{Languages} 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 @@ -101,7 +80,8 @@ Besides the two basic language translation, our user provide more options, here \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}; \item Deutsch translation \lstinline{lang=de}, provided by Lisa, please refer to\href{https://github.com/ElegantLaTeX/ElegantBook/issues/113}{Deutsch translation}; \item Spanish translation \lstinline{lang=es}, provided by Gustavo A. Corradi, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/133}{Spanish translation}; - \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}. + \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}; + \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}. \end{itemize} \begin{remark} @@ -262,22 +242,32 @@ From version 4.1, you can write your theorem environments as follows: Other theorem class environments with the same usage includes: \begin{table}[htbp] - \centering - \caption{Theorem Class Environments} - \begin{tabular}{llll} - \toprule - Environment & Label text & Prefix & Cross-reference \\ - \midrule - definition & label & def & \lstinline|\ref{def:label}| \\ - theorem & label & thm & \lstinline|\ref{thm:label}| \\ - lemma & label & lem & \lstinline|\ref{lem:label}| \\ - corrlary & label & cor & \lstinline|\ref{cor:label}| \\ - proposition & label & pro & \lstinline|\ref{pro:label}| \\ - \bottomrule - \end{tabular}% - \label{tab:theorem-class}% + \centering + \caption{Theorem Class Environments} + \begin{tabular}{llll} + \toprule + Environment & Label text & Prefix & Cross-reference \\ + \midrule + definition & label & def & \lstinline|\ref{def:label}| \\ + theorem & label & thm & \lstinline|\ref{thm:label}| \\ + lemma & label & lem & \lstinline|\ref{lem:label}| \\ + corrlary & label & cor & \lstinline|\ref{cor:label}| \\ + proposition & label & pro & \lstinline|\ref{pro:label}| \\ + \bottomrule + \end{tabular}% + \label{tab:theorem-class}% \end{table}% +\subsection{Counter for Theorem Environments} + +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}. + +\begin{lstlisting} +\documentclass[section]{elegantbook} % turn the Theorem 4.1 to Theorem 4.1.1 +\documentclass[thmcnt=section]{elegantbook} +\end{lstlisting} + + \subsection{Other Customized Environments} The other three math environments can be called directly since there are no additional option for them, e.g. \lstinline{example}: @@ -392,6 +382,13 @@ To change the bibliography style, this version introduces two options: \lstinlin \documentclass[citestyle=numeric-comp, bibstyle=authoryear]{elegantbook} \end{lstlisting} +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. + +\begin{lstlisting} +\documentclass[bibtex]{elegantbook} % or +\documentclass[bibend=bibtex]{elegantbook} +\end{lstlisting} + \section{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: @@ -615,11 +612,11 @@ We list some FAQs for users to refer to: \item \question{I want to customize font and background color.} 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. \item \question{Which version should I choose?} - Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX{} Live 2021. + Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX{} Live 2022. \item \question{Which editor should I choose?} - You can use \TeX{} Live 2021 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX{}works autocomplete}. \TeX{} Live 2021 + \TeX{}studio is strongly recommended. I myself use VS Code and Sublime Text. 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}. + You can use \TeX{} Live 2022 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX{}works autocomplete}. \TeX{} Live 2022 + \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}. \item \question{Hello, we want to use ElegantBook to write a book about machine learning and would like your authorization.} - 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. + 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. \item \question{What is cross reference?} This template is aimed at who are not a complete beginner for \LaTeX{}. Please learn more about \LaTeX{} before using this template. \item \question{Is the language for code highlighting optional?} @@ -629,7 +626,20 @@ We list some FAQs for users to refer to: \end{enumerate} \chapter{Version History} -We revised our templates now and then. This section shows the version story of ElegantBook. We have nearly 100 submits and 17 releases on GitHub since uploaded. +We revised our templates now and then. This section shows the version story of ElegantBook. + + +\datechange{2022/04/09}{release of v4.3.} + +\begin{change} + \item Remove part newtx settings, set TeX Gyre Terms/Heros fonts under \hologo{XeLaTeX}. + \item Fix Chinese fonts in the theorem environments. + \item Add theorem counter option, \lstinline{thmcnt=section}. + \item Add bib option \lstinline{bibend}, which can take value of biber and bibtex. + \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}. +\end{change} + + \datechange{2022/03/08}{release of v4.2.} @@ -637,7 +647,6 @@ We revised our templates now and then. This section shows the version story of E \item Bug fix due to the update of newtx fonts; \item Add `Chapter' in TOC, and redefine \lstinline{\chaptername} to unify the logic under different languages; \item Add language option for Japanese, \lstinline{lang=jp}. - \item \textbf{! Warnings}: Due to this `urgent' fonts bug and TOC modification, the multilingual option may cause some unexpected errors, you can report in this \href{https://github.com/ElegantLaTeX/ElegantBook/issues/170}{issue}, I will fix it after the releases of \TeX{} Live 2022. \end{change} diff --git a/elegantbook.cls b/elegantbook.cls index f4fe5dc..0966c3f 100644 --- a/elegantbook.cls +++ b/elegantbook.cls @@ -162,6 +162,7 @@ \renewcommand{\baselinestretch}{1.2} \PassOptionsToPackage{no-math}{fontspec} +\PassOptionsToPackage{quiet}{fontspec} \RequirePackage{iftex} \ifXeTeX