summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/cryptocode/README.md4
-rw-r--r--macros/latex/contrib/cryptocode/cryptocode.dtx347
-rw-r--r--macros/latex/contrib/cryptocode/cryptocode.ins2
-rw-r--r--macros/latex/contrib/cryptocode/cryptocode.pdfbin1043865 -> 1062027 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx12
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin583341 -> 586691 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex140
7 files changed, 382 insertions, 123 deletions
diff --git a/macros/latex/contrib/cryptocode/README.md b/macros/latex/contrib/cryptocode/README.md
index 44832eada3..88105e4e27 100644
--- a/macros/latex/contrib/cryptocode/README.md
+++ b/macros/latex/contrib/cryptocode/README.md
@@ -25,10 +25,10 @@ Cryptocode supports LaTeX' rollback mechanism. To load a particular version of c
\usepackage[options]{cryptocode}[=2018-11-11]
-Besides the current version 0.40, the following deprecated versions are available via
+Besides the current version 0.44, the following deprecated versions are available via
the rollback mechanism.
-- v0.32 (2020-04-01)
+- v0.32 (2020-04-24)
- v0.30 (2018-11-11)
# Contribution
diff --git a/macros/latex/contrib/cryptocode/cryptocode.dtx b/macros/latex/contrib/cryptocode/cryptocode.dtx
index f2cf2f7a9a..b9a629cd1b 100644
--- a/macros/latex/contrib/cryptocode/cryptocode.dtx
+++ b/macros/latex/contrib/cryptocode/cryptocode.dtx
@@ -3,14 +3,14 @@
\NeedsTeXFormat{LaTeX2e}
\DeclareRelease{v0.30}{2018-11-11}{cryptocode-2018-11-11.sty}
\DeclareRelease{v0.32}{2020-04-24}{cryptocode-2020-04-24.sty}
-\DeclareCurrentRelease{v0.40}{2020-07-10}
+\DeclareCurrentRelease{v0.44}{2021-08-15}
\ProvidesPackage{cryptocode}
- [2020/07/10 v0.40 Cryptocode LaTeX package for typesetting pseudocode, algorithms and protocols as well as cryptographic proofs.]
+ [2021/08/15 v0.44 Cryptocode LaTeX package for typesetting pseudocode, algorithms and protocols as well as cryptographic proofs.]
%</package>
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
-% Copyright (C) 2020 Arno Mittelbach, all rights reserved.
+% Copyright (C) 2021 Arno Mittelbach, all rights reserved.
% \fi
% \iffalse
%<*driver>
@@ -96,7 +96,7 @@
tabsize=2, % sets default tabsize to 2 spaces
title=\lstname }
- \CodelineIndex
+\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
@@ -141,40 +141,49 @@
% \changes{v0.32}{2020/01/11}{allow to control spacing with \textbackslash{}pcfor}
% \changes{v0.32}{2020/01/11}{allow overwriting rule command in pseudocode via headlinecmd (defaults to \textbackslash{}hrule)}
%
-% \changes{v0.40}{2020/06/20}{Bigger refactoring. Not completely backwards compatible. In particular, optimized spacing of pseudocode blocks and black box reductions.}
-% \changes{v0.40}{2020/06/20}{Switched to mathtools \emph{DeclarePairedDelimiter} for paired operators.
+% \changes{v0.40}{2020/07/10}{Bigger refactoring. Not completely backwards compatible. In particular, optimized spacing of pseudocode blocks and black box reductions.}
+% \changes{v0.40}{2020/07/10}{Switched to mathtools \emph{DeclarePairedDelimiter} for paired operators.
% Each paired operator comes in two forms, e.g, \emph{abs} and \emph{tabs} the latter to be used in flowtext
% which does not scale the outer delimiters.}
-% \changes{v0.40}{2020/06/20}{Adjusted spacing via \textbackslash{}pcaboveskip and \textbackslash{}pcbelowskip which are
+% \changes{v0.40}{2020/07/10}{Adjusted spacing via \textbackslash{}pcaboveskip and \textbackslash{}pcbelowskip which are
% added to \textbackslash{}pseudocode blocks and \emph{pchstack} environments}
-% \changes{v0.40}{2020/06/20}{Added block forms for pseudocode and procedure commands (\textbackslash{}pseudocodeblock and \textbackslash{}procedureblock).}
-% \changes{v0.40}{2020/06/20}{Added minlineheight option to \textbackslash{}pseudocode.}
-% \changes{v0.40}{2020/06/20}{Added headheight option to \textbackslash{}pseudocode.}
-% \changes{v0.40}{2020/06/20}{Added \textbackslash{}argmax and \textbackslash{}argmin to operators.}
-% \changes{v0.40}{2020/06/20}{Added \textbackslash{}pindist, \textbackslash{}sindist, and \textbackslash{}cindist to operators.}
-% \changes{v0.40}{2020/06/20}{Added aboveskip and belowskip option to \textbackslash{}pchstack and \textbackslash{}pcvstack.}
-% \changes{v0.40}{2020/06/20}{Added boxed, inline, noindent options to \textbackslash{}pchstack and \textbackslash{}pcvstack.}
-% \changes{v0.40}{2020/06/20}{Added space option to \textbackslash{}pchstack and \textbackslash{}pcvstack.}
-% \changes{v0.40}{2020/06/20}{Renamed horizontal spacing commands \textbackslash{}beforepcskip and \textbackslash{}afterpcskip to \textbackslash{}pcbeforeskip and \textbackslash{}pcafterskip.}
-% \changes{v0.40}{2020/06/20}{Added command \textbackslash{}pcsetargs to define default arguments for pseudocode blocks.}
-% \changes{v0.40}{2020/06/20}{Added command \textbackslash{}pcsethstackargs and \textbackslash{}pcsetvstackargs to define default arguments for hstack and vstack environments.}
-% \changes{v0.40}{2020/06/20}{Adapted bbrenv environment to take key value option list. Old format is still supported but deprecated.}
-% \changes{v0.40}{2020/06/20}{Added additional polynomials.}
-% \changes{v0.40}{2020/06/20}{Added additional adversaries.}
-% \changes{v0.40}{2020/06/20}{Added additional complexity classes.}
-% \changes{v0.40}{2020/06/20}{Added oracles package option.}
-% \changes{v0.40}{2020/06/20}{Fixed spacing issues with black box reduction messages.}
-% \changes{v0.40}{2017/10/02}{Added clockwise, leftstyle, centerstyle, rightstyle for bbrloop. Adjusted placing of center.}
-% \changes{v0.40}{2017/10/02}{Added fixedoffset, fixedboffset, islast for reduction messages.}
+% \changes{v0.40}{2020/07/10}{Added block forms for pseudocode and procedure commands (\textbackslash{}pseudocodeblock and \textbackslash{}procedureblock).}
+% \changes{v0.40}{2020/07/10}{Added minlineheight option to \textbackslash{}pseudocode.}
+% \changes{v0.40}{2020/07/10}{Added headheight option to \textbackslash{}pseudocode.}
+% \changes{v0.40}{2020/07/10}{Added \textbackslash{}argmax and \textbackslash{}argmin to operators.}
+% \changes{v0.40}{2020/07/10}{Added \textbackslash{}pindist, \textbackslash{}sindist, and \textbackslash{}cindist to operators.}
+% \changes{v0.40}{2020/07/10}{Added aboveskip and belowskip option to \textbackslash{}pchstack and \textbackslash{}pcvstack.}
+% \changes{v0.40}{2020/07/10}{Added boxed, inline, noindent options to \textbackslash{}pchstack and \textbackslash{}pcvstack.}
+% \changes{v0.40}{2020/07/10}{Added space option to \textbackslash{}pchstack and \textbackslash{}pcvstack.}
+% \changes{v0.40}{2020/07/10}{Renamed horizontal spacing commands \textbackslash{}beforepcskip and \textbackslash{}afterpcskip to \textbackslash{}pcbeforeskip and \textbackslash{}pcafterskip.}
+% \changes{v0.40}{2020/07/10}{Added command \textbackslash{}pcsetargs to define default arguments for pseudocode blocks.}
+% \changes{v0.40}{2020/07/10}{Added command \textbackslash{}pcsethstackargs and \textbackslash{}pcsetvstackargs to define default arguments for hstack and vstack environments.}
+% \changes{v0.40}{2020/07/10}{Adapted bbrenv environment to take key value option list. Old format is still supported but deprecated.}
+% \changes{v0.40}{2020/07/10}{Added additional polynomials.}
+% \changes{v0.40}{2020/07/10}{Added additional adversaries.}
+% \changes{v0.40}{2020/07/10}{Added additional complexity classes.}
+% \changes{v0.40}{2020/07/10}{Added oracles package option.}
+% \changes{v0.40}{2020/07/10}{Fixed spacing issues with black box reduction messages.}
+% \changes{v0.40}{2020/07/10}{Added clockwise, leftstyle, centerstyle, rightstyle for bbrloop. Adjusted placing of center.}
+% \changes{v0.40}{2020/07/10}{Added fixedoffset, fixedboffset, islast for reduction messages.}
%
+% \changes{v0.41}{2020/07/13}{Fixed horizontal spacing in bbrenv environment.}
%
+% \changes{v0.42}{2020/10/15}{Added command \textbackslash{}pcassert.}
+% \changes{v0.42}{2020/10/15}{More robust \textbackslash{}sample command that also works in subscripts.}
+%
+% \changes{v0.43}{2021/01/17}{Added support for cleveref via \textbackslash{}pcfixcleveref command.}
+%
+% \changes{v0.44}{2021/08/15}{Removed dependency on deprecated etex package.}
+%
+% \def\cryptocodeversion{v0.44}
%
%
%
% \author{Arno Mittelbach\\
% \texttt{mail@arno-mittelbach.de}\\
% \url{https://github.com/arnomi/cryptocode}\thanks{If you use cryptocode in your work, consider starring the repository on GitHub and/or rating it on CTAN.}}
-% \title{\Huge Cryptocode \\ \large\textsc{Typesetting Cryptography}}
+% \title{\Huge Cryptocode \\ \large\textsc{Typesetting Cryptography} \\ \small{Version \cryptocodeversion}}
%
%
% \maketitle
@@ -1290,7 +1299,7 @@
% \textbf{Command} & \textbf{Description} & \textbf{Result} \\\hline
% |\prover| & Proover & $\prover$ \\
% |\verifier| & Verifier & $\verifier$ \\
-% |\nizk| & Non interactie zero knowledge & $\nizk$ \\
+% |\nizk| & Non interactive zero knowledge & $\nizk$ \\
% |\hash| & A hash function & $\hash$ \\
% |\gash| & A hash function& $\gash$ \\
% |\fash| & A hash function & $\fash$ \\
@@ -2045,6 +2054,7 @@
% \label{sec:syntaxhighlight}
%
% \index{\textbackslash pcabort}
+% \index{\textbackslash pcassert}
% \index{\textbackslash pcfail}
% \index{\textbackslash pccontinue}
% \index{\textbackslash pccomment}
@@ -2079,6 +2089,7 @@
% \begin{tabular}{lll}
% \textbf{command} & \textbf{outcome} \\
% |\pcabort| & \pcabort\\
+% |\pcassert| & \pcassert\\
% |\pccontinue| & \pccontinue \\
% |\pccomment{comment}| & \pccomment{comment} \\
% |\pccomment[2em]{comment}| & \pccomment[2em]{comment} \\
@@ -3227,6 +3238,7 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
% \iffalse
%</example>
% \fi
+% Similarly you can redefine the double tabbing character |\<| by overwriting |\pcdbltabname| (also see Section~\ref{chap:protocols}).
%
% \subsubsection{Custom Line Spacing and Horizontal Rules}
% \index{\textbackslash pclb}
@@ -3566,6 +3578,8 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
% Spacings after the left separator and in front of the right separator can be controlled by
% |\pclnspace| and |\pclnrspace| which are set to 1em and 0.5em, respectively.
%
+% \amipagebreak
+%
% \subsection{Sub Protocols}
%
% Use the |subprocedure| environemnt to also create sub protocols.
@@ -3614,6 +3628,59 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
%</example>
% \fi
%
+% \subsection{Compact Presentation of Protocols}
+%
+% In order to present protocols more compactly you can use the |colspace| option
+% which adds space inbetween two columns. When set to a negative space, this has
+% the effect that columns overlap. The following example is once more our above
+% example using a sub protocol but this time with |colspace=-1cm|. Note that
+% the sub protocol inherits the option which is why both the outer and the inner
+% protocol now have overlapping columns.
+%
+% \procb[colspace=-1cm]{My Protocol}{
+% \textbf{Alice} \< \< \textbf{Bob} \\
+% b \sample \bin \< \< \\
+% \< \sendmessageright*{\text{send over } b} \< \\
+% \< \< \text{do something} \\
+% \<\< \dbox{\begin{subprocedure}\procedure{Subprotocol}{
+% \< \< \textbf{Charlie} \\
+% \text{something more} \< \< \\
+% \< \sendmessageright*[1.5cm]{\text{message}} \< \\
+% \< \< \text{some processing} \\
+% \< \< \text{more processing} \\
+% \< \sendmessageleft*[1.5cm]{\text{message}} \< \\
+% \< \sendmessageright*[1.5cm]{\text{message}} \< \\
+% \< \sendmessageleft*[1.5cm]{\text{message}} \< \\
+% }\end{subprocedure}} \\
+% \< \sendmessageleft*{\text{send over sth. else}} \< \\
+% \text{finalize} \< \< }
+%
+% \iffalse
+%<*example>
+% \fi
+ \begin{lstlisting}
+\procedureblock[colspace=-1cm]{My Protocol}{
+ \textbf{Alice} \< \< \textbf{Bob} \\
+ b \sample \bin \< \< \\
+ \< \sendmessageright*{\text{send over } b} \< \\
+ \< \< \text{do something} \\
+ \<\< \dbox{\begin{subprocedure}\procedure{Subprotocol}{
+ \< \< \textbf{Charlie} \\
+ \text{something more} \< \< \\
+ \< \sendmessageright*[1.5cm]{\text{message}} \< \\
+ \< \< \text{some processing} \\
+ \< \< \text{more processing} \\
+ \< \sendmessageleft*[1.5cm]{\text{message}} \< \\
+ \< \sendmessageright*[1.5cm]{\text{message}} \< \\
+ \< \sendmessageleft*[1.5cm]{\text{message}} \< \\
+ }\end{subprocedure}} \\
+ \< \sendmessageleft*{\text{send over sth. else}} \< \\
+ \text{finalize} \< \< }
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
% \amipagebreak
% \section{Game-Based Proofs}
% \label{chap:gbproofs}
@@ -4149,6 +4216,19 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
% may become necessary when using inputs and outputs). For this provide |aboveskip| and |belowskip| keys.
% (Note that in an earlier version of cryptocode you could write |\begin{bbrenv}[1cm]{A}[1cm]|. While this format
% is still supported it should be regarded deprecated.)
+%
+% \medskip
+% The |bbrenv| environment takes the following options as optional first parameter:
+% \begin{description}
+% \item[aboveskip]
+% Space above.
+% \item[belowskip]
+% Space below.
+% \item[tikzargs]
+% Underneath |bbrenv| is a |tikzpicture| and via |tikzargs| you can pass in arguments.
+% \end{description}
+%
+% \medskip
% The single mandatory argument to the bbrenv environment needs to specify a unique identifier
% (unique for the current reduction). This id is used as an internal TIKZ node name (\url{https://www.ctan.org/pkg/pgf}).
% \iffalse
@@ -4539,15 +4619,55 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
% \fi
%
%
-% \subsubsection{First Message}
+% \subsubsection*{First Message}
% \index{\textbackslash bbrfirstmessageoffset}
% The first message is offset by |\bbrfirstmessageoffset| which defaults to 1ex.
%
+% \subsubsection{Vdots}
+% \index{\textbackslash bbrmsgvdots}
+% \index{\textbackslash bbrqryvdots}
+%
+% You can use |\bbrmsgvdots| and |\bbrqryvdots| to add |\vdots| in between messages or queries.
+%
+% \begin{bbrenv}{A}
+% \begin{bbrbox}[name=A,minheight=14mm]
+% \pseudocode{a}
+% \end{bbrbox}
+% \bbrmsgfrom{top={$a$}}
+% \bbrmsgvdots
+% \bbrmsgfrom{islast=true,bottom={$a$}}
+% \bbrqryto{top=a}
+% \bbrqryvdots
+% \bbrqryto{bottom=a,islast=true}
+% \end{bbrenv}
+%
+%
+% \iffalse
+%<*example>
+% \fi
+ \begin{lstlisting}
+\begin{bbrenv}{A}
+ \begin{bbrbox}[name=A,minheight=14mm]
+ \pseudocode{a}
+ \end{bbrbox}
+ \bbrmsgfrom{top={$a$}}
+ \bbrmsgvdots
+ \bbrmsgfrom{islast=true,bottom={$a$}}
+ \bbrqryto{top=a}
+ \bbrqryvdots%
+ \bbrqryto{bottom=a,islast=true}
+\end{bbrenv}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
% \subsubsection{Add Space}
% \index{\textbackslash bbrmsgspace}
% \index{\textbackslash bbrqryspace}
% If the spacing between messages is not sufficient you can use the |bbrmsgspace| and
-% |bbrqryspace| commands to add additional space.
+% |bbrqryspace| commands to add additional space. Alternatively, you can use the options
+% |aboveskip| and |belowskip| on the individual message or query commands.
%
% \begin{bbrenv}[aboveskip=1cm,belowskip=0.5cm]{A}
% \begin{bbrbox}[name=Reduction]
@@ -5197,6 +5317,68 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
%</example>
% \fi
%
+%
+% \subsection{Horizontal Stacking}
+%
+% |bbrenv| environments can be stacked horizontally.
+%
+%\begin{figure}[h]
+% \centering
+% \begin{bbrenv}{A}
+% \begin{bbrbox}[name=A,minheight=15mm]
+% \pseudocode{a}
+% \end{bbrbox}
+% \bbrmsgfrom{islast=true,top={$a$}}
+% \bbrqryto{aboveskip=6mm,top={$2a$}}
+% \end{bbrenv}\begin{bbrenv}{B}
+% \begin{bbrbox}[name=B,minheight=15mm]%
+% \end{bbrbox}%
+% \bbrqryto{edgestyle={<->}}%
+% \bbrqryvdots[aboveskip=1mm]%
+% \bbrqryto{islast=true,edgestyle={<->}}%
+% \end{bbrenv}\begin{bbrenv}{C}
+% \begin{bbrbox}[name=C,minheight=15mm]%
+% \end{bbrbox}%
+% \bbrqryto{top={$3a$}}%
+% \end{bbrenv}%
+%\end{figure}
+%
+% Note that in order to not have horizontal space inbetween the boxes, that you
+% need to not leave any space. In the following code this is handled via comments.
+%
+% \iffalse
+%<*example>
+% \fi
+ \begin{lstlisting}
+\begin{figure}[h]
+ \centering
+ \begin{bbrenv}{A}
+ \begin{bbrbox}[name=A,minheight=15mm]
+ \pseudocode{a}
+ \end{bbrbox}
+ \bbrmsgfrom{islast=true,top={$a$}}
+ \bbrqryto{aboveskip=6mm,top={$2a$}}
+ \end{bbrenv}%
+\begin{bbrenv}{B}
+ \begin{bbrbox}[name=B,minheight=15mm]
+ \end{bbrbox}
+ \bbrqryto{edgestyle={<->}}
+ \bbrqryvdots[aboveskip=1mm]
+ \bbrqryto{islast=true,edgestyle={<->}}
+ \end{bbrenv}%
+\begin{bbrenv}{C}
+ \begin{bbrbox}[name=C,minheight=15mm]
+ \end{bbrbox}
+ \bbrqryto{top={$3a$}}
+ \end{bbrenv}%
+\end{figure}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+
+%
+%
% \subsection{Examples}
% A reduction sketch for full domain hash.
%
@@ -5402,9 +5584,28 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
% as this is used by most of the commands in \enquote{sets} and some of the commands in \enquote{probability}.
%
% \subsection{Hyperref}
+% \index{hyperref}
% The hyperref package (\url{https://www.ctan.org/pkg/hyperref}) should be loaded before cryptocode. If this is not possible
% call the |\pcfixhyperref| after |\begin{document}|.
%
+% \subsection{Cleveref}
+% \index{cleveref}
+% In order to support the cleveref package (\url{https://ctan.org/pkg/cleveref}) load cleveref after cryptocode and subsequently
+% (but still in the preamble) call |\pcfixcleveref|.
+%
+% \subsection{Babel - Spanish}
+% The spanish version of the babel package uses < and > as shorthands which are used by cryptocode as tabbing characters.
+% The easisest workaround is to tell cryptocode to use different tabbing characters, for example:
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\renewcommand{\pctabname}{ctab}
+\renewcommand{\pcdbltabname}{cdtab}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
%
%\StopEventually{%
% \PrintChanges
@@ -5485,7 +5686,18 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
%
% \begin{macrocode}
\DeclareOption{operators}{
-\providecommand{\sample}{\hskip2.3pt{\gets\!\!\mbox{\scriptsize${\$}$\normalsize}}\,}
+% \end{macrocode}
+%
+% Robust sample operator that also works in subscripts. Is based on
+% egreg's solution given in \url{https://tex.stackexchange.com/questions/418740/how-to-write-left-arrow-with-a-dollar-sign}.
+% \begin{macrocode}
+\providecommand\sample{\leftarrow\mathrel{\mkern-2.0mu}\pc@smalldollar}
+\newcommand{\pc@smalldollar}{\mathrel{\mathpalette\pc@small@dollar\relax}}
+\newcommand{\pc@small@dollar}[2]{%
+ \vcenter{\hbox{%
+ $#1\textnormal{\fontsize{0.7\dimexpr\f@size pt}{0}\selectfont\$\hskip-0.05em plus 0.5em}$%
+ }}%
+}
\DeclarePairedDelimiter\pc@floor{\lfloor}{\rfloor}
\providecommand{\floor}[1]{\pc@floor*{#1}}
@@ -6391,7 +6603,7 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
%
% Note that amsmath and mathtools have been loaded already earlier.
% \begin{macrocode}
-\RequirePackage{etex}
+
\if@pc@opt@amsfonts
\RequirePackage{amsfonts}
\fi
@@ -6574,6 +6786,7 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
%\begin{macro}{\pcparse}
%\begin{macro}{\pcfail}
%\begin{macro}{\pcabort}
+%\begin{macro}{\pcassert}
% All predefined (highlightable) keywords.
% \begin{macrocode}
\newcommand{\pcglobvar}{\highlightkeyword{gbl}}
@@ -6609,6 +6822,7 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
\newcommand{\pcparse}{\highlightkeyword{parse}}
\newcommand{\pcfail}{\highlightkeyword{fail}}
\newcommand{\pcabort}{\highlightkeyword{abort}}
+\newcommand{\pcassert}{\highlightkeyword{assert}}
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -6639,6 +6853,7 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
%
% \subsubsection{Misc}
%
@@ -6784,6 +6999,18 @@ for,foreach,{return },return,{ do },{ in },new,if, null, true,{until },{ to }, f
% \end{macrocode}
%
%
+% Allow to support cleveref package. It wants to be loaded after amsmath which is why it needs to be loaded after cryptocode.
+% To do the necessary label fixes, we need to run these after its label fixes at begin document.
+% \begin{macrocode}
+\providecommand{\pcfixcleveref}{
+\AtBeginDocument{%
+\pcfixhyperref%
+\makeatletter%
+\crefformat{@pclinenumber}{line~##2##1##3}%
+\crefrangeformat{@pclinenumber}{lines~##3##1##4 to~##5##2##6}%
+\makeatother%
+}}
+% \end{macrocode}
%
%
%
@@ -8323,8 +8550,20 @@ $\begin{aligned}#2\end{aligned}$%
%\end{macro}
%
%
+%\begin{macro}{tikzargs}
+%\begin{macro}{\bbrtikzargs}
+% Allow passing in arguments to |tikzpicture|.
+% \begin{macrocode}
+\newcommand*\bbrtikzargs{}
+\define@key{pcbbrenv}{tikzargs}[]{\renewcommand*\bbrtikzargs{#1}}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%
%
%\begin{environment}{bbrenv}
+% \changes{v0.41}{2020/07/13}{Fixed horizontal spacing behind bbrenv blocks.}
+% \changes{v0.41}{2020/07/13}{Added tikzargs key to pass in arguments to surrounding tikzpicture.}
% Black Box Reduction Environment
% \begin{macrocode}
\newenvironmentx{bbrenv}[3][1={aboveskip=0pt,belowskip=0pt},3=0pt]{%
@@ -8349,7 +8588,7 @@ $\begin{aligned}#2\end{aligned}$%
\vspace{\@pc@bbrenvaboveskip}%
\ifthenelse{\value{@bb@env@nestcnt}=1}
{\@pc@ensureremember%
-\begin{tikzpicture}
+\begin{tikzpicture}[baseline=0pt,\bbrtikzargs]
}{\tikz\bgroup}
}{%
\ifthenelse{\value{@bb@env@nestcnt}=1}
@@ -8382,10 +8621,10 @@ $\begin{aligned}#2\end{aligned}$%
\newcommand*\@bbrboxnameposoffset{below left=\bbrboxabovesep of phantomname.south west}
\newcommand*\bbrboxstyle{draw}
\newcommand*\bbrboxafterskip{}
-\newcommand*\bbrboxminheight{0cm}
+\newcommand*\bbrboxminheight{0pt}
\newcommand*\bbrboxminwidth{2cm}
-\newcommand*\bbrboxxshift{0cm}
-\newcommand*\bbrboxyshift{0cm}
+\newcommand*\bbrboxxshift{0pt}
+\newcommand*\bbrboxyshift{0pt}
\define@key{bbrbox}{abovesep}[]{\renewcommand*\bbrboxabovesep{#1}}
\define@key{bbrbox}{name}[]{\renewcommand*\bbrboxname{#1}}
\define@key{bbrbox}{namestyle}[]{\renewcommand*\bbrboxnamestyle{#1}}
@@ -8422,8 +8661,12 @@ $\begin{aligned}#2\end{aligned}$%
\tikzset{BBRBOXNAMESTYLE/.style/.expand once=\bbrboxnamestyle}%
\tikzset{BBRBOXNAMEPOSOFFSET/.style/.expand once=\@bbrboxnameposoffset}%
+\ifthenelse{\equal{\bbrboxxshift}{} \OR \equal{\bbrboxxshift}{0pt}}{
\coordinate[inner sep=0pt,outer sep=0pt] (\@bb@lastbox-tmpouter) {};
-\node at (\@bb@lastbox-tmpouter) {}; %this empty node seems needed to get the xyshift right.
+}{
+\node[inner sep=0pt, outer sep=0pt] (\@bb@lastbox-tmpouter) {}; %this empty node seems needed to get the xyshift right.
+}
+
\node[inner sep=.3333em,anchor=north,BBRBOXSTYLE,minimum height=\bbrboxminheight,below right=\bbrboxyshift and \bbrboxxshift of \@bb@lastbox-tmpouter] (\@bb@lastbox) \bgroup
\tikz{
\node[inner sep=0pt,outer sep=0pt,minimum height=0cm] (phantomname) {}; %minimum width
@@ -8766,11 +9009,20 @@ $\begin{aligned}#2\end{aligned}$%
% from bottom
\ifthenelse{\equal{#4}{north east}}{\def\@bbr@tmp@bottomanchor{south east}}{}
\ifthenelse{\equal{#4}{north west}}{\def\@bbr@tmp@bottomanchor{south west}}{}
- \node[#3=-\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.\@bbr@tmp@bottomanchor,anchor=#6,BBRCOM-SIDESTYLE] (\@bbrcomsidename) {\@bbrcomside};
+
+ \ifdefempty{\@bbrcomside}{
+ \coordinate[#3=-\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.\@bbr@tmp@bottomanchor] (\@bbrcomsidename);
+ }{
+ \node[#3=-\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.\@bbr@tmp@bottomanchor,anchor=#6,BBRCOM-SIDESTYLE] (\@bbrcomsidename) {\@bbrcomside};
+ }
}
{
% from top
- \node[#3=\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.#4,anchor=#6,BBRCOM-SIDESTYLE] (\@bbrcomsidename) {\@bbrcomside};
+ \ifdefempty{\@bbrcomside}{
+ \coordinate[#3=\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.#4] (\@bbrcomsidename);
+ }{
+ \node[#3=\@bb@com@tmpoffset and \@bbrcomlength of \@bb@lastbox.#4,anchor=#6,BBRCOM-SIDESTYLE] (\@bbrcomsidename) {\@bbrcomside};
+ }
}
\path[#2] (\@bbrcomsidename.#6) edge[BBRCOM-EDGESTYLE] node[above,BBRCOM-TOPSTYLE] (\@bbrcomtopname) {\@bbrcomtop} node[below,BBRCOM-BOTTOMSTYLE] (\@bbrcombottomname) {\@bbrcombottom} (\@bb@lastbox.#5|-\@bbrcomsidename) -- (\@bb@lastbox.#5|-\@bbrcomsidename) node[inner sep=0pt,outer sep=0pt,BBRCOM-OSIDESTYLE] (\@bbrcomosidename) {};
%
@@ -8816,13 +9068,15 @@ $\begin{aligned}#2\end{aligned}$%
%
%\begin{macro}{\bbrmsgvdots}
% \begin{macrocode}
-\newcommandx{\bbrmsgvdots}{%
- \bbrmsgtxt[xshift=\@bbrcomlength/2,afterskip=\@bbr@intermessage@skip]{$\vdots$}
+\newcommand{\bbrmsgvdots}[1][]{%
+ \bbrmsgtxt[xshift=\@bbrcomlength/2,afterskip=\@bbr@intermessage@shortskip,#1]{$\vdots$}
}
% \end{macrocode}
%\end{macro}
%
%
+%
+%
%\begin{macro}{\bbrqryto}
%\begin{macro}{\bbrqryfrom}
%\begin{macro}{\bbrqrytofrom}
@@ -8857,6 +9111,14 @@ $\begin{aligned}#2\end{aligned}$%
%\end{macro}
%
%
+%\begin{macro}{\bbrqryvdots}
+% \changes{v0.41}{2020/07/13}{Added bbrqryvdots.}
+% \begin{macrocode}
+\newcommand{\bbrqryvdots}[1][]{%
+ \bbrqrytxt[xshift=\@bbrcomlength/2,afterskip=\@bbr@intermessage@skip,#1]{$\vdots$}
+}
+% \end{macrocode}
+%\end{macro}
%
%\begin{macro}{\@bbroracleqry}
% \begin{macrocode}
@@ -9385,8 +9647,9 @@ $\begin{aligned}#2\end{aligned}$%
% \end{macrocode}
%
%
-%
+% \iffalse
% \begin{macrocode}
+% \fi
%</cryptocode.sty>
% \end{macrocode}
%\Finale \ No newline at end of file
diff --git a/macros/latex/contrib/cryptocode/cryptocode.ins b/macros/latex/contrib/cryptocode/cryptocode.ins
index 381b5eebb3..a9ebfb617e 100644
--- a/macros/latex/contrib/cryptocode/cryptocode.ins
+++ b/macros/latex/contrib/cryptocode/cryptocode.ins
@@ -4,7 +4,7 @@
\preamble
cryptocode.dtx
- Copyright 2020 Mittelbach, Arno
+ Copyright 2021 Mittelbach, Arno
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/cryptocode/cryptocode.pdf b/macros/latex/contrib/cryptocode/cryptocode.pdf
index b84314ac25..47fc600368 100644
--- a/macros/latex/contrib/cryptocode/cryptocode.pdf
+++ b/macros/latex/contrib/cryptocode/cryptocode.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 970c1d7f52..3672b124b9 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/08/13}{1.28o}
+\ProvidesExplClass{easybook}{2021/08/15}{1.28p}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -299,7 +299,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/08/13}{1.28o}
+\ProvidesExplPackage{easybase}{2021/08/15}{1.28p}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_add:Nn { NV,Nv }
@@ -2403,7 +2403,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/08/13}{1.28o}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/08/15}{1.28p}
{Customization of tcolorbox for easybook}
\tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip }
@@ -2522,9 +2522,9 @@
\NewDocumentEnvironment{outline}{O{}D(){\abstractname}o+b}
{
\begin{eb@tc@outline@box}{#2}{IfValueT = {#3}{#3}}
- \begin{eb@outline@list}[#1]
- #4
- \end{eb@outline@list}
+ \begin{eb@outline@list}[#1]
+ #4
+ \end{eb@outline@list}
\end{eb@tc@outline@box}
}{}
\NewDocumentEnvironment{exercise}{st+od()O{}+b}
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index aa74f48edc..f18fa673d2 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index 7ac6054a8a..7d57ff11e8 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -9,25 +9,22 @@
\colorlet{cnltxred}{violet}
\setcnltx
{
- name = easybook,
- title = EASYBOOK 使用手册,
- version = v1.28o,
- date = 2021/08/13,
- authors = 瞿毅,
- info = 排版简体中文学位论文和书籍,
- email = quee123@foxmail.com,
- url = https://gitee.com/texl3/easybook,
- abstract =
+ name = easybook,
+ color-scheme = blue,
+ title = EASYBOOK 使用手册,
+ version = v1.28p,
+ date = 2021/08/15,
+ authors = 瞿毅,
+ info = 排版简体中文学位论文和书籍,
+ email = quee123@foxmail.com,
+ url = https://gitee.com/texl3/easybook,
+ abstract =
{
\cls*{easybook} 是基于 \cls*{ctexbook} 书籍文档类创建以极简为风格的模板,同时兼具 \cls*{book} 与 \cls*{article} 文档类的用途,它的基础宏包 \pkg*{easybase} 还可以搭配 C\TeX 和标准文档类使用。\cls*{easybook} 考虑了一些细节并载入一些几乎必备的宏包进行包装和改进,提供多个命令和接口可以使用户简便地进行设置。它适用于排版中英文学位论文、学术书籍或者是笔记。
},
- code-only,
- arg-format = \normalfont\small\itshape,
- abstract-format = \small,
- color-scheme = blue,
- title-format = \huge\sffamily,
- add-frame-options = {innerleftmargin = 2em},
- listings-options = {numbers = none}
+ arg-format = \normalfont\small\itshape,
+ abstract-format = \small,
+ title-format = \huge\sffamily
}
\KOMAoptions{headsepline = 0.6pt,numbers = {noenddot}}
\setfootnoterule[0.6pt]{0.4\columnwidth}
@@ -46,7 +43,7 @@
\ExplSyntaxOn\makeatletter
\NewDocumentCommand{\passto}{smm}
{\IfBooleanF{#1}{\color{cnltxblue}}#3\ifblank{#2}{}{\ttfamily[#2]}}
-\newcommand{\splitmeta}[2][\texttt{,}]
+\newcommand{\splitmeta}[2][\code{,}]
{
\clist_clear:N \l_tmpa_clist
\clist_map_inline:nn {#2}
@@ -69,7 +66,7 @@
\newsplitarg{\splitoarg}{[}{]}
\newsplitarg{\splitdarg}{(}{)}
\newsplitarg{\splitmarg}{\{}{\}}
-\newcommand{\spemmeta}{\splitmeta[\texttt{!}]}
+\newcommand{\spemmeta}{\splitmeta[\code{!}]}
\newsplitarg[\spemmeta]{\spemcoarg}{[}{]}
\renewcommand{\cnltx@package@abstract@width}{0.85\linewidth}
\newcommand{\noitemsep}{\setlength{\itemsep}{0ex}}
@@ -244,7 +241,7 @@
\command{cleardoublepage}[\oarg{页面风格}]\Default{empty}
清双页命令可以确保下一页文本总在奇数页开始,在奇数页使用它会产生空白偶数页。文区命令 \cs{frontmatter} 和 \cs{mainmatter} 会用到清双页命令,在启用文类选项 \option*{openright} 时标题命令 \cs*{part} 和 \cs*{chapter} 也会用到清双页命令。
\command{blankpagestyle}[\marg{页面风格}]
- 多出空白页的默认页面风格用空白页面风格命令 \cs{blankpagestyle} 全局指定,或使用可选参数局部指定。默认的风格为 \code{empty},即空的页眉页脚。
+ 多出空白页的 \meta{页面风格} 用空白页面风格命令 \cs{blankpagestyle} 全局指定,或使用清双页命令的可选参数局部指定。空白页默认的风格为 \code{empty},即空的页眉页脚。
\end{commands}
\subsection{目录命令}
@@ -289,7 +286,7 @@
\code{subsection} 小节级别的双语目录标题命令,具有独立的 \code{bisubsection} 计数器。
\end{commands}
-它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \cs*{chapter}\sarg{} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。默认情况下双语目录的格式是一致的,共享使用 \module*{tocset} 的设置,英文目录的章级别标题名及编号的修改方式如下:
+它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \cs*{chapter}\sarg{} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。默认情况下双语目录的格式是一致的,共享使用 \module*{tocset} 模块的设置,英文目录的章级别标题名及编号的修改方式如下:
\begin{options}
\kvsplit{biname}{英文目录前名字,英文目录后名字}\Module{chapter}\Default{Chapter\cs*{space}}
更改英文目录 \code{chapter} 级别的标题编号前后名字,类似 C\TeX 的 \option*{name} 选项。
@@ -370,7 +367,7 @@
统一调整页眉、定理盒子以及代码框等线条的粗细。
\keybool{uppercase}\Default{true}
使用 \cs*{rightmark} 及 \cs*{leftmark} 标题标记命令获取标题内容时英文是否大写。
- \kvsplit*{figurepath}{\meta{路径名1}\code{\}}\code{\{}\meta{路径名2}}\Default
+ \kvsplit*{figurepath}{\meta{路径名1}\code{\}\{}\meta{路径名2}}\Default
设置插入图片的文件夹路径名,可以有多个路径名,每个路径包含在括号分隔,只有一个路径时需要包含在两层括号内。
\end{options}
@@ -517,27 +514,28 @@
\subsection{定理样式}
\label{subsec:theorem of style}
+文档类已预置 8 个定理环境,环境名及对应的定理标题见小节 \ref{subsec:theorem},它们均使用预置的定理样式 \code{easy-theorem}。下面 \module*{thmset} 模块的选项仅对这个定理样式生效,由 \pkg*{thmtools} 宏包提供支持。
\begin{options}
\keybool{thmbox}\Module{thmset}\Default{false}
开启定理环境盒子的边框,需载入 \pkg*{tcolorbox} 宏包才生效。这个选项与 \pkg*{thmtools} 中并不一致,\pkg*{thmtools} 的同名选项包括 \code{L}、\code{M} 和 \code{S} 三个参数。
\keychoice{within}{chapter,section,其它环境,空置}\Default{chapter}
定理编号跟随的计数器,默认跟随章的编号,也可以跟随其它定理环境的编号,当计数器增加时定理编号会从零开始,空置时不跟随其它计数器编号。
- \keyval-{headpunct}{字体命令}\Default{false}
- 定理标题末尾后的标记,在换行符或与第一段内容的间隔之前。
- \keyval-{bodyfont}{字体命令}\Default{chapter}
+ \keyval-{headpunct}{代码}\Default
+ 紧随定理标题末尾的标记代码,位于定理第一段内容的间距 \option{postheadspace} 之前,可以是字符或插入换行符 \cs*{newline} 等命令。
+ \keyval-{bodyfont}{字体命令}\Default
定理内容部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。
\keyval-{notefont}{字体命令}\Default
定理题注部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。
- \keyval-{headfont}{字体命令}\Default
+ \keyval-{headfont}{字体命令}\Default{\cs*{color}\Marg{ctex@emph}\cs*{sffamily}}
定理标题部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。
\keyval-{headindent}{刚性长度}\Default{0em}
定理标题的缩进,默认无缩进,可用 \cs*{parindent} 命令设置为段落缩进。
\keyval-{spaceabove}{弹性长度}\Default{0.75ex plus .1ex}
- 定理环境前的间距,使用 \pkg*{tcolorbox} 的环境包装后被覆盖。
+ 定理环境前的间距,使用 \pkg*{tcolorbox} 的盒子环境包装后被覆盖。
\keyval-{spacebelow}{弹性长度}\Default{0.75ex plus .1ex}
- 定理环境后的间距,使用 \pkg*{tcolorbox} 的环境包装后被覆盖。
- \keyval-{spacepost}{刚性长度}\Default{1em}
- 定理标题后与第一段内容的间距。
+ 定理环境后的间距,使用 \pkg*{tcolorbox} 的盒子环境包装后被覆盖。
+ \keyval-{postheadspace}{刚性长度}\Default{1em}
+ 定理标题后与定理第一段内容的间距。
\keyval-{headformat}{标题格式}\Default{\cs*{NAME}\cs*{space}\cs*{NUMBER}\cs*{NOTE}}
定理开头部分各组成元素的排列和格式,这个选项一般不需要使用,其中 \cs*{NAME}、\cs*{NUMBER} 和 \cs*{NOTE} 分别代表标题、编号和题注。
\kvsplit{brackets}{左括号,右括号}\Default{\Marg{(,)}}
@@ -545,56 +543,55 @@
\end{options}
\subsubsection{新建定理样式}
-文档类已预置 8 个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这三个命令,由 \pkg*{thmtools} 提供支持。
\begin{commands}
- \command{declaretheorem}[\oarg{键值列表1}\marg{定理环境名}\oarg{键值列表2}]
- 声明新的定理环境命令,\cs{newtheorem} 命令与它等效。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与它们的同名命令一致。\meta{键值列表} 中常用的选项如下:
+ \command{declaretheorem}[\oarg{键值列表1}\marg{定理环境}\oarg{键值列表2}]
+ 声明新的定理环境命令,\cs{newtheorem} 命令与它等效。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与它们的同名命令一致。键值列表中常用的选项如下:
\begin{options}
- \keyval*-{name}{定理环境标题}\Default
+ \keyval*-{name}{定理标题}
定理标题的默认值是环境的名称,并且首字母大写(英文标题)。
- \keychoice*{numbered}{no,yes,unless unique}\Default
+ \keychoice*{numbered}{no,yes,unless unique}\Default{yes}
定理可以被编号、不被编号或者只有在文档中多次出现时才被编号。
- \keyval*-{numberlike}{定理环境名}\Default
- 定理将使用此计数器进行编号,通常这是另一个定理环境的名称。
- \keyval*-{style}{定理样式名}\Default
- 选项的值为 \cs{declaretheoremstyle} 新定义的 \meta{定理样式名} 或预置的 \code{easy-theorem} 定理样式,定理将使用这种样式的设置。
+ \keyval*-{numberlike}{计数器}\Default
+ 定理将使用此 \meta{计数器} 进行编号,通常这是另一个定理环境的名称。
+ \keyval*-{style}{定理样式}\Default
+ 选项的值为使用 \cs{declaretheoremstyle} 命令新定义的定理样式。
\end{options}
\command{DeclareTheorem}[\marg{环境名}\oarg{英文标题}\marg{中文标题}\darg{盒子风格}\oarg{键值列表}]
- 定理声明命令 \cs{DeclareTheorem} 更加便捷,它定义一个新的定理环境,与 \cs{declaretheorem} 命令 \meta{键值列表} 支持相同的选项,但它们的区别有:
+ 定理声明命令 \cs{DeclareTheorem} 更加便捷,同样定义一个新的定理环境,与 \cs{declaretheorem} 命令的键值列表支持相同的选项,但它们的区别有:
\begin{itemize}
\item 中英文模式下标题不同,英文标题为可选项,默认为首字母大写的 \meta{环境名}。
\item 自动定义交叉引用的格式,引用标签前缀为定理标题名称。
\item 定理盒子选项 \keyis-{thmbox}{true} 仍然生效,此时 \meta{盒子风格} 为定理盒子风格的名称,它需要由新建盒子风格命令 \cs{newtcbstyle} 定义,默认为 \code{tc-theorem}。
- \item 默认使用 \code{easy-theorem} 定理样式,可在最后一个选项使用 \option*{style} 更改样式。
+ \item 新建定理环境默认使用的 \meta{定理样式} 为 \code{easy-theorem},而不是 \pkg*{thmtools} 默认样式。
\end{itemize}
- \command{declaretheoremstyle}[\oarg{键值列表1}\marg{定理样式名}\oarg{键值列表2}]
- 定义新的定理样式,\meta{键值列表} 中包括上述定理样式以及 \cs{declaretheorem} 的所有选项。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与它们的同名命令一致。
-\end{commands}
+ \command{declaretheoremstyle}[\oarg{键值列表1}\marg{定理样式}\oarg{键值列表2}]
+ 声明新的定理样式命令,键值列表支持上述 \module*{thmset} 模块中以及 \cs{declaretheorem} 的所有选项。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与它们的同名命令一致。
-下面简单列举定理命令的用法,预置定理的样式为 \code{easy-theorem},上述定理样式选项将仅对这个定理样式生效。如果使用这个样式增加新的定理环境可以这样:
-\begin{ctexexam}
- \DeclareTheorem{定理环境名}{中文标题}[style = easy-theorem]
- \declaretheorem[style = easy-theorem,name = 定理名]{定理环境名}
-\end{ctexexam}
+ 下面简单列举几个定理命令的用法,例如使用预置样式新建一个定理环境猜想:
+ \begin{ctexexam}
+ \DeclareTheorem{caixiang}{猜想}[style = easy-theorem] % 不需要指定预置样式
+ \declaretheorem[style = easy-theorem,name = 猜想]{caixiang}
+ \end{ctexexam}
-命令 \cs{declaretheorem} 定义的定理环境需要手动增加盒子边框:
-\begin{ctexexam}
- \tcolorboxenvironment{定理环境名}{tc-theorem}
-\end{ctexexam}
+ 命令 \cs{declaretheorem} 定义的定理环境需要手动增加盒子边框:
+ \begin{ctexexam}
+ \tcolorboxenvironment{caixiang}{tc-theorem}
+ \end{ctexexam}
-使用 \cs{addtcbstyle} 命令调整开启定理盒子时默认的样式,第一个参数为 \code{theorem},关于命令的介绍在小节 \ref{subsec:box}。
-\begin{ctexexam}
+ 使用 \cs{addtcbstyle} 命令调整开启定理盒子时默认的样式,第一个参数为 \code{theorem},关于命令的介绍在小节 \ref{subsec:box}。
+ \begin{ctexexam}
\addtcbstyle{theorem}{colback = GreenYellow}
-\end{ctexexam}
+ \end{ctexexam}
-定义一个新的定理样式可用于 \cs{declaretheorem} 的 \option*{style} 选项:
-\begin{ctexexam}
- \declaretheoremstyle[bodyfont = \rmfamily,spacepost = 0.5em]{定理样式名}
-\end{ctexexam}
+ 定义一个名为 \code{mythm} 的定理样式用于 \cs{declaretheorem} 的 \option*{style} 选项:
+ \begin{ctexexam}
+ \declaretheoremstyle[bodyfont = \rmfamily,spacepost = 0.5em]{mythm}
+ \end{ctexexam}
+\end{commands}
\subsection{页面尺寸}
\label{subsec:page margins}
-预置的页面尺寸与 \cls*{Word} 的默认值接近,\module*{geoset} 会将前两个之外的选项交给 \pkg*{geometry} 宏包接口命令 \cs*{geometry} 处理,并且 \meta{键值列表} 的选项与之相同,下面的选项仅是一小部分,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \option{paper} 选项的设置。
+预置的页面尺寸与 \cls*{Word} 的默认值接近,模块 \module*{geoset} 会将前两个之外的选项交给 \pkg*{geometry} 宏包接口命令 \cs*{geometry} 处理,并且 \meta{键值列表} 的选项与之相同,下面的选项仅是一小部分,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \option{paper} 选项的设置。
\begin{options}\noitemsep
\keyval-{headruleskip}{页眉线间距}\Module{geoset}\Default*
\keyval-{footruleskip}{页脚线间距}\Default*
@@ -959,10 +956,10 @@
\label{subsec:box}
使用盒子以及小节 \ref{subsec:exercise} 中的 \env{exercise} 环境需要在导言区\textbf{手动载入} \pkg*{tcolorbox} 宏包,它们 \meta{配置选项} 的键值列表同样由 \pkg*{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖预设。
\begin{commands}
- \command{newtcbstyle}[\marg{风格名称}\marg{键值列表}]
- 新建或重置一个名为 \code{tc-}\meta{风格名称} 的 \pkg*{tcolorbox} 宏包盒子风格,可以与 \cs{addtcbstyle} 命令联用。
- \command{addtcbstyle}[\marg{风格名称}\marg{键值列表}]
- 修改已存在的 \pkg*{tcolorbox} 宏包盒子风格。这个命令可以调整以下即将介绍的预置盒子风格,对于预置盒子来说参数 \meta{风格名称} 即为它们对应的环境或命令名。
+ \command{newtcbstyle}[\marg{盒子风格}\marg{键值列表}]
+ 新建或重置一个名为 \code{tc-}\meta{盒子风格} 的 \pkg*{tcolorbox} 宏包盒子风格,可以与 \cs{addtcbstyle} 命令联用。
+ \command{addtcbstyle}[\marg{盒子风格}\marg{键值列表}]
+ 修改已存在的 \pkg*{tcolorbox} 宏包盒子风格。这个命令可以调整以下即将介绍的预置盒子风格,对于预置盒子来说参数 \meta{盒子风格} 即为它们对应的环境或命令名。
\begin{ctexexam}
\newtcbstyle{mytcb} % 新建一个盒子风格tc-mytcb
{
@@ -1053,8 +1050,7 @@
在一定的场合下可能用到 \cs{UseCounter} 命令,比如通过新建快捷命令在一些位置使用定理环境的计数器,使用 \cs{labelformat} 设置计数器的引用标签需添加 \code{eb@}:
\begin{ctexexam}
\labelformat{eb@theorem}{定理 #1}
- \newcommand{\theoremhead}[1]
- {定理 \UseCounter[chapter]{theorem}{\hspace{1em}#1}}
+ \newcommand{\theoremhead}[1]{定理 \UseCounter[chapter]{theorem}{\hspace{1em}#1}}
\theoremhead{定理标题}\label{thm:theorem}
\end{ctexexam}
\end{commands}
@@ -1177,7 +1173,7 @@
\appendix
\section{依赖的宏包}
-以下为 \pkg*{easybase} 直接调用的关键宏包,方括号内为宏包已使用的选项。蓝色的宏包表示截至当前在 \TeX Live 2021 中存在更新,旧版本并不影响使用。带有 \ding{81} 符号的宏包并未载入它们,仅做了一些预配置,可在导言区手动载入以实现相关的功能。
+以下为 \pkg*{easybase} 直接调用的关键宏包,方括号内为宏包已使用的选项。蓝色的宏包表示截至当前在 \TeX Live 2021 中存在更新,旧版本并不影响使用。带有 \ding{72} 符号的宏包并未载入它们,仅做了一些预配置,可在导言区手动载入以实现相关的功能。
\begin{description}[font = \normalfont\sffamily]
\item[amsmath] 提供 \LaTeX 中的数学功能。
\item[\passto{heading}{ctex}] 提供中文排版的通用框架。
@@ -1201,11 +1197,11 @@
\item[titletoc] 设置目录中的标题格式。
\item[\passto*{normalem}{ulem}] 提供可断行多样式的下划线命令。
\item[\passto*{svgnames}{xcolor}] 提供任意颜色的设定与混合。
- \item[\ding{81} \passto{list = off}{bicaption}] 提供图表的双语题注。
- \item[\ding{81} imakeidx] 可以让文档同时生成和排版一个或多个索引。
- \item[\ding{81} mathtools] 增强 \pkg*{amsmath} 的数学功能。
- \item[\color{cnltxblue}\ding{81} \passto{many}{tcolorbox}] 为带有标题线的彩色和带框文本框提供了一个环境。
- \item[\ding{81} unicode-math] 处理使用 \code{unicode} 编码的数学字体。
+ \item[\ding{72} \passto{list = off}{bicaption}] 提供图表的双语题注。
+ \item[\ding{72} imakeidx] 可以让文档同时生成和排版一个或多个索引。
+ \item[\ding{72} mathtools] 增强 \pkg*{amsmath} 的数学功能。
+ \item[\color{cnltxblue}\ding{72} \passto{many}{tcolorbox}] 为带有标题线的彩色和带框文本框提供了一个环境。
+ \item[\ding{72} unicode-math] 处理使用 \code{unicode} 编码的数学字体。
\end{description}
\nocite{*}