diff options
Diffstat (limited to 'macros')
13 files changed, 1221 insertions, 304 deletions
diff --git a/macros/latex/contrib/beautybook/Beautybook-V6.1-CN.cls b/macros/latex/contrib/beautybook/Beautybook-CN.cls index 4e2f170d62..22bdb8248c 100644 --- a/macros/latex/contrib/beautybook/Beautybook-V6.1-CN.cls +++ b/macros/latex/contrib/beautybook/Beautybook-CN.cls @@ -1,6 +1,6 @@ %This Class is based on the default book class and options will be passed \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{Beautybook-V6.1-CN}[01-05-2023 V6.1 Beautybook Class] +\ProvidesClass{Beautybook-CN}[17-06-2023 Beautybook Class] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}} \ProcessOptions\relax \LoadClass[twoside]{ctexbook} diff --git a/macros/latex/contrib/beautybook/Beautybook-V6.1-EN.cls b/macros/latex/contrib/beautybook/Beautybook-EN.cls index 9efc799295..5f2652d753 100644 --- a/macros/latex/contrib/beautybook/Beautybook-V6.1-EN.cls +++ b/macros/latex/contrib/beautybook/Beautybook-EN.cls @@ -1,6 +1,6 @@ %This Class is based on the default book class and options will be passed \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{Beautybook-V6.1-EN}[01-05-2023 V6.1 Beautybook Class] +\ProvidesClass{Beautybook-EN}[17-06-2023 Beautybook Class] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} \ProcessOptions\relax \LoadClass[twoside]{book} @@ -8,22 +8,20 @@ \RequirePackage[fontsize=13.5pt]{fontsize} \linespread{1.05} \RequirePackage[dvipsnames,svgnames,x11names,table]{xcolor} -\colorlet{outermarginfgcolor}{DarkCyan} % foregroundcolor 较深 -\colorlet{outermarginbgcolor}{DarkCyan!30} % backgroundcolor 较浅 -\definecolor{高粱红}{HTML}{951c48} +\colorlet{outermarginfgcolor}{DarkCyan} % foregroundcolor +\colorlet{outermarginbgcolor}{DarkCyan!30} % backgroundcolor \RequirePackage{cncolours} -\RequirePackage{bropd} % math 自适应数学括号命令 \br{} !!! -\RequirePackage{tikz-imagelabels} % tikz图像标注 -\RequirePackage{epigraph-keys} % 名言引用 -\RequirePackage{fitbox} % 图像自适应 +\RequirePackage{bropd} +\RequirePackage{tikz-imagelabels} +\RequirePackage{epigraph-keys} +\RequirePackage{fitbox} \RequirePackage{pgfornament-han} \RequirePackage{tikz} \usetikzlibrary{calc,shadows,hobby,intersections, decorations.markings, decorations.pathreplacing,spy,arrows,shapes,fadings,trees,mindmap,patterns,shapes.arrows,shapes.symbols,tikzmark,shapes.geometric,graphs, quotes, angles,decorations.pathmorphing,through,shadings,backgrounds,positioning,fit,arrows.meta,shapes.misc,decorations.shapes} -\RequirePackage{pgfplots} %画图 %%页面样式设计核心包 %提供\pgfonlayer命令以及下列图层指令 +\RequirePackage{pgfplots} \pgfplotsset{compat=1.18} % \ExplSyntaxOn -% 封面切换程序 (LaTeX3)! \keys_define:nn {Beautybook/coverstyle} { cover-choose.choice:, @@ -32,7 +30,7 @@ cover-choose/en.code:n = {\RequirePackage{stys/Beautybook-en}}, cover-choose/enfig.code:n = {\RequirePackage{stys/Beautybook-enfig}}, cover-choose/birkar.code:n = {\RequirePackage{stys/Beautybook-birkar}}, - %cover-choose .initial:n = en , % 设置 en 为初始值 + %cover-choose .initial:n = en , } \newtoks \l__Beautybook_tmpa_toks \cs_new_protected:Npn \coverstyle @@ -65,7 +63,7 @@ }{} \renewcommand{\partial}{{\text{\usefont{U}{nxlmi}{m}{it}\symbol{64}}\mspace{1mu}}} }, - %cover-choose .initial:n = plain , % 设置 en 为初始值 + %cover-choose .initial:n = plain , } \cs_new_protected:Npn \mathstyle { @@ -80,7 +78,7 @@ % \RequirePackage{amssymb,amsfonts} \RequirePackage{makeidx} -\RequirePackage{etoolbox} % 判断函数 +\RequirePackage{etoolbox} \RequirePackage{paracol} \RequirePackage{tikz-cd} \RequirePackage{imakeidx} @@ -89,30 +87,27 @@ \RequirePackage{xkeyval,ifthen} \RequirePackage[backgroundcolor=yellow!40!cyan!20,bordercolor=yellow!40!cyan!20,linecolor=DarkCyan]{todonotes} \RequirePackage{varwidth} -\RequirePackage[colorlinks,linkcolor = purple, %%修改此处为你想要的颜色 -anchorcolor = purple, %%修改此处为你想要的颜色 -urlcolor = purple, %%修改此处为你想要的颜色 -citecolor = purple, %%修改此处为你想要的颜色 +\RequirePackage[colorlinks,linkcolor = purple, +anchorcolor = purple, +urlcolor = purple, +citecolor = purple, ]{hyperref} \setcounter{tocdepth}{3} -\setcounter{secnumdepth}{3}%增加编号深度 +\setcounter{secnumdepth}{3} \RequirePackage{dashrule} \newlength\outermarginwidth \setlength\outermarginwidth{1.5cm} \newlength\covershift \setlength\covershift{5cm} \RequirePackage{caption} -% 图注与表注格式 -\colorlet{captioncolor}{outermarginfgcolor} % 图片和表格题注文字颜色 +\colorlet{captioncolor}{outermarginfgcolor} \makeatletter -%%----------------------------------封面信息定义--------------------------------------------------------%% \newcommand\bookseries[1]{\def\@bookseries{#1}} \newcommand\subtitle[1]{\def\@subtitle{#1}} \newcommand\edition[1]{\def\@edition{#1}} \newcommand\presslogo[1]{\def\@presslogo{#1}} \newcommand\pressname[1]{\def\@pressname{#1}} \newcommand\coverimage[1]{\def\@coverimage{#1}} -%%----------------------------------封面信息定义--------------------------------------------------------%% \makeatother \RequirePackage{indentfirst} \RequirePackage{physics} @@ -120,7 +115,7 @@ citecolor = purple, %%修改此处为你想要的颜色 \pagecolor{nuanbai} \RequirePackage{amsmath} \RequirePackage{zhlipsum} -\RequirePackage{times} +\RequirePackage{stix} \RequirePackage[left=2cm,right=2cm,top=.6cm,bottom=2.2cm]{geometry} \RequirePackage{xpatch}%修正章节编号 \RequirePackage[automark]{scrlayer-scrpage}%页面设置宏包,隶属于koma-script文档类 @@ -236,7 +231,7 @@ citecolor = purple, %%修改此处为你想要的颜色 % ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); \fill [outermarginfgcolor,path fading=fade up,rounded corners=5pt]% ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); - \node[above left,font=\fontsize{25}{25}\selectfont\bfseries,align=center] (contents name) at ([shift={(0cm,-4.45cm)}]current page.north east) {\begin{varwidth}{.7\linewidth}\baselineskip=2ex #1\end{varwidth}}; + \node[above left,font=\fontsize{25}{25}\selectfont\bfseries,align=center] (contents name) at ([shift={(0cm,-4.45cm)}]current page.north east) {\begin{varwidth}{.7\linewidth}\baselineskip=2.3ex #1\end{varwidth}}; \end{pgfonlayer} \begin{pgfonlayer}{bottom} \node[right] (image) at ([shift={(-0.5cm,-2.8cm)}]current page.north west) {\includegraphics[width=7cm]{inner_pics/song2.png}}; @@ -249,7 +244,7 @@ citecolor = purple, %%修改此处为你想要的颜色 % ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); \fill [outermarginfgcolor,path fading=fade up,rounded corners=5pt]% ([yshift=2cm]chapnum.north west) rectangle (chapnum.south east); - \node[above right,font=\fontsize{25}{25}\selectfont\bfseries,align=center] (contents name) at ([shift={(0cm,-4.45cm)}]current page.north west) {\begin{varwidth}{.7\linewidth}\baselineskip=2ex #1\end{varwidth}}; + \node[above right,font=\fontsize{25}{25}\selectfont\bfseries,align=center] (contents name) at ([shift={(0cm,-4.45cm)}]current page.north west) {\begin{varwidth}{.7\linewidth}\baselineskip=2.3ex #1\end{varwidth}}; \end{pgfonlayer} \begin{pgfonlayer}{bottom} \node[left] (image) at ([shift={(0.5cm,-2.8cm)}]current page.north east) {\includegraphics[width=7cm]{inner_pics/song.png}}; diff --git a/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.pdf b/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.pdf Binary files differindex 4504ef36d9..5555dcddf7 100644 --- a/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.pdf +++ b/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.pdf diff --git a/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.tex b/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.tex index 2357391c39..dc2e3d7af5 100644 --- a/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.tex +++ b/macros/latex/contrib/beautybook/Beautybook-introduction-chinese.tex @@ -1,7 +1,7 @@ %% This work is released under the LaTeX Project Public License, v1.3c or later. % This template is made by Ethan Lu. % Please use XeLaTeX engine! -\documentclass[zihao=-4,fontset=windows]{Beautybook-V6.1-CN} +\documentclass[zihao=-4,fontset=windows]{Beautybook-CN} \coverstyle={ % 封面键值列表 cover-choose=cn, % cn (需新增项\entitle{#}); en ; enfig ; birkar } diff --git a/macros/latex/contrib/beautybook/Beautybook-introduction-english.pdf b/macros/latex/contrib/beautybook/Beautybook-introduction-english.pdf Binary files differindex 48c2a402d0..3d159d085d 100644 --- a/macros/latex/contrib/beautybook/Beautybook-introduction-english.pdf +++ b/macros/latex/contrib/beautybook/Beautybook-introduction-english.pdf diff --git a/macros/latex/contrib/beautybook/Beautybook-introduction-english.tex b/macros/latex/contrib/beautybook/Beautybook-introduction-english.tex index 2f83a3a3a5..65367f3a78 100644 --- a/macros/latex/contrib/beautybook/Beautybook-introduction-english.tex +++ b/macros/latex/contrib/beautybook/Beautybook-introduction-english.tex @@ -1,7 +1,7 @@ %% This work is released under the LaTeX Project Public License, v1.3c or later. % This template is made by Ethan Lu. % Please use pdfLaTeX engine! -\documentclass{Beautybook-V6.1-EN} +\documentclass{Beautybook-EN} \coverstyle={ cover-choose=en, % cn (Need \entitle{#}); en ; enfig ; birkar } @@ -150,7 +150,7 @@ % \newenvironment{note}[1][\bf Note:]{\par\Line\uuline{#1} }{\par\Line} \renewcommand{\Line}{\noindent\tikz\draw[line width=0.65pt,gray!80,dashed] (0,0)--++(.99\linewidth,0);\par} -\newcommand{\Wedge}[1][]{\tikz\path [draw,line width=1pt] (0,0)--++(4pt,12pt) node[right,font=\scriptsize] {#1} --++(4pt,-12pt);} +% \newcommand{\Wedge}[1][]{\tikz\path [draw,line width=1pt] (0,0)--++(4pt,12pt) node[right,font=\scriptsize] {#1} --++(4pt,-12pt);} \newenvironment{key}[1]{\begin{fancybox}{#1}\ }{\end{fancybox}} \newcommand{\pr}{^\prime} \newcommand{\prr}{^{\prime\prime}} @@ -194,10 +194,10 @@ }% \begin{document} \thispagestyle{empty} -\title{An Introduction to Complex Geometry} +\title{An Introduction to Beautybook template} \subtitle{} \edition{First Edition} -\bookseries{UniversiText} +\bookseries{Illustrated by Ethan Lu} \author{Ethan Lu} \pressname{logo} \presslogo{inner_pics/logo.png} @@ -243,55 +243,199 @@ As my first english book, i'm happy. \partabstract{\hspace*{2em} Here is the introduction area of each part, where you can write a concise overview of the part, of course, if there is nothing to say, you can leave it blank.} \part{The template usage introduction of \textbf{Beautybook}} \chapter{A short introduction of \textbf{Beautybook}} -Beauty \LaTeX{} series of templates is a book series made by me, an unknown little person. In fact, there are only two series, one is the custom book template \textbf{fancybook } , which is dedicated to the fresh and elegant style. (this has been changed permanently, because of my aesthetic problem, I prefer “Beauty”, forgive me!) , the other is my flagship product-\textbf{ Beautybook } ! About why they have such strange names? My answer is, originally I wanted to name it elegantboook, but there is already the famous elegantbook series, so I can only settle for the next best thing and name it a combination of a noun and a book with the same meaning of beauty, the Ancients Cloud: the book has its own Yan Ruyu, this is not, the beauty with books, is not beautiful! Therefore, this is the origin of \textbf{beauty book } ! -I am committed to creating a series of beautiful, elegant, simple template to facilitate the use of users and myself (mainly for their own, but can not stand the appreciation of everyone, I would like to introduce myself, please understand!) . Version changes frequently, please pay attention to version information, before starting to use templates, it is recommended to choose the latest official version! The latest test version will usually be released in the QQ Group, you can take it, after taking it is to stay at will.But unfortunately, I will be on July 5 in 2023 to stop maintenance and updates, so I can no longer solve the problem for you in the Q Group, Sorry! +The Beauty\LaTeX{} collection is a series of templates authored by a humble, unknown individual. In fact, there are only two series, one is the custom book template \textbf{fancybook } , which is dedicated to the fresh and elegant style, the other is my flagship product-\textbf{ Beautybook } ! Why did I choose such an unusual name? My answer is, originally I wanted to name it elegantboook, but there is already the famous elegantbook template. Inspired by the old poem "There is a jade-like beauty waiting for you in the book", the template is named ``Beautybook", which means a beautiful woman in your arms and the fragrance of a book overflowing! Therefore, this is the origin of the name \textbf{Beautybook } ! + + +I am committed to creating a series of beautiful, elegant, simple template to facilitate the use of users and myself. Version changes frequently, please pay attention to version information. Before starting to use templates, it is recommended to choose the latest official version! The latest test version will usually be released in the QQ Group, you can download it and try it yourself! This article covers some of the setup and basic usage of this template. If you have any other questions, suggestions or comments, feel free to submit them to me on GitHub \href{https://github.com/BeautyLaTeX/latex-template/issues}{issues} or \href{h1479840692@163.com}{163 mail} or QQ mail \href{1479840692@qq.com}{QQ mail}. -The template address are + +The Project Addresses are the following. \begin{itemize} - \item GitHub address: \href{https://github.com/BeautyLaTeX/latex-template}{https://github.com/BeautyLaTeX/latex-template}, - \item Download frome here: \href{https://github.com/BeautyLaTeX/latex-template/releases}{Official release}, - \item User QQ Group: 809237593. + \item GitHub repository: \href{https://github.com/BeautyLaTeX/latex-template}{https://github.com/BeautyLaTeX/latex-template}, + \item Download Release: \href{https://github.com/BeautyLaTeX/latex-template/releases}{Official release}, + \item User QQ Group: 809237593. (!If you are not in China, please e-mail me at \href{h1479840692@outlook.com}{outlook-email}.) \end{itemize} + \textit{This work is released under the LaTeX Project Public License, v1.3c or later.} -\section{Template Installation and Update} -You will need to use this template by downloading it and compiling it. Only use it locally (within a folder) . +\section{Installation and Maintenance of Template} -\subsection{Use template online} +There are two ways you can use this template. The first method is trivial that just download the zip of template from above channel, and then unzip and compile the main file in the archive (i.e. a file with a name like ``Beautybook-xx. tex"). The second way is uploading the zip of template to \texttt{overleaf} to comply. -This template can be uploaded directly to overleaf for use, but note that you need to write \lstinline{math-font=plain} in the premble and compile with the XeLaTeX engine! +Note that if you choose the second way, you must write \lstinline{math-font=plain} in the premble of the main file! + +It is worth noting that when you download the template from CTAN, then the English version of it does not use any third-party fonts, so that one can be compiled using \texttt{pdflatex}. This is an exception to the rule under which all other files must be compiled using the \texttt{XeLaTeX} engine. \subsection{Local Installation} -\textbf{Local Installation} use the following method: download the latest version from GitHub or QQ group, strictly need only class file \lstinline {.cls} and some folders. Then place the template files in your working directory and synchronously copy these folders: \texttt{fonts}, \texttt{stys}, \texttt{figures}, and \texttt{inner\_pics}, \texttt{frontmatter} to use. (If you are a chinese user, you can choose to copy the chinesefonts folder.) The advantage of this is that you can install \texttt{mtpro2} font to achieve a more elegant effect than if you were using it online. Of course, the choice is left to the users, and I won't comment here. +To install locally, follow these steps: download the latest version from GitHub, CTAN or the QQ group. Then place the template files in your working directory and copy these folders synchronously: \texttt{fonts}, \texttt{stys}, \texttt{figures}, \texttt{inner\_pics}, and \texttt{frontmatter}, in order to utilize them. (If you are a chinese user, you can choose to copy the chinesefonts folder.) The advantage of this is that you can install \texttt{mtpro2} font to achieve a more elegant effect than if you were using it online. Of course, the choice is left to the users, and I won't comment here. -The following are examples of minimal work: +The following is an example of a minimal work: \begin{lstlisting} - \documentclass[zihao=-4,fontset=none]{Beautybook-V6.1-CN} % Instead of using a custom font, change it to fontset = Windows/Mac/Ubuntu and comment out stys/Settings-CN. Chinese font settings at the end of this sty! If you want to learn to use third-party fonts, you can also refer to their own configuration! + \documentclass[zihao=-4,fontset=none]{Beautybook-CN} %If english, change it to Beautybook-EN%Instead of using a custom font, change it to fontset = Windows/Mac/Ubuntu and comment out stys/Settings-CN. Chinese font settings at the end of this sty! If you want to learn to use third-party fonts, you can also refer to their own configuration! \coverstyle={ % List of covers key values cover-choose=cn, % cn (A new entry is required \entitle{#}); en ; enfig ; birkar } \mathstyle={ % List of math fonts key values math-font=mtpro2, %plain (Default mathematical font); mtpro2 % !! Do not use the key value if the mtpro2 font isn't installed! } - \usepackage{stys/settings-CN} + % Some commands to control the layout of floating elements. + \renewcommand*{\textfraction}{0.05} + \renewcommand*{\topfraction}{0.9} + \renewcommand*{\bottomfraction}{0.8} + \renewcommand*{\floatpagefraction}{0.85} + \DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png} + \graphicspath{{figures/}{figure/}{pictures/}{picture/}{pic/}{pics/}{image/}{images/}} + %=======================Theorem Setting Area===============================% + \mynewtheorem{ % The amsthm package offers theorem environments, and a tcolorbox is utilized on the exterior. % + defi={\textbf{Definition}}[section]{interior style={left color=ReD!8,right color=ReD!5!CyaN!50}, borderline west={1.5mm}{0mm}{ReD}}, + thm={\textbf{Theorem}}[section]{interior style={left color=CyaN!80!black!20,right color=CyaN!80!black!15!CyaN!50}, borderline west={1.5mm}{0mm}{CyaN!80!black}}, + lem={\textbf{Lemma}}[section]{interior style={left color=BluE!8,right color=BluE!5!CyaN!50}, borderline west={1.5mm}{0mm}{BluE}}, + prop={\textbf{Proposition}}[section]{interior style={left color=OrangE!8,right color=OrangE!5!CyaN!50}, borderline west={1.5mm}{0mm}{OrangE}}, + exam={\textbf{Example}}[chapter]{interior style={left color=DarkGreen!8,right color=DarkGreen!5!CyaN!50}, borderline west={1.5mm}{0mm}{DarkGreen}}, + cor={\textbf{Corollary}}[chapter]{interior style={left color=violet!8,right color=violet!5!CyaN!50}, borderline west={1.5mm}{0mm}{violet}}, + } + \newtheorem*{remark}{\textbf{Remark}} + % Two exquisite theorem boxes crafted by the author! + \makeatletter + \mynewtcbtheorem{ + theorem={ % Christmas gift box style + counter=tcbthm, + the counter=\thesection.\arabic{tcbthm}, + name=Theorem, + thmcolor=purple, + autoref name=\bfseries Theorem, + style={ + arc=3pt,breakable,enhanced,interior style={top color=purple!12 ,middle color=purple!9, bottom color=purple!6},boxrule=0pt,top=8mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},% up + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},% down + opacityframe=0, opacityback=0.98, + fontupper=\itshape, step={tcbthm}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@theorem@overlay@unbroken{\theorem@name\ \thetcbthm}{\theorem@thmcolor}, + overlay first=\my@theorem@overlay@first{\theorem@name\ \thetcbthm}{\theorem@thmcolor}, + overlay last=\my@theorem@overlay@last, + } + }, + proposition={ % same as above. + counter=tcbprop, + the counter=\thesection.\arabic{tcbprop}, + autoref name=\bfseries Proposition, + style={ + arc=3pt,breakable,enhanced,interior style={top color=purple!12 ,middle color=purple!9, bottom color=purple!6},boxrule=0pt,top=8mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray}, + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray}, + opacityframe=0, opacityback=0.98, + fontupper=\itshape, step={tcbprop}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@theorem@overlay@unbroken{Proposition\ \thetcbprop}{purple}, + overlay first=\my@theorem@overlay@first{Proposition\ \thetcbprop}{purple}, + overlay last=\my@theorem@overlay@last{purple}, + } + }, + definition={ + counter=tcbdefi, + the counter=\thesection.\arabic{tcbdefi}, + autoref name=\bfseries Definition, + style={ + arc=3pt,breakable,enhanced,interior style={top color=blue!12 ,middle color=blue!9, bottom color=blue!6},boxrule=0pt,top=8mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray}, + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray}, + opacityframe=0, opacityback=0.98, + fontupper=\itshape, step={tcbdefi}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@theorem@overlay@unbroken{Definition\ \thetcbdefi}{blue}, + overlay first=\my@theorem@overlay@first{Definition\ \thetcbdefi}{blue}, + overlay last=\my@theorem@overlay@last{blue}, + } + }, + % Another box style. + lemma={ % Silk ribbon style. + counter=tcblem, + the counter=\thesection.\arabic{tcblem}, + name=Lemma, + lemcolor=DarkCyan, + autoref name=\bfseries Lemma, + style={ + arc=0mm,breakable,enhanced,interior style={top color=DarkCyan!12 ,middle color=DarkCyan!9, bottom color=DarkCyan!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray}, + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray}, + opacityframe=0, opacityback=0.98, + fontupper=\normalsize,step={tcblem}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@lemma@overlay@unbroken{\lemma@name\ \thetcblem}{\lemma@lemcolor}, + overlay first=\my@lemma@overlay@first{\lemma@name\ \thetcblem}{\lemma@lemcolor}, + overlay last=\my@lemma@overlay@last{\lemma@lemcolor}, + } + }, + corollary={ % same as above. + counter=tcbcor, + the counter=\thesection.\arabic{tcbcor}, + autoref name=\bfseries Corollary, + style={ + arc=0mm,breakable,enhanced,interior style={top color=orange!12 ,middle color=orange!9, bottom color=orange!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray}, + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray}, + opacityframe=0, opacityback=0.98, + fontupper=\normalsize,step={tcbcor}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@lemma@overlay@unbroken{Corollary\ \thetcbcor}{orange}, + overlay first=\my@lemma@overlay@first{Corollary\ \thetcbcor}{orange}, + overlay last=\my@lemma@overlay@last{orange}, + } + }, + example={ + counter=tcbexam, + the counter=\thesection.\arabic{tcbexam}, + autoref name=\bfseries Example, + style={ + arc=0mm,breakable,enhanced,interior style={top color=cyan!12 ,middle color=cyan!9, bottom color=cyan!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray}, + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray}, + opacityframe=0, opacityback=0.98, + fontupper=\normalsize,step={tcbexam}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@lemma@overlay@unbroken{Example\ \thetcbexam}{cyan}, + overlay first=\my@lemma@overlay@first{Example\ \thetcbexam}{cyan}, + overlay last=\my@lemma@overlay@last{cyan}, + } + }, + Exercise={ + counter=tcbexer, + the counter=\thechapter.\arabic{tcbexer}, + autoref name=\bfseries Exercise, + style={ + arc=0mm,breakable,enhanced,interior style={top color=red!12 ,middle color=red!9, bottom color=red!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray}, + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray}, + opacityframe=0, opacityback=0.9, + fontupper=\normalsize,step={tcbexer}, + before pre=\smallskip, after app=\smallskip, + overlay unbroken=\my@lemma@overlay@unbroken{Exercise\ \thetcbexer}{red}, + overlay first=\my@lemma@overlay@first{Exercise\ \thetcbexer}{red}, + overlay last=\my@lemma@overlay@last{red}, + } + }, + } + \makeatother + % \begin{document} \thispagestyle{empty} - \entitle{entitle,only when you use cncover} % cn + %\entitle{entitle,only when you use cncover} % Use only in "cn". \title{Title here} - \subtitle{XX} + \subtitle{Subtitle here} \edition{First Edition} - \bookseries{Series} + \bookseries{Series here} \author{your name here} \pressname{press name} - \presslogo{inner_pics/Springer-logo.png} - \coverimage{inner_pics/coverimage.jpg} % cn - %\coverimage{inner_pics/ivy-ge998908f8_1280.jpg} + \presslogo{inner_pics/logo.png} + %\coverimage{inner_pics/coverimage.jpg} % Use only in "cn". + \coverimage{inner_pics/ivy-ge998908f8_1280.jpg} \makecover % % Theme color @@ -302,26 +446,46 @@ The following are examples of minimal work: \colorlet{framegolden}{fg} \colorlet{framegray}{red!15} % - \input{frontmatter/titlepage-cn} % Titlepage + %\input{frontmatter/titlepage-cn} % Titlepage % If you are download from CTAN, it is no use. % \frontmatter \pagenumbering{Roman} - \input{frontmatter/preface-cn} % preface + %\input{frontmatter/preface-cn} % preface % If you are download from CTAN, it is no use. + % preface + \thispagestyle{empty} + \addcontentsline{toc}{chapter}{Preface} + \chapter*{Preface} + As my first english book, i'm happy. + + \hfill + \begin{tabular}{lr} + &----- Ethan Lu\\ + &2023-01-11 + \end{tabular} + + \begin{center} + \vfill + \thepage + \end{center} + \let\cleardoublepage\clearpage + % \thispagestyle{empty} \tableofcontents\let\cleardoublepage\clearpage \mainmatter \pagenumbering{arabic} - \partimage{inner_pics/part.png} % Part Pictures is needed,which is only need to write once. - \partabstract{\hspace{2em} XX} % Part introduction. If you don't want to write, it can be left blank. - \part{XX} - % \input{XX} - \backmatter - \appendix + \partimage{inner_pics/part.png} % Part Pictures is needed, which is only need to write once. + \partabstract{\hspace{2em} Part introduction.} % If you don't want to write, it can be left blank. + \part{Part title} + % \input{<filename>} + + + + \appendix % Appendix here % - \normalem + \normalem % It is needed in XeLaTeX! \printbibliography[ heading=bibintoc, title={Reference} @@ -329,19 +493,22 @@ The following are examples of minimal work: \printindex \thispagestyle{empty} \bottomimage{inner_pics/ivy-ge998908f8_1280.jpg} - \ISBNcode{\EANisbn[ISBN=ISBN Number here]} % + \ISBNcode{\EANisbn[ISBN=ISBN Number here]} % It can be left blank or just delete it! \summary{Bottom Information} \makebottomcover \end{document} \end{lstlisting} + \subsection{Release installation and updates} + The test environment for this template is \begin{enumerate} \item Win11 22H2 + \TeX{} Live 2023; \end{enumerate} + For the installation of \TeX Live/Mac\TeX{} , please refer to articles online, which is omitted here. -After installing \TeX{} Live, it is recommended to upgrade all macro packages after installation, upgrade method: use cmd or terminal to run \lstinline{tlmgr update --all}, if tlmgr needs to be updated, use cmd to run \lstinline{tlmgr update --self}, if there is a break in the update process, please use \lstinline{tlmgr update -- self --all --reinstall-forcibly-removed} update, that is +After installing \TeX{} Live, it is recommended to upgrade all macro packages after installation, upgrade methods: use ``cmd" or ``terminal" to run \lstinline{tlmgr update --all}, if tlmgr needs to be updated, use cmd to run \lstinline{tlmgr update --self}, if there is a break in the update process, please use \lstinline{tlmgr update -- self --all --reinstall-forcibly-removed} update, that is \begin{lstlisting} tlmgr update --self @@ -353,53 +520,57 @@ Please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-upd \chapter{The setting of Beautybook Template} -The English version of this template is based on the basic book class, and the Chinese version is based on the ctexbook class, so the option of book or ctexBook is also valid for this template. The default encoding is \texttt{UTF-8}, and it is recommended to compile with \TeX{} Live. +The English version of this template is based on the basic ``book" class, and the Chinese version is based on the ``ctexbook" class, so the option of book or ctexbook is also valid for this template. The default encoding is \texttt{UTF-8}, and it is recommended to compile with \TeX{} Live. \section{Language Mode} -This template contains two basic locales, \lstinline{Beautybook-V6.1.cls} in Chinese and \lstinline{Beautybook-V6.1-EN.cls} in English. Changing the locales will change the leading words (include figures, tables) of the chart title, the structure of the article (e.g. table of contents, references, etc.), and the leading words in the context of the theorem (e.g. Theorem, lemma, etc.). The different language modes are enabled as follows: +This template includes two basic locales: \lstinline{Beautybook-CN.cls} in Chinese and \lstinline{Beautybook-EN.cls} in English. Changing the locales alters the headings (including figures and tables) of the chart title, the article formatting (such as table of contents and references), and the language used for theorem contexts (such as Theorem, Lemma, etc.). You can switch between these language modes using the following instructions in the top of the premble: + \begin{lstlisting} -\documentclass{Beautybook-V6.1-CN} % chinese -\documentclass{Beautybook-V6.1-EN} % english +\documentclass{Beautybook-CN} % chinese +\documentclass{Beautybook-EN} % english \end{lstlisting} -In addition to the two sets of language settings that come with the template, if you need to use other languages, you can solve these problems by changing the \texttt{.cls} file +In addition to the two language settings that come with the template, if you need to use another language, you can do so by modifying the \texttt{.cls} file as follows \begin{enumerate} \item Change the name of the part environment \lstinline{Part\ \thepart} to \lstinline{(translation of part in your language)\ \thepart} - \item Main file, which is the theorem guide word in the introduction area of the current file - \item Change the name of the part in the chapter environment as shown in the first article - \item Keep in mind that only Asian locales can use the ctexbook class, i.e. based on \lstinline{Beautybook-V6.1-CN.cls} changes, other Spanish environments need to be changed based on \lstinline{Beautybook-V6.1-EN.cls}. + \item Theorem environment guide words in premble, such as Theorem. + \item Please remember that only Asian languages can be modified based on \lstinline{Beautybook-CN.cls}, other foreign languages need to be modified based on \lstinline{Beautybook-EN.cls}. \end{enumerate} -\section{Color Theme} -The color of this template is freely configurable, and the color parameters that can be configured are as follows: +\section{Theme Color} + +The colors of this template can be configured according to personal preferences in the following way : \begin{lstlisting} - \definecolor{bg}{HTML}{e0e0e0} % Overall style background color % i.e. light color - \definecolor{fg}{HTML}{455a64} % Overall style foreground color % i.e. dark + \definecolor{bg}{HTML}{e0e0e0} % Overall style background color % i.e. theme light color + \definecolor{fg}{HTML}{455a64} % Overall style foreground color % i.e. theme dark color %% The colors below are in the stys/bottompage.sty file - \definecolor{coverbgcolor}{HTML}{f9b868} % Cover and back cover background color - \definecolor{coverfgcolor}{HTML}{503D4B} % foreground color on the front and back covers - \definecolor{coverbar}{HTML}{BF8E6F} % cover bar color - \definecolor{bottomcolor}{HTML}{B3686A} % The back cover indicates the background color + \definecolor{coverbgcolor}{HTML}{f9b868} % Cover and bottom page background color + \definecolor{coverfgcolor}{HTML}{503D4B} % foreground color on the front and back covers + \definecolor{coverbar}{HTML}{BF8E6F} % cover bar color + \definecolor{bottomcolor}{HTML}{B3686A} % The theme color of bottom page %%%%%%%%%%%%%%%%%%%%%%%% - \colorlet{framegolden}{fg} % Antique box line color - \colorlet{framegray}{Dilu!5} % Antique box background color + \colorlet{framegolden}{fg} % Antique box's line color + \colorlet{framegray}{Dilu!5} % Antique box's background color \end{lstlisting} -There are also theorem environment colors that can be set in the introduction area of this file, which will be expanded on in the following section on the mathematical environment. + +In the preamble of the main file, certain theorem environments' colors can be set. This will be further explained in the upcoming section on mathematical environments. Here it is recommended to use the color configuration of the cncolours macro package developed by Lin Lianzhi, and you can select the appropriate color for comparison. -\section{Cover} -\subsection{Cover personalization} +\section{Choice of Cover} +\subsection{How to choose your favorite cover?} + This template has multiple sets of covers that can be used at will, and the use of them is as follows: + \begin{enumerate} - \item Springer classic cover --corresponding macro package \lstinline{cover-choose=cn} (Chinese default), - \item Springer Classic Cover 2 - corresponding to the macro package \lstinline{cover-choose=en} (English default), - \item Springer Classic Cover No. 3 - corresponding to macro package \lstinline{cover-choose=enfig} (image background), - \item Chinese classic cover of the book - corresponding to the macro package \lstinline{cover-choose=birkar} (triangular geometric wind). + \item Chinese classic cover (Chinese default) --corresponding macro package \lstinline{cover-choose=cn} , + \item Springer Classic Cover No. 1 (English default) --corresponding to the macro package \lstinline{cover-choose=en} , + \item Springer Classic Cover No. 2 (image background) --corresponding to macro package \lstinline{cover-choose=enfig} , + \item Springer Classic cover No. 3 (Geometric style) --corresponding to the macro package \lstinline{cover-choose=birkar} . Note that the information corresponding to the cover is not the same, look at the above example, just follow the requirements. \end{enumerate} @@ -418,39 +589,43 @@ This template has multiple sets of covers that can be used at will, and the use \end{tabular} \end{table} -\subsection{cover image} -The cover image can be found by yourself. +\subsection{Logo} -\subsection{logo} +You can search and obtain the publisher's logo yourself. To avoid copyright infringement, please ensure to choose a proper and lawful image when replacing the current one. -The logo used in this article is the springer classic horse logo that the wiki finds at random, you can query and download the publisher logo by yourself, in order to avoid infringement, please choose a suitable and legal picture to replace when replacing the picture. +\subsection{Custom Cover} -\subsection{custom cover} +Moreover, in case you opt for a personalized cover, say an A4 PDF file created through Adobe Illustrator or any other software, comment out the \lstinline{\makecover} command, and subsequently include the custom cover using the \lstinline{pdfpages} macro package. Likewise, if you utilize the \lstinline{titlepage} environment. -In addition, if you use a custom cover, such as an A4 PDF document made by Adobe illustror or other software, comment out \lstinline{makecover}, and then insert the custom cover with the help of the \lstinline{pdfpages} macro package. It is similar if you use the \lstinline{titlepage} environment. +\section{Title Style} -\section{chapter title} +This template is fully customized for section headings, if this is not to your liking, you can comment them out to restore the default style. -This template customizes a set of heading styles, mainly Part, Chapter, Section three headings, see CLS for specific code. It may not suit everyone's aesthetic, and commenting it out will return to the default ctexbook heading style. +\section{Introduction to the Mathematical Environments} -\section{Introduction to the Mathematical Environment} +Our template includes four distinct theorem environments. These consist of the default theorem style provided by ``amsthm" in simple mode, as well as a custom style provided by ``thmtools." Additionally, we offer a color emphasis box style, an exquisite box style that I developed, and an ancient style box provided by Mr. Wuyue, which can also be used as a theorem box. + +\subsection{Usage of theorem environments} + +Here is the effect of the theorem environment provided by amsthm. +\subsubsection{amsthm} -In our template, we have defined four different theorem modes, including simple mode (default theorem style amsthm), a little custom thmtools, a color emphasis box, and an exclusive copyright box developed by me, of course, the ancient style box customized by Mr. Kirigetsu You can also use it as a theorem box, just add lstinline{ys style} to the first theorem style in the introduction area of this document. -\subsection{Use of theorem class environment} -The following is a demonstration of the use effect -subsubsection{amsthm} \begin{remark} This is an amsthm-based annotation environment \end{remark} + \subsubsection{thmtools} + \begin{proof}[description of proof] Proof environment \end{proof} -\begin{solution}[test sol.] +\begin{solution}[description of solution] Solution environment \end{solution} -\subsubsection{color accent box} + +\subsubsection{Color emphasis box style} + \begin{defi}[name of the definition]\label{defi:def test} The first defines the environment \end{defi} @@ -474,31 +649,36 @@ subsubsection{amsthm} \begin{lem}[name of the lem]\label{lem:lem test} The first lemma environment \end{lem} -\clearpage -\subsubsection{There are two types of boxes for personal copyright} + +% \clearpage + +\section{Two exquisite theorem boxes crafted by the author!} \begin{definition}[][Name][def label] - This is a custom box custom theorem environment, which is an example of where the environment is defined. Note: Use as follows + Here are the guidelines for using these two boxes. \begin{itemize} - \item If you don't have a name and label, use it as \begin{lstlisting} + \item If the theorem name and label are both empty, you can write it like this : + \begin{lstlisting} \begin{definition} Define the environment content \end{definition} \end{lstlisting} - \item If you don't have a label but have a name, use it as \begin{lstlisting} + \item If you don't have a label but have a name, use it as + \begin{lstlisting} \begin{definition}[][Name] Define the environment content \end{definition} \end{lstlisting} - \item If you have a tag, then whether or not it has a name, use it as \begin{lstlisting} + \item If you have a tag, then whether or not it has a name, use it as + \begin{lstlisting} \begin{definition}[][Yes, fill in, no blank][Tag] Define the environment content \end{definition} \end{lstlisting} - \item If you want to change some setting options of the box, such as bordering, etc., use it + \item If you want to change some setting options of the box, such as bordering, etc., use it as \begin{lstlisting} - \begin{definition}[tcolorbox option][write the name if it has, delete it with the outer parentheses if it does not][tag (there is a tag under the tag, there is no tag can delete the label with the outer parentheses)] + \begin{definition}[tcolorbox options][If so, write the name, if not, delete it along with the outside brackets.][tag (Here is where the label is written, if there is no label should be deleted together with the outside brackets.)] Define the environment content \end{definition} \end{lstlisting} @@ -522,70 +702,75 @@ subsubsection{amsthm} The usage is the same as above, refer to the tag \ref{def label} below or you can \autoref{def label}. \end{example} -Antique box +\paragraph*{Ancient style box} \begin{fancybox} -Antique box test, you can nest other environments arbitrarily! + Test ancient style box , you can use it to nest outside of other environments arbitrarily! \end{fancybox} -\subsection{modify counter} +\subsection{Theorem counter adjustment} + +If you want to modify the theorem environment to count by section, you can modify the \lstinline{chapter} in the counter option \lstinline{ counter/.code}, the available options are \lstinline{chapter} (default) and \lstinline{section}, \lstinline{subsection}, etc. -If you want to modify the theorem environment to count by section, you can modify the \lstinline{chapter} in the counter option \lstinline{ counter/.code}, the available options are \lstinline{chapter} (default) and \lstinline{section}, \lstinline{subsection}, etc -\subsection{custom theorem class environment} -Users can define their own theorem environment in four ways, namely amsthm and thmtools, which can be seen in the macro package documentation; The latter two theorems are defined in the following way. +\subsection{How to define a new theorem environment?} -For example, in the introduction to this document: +There are four ways in which users can define their own theorem environments. Among them amsthm and thmtools can be learned through their macro package documentations. The latter two theorems are defined in the following way. + +For example, in premble of the main file, you can write it as \begin{lstlisting} % This is the first one. \mynewtheorem{ - defi={\textbf{Definition}}[section]{interior style={left color=ReD!8,right color=ReD!5!CyaN!50}, borderline west={1.5mm}{0mm}{ReD}}, + defi={\textbf{Definition}}[section]{interior style={left color=ReD!8,right color=ReD!5!CyaN!50}, borderline west={1.5mm}{0mm}{ReD}}, % It is a example of the first one, then you can mimic it to build the theorem setting you need. } % This is the second one. - \mynewtcbtheorem{ - theorem={ % Christmas gift box style - counter=tcbthm, - the counter=\thesection.\arabic{tcbthm}, - name=Theorem, % It is saved to \theorem@name. - thmcolor=purple5, - autoref name=\bfseries Theorem, + <environment name>={ + counter=tcb<theorem counter>, + the counter=\thesection.\arabic{tcb<theorem counter>}, + autoref name=\bfseries <environment name>, style={ - arc=3pt,breakable,enhanced,interior style={top color=purple5!5 ,middle color=purple5!1!nuanbai, bottom color=nuanbai},boxrule=0pt,top=8mm, - fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},% shadow up - fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},% shadow down + arc=3pt,breakable,enhanced,interior style={top color=<your color>!12 ,middle color=<your color>!9, bottom color=<your color>!6},boxrule=0pt,top=8mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray}, + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray}, opacityframe=0, opacityback=0.98, - fontupper=\itshape, step={tcbthm}, + fontupper=\itshape, step={tcb<theorem counter>}, before pre=\smallskip, after app=\smallskip, - overlay unbroken=\my@theorem@overlay@unbroken{\theorem@name\ \thetcbthm}{\theorem@thmcolor}, - overlay first=\my@theorem@overlay@first{\theorem@name\ \thetcbthm}{\theorem@thmcolor}, - overlay last=\my@theorem@overlay@last{\theorem@thmcolor}, + overlay unbroken=\my@theorem@overlay@unbroken{<environment name>\ \thetcb<theorem counter>}{<your color>}, + overlay first=\my@theorem@overlay@first{<environment name>\ \thetcb<theorem counter>}{<your color>}, + overlay last=\my@theorem@overlay@last{<your color>}, } }, - lemma={ % Ribbon style - counter=tcblem, - the counter=\thesection.\arabic{tcblem}, - name=Lemma, - lemcolor=(color), - autoref name=\bfseries Lemma, + <environment name>={ + counter=tcb<theorem counter>, + the counter=\thesection.\arabic{tcb<theorem counter>}, + autoref name=\bfseries <environment name>, style={ - arc=0mm,breakable,enhanced,interior style={top color=(color)!5 ,middle color=(color)!1!nuanbai, bottom color=nuanbai},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm, - fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray},% shadow up - fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray},%shadow down + arc=0mm,breakable,enhanced,interior style={top color=<your color>!12 ,middle color=<your color>!9, bottom color=<your color>!6},arc=3pt,boxrule=0pt,top=7mm,bottom=5mm, + fuzzy shadow={-0.6mm}{0.6mm}{0mm}{0.3mm}{white!50!gray}, + fuzzy shadow={0.6mm}{-0.6mm}{0mm}{0.3mm}{fill=white!40!gray}, opacityframe=0, opacityback=0.98, - fontupper=\normalsize,step={tcblem}, + fontupper=\normalsize,step={tcb<theorem counter>}, before pre=\smallskip, after app=\smallskip, - overlay unbroken=\my@lemma@overlay@unbroken{\lemma@name\ \thetcblem}{\lemma@lemcolor}, - overlay first=\my@lemma@overlay@first{\lemma@name\ \thetcblem}{\lemma@lemcolor}, - overlay last=\my@lemma@overlay@last{\lemma@lemcolor}, + overlay unbroken=\my@lemma@overlay@unbroken{<environment name>\ \thetcb<theorem counter>}{<your color>}, + overlay first=\my@lemma@overlay@first{<environment name>\ \thetcb<theorem counter>}{<your color>}, + overlay last=\my@lemma@overlay@last{<your color>}, } }, } \end{lstlisting} + \begin{remark} - To explain, the overlay part needs to be changed Chinese seen, the theorem name is changed to what you want, and the color is also, and then don't forget to change the outermost environment name such as example to yours, such as axiom and the like, and the counter name of tcbexam should be replaced with your new definition, such as tcbaxiom and the like, and the rest does not need to be moved. As for the first theorem style, look at the above example, I believe you can learn. + Change the folllowing parts : + \begin{center} + \begin{tabular}{ccc}\hline + <environment name> & $\to$ & your new defined theorem name \\ + <theorem counter > & $\to$ & your new defined theorem counter \\ + <your color> & $\to$ & your new defined theorem color \\ \hline + \end{tabular} + \end{center} \end{remark} \section{list environment} -This template is customizable with the help of lstinline{enumitem}, see the enumitem macro package documentation, here the example is as follows\\[2ex] +This template is customizable with the help of \lstinline{enumitem}, see the enumitem macro package documentation. Here are two examples.\\[2ex] \begin{minipage}[b]{0.49\textwidth} \begin{itemize}[label=$\bigodot $] \item first item of nesti; @@ -614,21 +799,23 @@ This template is customizable with the help of lstinline{enumitem}, see the enum \end{enumerate} \end{enumerate} \end{minipage} + \section{References} -\subsection{print document} +\subsection{print reference} -\lstinline{ref.bib} is a file stored in the reference and needs to be placed in the project folder. +\lstinline{ref.bib} is a file stored in the reference and needs to be placed in the working folder. -\subsection{modify document format} +\subsection{modify reference format} -In addition, this template calls the Biblatex macro package and provides Biber engine compilation references, of course, you can also directly delete the Biblatex macro package in cls file (the last few lines of cls) to use Bibtex. +In addition, this template calls the Biblatex macro package and provides Biber engine to compile references. Of course, you can also directly delete the Biblatex macro package in cls file (the last few lines of cls) to use Bibtex. -For bib items, you can pick them up in Google Scholar, Mendeley, Endnote and add them to lstinline{ref.bib}. When quoting in the text, just quote their bib key. +For bib items, you can pick them up in Google Scholar, Mendeley, Endnote and add them to \lstinline{ref.bib}. When quoting in the text, just quote their bib key. -The document style defaults to GB GB7714-2015, reference example: \cite{Huybrechts2010Complex}. +The default reference style used by the template is ``GB7714-2015". There is a simple reference example. \cite{Huybrechts2010Complex} + +If you need to set to a numeric style, you need to change the ``GB7714-2015" in the biblatex macro package option to ``numerical". -If you need to set to a numeric style, you need to change the GB in the biblatex macro package option to numerical. \begin{lstlisting} \usepackage[ backend=biber, % can be changed to bibtex (or simply delete bibtex) @@ -638,10 +825,12 @@ sorting=nty \addbibresource{ref.bib} \end{lstlisting} -\chapter{font options} +\chapter{Font options (Chinese users only, English users please do not omit the contents of this chapter.)} + The reason why the font options are independent is that we hope that users of this template care about the fonts used by the template, know the fonts they use and encounter font-related problems more easily to find answers. -This template uses the fonts provided by Ctex's Windows options by default, if not necessary, the font should not be changed, of course, if you really need to, you can follow the following code: +This template uses ctexbook class, so the fontset is consistent with it. The default option is \lstinline{fontset=windows}. If not necessary, the font should not be changed. If you do have a need for third-party fonts, then you can set them up as follows. + \begin{lstlisting} \setCJKmainfont[Path=fonts/,BoldFont={XX.TTF},ItalicFont={YY.TTF},SlantedFont = {ZZ.TTF} , SlantedFeatures = {FakeSlant}]{WW.TTF} \setCJKsansfont[Path=fonts/,BoldFont={XX.TTF},ItalicFont={XX.TTF}]{XX.TTF} @@ -654,10 +843,7 @@ This template uses the fonts provided by Ctex's Windows options by default, if n -\appendix -\chapter{cover effect display} -\section{cover en as shown in this document} -\section{See attachment in folder for other covers} +%\appendix diff --git a/macros/latex/contrib/beautybook/README.md b/macros/latex/contrib/beautybook/README.md index 7d494cc581..d610d61877 100644 --- a/macros/latex/contrib/beautybook/README.md +++ b/macros/latex/contrib/beautybook/README.md @@ -14,6 +14,10 @@ Beautybook is designed for writing books, created by [Ethan Lu](https://github.c If you are an English user, then please use a cls file with the "-EN" suffix and compile the english tex file with pdfLaTeX, and conversely, if you are a Chinese user, then remember, use a cls file with the "-CN" suffix and compile the chinese tex file with the XeLaTeX engine! +## Version + +Release 2023-06-17. + ## License This work is released under the LaTeX Project Public License, v1.3c or later. diff --git a/macros/latex/contrib/covington/README b/macros/latex/contrib/covington/README index 4587e8f7b4..0911cf90a9 100644 --- a/macros/latex/contrib/covington/README +++ b/macros/latex/contrib/covington/README @@ -31,6 +31,12 @@ The package consists of the following files: == CHANGES == +* Version 2.11 (2023-06-17) + - Add support for judgment markers in examples and glosses. + - Add support for customization of spacing between gloss lines. + - Add support for gloss comment lines via optional arguments. + - Add support for translation lines on the right side of glosses (via new tlr* option). + * Version 2.10 (2023-06-02) - Use LaTeX's own keyval mechanism rather than xkeyval. - Introduce a better interface to customize the appearance of examples. Now everything can diff --git a/macros/latex/contrib/covington/covington.pdf b/macros/latex/contrib/covington/covington.pdf Binary files differindex d76ea95e7d..2fddb771fb 100644 --- a/macros/latex/contrib/covington/covington.pdf +++ b/macros/latex/contrib/covington/covington.pdf diff --git a/macros/latex/contrib/covington/covington.sty b/macros/latex/contrib/covington/covington.sty index 06792446c4..b676c7e836 100644 --- a/macros/latex/contrib/covington/covington.sty +++ b/macros/latex/contrib/covington/covington.sty @@ -42,8 +42,8 @@ %%% Metadata %%% -\def\filedate{2023/06/02} -\def\fileversion{2.10} +\def\filedate{2023/06/17} +\def\fileversion{2.11} \def\filename{covington.sty} % Macro to issue warnings @@ -186,11 +186,14 @@ % This is a sentence. \hfill (\exampleno) % \end{flushleft} +% Counter to generate unique example ID +\newcounter{explid} + \ifownexcounter \newcounter{covex} - \newcommand{\@exampleno}{\refstepcounter{covex}\thecovex} + \newcommand{\@exampleno}{\stepcounter{explid}\refstepcounter{covex}\thecovex} \else - \newcommand{\@exampleno}{\refstepcounter{equation}\theequation} + \newcommand{\@exampleno}{\stepcounter{explid}\refstepcounter{equation}\theequation} \fi \newcommand*\@@exampleno{\ifownexcounter\thecovex\else\theequation\fi} \newcommand*\exampleno{\@ifstar{\@@exampleno}{\@exampleno}} @@ -308,14 +311,37 @@ \newif\if@cov@expst@star\@cov@expst@starfalse +% Commands to register and check preamble in (sub-)examples +% Adapted from etoolbox +\DeclareRobustCommand*{\RegisterExPreamble}[1]{% + \expandafter\gdef\csname cov@havepreamble:#1\endcsname{}% +} + +\newcommand*{\IfExPreamble}[1]{% + \ifcsname cov@havepreamble:#1\endcsname + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi% +} + % 2022-08-20 (v. 2.8): optional preceding example text \newcommand*\expreamblefs{\normalfont} -\newcommand\expreamble[1]{\bgroup\expreamblefs#1\egroup\par} +\newcommand\expreamble[1]{% + \bgroup\expreamblefs#1\egroup\par\cov@judge@marker% + \if@filesw% + \protected@write\@auxout{}{\protect\RegisterExPreamble{\theexplid}}% + \fi% + \ignorespaces% +} % 2023.05.26 (v. 2.9): optional trailung subexample text \newcommand*\expostamblefs{\normalfont} \newcommand*\expostamble[1]{\bgroup\expostamblefs#1\egroup} +% 2023.06.04 (v. 2.11): judge marks +\newcommand*\cov@judge@fs{\normalfont\upshape} + \DeclareKeys[covexpl] { % font settings @@ -339,16 +365,36 @@ % numberformat={template} numberformat.code = { \cov@parse@number@template{#1}{exfmt}{covexnumber} }, % fnnumberformat={template} - fnumberformat.code = { \cov@parse@number@template{#1}{fnexfmt}{covexnumberfn} } + fnumberformat.code = { \cov@parse@number@template{#1}{fnexfmt}{covexnumberfn} }, + % judge=text + judge.code = { \def\cov@judge@ex@text{#1} \settowidth\cov@judge@width{\cov@judge@fs#1} }, + % judgement shorthands: *, ?, *?, ??, # + *.code = { \def\cov@judge@ex@text{*} \settowidth\cov@judge@width{\cov@judge@fs*} }, + ?.code = { \def\cov@judge@ex@text{?} \settowidth\cov@judge@width{\cov@judge@fs?} }, + *?.code = { \def\cov@judge@ex@text{*?} \settowidth\cov@judge@width{\cov@judge@fs*?} }, + ??.code = { \def\cov@judge@ex@text{??} \settowidth\cov@judge@width{\cov@judge@fs??} }, + #.code = { \def\cov@judge@ex@text{\#} \settowidth\cov@judge@width{\cov@judge@fs\#} }, + % judgement font settings + fsjudge.store = \cov@judge@fs, + % judgewith=<text> + judgewidth.code = { \settowidth\cov@judge@width{\cov@judge@fs#1} }, + % addjudgesep=length + addjudgesep.code = { \addtolength\cov@judge@sep{#1} } } +\newif\if@cov@insingleex\@cov@insingleexfalse + \newenvironment{covexample}[1][]{% - \ifx#1\empty\else\SetKeys[covexpl]{#1}\fi% + \@cov@insingleextrue% + \let\cov@judge@ex@text\cov@judge@ex@text@global% + \SetKeys[covexpl]{#1}% \begin{covexamples} - \item\@ifundefined{cov@xp}{}{\expreamble{\cov@xp}}% insert preamble if given + \@ifundefined{cov@judge@ex@text}{\item}{\item<\cov@judge@ex@text>}% + \ifx\cov@xp\empty\cov@judge@marker\else\expreamble{\cov@xp}\fi% insert preamble if given }{% \@ifundefined{cov@xpst}{}{\if@cov@expst@star\unskip\fi\expostamble{\cov@xpst}}% \end{covexamples}% + \@cov@insingleexfalse% } \@ifundefined{example}{% @@ -402,21 +448,71 @@ \let\exfmt\arabic +% Allow for \item<judgment>[label] +\def\cov@judge@item<#1>{% + \global\def\cov@judge{#1}% + \@ifnextchar[% + {\@item}% + {\cov@item}% +}% + +\newlength\cov@judge@width +\settowidth\cov@judge@width{?} +\newlength\cov@subjudge@width +\settowidth\cov@subjudge@width{?} +\newlength\cov@judge@sep +\setlength\cov@judge@sep{.1em} +\newlength\cov@judge@extra +\setlength\cov@judge@extra{0pt} + +\newif\if@cov@insubex\@cov@insubexfalse + +\def\cov@judge@marker{} + \newenvironment{covexamples}[1][]{% % define "examples" environment - \ifx#1\empty\else\SetKeys[covexpl]{#1}\fi% + \if@cov@insubex% + \let\cov@judge@ex@text\relax% + \else% + \if@cov@insingleex\else% + \let\cov@judge@ex@text\cov@judge@ex@text@global% + \fi% + \fi% + \ifx{#1}{\empty}\else\SetKeys[covexpl]{#1}\fi% + \addtolength\cov@judge@extra{\cov@judge@width}% + \addtolength\cov@judge@extra{\cov@judge@sep}% + % parse <...> item argument + \let\cov@item\item% + \let\cov@@item\@item% + \def\@item[##1]{% + \cov@@item[##1] \@ifundefined{cov@judge}{}{% + \def\cov@judge@marker{\hspace*{-\cov@judge@extra}% + \makebox[\cov@judge@width][r]{\cov@judge@fs\cov@judge}% + \hspace{\cov@judge@sep}\ignorespaces}% + \IfExPreamble{\theexplid}{}{\cov@judge@marker\ignorespaces}% + }% + } + \def\item{% + \@inmatherr\item + \@ifnextchar<{\cov@judge@item}% + {\@ifundefined{cov@judge@ex@text}% + {\global\let\cov@judge\relax}% + {\global\let\cov@judge\cov@judge@ex@text}% + \cov@item}% + }% \begin{list}% {% \covexamplenofs% font - \ifcov@infootnote + \ifcov@infootnote% \covexnumberfn{\thecovfnex}% - \else + \else% \covexnumber{\@@exampleno}% - \fi + \fi% }% {% \addtolength{\labelwidth}{\examplenumbersep}% \addtolength{\leftmargin}{\examplenumbersep}% \addtolength{\leftmargin}{\exampleind}% + \stepcounter{explid}% \ifcov@infootnote \setcounter{covexsave}{\arabic{covfnex}}% \usecounter{covfnex}% @@ -473,12 +569,20 @@ % 2019-06-21 (v. 2.3): optional preceding subexample text \newcommand*\subexpreamblefs{\normalfont} -\newcommand\subexpreamble[1]{\bgroup\subexpreamblefs#1\egroup\par} +\newcommand\subexpreamble[1]{% + \bgroup\subexpreamblefs#1\egroup\par\cov@judge@marker% + \if@filesw% + \protected@write\@auxout{}{\protect\RegisterExPreamble{\theexplid}}% + \fi% + \ignorespaces% +} % 2023.05.26 (v. 2.9): optional trailung subexample text \newcommand*\subexpostamblefs{\normalfont} \newcommand*\subexpostamble[1]{\bgroup\subexpostamblefs#1\egroup} +\newcommand*\cov@closscomments@fs{\normalfont\upshape} + \DeclareKeys[covsubexpl] { % font settings @@ -508,7 +612,23 @@ % fnnumberformat={template} fnumberformat.code = { \cov@parse@number@template{#1}{fnexfmt}{covexnumberfn} }, % subnumberformat={template} - subnumberformat.code = { \cov@parse@number@template{#1}{subexfmt}{covsubexnumber} } + subnumberformat.code = { \cov@parse@number@template{#1}{subexfmt}{covsubexnumber} }, + % judge=text + judge.code = { \def\cov@subjudge@ex@text{#1} \settowidth\cov@subjudge@width{\cov@judge@fs#1} }, + % subjudge=text + subjudge.code = { \def\cov@subjudge@ex@text{#1} \settowidth\cov@judge@width{#1} }, + % judgement shorthands: *, ?, *?, ??, # + *.code = { \def\cov@subjudge@ex@text{*} \settowidth\cov@subjudge@width{\cov@judge@fs*} }, + ?.code = { \def\cov@subjudge@ex@text{?} \settowidth\cov@subjudge@width{\cov@judge@fs?} }, + *?.code = { \def\cov@subjudge@ex@text{*?} \settowidth\cov@subjudge@width{\cov@judge@fs*?} }, + ??.code = { \def\cov@subjudge@ex@text{??} \settowidth\cov@subjudge@width{\cov@judge@fs??} }, + #.code = { \def\cov@subjudge@ex@text{\#} \settowidth\cov@subjudge@width{\cov@judge@fs\#} }, + % judgement font settings + fsjudge.store = \cov@judge@fs, + % judgewith=<text> + judgewidth.code = { \settowidth\cov@subjudge@width{\cov@judge@fs#1} }, + % addjudgesep=length + addjudgesep.code = { \addtolength\cov@judge@sep{#1} } } \newlength\subexamplenumbersep @@ -518,14 +638,58 @@ \let\subexfmt\alph +% Allow for \item<judgment>[label] +\def\cov@judge@subitem<#1>{% + \global\def\cov@subjudge{#1}% + \@ifnextchar[% + {\@item}% + {\cov@subitem}% +}% + +% Copied from the kernel (enumerate) and adapted +% to accept <...> item arguments +\def\covsubexs{% + \setlength\cov@judge@extra{\cov@subjudge@width}% + \addtolength\cov@judge@extra{\cov@judge@sep}% + \let\cov@subitem\item% + \let\cov@@subitem\@item% + \def\@item[##1]{% + \cov@@subitem[##1] \@ifundefined{cov@subjudge}{}{% + \def\cov@judge@marker{\hspace*{-\cov@judge@extra}% + \makebox[\cov@subjudge@width][r]{\cov@judge@fs\cov@subjudge}% + \hspace{\cov@judge@sep}\ignorespaces}% + \IfExPreamble{\theexplid}{}{\cov@judge@marker\ignorespaces}% + }% + }% + \def\item{% + \@inmatherr\item + \@ifnextchar<{\cov@judge@subitem}% + {\@ifundefined{cov@subjudge@ex@text}% + {\global\let\cov@subjudge\relax}% + {\global\let\cov@subjudge\cov@subjudge@ex@text}% + \cov@subitem}% + }% + \ifnum \@enumdepth >\thr@@\@toodeep\else + \advance\@enumdepth\@ne + \edef\@enumctr{enum\romannumeral\the\@enumdepth}% + \expandafter + \list + \csname label\@enumctr\endcsname + {\stepcounter{explid}\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}% + \fi} +\let\endcovsubexs =\endlist + + \newenvironment{covsubexamples}[1][]% % define "subexamples" environment {% + \@cov@insubextrue% \let\cov@xp\relax% \let\cov@xpst\relax% - \ifx#1\empty\else\SetKeys[covsubexpl]{#1}\fi% + \let\cov@judge@ex@text\relax% + \ifx{#1}{\empty}\else\SetKeys[covsubexpl]{#1}\fi% \begin{covexample}% \@ifundefined{cov@sxp}{}{\bgroup\subexpreamblefs\cov@sxp\egroup}% insert preamble if given - \begin{enumerate} + \begin{covsubexs} \addtolength{\labelsep}{\subexamplenumbersep}% \renewcommand\theenumi{\subexfmt{enumi}} \renewcommand\labelenumi{\covexamplenofs\covsubexnumber{\theenumi}} @@ -535,10 +699,11 @@ }% {% \let\cov@sxp\relax - \end{enumerate} + \end{covsubexs} \@ifundefined{cov@sxpst}{}{\subexpostamble{\cov@sxpst}}% insert postamble if given \let\cov@sxpst\relax \end{covexample} + \@cov@insubexfalse% } \@ifundefined{subexamples}{% @@ -590,7 +755,43 @@ % fnnumberformat={template} fnumberformat.code = { \cov@parse@number@template{#1}{fnexfmt}{covexnumberfn} }, % subnumberformat={template} - subnumberformat.code = { \cov@parse@number@template{#1}{subexfmt}{covsubexnumber} } + subnumberformat.code = { \cov@parse@number@template{#1}{subexfmt}{covsubexnumber} }, + % judge=text + judge.code = { \def\cov@judge@ex@text@global{#1} \settowidth\cov@judge@width{#1} }, + % subjudge=text + subjudge.code = { \def\cov@subjudge@ex@text{#1} \settowidth\cov@judge@width{#1} }, + % judgement shorthands: *, ?, *?, ??, # + *.code = + { \def\cov@judge@ex@text@global{*} + \def\cov@subjudge@ex@text{*} + \settowidth\cov@judge@width{\cov@judge@fs*} + }, + ?.code = + { \def\cov@judge@ex@text@global{?} + \def\cov@subjudge@ex@text{?} + \settowidth\cov@judge@width{\cov@judge@fs?} + }, + *?.code = + { \def\cov@judge@ex@text@global{*?} + \def\cov@subjudge@ex@text{*?} + \settowidth\cov@judge@width{\cov@judge@fs*?} + }, + ??.code = + { \def\cov@judge@ex@text@global{??} + \def\cov@subjudge@ex@text{??} + \settowidth\cov@judge@width{\cov@judge@fs??} + }, + #.code = + { \def\cov@judge@ex@text@global{\#} + \def\cov@subjudge@ex@text{\#} + \settowidth\cov@judge@width{\cov@judge@fs\#} + }, + % judgement font settings + fsjudge.store = \cov@judge@fs, + % judgewith=<text> + judgewidth.code = { \settowidth\cov@judge@width{#1} }, + % addjudgesep=length + addjudgesep.code = { \addtolength\cov@judge@sep{#1} } } % General setting option @@ -679,6 +880,27 @@ \newcommand*\glosslinepostamble[1]{\bgroup\fsglpostamble{}#1\egroup} \def\cov@gl@postamble@text{} +% Optional extra space between gloss lines +\newlength\cov@glossline@sepi +\setlength\cov@glossline@sepi{0pt} +\newlength\cov@glossline@sepii +\setlength\cov@glossline@sepii{0pt} +\newlength\cov@glossline@sepiii +\setlength\cov@glossline@sepiii{0pt} +\newlength\cov@glossline@sepi@local +\setlength\cov@glossline@sepi@local{0pt} +\newlength\cov@glossline@sepii@local +\setlength\cov@glossline@sepii@local{0pt} +\newlength\cov@glossline@sepiii@local +\setlength\cov@glossline@sepiii@local{0pt} + +\newlength\cov@glosswidth@local +\newlength\cov@glosssep@local +\newlength\cov@glosspwidth@local +\setlength\cov@glosswidth@local{0pt} +\setlength\cov@glosssep@local{0pt} +\setlength\cov@glosspwidth@local{0pt} + \def\gll{% % Introduces 2-line text-and-gloss. \begin{flushleft} \vskip\baselineskip% % Added 1992 Nov 8 to force single spacing @@ -728,10 +950,48 @@ \ignorespaces\xthreesent } -\def\glt{{\hskip -\glossglue}\cov@nopagebreak\unhbox\gline\smallskip\cov@nopagebreak\newline} % \newline was \\ +\newsavebox{\pline} % the constructed preamble line (hbox) + +\RequirePackage{varwidth} + +\newlength\glosswidth +\newlength\glosssep +\setlength\glosssep{1em} +\newlength\glosspwidth + +\AtBeginDocument{\setlength\glosswidth{.6\textwidth}}% + +\def\glt{% + \setlength\glosswidth{.6\linewidth}% + \if@cov@glosspline% + % + \begin{varwidth}[t]{\cov@glosswidth@local} + {\hskip -\glossglue}\unhbox\gline% + \end{varwidth}% + \hspace{\cov@glosssep@local}% + \usebox{\pline}% + \else% + {\hskip -\glossglue}\cov@nopagebreak\unhbox\gline% + \fi% + \smallskip\cov@nopagebreak\newline% % \newline was \\ +} % Introduces translation. % Required even if no translation follows. +\def\glnx{% + \setlength\glosswidth{.6\linewidth}% + \if@cov@glosspline% + % + \begin{varwidth}[t]{\cov@glosswidth@local} + {\hskip -\glossglue}\unhbox\gline% + \end{varwidth}% + \hspace{\cov@glosssep@local}% + \usebox{\pline}% + \else% + {\hskip -\glossglue}\cov@nopagebreak\unhbox\gline% + \fi% +} + \def\gln{{\hskip -\glossglue}\unhbox\gline\hfill} % Alternative to glt, when one wants to % put a number but no translation. @@ -881,12 +1141,18 @@ \else% \glosslinepreamble{\cov@gl@preamble@text}\cov@nopagebreak\newline% \fi% + \ifx\cov@judge@gloss@text\empty% + \else + \bgroup\cov@judge@fs\cov@judge@gloss@text\egroup% + \hspace{\cov@judge@sep}\ignorespaces% + \fi \loop\lastword{\eachwordone}{\lineone}{\wordone}% \lastword{\eachwordtwo}{\linetwo}{\wordtwo}% \global\setbox\gline=\hbox{\unhbox\gline% \hskip\glossglue% \vtop{% vtop was vbox \box\wordone + \vspace{\cov@glossline@sepi@local} \nointerlineskip \box\wordtwo }% @@ -899,12 +1165,18 @@ \gdef\xthreesent#1\xgle#2\xgle#3\xgle% #1 = first line, #2 = second line, #3 = third {\xgetwords(\lineone,\eachwordone)#1 \xgle% + \vspace{\cov@glossline@sepi}% \xgetwords(\linetwo,\eachwordtwo)#2 \xgle% \xgetwords(\linethree,\eachwordthree)#3 \xgle% \ifx\cov@gl@preamble@text\empty% \else% \glosslinepreamble{\cov@gl@preamble@text}\cov@nopagebreak\newline% \fi% + \ifx\cov@judge@gloss@text\empty% + \else + \bgroup\cov@judge@fs\cov@judge@gloss@text\egroup% + \hspace{\cov@judge@sep}\ignorespaces% + \fi \loop\lastword{\eachwordone}{\lineone}{\wordone}% \lastword{\eachwordtwo}{\linetwo}{\wordtwo}% \lastword{\eachwordthree}{\linethree}{\wordthree}% @@ -912,8 +1184,10 @@ \hskip\glossglue \vtop{% vtop was vbox \box\wordone + \vspace{\cov@glossline@sepi@local} \nointerlineskip \box\wordtwo + \vspace{\cov@glossline@sepii@local} \nointerlineskip \box\wordthree }% @@ -928,10 +1202,22 @@ \newif\ifcov@enquote@tl\cov@enquote@tltrue \def\cov@fstl{\cov@fstl@global} \newcommand*\glosslinetrans[1]{\bgroup\cov@fstl\ifcov@enquote@tl\covenquote{#1}\else#1\fi\egroup} -\newcommand*\glot[1]{% - \def\tempx{#1}% - \ifx\tempx\empty\gln - \else\glt\glosslinetrans{#1}\fi% +\newcommand*\glot[2][]{% + \def\tempx{#2}% + \ifx\tempx\empty% + \ifcov@tlr@star% + \glnx + \else% + \gln + \fi% + \else% + \glt% + \ifx#1\empty\else% + \hphantom{\cov@judge@fs#1}% + \hspace{\cov@judge@sep}\ignorespaces% + \fi% + \glosslinetrans{#2}% + \fi% } % V. 2.0: More convenient gloss macros @@ -942,32 +1228,62 @@ \newif\ifcov@ex@gloss@global\cov@ex@gloss@globalfalse \newif\ifcov@tlr\cov@tlrfalse \newif\ifcov@tlr@global\cov@tlr@globalfalse +\newif\ifcov@tlr@star\cov@tlr@starfalse +\newif\ifcov@tlr@star@global\cov@tlr@star@globalfalse \newif\ifcov@enquote@tl@global\cov@enquote@tl@globaltrue \def\cov@gl@preamble@global{} \def\cov@gl@postamble@global{} \DeclareKeys[covgloss] { - % 1. ex=<true|false> + % ex=<true|false> ex.if = cov@ex@gloss, - % 2. tlr=<true|false> + % tlr=<true|false> tlr.if = cov@tlr, - % 3. font settings for gloss line i, ii, iii + % tlr*=<true|false> + tlr*.if = cov@tlr@star, + % font settings for gloss line i, ii, iii fsi.store = \lglosslineone, fsii.store = \lglosslinetwo, fsiii.store = \lglosslinethree, - % 4. Gloss preamble text + % Gloss preamble text preamble.code = { \edef\cov@gl@preamble{#1} }, - % 5. Gloss postamble text + % Gloss postamble text postamble.store = \cov@gl@postamble, - % 6. Gloss preamble font settings + % Gloss preamble font settings fspreamble.store = \cov@fsglpreamble@local, - % 7. Gloss postamble font settings + % Gloss postamble font settings fspostamble.store = \cov@fsglpostamble@local, - % 8. Enquote translation line + % Enquote translation line enquotetl.if = cov@enquote@tl, - % 9. translation line font settings - fstl.store = \cov@fstl@local + % translation line font settings + fstl.store = \cov@fstl@local, + % judge=text + judge.code = { \def\cov@judge@gloss@text{#1} }, + % judgement shorthands: *, ?, *?, ??, # + *.code = { \def\cov@judge@gloss@text{*} }, + ?.code = { \def\cov@judge@gloss@text{?} }, + *?.code = { \def\cov@judge@gloss@text{*?} }, + ??.code = { \def\cov@judge@gloss@text{??} }, + #.code = { \def\cov@judge@gloss@text{\#} }, + % judgement font settings + fsjudge.store = \cov@judge@fs, + % addjudgesep=length + addjudgesep.code = { \addtolength\cov@judge@sep{#1} }, + % addlinesepi=length + addlinesepi.code = { \addtolength\cov@glossline@sepi@local{#1} }, + % addlinesepii=length + addlinesepii.code = { \addtolength\cov@glossline@sepii@local{#1} }, + % addlinesepiii=length + addlinesepiii.code = { \addtolength\cov@glossline@sepiii@local{#1} }, + % glosswidth=length + glosswidth.code = { \setlength\cov@glosswidth@local{#1} }, + % glosssep=length + glosssep.code = { \setlength\cov@glosssep@local{#1} }, + % glosscommentwidth=length + glosscommentwidth.code = { \setlength\cov@glosspwidth@local{#1} }, + % comment font settings + fscomments.store = \cov@closscomments@fs } \DeclareKeys[gcovgloss] @@ -976,6 +1292,8 @@ ex.if = cov@ex@gloss@global, % 2. tlr=<true|false> tlr.if = cov@tlr@global, + % 2. tlr*=<true|false> + tlr*.if = cov@tlr@star@global, % 3. font settings for gloss line i, ii, iii fsi.code = { \global\def\glosslineone@global{#1} }, fsii.code = { \global\def\glosslinetwo@global{#1} }, @@ -991,7 +1309,35 @@ % 8. Enquote translation line enquotetl.if = cov@enquote@tl@global, % 9. translation line font settings - fstl.code = { \global\def\cov@fstl@global{#1} } + fstl.code = { \global\def\cov@fstl@global{#1} }, + % judge=text + judge.code = { \def\cov@judge@gloss@text@global{#1} }, + % judgement shorthands: *, ?, *?, ??, # + *.code = { \def\cov@judge@gloss@text@global{*} }, + ?.code = { \def\cov@judge@gloss@text@global{?} }, + *?.code = { \def\cov@judge@gloss@text@global{*?} }, + ??.code = { \def\cov@judge@gloss@text@global{??} }, + #.code = { \def\cov@judge@gloss@text@global{\#} }, + % judgement font settings + fsjudge.store = \cov@judge@fs, + % addjudgesep=length + addjudgesep.code = { \addtolength\cov@judge@sep{#1} }, + % addjudgesep=length + addjudgesep.code = { \addtolength\cov@judge@sep{#1} }, + % addlinesepi=length + addlinesepi.code = { \addtolength\cov@glossline@sepi{#1} }, + % addlinesepii=length + addlinesepii.code = { \addtolength\cov@glossline@sepii{#1} }, + % addlinesepiii=length + addlinesepiii.code = { \addtolength\cov@glossline@sepiii{#1} }, + % glosswidth=length + glosswidth.code = { \setlength\glosswidth{#1} }, + % glosssep=length + glosssep.code = { \setlength\glosssep{#1} }, + % glosscommentwidth=length + glosscommentwidth.code = { \setlength\glosspwidth{#1} }, + % judgement font settings + fscomments.store = \cov@closscomments@fs } @@ -999,18 +1345,37 @@ \let\cov@fsglpostamble@local\relax% \let\cov@fstl@local\relax% +\newif\if@cov@glosspline + % % General setting option \newcommand*\setglossoptions[1]{\SetKeys[gcovgloss]{#1}} % -% 1. \digloss[<opts>]{<line 1>}{<line 2>}{<translation>} -\newcommand*\digloss[4][\empty]{% +% 1. \digloss[<opts>]{<line 1>}[linepostamble1] +% {<line 2>}[linepostamble2] +% {<translation>} +\NewDocumentCommand\digloss{ o m o m o m } +{ + \@cov@glossplinefalse% + \@cov@insubextrue% + \@ifundefined{cov@judge@gloss@text@global}% + {\let\cov@judge@gloss@text\relax}% + {\let\cov@judge@gloss@text\cov@judge@gloss@text@global}% \let\lglosslineone\relax% \let\lglosslinetwo\relax% \let\lglosslinethree\relax% \let\glosslineone\glosslineone@global% \let\glosslinetwo\glosslinetwo@global% \let\glosslinethree\glosslinethree@global% + \setlength\cov@glossline@sepi@local{\cov@glossline@sepi}% + \setlength\cov@glossline@sepii@local{\cov@glossline@sepii}% + \setlength\cov@glossline@sepiii@local{\cov@glossline@sepiii}% + \setlength\cov@glosswidth@local{\glosswidth}% + \setlength\cov@glosssep@local{\glosssep}% + \setlength\glosspwidth{\textwidth}% + \addtolength\glosspwidth{-\glosswidth}% + \addtolength\glosspwidth{-\glosssep}% + \setlength\cov@glosspwidth@local{\glosspwidth}% \ifcov@ex@gloss@global \SetKeys[covgloss]{ex=true} \else @@ -1021,6 +1386,11 @@ \else \SetKeys[covgloss]{tlr=false} \fi% + \ifcov@tlr@star@global + \SetKeys[covgloss]{tlr*=true} + \else + \SetKeys[covgloss]{tlr*=false} + \fi% \ifcov@enquote@tl@global \SetKeys[covgloss]{enquotetl=true} \else @@ -1028,7 +1398,7 @@ \fi% \def\cov@gl@preamble{\cov@gl@preamble@global}% \def\cov@gl@postamble{\cov@gl@postamble@global}% - \ifx#1\empty\else\SetKeys[covgloss]{#1}\fi% + \IfNoValueF{#1}{\SetKeys[covgloss]{#1}}% \ifcov@ex@gloss \begin{covexample} \fi% @@ -1046,16 +1416,47 @@ \@ifundefined{cov@fstl@local}% {\let\cov@fstl\cov@fstl@global}% {\let\cov@fstl\cov@fstl@local}% - \xgll #2\xgle - #3\xgle - \ifcov@tlr - \gln #4% - \else - \glot{#4}% - \fi - \ifx\cov@gl@postamble@text\empty% + \ifcov@tlr@star% + \@cov@glossplinetrue\def\lineonepa{% + \glosslinetrans{#6}% + \ifx\cov@gl@postamble@text\empty% + \else% + \glosslinepostamble{\cov@gl@postamble@text}\cov@nopagebreak% + \fi% + }% + \def\linetwopa{\strut}% \else% - \glosslinepostamble{\cov@gl@postamble@text}\cov@nopagebreak% + \IfNoValueTF{#3}{\def\lineonepa{\strut}}{\@cov@glossplinetrue\def\lineonepa{\cov@closscomments@fs#3}}% + \IfNoValueTF{#5}{\def\linetwopa{\strut}}{\@cov@glossplinetrue\def\linetwopa{\cov@closscomments@fs#5}}% + \fi% + \if@cov@glosspline% + \savebox{\pline}{% + \begin{varwidth}[t]{\cov@glosspwidth@local} + \lineonepa\par + \vspace{\cov@glossline@sepi@local} + \linetwopa + \end{varwidth} + }% + \fi + \xgll #2\xgle + #4\xgle + \ifcov@tlr@star\glot{}\else% + \ifcov@tlr + \gln #6% + \else + \IfBlankF{#6}{% + \vspace{\cov@glossline@sepii@local}% + }% + \ifx\cov@judge@gloss@text\empty% + \glot{#6}% + \else% + \glot[\cov@judge@gloss@text]{#6}% + \fi% + \fi% + \ifx\cov@gl@postamble@text\empty% + \else% + \glosslinepostamble{\cov@gl@postamble@text}\cov@nopagebreak% + \fi% \fi% \glend \ifcov@ex@gloss @@ -1067,16 +1468,35 @@ \let\cov@fsglpreamble@local\relax% \let\cov@fsglpostamble@local\relax% \let\cov@fstl@local\relax% + \let\cov@judge@gloss@text\relax% + \@cov@insubexfalse% } -% 2. \trigloss[<opts>]{<line 1>}{<line 2>}{<line 3>}{<translation>} -\newcommand\trigloss[5][\empty]{% +% 2. \trigloss[<opts>]{<line 1>}[linepostamble1] +% {<line 2>}[linepostamble2] +% {<line 3>}[linepostamble3] +% {<translation>} +\NewDocumentCommand\trigloss{ o m o m o m o m } +{% + \@cov@insubextrue% + \@ifundefined{cov@judge@gloss@text@global}% + {\let\cov@judge@gloss@text\relax}% + {\let\cov@judge@gloss@text\cov@judge@gloss@text@global}% \let\lglosslineone\relax% \let\lglosslinetwo\relax% \let\lglosslinethree\relax% \let\glosslineone\glosslineone@global% \let\glosslinetwo\glosslinetwo@global% \let\glosslinethree\glosslinethree@global% + \setlength\cov@glossline@sepi@local{\cov@glossline@sepi}% + \setlength\cov@glossline@sepii@local{\cov@glossline@sepii}% + \setlength\cov@glossline@sepiii@local{\cov@glossline@sepiii}% + \setlength\cov@glosswidth@local{\glosswidth}% + \setlength\cov@glosssep@local{\glosssep}% + \setlength\glosspwidth{\textwidth}% + \addtolength\glosspwidth{-\glosswidth}% + \addtolength\glosspwidth{-\glosssep}% + \setlength\cov@glosspwidth@local{\glosspwidth}% \ifcov@ex@gloss@global \SetKeys[covgloss]{ex=true} \else @@ -1087,6 +1507,11 @@ \else \SetKeys[covgloss]{tlr=false} \fi% + \ifcov@tlr@star@global + \SetKeys[covgloss]{tlr*=true} + \else + \SetKeys[covgloss]{tlr*=false} + \fi% \ifcov@enquote@tl@global \SetKeys[covgloss]{enquotetl=true} \else @@ -1094,7 +1519,7 @@ \fi% \def\cov@gl@preamble{\cov@gl@preamble@global}% \def\cov@gl@postamble{\cov@gl@postamble@global}% - \ifx#1\empty\else\SetKeys[covgloss]{#1}\fi% + \IfNoValueF{#1}{\SetKeys[covgloss]{#1}}% \ifcov@ex@gloss \begin{covexample} \fi% @@ -1112,17 +1537,51 @@ \@ifundefined{cov@fstl@local}% {\let\cov@fstl\cov@fstl@global}% {\let\cov@fstl\cov@fstl@local}% + \ifcov@tlr@star% + \@cov@glossplinetrue\def\lineonepa{% + \glosslinetrans{#8}% + \ifx\cov@gl@postamble@text\empty% + \else% + \glosslinepostamble{\cov@gl@postamble@text}\cov@nopagebreak% + \fi% + }% + \def\linetwopa{\strut}% + \else% + \IfNoValueTF{#3}{\def\lineonepa{\strut}}{\@cov@glossplinetrue\def\lineonepa{\cov@closscomments@fs#3}}% + \IfNoValueTF{#5}{\def\linetwopa{\strut}}{\@cov@glossplinetrue\def\linetwopa{\cov@closscomments@fs#5}}% + \IfNoValueTF{#7}{\def\linethreepa{\strut}}{\@cov@glossplinetrue\def\linethreepa{\cov@closscomments@fs#7}}% + \fi% + \if@cov@glosspline% + \savebox{\pline}{% + \begin{varwidth}[t]{\cov@glosspwidth@local} + \lineonepa\par + \vspace{\cov@glossline@sepi@local} + \linetwopa\par + \vspace{\cov@glossline@sepii@local} + \linethreepa + \end{varwidth} + }% + \fi \xglll #2\xgle - #3\xgle #4\xgle - \ifcov@tlr - \gln #5% - \else - \glot{#5}% - \fi - \ifx\cov@gl@postamble@text\empty% - \else% - \glosslinepostamble{\cov@gl@postamble@text}\cov@nopagebreak% + #6\xgle + \ifcov@tlr@star\glot{}\else% + \ifcov@tlr + \gln #8% + \else + \IfBlankF{#8}{% + \vspace{\cov@glossline@sepiii@local}% + }% + \ifx\cov@judge@gloss@text\empty% + \glot{#8}% + \else% + \glot[\cov@judge@gloss@text]{#8}% + \fi% + \fi + \ifx\cov@gl@postamble@text\empty% + \else% + \glosslinepostamble{\cov@gl@postamble@text}\cov@nopagebreak% + \fi% \fi% \glend \ifcov@ex@gloss @@ -1134,6 +1593,8 @@ \let\cov@fsglpreamble@local\relax% \let\cov@fsglpostamble@local\relax% \let\cov@fstl@local\relax% + \let\cov@judge@gloss@text\relax% + \@cov@insubexfalse% } diff --git a/macros/latex/contrib/covington/covington.tex b/macros/latex/contrib/covington/covington.tex index f8fe4ee94c..865305f981 100644 --- a/macros/latex/contrib/covington/covington.tex +++ b/macros/latex/contrib/covington/covington.tex @@ -97,8 +97,8 @@ % % Titling % -\def\pversion{Version 2.10} -\def\pdate{June 2, 2023} +\def\pversion{Version 2.11} +\def\pdate{June 17, 2023} \title{\textbf{The \cvt\ Package\\\Large Macros for Linguistics}} \author{Michael A. Covington \and J\"urgen Spitzm\"uller\thanks{Current maintainer. @@ -312,11 +312,20 @@ The \jenv{example} environment provides the following options which also allow f \item[\joption{fsno=\{\jparam{font settings}\}}] Default: \verb|{\normalfont\upshape}|. Adjusts the font settings of the example number. Valid values are \LaTeX\ font switches such as \jfcsmacro{itshape}, \jfcsmacro{bfseries} etc. + \item[\joption{judge=\{\jparam{arbitrary text}\}}] Insert grammaticality judgments (such as * or ?) + to an example. This will be inserted before the example text with a small space and uses its own + markup. For convenience, the following shorthand options are also provided: + \joption{*}, \joption{?}, \joption{*?}, \joption{??}, and \joption{\#} (as alias to + \joption{judge=*} etc.). + \item[\joption{fsjudge=\{\jparam{font settings}\}}] Default: \verb|{\normalfont\upshape}|. + Adjusts the font settings of the grammaticality judgment. + Valid values are \LaTeX\ font switches such as \jfcsmacro{itshape}, \jfcsmacro{bfseries} etc. \item[\joption{preamble=\{\jparam{arbitrary text}\}}] Arbitrary text that is inserted on an own line after the example number (preceding the example text). This might be useful, for instance, to give context information, to specify the language or the source in case of cited examples. The advantage over just adding a line manually in the example is that you can globally or locally - set the markup with the \joption{fspreamble} option. + set the markup with the \joption{fspreamble} option. Also, judgment markers are properly set + after the preamble. \item[\joption{postamble=\{\jparam{arbitrary text}\}}] Arbitrary text that is appended to the example (on the same line after a space). This might be useful to add a reference or an explanation to the translation. @@ -339,6 +348,14 @@ The \jenv{example} environment provides the following options which also allow f negative values will decrease the indentation of the example. \item[\joption{addnumbersep=\{\jparam{length}\}}] Default: \verb|{0pt}|. Increases or (with negative values) decreases the spacing between example number and example. + \item[\joption{judgewidth=\{\jparam{text}\}}] + Sets the width that is reserved for the judgment marker. This is automatically set to the input + of \joption{judge}. By default and notably in the \jenv{examples} and \jenv{examples} environments + which use an angular \jcsmacro{item} argument rather than the \joption{judge} option, + this is preset to \verb|{?}|. + \item[\joption{addjudgesep=\{\jparam{length}\}}] Default: \verb|{0pt}|. + Increases or (with negative values) decreases the spacing between judgment mark and example + (which amounts to 0.2\,em by default). \item[\joption{numberformat=\{\jparam{template}\}}] Default: \verb|{(1)}|. The format of the example number. The option takes templates as known from the \textsf{enumerate} package \cite{enumerate}. @@ -352,12 +369,11 @@ The \jenv{example} environment provides the following options which also allow f and example is in a footnote. For the template format, see \joption{numberformat}. \end{description} % -If you pass the options as optional argument to an environment, they will only apply to the current environment. - +If you pass these as optional argument to an environment, they will only apply to the current environment. If you want to make a global change, you can use the macro -\begin{itemize} - \item \jcsmacro{setexampleoptions\{\jparam{options}\}} -\end{itemize} +\begin{lstlisting}[moretexcs={setexampleoptions}] +\setexampleoptions{<options>} +\end{lstlisting} and pass either of the above options to it (as usual separated by comma). This will apply to all subsequent examples (the \jenv{example} environment described here as well as \jenv{examples}, \jenv{subexamples} and glosses with the \joption{ex} option) until further global change and unless an option is altered locally via optional argument. @@ -368,12 +384,7 @@ Please refer to sec.~\ref{sec:exex} for exemplifications of the options. To display a series of examples together, each with its own example number, use \jenv{examples} (or \jenv{covexamples}\footnote{% - As for \jenv{example}, \cvt\ checks if there is already an \jfenv{examples} environment defined, - and if this is the case, \cvt\ does not define its own one. The alias environment \jenv{covexamples} - is always available as a fallback. If you use the package option \joption{force}, \cvt\ will override - existing \jfenv{examples} environments. The package will issue a warning if \jenv{examples} is already defined - (this is the case, for instance, if you use \cvt\ with the \texttt{beamer} class), telling you - how the package has dealt with the situation.% + The fallback mechanism described in footnote~\ref{fn:fallbacks} for \jfenv{example} apply here, too.% }) instead of \jenv{example} or \jenv{covexample}. There can be more than one example with this environment, and each of them has to be introduced by \jfcsmacro{item}, like this: @@ -396,18 +407,48 @@ This prints as: \item This is the second sentence. \end{examples} % -The \jenv{examples} environments accepts the same options than the \jenv{example} environment (please refer -to sec.~\ref{sec:ex} for details). -However, there is one notable exception: \joption{preamble} and \joption{postamble[*]} do not have any effect since, -if you want to add preceding or trailing text, you will want to add this to specific items in the set. - -To this end, we provide specific macros, namely \jcsmacro{expreamble} and \jcsmacro{expostamble}, which can be placed -where they should appear in the example, and which take the same markup than the texts passed via \joption{preamble} -or \joption{postamble} option in the \jenv{example} environment. +Besides to the normal optional item argument (see below), the examples environment provides an optional angular +argument which allows you to pass a judgment marker. Consider: +\begin{lstlisting} +\begin{examples} +\item<*> Ein ungrammatischem Satz. +\item Ein grammatischer Satz. +\end{examples} +\end{lstlisting} +% +This is printed as: +\begin{examples} + \item<*> Ein ungrammatischem Satz. + \item Ein grammatischer Satz. +\end{examples} +% +If you use a wider marker such as \jparam{??}, you need to adjust the width of the reserved space for the marker. +To this end, the option \joption{judgewidth=\{\jparam{text}\}} is provided (e.\,g., \verb|judgewidth={??}|). +With even wider markers, you might also need to adjust \joption{addnumbersep} to prevent the marker from coming too +close to the example number. + +The \jenv{examples} environments accepts the same options than the \jenv{example} environment (please refer to +sec.~\ref{sec:ex} for details). +However, there are some notable deviations and exceptions due to the fact that we are dealing with multiple examples +in a row here: +\begin{itemize} + \item \joption{judge=\{\jparam{arbitrary text}\}} and its shorthand aliases (\joption{*}, \joption{?}, \joption{*?}, + \joption{??}, and \joption{\#}) set the default judgment marker for all items in the environment. + It also sets the appropriate \joption{judgewidth} for the selected marker. + Use the aforementioned angular \jcsmacro{item} option to overwrite the preset marker or to set + one for indivual examples only. + \item \joption{preamble} and \joption{postamble[*]} do not have any effect at all, as such text needs to + be set for individual examples in the set; to this end, we provide a specific solution, as documented + in what follows. +\end{itemize} +% +For preambles and postambles, we provide specific macros, namely \jcsmacro{expreamble} and \jcsmacro{expostamble}, +which can be placed where they should appear in the example, and which take the same markup than the texts passed +via \joption{preamble} or \joption{postamble} option in the \jenv{example} environment. Hence, also here, the advantage over just adding text as is in the example is that an own, globally settable markup is used. This is particularly relevant if you globally set examples to be italicized via the \joption{fs} option (as we have done it -in our examples in sec.~\ref{sec:exex}). +in our examples in sec.~\ref{sec:exex}). Also, judgment markers are properly set after the preamble. Consider: \begin{lstlisting}[moretexcs={expreamble}] @@ -428,7 +469,7 @@ This prints as follows: \end{examples} % To see the advantage more clearly, let us locally set the markup of the example text: -\begin{lstlisting}[moretexcs={expreamble}] +\begin{lstlisting}[moretexcs={expreamble},morekeywords=fs] \begin{examples}[fs={\itshape}] \item \expreamble{Here is Jakobson's famous poetic example:} I like Ike! @@ -446,7 +487,7 @@ As you can see, the preamble text is untouched: \end{examples} % Along the same line, consider: -\begin{lstlisting}[moretexcs={expostamble}] +\begin{lstlisting}[moretexcs={expostamble},morekeywords=fs] \begin{examples}[fs={\itshape}] \item I like Ike! \expostamble{(Jakobson 1960: 357)} \item I am in favor of Mr. Eisenhower.\expostamble{\footnote{He actually wasn't.}} @@ -473,7 +514,9 @@ results in: \item A proposition. \item[\covexnumber{\exampleno*'}] An alternative proposition. \end{examples} - +% +If you need an angular (judgment) argument and an optional argument, pass the judgment argument first +(i.\,e., \verb|\item<judgment>[custom label]|). \subsection[The \jenv{subexamples} environment]{The \jenv{subexamples} environment}\label{sec:subexs} @@ -519,9 +562,33 @@ prints as: \item This is the second sentence. \end{subexamples} % +Similar to the \jenv{examples} environment, the \jenv{subexamples} environment's item has an angular argument +to pass grammaticality judgment markers, as in: +% +\begin{subexamples} + \item This is a well-formed sentence. + \item<*> This not well-formed is. +\end{subexamples} +% +which was typed as: +\begin{lstlisting} +\begin{subexamples} +\item This is a well-formed sentence. +\item<*> This not well-formed is. +\end{subexamples} +\end{lstlisting} +% +The settings of the judgment markers (spacing and markup) is done via the options described in +sec.~\ref{sec:ex}. + The \jenv{subexamples}/\jenv{covsubexamples} environment provides the same options than the \jenv{example} and \jenv{examples} environment (see sec.~\ref{sec:ex}) with the following deviations and additions: \begin{description} + \item[\joption{judge=\{\jparam{arbitrary text}\}}] and its shorthand aliases (\joption{*}, \joption{?}, + \joption{*?}, \joption{??}, and \joption{\#}) set the default judgment marker for all items in the environment. + It also sets the appropriate \joption{judgewidth} for the selected marker. + Use the aforementioned angular \jcsmacro{item} option to overwrite the preset marker or to set + one for indivual subexamples only. \item[\joption{preamble=\{\jparam{arbitrary text}\}}] Arbitrary text is inserted here on the first line (after the main number and before the first sub-example, which then follows on a new line). This might be useful, for instance, to give context information, to specify the language or the source @@ -538,6 +605,7 @@ and \jenv{examples} environment (see sec.~\ref{sec:ex}) with the following devia Also note that, if you set options globally via \jcsmacro{setexampleoptions}, the following derivating options should be used to distinguish the \jenv{subexample} from the \jenv{example} case. \begin{description} + \item[\joption{subjudge=\{\jparam{text}\}}] sets the default judge marker for subexamples. \item[\joption{fssubpreamble=\{\jparam{font settings}\}}] Default: \verb|{\normalfont\upshape}|. Adjusts the font settings of subexample's preamble text and the \jcsmacro{subexpreamble} macro described below. @@ -546,18 +614,24 @@ should be used to distinguish the \jenv{subexample} from the \jenv{example} case Tweaks the sub\-example's postamble text font settings and the \jcsmacro{subexpostamble} macro described below. Valid values are \LaTeX\ font switches such as \jfcsmacro{itshape}, \jfcsmacro{bfseries} etc. + \item[\joption{fssubpostamble=\{\jparam{font settings}\}}] Default: \verb|{\normalfont\upshape}|. + Tweaks the sub\-example's postamble text font settings and the \jcsmacro{subexpostamble} + macro described below. + Valid values are \LaTeX\ font switches such as \jfcsmacro{itshape}, \jfcsmacro{bfseries} etc. \end{description} % -For convenience, both options actually also work (as aliases) in optional arguments. +For convenience, all these options actually also work (as aliases) in optional arguments passed to +\jenv{subexamples} environment. To add additional text preceding or following specific subitems, you can principally use the \jcsmacro{expreamble} and \jcsmacro{expostamble} macros desribed in sec.~\ref{sec:exs}. To allow for separating the markup of such texts in subexample from the example case, we also provide specific macros, \jcsmacro{subexpreamble} and \jcsmacro{subexpostamble} which use their own font settings (and the same than the \joption{preamble} and -\joption{postamble} options of this environment). +\joption{postamble} options of this environment). With all these macros, judgment markers are properly set after +the preamble. For example: -\begin{lstlisting}[moretexcs={subexpreamble}] +\begin{lstlisting}[moretexcs={subexpreamble},morekeywords=preamble] \begin{covsubexamples}[preamble={Here are two sentences:}] \item \subexpreamble{English:} This is the first sentence. \item \subexpreamble{German:} Das ist der zweite Satz. @@ -602,20 +676,21 @@ as common in linguistics. As you now already know, this is very easy to do, via: \setexampleoptions{fs=\itshape} % which applies from now on. If we now enter: -\begin{lstlisting} -\begin{example}[preamble={This example showcases the pre- and postamble options:}, +\begin{lstlisting}[morekeywords={preamble,postamble}] +\begin{example}[preamble={Consider this example:}, postamble={(German)}] Das ist ein Satz. \end{example} \end{lstlisting} % We will get: -\begin{example}[preamble={This example showcases the pre- and postamble options:},postamble={(German)}] +\begin{example}[preamble={Consider this example:}, + postamble={(German)}] Das ist ein Satz. \end{example} % And with a similar subexample: -\begin{lstlisting} +\begin{lstlisting}[morekeywords={preamble,postamble}] \begin{subexamples}[preamble={Here are two sentences}, postamble={(Doe 1974: 12)}] \item This is the first sentence. @@ -628,11 +703,81 @@ we get the following output: \item This is the second sentence. \end{subexamples} % -In what follows, we demonstrate the adjustment of the spacing of examples. +Let us briefly demonstrate the judgment feature. If we want to mark an example as being ungrammatical, +we use the conventional asterisk mark, like this: +\begin{lstlisting}[morekeywords=judge] +\begin{example}[judge=*] +Ein ungrammatischem Satz. +\end{example} +\end{lstlisting} +% +or, shorter: +\begin{lstlisting}[morekeywords={*}, alsoletter={*}] +\begin{example}[*] +Ein ungrammatischem Satz. +\end{example} +\end{lstlisting} +% +to get: +\begin{example}[judge=*] + Ein ungrammatischem Satz. +\end{example} +% +With the \jenv{examples} and \jenv{subexamples} environment, we need to pass the marker to the item's +angular argument instead, as already demonstrated in sec.~\ref{sec:exs}: +\begin{lstlisting} +\begin{examples} +\item<*> Ein ungrammatischem Satz. +\item Ein grammatischer Satz. +\end{examples} +\end{lstlisting} +% +\begin{examples} + \item<*> Ein ungrammatischem Satz. + \item Ein grammatischer Satz. +\end{examples} +% +With wider markers, we need to adjust the marker width via \joption{judgewidth}, and +since we have a larger count of examples now, we also adjust \joption{addnumbersep} +to have a good space to the number: +\begin{lstlisting}[morekeywords={judgewidth,addnumbersep}] +\begin{examples}[judgewidth={??},addnumbersep={1ex}] +\item<??> Kann ich ein gratis Bier haben? +\item Kann ich ein Bier gratis haben? +\end{examples} +\end{lstlisting} +% +\begin{examples}[judgewidth={??},addnumbersep={1ex}] + \item<??> Kann ich ein gratis Bier haben? + \item Kann ich ein Bier gratis haben? +\end{examples} +% +\Cvt\ takes care that judgment markers are also properly set with preambles (with the +\jcsmacro{expreamble} and \jcsmacro{subexpreamble} macros, this requires an extra +\LaTeX\ pass). Observe how: +% +\begin{lstlisting}[moretexcs={expreamble}] +\begin{examples} +\item \expreamble{Compare this:} + Oh, I am so well-formed! +\item<*> \expreamble{with this:} + Lucky are you! +\end{examples} +\end{lstlisting} +% +comes out as expected: +\begin{examples} + \item \expreamble{Compare this:} + Oh, I am so well-formed! + \item<*> \expreamble{with this:} + Lucky are you! +\end{examples} +% +In what follows, we demonstrate further adjustments of the spacing of examples. The space between the example number and the text (or the subnumber in case of subexamples) can be adjusted, as documented above, by means of the \joption{addnumbersep} example option. So, for instance, -\begin{lstlisting}[moretexcs={addnumbersep}] +\begin{lstlisting}[morekeywords={addnumbersep}] \begin{example}[addnumbersep={2em}] Look, I am shifted right! \end{example} @@ -647,7 +792,7 @@ The indentation (left margin) of examples and subexamples is controlled by the \ example option. Doing \joption{leftmargin=1em}, for instance, will increase the indentation by 1\,em, negative values will decrease it accordingly. For the latter, consider: -\begin{lstlisting}[moretexcs={leftmargin}] +\begin{lstlisting}[morekeywords={leftmargin}] \begin{example}[leftmargin={-2.6em}] This is a marginal case. \end{example} @@ -662,7 +807,7 @@ In case of \jenv{subexamples}, the distance between example subnumber and text c via the \joption{addsubnumbersep} option. Again, a positive value will increase, a negative value will decrease the distance. Doing -\begin{lstlisting}[moretexcs={addnumbersep,addsubnumbersep}] +\begin{lstlisting}[morekeywords={addnumbersep,addsubnumbersep}] \begin{subexamples}[addnumbersep={-0.4em},addsubnumbersep={0.4em}] \item My numbers have been moved. \item Mine as well. @@ -690,8 +835,8 @@ etc. So to equip the examples with a dot after the number, we use \joption{numberformat=\{(1.)\}} To remove the parentheses from the subexample letter, for instance, we can use \joption{subnumberformat=\{a\}}. The following example demonstrates both options: -\begin{lstlisting}[moretexcs={numberformat,subnumberformat}] -\begin{subexamples}[numberformat={(1.)}, subnumberformat={a}] +\begin{lstlisting}[morekeywords={numberformat,subnumberformat}] +\begin{subexamples}[numberformat={(1.)},subnumberformat={a}] \item This is a statement. \item This is an adjacent statement. \end{subexamples} @@ -704,25 +849,24 @@ And we get what we want: \end{subexamples} % Note that the \joption{numberformat} option by default also changes the numbers of examples in footnotes, even if -\joption{fnexamplecounter=own} or \joption{fnexamplecounter=own-reset} is used. This does not apply to the counter format, +\joption{fnexamplecounter=own[-reset]} is used. This does not apply to the counter format, however. So \joption{numberformat=\{[1.])\}} will also make the example numbers in footnote appear in brackets and with the dot, but it will still use the lower Roman numbering. Use \joption{fnnumberformat} to fully change the appearance. With the last examples, we return to example markup. Remember, we have globally set the markup of example sentences to italics at the beginning of this section. Now if we want to have it bold instead for one single occurence, we can reset it for the one case via the environment options (if we wanted to change it globally from now on, we would use \jcsmacro{setexampleoptions} once more). - Observe how: -\begin{lstlisting}[moretexcs={covsubexnumber}] -\begin{example}[fs=\bfseries,preamble={This is the preamble}, - postamble={(Postamble)}] +\begin{lstlisting}[morekeywords={fs,preamble,postamble}] +\begin{example}[fs=\bfseries,preamble={Note:}, + postamble={(in any respect)}] This is a bold statement! \end{example} \end{lstlisting} % results in: -\begin{example}[fs=\bfseries,preamble={This is the preamble}, - postamble={(Postamble)}] +\begin{example}[fs=\bfseries,preamble={Note:}, + postamble={(in any respect)}] This is a bold statement! \end{example} % @@ -762,18 +906,28 @@ Both are described in turn. \subsection{Gloss macros}\label{sec:gmacros} \Cvt\ provides two gloss macros: -\begin{itemize} - \item \jcsmacro{digloss[\jparam{options}]\{\jparam{gloss line 1}\}\{\jparam{gloss line 2}\}\{\jparam{free translation}\}}\\ - typesets two-line glosses with a translation line (the macro name - puns on Greek \lexp{diglossa}, lit. \lmean{two tongues}, \lmean{bilingualism}) - \item \jcsmacro{trigloss[\jparam{options}]\{\jparam{gloss l.\,1}\}\{\jparam{gloss l.\,2}\}\{\jparam{gloss l.\,3}\}\{\jparam{free tr.}\}}\\ - typesets three-line\footnote{The additional line can be useful for instance - to gloss cited forms, morphology, or an additional translation. - See sec.~\ref{sec:glossex} for examples.} - glosses with a translation line (cf. Greek \lexp{triglossa}, - lit. \lmean{three tongues}, \lmean{trilingualism}) -\end{itemize} -% +\begin{lstlisting}[moretexcs={digloss}] +\digloss[<options>] + {<gloss line 1>}[<optional comment line 1>] + {<gloss line 2>}[<optional comment line 2>] + {<free translation>} +\end{lstlisting} +typesets two-line glosses with a translation line, and optionally comments to the right side +of the gloss lines (the macro name puns on Greek \lexp{diglossa}, lit. \lmean{two tongues}, +\lmean{bilingualism}). +\begin{lstlisting}[moretexcs={trigloss}] +\trigloss[<options>] + {<gloss line 1>}[<optional comment line 1>] + {<gloss line 2>}[<optional comment line 2>] + {<gloss line 3>}[<optional comment line 3>] + {<free translation>} +\end{lstlisting} +typesets three-line\footnote{The additional line can be useful for instance +to gloss cited forms, morphology, or an additional translation. +See sec.~\ref{sec:glossex} for examples.} +glosses with a translation line and optional comments (cf. Greek \lexp{triglossa}, +lit. \lmean{three tongues}, \lmean{trilingualism}). + The example given above would thus be typed as: \begin{lstlisting}[moretexcs={digloss}] \digloss{Dit is een Nederlands voorbeeld} @@ -785,11 +939,11 @@ Note that: \begin{itemize} \item The \jparam{free translation} argument can be left empty. In this case, no translation line is added (and no extra space taken). - \item The macros automatically markup the lines. By default, the first gloss - line is in italics, subsequent lines are set upright, and the free translation in single - quotation marks (using the language-sensitive \textsf{csquotes} \cite{csquotes} macros if - this package is loaded). This can be customized, though, via the macro options or globally - via the macro \jcsmacro{setglossoptions} which will be documented below. + \item The macros automatically markup the lines. + By default, the first gloss line is in italics, subsequent lines are set upright, and the + free translation in single quotation marks (using the language-sensitive \textsf{csquotes} + \cite{csquotes} macros if this package is loaded). This can be customized, though, via the + macro options or globally via the macro \jcsmacro{setglossoptions} which will be documented below. \item By default, page breaks might occur within glosses. In order to prevent it, the package option \joption{noglossbreaks} (see sec.~\ref{sec:intro}) will help in many cases. If it doesn't, you can wrap the whole gloss into a minipage or parbox. @@ -825,10 +979,19 @@ Note that: (i.\,e., it is numbered). In this case, any example settings done via \jcsmacro{setexampleoptions} (sec.~\ref{sec:ex}) apply. \item[\joption{tlr=\jparam{true|false}}] Default: \emph{false}. If set to true, the translation line (content - of the \jparam{free translation} argument) is set right to the gloss lines, rather than into a new line below. - Since the gloss itself is set in a box, this means the \jparam{free translation} will appear lined up with the + of the \jparam{free translation} argument) is set right to the gloss lines, rather than into a new line below, + and shifted towards the right margin. In contrast to the normal translation line, the content is not enquoted. + Since the gloss itself is set in a box, the \jparam{free translation} will appear lined up with the first line of the gloss. This can be useful when no translation, but an aligned number or something similar, is to be inserted right to the gloss (please refer to sec.~\ref{sec:glossex} for an example). + + Note that this option defuncts the optional gloss line comments. + \item[\joption{tlr*=\jparam{true|false}}] Default: \emph{false}. A variant of \joption{tlr} which is + suitable for setting real free translations (enquoted) right to the gloss (after a small space). + Both the gloss and the translation line are placed in a box with limited width in this case. + The maximum width of the translation line can be adjusted via the \joption{glosscommentwidth} option + described below, the maximum width of the gloss and the space between gloss and translation line via + \joption{glosswidth} and \joption{glosssep}, respectively. \item[\joption{fsi=\{\jparam{font settings}\}}]. Default: \verb|{\normalfont\itshape}|. Adjusts the font settings of the first gloss line. Valid values are \LaTeX\ font switches such as \jfcsmacro{itshape}, \jfcsmacro{bfseries} etc. @@ -850,6 +1013,25 @@ Note that: for enquoting the translation. If not, a fallback quotation (using English single quotation marks) is used. The usage of \textsf{csquotes} is highly recommended! + \item[\joption{addlinesepi=\{\jparam{length}\}}]. Default: \verb|{0pt}|. + Increases or (with negative values) decreases the vertical spacing after the first gloss line. + \item[\joption{addlinesepii=\{\jparam{length}\}}] Default: \verb|{0pt}|. + Increases or (with negative values) decreases the vertical spacing after the second gloss line + (in \jcsmacro{digloss}, this is only done if a translation line follows). + \item[\joption{addlinesepiii=\{\jparam{length}\}}] Default: \verb|{0pt}|. + Increases or (with negative values) decreases the vertical spacing after the third gloss line + if a translation line follows (in case of \jcsmacro{trigloss}). + \item[\joption{judge=\{\jparam{arbitrary text}\}}] Insert grammaticality judgments (such as * or ?) + to the gloss. This will be prepended to the first gloss line with a small space and uses its own + markup. For convenience, the following shorthand options are also provided: + \joption{*}, \joption{?}, \joption{*?}, \joption{??}, and \joption{\#} (as alias to + \joption{judge=*} etc.). + \item[\joption{fsjudge=\{\jparam{font settings}\}}] Default: \verb|{\normalfont\upshape}|. + Adjusts the font settings of the grammaticality judgment. + Valid values are \LaTeX\ font switches such as \jfcsmacro{itshape}, \jfcsmacro{bfseries} etc. + \item[\joption{addjudgesep=\{\jparam{length}\}}] Default: \verb|{0pt}|. + Increases or (with negative values) decreases the spacing between judgment mark and gloss + (which amounts to 0.2\,em by default). \item[\joption{preamble=\{\jparam{arbitrary text}\}}] Arbitrary text that is inserted on an own line before the interlinearized gloss. This might be useful, for instance, to give context information, to specify the language or the source in case of cited glosses. @@ -868,13 +1050,23 @@ Note that: \item[\joption{fspostamble=\{\jparam{font settings}\}}] Default: \verb|{\normalfont\upshape}|. Adjusts the font settings of the postamble line. Valid values are \LaTeX\ font switches such as \jfcsmacro{itshape}, \jfcsmacro{bfseries} etc. + \item[\joption{glosswidth=\{\jparam{length}\}}] Default: \verb|{0.6\textwidth}|. + Sets the maximum width the gloss takes if optional comments or \joption{tlr*=true} are used. + \item[\joption{glosssep=\{\jparam{length}\}}] Default: \verb|{1em}|. + Sets space between gloss and optional comments or free translation in case of \joption{tlr*=true}. + \item[\joption{glosscommentwidth=\{\jparam{length}\}}] + Sets the maximum width of gloss comments or free translation in case of \joption{tlr*=true}. + By default this is automatically calculated from the above two lengths. + \item[\joption{fscomments=\{\jparam{font settings}\}}] Default: \verb|{\normalfont\upshape}|. + Adjusts the font settings of the gloss comments. + Valid values are \LaTeX\ font switches such as \jfcsmacro{itshape}, \jfcsmacro{bfseries} etc. \end{description} % -If given as optional arguments to a \jcsmacro{digloss} or \jcsmacro{trigloss} macro, the options will only apply to +If passed to a \jcsmacro{digloss} or \jcsmacro{trigloss} macro, the options will only apply to this very gloss. If you want to make a permanent change, you can use the macro -\begin{itemize} - \item \jcsmacro{setglossoptions\{\jparam{options}\}} -\end{itemize} +\begin{lstlisting}[moretexcs={setglossoptions}] +\setglossoptions{<options>} +\end{lstlisting} and pass either of the above options to it. This will apply to all subsequent glosses (until further global change and unless the setting is altered locally via macro option). @@ -917,7 +1109,10 @@ The following is a complete list of all low-level glossing commands: \item[\jcsmacro{glot\{\jparam{free translation}\}}] is an alternative to \jcsmacro{glt} and a smarter way to insert a translation line. Other than \jcsmacro{glt}, it marks up (by default: enquotes) the translation line. Also, it does not add an empty line if the - translation is empty. This command has been introduced in \cvt\ 2.0. + translation is empty. + This macro also takes an optional argument where a judgment marker can be passed. + This is for nice alignment with the gloss lines if such a marker is used. + The markup can be customized by redefining the following macro: \begin{lstlisting}[moretexcs={glosslinetrans,covenquote,cov@fstl,ifcov@enquote@tl}] \newcommand*\glosslinetrans[1]{% @@ -1011,7 +1206,7 @@ In order to produce this, we use the \jcsmacro{trigloss} macro for a three-line and pass the \joption{fsii} option with the respective font switches in order to get small capitals in the second line (\jcsmacro{normalfont} is needed here to disable the italics set for the first line): -\begin{lstlisting}[moretexcs={trigloss}] +\begin{lstlisting}[moretexcs={trigloss},morekeywords=fsii] \trigloss[fsii={\normalfont\scshape}] {Hoc est aliud exemplum} {n.sg.nom 3sg n.sg.nom n.sg.nom} @@ -1023,22 +1218,41 @@ Next, an example with a gloss but no translation, with an example number at the right: \digloss[tlr]{Hoc habet numerum} {This has number} - {\hfill (\exampleno)} + {(\exampleno)} % That one was typed using the option \joption{tlr}: -\begin{lstlisting}[moretexcs={digloss,exampleno}] +\begin{lstlisting}[moretexcs={digloss,exampleno},morekeywords=tlr] \digloss[tlr]{Hoc habet numerum} {This has number} - {\hfill (\exampleno)} + {(\exampleno)} +\end{lstlisting} +% +Third, we showcase the \joption{tlr*} option which is usable if +you want the free translation to the right: +\digloss[tlr*,glosscommentwidth={.6\textwidth}] + {Tres facet collegium} + {Three make society} + {Three persons constitute a group.} +% +This has been entered like this: +\begin{lstlisting}[moretexcs={digloss,exampleno},morekeywords=tlr] +\digloss[tlr*,glosscommentwidth={.6\textwidth}] + {Tres facet collegium} + {Three make society} + {Three persons constitute a group.} \end{lstlisting} % -Third, we'll put a glossed sentence inside the \texttt{example} +As you note, we also used the \joption{glosscommentwidth} option to +make the box which holds the translation line in this case a bit +wider (as the translation is rather long and the gloss itself rather short). + +Now, we'll put a glossed sentence inside the \texttt{example} environment, which is a very common way of using it: \digloss[ex]{Hoc habet numerum praepositum} {This has number preposed} {This one has a number in front of it.} This last example was, of course, typed as: -\begin{lstlisting}[moretexcs={digloss}] +\begin{lstlisting}[moretexcs={digloss},morekeywords=ex] \digloss[ex]{Hoc habet numerum praepositum} {This has number preposed} {This one has a number in front of it.} @@ -1059,7 +1273,8 @@ cited example: p.~2) and also exemplifies the use of \joption{preamble}: {now they-\textsc{obl-gen} farm forever behind stay-\textsc{fut-neg}} {Now their farm will not stay behind forever.} This has been input as follows: -\begin{lstlisting}[moretexcs={digloss},basicstyle={\footnotesize\ttfamily}] +\begin{lstlisting}[moretexcs={digloss},basicstyle={\footnotesize\ttfamily}, + morekeywords={ex,preamble}] \digloss[ex,preamble={Lezgian (Haspelmath 1993:207)}] {Gila abur-u-n ferma hamialu\v{g} g\v{g}na amuq'-da-\v{c}.} {now they-\textsc{obl-gen} farm forever behind stay-\textsc{fut-neg}} @@ -1071,14 +1286,42 @@ Also, if you adhere to the \emph{Leipzig glossing rules}, you might want to chec \LaTeX\ package \cite{leipzig-ltx} that facilitates the use of the gloss abbreviations that have been entered and marked-up manually here. +Next, we showcase grammatical judgment. Similar to how this is done in examples, we +simply pass the respective \joption{judge} option or shorthand: +\begin{lstlisting}[moretexcs={digloss},basicstyle={\footnotesize\ttfamily}, + alsoletter={??}, morekeywords={ex,??}] +\digloss[ex,??] + {Hier werden Sie geholfen!} + {Here become.\textsc{aux.pass.2sg.pst} you.\textsc{2sg.acc} help.\textsc{pass.ptcp}} + {Here you will be helped!} +\end{lstlisting} +% +resulting in: +\digloss[ex,??]{Hier werden Sie geholfen!} + {Here become.\textsc{aux.pass.2sg.pst} you.\textsc{2sg.acc} help.\textsc{pass.ptcp}} + {You will be helped here!} +% +Gloss line comments allow you to set arbitrary text right to specific gloss lines, as in: +\digloss[ex]{Gut Ding will Weile haben}[(German proverb)] + {Good thing want while have} + {Slow and steady wins the race} +% +This was typed in with the help of the optional gloss arguments: +\begin{lstlisting}[moretexcs={digloss},basicstyle={\footnotesize\ttfamily}, morekeywords={ex}] +\digloss[ex]{Gut Ding will Weile haben}[(German proverb)] + {Good thing want while have} + {Slow and steady wins the race} +\end{lstlisting} +% The final example exemplifies the use of \joption{postamble}. In what follows we add a footnote to the translation line, but outside the translation (as marked-up by quotation marks): \digloss[ex, postamble={\footnote{Yes, really!}}] -{Mein Luftkissenboot ist voller Aale} -{My hovercraft is {full of} eels} -{Do you have matches?} + {Mein Luftkissenboot ist voller Aale} + {My hovercraft is {full of} eels} + {Do you have matches?} This has been input as follows: -\begin{lstlisting}[moretexcs={digloss},basicstyle={\footnotesize\ttfamily}] +\begin{lstlisting}[moretexcs={digloss},basicstyle={\footnotesize\ttfamily}, + morekeywords={ex,postamble}] \digloss[ex, postamble={\footnote{Yes, really!}}] {Mein Luftkissenboot ist voller Aale} {My hovercraft is {full of} eels} @@ -1402,6 +1645,15 @@ it. \section{Release history} +\subsection*{2.11 (2023 June 17)} +\begin{itemize} + \item Add support for judgment markers in examples and glosses. + \item Add support for customization of spacing between gloss lines. + \item Add support for gloss comment lines via optional arguments. + \item Add support for translation lines on the right side of glosses + (via new \joption{tlr*} option). +\end{itemize} + \subsection*{2.10 (2023 June 2)} \begin{itemize} \item Use \LaTeXe's own keyval mechanism rather than \textsf{xkeyval}. diff --git a/macros/latex/contrib/eolang/eolang.dtx b/macros/latex/contrib/eolang/eolang.dtx index 3a38714fbd..f11125a7e2 100644 --- a/macros/latex/contrib/eolang/eolang.dtx +++ b/macros/latex/contrib/eolang/eolang.dtx @@ -50,7 +50,7 @@ %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{eolang} %<*package> -[2023-03-01 0.12.1 Formulas and Graphs for EO Programming Language] +[2023-06-17 0.12.2 Formulas and Graphs for EO Programming Language] %</package> %<*driver> \documentclass{ltxdoc} @@ -463,7 +463,7 @@ % \pagestyle{empty} % \begin{document} % \begin{phiquation*} -% x -> \left\{\begin{matrix} \ +% foo -> \left\{\begin{matrix} \ % ? \\ % [[ L> ^ \times $.\alpha_0 ]] \\ % [[ D> 42 ]] \ @@ -601,6 +601,19 @@ % \end{document} % \end{docshot} +% When necessary to use a percentage sign, prepend it with a backward slash: +% \docshotOptions{firstline=5,lastline=10} +% \begin{docshot} +% \documentclass{article} +% \usepackage{eolang} +% \thispagestyle{empty} +% \begin{document} +% \begin{phiquation*} +% x -> sprintf("Hello, \%s!", name) +% \end{phiquation*} +% \end{document} +% \end{docshot} + % You can make a copy of a vertex together with its kids: % \docshotOptions{firstline=5,lastline=15} % \begin{docshot} @@ -783,7 +796,7 @@ $macro = $ARGV[0]; open(my $fh, '<', $ARGV[1]); my $tex; { local $/; $tex = <$fh>; } -print "% This file is auto-generated by 0.12.1\n"; +print "% This file is auto-generated by 0.12.2\n"; print '% There are ', length($tex), ' chars in the input: ', $ARGV[1], "\n"; print '% ---', "\n"; @@ -796,7 +809,7 @@ foreach my $t (@lines) { print '% ', $t, "\n"; } print '% ---', "\n"; -$tex =~ s/%.*\n/\n/g; +$tex =~ s/(?<!\\)%.*\n/\n/g; $tex =~ s/^\s+|\s+$//g; my $splitting = $tex =~ /^\\begin\{split\}/; if ($splitting) { @@ -1111,7 +1124,7 @@ print '\begin{phicture}', "\n"; for (my $c = 0; $c < 0+@cmds; $c++) { my $cmd = $cmds[$c]; $cmd =~ s/^\s+//g; - $cmd =~ s/%.*//g; + $cmd =~ s/(?<!\\)%.*//g; my ($head, $tail) = split(/ /, $cmd, 2); my %opts = {}; foreach my $p (split(/ /, $tail)) { diff --git a/macros/latex/contrib/eolang/eolang.pdf b/macros/latex/contrib/eolang/eolang.pdf Binary files differindex cfd4ffcbfd..79a7500932 100644 --- a/macros/latex/contrib/eolang/eolang.pdf +++ b/macros/latex/contrib/eolang/eolang.pdf |