diff options
Diffstat (limited to 'macros/unicodetex/latex/einfart')
-rw-r--r-- | macros/unicodetex/latex/einfart/README.md | 7 | ||||
-rw-r--r-- | macros/unicodetex/latex/einfart/einfart-doc-cn.pdf | bin | 151770 -> 236172 bytes | |||
-rw-r--r-- | macros/unicodetex/latex/einfart/einfart-doc-cn.tex | 450 | ||||
-rw-r--r-- | macros/unicodetex/latex/einfart/einfart-doc-en.pdf | bin | 105718 -> 145877 bytes | |||
-rw-r--r-- | macros/unicodetex/latex/einfart/einfart-doc-en.tex | 438 | ||||
-rw-r--r-- | macros/unicodetex/latex/einfart/einfart.cls | 156 |
6 files changed, 788 insertions, 263 deletions
diff --git a/macros/unicodetex/latex/einfart/README.md b/macros/unicodetex/latex/einfart/README.md index 0984daa1d4..58ceae6fbf 100644 --- a/macros/unicodetex/latex/einfart/README.md +++ b/macros/unicodetex/latex/einfart/README.md @@ -5,10 +5,11 @@ `einfart` is a LaTeX class for typesetting articles, which has a simple and clear design. -Currently, it has native support to English, French and Chinese typesetting. And -it may compile with either XeLaTeX or LuaLaTeX. +Currently, it has native support to Chinese (simplified and traditional), +English, French, German, Japanese and Russian typesetting. And it may compile +with either XeLaTeX or LuaLaTeX. -This is part of the minimalist class series. +This is part of the `minimalist` class series. # License diff --git a/macros/unicodetex/latex/einfart/einfart-doc-cn.pdf b/macros/unicodetex/latex/einfart/einfart-doc-cn.pdf Binary files differindex 54f896a49c..fece759401 100644 --- a/macros/unicodetex/latex/einfart/einfart-doc-cn.pdf +++ b/macros/unicodetex/latex/einfart/einfart-doc-cn.pdf diff --git a/macros/unicodetex/latex/einfart/einfart-doc-cn.tex b/macros/unicodetex/latex/einfart/einfart-doc-cn.tex index 984b1d075a..058440e3fa 100644 --- a/macros/unicodetex/latex/einfart/einfart-doc-cn.tex +++ b/macros/unicodetex/latex/einfart/einfart-doc-cn.tex @@ -1,25 +1,28 @@ %! TEX program = xelatex -\PassOptionsToPackage{dvipsnames}{xcolor} \documentclass{einfart} \linenumbers % 开启行号 -\UseLanguage{Chinese} %%================================ -%% TeX logo 与 网址 +%% 引入工具集 %%================================ -\usepackage{hologo} -\usepackage{url} +\usepackage{PJLtoolkit} +\usepackage{longtable} % breakable tables +\usepackage{hologo} % more TeX logo + +\UseLanguage{Chinese} %%================================ %% 排版代码 %%================================ \usepackage{listings} +\definecolor{maintheme}{RGB}{70,130,180} +\definecolor{forestgreen}{RGB}{21,122,81} \definecolor{lightergray}{gray}{0.99} \lstset{language=[LaTeX]TeX, - keywordstyle=\color{RoyalBlue}, + keywordstyle=\color{maintheme}, basicstyle=\ttfamily, - commentstyle=\color{ForestGreen}\ttfamily, + commentstyle=\color{forestgreen}\ttfamily, stringstyle=\rmfamily, showstringspaces=false, breaklines=true, @@ -32,9 +35,9 @@ firstnumber=last, } \providecommand{\meta}[1]{$\langle${\normalfont\itshape#1}$\rangle$} -\lstset{morekeywords=% - {CreateTheorem,proofideanameCN,cref,dnf,needgraph,UseLanguage, - linenumbers,nolinenumbers,subsection,maketitle +\lstset{moretexcs=% + {linenumbers,nolinenumbers,subsection, + color,CreateTheorem,proofideanameCN,cref,dnf,needgraph,UseLanguage,UseOtherLanguage,AddLanguageSetting,maketitle,address,curraddr,email,keywords,subjclass,thanks,dedicatory,PJLdate,ProjLib } } \lstnewenvironment{code}% @@ -43,6 +46,31 @@ } {\ResumeLineNumbers} +%%================================ +%% remind +%%================================ +\usepackage[many]{tcolorbox} +\newenvironment{remind}[1][提示]{% + \LocallyStopLineNumbers% + \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={\sffamily #1}]% +}{\end{tcolorbox}\ResumeLineNumbers} + +%%================================ +%% 名称 +%%================================ \providecommand{\minimalist}{\textsf{minimalist}} \providecommand{\minimart}{\textsf{minimart}} \providecommand{\minimbook}{\textsf{minimbook}} @@ -54,111 +82,298 @@ %%================================ \begin{document} -\title{\einfart{},以极简主义风格排版你的文章\thanks{对应版本. \texttt{\einfart{} 2021/03/15}}} -\author{锦文} -\date{2021年3月,北京} +\title{\einfart{},以极简主义风格排版你的文章} +\author{许锦文} +\thanks{对应版本. \texttt{\einfart{} 2021/05/23}} +\date{2021年5月,北京} \maketitle \begin{abstract} - \einfart{}是\minimalist{}文档类系列的成员之一,整个系列包含用于排版文章的\minimart{}、\einfart{}以及用于排版书的\minimbook{}、\simplivre{}。我设计这一系列的初衷是为了撰写草稿与笔记,使之看上去简朴而不简陋。 + \einfart{} 是 \minimalist{} 文档类系列的成员之一,其名称取自于德文的 einfach (``简约''),并取了 artikel (``文章'') 的前三个字母组合而成。整个 \minimalist{} 系列包含用于排版文章的 \minimart{}、\einfart{} 以及用于排版书的 \minimbook{}、\simplivre{}。我设计这一系列的初衷是为了撰写草稿与笔记,使之看上去简朴而不简陋。 - 其中,\einfart{}与\simplivre{}支持英文、法文、中文三种语言,并且同一篇文档中三种语言可以很好地协调。由于采用了自定义字体,需要采用 \hologo{XeLaTeX} 或 \hologo{LuaLaTeX} 进行编译。 + \einfart{} 支持英文、法文、德文、中文、日文、俄文六种语言,并且同一篇文档中这些语言可以很好地协调。由于采用了自定义字体,需要用 \hologo{XeLaTeX} 或 \hologo{LuaLaTeX} 引擎进行编译。 - 这篇说明文档是用\einfart{}排版的,你可以把它看作一份简短的说明与演示。 + 这篇说明文档即是用 \einfart{} 排版的,你可以把它看作一份简短的说明与演示。 \end{abstract} \tableofcontents -\section{关于文档类的名称与选项} +\bigskip +\begin{remind} + 多语言支持、定理类环境、未完成标记等功能是由 \ProjLib{} 工具箱提供的,这里只给出了将其与本文档类搭配使用的要点。如需获取更详细的信息,可以参阅 \ProjLib{} 的说明文档。 +\end{remind} + +\clearpage +\section{初始化} + +\subsection{如何载入} + +只需要在第一行写: + +\begin{code} + \documentclass{einfart} +\end{code} + +即可使用 \einfart{} 文档类。请注意,要使用 \hologo{XeLaTeX} 或 \hologo{LuaLaTeX} 引擎才能编译。 + +\subsection{选项} + +\einfart{} 文档类有下面几个选项: + +\begin{itemize} + \item \texttt{draft} 或 \texttt{fast} + \begin{itemize} + \item 你可以使用选项 \verb|fast| 来启用快速但略微粗糙的样式,主要区别是: + \begin{itemize} + \item 使用较为简单的数学字体设置; + \item 不启用超链接; + \item 启用 \ProjLib{} 工具箱的快速模式。 + \end{itemize} + \end{itemize} + \item \texttt{a4paper} 或 \texttt{b5paper} + \begin{itemize} + \item 可选的纸张大小。默认的纸张大小为 7in $\times$ 10in。 + \end{itemize} + \item \texttt{allowbf} + \begin{itemize} + \item 允许加粗。启用这一选项时,题目、各级标题、定理类环境名称会被加粗。 + \end{itemize} + \item \texttt{classical} + \begin{itemize} + \item 经典模式。启用这一选项时,样式会变得更加中规中矩:段落呈首行缩进样式、各类下划线减少、标题样式改变、定理类环境的样式也会更贴近常见的设置。 + \end{itemize} +\end{itemize} + +\begin{remind} + \begin{itemize} + \item 在文章的撰写阶段,建议使用 \verb|fast| 选项以加快编译速度,改善写作时的流畅程度。在最后,可以把 \verb|fast| 标记去除,从而得到正式的版本。使用 \verb|fast| 模式时会有“DRAFT”字样的水印,以提示目前处于草稿阶段。 + \item 如果你喜欢更加传统的样式,\texttt{allowbf} + \texttt{classical} 是一个不错的搭配。 + \end{itemize} +\end{remind} + +\section{关于文档类中使用的字体} +\einfart{} 默认使用 Palatino Linotype 作为英文字体,方正悠宋、悠黑GBK作为中文字体,并部分使用了 Neo Euler 作为数学字体。其中,Neo Euler可以在 \url{https://github.com/khaledhosny/euler-otf} 下载。其他字体不是免费字体,需要自行购买使用。可以在方正字库网站查询详细资料:\url{https://www.foundertype.com}。 + +% \begin{itemize} +% \item English main font. \textsf{English sans serif font}. +% \item 中文主要字体,\textsf{中文无衬线字体} +% \item 数学示例: \( \alpha, \beta, \gamma, \delta, 1,2,3,4, a,b,c,d \), \[\mathrm{li}(x)\coloneqq \int_2^{\infty} \frac{1}{\log t}\,\mathrm{d}t \] +% \end{itemize} + +在没有安装相应的字体时,将采用TeX Live中自带的字体来代替,效果可能会有所折扣。 + -\einfart{}取自于德文的einfach (“简约”),并取了artikel (“文章”)的前三个字母组合而成。 +\section{使用说明} -\simplivre{}取自于法文的simple (“简约”),以及livre (“书”),由二者组合而成。 +接下来介绍的许多功能是由 \ProjLib{} 工具箱提供的。这里只介绍了基本使用方法,更多细节可以直接参阅其用户文档。 + +\subsection{语言设置} -你可以使用选项 \verb|fast| 来启用快速但略微粗糙的样式,主要区别是: +\einfart{} 提供了多语言支持,包括简体中文、繁体中文、英文、法文、德文、日文、俄文。可以通过下列命令来选定语言: \begin{itemize} - \item 使用较为简单的数学字体设置; - \item 不使用hyperref; - \item 不使用tikz; - \item 使用polyglossia而不是babel来支持多语言。(使用polyglossia编译速度会略有提高,但目前对于中文的兼容不太完善,在它更加稳定后,将会考虑全面切换到polyglossia) + \item \lstinline|\UseLanguage{|\meta{language name}\lstinline|}|,用于指定语言,在其后将使用对应的语言设定。 + \begin{itemize} + \item 既可以用于导言部分,也可以用于正文部分。在不指定语言时,默认选定 “English”。 + \end{itemize} + \item \lstinline|\UseOtherLanguage{|\meta{language name}\lstinline|}{|\meta{content}\lstinline|}|,用指定的语言的设定排版 \meta{content}。 + \begin{itemize} + \item 相比较 \lstinline|\UseLanguage|,它不会对行距进行修改,因此中西文字混排时能够保持行距稳定。 + \end{itemize} \end{itemize} -在文章的撰写阶段,建议使用 \verb|fast| 选项以加快编译速度,改善写作时的流畅程度。在最后,可以把 \verb|fast| 标记去除,从而得到正式的版本。 +\meta{language name} 有下列选择: +\begin{itemize} + \item 简体中文:\texttt{Chinese}、\texttt{chinese}、\texttt{SChinese}、\texttt{schinese}、\texttt{SimplifiedChinese} \\\hspace*{5em}或 \texttt{simplifiedchinese} + \item 繁体中文:\texttt{TChinese}、\texttt{tchinese}、\texttt{TraditionalChinese} 或 \texttt{traditionalchinese} + \item 英文:\texttt{English} 或 \texttt{english} + \item 法文:\texttt{French} 或 \texttt{french} + \item 德文:\texttt{German}、\texttt{german} 或 \texttt{ngerman} + \item 日文:\texttt{Japanese} 或 \texttt{japanese} + \item 俄文:\texttt{Russian} 或 \texttt{russian} +\end{itemize} -\section{一些使用说明} +另外,还可以通过下面的方式来填加相应语言的设置: +\begin{itemize} + \item \lstinline|\AddLanguageSetting{|\meta{settings}\lstinline|}| + \begin{itemize} + \item 向所有支持的语言增加设置 \meta{settings}。 + \end{itemize} + \item \lstinline|\AddLanguageSetting(|\meta{language name}\lstinline|){|\meta{settings}\lstinline|}| + \begin{itemize} + \item 向指定的语言 \meta{language name} 增加设置 \meta{settings}。 + \end{itemize} +\end{itemize} +例如,\lstinline|\AddLanguageSetting(German){\color{orange}}| 可以让所有德语以橙色显示(当然,还需要再加上 \lstinline|\AddLanguageSetting{\color{black}}| 来修正其他语言的颜色)。 + + +\subsection{定理类环境及其引用} -正文部分每段的开头没有缩进,但每两段之间会有半行左右的间距。就像这样—— +定义、定理等环境已经被预定义,可以直接使用。 -这里是下一个自然段。 +具体来说,预设的定理类环境包括: +\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},以及相应的带有星号 \lstinline|*| 的无编号版本。 -\subsection{定理,以及引用} +在引用定理类环境时,建议使用智能引用 \lstinline|\cref{|\meta{label}\lstinline|}|。这样就不必每次都写上相应环境的名称了。 -定义、定理等环境已经被预定义,可以直接使用,例如: +\begin{remind}[例子] \begin{code} \begin{definition}[奇异物品] \label{def: strange} ... \end{code} 将会生成 \begin{definition}[奇异物品]\label{def: strange} - 这是奇异物品的定义。 + 这是奇异物品的定义。定理类环境的前后有一行左右的间距。在定义结束的时候会有一个符号来标记。 \end{definition} -定理类环境的前后有一行左右的间距。在定义结束的时候会有一个符号来标记。 +\lstinline|\cref{def: strange}| 会显示为:\cref{def: strange}。 + +使用 \lstinline|\UseLanguage{English}| 后,定理会显示为: + +\UseLanguage{English} +\begin{theorem}[Useless]\label{thm} + A theorem in English. +\end{theorem} + +默认情况下,引用时,定理的名称总是与定理所在区域的语言匹配,例如,上面的定义在现在的英文模式下依然显示为中文:\cref{def: strange} 和 \cref{thm}。如果在引用时想让定理的名称与当前语境相匹配,可以在全局选项中加入 \texttt{regionalref}。 +\end{remind} + +\UseLanguage{Chinese} -引用时,可以直接使用智能引用 \lstinline|\cref{标签名称}|,例如:\lstinline|\cref{def: strange}| 会显示为:\cref{def: strange}。 \subsection{定义新的定理型环境} -首先定义这个环境在所用语言下的名称 \lstinline|\(name of environment)(language name)|,其中 \\\lstinline|(language name)| 是 \lstinline|EN|、\lstinline|FR|、\lstinline|CN| 等,然后用下面四种方式之一定义这一环境: +若需要定义新的定理类环境,首先要定义这个环境在所用语言下的名称 \lstinline|\|\meta{name of environment}\meta{language abbr},其中 \meta{language abbr} 是语言的简写,分别为: +\begin{longtable}{ll|ll} + \texttt{CN} & 简体中文 & \texttt{DE} & 德文\\ + \texttt{TC} & 繁体中文 & \texttt{JP} & 日文\\ + \texttt{EN} & 英文 & \texttt{RU} & 俄文\\ + \texttt{FR} & 法文 & &\\ +\end{longtable} + +\vspace{-0.3\baselineskip} +\begin{remind} + 如果要定义名称后带有星号 \lstinline|*| 的环境,那么在上面的 \meta{name of environment} 中不用写星号。 +\end{remind} + +然后用下面五种方式之一定义这一环境: \begin{itemize} - \item \lstinline|\CreateTheorem*{(name of environment)}| - \item \lstinline|\CreateTheorem{(name of environment)}[(numbered like)]| - \item \lstinline|\CreateTheorem{(name of environment)}<(numbered within)>| - \item \lstinline|\CreateTheorem{(name of environment)}| + \item \lstinline|\CreateTheorem*{|\meta{name of environment}\lstinline|}| + \begin{itemize} + \item 定义不编号的环境 \meta{name of environment} + \end{itemize} + \item \lstinline|\CreateTheorem{|\meta{name of environment}\lstinline|}| + \begin{itemize} + \item 定义编号环境 \meta{name of environment},按顺序编号 + \end{itemize} + \item \lstinline|\CreateTheorem{|\meta{name of environment}\lstinline|}[|\meta{numbered like}\lstinline|]| + \begin{itemize} + \item 定义编号环境 \meta{name of environment},与 \meta{numbered like} 计数器共用编号 + \end{itemize} + \item \lstinline|\CreateTheorem{|\meta{name of environment}\lstinline|}<|\meta{numbered within}\lstinline|>| + \begin{itemize} + \item 定义编号环境 \meta{name of environment},在 \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 将 \meta{name of environment} 与 \meta{existed environment} 或 \meta{existed environment}\lstinline|*| 等同。 + \item 这种方式通常在两种情况下比较有用: + \begin{enumerate} + \item 希望定义更简洁的名称。例如,使用 \lstinline|\CreateTheorem{thm}(theorem)|,便可以直接用名称 \texttt{thm} 来撰写定理。 + \item 希望去除某些环境的编号。例如,使用 \lstinline|\CreateTheorem{remark}(remark*)|,便可以去除 \texttt{remark} 环境的编号。 + \end{enumerate} + \end{itemize} \end{itemize} +\begin{remind} + 其内部使用了 \textsf{amsthm},因此传统的 \texttt{theoremstyle} 对其也是适用的,只需在相关定义前标明即可。 +\end{remind} + \def\proofideanameCN{思路} -\CreateTheorem*{proofidea} +\CreateTheorem*{proofidea*} +\CreateTheorem{proofidea}<subsection> -例如, +\bigskip +下面提供一个例子。这三行代码: \begin{code} \def\proofideanameCN{思路} - \CreateTheorem*{proofidea} + \CreateTheorem*{proofidea*} + \CreateTheorem{proofidea}<subsection> \end{code} -可以定义不编号的环境 \lstinline|proofidea|,它支持在中文环境中使用,效果如下所示: + +可以分别定义不编号的环境 \lstinline|proofidea*| 和编号的环境 \lstinline|proofidea| (在 subsection 内编号),它们支持在简体中文语境中使用,效果如下所示: + +\begin{proofidea*} + \lstinline|proofidea*| 环境。 +\end{proofidea*} \begin{proofidea} - ... + \lstinline|proofidea| 环境。 \end{proofidea} \subsection{未完成标记} 你可以通过 \lstinline|\dnf| 来标记尚未完成的部分。例如: \begin{itemize} - \item \lstinline|\dnf|: \quad \dnf - \item \lstinline|\dnf<还需加入…>|: \quad \dnf<还需加入…> + \item \lstinline|\dnf| 或 \lstinline|\dnf<...>|。效果为:\dnf~或 \dnf<...>。\\其提示文字与当前语言相对应,例如,在法语模式下将会显示为 \UseOtherLanguage{French}{\dnf}。 \end{itemize} 类似的,还有 \lstinline|\needgraph| : \begin{itemize} - \item \lstinline|\needgraph|: \needgraph - \item \lstinline|\needgraph<关于…>|: \needgraph<关于…> + \item \lstinline|\needgraph| 或 \lstinline|\needgraph<...>|。效果为:\needgraph~或 \needgraph<...>其提示文字与当前语言相对应,例如,在法语模式下将会显示为 \UseOtherLanguage{French}{\needgraph} \end{itemize} -\subsection{语言设置} -可以随时使用 \lstinline|\UseLanguage{语言名称}| 更改语言,语言名称包括Chinese、English、French(首字母大小写随意,例如chinese亦可)。这样,各种指令和环境的效果也会随之变动。 -例如,使用 \lstinline|\UseLanguage{English}| 后,定理与未完成标记会显示为: +\subsection{关于文章标题、摘要与关键词} -\UseLanguage{English} -\begin{theorem}[Useless]\label{thm} - Some theorem in English. \dnf -\end{theorem} +% 由于引入了 \ProjLib{} 工具箱的 \textsf{PJLamssim} 组件, +\einfart{} 同时具有标准文档类与\AmS{} 文档类的一些特性。 -引用时,定理的名称总是与定理所在区域的语言匹配,例如,开头的定义在现在的英文模式下依然显示为中文:\cref{def: strange} 和 \cref{thm}。 +因此,文章的标题部分既可以按照标准文档类 \textsf{article} 的写法来写: -\UseLanguage{Chinese} +\begin{code} + \title{(*\meta{title}*)} + \author{(*\meta{author}*)} + \date{(*\meta{date}*)} + \maketitle + \begin{abstract} + (*\meta{abstract}*) + \end{abstract} + \begin{keyword} + (*\meta{keywords}*) + \end{keyword} +\end{code} + +也可以按照 \AmS{} 文档类的方式来写: + +\begin{code} + \title{(*\meta{title}*)} + \author{(*\meta{author}*)} + \address{(*\meta{address}*)} + \email{(*\meta{email}*)} + \date{(*\meta{date}*)} + \keywords{(*\meta{keywords}*)} + \subjclass{(*\meta{subjclass}*)} + \begin{abstract} + (*\meta{abstract}*) + \end{abstract} + \maketitle +\end{code} + +作者信息可以包含多组,输入方式为: + +\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} + +其中 \lstinline|\address|、\lstinline|\curraddr|、\lstinline|\email| 的相互顺序是不重要的。 \subsection{关于行号} 行号可以随时开启和关闭。\lstinline|\linenumbers| 用来开启行号,\lstinline|\nolinenumbers| 用来关闭行号。标题、目录、索引等位置为了美观,不进行编号。 @@ -171,74 +386,121 @@ \end{itemize} 这是标题使用下划线装饰之后带来的一个缺点。 -\subsection{关于字体} -\einfart{}与\simplivre{}使用Palatino Linotype作为英文字体,方正悠宋、悠黑简体作为中文字体,并部分使用了Neo Euler作为数学字体: -\begin{itemize} - \item English main font. \textsf{English sans serif font}. - \item 中文主要字体,\textsf{中文无衬线字体} - \item 数学示例: \( \alpha, \beta, \gamma, \delta, 1,2,3,4, a,b,c,d \), \[\mathrm{li}(x)\coloneqq \int_2^{\infty} \frac{1}{\log t}\,\mathrm{d}t \] + +\section{目前存在的问题} + +\begin{itemize}[itemsep=.6em] + \item 对于字体的设置仍然不够完善。 + \item 由于很多核心功能建立在 \ProjLib{} 工具箱的基础上,因此 \einfart{} 自然继承了其所有问题。详情可以参阅 \ProjLib{} 用户文档的“目前存在的问题”这一小节。 + \item 错误处理功能不完善,在出现一些问题时没有相应的错误提示。 + \item 代码中仍有许多可优化之处。 \end{itemize} -其中,Neo Euler可以在 \url{https://github.com/khaledhosny/euler-otf} 下载。 -其他字体不是免费字体,需要自行购买使用(你可以在方正字库网站查询详细资料:\url{https://www.foundertype.com})。 -在没有安装相应的字体时,将采用TeX Live中自带的字体来代替,效果可能会有所折扣。 +\UseLanguage{English} +\clearpage \section{文档示例} -\singlespacing +\subsection{标准文档类写法} + +如果想采用标准文档类中的写法,可以参考下面的例子: -\LocallyStopLineNumbers -\begin{minipage}{0.45\textwidth} \begin{code} -%! TEX program = xelatex -\documentclass[fast]{einfart} +\documentclass{einfart} +\usepackage{PJLtoolkit} % Load ProjLib toolkit -\linenumbers -\UseLanguage{French} +\UseLanguage{French} % Use French from here \begin{document} -\title{Titre} -\author{Nom} -\date{03 / 2021, Lieu} +\title{Le Titre} +\author{Auteur} +\date{\PJLdate{2022-04-01}} \maketitle -%% Texte ici +\begin{abstract} + Ceci est un résumé. \dnf<Plus de contenu est nécessaire.> +\end{abstract} +\begin{keyword} + AAA, BBB, CCC, DDD, EEE +\end{keyword} + +\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} -\end{minipage} -% -\hfill -% -\begin{minipage}{0.45\textwidth} + +如果以后想切换到标准文档类,只需要将前两行换为: + \begin{code} -%! TEX program = xelatex -\documentclass[fast]{einfart} +\documentclass{article} +\usepackage[a4paper,margin=1in]{geometry} +\usepackage[hidelinks]{hyperref} +\usepackage[palatino]{PJLtoolkit} % Load ProjLib toolkit +\end{code} -\linenumbers -\UseLanguage{Chinese} + +\clearpage +\subsection{\texorpdfstring{\AmS{}}{AMS} 文档类写法} + +如果日后有意切换到期刊模版,想采用 \AmS{} 文档类中的写法,可以参考下面的例子: + +\begin{code} +\documentclass{einfart} +\usepackage{PJLtoolkit} % Load ProjLib toolkit + +\UseLanguage{French} % Use French from here \begin{document} -\title{标题} -\author{姓名} -\date{2021年3月,地点} +\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{\PJLdate{2022-04-01}} +\subjclass{*****} +\keywords{...} + +\begin{abstract} + Ceci est un résumé. \dnf<Plus de contenu est nécessaire.> +\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{minipage} -\par -\ResumeLineNumbers -\bigskip -(\lstinline|\UseLanguage| 既可以放在导言中,也可以放在正文部分,并且可以按照需要反复使用) +这样,若想切换到 \AmS{} 文档类,只需要将前两行换为: + +\begin{code} +\documentclass{amsart} +\usepackage[a4paper,margin=1in]{geometry} +\usepackage[hidelinks]{hyperref} +\usepackage[palatino]{PJLtoolkit} % Load ProjLib toolkit +\end{code} \end{document} diff --git a/macros/unicodetex/latex/einfart/einfart-doc-en.pdf b/macros/unicodetex/latex/einfart/einfart-doc-en.pdf Binary files differindex ffef04eabe..9fecd39dda 100644 --- a/macros/unicodetex/latex/einfart/einfart-doc-en.pdf +++ b/macros/unicodetex/latex/einfart/einfart-doc-en.pdf diff --git a/macros/unicodetex/latex/einfart/einfart-doc-en.tex b/macros/unicodetex/latex/einfart/einfart-doc-en.tex index 49b04581a0..5e42a556a0 100644 --- a/macros/unicodetex/latex/einfart/einfart-doc-en.tex +++ b/macros/unicodetex/latex/einfart/einfart-doc-en.tex @@ -1,24 +1,26 @@ %! TEX program = xelatex -\PassOptionsToPackage{dvipsnames}{xcolor} \documentclass{einfart} \linenumbers % Enable line numbers %%================================ -%% TeX logo and URL +%% Import toolkit %%================================ -\usepackage{hologo} -\usepackage{url} +\usepackage{PJLtoolkit} +\usepackage{longtable} % breakable tables +\usepackage{hologo} % more TeX logo %%================================ %% For typestting code %%================================ \usepackage{listings} +\definecolor{maintheme}{RGB}{70,130,180} +\definecolor{forestgreen}{RGB}{21,122,81} \definecolor{lightergray}{gray}{0.99} \lstset{language=[LaTeX]TeX, - keywordstyle=\color{RoyalBlue}, + keywordstyle=\color{maintheme}, basicstyle=\ttfamily, - commentstyle=\color{ForestGreen}\ttfamily, + commentstyle=\color{forestgreen}\ttfamily, stringstyle=\rmfamily, showstringspaces=false, breaklines=true, @@ -31,9 +33,9 @@ firstnumber=last, } \providecommand{\meta}[1]{$\langle${\normalfont\itshape#1}$\rangle$} -\lstset{morekeywords=% - {CreateTheorem,proofideanameEN,cref,dnf,needgraph,UseLanguage, - linenumbers,nolinenumbers,subsection,maketitle +\lstset{moretexcs=% + {linenumbers,nolinenumbers,subsection, + color,CreateTheorem,proofideanameEN,cref,dnf,needgraph,UseLanguage,UseOtherLanguage,AddLanguageSetting,maketitle,address,curraddr,email,keywords,subjclass,thanks,dedicatory,PJLdate,ProjLib } } \lstnewenvironment{code}% @@ -42,6 +44,31 @@ } {\ResumeLineNumbers} +%%================================ +%% remind +%%================================ +\usepackage[many]{tcolorbox} +\newenvironment{remind}[1][Remind]{% + \LocallyStopLineNumbers% + \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={\sffamily #1}]% +}{\end{tcolorbox}\ResumeLineNumbers} + +%%================================ +%% 名称 +%%================================ \providecommand{\minimalist}{\textsf{minimalist}} \providecommand{\minimart}{\textsf{minimart}} \providecommand{\minimbook}{\textsf{minimbook}} @@ -53,110 +80,294 @@ %%================================ \begin{document} -\title{\einfart{}, write your articles in a simple and clear way\thanks{Corresponding to: \texttt{\einfart{} 2021/03/15}}} -\author{Jinwen} -\date{March 2021, Beijing} +\title{\einfart{}, write your articles in a simple and clear way} +\author{Jinwen XU} +\thanks{Corresponding to: \texttt{\einfart{} 2021/05/23}} +\date{May 2021, Beijing} \maketitle \begin{abstract} - \einfart{} is a member of the \minimalist{} class series. The entire collection includes \minimart{} and \einfart{} for typesetting articles and \minimbook{} and \simplivre{} for typesetting books. My original intention in designing this series was to write drafts and notes that look simple but not shabby. + \einfart{} is part of the \minimalist{} class series, whose name is taken from German word ``einfach'' (``simple''), combined with the first three letters of ``artikel'' (``article''). The entire collection includes \minimart{} and \einfart{} for typesetting articles, and \minimbook{} and \simplivre{} for typesetting books. My original intention in designing them was to write drafts and notes that look simple yet not shabby. - Among them, \einfart{} and \simplivre{} support three languages: English, French, and Chinese, and these three languages can be switched seamlessly in a single document. Due to the usage of custom fonts, they need to be compiled with \hologo{XeLaTeX} or \hologo{LuaLaTeX}. + \einfart{} supports six languages: English, French, German, Chinese, Japanese and Russian. These languages can be switched seamlessly in a single document. Due to the usage of custom fonts, \einfart{} requires \hologo{XeLaTeX} or \hologo{LuaLaTeX} to compile. This documentation is typeset using \einfart{}. You can think of it as a short introduction and demonstration. \end{abstract} \tableofcontents -\section{On the naming and options} -\einfart{} is taken from German word ``einfach'' (``simple''), combined with the first three letters of ``artikel'' (``article''). +\bigskip +\begin{remind} + Multi-language support, theorem-like environments, draft marks and some other features are provided by the \ProjLib{} toolkit. Here we only briefly discuss how to use it with this document class. For more detailed information, you can refer to the documentation of \ProjLib{}. +\end{remind} + +\clearpage +\section{Initialization} + +\subsection{How to load} + +One only needs to put +\begin{code} + \documentclass{einfart} +\end{code} +as the first line to use the \einfart{} class. Please note that you need to use either \hologo{XeLaTeX} or \hologo{LuaLaTeX} engine to compile. + +\subsection{Options} -\simplivre{} is taken from French words ``simple'' and ``livre'' (for ``book''). +\einfart{} offers the following options: -You can use the option \verb|fast| to enable a fast but slightly rough version. The main differences are: \begin{itemize} - \item Use simpler math font configuration; - \item Do not use hyperref; - \item Do not use tikz; - \item Use polyglossia instead of babel to support multiple languages. (Using polyglossia will increase the compilation speed slightly, but the current compatibility with Chinese is not perfect. When it becomes more stable, I will consider fully switching to polyglossia) + \item \texttt{draft} or \texttt{fast} + \begin{itemize} + \item The option \verb|fast| enables a faster but slightly rougher style, main differences are: + \begin{itemize} + \item Use simpler math font configuration; + \item Do not use hyperref; + \item Enable the fast mode of \ProjLib{} toolkit. + \end{itemize} + \end{itemize} + \item \texttt{a4paper} or \texttt{b5paper} + \begin{itemize} + \item Optional paper size. The default paper size is 7in $\times$ 10in. + \end{itemize} + \item \texttt{allowbf} + \begin{itemize} + \item Allow boldface. When this option is enabled, the title, titles of all levels and names of theorem-like environments will be bolded. + \end{itemize} + \item \texttt{classical} + \begin{itemize} + \item Classic mode. When this option is enabled, the style will become more regular: paragraphs are indented, the use of underlines are reduced, heading styles are changed, and the theorem styles will be much closer to common styles. + \end{itemize} \end{itemize} -During the writing stage of your document, it is recommended to use the \verb|fast| option to speed up compilation and improve the smoothness of your writing experience. At the end, you can remove the ``fast'' mark to get the final version. +\begin{remind} + \begin{itemize} + \item During the draft stage, it is recommended to use the \verb|fast| option to speed up compilation. At the end, one should remove the ``fast'' option to get the final version. When in \verb|fast| mode, there will be a watermark "DRAFT" to indicate that you are currently in the draft mode. + \item \texttt{allowbf} + \texttt{classical} is probably a good choice if you prefer traditional style. + \end{itemize} +\end{remind} + +\section{On the fonts} +By default, \einfart{} uses Palatino Linotype as the English font, FounderType's YouSong and YouHei GBK as the Chinese fonts, and partially uses Neo Euler as the math font. Among them, Neo Euler can be downloaded at \url{https://github.com/khaledhosny/euler-otf}. The other fonts are not free, you need to purchase and use them on your own. (For the Chinese fonts, visit FounderType's website for detail: \url{https://www.foundertype.com} ). + +% \begin{itemize} +% \item English main font. \textsf{English sans serif font}. +% \item 中文主要字体, \textsf{中文无衬线字体} +% \item Math demonstration: \( \alpha, \beta, \gamma, \delta, 1,2,3,4, a,b,c,d \), \[\mathrm{li}(x)\coloneqq \int_2^{\infty} \frac{1}{\log t}\,\mathrm{d}t \] +% \end{itemize} + +When the corresponding font is not installed, fonts that comes with TeX Live will be used instead. In this case, the experience might be reduced. \section{Some instructions} -There is no indentation at the beginning of each paragraph, but there will be a half-line space between each two paragraphs. like this --- +Many of the features described next are provided by the \ProjLib{} toolkit. Only the basic usage is mentioned here. For more details, please refer to its user documentation. + +\subsection{Language configuration} + +\einfart{} has multi-language support, including simplified Chinese, traditional Chinese, English, French, German, Japanese, and Russian. 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). -Here is the next paragraph. \subsection{Theorems and how to reference them} -Environments such as definitions and theorems have been pre-defined and can be used directly, for example: +Environments such as definitions and theorems have been pre-defined and can be used directly. + +More specifically, 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. + +When referencing a theorem-like environment, it is recommended to use clever 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. + +\begin{remind}[Example] \begin{code} \begin{definition}[Strange things] \label{def: strange} ... \end{code} + will produce \begin{definition}[Strange things]\label{def: strange} - This is the definition of some strange objects. + This is the definition of some strange objects. There is approximately an one-line space before and after the theorem environment, and there will be a symbol to mark the end of the environment. \end{definition} -There is approximately an one-line space before and after the theorem environment. There will be a symbol to mark the end of the environment. +\lstinline|\cref{def: strange}| will be displayed as: \cref{def: strange}. + +After using \lstinline|\UseLanguage{French}|, a theorem will be displayed as: + +\UseLanguage{French} +\begin{theorem}[Inutile]\label{thm} + Un théorème en français. +\end{theorem} + +By default, when referenced, the name of the theorem always matches the language of the context in which the theorem is located. For example, the definition above is still displayed in English in the current French mode: \cref{def: strange} and \cref{thm}. If you want the name of the theorem to match the current context when referencing, you can add \texttt{regionalref} to the global options. +\end{remind} + +\UseLanguage{English} -When referencing, you can directly use clever reference \lstinline|\cref{(label name)}|. For example, \lstinline|\cref{def: strange}| will be displayed as: \cref{def: strange}. \subsection{Define a new theorem-like environment} -First define the name of this environment in the language used: \lstinline|\(name of environment)(language name)|. Where \lstinline|(language name)| can be \lstinline|EN|, \lstinline|FR|, \lstinline|CN|, etc., and then define this environment in one of the following four ways: +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} + +\vspace{-.5\baselineskip} +\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} + +And then define this environment in one of following five ways: \begin{itemize} - \item \lstinline|\CreateTheorem*{(name of environment)}| - \item \lstinline|\CreateTheorem{(name of environment)}[(numbered like)]| - \item \lstinline|\CreateTheorem{(name of environment)}<(numbered within)>| - \item \lstinline|\CreateTheorem{(name of environment)}| + \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}|\\\lstinline|(theorem)|, one can then use the name \texttt{thm} to write theorem. + \item To remove the numbering. 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*} +\CreateTheorem{proofidea}<subsection> + +\bigskip +Here is an example. The following code: -For example, \begin{code} \def\proofideanameEN{Idea} - \CreateTheorem*{proofidea} + \CreateTheorem*{proofidea*} + \CreateTheorem{proofidea}<subsection> \end{code} -defines an unnumbered environment \lstinline|proofidea|, which supports using in the English context, and the effect is as follows: + +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: + +\begin{proofidea*} + The \lstinline|proofidea*| environment. +\end{proofidea*} \begin{proofidea} - ... + The \lstinline|proofidea| environment. \end{proofidea} \subsection{Draft mark} You can use \lstinline|\dnf| to mark the unfinished part. For example: \begin{itemize} - \item \lstinline|\dnf|: \quad \dnf - \item \lstinline|\dnf<Still need ...>|: \quad \dnf<Still need ...> + \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. \end{itemize} -Similarly, there is \lstinline|\needgraph| : +Similarly, there is \lstinline|\needgraph| : \begin{itemize} - \item \lstinline|\needgraph|: \needgraph - \item \lstinline|\needgraph<About ...>|: \needgraph<About ...> + \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} -\subsection{Language configuration} -You can use \lstinline|\UseLanguage{(name of language))}| at any time to change the language, Language names include Chinese, English, French (the case of the first letter is arbitrary, for example, ``chinese'' is also acceptable). With this, the effects of various commands and environments will also change accordingly. +\subsection{On the title, abstract and keywords} -For example, after using \lstinline|\UseLanguage{French}|, the theorem and the draft mark will be displayed as: +\einfart{} has both the features of standard classes and that of the \AmS{} classes. -\UseLanguage{French} -\begin{theorem}[Inutile]\label{thm} - Un théorème en français. \dnf -\end{theorem} +Therefore, the title part can either be written in the usual way, in accordance with the standard class \textsf{article}: + +\begin{code} + \title{(*\meta{title}*)} + \author{(*\meta{author}*)} + \date{(*\meta{date}*)} + \maketitle + \begin{abstract} + (*\meta{abstract}*) + \end{abstract} + \begin{keyword} + (*\meta{keywords}*) + \end{keyword} +\end{code} -When referenced, the name of the theorem always matches the language of the region in which the theorem is located, for example, the definition of the beginning is still displayed in English in the current French mode: \cref{def: strange} and \cref{thm}. +or written in the way of \AmS{} classes: -\UseLanguage{English} +\begin{code} + \title{(*\meta{title}*)} + \author{(*\meta{author}*)} + \address{(*\meta{address}*)} + \email{(*\meta{email}*)} + \date{(*\meta{date}*)} + \keywords{(*\meta{keywords}*)} + \subjclass{(*\meta{subjclass}*)} + \begin{abstract} + (*\meta{abstract}*) + \end{abstract} + \maketitle +\end{code} + +\medskip +The author information can contain multiple groups, written as: + +\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} +Among them, the mutual order of \lstinline|\address|, \lstinline|\curraddr|, \lstinline|\email| is not important. + +\clearpage \subsection{On the line numbers} Line numbers can be turned on and off at any time. \lstinline|\linenumbers| is used to enable the line numbers, and \lstinline|\nolinenumbers| is used to disable them. For the sake of beauty, the title, table of contents, index and some other elements are not numbered. @@ -168,72 +379,117 @@ In \lstinline|\section| or \lstinline|\subsection| , if you wish to add footnote \end{itemize} This is a disadvantage brought about by the underline decoration of the title. -\subsection{On the fonts} -\einfart{} and \simplivre{} use Palatino Linotype as the English font, FounderType's YouSong and YouHei Simplified as the Chinese fonts, and partially use Neo Euler as the mathematical font: -\begin{itemize} - \item English main font. \textsf{English sans serif font}. - \item 中文主要字体, \textsf{中文无衬线字体} - \item Math demonstration: \( \alpha, \beta, \gamma, \delta, 1,2,3,4, a,b,c,d \), \[\mathrm{li}(x)\coloneqq \int_2^{\infty} \frac{1}{\log t}\,\mathrm{d}t \] -\end{itemize} -Among them, Neo Euler can be downloaded at \url{https://github.com/khaledhosny/euler-otf}. Other fonts are not free, you need to purchase and use them on your own. (For the Chinese fonts, visit FounderType's website for detail: \url{https://www.foundertype.com} ). +\section{Known issues} -When the corresponding font is not installed, the font that comes with TeX Live will be used instead, and the experience might be reduced. +\begin{itemize}[itemsep=.6em] + \item The font settings are still not perfect. + \item Since many features are based on the \ProjLib{} toolkit, \einfart{} inherits all its problems. For details, please refer to the "Known Issues" section of the \ProjLib{} documentation. + \item The error handling mechanism is incomplete: there is no corresponding error prompt when some problems occur. + \item There are still many things that can be optimized in the code. +\end{itemize} +\clearpage \section{Document templates} -\singlespacing +\subsection{The standard way} + +If you want to write in the standard way, you can refer to the following example: -\LocallyStopLineNumbers -\begin{minipage}{0.45\textwidth} \begin{code} -%! TEX program = xelatex -\documentclass[fast]{einfart} +\documentclass{einfart} +\usepackage{PJLtoolkit} % Load ProjLib toolkit -\linenumbers -\UseLanguage{French} +\UseLanguage{French} % Use French from here \begin{document} -\title{Titre} -\author{Nom} -\date{03 / 2021, Lieu} +\title{Le Titre} +\author{Auteur} +\date{\PJLdate{2022-04-01}} \maketitle -%% Texte ici +\begin{abstract} + Ceci est un résumé. \dnf<Plus de contenu est nécessaire.> +\end{abstract} +\begin{keyword} + AAA, BBB, CCC, DDD, EEE +\end{keyword} + +\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} -\end{minipage} -% -\hfill -% -\begin{minipage}{0.45\textwidth} + +If you wish to switch to the standard class later, just replace the first two lines with: + \begin{code} -%! TEX program = xelatex -\documentclass[fast]{einfart} +\documentclass{article} +\usepackage[a4paper,margin=1in]{geometry} +\usepackage[hidelinks]{hyperref} +\usepackage[palatino]{PJLtoolkit} % Load ProjLib toolkit +\end{code} + + +\clearpage +\subsection{The \texorpdfstring{\AmS{}}{AMS} way} -\linenumbers -\UseLanguage{Chinese} +If you intend to switch to the journal template in the future and thus want to use the writing style as in the \AmS{} classes, you can refer to the following example: + +\begin{code} +\documentclass{einfart} +\usepackage{PJLtoolkit} % Load ProjLib toolkit + +\UseLanguage{French} % Use French from here \begin{document} -\title{标题} -\author{姓名} -\date{2021年3月,地点} +\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{\PJLdate{2022-04-01}} +\subjclass{*****} +\keywords{...} + +\begin{abstract} + Ceci est un résumé. \dnf<Plus de contenu est nécessaire.> +\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{minipage} -\par -\ResumeLineNumbers -\bigskip -(\lstinline|\UseLanguage| can be placed either in the preamble or in the body part, and can be used repeatedly as needed) +In this way, if you wish to switch to \AmS{} class later, just replace the first two lines with: + +\begin{code} +\documentclass{amsart} +\usepackage[a4paper,margin=1in]{geometry} +\usepackage[hidelinks]{hyperref} +\usepackage[palatino]{PJLtoolkit} % Load ProjLib toolkit +\end{code} \end{document} diff --git a/macros/unicodetex/latex/einfart/einfart.cls b/macros/unicodetex/latex/einfart/einfart.cls index 50dae49c48..52bad4daaa 100644 --- a/macros/unicodetex/latex/einfart/einfart.cls +++ b/macros/unicodetex/latex/einfart/einfart.cls @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020-10-01] \ProvidesClass{einfart} - [2021/03/15 A simple and clear article style] + [2021/05/23 A simple and clear article style] \def\minimclass@baseclass{article} \RequirePackage{kvoptions} \RequirePackage{etoolbox} @@ -27,6 +27,13 @@ } \DeclareBoolOption[false]{draft} \DeclareBoolOption[false]{fast} +\DeclareBoolOption[false]{classical} + +\newif\if@minimclass@bfivepaper\@minimclass@bfivepaperfalse +\DeclareVoidOption{b5paper}{\@minimclass@bfivepapertrue} +\newif\if@minimclass@afourpaper\@minimclass@afourpaperfalse +\DeclareVoidOption{a4paper}{\@minimclass@afourpapertrue} + \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{\minimclass@baseclass}} \ProcessKeyvalOptions*\relax \LoadClass{\minimclass@baseclass} @@ -37,6 +44,8 @@ %%================================ %% Page layout %%================================ +\RequirePackage{silence} +\WarningFilter{geometry}{Over-specification in} \RequirePackage[heightrounded]{geometry} \geometry{ papersize={7in,10in}, @@ -45,15 +54,36 @@ vmarginratio=1:1, footnotesep=2em plus 2pt minus 2pt, } +\if@minimclass@bfivepaper +\geometry{ + b5paper, + total={40em,59em}, + hmarginratio=1:1, + vmarginratio=1:1, + footnotesep=2em plus 2pt minus 2pt, +} +\fi +\if@minimclass@afourpaper +\geometry{ + a4paper, + total={47em,70em}, + hmarginratio=1:1, + vmarginratio=1:1, + footnotesep=2em plus 2pt minus 2pt, +} +\fi \if@minimclass@fast \PassOptionsToPackage{fast}{minimalist} + \RequirePackage{draftwatermark} + \DraftwatermarkOptions{text={\normalfont DRAFT},colorspec=0.95} \fi -\if@minimclass@fast - \PassOptionsToPackage{polyglossia}{minimalist} +\if@minimclass@classical + \RequirePackage{indentfirst} +\else + \AtEndPreamble{\RequirePackage{parskip}} \fi \RequirePackage{minimalist} -\AtEndPreamble{\RequirePackage{parskip}} %%================================ %% Fonts @@ -69,27 +99,32 @@ \IfFontExistsTF{Palatino Linotype}{% \setmainfont{Palatino Linotype} }{ - \setmainfont{texgyrepagella-regular.otf}[ - BoldFont = texgyrepagella-bold.otf , - ItalicFont = texgyrepagella-italic.otf , - BoldItalicFont = texgyrepagella-bolditalic.otf ] + \setmainfont{TeXGyrePagellaX-Regular.otf}[ + BoldFont = TeXGyrePagellaX-Bold.otf , + ItalicFont = TeXGyrePagellaX-Italic.otf , + BoldItalicFont = TeXGyrePagellaX-BoldItalic.otf ] } \setsansfont{SourceSansPro-Regular.otf}[ - Scale = MatchLowercase, + Scale = MatchLowercase , BoldFont = SourceSansPro-Bold.otf , ItalicFont = SourceSansPro-RegularIt.otf , BoldItalicFont = SourceSansPro-BoldIt.otf ] + \setmonofont{cmuntt.otf}[ + Scale = 1.05 , + BoldFont = cmuntb.otf , + ItalicFont = cmunst.otf , + BoldItalicFont = cmuntb.otf ] %% Chinese fonts \PassOptionsToPackage{fontset=none,scheme=plain}{ctex} \RequirePackage{ctex} -\IfFontExistsTF{FZYouSongS 507R}{% - \setCJKmainfont{FZYouSongS 507R}[ - BoldFont = FZYouSongS 509R , - BoldFeatures = {FakeBold=2} , +\IfFontExistsTF{FZYOUSK_507R--GBK1-0}{% + \setCJKmainfont{FZYOUSK_507R--GBK1-0}[ + BoldFont = FZYOUSK_509R--GBK1-0 , + BoldFeatures = {FakeBold=4} , ItalicFont = * , - BoldItalicFont = FZYouSongS 509R , - BoldItalicFeatures = {FakeBold=2} , + BoldItalicFont = FZYOUSK_509R--GBK1-0 , + BoldItalicFeatures = {FakeBold=4} , SmallCapsFont = * ] }{ \setCJKmainfont{FandolSong-Regular.otf}[ @@ -99,13 +134,13 @@ BoldItalicFeatures = {FakeBold=4} , SmallCapsFont = * ] } -\IfFontExistsTF{FZYouSongS 507R}{% - \setCJKmonofont{FZYouSongS 507R}[ - BoldFont = FZYouSongS 509R , - BoldFeatures = {FakeBold=2} , +\IfFontExistsTF{FZYOUSK_507R--GBK1-0}{% + \setCJKmonofont{FZYOUSK_507R--GBK1-0}[ + BoldFont = FZYOUSK_509R--GBK1-0 , + BoldFeatures = {FakeBold=4} , ItalicFont = * , - BoldItalicFont = FZYouSongS 509R , - BoldItalicFeatures = {FakeBold=2} , + BoldItalicFont = FZYOUSK_509R--GBK1-0 , + BoldItalicFeatures = {FakeBold=4} , SmallCapsFont = * ] }{ \setCJKmonofont{FandolFang-Regular.otf}[ @@ -116,11 +151,12 @@ BoldItalicFeatures = {FakeBold=4} , SmallCapsFont = * ] } -\IfFontExistsTF{FZYouHeiS 506L}{% - \setCJKsansfont{FZYouHeiS 506L}[ - BoldFont = FZYouHeiS 509R, +\IfFontExistsTF{FZYOUHK_506L--GBK1-0}{% + \setCJKsansfont{FZYOUHK_506L--GBK1-0}[ + BoldFont = FZYOUHK_509R--GBK1-0 , + BoldFeatures = {FakeBold=4} , ItalicFont = * , - BoldItalicFont = FZYouHeiS 509R , + BoldItalicFont = FZYOUHK_509R--GBK1-0 , SmallCapsFont = * ] }{ \setCJKsansfont{FandolHei-Regular.otf}[ @@ -131,14 +167,16 @@ } %% Math font -\if@minimclass@fast\else +\if@minimclass@fast +\RequirePackage{amssymb} +\else \PassOptionsToPackage {warnings-off={mathtools-colon,mathtools-overbracket}}{unicode-math} \RequirePackage{unicode-math} -\unimathsetup{math-style=ISO} +\unimathsetup{math-style=ISO, partial=upright, nabla=upright} \setmathfont{Asana-Math.otf} \IfFontExistsTF{Neo Euler}{% -\setmathfont{Neo Euler} % From https://tex.stackexchange.com/a/425887 +\setmathfont{Neo Euler} [range={"0000-"0001,"0020-"007E, "00A0,"00A7-"00A8,"00AC,"00AF,"00B1,"00B4-"00B5,"00B7, "00D7,"00F7, @@ -165,9 +203,22 @@ "1D507-"1D50A,"1D50D-"1D514,"1D516-"1D51C,"1D51E-"1D537, "1D56C-"1D59F,"1D6A8-"1D6B8,"1D6BA-"1D6D2,"1D6D4-"1D6DD, "1D6DF,"1D6E1,"1D7CE-"1D7D7 }] +\setmathfont[range=up/{greek,Greek}, script-features={}, sscript-features={} + ]{Neo Euler} +\setmathfont[range=up/{latin,Latin}, script-features={}, sscript-features={} + ]{Neo Euler} +\setmathfont[range={bfup/{latin, Latin, greek, Greek}, frak, bffrak, cal}, + script-features={}, sscript-features={} + ]{Neo Euler} +\setmathfont[range={up/num, bfup/num, it, bfit, scr, bfscr, + sfup, sfit, bfsfup, bfsfit, tt} + ]{Asana-Math.otf} +\setmathfont[range=bfcal, Scale=MatchUppercase, Alternate]{Asana-Math.otf} }{} \fi +\def\PJL@font@alreadyset{} + \RequirePackage[verbose=silent]{microtype} %%================================ @@ -176,7 +227,9 @@ \RequirePackage{graphicx} \graphicspath{{images/}} \RequirePackage{wrapfig} +\RequirePackage{float} \RequirePackage{caption} +\captionsetup{font=small} %%================================ %% Index @@ -185,53 +238,6 @@ \pretocmd{\printindex}{\LocallyStopLineNumbers}{}{\FAIL} \apptocmd{\printindex}{\ResumeLineNumbers}{}{\FAIL} -%%================================ -%% Draft mark -%%================================ -\def\dnfFont{\ttfamily} -\def\needgraphFont{\ttfamily} - -\def\dnfTextEN{To be finished here} -\def\needgraphTextEN{A graph is needed here} -\def\dnfTextFR{À terminer ici} -\def\needgraphTextFR{Il manque encore un graphique ici} -\def\dnfTextCN{这里的内容尚未完成} -\def\needgraphTextCN{这里需要一张图片} - -\definecolor{dnfColor}{RGB}{21,122,20} -\definecolor{needgraphColor}{RGB}{70,130,180} - -\if@minimclass@fast - \newcommand{\plainBox}[2][-paper]{\textcolor{#1}{% - \setlength{\fboxsep}{1.5pt}% - \setlength{\fboxrule}{1.2pt}% - \fbox{#2}}} -\else - \PassOptionsToPackage{many}{tcolorbox} - \RequirePackage{tcolorbox} - \newtcbox{\plainBox}[1][-paper]{enhanced jigsaw,% - on line, arc = 1.2pt, outer arc = 1pt,breakable,% - colframe = #1,colupper=#1,opacityback=0,% - boxsep = 1pt,boxrule = 1.2pt,% - left = 1pt, right = 1pt, top = 0pt, bottom = 0pt,% - } -\fi - -\NewDocumentCommand{\dnf}{d<>}{% - \noindent\plainBox[dnfColor]% - {\normalfont\dnfFont\bfseries\small% - \csname dnfText\csname\languagename ABBR\endcsname\endcsname% - \IfNoValueF{#1}{ : #1}}% -} -\NewDocumentCommand{\needgraph}{d<>}{% - \par% - \centerline{\plainBox[needgraphColor]% - {\normalfont\needgraphFont\bfseries\small% - \csname needgraphText\csname\languagename ABBR\endcsname\endcsname% - \IfNoValueF{#1}{ : #1}}}% - \par% -} - \endinput %% %% End of file `einfart/einfart.cls'. |