%! TEX program = xelatex \documentclass[allowbf]{lebhart} %%================================ %% Import toolkit %%================================ \usepackage{PLtoolkit} \usepackage{longtable} % breakable tables \usepackage{hologo} % more TeX logo %%================================ %% For typestting code %%================================ \usepackage{listings} \definecolor{lightergray}{gray}{0.99} \lstset{language=[LaTeX]TeX, keywordstyle=\color{maintheme}, basicstyle=\ttfamily, commentstyle=\color{forestgreen}\ttfamily, stringstyle=\rmfamily, showstringspaces=false, breaklines=true, frame=lines, backgroundcolor=\color{lightergray}, flexiblecolumns=true, escapeinside={(*}{*)}, % numbers=left, numberstyle=\scriptsize, stepnumber=1, numbersep=5pt, firstnumber=last, } \providecommand{\meta}[1]{$\langle${\normalfont\itshape#1}$\rangle$} \lstset{moretexcs=% {color,CreateTheorem,proofideanameEN,cref,dnf,needgraph,UseLanguage,UseOtherLanguage,AddLanguageSetting,maketitle,address,curraddr,email,keywords,subjclass,thanks,dedicatory,PLdate,ProjLib } } \lstnewenvironment{code}% {\setkeys{lst}{columns=fullflexible,keepspaces=true}}{} %%================================ %% remind %%================================ \newenvironment{remind}[1][Remind]{% \begin{tcolorbox}[breakable, enhanced, width = \textwidth, colback = white, colbacktitle = paper, colframe = gray!50, boxrule=0.2mm, coltitle = black, fonttitle = \sffamily, attach boxed title to top left = {yshift=-\tcboxedtitleheight/2, xshift=\tcboxedtitlewidth/4}, boxed title style = {boxrule=0pt, colframe=paper}, before skip = 0.3cm, after skip = 0.3cm, top = 3mm, bottom = 3mm, title={\scshape\sffamily #1}]% }{\end{tcolorbox}} %%================================ %% 名称 %%================================ \providecommand{\PLtoolkit}{\textsf{PLtoolkit}} \providecommand{\PLamssim}{\textsf{PLamssim}} \providecommand{\PLauthor}{\textsf{PLauthor}} \providecommand{\PLdatestr}{\textsf{PLdate}} \providecommand{\PLdraft}{\textsf{PLdraft}} \providecommand{\PLlang}{\textsf{PLlang}} \providecommand{\PLlogo}{\textsf{PLlogo}} \providecommand{\PLpaper}{\textsf{PLpaper}} \providecommand{\PLthm}{\textsf{PLthm}} %%================================ %% 正文 %%================================ \begin{document} \title{\ProjLib{}~~Toolkit\\[.3\baselineskip]\normalsize User Manual} \author{Jinwen Xu} \thanks{Corresponding to: \texttt{\ProjLib{}~2021/05/12}} \date{May 2021, Beijing} \maketitle \begin{abstract} The \ProjLib{} toolkit is designed to simplify the preparation before writing \LaTeX{} documents. With \PLtoolkit{} loaded, you no longer need to set up the theorem-like environments nor configure the appropriate multilingual settings. Additionally, a series of auxiliary functionalities have been introduced. \end{abstract} % \tableofcontents \section{PLtoolkit} \subsection{How to load it} Just add the following line to your preamble: \begin{code} \usepackage{PLtoolkit} \end{code} \begin{remind}[Attention] Since \textsf{cleveref} is used internally, \PLtoolkit{} needs to be placed after \textsf{varioref} and \textsf{hyperref}. \end{remind} \medskip \subsection{Options} \PLtoolkit{} offers the following options: \begin{itemize} \item \texttt{draft} or \texttt{fast} \begin{itemize} \item Fast mode. The functionality is appropriately reduced to get faster compilation speed, recommended to use during the writing phase. \end{itemize} \item \texttt{palatino}、\texttt{times}、\texttt{garamond}、\texttt{biolinum} \begin{itemize} \item Font options. As the name suggest, font with corresponding name will be loaded. \end{itemize} \item \texttt{author} \begin{itemize} \item Load \PLauthor{}. For more information about its functionality, see the section on this package. \end{itemize} \item \texttt{amssim} \begin{itemize} \item Load \PLamssim{}. For more information about its functionality, see the section on this package. \end{itemize} \item \texttt{nothms} \begin{itemize} \item The theorem-like environments will not be defined. You should use this option if you wish to apply your own theorem styles. \end{itemize} \end{itemize} In addition, there are also some options of the components that can (and should) be passed as global options of the document class, such as \texttt{paperstyle} and \texttt{preview} of \PLpaper{}. For more information, please refer to the corresponding section. \section{The components} \subsection{PLamssim} \PLamssim{} is used to simulate some features of the \textsf{amsart} class in a standard class, including: \begin{itemize} \item \lstinline|\address|, \lstinline|\curraddr|, \lstinline|\email| and \lstinline|\dedicatory| macro(the first three are provided by \PLauthor{}) \item \lstinline|\keywords| macro \item \lstinline|\subjclass| macro \item \lstinline|\thanks| can be written outside \lstinline|\author| \item The \lstinline|abstract| environment can be placed before \lstinline|\maketitle| \end{itemize} These modifications would only take place in standard classes. In the \AmS{} classes, \PLamssim{} does not have any effect. \subsection{PLauthor} \PLauthor{} offers \lstinline|\address|, \lstinline|\curraddr| and \lstinline|\email|, and allows you to enter multiple groups of author information. The standard usage is like this: \begin{code} \author{(*\meta{author 1}*)} \address{(*\meta{address 1}*)} \email{(*\meta{email 1}*)} \author{(*\meta{author 2}*)} \address{(*\meta{address 2}*)} \email{(*\meta{email 2}*)} ... \end{code} The mutual order of \lstinline|\address|, \lstinline|\curraddr| and \lstinline|\email| is not important. \subsection{PLdate} \PLdatestr{} offers the \lstinline|\PLdate|\meta{yyyy-mm-dd} macro to convert \meta{yyyy-mm-dd} into the date format of the currently selected language. For example, in current English context, \lstinline|\PLdate{2022-04-01}| would become: \PLdate{2022-04-01}. For details on how to select a language, please refer to the section on \PLlang{}. \subsection{PLdraft} \PLdraft{} offers the following macros: \begin{itemize} \item \lstinline|\dnf| or \lstinline|\dnf<...>|. The effect is: \dnf~ or \dnf<...>. \\The prompt text changes according to the current language. For example, it will be displayed as \UseOtherLanguage{French}{\dnf} in French mode. \item \lstinline|\needgraph| or \lstinline|\needgraph<...>|. The effect is: \needgraph or \needgraph<...>The prompt text changes according to the current language. For example, in French mode, it will be displayed as \UseOtherLanguage{French}{\needgraph} \end{itemize} For details on how to select a language, please refer to the section on \PLlang{}. \subsection{PLlang} \PLlang{} offers multi-language support, including simplified Chinese, traditional Chinese, English, French, German, Japanese, and Russian (among them, Chinese, Japanese, and Russian require appropriate \TeX{} engines and fonts to support). The language can be selected by the following macros: \begin{itemize} \item \lstinline|\UseLanguage{|\meta{language name}\lstinline|}| is used to specify the language. The corresponding setting of the language will be applied after it. It can be used either in the preamble or in the main body. When no language is specified, ``English" is selected by default. \item \lstinline|\UseOtherLanguage{|\meta{language name}\lstinline|}{|\meta{content}\lstinline|}|, which uses the specified language settings to typeset \meta{content}. Compared with \lstinline|\UseLanguage|, it will not modify the line spacing, so line spacing would remain stable when CJK and Western texts are mixed. \end{itemize} \meta{language name} can be: \begin{itemize} \item Simplified Chinese: \texttt{Chinese}, \texttt{chinese}, \texttt{SChinese}, \texttt{schinese}, \texttt{SimplifiedChinese} or \texttt{simplifiedchinese} \item Traditional Chinese: \texttt{TChinese}, \texttt{tchinese}, \texttt{TraditionalChinese} or \texttt{traditionalchinese} \item English: \texttt{English} or \texttt{english} \item French: \texttt{French} or \texttt{french} \item German: \texttt{German}, \texttt{german} or \texttt{ngerman} \item Japanese: \texttt{Japanese} or \texttt{japanese} \item Russian: \texttt{Russian} or \texttt{russian} \end{itemize} \medskip In addition, you can also add new settings to selected language: \begin{itemize} \item \lstinline|\AddLanguageSetting{|\meta{settings}\lstinline|}| \begin{itemize} \item Add \meta{settings} to all supported languages. \end{itemize} \item \lstinline|\AddLanguageSetting(|\meta{language name}\lstinline|){|\meta{settings}\lstinline|}| \begin{itemize} \item Add \meta{settings} to the selected language \meta{language name}. \end{itemize} \end{itemize} For example, \lstinline|\AddLanguageSetting(German){\color{orange}}| can make all German text displayed in orange (of course, one then need to add \lstinline|\AddLanguageSetting{\color{black}}| in order to correct the color of the text in other languages). \subsection{PLlogo} \PLlogo{} offers the \lstinline|\ProjLib| macro to draw the logo, which looks like \ProjLib{}. It is similar to ordinary text macros and can be used with different font size macros: % \begin{itemize} % \item \lstinline|\tiny|:\quad {\tiny\ProjLib} % \item \lstinline|\scriptsize|:\quad {\scriptsize\ProjLib} % \item \lstinline|\footnotesize|:\quad {\footnotesize\ProjLib} % \item \lstinline|\normalsize|:\quad {\normalsize\ProjLib} % \item \lstinline|\large|:\quad {\large\ProjLib} % \item \lstinline|\Large|:\quad {\Large\ProjLib} % \item \lstinline|\LARGE|:\quad {\LARGE\ProjLib} % \item \lstinline|\huge|:\quad {\huge\ProjLib} % \item \lstinline|\Huge|:\quad {\Huge\ProjLib} % \end{itemize} \bigskip \begin{longtable}{ll} \lstinline|\tiny|:& {\tiny\ProjLib}\\ \lstinline|\scriptsize|:& {\scriptsize\ProjLib}\\ \lstinline|\footnotesize|:& {\footnotesize\ProjLib}\\ \lstinline|\normalsize|:& {\normalsize\ProjLib}\\ \lstinline|\large|:& {\large\ProjLib}\\ \lstinline|\Large|:& {\Large\ProjLib}\\ \lstinline|\LARGE|:& {\LARGE\ProjLib}\\ \lstinline|\huge|:& {\huge\ProjLib}\\ \lstinline|\Huge|:& {\Huge\ProjLib} \end{longtable} \clearpage \subsection{PLpaper} \PLpaper{} is mainly used to adjust the paper color. It has the following options: \begin{itemize} \item \texttt{paperstyle = \meta{paper style name}} \begin{itemize} \item Set the paper color style. The options available for \meta{paper style name} are: \texttt{yellow}, \texttt{dark} and \texttt{nord}. \end{itemize} \item \texttt{yellowpaper}、\texttt{darkpaper}、\texttt{nordpaper} \begin{itemize} \item Set the paper color style. The effect is the same as \texttt{paperstyle} with the corresponding \meta{paper style name} specified. \end{itemize} \item \texttt{preview} \begin{itemize} \item Preview mode. Crop the white edges of pdf file for the convenience of reading. \end{itemize} \end{itemize} It is recommended to pass these options as global options of the document class. In this way, the paper settings would be clear at a glance. \subsection{PLthm} \PLthm{} offers the configuration of theorem-like environments. It has the following option: % \vspace{-.3\baselineskip} \begin{itemize} \item \texttt{nothms} \begin{itemize} \item The theorem-like environments will not be defined. You should use this option if you wish to apply your own theorem styles. \end{itemize} \end{itemize} Preset environments include: \texttt{assumption}, \texttt{axiom}, \texttt{conjecture}, \texttt{convention}, \texttt{corollary}, \texttt{definition}, \texttt{definition-proposition}, ~~\texttt{definition-theorem}, ~~\texttt{example}, ~~\texttt{exercise}, ~~\texttt{fact}, ~~\texttt{hypothesis}, ~~\texttt{lemma}, \\\texttt{notation}, \texttt{problem}, \texttt{property}, \texttt{proposition}, \texttt{question}, \texttt{remark}, \texttt{theorem}, and the corresponding unnumbered version with an asterisk \lstinline|*| in the name. The display of these environments will change according to the current language. For example, \texttt{theorem} will be displayed as ``Theorem" in English mode and ``Théorème" in French mode. For details on how to select a language, please refer to the section on \PLlang{}. When referencing a theorem-like environment, it is recommended to use smart reference \lstinline|\cref{|\meta{label}\texttt{\}}. In this way, there is no need to explicitly write down the name of the corresponding environment every time. \medskip If you need to define a new theorem-like environment, you must first define the name of the environment in the language used: \lstinline|\|\meta{name of environment}\meta{language abbr}, where \meta{language abbr} is the abbreviation of language, which can be: % \vspace{-.5\baselineskip} \begin{longtable}{ll|ll} \texttt{CN} & Simplified Chinese & \texttt{DE} & German\\ \texttt{TC} & Traditional Chinese & \texttt{JP} & Japanese\\ \texttt{EN} & English & \texttt{RU} & Russian\\ \texttt{FR} & French & &\\ \end{longtable} \begin{remind} If you want to define an environment with an asterisk \lstinline|*| after the name, you don't need to write an asterisk in the \meta{name of environment} above. See the example below. \end{remind} \medskip And then define this environment in one of following five ways: \begin{itemize} \item \lstinline|\CreateTheorem*{|\meta{name of environment}\lstinline|}| \begin{itemize} \item Define an unnumbered environment \meta{name of environment} \end{itemize} \item \lstinline|\CreateTheorem{|\meta{name of environment}\lstinline|}| \begin{itemize} \item Define a numbered environment \meta{name of environment}, numbered in order 1,2,3,\dots \end{itemize} \item \lstinline|\CreateTheorem{|\meta{name of environment}\lstinline|}[|\meta{numbered like}\lstinline|]| \begin{itemize} \item Define a numbered environment \meta{name of environment}, which shares the counter \meta{numbered like} \end{itemize} \item \lstinline|\CreateTheorem{|\meta{name of environment}\lstinline|}<|\meta{numbered within}\lstinline|>| \begin{itemize} \item Define a numbered environment \meta{name of environment}, numbered within the counter \meta{numbered within} \end{itemize} \item \lstinline|\CreateTheorem{|\meta{name of environment}\lstinline|}(|\meta{existed environment}\lstinline|)|\\ \lstinline|\CreateTheorem*{|\meta{name of environment}\lstinline|}(|\meta{existed environment}\lstinline|)| \begin{itemize} \item Identify \meta{name of environment} with \meta{existed environment} or \meta{existed environment}\lstinline|*|. \item This method is usually useful in the following two situations: \begin{enumerate} \item To use a more concise name. For example, with \lstinline|\CreateTheorem{thm}(theorem)|, one can then use the name \texttt{thm} to write theorem. \item To remove the numbering of some environments. For example, one can remove the numbering of the \texttt{remark} environment with \lstinline|\CreateTheorem{remark}(remark*)|. \end{enumerate} \end{itemize} \end{itemize} \begin{remind} It uses \textsf{amsthm} internally, so the traditional \texttt{theoremstyle} is also applicable to it. One only needs declare the style before the relevant definitions. \end{remind} \def\proofideanameEN{Idea} \CreateTheorem*{proofidea*} \CreateTheorem{proofidea} \bigskip Here is an example. The following code: \begin{code} \def\proofideanameEN{Idea} \CreateTheorem*{proofidea*} \CreateTheorem{proofidea} \end{code} defines an unnumbered environment \lstinline|proofidea*| and a numbered environment \lstinline|proofidea| (numbered within subsection) respectively. They can be used in English context. The effect is as follows (the actual style is related to the document class): \begin{proofidea*} The \lstinline|proofidea*| environment. \end{proofidea*} \begin{proofidea} The \lstinline|proofidea| environment. \end{proofidea} \medskip \section{Known issues} \begin{itemize}[itemsep=.6em] \item \PLauthor{} is still in its preliminary stage, and thus its effect is still not as good as the relatively mature \textsf{authblk} in some aspects. \item \PLlang{}: It is still quite problematic with the configuration of \textsf{polyglossia}, so main features are implemented through \textsf{babel} for now. \item \PLpaper{}: the \texttt{preview} option is mainly implemented with the help of package \textsf{geometry}, so it does not work quite as well in the \textsc{\textsf{Koma}} document classes. \item \PLthm{}: The numbering and theorem-style settings of the theorem-like environments cannot be accessed by the user at present. \item \PLthm{}: The localization of \textsf{cleveref} is not yet complete for all supported languages of \PLlang{}, especially for Chinese, Japanese and Russian. \item The error handling mechanism is incomplete: there is no corresponding error prompt when some problems occur. \item There are many things that can be optimized in the code. Some codes take too long to run, especially the definition of theorem-like environments in \PLthm{}. \end{itemize} \clearpage \section{Usage example} \subsection{Standard classes} In standard classes, one usually only need to configure the page size, hyperlinks and load \PLtoolkit{} before actually start writing the document. Below is a complete example. \begin{code} \documentclass{article} \usepackage[a4paper,margin=.75in]{geometry} \usepackage[hidelinks]{hyperref} \usepackage[palatino]{PLtoolkit} % Load the toolkit and use font Palatino \UseLanguage{French} % Use French from here \begin{document} \title{Le Titre} \author{Auteur} \date{\PLdate{2022-04-01}} \maketitle \begin{abstract} Ceci est un résumé. \dnf \end{abstract} \section{Un théorème} %% Theorem-like environments can be used directly \begin{theorem}\label{thm:abc} Ceci est un théorème. \end{theorem} Référence du théorème: \cref{thm:abc} % It is recommended to use clever reference \end{document} \end{code} \bigskip If \PLamssim{} is loaded, then one can adopt the \AmS{} writing style in the document (of course, the original way is also valid, so always adding the option \texttt{amssim} usually does not cause problems). This way, the line that introduces \PLtoolkit{} should be written as: \begin{code} \usepackage[amssim,palatino]{PLtoolkit} \end{code} \clearpage \subsection{The \texorpdfstring{\AmS{}}{AMS} classes} In \AmS{} classes, one usually only need to configure the page size, hyperlinks and load \PLtoolkit{} before actually start writing the document. Below is a complete example. \begin{code} \documentclass{amsart} \usepackage[a4paper,margin=.75in]{geometry} \usepackage[hidelinks]{hyperref} \usepackage[palatino]{PLtoolkit} % Load the toolkit and use font Palatino \UseLanguage{French} % Use French from here \begin{document} \title{Le Titre} \author{Auteur 1} \address{Adresse 1} \email{\href{Courriel 1}{Courriel 1}} \author{Auteur 1} \address{Adresse 1} \email{\href{Courriel 2}{Courriel 2}} \date{\PLdate{2022-04-01}} \subjclass{*****} \keywords{...} \begin{abstract} Ceci est un résumé. \dnf \end{abstract} \maketitle \section{Première section} %% Theorem-like environments can be used directly \begin{theorem}\label{thm:abc} Ceci est un théorème. \end{theorem} Référence du théorème: \cref{thm:abc} % It is recommended to use clever reference \end{document} \end{code} \end{document}