diff options
author | Norbert Preining <norbert@preining.info> | 2025-02-13 03:04:57 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2025-02-13 03:04:57 +0000 |
commit | ae931350ec33a96091c59e9efd24b8b2b9b1d4dc (patch) | |
tree | 3e0fe048f17f5ac516211e9426bf16920a0f7c14 /macros | |
parent | 87c36a80e61ee474c13f48efca3c2f0ed9bc0df0 (diff) |
CTAN sync 202502130304
Diffstat (limited to 'macros')
58 files changed, 3284 insertions, 3053 deletions
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/README.md b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/README.md index a1e3695e15..d659207e8d 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/README.md +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/README.md @@ -10,13 +10,13 @@ <!-- BADGES --> <p align="center"> <a href="https://ctan.org/pkg/beamertheme-gotham"><img src="https://img.shields.io/ctan/v/beamertheme-gotham?logo=LaTeX&logoColor=%23008080&color=%23008080"/></a> - <a href="https://gitlab.com/RomainNOEL/beamertheme-gotham/-/release/"><img src="https://img.shields.io/badge/Latest_Release-v1.2.0-FC6D26?logo=Gitlab&logoColor=%#FC6D26"/></a> + <a href="https://gitlab.com/RomainNOEL/beamertheme-gotham/-/release/"><img src="https://img.shields.io/badge/Latest_Release-v1.2.1-FC6D26?logo=Gitlab&logoColor=%#FC6D26"/></a> <a href="https://gitlab.com/RomainNOEL/beamertheme-gotham/-/pipelines?page=1&scope=all&ref=main"><img src="https://img.shields.io/gitlab/pipeline-status/RomainNOEL%2Fbeamertheme-gotham?branch=main&logo=githubactions&label=pipeline"/></a> <a href="https://gitlab.com/RomainNOEL/beamertheme-gotham/-/blob/main/LICENSE.txt"><img src="https://img.shields.io/badge/License-LPPL_1.3c-blue?logo=opensourceinitiative"/></a> <a href="https://gitlab.com/api/v4/projects/52144864/jobs/artifacts/main/raw/gotham.pdf?job=deploy-files"><img src="https://img.shields.io/badge/Documentation-PDF_online-green?logo=readthedocs"/></a> <a href="https://www.repostatus.org/lifecycle"><img src="https://img.shields.io/badge/repo_status-active-FC6D26?logo=framework&color=#F10001"/></a> </p> -<!-- Latest_Release-v1.2.0 Date: 2024-11-11 --> +<!-- Latest_Release-v1.2.1 Date: 2025-02-11 --> ## What is Gotham ? @@ -86,7 +86,7 @@ Several possibilities are available and tested: - download the `.sty` released zip files, - build from sources using `l3build`, - download or update from [CTAN](https://ctan.org/pkg/beamertheme-gotham), -- fork a example from [Overleaf](https://overleaf.com) . +- fork a example from [Overleaf](https://www.overleaf.com/read/ybdcnjxjrwgq#3ae7f9) . ### Download from release The zip file containing the `.sty` files is downloadable through our latest [release link](https://gitlab.com/RomainNOEL/beamertheme-gotham/-/releases/) diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/ctan.ann b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/ctan.ann index e136a381f2..1e339a4766 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/ctan.ann +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/ctan.ann @@ -5,19 +5,14 @@ The `Gotham` package is a modern, minimal-ish, versatile and extendable theme fo +## Version: 1.2.1.c Date: 2025-02-11 -## Version: 1.2.0.a Date: 2024-11-11 - -### Breaking changes -- `standout template` option renamed to `standout BG template`. -- `\gothamFootlineOffset` length renamed `\gothamFootlineVOffset`. +### Fixes +- spacing vertical and horizontal between subsections toc. +- spacing vertical for sections with `gotham bullet` toc leading to an error with `minted` package ([https://gitlab.com/RomainNOEL/beamertheme-gotham/-/issues/4]). +- use of `minted` instead of `listings` for code highlighting in examples. ### News -- test with theorem from `thmtools`. -- add hook after colorset `\gothamHookPostColorBGSet`. -- add hook in footer `\gothamHookFooter` and add `\gothamFootlineHRightOffset` length. -- `standout template` option to change the whole page. - -### Fixes -- length of subtitle in title page of gotham-normal and gotham-splitvert -- primary palette typo
\ No newline at end of file +- add `\partpageOptions`, `\sectionpageOptions`, `\subsectionpageOptions`, `\subsubsectionpageOptions` controlling the frame options of parts and sections pages... +- add `\partpageTocOptions`, `\sectionpageTocOptions`, `\subsectionpageTocOptions`, `\subsubsectionpageTocOptions` controlling the frame options of the table of contents for parts and sections... +- add `\partTocOptions`, `\sectionTocOptions`, `\subsectionTocOptions`, `\subsubsectionTocOptions` controlling the options of table of contents for parts and sections...
\ No newline at end of file diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-dev-impl.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-dev-impl.pdf Binary files differindex 6048764ed7..8620fef1b9 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-dev-impl.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-dev-impl.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-doc.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-doc.pdf Binary files differindex a0feb18939..646b7e6603 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-doc.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-doc.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-doc.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-doc.tex index 02ddf9d8dc..720d370ace 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-doc.tex +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-doc.tex @@ -1,12 +1,12 @@ \documentclass{l3doc} - \usepackage[T1]{fontenc} + \usepackage[T1]{fontenc} \usepackage{pdfpages} \usepackage{standalone} % \usepackage{gotham} % \usepackage{readprov} % \ReadPackageInfos{beamerthemegotham} - \edef\GothamVersion{v1.2.0.a} %{\fileversion} - \edef\GothamDate{2024-11-11} %{\filedate} + \edef\GothamVersion{v1.2.1.c} %{\fileversion} + \edef\GothamDate{2025-02-11} %{\filedate} \usepackage{parskip} @@ -61,11 +61,20 @@ \usepackage{subcaption} % for subfigures \usepackage{cleveref} % for references - \providecommand{\defopt}[1]{default: #1}%{\underline{#1}} - \newenvironment{DescribeGothamOption}[3]{ - \DescribeOption{#1} % from l3doc + \providecommand{\defopt}[1]{\underline{#1}}%{default: #1}%{\underline{#1}} + \NewDocumentEnvironment{DescribeGothamOption}{ o m m m }{ + \DescribeOption{#2} % from l3doc + \IfNoValueTF{#1}{ + % true => left empty intentionally + }{ + \DescribeOption{% add extra info like added or updated dates to mimic 'function' env. + \rule[2.5ex]{\linewidth}{0.3pt} + \\[-3.5ex] + {\scriptsize #1 \hfill\ } + } + } \begin{minipage}[t]{\textwidth} - \textit{\textbf{\textcolor{tSec}{#2}}}\dotfill\,\defopt{#3}\par + \textit{\textbf{\textcolor{tSec}{#3}}}\dotfill\,\defopt{#4}\par \begingroup \vspace{0.5em} }{ @@ -388,7 +397,7 @@ % {list of possible values}{default}{ % A short description of the option. % }\end{DescribeGothamOption} - \begin{DescribeGothamOption}{standout template} + \begin{DescribeGothamOption}[added=2024-11-11]{standout template} {gotham, <your-name>}{gotham}{ Set the standin and stantout template to use when the |standin| or |stantout| frame option is activated. If you want to use your own template, this latter should be previously defined with: @@ -400,7 +409,7 @@ % {list of possible values}{default}{ % A short description of the option. % }\end{DescribeGothamOption} - \begin{DescribeGothamOption}{standout BG template} + \begin{DescribeGothamOption}[updated=2024-11-11]{standout BG template} {gotham, <your-name>}{gotham}{ Since most of the time the standin and standout are only varying from their backgrounds, \themename{} offers the possibility to change only and simply these local background through this option. This option sets the standin and stantout background template to use when the |standin| or |stantout| frame option is activated. @@ -851,13 +860,48 @@ % \begin{arguments} % \item |height| of the picture. % \end{arguments} - The command to change the title of frames containing part (or section or subsection) table of contents. + The command to change the title of frames containing part's (or section or subsection) table of contents. For example, you redefine this command through: \begin{lstlisting}[gobble=6] \renewcommand{\partContentName}{Part's agenda} \end{lstlisting} \end{function} + \begin{function}[added = 2025-01-06]{\partpageOptions, \sectionpageOptions, \subsectionpageOptions, \subsubsectionpageOptions} + % \begin{arguments} + % \item |height| of the picture. + % \end{arguments} + The commands to change the options of frames containing part's title (or section or subsection) at its start. + For example, you redefine this command through: + \begin{lstlisting}[gobble=6] + \renewcommand{\partpageOptions}{plain} + \end{lstlisting} + \end{function} + + \begin{function}[added = 2025-01-06]{\partpageTocOptions, \sectionpageTocOptions, \subsectionpageTocOptions}%, \subsubsectionpageTocOptions + % \begin{arguments} + % \item |height| of the picture. + % \end{arguments} + The command to change the options of frames containing part's (or section or subsection) table of contents. + For example, you redefine this command through: + \begin{lstlisting}[gobble=6] + \renewcommand{\partpageTocOptions}{nofooter} + \end{lstlisting} + \end{function} + + \begin{function}[added = 2025-01-06]{\partTocOptions, \sectionTocOptions, \subsectionTocOptions}%, \subsubsectionTocOptions + % \begin{arguments} + % \item |height| of the picture. + % \end{arguments} + The command to change the options for part's (or section or subsection) table of contents at the beginning of this part. + For example, you redefine this command through: + \begin{lstlisting}[gobble=6] + \renewcommand{\sectionTocOptions}{ + currentsection, hideallsubsections + } + \end{lstlisting} + \end{function} + \begin{variable}{gothamZerosectionframes} Boolean variable to flag if they are frame in a zeroth section. This variable helps to adapt the spreading of |mini frames nav| bar. @@ -876,7 +920,7 @@ \end{lstlisting} \end{variable} - \begin{function}{\gothamHookFooter} + \begin{function}[updated=2024-11-11]{\gothamHookFooter} % \begin{arguments} % \item |height| of the picture. % \end{arguments} @@ -889,7 +933,7 @@ \end{lstlisting} \end{function} - \begin{function}{\gothamHookPostColorBGSet} + \begin{function}[updated=2024-11-11]{\gothamHookPostColorBGSet} % \begin{arguments} % \item |height| of the picture. % \end{arguments} @@ -986,7 +1030,7 @@ |\gothamFootlineRuleHeight| controls the height and | \gothamFootlineRuleLength| the length of the rule used to delimit the footer. \end{variable} - \begin{variable}{\gothamFootlineHRightOffset, \gothamFootlineVOffset, \gothamFootlineHeight, \gothamFootlineDepth} + \begin{variable}[updated=2024-11-11]{\gothamFootlineHRightOffset, \gothamFootlineVOffset, \gothamFootlineHeight, \gothamFootlineDepth} |\gothamFootlineHRightOffset| is controlling the horizontal space between the right border of the page and the side of the footline. |\gothamFootlineVOffset| is controlling space between to bottom of the text (or the footnote) and the footline. |\gothamFootlineHeight| and |\gothamFootlineDepth| are controlling the height and depth of the footline baseline. @@ -1169,7 +1213,6 @@ \item Turn internal length into \_dim. \item Improve documentation. \item Add a hexagonal, wavy and add lengths on the blueprint layout backgrounds. - \item Remove calc package (that can be replaced by xfp or just fp). \item Remove colors from tests inner and outer. \item Replace the |\setbeamertemplate{yy}[default/xx]| by |\__gotham_inner_set_template:nn{title~page}| or merge them because the default values in dict/template are interesting but |\__gotham_inner_set_template| are simpler. \item add colorset more "blue-ish", "green-ish" ... from colorA etc. @@ -1189,37 +1232,44 @@ % \begin{documentation} -% \begin{macro|function|variable}{\nameMacro} -% \begin{syntax} -% \cs{nameMacro}\oarg{option1=value1, ...}\marg{gotham} -% \textrm{where the options are (default marked as} \defopt{default}\textrm{):} -% \meta{footer template} = \oarg{\defopt{gotham} \textbar ... } -% \end{syntax} -% Description of |nameMacro| which xxx. -% \end{macro|function|variable} +% \begin{macro|function|variable}[updated|added=2025-02-25]{\nameMacro} +% \begin{syntax} +% \cs{nameMacro}\oarg{option1=value1, ...}\marg{tempkg} +% \textrm{where the options are (default marked as} \defopt{default}\textrm{):} +% \meta{footer template} = \oarg{\defopt{tempkg} \textbar ... } +% \end{syntax} +% Description of |nameMacro| which xxx. +% \end{macro|function|variable} % \end{documentation} %%%% % \begin{implementation} -% \begin{macro|function|variable}{\nameMacro} -% \begin{arguments} -% \item |width| Name of the option to add, this name should also correspond to the name of the environment followed by the suffix 'env'. -% \end{arguments} +% \begin{macro|function|variable}[updated|added=2025-02-25]{\nameMacro} +% \begin{arguments} +% \item |width| Name of the option to add, this name should also correspond to the name of the environment followed by the suffix 'env'. +% \end{arguments} % Description +% \changes{v1.0.1}{2025-02-25}{original version} % \UnitTested % NOT FOR VARIABLES OF FUNCTIONS -% \TestFiles{gotham-test-xxx} % NOT FOR VARIABLES +% \TestFiles{tempkg-test-xxx} % NOT FOR VARIABLES % \begin{macrocode} - +%% MY CODE % \end{macrocode} -% \end{macro|function|variable} +% \end{macro|function|variable} % \end{implementation} + + % \begin{implementation} -% \begin{macro}{\nameMacro} +% \begin{macro}[updated|added=2025-02-25]{\nameMacro} +% \begin{arguments} +% \item |width| Name of the option to add, this name should also correspond to the name of the environment followed by the suffix 'env'. +% \end{arguments} % Description -% \UnitTested -% \TestFiles{gotham-test-048} +% \changes{v1.0.1}{2025-02-25}{original version} +% \UnitTested % NOT FOR VARIABLES OF FUNCTIONS +% \TestFiles{tempkg-test-xxx} % NOT FOR VARIABLES % \begin{macrocode} - +%% MY CODE % \end{macrocode} -% \end{macro} +% \end{macro} % \end{implementation}
\ No newline at end of file diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example169transp.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example169transp.pdf Binary files differindex 4d61d952ce..56c726c6e2 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example169transp.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example169transp.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example169transp.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example169transp.tex index 71bd8cf1e9..29155f4c1b 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example169transp.tex +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example169transp.tex @@ -1,27 +1,39 @@ \documentclass[aspectratio=169, 10pt]{beamer} \usetheme{gotham} - \gothamset{ - numbering= framenumber, - % tocframe template= gotham simple, - parttocframe default=off, - sectiontocframe default=off, - subsectiontocframe default=off, - } + \gothamset{ + numbering= framenumber, + % tocframe template= gotham simple, + parttocframe default=off, + sectiontocframe default=off, + subsectiontocframe default=off, + } \usepackage{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tabularray} % Typeset tabulars and arrays (contains equivalent of longtable, booktabs and dcolumn at least) \UseTblrLibrary{booktabs} % to load extra commands from booktabs - \usepackage{changepage} - - \usepackage{appendixnumberbeamer} - \usepackage[scale=2]{ccicons} - % \usepackage{pgfplots} - \usepgfplotslibrary{dateplot} - - \newcommand{\themename}{\textbf{\textsc{Gotham}}} + \usepackage{changepage} + \usepackage{appendixnumberbeamer} + \newcommand{\famName}[1]{\textsc{#1}} + \usepackage{minted} + \definecolor{codeback}{rgb}{0.90,0.91,0.92} + \definecolor{codebackdark}{rgb}{0.10,0.11,0.12} + \usemintedstyle{emacs} + \setmintedinline[tex]{bgcolor=codeback} + \setminted[tex]{ + autogobble, + bgcolor=codeback, + tabsize=4, + extrakeywords={usetheme,institute,maketitle,subtitle,gothamset,colorlet,setbeamercolor,plain,defbeamertemplate} + } + + \usepackage[scale=2]{ccicons} + % \usepackage{pgfplots} + \usepgfplotslibrary{dateplot} + + \newcommand{\themename}{\textbf{\textsc{Gotham}}} \title[]{Gotham} @@ -36,11 +48,11 @@ \maketitle - \begin{frame}[toc]{Table of contents}% - \tableofcontents%[hideallsubsections] - \end{frame} + \begin{frame}[toc]{Table of contents}% + \tableofcontents%[hideallsubsections] + \end{frame} - + %%%%%%%%%%%%%%%%%%%% %%% MAINMATTER %%% %%%%%%%%%%%%%%%%%%%% @@ -53,13 +65,13 @@ \appendix - \begin{frame}[fragile]{Backup slides} - Sometimes, it is useful to add slides at the end of your presentation to refer to during audience questions. + \begin{frame}[fragile]{Backup slides} + Sometimes, it is useful to add slides at the end of your presentation to refer to during audience questions. - The best way to do this is to include \verb|\usepackage{appendixnumberbeamer}| in your preamble and call \verb|\appendix| before your backup slides. + The best way to do this is to include \verb|\usepackage{appendixnumberbeamer}| in your preamble and call \verb|\appendix| before your backup slides. - \themename{} will automatically turn off slide numbering and progress bars for slides in the appendix. - \end{frame} + \themename{} will automatically turn off slide numbering and progress bars for slides in the appendix. + \end{frame} \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example43dark.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example43dark.pdf Binary files differindex e5eca50334..77c68978b8 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example43dark.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example43dark.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example43dark.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example43dark.tex index af6e53c6ab..e072f9fe77 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example43dark.tex +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-example43dark.tex @@ -1,28 +1,40 @@ \documentclass[aspectratio=43, 10pt]{beamer} \usetheme{gotham} - \gothamset{ - background=dark, - numbering= framenumber, - % tocframe template= gotham simple, - parttocframe default=off, - sectiontocframe default=off, - subsectiontocframe default=off, - } + \gothamset{ + background=dark, + numbering= framenumber, + % tocframe template= gotham simple, + parttocframe default=off, + sectiontocframe default=off, + subsectiontocframe default=off, + } \usepackage{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tabularray} % Typeset tabulars and arrays (contains equivalent of longtable, booktabs and dcolumn at least) \UseTblrLibrary{booktabs} % to load extra commands from booktabs - \usepackage{changepage} - - \usepackage{appendixnumberbeamer} - \usepackage[scale=2]{ccicons} - % \usepackage{pgfplots} - \usepgfplotslibrary{dateplot} - - \newcommand{\themename}{\textbf{\textsc{Gotham}}} + \usepackage{changepage} + \usepackage{appendixnumberbeamer} + \newcommand{\famName}[1]{\textsc{#1}} + \usepackage{minted} + \definecolor{codeback}{rgb}{0.90,0.91,0.92} + \definecolor{codebackdark}{rgb}{0.10,0.11,0.12} + \usemintedstyle{emacs} + \setmintedinline[tex]{bgcolor=codeback} + \setminted[tex]{ + autogobble, + bgcolor=codeback, + tabsize=4, + extrakeywords={usetheme,institute,maketitle,subtitle,gothamset,colorlet,setbeamercolor,plain,defbeamertemplate} + } + + \usepackage[scale=2]{ccicons} + % \usepackage{pgfplots} + \usepgfplotslibrary{dateplot} + + \newcommand{\themename}{\textbf{\textsc{Gotham}}} \title[]{Gotham} @@ -37,11 +49,11 @@ \maketitle - \begin{frame}[toc]{Table of contents}% - \tableofcontents%[hideallsubsections] - \end{frame} + \begin{frame}[toc]{Table of contents}% + \tableofcontents%[hideallsubsections] + \end{frame} - + %%%%%%%%%%%%%%%%%%%% %%% MAINMATTER %%% %%%%%%%%%%%%%%%%%%%% @@ -54,13 +66,13 @@ \appendix - \begin{frame}[fragile]{Backup slides} - Sometimes, it is useful to add slides at the end of your presentation to refer to during audience questions. + \begin{frame}[fragile]{Backup slides} + Sometimes, it is useful to add slides at the end of your presentation to refer to during audience questions. - The best way to do this is to include \verb|\usepackage{appendixnumberbeamer}| in your preamble and call \verb|\appendix| before your backup slides. + The best way to do this is to include \verb|\usepackage{appendixnumberbeamer}| in your preamble and call \verb|\appendix| before your backup slides. - \themename{} will automatically turn off slide numbering and progress bars for slides in the appendix. - \end{frame} + \themename{} will automatically turn off slide numbering and progress bars for slides in the appendix. + \end{frame} \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-exampleSimple.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-exampleSimple.pdf Binary files differindex beebdfbb2c..cedf317dda 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-exampleSimple.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-exampleSimple.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-user-cmds.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-user-cmds.pdf Binary files differindex fe77dd5a17..03229dc762 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-user-cmds.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham-user-cmds.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham.dtx index 896f9ce977..e88a13ea34 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham.dtx +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham.dtx @@ -23,7 +23,7 @@ \input expl3-generic \relax %</internal> %<class>\NeedsTeXFormat{LaTeX3e} -%<package>\ProvidesExplPackage{beamerthemegotham}{2024-11-11}{1.2.0.a}{A modern, minimal-ish, versatile and extendable yet robust theme for Beamer} +%<package>\ProvidesExplPackage{beamerthemegotham}{2025-02-11}{1.2.1.c}{A modern, minimal-ish, versatile and extendable yet robust theme for Beamer} %<author>Romain NOEL</author> %<maintainer>Romain NOEL</maintainer> %<url>https://gitlab.com/RomainNOEL/beamertheme-gotham</url> @@ -39,8 +39,8 @@ % \usepackage{gotham} % \usepackage{readprov} % \ReadPackageInfos{beamerthemegotham} - \edef\GothamVersion{v1.2.0.a} %{\fileversion} - \edef\GothamDate{2024-11-11} %{\filedate} + \edef\GothamVersion{v1.2.1.c} %{\fileversion} + \edef\GothamDate{2025-02-11} %{\filedate} \usepackage{parskip} \usepackage{setspace} @@ -92,12 +92,20 @@ \usepackage{subcaption} % For subfigures \usepackage{cleveref} % for references - \providecommand{\defopt}[1]{default: #1}%{\underline{#1}} - % \DescribeGothamOption{optionName}{possible values}{default value}{descrption} - \newenvironment{DescribeGothamOption}[3]{ - \DescribeOption{#1} % from l3doc + \providecommand{\defopt}[1]{\underline{#1}}%{default: #1}%{\underline{#1}} + \NewDocumentEnvironment{DescribeGothamOption}{ o m m m }{ + \DescribeOption{#2} % from l3doc + \IfNoValueTF{#1}{ + % true => left empty intentionally + }{ + \DescribeOption{% add extra info like added or updated dates to mimic 'function' env. + \rule[2.5ex]{\linewidth}{0.3pt} + \\[-3.5ex] + {\scriptsize #1 \hfill\ } + } + } \begin{minipage}[t]{\textwidth} - \textit{\textbf{\textcolor{tSec}{#2}}}\dotfill\,\defopt{#3}\par + \textit{\textbf{\textcolor{tSec}{#3}}}\dotfill\,\defopt{#4}\par \begingroup \vspace{0.5em} }{ @@ -188,10 +196,10 @@ %\begin{implementation} % \begin{macrocode} %<*font> -\ProvidesExplPackage{beamerfontthemegotham}{2024-11-11}{1.2.0.a}{gotham font theme} +\ProvidesExplPackage{beamerfontthemegotham}{2025-02-11}{1.2.1.c}{gotham font theme} \RequirePackage{expl3} -\RequirePackage{xparse} -\RequirePackage{etoolbox} +% \RequirePackage{xparse} +% \RequirePackage{etoolbox} \RequirePackage{ifxetex} \RequirePackage{ifluatex} % \end{macrocode} @@ -205,7 +213,7 @@ % \begin{implementation} % \begin{variable}{font messages} % Definition of the messages that are used and reused by font theme. -% \changes{v0.2.0}{2024/01/25}{New} +% \changes{v0.2.0}{2024-01-25}{New} % \begin{macrocode} \msg_new:nnn { gotham } { font-not-found } { @@ -303,7 +311,7 @@ \RequirePackage[no-math]{fontspec} } % - % We search for regular, italic, light, light italic,fonts under the default |Fira Sans| names. + % We search for regular, italic, light, light italic, fonts under the default |Fira Sans| names. \iffontsavailable{FiraSans-Light.otf, FiraSans-LightItalic.otf, FiraSans-Regular.otf, @@ -313,6 +321,7 @@ BoldFont={FiraSans-Regular.otf}, BoldItalicFont={FiraSans-Italic.otf}] {FiraSans-Light.otf} + \renewcommand{\ttdefault}{lmtt} % Latin Modern Typewriter }{ % If this fails, the suffix OT --- used by some Linux distributions --- will be tried. \iffontsavailable{FiraSans~Light~OT, @@ -324,6 +333,7 @@ BoldFont={Fira~Sans~Regular~OT}, BoldItalicFont={Fira~Sans~Italic~OT}] {Fira~Sans~Light~OT} + \renewcommand{\ttdefault}{lmtt} % Latin Modern Typewriter }{ % If this also fails, a warning will be displayed and the standard fonts will be used. \msg_warning:nn { gotham } { fonts-not-available }% @@ -337,6 +347,7 @@ % If this fails, the suffix OT --- used by some Linux distributions --- will be tried. \iffontsavailable{Fira~Mono~Medium~OT, Fira~Mono~Bold~OT}{ \setmonofont[BoldFont={Fira~Mono~Medium~OT}]{Fira~Mono~Bold~OT} + \renewcommand{\ttdefault}{lmtt} % Latin Modern Typewriter }{ % If this also fails, a warning will be displayed and the standard fonts will be used. \msg_warning:nn { gotham } { fonts-not-available } @@ -973,9 +984,9 @@ %\begin{implementation} % \begin{macrocode} %<*color> -\ProvidesExplPackage{beamercolorthemegotham}{2024-11-11}{1.2.0.a}{Gotham color theme} +\ProvidesExplPackage{beamercolorthemegotham}{2025-02-11}{1.2.1.c}{Gotham color theme} \RequirePackage{expl3} -\RequirePackage{xparse} +% \RequirePackage{xparse} \RequirePackage{xcolor} % \end{macrocode} % \end{implementation} @@ -1578,10 +1589,11 @@ %\begin{implementation} % \begin{macrocode} %<*inner> -\ProvidesExplPackage{beamerinnerthemegotham}{2024-11-11}{1.2.0.a}{gotham inner theme} +\ProvidesExplPackage{beamerinnerthemegotham}{2025-02-11}{1.2.1.c}{gotham inner theme} \RequirePackage{expl3} -\RequirePackage{xparse} +% \RequirePackage{xparse} \RequirePackage{calc} +% \RequirePackage{xfp} \RequirePackage{tikz} % \end{macrocode} % \end{implementation} @@ -2959,7 +2971,17 @@ \providebool{subsectionContent} \booltrue{subsectionContent} \providecommand{\subsecContentName}{Subsection~content} +% \end{macrocode} +% \end{variable} +% \end{implementation} +% \begin{implementation} +% \begin{variable}{\providebool{subsubsectionContent}, \subsubsecContentName} +% Boolean variable to enable the table of contents of the subsubsection, and the command containing the 'table of contents' title. +% \begin{macrocode} % Subsubsection is not useful (at least up to understanding of the moment) because we do not display frame with the content of a subsubsection since it is the small unity we are working with. +\providebool{subsubsectionContent} +\booltrue{subsubsectionContent} +\providecommand{\subsubsecContentName}{Subsubsection~content} % \end{macrocode} % \end{variable} % \end{implementation} @@ -3003,10 +3025,81 @@ % \end{macro} % \end{implementation} +% \begin{documentation} +% \begin{variable}[added=2025-01-06]{\partpageOptions, \sectionpageOptions, \subsectionpageOptions, \subsubsectionpageOptions} +% Variable commands that contain the coma-separated list of options which are given to the partpage (respectively to the section, subsection and subsubsection). +% \end{variable} +% \end{documentation} +%%%% +% \begin{implementation} +% \begin{variable}[added=2025-01-06]{\partpageOptions, \sectionpageOptions, \subsectionpageOptions, \subsubsectionpageOptions} +% Options used in |\begin{frame}[\partpageOptions,part]{\partpage}...| . +% TESTED in gotham-test-1039 +% \changes{v1.2.1}{2025-01-06}{newly introduced} +% \begin{macrocode} +\providecommand{\partpageOptions}{noframenumbering} +\providecommand{\sectionpageOptions}{noframenumbering} +\providecommand{\subsectionpageOptions}{noframenumbering} +\providecommand{\subsubsectionpageOptions}{noframenumbering} +% \end{macrocode} +% \end{variable} +% \end{implementation} + +% \begin{documentation} +% \begin{variable}[added=2025-01-06]{\partpageTocOptions, \sectionpageTocOptions, \subsectionpageTocOptions, \subsubsectionpageTocOptions} +% Variable commands that contain the coma-separated list of options which are given to the table of contents page at the begin of a part (respectively to the section, subsection and subsubsection). +% \end{variable} +% \end{documentation} +%%%% % \begin{implementation} -% \begin{function}{\__gotham_inner_disable_partpage:, \__gotham_inner_enable_partpage:} -% Commands to disable or enable the display of a 'part page' frame at the begining of every new part. -% It replaces the |\newcommand{\gotham@disablepartpage}| and | \newcommand{\gotham@enablepartpage}| +% \begin{variable}[added=2025-01-06]{\partpageTocOptions, \sectionpageTocOptions, \subsectionpageTocOptions, \subsubsectionpageTocOptions} +% Options used in |\begin{frame}[\partpageTocOptions,tocpart]{toc part page...}| . +% TESTED in gotham-test-1039 +% \changes{v1.2.1}{2025-01-06}{newly introduced} +% \begin{macrocode} +\providecommand{\partpageTocOptions}{noframenumbering} +\providecommand{\sectionpageTocOptions}{noframenumbering} +\providecommand{\subsectionpageTocOptions}{noframenumbering} +% \providecommand{\subsubsectionpageTocOptions}{noframenumbering} +% \end{macrocode} +% \end{variable} +% \end{implementation} + +% \begin{documentation} +% \begin{variable}[added=2025-01-06]{\partTocOptions, \sectionTocOptions, \subsectionTocOptions, \subsubsectionTocOptions} +% Variable commands that contain the coma-separated list of options which are given to the table of content at the beginning of a part (respectively to the section, subsection and subsubsection). +% \end{variable} +% \end{documentation} +%%%% +% \begin{implementation} +% \begin{variable}[added=2025-01-06]{\partTocOptions, \sectionTocOptions, \subsectionTocOptions, \subsubsectionTocOptions} +% Options used in |\tableofcontents[\partTocOptions]| . +% TESTED in gotham-test-1039 +% \changes{v1.2.1}{2025-01-06}{newly introduced} +% \begin{macrocode} +\providecommand{\partTocOptions}{} +\providecommand{\sectionTocOptions}{ + currentsection, currentsubsection, + hideothersubsections, + sectionstyle=show/shaded, +} +\providecommand{\subsectionTocOptions}{ + currentsection, currentsubsection, + % currentsubsubsection, + hideothersubsections, + sectionstyle=show/shaded, + subsectionstyle=show/shaded/hide, + subsubsectionstyle=show/show/hide, +} +% \providecommand{\subsubsectionTocOptions}{} +% \end{macrocode} +% \end{variable} +% \end{implementation} + +% \begin{implementation} +% \begin{function}[updated=2025-01-06]{\__gotham_inner_disable_partpage:, \__gotham_inner_enable_partpage:} +% Commands to disable or enable the display of a 'part page' frame at the beginning of every new part. +% \changes{v1.2.1}{2025-01-06}{includes new variables} % \TestFiles{gotham-test-041} % \begin{macrocode} \cs_new_protected:Nn \__gotham_inner_disable_partpage: @@ -3022,14 +3115,32 @@ \ifbeamer@inframe \partpage \else - \frame[c, noframenumbering, part]{\partpage} + \ifdefempty{\partpageOptions}{ + % empty command + \frame[c, part]{\partpage} + }{ + % non-empty command + \frame[c, \expandafter\partpageOptions, part]{\partpage} + } \fi \ifbool{partContent}{ % true - \begin{frame}[noframenumbering, tocpart] - \frametitle{\partContentName} - \tableofcontents[part=\thepart] + \ifdefempty{\partpageTocOptions}{ + % empty command + \begin{frame}[tocpart] + }{ + % non-empty command + \begin{frame}[tocpart, \expandafter\partpageTocOptions] + } + \ifdefempty{\partContentName}{}{\frametitle{\partContentName}} + \ifdefempty{\partTocOptions}{ + % empty command + \tableofcontents[part=\thepart] + }{ + % non-empty command + \expandafter\tableofcontents[part=\thepart, \expandafter\partTocOptions] + } \end{frame} }{ % else empty @@ -3041,9 +3152,9 @@ % \end{implementation} % \begin{implementation} -% \begin{function}{\__gotham_inner_disable_sectionpage:, \__gotham_inner_enable_sectionpage:} -% Commands to disable or enable the display of a 'section page' frame at the begining of every new section. -% It replaces the |\newcommand{\gotham@disablesectionpage}| and | \newcommand{\gotham@enablesectionpage}| +% \begin{function}[updated=2025-01-06]{\__gotham_inner_disable_sectionpage:, \__gotham_inner_enable_sectionpage:} +% Commands to disable or enable the display of a 'section page' frame at the beginning of every new section. +% \changes{v1.2.1}{2025-01-06}{includes new variables} % \TestFiles{gotham-test-041} % \begin{macrocode} \cs_new_protected:Nn \__gotham_inner_disable_sectionpage: @@ -3059,21 +3170,31 @@ \ifbeamer@inframe \sectionpage \else - \frame[c, noframenumbering, section]{\sectionpage} + \ifdefempty{\sectionpageOptions}{ + % empty command + \frame[c, section]{\sectionpage} + }{ + % non-empty command + \frame[c, \expandafter\sectionpageOptions, section]{\sectionpage} + } \fi \ifbool{sectionContent}{ % true - \begin{frame}[noframenumbering, tocsec] - \frametitle{\secContentName} - {\tableofcontents[currentsection, currentsubsection, - hideothersubsections, - sectionstyle=show/shaded, - ] + \ifdefempty{\sectionpageTocOptions}{ + % empty command + \begin{frame}[tocsec] + }{ + % non-empty command + \begin{frame}[\expandafter\sectionpageTocOptions, tocsec] + } + \ifdefempty{\secContentName}{}{\frametitle{\secContentName}} + { + \expandafter\tableofcontents\expandafter[\sectionTocOptions] } \end{frame} }{ - % else empty + % else empty } } } @@ -3082,9 +3203,9 @@ % \end{implementation} % \begin{implementation} -% \begin{function}{\__gotham_inner_disable_subsectionpage:, \__gotham_inner_enable_subsectionpage:} -% Commands to disable or enable the display of a 'subsection page' frame at the begining of every new subsection. -% It replaces the |\newcommand{\gotham@disablesubsectionpage}| and | \newcommand{\gotham@enablesubsectionpage}| +% \begin{function}[updated=2025-01-06]{\__gotham_inner_disable_subsectionpage:, \__gotham_inner_enable_subsectionpage:} +% Commands to disable or enable the display of a 'subsection page' frame at the beginning of every new subsection. +% \changes{v1.2.1}{2025-01-06}{includes new variables} % \TestFiles{gotham-test-041} % \begin{macrocode} \cs_new_protected:Nn \__gotham_inner_disable_subsectionpage: @@ -3100,20 +3221,27 @@ \ifbeamer@inframe \subsectionpage \else - \frame[c, noframenumbering, subsec]{\subsectionpage} + \ifdefempty{\subsectionpageOptions}{ + % empty command + \frame[c, subsec]{\subsectionpage} + }{ + % non-empty command + \frame[c, \expandafter\subsectionpageOptions, subsec]{\subsectionpage} + } \fi \ifbool{subsectionContent}{ % true - \begin{frame}[noframenumbering, tocsubsec] - \frametitle{\subsecContentName} - {\tableofcontents[currentsection, currentsubsection, - %currentsubsubsection, - hideothersubsections, - sectionstyle=show/shaded, - subsectionstyle=show/shaded/hide, - subsubsectionstyle=show/show/hide, - ] + \ifdefempty{\subsectionpageTocOptions}{ + % empty command + \begin{frame}[tocsubsec] + }{ + % non-empty command + \begin{frame}[\expandafter\subsectionpageTocOptions, tocsubsec] + } + \ifdefempty{\subsecContentName}{}{\frametitle{\subsecContentName}} + { + \expandafter\tableofcontents\expandafter[\subsectionTocOptions] } \end{frame} }{ @@ -3126,9 +3254,9 @@ % \end{implementation} % \begin{implementation} -% \begin{function}{\__gotham_inner_disable_subsubsectionpage:, \__gotham_inner_enable_subsubsectionpage:} -% Commands to disable or enable the display of a 'subsubsection page' frame at the begining of every new subsubsection. -% It replaces the |\newcommand{\gotham@disablesubsubsectionpage}| and | \newcommand{\gotham@enablesubsubsectionpage}| +% \begin{function}[updated=2025-01-06]{\__gotham_inner_disable_subsubsectionpage:, \__gotham_inner_enable_subsubsectionpage:} +% Commands to disable or enable the display of a 'subsubsection page' frame at the beginning of every new subsubsection. +% \changes{v1.2.1}{2025-01-06}{includes new variables} % \TestFiles{gotham-test-041} % \begin{macrocode} \cs_new_protected:Nn \__gotham_inner_disable_subsubsectionpage: @@ -3144,8 +3272,33 @@ \ifbeamer@inframe \subsubsectionpage \else - \frame[c, noframenumbering, subsubsec]{\subsubsectionpage} + \ifdefempty{\subsubsectionpageOptions}{ + % empty command + \frame[c, subsubsec]{\subsubsectionpage} + }{ + % non-empty command + \frame[c, \expandafter\subsubsectionpageOptions, subsubsec]{\subsubsectionpage} + } \fi + + % I don't think anyone will use this for now. But, just in case I keep it commented. + % \ifbool{subsubsectionContent}{ + % % true + % \ifdefempty{\subsubsectionpageTocOptions}{ + % % empty command + % \begin{frame}[tocsubsubsec] + % }{ + % % non-empty command + % \begin{frame}[\expandafter\subsubsectionpageTocOptions, tocsubsubsec] + % } + % \ifdefempty{\subsubsecContentName}{}{\frametitle{\subsubsecContentName}} + % { + % \expandafter\tableofcontents\expandafter[\subsubsectionTocOptions] + % } + % \end{frame} + % }{ + % % else empty + % } } } % \end{macrocode} @@ -4144,35 +4297,36 @@ % \begin{implementation} % \begin{macro}{\defbeamertemplate{section~in~toc}{gotham~bullet}} % Template definitions for |gotham bullet| style of ToC that appear in section \textbar subsection \textbar subsubsection frame. +% \changes{v1.2.1}{2025-02-10}{adapt shaded subsection in toc} % \UnitTested % \TestFiles{gotham-test-042} % \begin{macrocode} \defbeamertemplate{section~in~toc}{gotham~bullet}{ - \hspace*{0.4cm}\tikz[baseline=-0.5ex]\node[section~number]{\textbf{\small\inserttocsectionnumber}}; - \ \tikz[baseline=-0.5ex]\node[section]{\usebeamerfont*{toc~title} \inserttocsection};\\[-0.35cm] - \hspace*{1.13cm}{\usebeamercolor*[fg]{footer} \rule{0.6\paperwidth}{0.2pt}\\\nointerlineskip} + \hspace*{0.4cm}\tikz[baseline=-0.5ex]\node[section~number]{\textbf{\inserttocsectionnumber}}; + \ \tikz[baseline=-0.5ex]\node[section]{\usebeamerfont*{toc~title}\inserttocsection};\\[-0.35cm] + \hspace*{1.13cm}{\usebeamercolor*[fg]{footer} \rule{0.6\paperwidth}{0.2pt}{\par\vskip-0.35\baselineskip}\nointerlineskip} } \defbeamertemplate{subsection~in~toc}{gotham~bullet}{ \hspace*{0.53cm}\tikz[baseline=-0.5ex]\node[subsection~number]{}; - \hspace*{0.5cm}\tikz[baseline=-0.5ex]\node[subsection]{\usebeamerfont*{toc~subtitle}\inserttocsubsection};\\[-0.2cm] + \hspace*{0.5cm}\tikz[baseline=-0.5ex]\node[subsection]{\usebeamerfont*{toc~subtitle}\inserttocsubsection \gotham@strut};\\[-0.2cm] } \defbeamertemplate{subsubsection~in~toc}{gotham~bullet}{ \hspace*{0.58cm}\tikz[baseline=-0.5ex]\node[subsubsection~number]{}; - \hspace*{0.69cm}\tikz[baseline=-0.5ex]\node[subsubsection]{\usebeamerfont*{toc~subtitle}\inserttocsubsubsection};\\[-0.2cm] + \hspace*{0.69cm}\tikz[baseline=-0.5ex]\node[subsubsection]{\usebeamerfont*{toc~subtitle}\inserttocsubsubsection \gotham@strut};\\[-0.2cm] } % Shaded for sections already done in the presentation. \defbeamertemplate{section~in~toc~shaded}{gotham~bullet}{ - \hspace*{0.4cm}\tikz[baseline=-0.5ex]\node[section~number, fill=colorBackElement!40, text=background]{\usebeamerfont*{toc~subtitle}\textbf{\inserttocsectionnumber}}; - \ \tikz[baseline=-0.5ex]\node[section, text=colorExample!20]{\usebeamerfont*{toc~title} \inserttocsection};\\[-0.35cm] - \hspace*{1.3cm}{\usebeamercolor*[fg]{footer} \rule{0.6\paperwidth}{0.2pt}\\\nointerlineskip} + \hspace*{0.4cm}\tikz[baseline=-0.5ex]\node[section~number, fill=colorBackElement!40]{\usebeamerfont*{toc~subtitle}\textbf{\inserttocsectionnumber}}; + \ \tikz[baseline=-0.5ex]\node[section, text=colorBackElement!20]{\usebeamerfont*{toc~title}\inserttocsection};\\[-0.35cm] + \hspace*{1.13cm}{\usebeamercolor*[fg]{footer} \rule{0.6\paperwidth}{0.2pt}{\par\vskip-0.35\baselineskip}\nointerlineskip} } \defbeamertemplate{subsection~in~toc~shaded}{gotham~bullet}{ - \hspace*{0.55cm}\tikz[baseline=-0.5ex]\node[subsection~number,fill=colorBackElement!20]{}; - \hspace*{0.5cm}\tikz[baseline=-0.5ex]\node[subsection, text=colorBackElement!20]{};\\[-0.2cm] + \hspace*{0.53cm}\tikz[baseline=-0.5ex]\node[subsection~number,fill=colorBackElement!20]{}; + \hspace*{0.5cm}\tikz[baseline=-0.5ex]\node[subsection, text=colorBackElement!20]{\usebeamerfont*{toc~subtitle}\inserttocsubsection \gotham@strut};\\[-0.2cm] } \defbeamertemplate{subsubsection~in~toc~shaded}{gotham~bullet}{ \hspace*{0.58cm}\tikz[baseline=-0.5ex]\node[subsubsection~number,fill=colorBackElement!20]{}; - \hspace*{0.69cm}\tikz[baseline=-0.5ex]\node[subsubsection,text=colorBackElement!20]{\usebeamerfont*{toc~subtitle}\inserttocsubsubsection};\\[-0.2cm] + \hspace*{0.69cm}\tikz[baseline=-0.5ex]\node[subsubsection,text=colorBackElement!20]{\usebeamerfont*{toc~subtitle}\inserttocsubsubsection \gotham@strut};\\[-0.2cm] } % \end{macrocode} % \end{macro} @@ -4181,6 +4335,7 @@ % \begin{implementation} % \begin{macro}{\defbeamertemplate{section~in~toc}{gotham~bullet}} % Template definitions for |gotham simple| style of ToC that appear in section \textbar subsection \textbar subsubsection frame. +% \changes{v1.2.1}{2025-01-06}{adapt shaded subsection in toc} % \UnitTested % \TestFiles{gotham-test-042} % \begin{macrocode} @@ -4200,6 +4355,24 @@ \qquad{{\inserttocsectionnumber}.\inserttocsubsectionnumber.\inserttocsubsubsectionnumber.}~\inserttocsubsubsection \\ } +\defbeamertemplate{section~in~toc~shaded}{gotham~simple}{ + \begin{colormixin}{20!parent.bg} + {{\inserttocsectionnumber}.}~\inserttocsection + \end{colormixin} + \\ +} +\defbeamertemplate{subsection~in~toc~shaded}{gotham~simple}{ + \begin{colormixin}{20!parent.bg} + \quad{{\inserttocsectionnumber}.\inserttocsubsectionnumber.}~\inserttocsubsection + \end{colormixin} + \\ +} +\defbeamertemplate{subsubsection~in~toc~shaded}{gotham~simple}{ + \begin{colormixin}{20!parent.bg} + \qquad{{\inserttocsectionnumber}.\inserttocsubsectionnumber.\inserttocsubsubsectionnumber.}~\inserttocsubsubsection + \end{colormixin} + \\ +} % \end{macrocode} % \end{macro} % \end{implementation} @@ -4208,6 +4381,7 @@ % \begin{macro}{\defbeamertemplate{background~canvas}{toc/gotham~simple}, \defbeamertemplate{toc~page}{gotham~simple|bullet}} % Definition of toc page style named gotham simple and gotham bullet, used for table of content pages. % Both are using a dedicated background canvas. +% \changes{v1.2.1}{2025-01-05}{add shaded subsection in toc setup} % \UnitTested % \TestFiles{gotham-test-042} % \begin{macrocode} @@ -4219,15 +4393,21 @@ \defbeamertemplate{toc~page}{gotham~simple}{ \setbeamertemplate{part~in~toc}[gotham~simple] \setbeamertemplate{section~in~toc}[gotham~simple] + \setbeamertemplate{section~in~toc~shaded}[gotham~simple] \setbeamertemplate{subsection~in~toc}[gotham~simple] + \setbeamertemplate{subsection~in~toc~shaded}[gotham~simple] \setbeamertemplate{subsubsection~in~toc}[gotham~simple] + \setbeamertemplate{subsubsection~in~toc~shaded}[gotham~simple] \setbeamertemplate{background~canvas}[toc/gotham~simple] } \defbeamertemplate{toc~page}{gotham~bullet}{ \setbeamertemplate{part~in~toc}[gotham~bullet] \setbeamertemplate{section~in~toc}[gotham~bullet] + \setbeamertemplate{section~in~toc~shaded}[gotham~bullet] \setbeamertemplate{subsection~in~toc}[gotham~bullet] + \setbeamertemplate{subsection~in~toc~shaded}[gotham~bullet] \setbeamertemplate{subsubsection~in~toc}[gotham~bullet] + \setbeamertemplate{subsubsection~in~toc~shaded}[gotham~bullet] \setbeamertemplate{background~canvas}[toc/gotham~simple] } % \end{macrocode} @@ -4283,8 +4463,11 @@ \defbeamertemplate{toc~part~frame}{gotham~simple}{ \setbeamertemplate{part~in~toc}[gotham~simple] \setbeamertemplate{section~in~toc}[gotham~simple] + \setbeamertemplate{section~in~toc~shaded}[gotham~simple] \setbeamertemplate{subsection~in~toc}[gotham~simple] + \setbeamertemplate{subsection~in~toc~shaded}[gotham~simple] \setbeamertemplate{subsubsection~in~toc}[gotham~simple] + \setbeamertemplate{subsubsection~in~toc~shaded}[gotham~simple] \setbeamertemplate{background~canvas}[toc~part~gotham] \setbeamertemplate{frametitle}[toc~gotham] % \usebeamertemplate*{part~page}% already included @@ -4292,8 +4475,11 @@ \defbeamertemplate{toc~section~frame}{gotham~simple}{ \setbeamertemplate{part~in~toc}[gotham~simple] \setbeamertemplate{section~in~toc}[gotham~simple] + \setbeamertemplate{section~in~toc~shaded}[gotham~simple] \setbeamertemplate{subsection~in~toc}[gotham~simple] + \setbeamertemplate{subsection~in~toc~shaded}[gotham~simple] \setbeamertemplate{subsubsection~in~toc}[gotham~simple] + \setbeamertemplate{subsubsection~in~toc~shaded}[gotham~simple] \setbeamertemplate{background~canvas}[toc~section~gotham] \setbeamertemplate{frametitle}[toc~gotham]% % \usebeamertemplate*{section~page}% already included @@ -4301,8 +4487,11 @@ \defbeamertemplate{toc~subsection~frame}{gotham~simple}{ \setbeamertemplate{part~in~toc}[gotham~simple] \setbeamertemplate{section~in~toc}[gotham~simple] + \setbeamertemplate{section~in~toc~shaded}[gotham~simple] \setbeamertemplate{subsection~in~toc}[gotham~simple] + \setbeamertemplate{subsection~in~toc~shaded}[gotham~simple] \setbeamertemplate{subsubsection~in~toc}[gotham~simple] + \setbeamertemplate{subsubsection~in~toc~shaded}[gotham~simple] \setbeamertemplate{background~canvas}[toc~subsection~gotham] \setbeamertemplate{frametitle}[toc~gotham] % \usebeamertemplate*{subsection~page}% already included @@ -4320,8 +4509,11 @@ \defbeamertemplate{toc~part~frame}{gotham~bullet}{ \setbeamertemplate{part~in~toc}[gotham~bullet] \setbeamertemplate{section~in~toc}[gotham~bullet] + \setbeamertemplate{section~in~toc~shaded}[gotham~bullet] \setbeamertemplate{subsection~in~toc}[gotham~bullet] + \setbeamertemplate{subsection~in~toc~shaded}[gotham~bullet] \setbeamertemplate{subsubsection~in~toc}[gotham~bullet] + \setbeamertemplate{subsubsection~in~toc~shaded}[gotham~bullet] \setbeamertemplate{background~canvas}[toc~part~gotham] \setbeamertemplate{frametitle}[toc~gotham] % \usebeamertemplate*{part~page}% already included @@ -4329,8 +4521,11 @@ \defbeamertemplate{toc~section~frame}{gotham~bullet}{ \setbeamertemplate{part~in~toc}[gotham~bullet] \setbeamertemplate{section~in~toc}[gotham~bullet] + \setbeamertemplate{section~in~toc~shaded}[gotham~bullet] \setbeamertemplate{subsection~in~toc}[gotham~bullet] + \setbeamertemplate{subsection~in~toc~shaded}[gotham~bullet] \setbeamertemplate{subsubsection~in~toc}[gotham~bullet] + \setbeamertemplate{subsubsection~in~toc~shaded}[gotham~bullet] \setbeamertemplate{background~canvas}[toc~section~gotham] \setbeamertemplate{frametitle}[toc~gotham]% % \usebeamertemplate*{section~page}% already included @@ -4338,8 +4533,11 @@ \defbeamertemplate{toc~subsection~frame}{gotham~bullet}{ \setbeamertemplate{part~in~toc}[gotham~bullet] \setbeamertemplate{section~in~toc}[gotham~bullet] + \setbeamertemplate{section~in~toc~shaded}[gotham~bullet] \setbeamertemplate{subsection~in~toc}[gotham~bullet] + \setbeamertemplate{subsection~in~toc~shaded}[gotham~bullet] \setbeamertemplate{subsubsection~in~toc}[gotham~bullet] + \setbeamertemplate{subsubsection~in~toc~shaded}[gotham~bullet] \setbeamertemplate{background~canvas}[toc~subsection~gotham] \setbeamertemplate{frametitle}[toc~gotham] % \usebeamertemplate*{subsection~page}% already included @@ -4840,7 +5038,7 @@ %\begin{implementation} % \begin{macrocode} %<*outer> -\ProvidesExplPackage{beamerouterthemegotham}{2024-11-11}{1.2.0.a}{gotham outer theme} +\ProvidesExplPackage{beamerouterthemegotham}{2025-02-11}{1.2.1.c}{gotham outer theme} \RequirePackage{expl3} \RequirePackage{xfp} \RequirePackage{calc} @@ -5094,8 +5292,8 @@ % \begin{macrocode} % sidebar lengths \newlength{\sidebarRightHOffset} -\setlength{\sidebarRightHOffset}{-2.5ex} \newlength{\sidebarLeftHOffset} +\setlength{\sidebarRightHOffset}{-2.5ex} \setlength{\sidebarLeftHOffset}{+0.5ex} % \end{macrocode} % \end{variable} @@ -5846,7 +6044,7 @@ % \end{implementation} % \begin{documentation} -% \begin{variable}{\gothamFootlineVOffset, \gothamFootlineHRightOffset,\gothamFootlineHeight, \gothamFootlineDepth} +% \begin{variable}[updated=2024-11-11]{\gothamFootlineVOffset, \gothamFootlineHRightOffset,\gothamFootlineHeight, \gothamFootlineDepth} % Lengths controlling the position of |footline|. % |\gothamFootlineVOffset| is controlling vertical space between to bottom of the text (or the footnote) and the footline. % |\gothamFootlineVOffset| is by default -0.5ex, to have more space in the frame but if the footer is not really used, the space can be even more optimized using |\setlength{\gothamFootlineVOffset}{-2.0ex}|. @@ -5857,7 +6055,7 @@ % \end{documentation} %%%%%% % \begin{implementation} -% \begin{variable}{\gothamFootlineVOffset, \gothamFootlineHeight, \gothamFootlineDepth} +% \begin{variable}[updated=2024-11-11]{\gothamFootlineVOffset, \gothamFootlineHeight, \gothamFootlineDepth} % Lengths used in |footline| template. % \begin{macrocode} % Footline lengths @@ -8716,7 +8914,6 @@ % \begin{macrocode} %<*package> \RequirePackage{expl3} -\RequirePackage{xparse} % \RequirePackage{ifxetex} % \RequirePackage{ifluatex} % \RequirePackage{etoolbox} @@ -8871,7 +9068,84 @@ % % \end{macrocode} % \end{implementation} -% + +% \begin{documentation} +% \begin{function}{\gothamreset} +% \begin{syntax} +% \cs{gothamreset} +% \end{syntax} +% Command to reset gotham to default. Mainly useful when other theme have left some definitions. +% \end{function} +% \end{documentation} +%%%%%% +% \begin{implementation} +% \begin{function}{\gothamreset} +% \begin{arguments} +% \item |height| of the picture +% \end{arguments} +% Command to be redefined by users. +% \TestFiles{ gotham-test-046b} +% \begin{macrocode} +\DeclareDocumentCommand{\gothamreset}{m}{ + % commands + \renewcommand{\gothamInstituteLogoSquare}[1][4ex]{ } + \renewcommand{\gothamInstituteLogoCircle}[1][4ex]{ } + \renewcommand{\gothamHookPostColorBGSet}{ + \colorlet{colorStandout}{colorA} + \colorlet{colorFrametitle}{colorA} + \colorlet{colorProgBar}{colorC} + \setbeamercolor{frametitle}{ + use=primary~palette, + parent=primary~palette, + bg=colorFrametitle, + fg=colorBG + } + \setbeamercolor{standout}{bg=colorStandout, fg=colorPale} + } + \renewcommand{\gothamtitlepagelogo}{} + \renewcommand{\gothamtitlepagebg}{} + \renewcommand{\gothamRightFiligrane}{} + \renewcommand{\gothamLeftFiligrane}{} + \renewcommand{\gothamHookFooter}{} + + % lengths + \setlength{\gothamProgressSectionHeight}{3pt} + \setlength{\sectionhoffset}{0pt} + \setlength{\sidebarRightHOffset}{-2.5ex} + \setlength{\sidebarLeftHOffset}{+0.5ex} + \setlength{\gothamFrametitleToppading}{2.2ex} + \setlength{\gothamFrametitleBottompading}{2.2ex} + \setlength{\gothamFrametitleLeftpading}{2.2ex} + \setlength{\gothamFrametitleRightpading}{2.2ex} + \setlength{\gothamFramesubtitleStrutend}{0pt} + \setlength{\gothamFootlineVOffset}{-0.5ex} + \setlength{\gothamFootlineDepth}{0.1ex} + \setlength{\gothamFootlineHeight}{1.5ex} + \setlength{\gothamFootlineHRightOffset}{\spaceskip} + \setlength{\gothamHposLeftRotFooter}{-7pt} + \setlength{\gothamHposRightRotFooter}{2pt} + \setlength{\gothamVposLeftRotFooter}{15pt} + \setlength{\gothamVposRightRotFooter}{15pt} + \setlength{\gothamLeftFooterPadding}{2.0ex} + \setlength{\gothamRightFooterPadding}{3.5ex} + \setlength{\gothamFooterHOffset}{0pt} + \setlength{\gothamFootlineRuleLeftPadding}{7mm} + \setlength{\gothamFootlineRuleHeight}{0.0pt} + \setlength{\gothamFootlineRuleLength}{15mm} + \setlength{\gothamProgressCircHeight}{1.8\baselineskip} + \setlength{\gothamCounterCircleRadius}{1.12ex} + \setlength{\gothamProgressCircBorderWidth}{1.65mm} + \setlength{\gothamCircleNumberingVshift}{1.4mm} + \setlength{\gothamCircleNumberingHshift}{2.6mm} + \setlength{\gothamProgressHeadFootLineheight}{1.2ex} + + % options to default + \keys_set:nn { gotham/all/all } { default } +} +% \end{macrocode} +% \end{function} +% \end{implementation} + % \begin{implementation} % \begin{macrocode} %\endinput diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham.pdf Binary files differindex 63fa4d5eb4..772c89767d 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/gotham.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/section-Gotham.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/section-Gotham.tex index 8267e1cf14..4c237c99d4 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/section-Gotham.tex +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-gotham/section-Gotham.tex @@ -4,49 +4,53 @@ \usepackage{standalone} \usepackage{tikz} \usepackage{pgfplots} - \usepackage{tabularray} % Typeset tabulars and arrays (contains equivalent of longtable, booktabs and dcolumn at least) + \usepackage{tabularray} % Typeset tabulars and arrays (contains equivalent of longtable, booktabs and dcolumn at least) \UseTblrLibrary{booktabs} % to load extra commands from booktabs \usepackage{changepage} + \usepackage{minted} + \definecolor{codeback}{rgb}{0.90,0.91,0.92} + \definecolor{codebackdark}{rgb}{0.10,0.11,0.12} + \newcommand{\famName}[1]{\textsc{#1}} \newcommand{\themename}{\textbf{\textsc{Gotham}}} -\begin{document} +\begin{document} \section{Gotham Theme} % FRAME - \begin{frame}[fragile]{Gotham} - - The \themename{} theme is a Beamer theme with a minimal-ish visual style largely inspired by the \href{https://github.com/matze/mtheme}{\textsc{Metropolis} Beamer Theme} by Matthias Vogelgesang (and some other Beamer themes). + \begin{frame}[fragile]{Gotham package} + + The \themename{} theme is a Beamer theme with a minimal-ish visual style largely inspired by the \href{https://github.com/matze/mtheme}{\textsc{Metropolis} Beamer Theme} by Matthias \famName{Vogelgesang} (and some other Beamer themes). Yet, \themename{} is highly extendable and versatile. \bigskip - + First, enable the theme by classically loading it: - - \begin{verbatim} + + \begin{minted}{tex} \documentclass{beamer} \usetheme{gotham} - \end{verbatim} - - Then, the all customization can be performed at any moment in the presentation using: + \end{minted} + + Then, all the customization can be performed at any moment in the presentation using: - \begin{verbatim} + \begin{minted}{tex} \gothamset{<option>=...} - \end{verbatim} + \end{minted} \end{frame} \subsection{Fonts} - % FRAME + % FRAME \begin{frame}[fragile]{Gotham title formats} Note, that you have to have Mozilla's \emph{Fira Sans} font and XeTeX or LuaTeX installed to enjoy this wonderful typography. \begin{columns}[T,onlytextwidth] \column{0.49\textwidth} - \themename{} supports 4 different title formats \verb|\gothamset{format frametitle=}| + \themename{} supports 4 different title formats \mintinline{tex}|\gothamset{format frametitle=}| \begin{itemize} \item regular \item \MakeLowercase{Lower} @@ -54,42 +58,36 @@ \item \MakeTitlecase{Title Case} \end{itemize} \column{0.49\textwidth} - \themename{} supports 3 different title shape \verb|\gothamset{shape frametitle=...}|: + \themename{} supports 3 different title shape \mintinline{tex}|\gothamset{shape frametitle=...}|: \begin{itemize} \item regular \item \textsc{Small caps} \item \textit{italic} \end{itemize} \end{columns} - + \vspace{2em} They can either be set at once for every title type or individually. \end{frame} - { \gothamset{shape frametitle=smallcaps, format frametitle=titlecase} + { \gothamset{format frametitle=upper, shape frametitle=italic} % FRAME - \begin{frame}{Titles: Small caps and titlecase} - This frame uses the title format options: \texttt{shape frametitle=smallcaps, format frametitle=titlecase}. - - \begin{alertblock}{Potential Problems} - Be aware that not every font supports small caps. - If for example you typeset your presentation with pdfTeX and the Computer Modern Sans Serif font, every text in small caps will be typeset with the Computer Modern Serif font instead. - Please refer to the documentation if you consider using it. - - As a rule of thumb: just use it for plaintext-only titles. - \end{alertblock} + \begin{frame}{Titles: Upper and italic} + This frame uses the title format options: \mintinline{tex}|format frametitle=upper|, \mintinline{tex}|shape frametitle=italic|. \end{frame} } - { \gothamset{format frametitle=upper, shape frametitle=italic} + { \gothamset{shape frametitle=smallcaps, format frametitle=titlecase} % FRAME - \begin{frame}{Titles: Upper and italic} - This frame uses the title format options: \texttt{format frametitle=upper, shape frametitle=smallcaps}. - - \begin{alertblock}{Potential problems} - As this title format also uses small caps you face the same problems as with the \texttt{smallcaps} title format. - Additionally this format can cause some other problems. + \begin{frame}{Titles: Small caps and titlecase} + This frame uses the title format options: \mintinline{tex}|shape frametitle=smallcaps|, \mintinline{tex}|format frametitle=titlecase|. + + \begin{alertblock}{Potential Problems} + Be aware that not every font supports small caps. + If for example you typeset your presentation with pdfTeX and the Computer Modern Sans Serif font, every text in \mintinline{tex}{smallcaps} will be typeset with the Computer Modern Serif font instead. Please refer to the documentation if you consider using it. + + As a rule of thumb: just use it for plaintext-only titles. \end{alertblock} \end{frame} } @@ -97,7 +95,7 @@ { \gothamset{format frametitle=lower} % FRAME \begin{frame}{Titles: LOWER and regular} - This frame uses the title format options: \texttt{format frametitle=lower, shape frametitle=regular}. + This frame uses the title format options: \mintinline{tex}{format frametitle=lower}, \mintinline{tex}{shape frametitle=regular}. \end{frame} } @@ -108,188 +106,210 @@ % FRAME \begin{frame}[fragile]{Presentation style via background color} The color mode (a.k.a. background color) can be changed using: - \begin{verbatim} \gothamset{background=dark | light | transparent} \end{verbatim} + \begin{minted}[bgcolor=codebackdark]{tex} + \gothamset{background=dark | light | transparent} + \end{minted} \end{frame} } - % FRAME + % FRAME \begin{frame}[fragile]{Blocks} Three different block environments are pre-defined and may be styled with an optional background color. - + \begin{columns}[T,onlytextwidth] - \column{0.3\textwidth} - \begin{verbatim}\gothamset{ - block=native}\end{verbatim} + \column{0.3\textwidth} + \begin{minted}{tex} + \gothamset{ + block=native} + \end{minted} - \begin{block}{Default} - Block content. - \end{block} - - \begin{alertblock}{Alert} - Block content. - \end{alertblock} - - \begin{exampleblock}{Example} - Block content. - \end{exampleblock} - - \column{0.3\textwidth} - - \gothamset{block=transparent} - \begin{verbatim}\gothamset{ - block=transparent}\end{verbatim} - - \begin{block}{Default} - Block content. - \end{block} - - \begin{alertblock}{Alert} - Block content. - \end{alertblock} - - \begin{exampleblock}{Example} - Block content. - \end{exampleblock} + \gothamset{block=native} + \begin{block}{Default} + Block content. + \end{block} + + \begin{alertblock}{Alert} + Block content. + \end{alertblock} + + \begin{exampleblock}{Example} + Block content. + \end{exampleblock} \column{0.3\textwidth} - - \gothamset{block=fill} - \begin{verbatim}\gothamset{ - block=fill}\end{verbatim} - - \begin{block}{Default} - Block content. - \end{block} - - \begin{alertblock}{Alert} - Block content. - \end{alertblock} - - \begin{exampleblock}{Example} - Block content. - \end{exampleblock} - + + \gothamset{block=transparent} + \begin{minted}{tex} + \gothamset{ + block=transparent} + \end{minted} + + \begin{block}{Default} + Block content. + \end{block} + + \begin{alertblock}{Alert} + Block content. + \end{alertblock} + + \begin{exampleblock}{Example} + Block content. + \end{exampleblock} + + \column{0.3\textwidth} + + \gothamset{block=fill} + \begin{minted}{tex} + \gothamset{ + block=fill} + \end{minted} + + \begin{block}{Default} + Block content. + \end{block} + + \begin{alertblock}{Alert} + Block content. + \end{alertblock} + + \begin{exampleblock}{Example} + Block content. + \end{exampleblock} + \end{columns} \end{frame} + {\gothamset{colorset=red} % FRAME \begin{frame}[fragile]{Color customization} - The colors can be changed using: - \begin{verbatim} - \colorlet{colorPale}{gPaleYell} % BG in light/normal mode - \colorlet{colorDark}{gDarkBlack} % FG in light/normal mode - \colorlet{colorA}{gDarkTeal} % frametitle, standin.out, - \colorlet{colorAreversed}{gLightTeal} % frametitle, standin.in, - \colorlet{colorB}{gMidGrey} % gray BG : progress bar, blocks - \colorlet{colorC}{gDeepYellOr} % progress bar - \colorlet{colorD}{gLightOrange} % alert - \colorlet{colorE}{gLightGreen} % example - \end{verbatim} + The color theme can be used only in preamble with \mintinline{tex}|\usecolortheme{wolverine}| and without guarantees on the visual aspect. + + \themename{} offers predefined color setup at any time through \mintinline{tex}|\gothamset{colorset=red}| + + Otherwise, the colors can be changed manually using: + \begin{minted}{tex} + \colorlet{colorPale}{gPaleYell} % BG in light/normal mode + \colorlet{colorDark}{gDarkBlack} % FG in light/normal mode + \colorlet{colorA}{gDarkTeal} % frametitle, standin.out, + \colorlet{colorAreversed}{gLightTeal} % frametitle, standin.in, + \colorlet{colorB}{gMidGrey} % gray BG : progress bar, blocks + \colorlet{colorC}{gDeepYellOr} % progress bar + \colorlet{colorD}{gLightOrange} % alert + \colorlet{colorE}{gLightGreen} % example + \end{minted} \end{frame} + } \subsection{Inner} % FRAME \begin{frame}[fragile]{Title page} - \themename{} offers the possibility to adapt the title page layout (printed with \verb|\maketitle| or \verb|\titlepage|). + \themename{} offers the possibility to adapt the title page layout (printed with \mintinline{tex}|\maketitle| or \mintinline{tex}|\titlepage|). This can be achieved using: + \begin{minted}{tex} + \defbeamertemplate{title page}{your name}{your defintion} + \gothamset{title page= your name} + \end{minted} - \begin{verbatim} \defbeamertemplate{title page}{your name}{your defintion} - \gothamset{title page= your name}\end{verbatim} - - \themename{} also predefined several templates such as: - \verb$gotham normal | gotham splitvert | gotham dividedpic$ \verb$| gotham reversed$ + \themename{} also predefined several templates such as: + \mintinline{tex}$gotham normal$ | \mintinline{tex}$gotham splitvert$ | \mintinline{tex}$gotham dividedpic$ | \mintinline{tex}$gotham reversed$ \end{frame} % FRAME \begin{frame}[fragile]{Table of contents} - \themename{} come with the possibility to apply different style for your table of contents (ToC) page. + \themename{} comes with the possibility to apply different styles for your table of contents (ToC) page. You can define your own ToC style as it follows: - \begin{verbatim} + \begin{minted}{tex} \defbeamertemplate{toc page}{your name}{your def} \gothamset{tocframe template= your name} - \end{verbatim} - Then, referring to this template using the frame option \verb|[toc]| in your presentation: - \begin{verbatim} + \end{minted} + Then, referring to this template using the frame option \mintinline{tex}|[toc]| in your presentation: + \begin{minted}{tex} \begin{frame}[toc]{Table of contents} \tableofcontents%[hideallsubsections] - \end{frame }\end{verbatim} + \end{frame } + \end{minted} - Or using one of the \themename{} predefined template, such as: \verb$gotham simple | gotham bullet$ + Or using one of the \themename{} predefined templates, such as: \mintinline{tex}$gotham simple | gotham bullet$ \end{frame} % FRAME \begin{frame}[fragile]{Sections} - \themename{} provides a multiple options to tune sections (respectively \verb|part|, \verb|section|, \verb|subsection| and \verb|subsubsection|). - Thus, using the setting controls: - - The section command \verb|\section{Elements}| from Beamer will appear very differently. - The section page will appear or disappear thanks to: \verb$\gothamset{sectionframe default=<on|off>}$, while its layout (when appearing) is controlled by: - \begin{verbatim} + \themename{} provides a multiple options to tune sections (respectively \mintinline{tex}|part|, \mintinline{tex}|section|, \mintinline{tex}|subsection| and \mintinline{tex}|subsubsection|). + + The section command \mintinline{tex}|\section{Elements}| from Beamer will appear very different. + The section page will appear or disappear thanks to: \mintinline{tex}$\gothamset{sectionframe default=<on|off>}$, while its layout (when appearing) is controlled by: + \begin{minted}{tex} \defbeamertemplate{part|sub|subsub|section frame} {your name}{your def} - \gothamset{sectionframe template= your name}\end{verbatim} + \gothamset{sectionframe template= your name} + \end{minted} - \themename{} predefined template are: \verb$gotham progressbar | gotham simple |$ \verb$gotham splitvert progressbar |$ \verb$gotham splitvert simple | gotham progressvert$ + \themename{} predefined template are: \mintinline{tex}$gotham progressbar | gotham simple |$ \mintinline{tex}$gotham splitvert progressbar |$ \mintinline{tex}$gotham splitvert simple | gotham progressvert$ \end{frame} % FRAME \begin{frame}[fragile]{Sections contents} - After the section page, you can (de)activate a page with table of contents in the section using \verb$\gothamset{sectiontocframe default=<on|off>}$, and its layout is controlled by: - \begin{verbatim} + After the section page, you can (de)activate a page with a table of contents for the section using \mintinline{tex}$\gothamset{sectiontocframe default=<on|off>}$, and its layout is controlled by: + \begin{minted}{tex} \defbeamertemplate{toc subsection frame}{your name}{your def} \gothamset{sectionframe template= your name} - \end{verbatim} + \end{minted} - \themename{} predefined template are: \verb$gotham simple | gotham bullet$ + \themename{} predefined template are: \mintinline{tex}$gotham simple | gotham bullet$ \end{frame} % FRAME \begin{frame}[fragile, watermark]{Watermark} With \themename{} you can locally or globally add watermark to your slides by using: - \begin{verbatim} \defbeamertemplate{background}{watermark/your name}{your def} - \gothamset{watermark template= your name}\end{verbatim} - - Then, this watermark can be turn on locally using \verb|\begin{frame}[watermark]| or globally with \verb|\gothamset{watermark default= on}| . - \end{frame} + \begin{minted}{tex} + \defbeamertemplate{background}{watermark/your name}{your def} + \gothamset{watermark template= your name} + \end{minted} + + Then, this watermark can be turned on locally using \mintinline{tex}|\begin{frame}[watermark]| or globally with \mintinline{tex}|\gothamset{watermark default= on}| . + \end{frame} % FRAME \begin{standinenv} \begin{frame}[fragile]{Standin} - \themename{} comes with 2 environments/specials layouts named \verb|standin| and \verb|standout|. - These specials layouts can be used to emphasize some content or last slide\textellipsis + \themename{} comes with 2 environments/special layouts named \mintinline{tex}|standin| and \mintinline{tex}|standout|. + These special layouts can be used to emphasize some content or last slide\textellipsis - This layout can be turn on using \verb|\begin{frame}[standin]| or using the dedicated environment (\verb|\begin{standinenv}\begin{frame}...\end{frame}\end{standinenv}|). + This layout can be turned on using \mintinline{tex}|\begin{frame}[standin]| or using the dedicated environment (\mintinline{tex}|\begin{standinenv}\begin{frame}...\end{frame}\end{standinenv}|). Note that the background can also be tuned using: - \begin{verbatim} \defbeamertemplate{background canvas}{standin/name}{your def} - \gothamset{standin BG template= name}\end{verbatim} - + \begin{minted}{tex} + \defbeamertemplate{background canvas}{standin/name}{your def} + \gothamset{standin BG template= name} + \end{minted} + \end{frame} \end{standinenv} % FRAME \begin{frame}[standout, watermark]{Standout} - Here is an example of standout (working as standin), that can be combined with a watermark. + Here is an example of standout (working as standin), which can be combined with a watermark. Another difference, apart the obvious color change is the font size and series. \end{frame} \subsection{Outer} - - {% - \setbeamertemplate{frame footer}{My custom footer} + + {\setbeamertemplate{frame footer}{My custom footer} % FRAME \begin{frame}[fragile]{Frame footer} - \themename{} defines a custom Beamer template to add a text to the footer. + \themename{} defines a custom Beamer template to add a text to the footer. It can be set via - \begin{verbatim}\setbeamertemplate{frame footer}{My custom footer}\end{verbatim} + \begin{minted}{tex} + \setbeamertemplate{frame footer}{My custom footer} + \end{minted} - Even after redefining (or not) your frame footer template, you can locally remove it with the frame option \verb|\begin{frame}[nofooter]|. + Even after redefining (or not) your frame footer template, you can locally remove it with the frame option \mintinline{tex}|\begin{frame}[nofooter]|. \end{frame} } @@ -298,15 +318,19 @@ \author[your shortauthor name]{Romain NOËL} % FRAME \begin{frame}[fragile, rotateFooter]{rotateFooter} - The default footer from \themename{}, it displays the \verb|shortdate|, \verb|shorttitle| and \verb|shortauthor|. + The default footer from \themename{}, it displays the \mintinline{tex}|shortdate|, \mintinline{tex}|shorttitle| and \mintinline{tex}|shortauthor|. So by filling these fields in your document setup, you will see them appear in your footer: - \begin{verbatim} \title[your shorttitle]{Your title} + \begin{minted}{tex} + \title[your shorttitle]{Your title} \date[shortdate]{\today} - \author[your shortauthor name]{John DOE} \end{verbatim} - - Since, we always need some extra space on some frames that would like to overlay a bit the footer, \themename{}'s footer offers also possibility to be put on side locally using \verb|\begin{frame}[rotateFooter]|, or globally with - \begin{verbatim} \gothamset{rotateFooter default=on} \end{verbatim} - If it has set globally, it can be deactivated locally with the frame option \verb|\begin{frame}[norotateFooter]|. + \author[your shortauthor name]{John DOE} + \end{minted} + + Since we always need some extra space on some frames that would like to overlay a bit the footer, \themename{}'s footer also offers possibility to be put locally on the side using \mintinline{tex}|\begin{frame}[rotateFooter]|, or globally with + \begin{minted}{tex} + \gothamset{rotateFooter default=on} + \end{minted} + If it has set globally, it can be deactivated locally with the frame option \mintinline{tex}|\begin{frame}[norotateFooter]|. \end{frame} \title[]{Gotham} @@ -316,74 +340,77 @@ } % FRAME \begin{frame}[edging, fragile]{Edging} - \themename{} has two hook commands, \verb|\gothamRightFiligrane| and \verb|\gothamLeftFiligrane|, that can be redefined to customize what to display in the edgings (a.k.a. filigrane, a.k.a. sidebar). - As example, one could do: - \begin{verbatim} + \themename{} has two hook commands, \mintinline{tex}|\gothamRightFiligrane| and \mintinline{tex}|\gothamLeftFiligrane|, that can be redefined to customize what to display in the edgings (a.k.a. filigrane, a.k.a. sidebar). + As an example, one could do: + \begin{minted}{tex} \renewcommand{\gothamRightFiligrane}{% \rotatebox{90}{gotham right filigrane pattern} - }\end{verbatim} + } + \end{minted} - Then, to set if it should be displayed or not, globally \begin{verbatim} \gothamset{edging default=on} \end{verbatim} - or locally with the frame option \verb|\begin{frame}[edging]| or \verb|\begin{frame}[noedging]|. + Then, to set if it should be displayed or not, globally + \begin{minted}{tex} + \gothamset{edging default=on} + \end{minted} + or locally with the frame option \mintinline{tex}|\begin{frame}[edging]| or \mintinline{tex}|\begin{frame}[noedging]|. \end{frame} % FRAME % \begin{nofootlineenv} \begin{frame}[fragile,noedging,nofooter]{Really wide contents} \begin{adjustwidth}{-2em}{-2em} - If you want a really wide content in your frame, you can change the size of your margin (requires \verb|\usepackage{changepage}| in your preamble). - You can also suppress the edging (\verb|[noedging]|) and footer (\verb|[nofooter]|) or even more radically footline (\verb|[nofootline]|). + If you want a really wide content in your frame, you can change the size of your margin (requires \mintinline{tex}|\usepackage{changepage}| in your preamble). + You can also suppress the edging (\mintinline{tex}|[noedging]|) and footer (\mintinline{tex}|[nofooter]|) or even more radically footline (\mintinline{tex}|[nofootline]|). - Here is an example combining them: - \begin{verbatim} + Here is an example combining them: + \begin{minted}{tex} \begin{frame}[noedging,nofootline]{extended frame} \begin{adjustwidth}{-2em}{-2em}% 2em extra to the left and 2em for right margin. wide content \end{adjustwidth} \end{frame } - \end{verbatim} + \end{minted} \end{adjustwidth} \end{frame} % \end{nofootlineenv} {% \renewcommand{\gothamInstituteLogoSquare}[1][4ex]{% - \includegraphics[height=#1]{gotham-logo.pdf} - } + \includegraphics[height=#1]{gotham-logo.pdf} + } \logo{extra LOGO} % FRAME \begin{frame}[fragile]{Frametitle} \framesubtitle{with a subtitle} - The frametile template brought by \themename{} is relatively classic: it supports \verb|\subframetitle| and frame continuation (with \verb|[allowframebreaks]|) through templates that can be tuned. - Nevertheless, it the frametitle template also includes a hook for your institute logo in the top right corner, leaving the command \verb|\logo{}| free for your extra logos. - + The frametile template brought by \themename{} is relatively classic: it supports \mintinline{tex}|\subframetitle| and frame continuation (with \mintinline{tex}|[allowframebreaks]|) through templates that can be tuned. + Nevertheless, it the frametitle template also includes a hook for your institute logo in the top right corner, leaving the command \mintinline{tex}|\logo{}| free for your extra logos. + So, one can have both logos using: - \begin{verbatim} + \begin{minted}{tex} \renewcommand{\gothamInstituteLogoSquare}[1][4ex]{ \includegraphics[height=#1]{gotham-logo.pdf} } \logo{extra LOGO} - \end{verbatim} + \end{minted} \end{frame} } \author[]{Romain NOËL} - {% - \gothamset{progressbar position=foot, numbering= totalframenumber} + {\gothamset{progressbar position=left, progressbar style= rounded box, progressbar advancement= brlt, numbering= circle} % FRAME \begin{frame}[fragile]{Numbering and progressbar} - \themename{} theme can numbering your frames in the bottom right corner using different styles. + \themename{} theme can numbering your frames in the bottom right corner using different styles. You can also decide to use a progression bar to indicate how much of your presentation remains. The setup of numbering and progression bar can be performed through: - \begin{verbatim} + \begin{minted}{tex} \gothamset{numbering= totalframenumber, progressbar position=foot} - \end{verbatim} + \end{minted} - Numbering available options are: \verb$none | framenumber | totalframenumber | appendixframenumber | pagenumber | totalpagenumber | circle$ + Numbering available options are: \mintinline{tex}$none | framenumber | totalframenumber | appendixframenumber | pagenumber $ \mintinline{tex}$| totalpagenumber | circle$ - Progressbar position available options are: \verb$none | head | frametitle | foot | circlehead$ + Progressbar position available options are: \mintinline{tex}$none | head | frametitle | foot | circlehead | left | right$ \end{frame} } diff --git a/macros/latex/contrib/codedescribe/README.md b/macros/latex/contrib/codedescribe/README.md index 249baab436..331065b4ff 100644 --- a/macros/latex/contrib/codedescribe/README.md +++ b/macros/latex/contrib/codedescribe/README.md @@ -86,7 +86,10 @@ The Current Maintainer of this work is Alceu Frigeri ## Changelog -* Version 1.5 (this) +* Version 1.5b (this) + - fixing issue #2 (reverting `codesyntax` bug introduced by v1.5). + +* Version 1.5 - fixing issue #1 (misalignment when missing a `codesyntax` inner environment). * Version 1.4 diff --git a/macros/latex/contrib/codedescribe/doc/codedescribe.pdf b/macros/latex/contrib/codedescribe/doc/codedescribe.pdf Binary files differindex c585e77287..0543e0d887 100644 --- a/macros/latex/contrib/codedescribe/doc/codedescribe.pdf +++ b/macros/latex/contrib/codedescribe/doc/codedescribe.pdf diff --git a/macros/latex/contrib/codedescribe/doc/codedescribe.tex b/macros/latex/contrib/codedescribe/doc/codedescribe.tex index a647925796..2e15d85f57 100644 --- a/macros/latex/contrib/codedescribe/doc/codedescribe.tex +++ b/macros/latex/contrib/codedescribe/doc/codedescribe.tex @@ -15,7 +15,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.5} {2025/02/10} +%% This is version {1.5b} {2025/02/12} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/codedescribe diff --git a/macros/latex/contrib/codedescribe/latex/codedescribe.sty b/macros/latex/contrib/codedescribe/latex/codedescribe.sty index 37d5d7b46a..57321801df 100644 --- a/macros/latex/contrib/codedescribe/latex/codedescribe.sty +++ b/macros/latex/contrib/codedescribe/latex/codedescribe.sty @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.5} {2025/02/10} +%% This is version {1.5b} {2025/02/12} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/codedescribe @@ -22,8 +22,8 @@ \ProvidesExplPackage {codedescribe} - {2025/02/10} - {1.5} + {2025/02/12} + {1.5b} {LaTeX Code Description/Documentation} %%%%%%% @@ -36,8 +36,8 @@ { name .code:n = {codedescribe} , prefix .code:n = {codedesc} , - date .code:n = {2025/02/10} , - version .code:n = {1.5} , + date .code:n = {2025/02/12} , + version .code:n = {1.5b} , description .code:n = {\LaTeX~Code~Description/Documentation} } \cs_if_exist:NF \PkgInfo @@ -650,7 +650,7 @@ \coffin_new:N \l__codedesc_margin_coffin \coffin_new:N \l__codedesc_text_coffin \coffin_new:N \l__codedesc_syntax_coffin -\bool_new:N \l__codedesc_syntax_bool +\bool_new:N \g__codedesc_syntax_bool \dim_new:N \l__codedesc_syntax_wd_dim \dim_new:N \l__codedesc_margin_wd_dim @@ -754,7 +754,7 @@ \dim_set:Nn \l__codedesc_syntax_wd_dim {\l__codedesc_textcolwidth_dim} } \coffin_clear:N \l__codedesc_syntax_coffin - \bool_set_false:N \l__codedesc_syntax_bool + \bool_gset_false:N \g__codedesc_syntax_bool \vcoffin_set:Nnw \l__codedesc_text_coffin {\l__codedesc_textcolwidth_dim} \setlength\parindent{0pt} \begin{minipage}[t]{\l__codedesc_textcolwidth_dim} @@ -762,7 +762,7 @@ { \end{minipage} \vcoffin_set_end: - \bool_if:NF \l__codedesc_syntax_bool + \bool_if:NF \g__codedesc_syntax_bool { \vcoffin_gset:Nnn \l__codedesc_syntax_coffin {\l__codedesc_syntax_wd_dim} { @@ -816,7 +816,7 @@ \end{tabular} %\color{black} \vcoffin_gset_end: - \bool_set_true:N \l__codedesc_syntax_bool + \bool_gset_true:N \g__codedesc_syntax_bool } diff --git a/macros/latex/contrib/codedescribe/latex/codelisting.sty b/macros/latex/contrib/codedescribe/latex/codelisting.sty index c02c7511ee..d62f0fc5a2 100644 --- a/macros/latex/contrib/codedescribe/latex/codelisting.sty +++ b/macros/latex/contrib/codedescribe/latex/codelisting.sty @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.5} {2025/02/10} +%% This is version {1.5b} {2025/02/12} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/codedescribe @@ -22,8 +22,8 @@ \ProvidesExplPackage {codelisting} - {2025/02/10} - {1.5} + {2025/02/12} + {1.5b} {LaTeX Code Listing} %%%%%%% @@ -36,8 +36,8 @@ { name .code:n = {codelisting} , prefix .code:n = {codelist} , - date .code:n = {2025/02/10} , - version .code:n = {1.5} , + date .code:n = {2025/02/12} , + version .code:n = {1.5b} , description .code:n = {\LaTeX~Code~Listing} } \cs_if_exist:NF \PkgInfo diff --git a/macros/latex/contrib/easybook/README.md b/macros/latex/contrib/easybook/README.md index 67400381e8..a3bb2e031e 100644 --- a/macros/latex/contrib/easybook/README.md +++ b/macros/latex/contrib/easybook/README.md @@ -1,5 +1,5 @@ # The `easybook` document class -Easily typesetting Chinese theses or books (v2025m) +Easily typesetting Chinese theses or books (v2025n) ## Abstract `easybook` is a pure academic template created based on the `ctexbook` book document class. It also has the functions of `book` and `article` document class. Combined with the general framework design of the theses of many universities in China, providing multiple commands and interfaces allows users to easily customize the theses templates. Its basic macro package `easybase` can also be used with `ctex` and standard document classes. diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 3816ccacb0..c1260e6200 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -14,7 +14,7 @@ % This work has the LPPL maintenance status `maintained'. %<class|package>\NeedsTeXFormat{LaTeX2e}[2021/11/15] %<*class> -\ProvidesExplClass{easybook}{2025/02/11}{2025m} +\ProvidesExplClass{easybook}{2025/02/12}{2025n} {Easily typesetting Chinese theses or books} \bool_new:N \l__eb_compile_draft_bool @@ -308,7 +308,7 @@ %</class> %<*package> \RequirePackage{etoolbox} -\ProvidesExplPackage{easybase}{2025/02/11}{2025m} +\ProvidesExplPackage{easybase}{2025/02/12}{2025n} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -2817,13 +2817,8 @@ \cs_new_protected:Npn \eb_link_border_set:n #1 { - \AddToHook{package/hyperref/after}[eb/hyperref] - { - \Hy@colorlinksfalse - \def\@pdfborder{#1} - \def\Hy@colorlink ##1 {\begingroup} - \def\Hy@endcolorlink{\endgroup} - } + \hypersetup{colorlinks = false} + \def\@pdfborder{#1} } \cs_new_protected:Npn \eb_link_colors_set: { \hypersetup{colorlinks} } @@ -2869,9 +2864,9 @@ { linkcolor = ctex@link,linkbordercolor = ctex@link, urlcolor = ctex@url,urlbordercolor = ctex@url, - citecolor = ctex@cite,citebordercolor = ctex@cite + citecolor = ctex@cite,citebordercolor = ctex@cite, + bookmarksnumbered = true } - \hypersetup{bookmarksnumbered = true} \exp_args:NV \hypersetup \l__eb_hyperref_options_clist } @@ -3021,7 +3016,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2025/02/11}{2025m} +\ProvidesExplFile{eb-tcolorbox.cfg}{2025/02/12}{2025n} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf Binary files differindex 854aa8345b..bf26edf532 100644 --- a/macros/latex/contrib/easybook/easybook.pdf +++ b/macros/latex/contrib/easybook/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index 1369ed4003..faa9705a6c 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -23,8 +23,8 @@ name = easybook, color-scheme = blue, title = EASYBOOK使用手册, - version = v2025m, - date = 2025/02/11, + version = v2025n, + date = 2025/02/12, authors = 瞿毅, info = 简便地排版中文学位论文或书籍, email = toquyi@163.com, @@ -1603,7 +1603,7 @@ $\blacktriangleright$需要注意正确\textbf{编译索引}要增加 \code{-she \item 索引功能支持由适配 \pkg*{imakeidx} 宏包改为适配 \pkg*{indextools} 宏包。 \item \pkg*{caption} 宏包支持的图表等题注的目录选项支持 \cs{CTEXifname} 编号判断命令。 \end{version} - \shortversion{v = 2025m,date = 2025/02/11,changes = 优化 \module*{ref} 模块,修复选项 \keyis{linktype}{none} 失效的问题。} + \shortversion{v = 2025n,date = 2025/02/12,changes = 优化 \module*{ref} 模块,修复选项 \keyis{linktype}{none} 失效的问题。} \end{changelog} \nocite{*} % \AddToHook{cmd/printindex/before}{\clearpage} diff --git a/macros/latex/contrib/microtype/README.md b/macros/latex/contrib/microtype/README.md index 7ee121649c..9b6d9480fb 100644 --- a/macros/latex/contrib/microtype/README.md +++ b/macros/latex/contrib/microtype/README.md @@ -4,7 +4,7 @@ The `microtype` package **Subliminal refinements towards typographical perfection** - (v3.2 -- 2024/12/12) + (v3.2a -- 2025/02/11) Overview @@ -83,4 +83,4 @@ provided that: (1) the original copyright statement is not removed, and (2) the identification string is changed. ------------------------------------------------------ -Copyright (c) 2004--2024 R Schlicht `<w.m.l@gmx.net>` +Copyright (c) 2004--2025 R Schlicht `<w.m.l@gmx.net>` diff --git a/macros/latex/contrib/microtype/microtype-code.pdf b/macros/latex/contrib/microtype/microtype-code.pdf Binary files differindex 48d60076ae..755fc71474 100644 --- a/macros/latex/contrib/microtype/microtype-code.pdf +++ b/macros/latex/contrib/microtype/microtype-code.pdf diff --git a/macros/latex/contrib/microtype/microtype-utf.dtx b/macros/latex/contrib/microtype/microtype-utf.dtx index 4789976f6b..86b623551d 100644 --- a/macros/latex/contrib/microtype/microtype-utf.dtx +++ b/macros/latex/contrib/microtype/microtype-utf.dtx @@ -3,7 +3,7 @@ % ------------------------------------------------------------------------ % The `microtype' package % Subliminal refinements towards typographical perfection -% Copyright (c) 2004--2024 R Schlicht <w.m.l@gmx.net> +% Copyright (c) 2004--2025 R Schlicht <w.m.l@gmx.net> % % This work may be distributed and/or modified under the conditions of the % LaTeX Project Public License, either version 1.3c of this license or (at @@ -27,7 +27,7 @@ \ProvidesFile %</!EBGaramond> %<*driver> - {\jobname.dtx}[2024/12/12 v3.2] + {\jobname.dtx}[2025/02/11 v3.2a] %</driver> %<CharisSIL> {mt-CharisSIL.cfg}[2017/07/07 v1.1 microtype config. file: Charis SIL (RS)] %<LatinModernRoman> {mt-LatinModernRoman.cfg}[2021/02/21 v1.1 microtype config. file: Latin Modern Roman (RS)] diff --git a/macros/latex/contrib/microtype/microtype.dtx b/macros/latex/contrib/microtype/microtype.dtx index 5b5e535646..a88329893e 100644 --- a/macros/latex/contrib/microtype/microtype.dtx +++ b/macros/latex/contrib/microtype/microtype.dtx @@ -3,7 +3,7 @@ % ------------------------------------------------------------------------ % The `microtype' package % Subliminal refinements towards typographical perfection -% Copyright (c) 2004--2024 R Schlicht <w.m.l@gmx.net> +% Copyright (c) 2004--2025 R Schlicht <w.m.l@gmx.net> % % This work may be distributed and/or modified under the conditions of the % LaTeX Project Public License, either version 1.3c of this license or (at @@ -37,7 +37,7 @@ %<lua-> {microtype-luatex.def} %<xe-> {microtype-xetex.def} %<*package|letterspace|m-t|pdf-|lua-|xe-|show> - [2024/12/12 v3.2 + [2025/02/11 v3.2a %<package> Micro-typographical refinements %<letterspace> Robust letterspacing %<show> Visual debugging for the microtype package @@ -52,8 +52,8 @@ %<luafile>local microtype = microtype %<luafile>microtype.module = { %<luafile> name = "microtype", -%<luafile> version = "3.2", -%<luafile> date = "2024/12/12", +%<luafile> version = "3.2a", +%<luafile> date = "2025/02/11", %<luafile> description = "microtype module.", %<luafile> author = "E. Roux, R. Schlicht and P. Gesang", %<luafile> copyright = "E. Roux, R. Schlicht and P. Gesang", @@ -671,7 +671,7 @@ pdfkeywords={TeX, LaTeX, pdfTeX, LuaTeX, XeTeX, typography, micro-typography, character protrusion, margin kerning, optical alignment, font expansion, font scaling, hz, kerning, spacing, glue, letterspacing, tracking, ligatures}, - pdfcopyright={\textcopyright\ 2004--2024 R Schlicht\textLF + pdfcopyright={\textcopyright\ 2004--2025 R Schlicht\textLF This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version.\textLF @@ -966,7 +966,7 @@ % other extensions (see section~\ref{sec:lettersp}\ifcodedoc\space of the User manual\fi). % %\bigskip\noindent -% This package is copyright \textcopyright\ 2004\kern.09em--2024 R Schlicht. +% This package is copyright \textcopyright\ 2004\kern.09em--2025 R Schlicht. % It may be distributed and/or modified under the conditions of the % \IfFileExists{lppl.tex}{\hyperref[LPPL:LPPL]}{\href{https://www.latex-project.org/lppl/}} % {\LaTeX\ Project Public License}, @@ -1198,8 +1198,8 @@ % the active font set (by default, all small capitals). % With \pdftex, it is only available in <PDF> mode. % -%^^A\medskip %\pagebreak ^^A layout +%\medskip %\Describe{Option}{kerning}{true,!false,:font set name} %\DescribeOption{spacing} % These features do not unconditionally improve the quality of the typeset text: @@ -1373,7 +1373,6 @@ % in case you are using a pre-1.40 \pdftex\ version, \opt{step} is by default % set to one fifth of the smaller value of \opt{stretch} and \opt{shrink}. % -%\enlargethispage{\baselineskip} ^^A layout %\medskip %\Describe{Option}{selected}{true,!false} % When applying font expansion, it is possible to restrict the expansion of some @@ -1417,13 +1416,14 @@ %\medskip %\Describe{Option}{verbose}{true,!false,errors,silent} % Information on the settings used for each font will be written into the log -% file if you enable the \opt{verbose} option. When \microtype\ encounters a -% problem that is not fatal (\eg, an unknown character in the settings, or -% non-existent settings), it will by default only issue a warning and try to -% continue. Loading the package with |verbose=errors| will turn all warnings -% into errors, so that you can be sure that no problem will go unnoticed. If on -% the other hand you have investigated all warnings and decide to ignore them, -% you may silence \microtype\ with |verbose=silent|. +% file if you enable the \opt{verbose} option. This is useful for debugging. +% When \microtype\ encounters a problem that is not fatal (\eg, an unknown +% character in the settings, or non-existent settings), it will by default +% only issue a warning and try to continue. Loading the package with +% |verbose=errors| will turn all warnings into errors, so that you can be sure +% that no problem will go unnoticed. If, on the other hand, you have +% investigated all warnings and decide to ignore them, you may silence +% \microtype\ with |verbose=silent|. % %\medskip %\Describe{Option}{babel}{true,!false} @@ -1449,7 +1449,7 @@ % instead, it is recommended to just call the respective program (|latex| resp. % |dvilualatex|). %\changes{v2.8}{2020/04/02}{declare \opt{DVIoutput} option deprecated} -% For \xetex, this option is not applicable.\looseness=-1 ^^A layout +% For \xetex, this option is not applicable. % %\iffalse %\changes{v1.5}{2004/12/15}{add note about \opt{DVIoutput} option} @@ -1559,7 +1559,6 @@ % words, this is equivalent to specifying \emph{all} possible values for that % attribute. % Therefore, the predefined set `|alltext|', which is declared as: -%\enlargethispage{\baselineskip} ^^A layout %\begin{verbatim} %\DeclareMicrotypeSet{alltext} % { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2,TU} } @@ -1754,7 +1753,7 @@ % normal weight (|T1//m/it/|), the settings for the |cmr| family would apply. %\changes{v1.7}{2005/03/23}{remove table of match order % (now table~\ref{tab:match-order} on page~\pageref{tab:match-order})} -% The encoding must always match. +% The encoding must always match.\looseness=-1 ^^A layout %\iffalse %^^A TODO: When using native TrueType\slash OpenType fonts (with \xetex\ or \luatex, and %^^A the \pkg{fontspec} package), you may additionally restrict the settings to @@ -2086,6 +2085,7 @@ % % \lssample % +%\enlargethispage{\baselineskip}^^A layout %\noindent % While the word `Stop' is not letterspaced, the space between the letters in % the other two words is expanded by the \showarrow[tracking]{tracking~amount}{red} @@ -2180,7 +2180,6 @@ % \par % For example, you can find the following settings, intended to be used % for documents written in French, in the main configuration file: -%\pagebreak ^^A layout %\begin{verbatim}[deletekeywords={[1]{unit}}] %\SetExtraKerning % [ name = french-default, @@ -2484,7 +2483,6 @@ %}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox %\end{table} % -%\enlargethispage{\baselineskip} ^^A layout %\medskip %\Describe{Macro}{\DeclareMicrotypeVariants}{list of suffixes} %\DescribeMacro{\DeclareMicrotypeVariants*} @@ -2525,7 +2523,6 @@ % section~\ref{sub:hook}.} % This command will load the file `|mt-|\meta{font name}|.cfg|'. % -%\enlargethispage{\baselineskip} ^^A layout %\medskip %\Describe{Macro}{\DeclareMicrotypeFilePrefix}{prefix} % Or, in fact, it will load the file `\meta{prefix}|-|\meta{font name}|.cfg|'. @@ -2717,7 +2714,6 @@ % (which does not support package options) simply \cmd\input\ \file{letterspace.sty}. % % -%\pagebreak ^^A layout %\section[Disabling ligatures] % {Disabling ligatures \requires{\pdftex~1.30,\luatex~0.30}} % \label{sec:disable-ligatures} @@ -2809,7 +2805,7 @@ % \MTsupp{\cls{memoir}} % \item[footnote] Protrusion for the first line of footnote text (visible in particular % when the footnote text is set in block paragraphs, like in this document). -% \MTsupp{\cls{memoir}, <\cls{KOMA}> classes, \cls{beamer}, \pkg{hyperref}} +% \MTsupp{\cls{memoir}, <\cls{KOMA}> classes, \cls{beamer}, \pkg{changebar}, \pkg{fnbreak}, \pkg{hyperref}} % \item[verbatim] Disables protrusion and expansion in verbatim environments. % \MTsupp{\pkg{alltt}} % \item[eqnum] Protrusion for equation numbers on either side. If you are using the @@ -3387,7 +3383,7 @@ % \contributor Nelson Lago <@\at @>, ^^A https://github.com/urrameu % \contributor Brian Dunn <@\at @>, ^^A https://github.com/bdtc % \contributor Ralf Steinle <rasteinle\at web.de>, -% \contributor Denis Bitouz\'e <@\at @>, ^^A https://tex.stackexchange.com/users/18401/denis-bitouz%c3%a9 +% \contributor Denis Bitouz\'e <dbitouze\at wanadoo.fr>, ^^A https://tex.stackexchange.com/users/18401/denis-bitouz%c3%a9, https://github.com/dbitouze % \contributor Christophe Dervieux <@\at @>, ^^A https://github.com/cderv % \contributor Scott Kostyshak <@\at @>, ^^A https://github.com/scottkosty % \contributor Shen Zhou Hong <@\at @>, ^^A https://github.com/ShenZhouHong @@ -3406,9 +3402,12 @@ % \contributor Aleksandr Petrosyan <@\at @>, ^^A https://github.com/appetrosyan % \contributor Didier Verna <@\at @>, ^^A https://tex.stackexchange.com/users/24506/didier-verna % `\contributor nowox <@\at @>', ^^A https://tex.stackexchange.com/users/85416/nowox -% `\contributor hpvd <@\at @>' ^^A https://github.com/hpvd +% `\contributor hpvd <@\at @>', ^^A https://github.com/hpvd +% \contributor Mark Collins <@\at @>, ^^A https://github.com/Marcool04 +% \contributor Nick Bart <@\at @>, ^^A https://github.com/njbart +% `\contributor Rimole <@\at @>' ^^A https://github.com/Rimole % and -% \contributor Mark Collins <@\at @>. ^^A https://github.com/Marcool04 +% \contributor Clea F. Rees <@\at @>. % %\iffalse %\section{History of micro-typography} ^^A some time ... @@ -3550,7 +3549,9 @@ % %\begin{History} % -%\Version{\expandafter\@gobble\fileversion}{\filedate} +%\VersionDate{\expandafter\@gobble\fileversion}{\filedate} +% +%\Version{3.2}{2024/12/12} % \item Support for tracking/letterspacing with \xetex\ % \refsection{\ref{sub:options-microtype}, \ref{sub:tracking}, \ref{sec:lettersp}} % \item New default for letterspacing: \MT@letterspace@default\space \refsection{\ref{sub:options-tracking}} @@ -3983,6 +3984,7 @@ %^^A \do@subst@correction,\f@encoding,\f@family,\f@size,\font@name,\fontencoding, %^^A \fontseries,\fontshape,\glb@currsize,\glb@settings,\normalfont,\pickup@font, %^^A \remove@tlig,\selectfont,\seriesdefault,\shapedefault,\set@fontsize,\showhyphens} ^^A latex +%\DoNotIndex{\ExplSyntaxOff,\ExplSyntaxOn} ^^A latex3 %\DoNotIndex{\normalpdfoutput,\normalpdftexversion,\normalpdftexrevision} ^^A tex live 2004 %\DoNotIndex{\alltt} ^^A alltt %\DoNotIndex{\eqref,\tagform@} ^^A amsmath @@ -3990,6 +3992,7 @@ %\DoNotIndex{\percentsign} ^^A babel/spanish,galician,mexican %\DoNotIndex{\beamer@@callorigitem,\beamer@callorigitem, % \beamer@framefootnotetext} ^^A beamer +%\DoNotIndex{\cb@end,\ltx@footnotetext,\ltx@mpfootnotetext} ^^A changebar %\DoNotIndex{\CJK@ifundefined,\CJK@plane,\CJK@temp,\CJK@addcmap} ^^A CJK,CJKutf8 %\DoNotIndex{\color} ^^A color %\DoNotIndex{\csqQQ,\csq@bqgroup,\csq@eqgroup,\@disablequotes, @@ -3997,12 +4000,15 @@ % \hyphenquote,\hyphentextquote,\hyphentextcquote,\textquote,\textcquote} ^^A csquotes %\DoNotIndex{\meta} ^^A doc %\DoNotIndex{\apptocmd,\gappto,\ifdefdimen,\ifdefmacro,\ifdefparam,\patchcmd}^^A etoolbox +%\DoNotIndex{\fnb@fnstart,\fnb@orig@footnotetext} ^^A fnbreak %\DoNotIndex{\txfigures,\lnfigures,\tbfigures,\prfigures,\fontfigurestyle, % \fontfigurealignment,\fontbasefamily,\figureversion,\textfigures, % \liningfigures,\tabularfigures,\proportionalfigures} ^^A fontaxes +%\DoNotIndex{\addfontfeature,\addfontfeatures,\strong} ^^A fontspec %\DoNotIndex{\hyper@@anchor,\hyper@nopatch@footnote,\Hy@footnote@currentHref, % \ifHy@hyperfootnotes,\ifHy@implicit,\pdfstringdefDisableCommands, % \pdfstringdefWarn} ^^A hyperref +%\DoNotIndex{\theequationdis,\theIEEEsubequationdis} ^^A IEEEtran %\DoNotIndex{\ifpdf,\ifetex,\ifluatex,\ifxetex} ^^A ifpdf/iftex %\DoNotIndex{\@inpenc@undefined@,\IeC,\inputencoding,\inputencodingname} ^^A inputenc %^^A\DoNotIndex{\UTFviii@defined,\UTF@four@octets@noexpand, ^^A inputenc/utf8 @@ -4010,6 +4016,7 @@ %^^A \UTFviii@four@octets,\UTFviii@three@octets,\UTFviii@two@octets} %\DoNotIndex{\PrerenderUnicode,\unicode@charfilter} ^^A inputenc/utf8x %\DoNotIndex{\define@key,\KV@@sp@def,\setkeys} ^^A keyval +%\DoNotIndex{\KOMAClassName,\setuptoc,\unsettoc,\scr@saved@footnotetext} ^^A koma (tocbasic) %\DoNotIndex{\l@dunhbox@line} ^^A ((r)e)ledmac,((r)e)ledpar %\DoNotIndex{\lst@ProcessLetter} ^^A listings %\DoNotIndex{\cs,\marg,\oarg,\parg} ^^A ltxdoc @@ -4027,9 +4034,14 @@ % \textu,\textscu,\textui,\textri,\textdf,\textnw,\textcd,\textec,\textuc, % \textet,\textep,\textex,\textux,\textrw,\textmb,\textdb,\textsb,\texteb, % \textub,\textlg,\textel,\textul} ^^A nfssext-cfr +%\DoNotIndex{\booknumberline,\chapternumberline,\foottextfont,\partnumberline, +% \cftbookafterpnum,\cftchapterafterpnum,\cftfigureafterpnum,\cftparagraphafterpnum, +% \cftpartafterpnum,\cftsectionafterpnum,\cftsubparagraphafterpnum,\cftsubsectionafterpnum, +% \cftsubsubsectionafterpnum,\cfttableafterpnum} ^^A memoir %\DoNotIndex{\pdf@escapestring} ^^A pdftexcmds %\DoNotIndex{\py@macron} ^^A pinyin %\DoNotIndex{\polyglossia@language@switched} ^^A polyglossia +%\DoNotIndex{\SK@eqnnum,\SK@tagform@} ^^A showkeys %\DoNotIndex{\@topic@item} ^^A simplecv %\DoNotIndex{\SOUL@,\SOUL@doword,\soulregister} ^^A soul %\DoNotIndex{\tikz@expandcount} ^^A tikz @@ -4037,12 +4049,6 @@ %\DoNotIndex{\@vwid@sift,\sift@deathcycles,\@vwid@resetb,\@vwid@loff,\@vwid@measure}^^A varwidth %\DoNotIndex{\@xspace,\@xspace@firsttrue} ^^A xspace %\DoNotIndex{\frakfamily,\gothfamily,\swabfamily,\textfrak,\textgoth,\textswab}^^A yfonts -%\DoNotIndex{\booknumberline,\chapternumberline,\foottextfont,\partnumberline, -% \cftbookafterpnum,\cftchapterafterpnum,\cftfigureafterpnum,\cftparagraphafterpnum, -% \cftpartafterpnum,\cftsectionafterpnum,\cftsubparagraphafterpnum,\cftsubsectionafterpnum, -% \cftsubsubsectionafterpnum,\cfttableafterpnum} ^^A memoir -%\DoNotIndex{\KOMAClassName,\setuptoc,\unsettoc,\scr@saved@footnotetext} ^^A koma (tocbasic) -%\DoNotIndex{\theequationdis,\theIEEEsubequationdis} ^^A IEEEtran %\DoNotIndex{\x,\MT@dinfo,\MT@dinfo@nl,\tracingmicrotype,\tracingmicrotypeinpdf, % \ifMT@inannot,\MT@inannottrue,\MT@inannotfalse,\MT@addto@annot,\MT@pdf@annot, % \MT@show@pdfannot,\iftracingmicrotypeinpdfall,\tracingmicrotypeinpdfalltrue, @@ -5348,6 +5354,7 @@ end local find = string.find local match = string.match +local gsub = string.gsub local tex_write = tex.write local catpackage @@ -6359,8 +6366,10 @@ microtype.do_font = do_font % line by line, in the course of which margin kerns will get lost. % We patch the relevant commands to record and reinsert the margin kerns. %\changes{v3.2}{2024/05/03}{patch \pkg{varwidth} to allow for margin kerning -% (reported by `\contributor web-stranger <@\at @>')} +% (reported by \contributor web-stranger <@\at @>)} % ^^A https://tex.stackexchange.com/questions/245798/microtype-raggedright-and-varwidth-doesnt-work-well-with-each-other +%\changes{v3.2a}{2024/12/21}{fix for \cls{standalone} class +% (reported by \contributor Denis Bitouz\'e <dbitouze\at wanadoo.fr>) \githubissue{43}} % \begin{macrocode} \MT@requires@pdftex5{ %</pdf-> @@ -6371,8 +6380,8 @@ microtype.do_font = do_font ^^X \newdimen\MT@vwid@leftmargin ^^X \newdimen\MT@vwid@rightmargin ^^X \patchcmd\@vwid@sift{\sift@deathcycles\z@} -^^X {\MT@vwid@leftmargin\leftmarginkern\z@ -^^X \MT@vwid@rightmargin\rightmarginkern\z@ \sift@deathcycles\z@}{}{}% +^^X {\ifhbox\z@ \MT@vwid@leftmargin\leftmarginkern\z@ +^^X \MT@vwid@rightmargin\rightmarginkern\z@\fi \sift@deathcycles\z@}{}{}% ^^X \patchcmd\@vwid@resetb{\kern\@vwid@loff \unhbox\z@} ^^X {\kern\@vwid@loff \ifdim\MT@vwid@leftmargin=\z@\else\kern\MT@vwid@leftmargin\fi ^^X \unhbox\z@ \ifdim\MT@vwid@rightmargin=\z@\else\kern\MT@vwid@rightmargin\fi}{}{}% @@ -6808,6 +6817,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % \end{macrocode} %\begin{macro}{\MT@append@patch} %\begin{macro}{\MT@patch@patch} +%\begin{macro}{\MT@patch@patch@app} % Wrappers around \pkg{etoolbox} commands. % We also remember the original command to allow unpatching. % \begin{macrocode} @@ -6819,9 +6829,13 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@remember@patch{#1}% \patchcmd#1{#2}{#3}\relax\MT@patch@okfalse } +\def\MT@patch@patch@app#1#2#3{% + \MT@patch@patch#1{#2}{#2#3}% +} % \end{macrocode} %\end{macro} %\end{macro} +%\end{macro} %\begin{macro}{\MT@remember@patch} % Remember the original definition and add to undo command. % \begin{macrocode} @@ -6904,7 +6918,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % \begin{macrocode} \@ifclassloaded{beamer} {\MT@append@patch\beamer@@callorigitem\leftprotrusion - \MT@patch@patch\beamer@callorigitem{\ignorespaces}{\ignorespaces\leftprotrusion}} + \MT@patch@patch@app\beamer@callorigitem\ignorespaces\leftprotrusion} % \end{macrocode} % \item the \cls{simplecv} class % \begin{macrocode} @@ -6975,7 +6989,7 @@ time will almost certainly lead to undesired results. Have your choice!}% {\MT@patch@patch\theequationdis{(}{\leftprotrusion{(}}% \MT@patch@patch\theequationdis{)}{\rightprotrusion{)}}% \MT@patch@patch\theIEEEsubequationdis{(}{\leftprotrusion{(}}% - \MT@patch@patch\theIEEEsubequationdis{)}{\rightprotrusion{)}}}% + \MT@patch@patch\theIEEEsubequationdis{)}{\rightprotrusion{)}}} {}% % \end{macrocode} % \item \cmd\eqref\ (\pkg{amsmath}) relies on \cmd\tagform@, so we have to have it @@ -6986,7 +7000,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \@ifpackageloaded{amsmath} {\MT@ifdefined@c@TF\SK@tagform@ {\MT@patch@patch\SK@tagform@{(}{\leftprotrusion{(}}% - \MT@patch@patch\SK@tagform@{)}{\rightprotrusion{)}}}% + \MT@patch@patch\SK@tagform@{)}{\rightprotrusion{)}}} {\MT@patch@patch\tagform@{(}{\leftprotrusion{(}}% \MT@patch@patch\tagform@{)}{\rightprotrusion{)}}}% % \end{macrocode} @@ -7045,11 +7059,22 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@define@patch{footnote}{% \MT@ifdefined@n@TF{fnote_footnotetext:n} {\ExplSyntaxOn - \MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}% - \MT@exp@cs\MT@patch@patch{fnote_footnotetext:n}{\ignorespaces}{\ignorespaces\leftprotrusion}% - \MT@patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}% + \MT@patch@patch@app\@footnotetext\ignorespaces\leftprotrusion + \MT@exp@cs\MT@patch@patch@app{fnote_footnotetext:n}\ignorespaces\leftprotrusion + \MT@patch@patch@app\@mpfootnotetext\ignorespaces\leftprotrusion \ExplSyntaxOff} % \end{macrocode} +% \item \pkg{fnbreak} patches the footnote command <ABD>, overwriting everything else. +% This also means that we can only patch it if \pkg{fnbreak} has been loaded first. +%\changes{v3.2a}{2025/01/07}{fix protrusion patch \texttt{footnote} with \pkg{fnbreak} +% (reported by \contributor Rimole <@\at @>) \githubissue{44}} +% \begin{macrocode} + {\@ifpackageloaded{fnbreak} + {\MT@ifdefined@c@TF\fnb@orig@footnotetext + {\MT@patch@patch@app\@footnotetext\fnb@fnstart\leftprotrusion} + {\MT@warning{Unable to apply patch `footnote'.\MessageBreak + Load package `fnbreak' before `microtype'}}}% +% \end{macrocode} % \item \pkg{hyperref} also patches this command (but only if |hyperfootnotes=true|, % |implicit=true| and \cmd\hyper@nopatch@footnote\ is undefined) %\changes{v3.0a}{2021/11/30}{fix protrusion patch \texttt{footnote} with \pkg{hyperref} @@ -7059,39 +7084,37 @@ time will almost certainly lead to undesired results. Have your choice!}% %\changes{v3.0e}{2022/05/21}{fix protrusion patch \texttt{footnote} for \pkg{hyperref} % if \cmd\hyper@nopatch@footnote\ is defined} % \begin{macrocode} - {\@ifpackageloaded{hyperref} - {\MT@if@false - \ifHy@implicit - \ifHy@hyperfootnotes - \MT@ifdefined@c@TF\hyper@nopatch@footnote\relax - \MT@if@true + {\@ifpackageloaded{hyperref} + {\MT@if@false + \ifHy@implicit + \ifHy@hyperfootnotes + \MT@ifdefined@c@TF\hyper@nopatch@footnote\relax + \MT@if@true + \fi \fi - \fi - \ifMT@if@\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} - \@secondoftwo - {\MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}% - \MT@patch@patch\@footnotetext{\@empty\ignorespaces}{\@empty\ignorespaces\leftprotrusion}% - \MT@patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}% - \MT@patch@patch\@mpfootnotetext - {{\expandafter\hyper@@anchor\expandafter - {\Hy@footnote@currentHref}{\relax}}\ignorespaces} - {{\expandafter\hyper@@anchor\expandafter - {\Hy@footnote@currentHref}{\relax}}\ignorespaces\leftprotrusion}} + \ifMT@if@\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} + \@secondoftwo + {\MT@patch@patch@app\@footnotetext\ignorespaces\leftprotrusion + \MT@patch@patch@app\@footnotetext{\@empty\ignorespaces}\leftprotrusion + \MT@patch@patch@app\@mpfootnotetext\ignorespaces\leftprotrusion + \MT@patch@patch@app\@mpfootnotetext{{\expandafter\hyper@@anchor + \expandafter{\Hy@footnote@currentHref}{\relax}}\ignorespaces} + \leftprotrusion} % \end{macrocode} % \item \cls{memoir} additionally allows footnotes in the margins % \begin{macrocode} - {\@ifclassloaded{memoir} - {\MT@patch@patch\@footnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}% - \MT@patch@patch\@mpfootnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}} + {\@ifclassloaded{memoir} + {\MT@patch@patch\@footnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}% + \MT@patch@patch\@mpfootnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}} % \end{macrocode} % \item \cls{beamer} has it its own way, of course %\changes{v3.0e}{2022/05/13}{fix protrusion patch \texttt{footnote} with \cls{beamer}} % \begin{macrocode} - {\@ifclassloaded{beamer} - {\MT@exp@cs\MT@patch@patch{beamerx@\string\beamer@framefootnotetext} - {\ignorespaces}{\ignorespaces\leftprotrusion}% - \MT@exp@cs\MT@patch@patch{beamerx@\string\@mpfootnotetext} - {\ignorespaces}{\ignorespaces\leftprotrusion}} + {\@ifclassloaded{beamer} + {\MT@exp@cs\MT@patch@patch@app{beamerx@\string\beamer@framefootnotetext} + \ignorespaces\leftprotrusion + \MT@exp@cs\MT@patch@patch@app{beamerx@\string\@mpfootnotetext} + \ignorespaces\leftprotrusion} % \end{macrocode} % \item the <\cls{KOMA}> classes %\changes{v3.0a}{2021/12/02}{fix protrusion patch \texttt{footnote} with <\cls{KOMA}> classes @@ -7099,13 +7122,24 @@ time will almost certainly lead to undesired results. Have your choice!}% %\changes{v3.1}{2022/08/03}{fix test for <\cls{KOMA}> classes in protrusion patch \texttt{footnote} % (also reported by \contributor David Purton <@\at @>) \githubissue{26}} % \begin{macrocode} - {\MT@ifdefined@c@TF\KOMAClassName - {\MT@patch@patch\scr@saved@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}% + {\MT@ifdefined@c@TF\KOMAClassName + {\MT@patch@patch@app\scr@saved@footnotetext\ignorespaces\leftprotrusion + \MT@patch@patch@app\@mpfootnotetext\ignorespaces\leftprotrusion} +% \end{macrocode} +% \item \pkg{changebar} +%\changes{v3.2a}{2025/01/07}{fix protrusion patch \texttt{footnote} with \pkg{changebar} +% (reported by \contributor Rimole <@\at @>) \githubissue{45}} +% \begin{macrocode} + {\@ifpackageloaded{changebar} + {\MT@patch@patch\@footnotetext{#1}{\leftprotrusion#1}% + \MT@patch@patch\@footnotetext{#1\cb@end}{\leftprotrusion#1\cb@end}% + \MT@patch@patch\@mpfootnotetext{#1}{\leftprotrusion#1}% + \MT@patch@patch\@mpfootnotetext{#1\cb@end}{\leftprotrusion#1\cb@end}} % \end{macrocode} -% \item the base classes +% \item finally, the base classes % \begin{macrocode} - {\MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}% - \MT@patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}}}}% + {\MT@patch@patch@app\@footnotetext\ignorespaces\leftprotrusion + \MT@patch@patch@app\@mpfootnotetext\ignorespaces\leftprotrusion}}}}}}}% }{}% % \end{macrocode} % \end{itemize} @@ -9946,17 +9980,21 @@ time will almost certainly lead to undesired results. Have your choice!}% % \end{macrocode} %\end{macro} %\begin{macro}{\MT@ls@fontspec@font} -% Add the |kernfactor| feature to a font loaded by \pkg{fontspec}. +% Add the |kernfactor| feature to a font loaded by \pkg{fontspec} %\changes{v2.6a}{2016/05/03}{fix for value of \textpm1000} %\changes{v2.7}{2017/02/10}{fix for `\texttt{file:}\meta{font}' spec -% (reported by \contributor Reinhard Kotucha <reinhard.kotucha\at web.de>)} +% (reported by \contributor Reinhard Kotucha <reinhard.kotucha\at web.de>)}^^A % ^^A http://tug.org/pipermail/lualatex-dev/2017-February/001670.html %\changes{v3.0}{2021/03/19}{use \texttt{lua} to parse font spec\slash fix for font spec containing spaces -% (reported by \contributor Aman Mehra <reportaman\at gmail.com>)} +% (reported by \contributor Aman Mehra <reportaman\at gmail.com>)}^^A % ^^A https://tex.stackexchange.com/questions/567698/luatex-microtype-fontspec-luaotfload-buggy-interaction-canceling-each-others-s %\changes{v3.2}{2024/05/03}{fix for spaces in font names, made necessary because \pkg{fontspec} v2.9b no longer strips them % (reported by \contributor Bernhard Fisseni <@\at @>) -% \githubissue{35}} ^^A cf. https://github.com/latex3/fontspec/commit/b3f91feab5519d1a04db4b63adfc397e3e81a742 +% \githubissue{35}}^^A +% ^^A cf. https://github.com/latex3/fontspec/commit/b3f91feab5519d1a04db4b63adfc397e3e81a742 +% (after possibly removing a leftover |kernfactor| spec). +%\changes{v3.2a}{2025/02/10}{remove \texttt{kernfactor} from font spec +% (reported by \contributor Clea F. Rees <@\at @>) \githubissue{47}} % \begin{macrocode} %<*lua-|letterspace> \def\MT@ls@fontspec@font{% @@ -9976,6 +10014,7 @@ local function add_ls(k,feat) local f = tex.fontname(font.current()) local spec,size = match(f,'^(.+)( at .+)$') if not spec then spec = f end + spec = gsub(spec,"kernfactor=[-]?%d+%.%d+;","") local q = match(spec,'^"') or "" local a,b,c = match(spec,'^'..q..'([^:]+):?([^:]*):?(.*)'..q..'$') local ls = "kernfactor=" .. k/1000 .. ';' @@ -10765,12 +10804,14 @@ microtype.add_ls = add_ls % The possibility to disable ligatures is a new features of \pdftex\ 1.30, and % also works with \luatex. %\changes{v2.3}{2007/10/23}{fix: set evaluation didn't work (bug introduced in v2.2)} +%\changes{v3.2a}{2024/12/18}{fix: define current feature (reported by \contributor Nick Bart <@\at @>) \githubissue{42}} % \begin{macrocode} %<*pdf-|lua-> %<pdf->\MT@requires@pdftex5{ \def\MT@noligatures{% \MT@dotrue \let\@tempa\MT@nl@setname + \def\MT@feat{nl}% \MT@map@clist@n{font,encoding,family,series,shape,size}{% \MT@ifdefined@n@TF{MT@checklist@##1}% {\csname MT@checklist@##1\endcsname}% @@ -20816,7 +20857,7 @@ This is the current font stretched by 5\%, normal, and shrunk by 5\%: % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \CheckSum{13403} +% \CheckSum{13422} % % \Finale % @@ -20841,7 +20882,7 @@ This is the current font stretched by 5\%, normal, and shrunk by 5\%: # (2) Install the package by running pdflatex microtype.ins # (3) Extract microtype-lssample.dtx and microtype-logo.dtx from -# microtype.pdf (ie., from the file you are about to recreate ...). +# microtype-code.pdf (ie., from one of the files you are about to recreate ...). # This can be done, eg., with Adobe Reader or with the pdftk tool. # (4) To typeset the user documentation (microtype.pdf) run pdflatex microtype.dtx diff --git a/macros/latex/contrib/microtype/microtype.ins b/macros/latex/contrib/microtype/microtype.ins index e7de0295d3..87cb9d5004 100644 --- a/macros/latex/contrib/microtype/microtype.ins +++ b/macros/latex/contrib/microtype/microtype.ins @@ -10,7 +10,7 @@ The `microtype' package Subliminal refinements towards typographical perfection - Copyright (c) 2004--2024 R Schlicht <w.m.l@gmx.net> + Copyright (c) 2004--2025 R Schlicht <w.m.l@gmx.net> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at diff --git a/macros/latex/contrib/microtype/microtype.pdf b/macros/latex/contrib/microtype/microtype.pdf Binary files differindex 68b6b3b5d8..3ea50d684c 100644 --- a/macros/latex/contrib/microtype/microtype.pdf +++ b/macros/latex/contrib/microtype/microtype.pdf diff --git a/macros/latex/contrib/notebeamer/README.md b/macros/latex/contrib/notebeamer/README.md index 02020183f5..af2943912a 100644 --- a/macros/latex/contrib/notebeamer/README.md +++ b/macros/latex/contrib/notebeamer/README.md @@ -24,7 +24,7 @@ Copyright and License license or (at your option) any later version. The latest version of this license is in the file http://www.latex-project.org/lppl.txt - This work has the LPPL maintenance status `maintained'. + This work has the LPPL maintenance status `maintained`. The Current Maintainer of this work is Mingyu Xia. diff --git a/macros/latex/contrib/notebeamer/notebeamer.dtx b/macros/latex/contrib/notebeamer/notebeamer.dtx index 861c2e990f..313d554fcf 100644 --- a/macros/latex/contrib/notebeamer/notebeamer.dtx +++ b/macros/latex/contrib/notebeamer/notebeamer.dtx @@ -11,7 +11,7 @@ % * % http://www.latex-project.org/lppl.txt * % * -% This work has the LPPL maintenance status `maintained'. * +% This work has the LPPL maintenance status `maintained`. * % * % The Current Maintainer of this work is Mingyu Xia. * % * @@ -58,7 +58,7 @@ Copyright and License license or (at your option) any later version. The latest version of this license is in the file http://www.latex-project.org/lppl.txt - This work has the LPPL maintenance status `maintained'. + This work has the LPPL maintenance status `maintained`. The Current Maintainer of this work is Mingyu Xia. @@ -102,7 +102,7 @@ Copyright and License % \texttt{<\href{mailto:myhsia@outlook.com}{myhsia@outlook.com}>}^^A % } % -% \date{Released 2025-02-11\quad \texttt{v4.0C}} +% \date{Released 2025-02-12\quad \texttt{v4.0D}} % % \maketitle % @@ -173,16 +173,14 @@ Copyright and License % % \begin{macrocode} %<*package> +%<@@=notebm> % \end{macrocode} -% Provides the package name. +% +% The package starts here. +% % \begin{macrocode} -\ProvidesExplPackage{notebeamer}{2025/02/11}{v4.0C} +\ProvidesExplPackage{notebeamer}{2025-02-12}{v4.0D} {Package provides macros for inputting slides on note papers quickly.} -% \end{macrocode} -% Load the \pkg{l3graphics} package to get the number of file pages, the -% \pkg{tikz} package to draw graphics, and the \pkg{tikzpagenodes} package to -% locate the text area of the physical pages. -% \begin{macrocode} \RequirePackage{l3graphics, tikz, tikzpagenodes} % \end{macrocode} % @@ -195,7 +193,7 @@ Copyright and License { \group_begin: \keys_set:nn { notebeamer / includebeamer } { #1, #3 } - \__nb_includebm_aux:n {#2} + \__@@_include_aux:n {#2} \group_end: } % \end{macrocode} @@ -203,117 +201,120 @@ Copyright and License % \subsection{Keys} % % Define the keys for the \cs{includebeamer} command. +% % \begin{macrocode} \keys_define:nn { notebeamer / includebeamer } { - color .tl_set:N = \l__includebm_color_tl, + color .tl_set:N = \l__@@_include_color_tl, color .initial:n = black, - pages .tl_set:N = \l__includebm_pages_tl, + pages .tl_set:N = \l__@@_include_pages_tl, pages .initial:n = 1, - nup .int_set:N = \l__includebm_nup_int, + nup .int_set:N = \l__@@_include_nup_int, nup .initial:n = 3, - lines .int_set:N = \l__includebm_lines_int, - ratio .fp_set:N = \l__includebm_ratio_fp, + lines .int_set:N = \l__@@_include_lines_int, + ratio .fp_set:N = \l__@@_include_ratio_fp, ratio .initial:n = .5, - sep .dim_set:N = \l__includebm_sep_dim, + sep .dim_set:N = \l__@@_include_sep_dim, sep .initial:n = 2ex, - lefthead .tl_set:N = \l__includebm_lefthead_tl, - righthead .tl_set:N = \l__includebm_righthead_tl, + lefthead .tl_set:N = \l__@@_include_lefthead_tl, + righthead .tl_set:N = \l__@@_include_righthead_tl, unknown .code:n = \tl_if_novalue:nF {#1} - { \tl_set_eq:NN \l__includebm_color_tl \l_keys_key_tl } + { \tl_set_eq:NN \l__@@_include_color_tl \l_keys_key_tl } } % \end{macrocode} -% \newpage +% % \subsection{Internal Auxiliary} % -% \begin{variable}{\l__nb_nup_dim,\l__includebm_ratio_dim} +% \begin{variable}{\l__@@_nup_dim,\l__@@_include_ratio_dim} % Store the heights and widths of the logical pages in a specific nup. % \begin{macrocode} -\dim_new:N \l__nb_nup_dim -\dim_new:N \l__includebm_ratio_dim +\dim_new:N \l__@@_nup_dim +\dim_new:N \l__@@_include_ratio_dim % \end{macrocode} % \end{variable} -% -% \begin{variable}{\l__nb_pages_total_int,\l__nb_pages_residue_int} +% \newpage +% \begin{variable}{\l__@@_pages_total_int,\l__@@_pages_residue_int} % Store the number of total physical pages and residue logical pages. % \begin{macrocode} -\int_new:N \l__nb_pages_total_int -\int_new:N \l__nb_pages_residue_int +\int_new:N \l__@@_pages_total_int +\int_new:N \l__@@_pages_residue_int % \end{macrocode} % \end{variable} % -% \begin{variable}{\l__nb_tmpa_clist} -% Store the results of \cs{nb_range_to_list:nN}. +% \begin{variable}{\l__@@_tmpa_clist} +% Store the results of \cs{@@_range_to_list:nN}. % \begin{macrocode} -\clist_new:N \l__nb_tmpa_clist +\clist_new:N \l__@@_tmpa_clist % \end{macrocode} % \end{variable} % -% \begin{macro}{\__nb_includebm_aux:n} +% \begin{macro}{\__@@_include_aux:n} % Define the auxiliary command of \cs{includebeamer}. % \begin{macrocode} -\cs_new_protected_nopar:Npn \__nb_includebm_aux:n #1 +\cs_new_protected_nopar:Npn \__@@_include_aux:n #1 { - \graphics_get_pagecount:nN {#1} \l__includebm_filepages_int - \dim_set:Nn \l__nb_nup_dim { \textheight/\l__includebm_nup_int } - \dim_set:Nn \l__includebm_ratio_dim - { \fp_use:N \l__includebm_ratio_fp \textwidth } - \tl_if_eq:NnTF \l__includebm_pages_tl { - } + \graphics_get_pagecount:nN {#1} \l__@@_include_filepages_int + \dim_set:Nn \l__@@_nup_dim { \textheight/\l__@@_include_nup_int } + \dim_set:Nn \l__@@_include_ratio_dim + { \fp_use:N \l__@@_include_ratio_fp \textwidth } + \tl_if_eq:NnTF \l__@@_include_pages_tl { - } { - \nb_range_to_list:nN - { 1 - \l__includebm_filepages_int } \l__nb_tmpa_clist + \@@_range_to_list:nN + { 1 - \l__@@_include_filepages_int } \l__@@_tmpa_clist } { - \exp_args:NV \nb_range_to_list:nN - { \l__includebm_pages_tl } \l__nb_tmpa_clist + \exp_args:NV \@@_range_to_list:nN + { \l__@@_include_pages_tl } \l__@@_tmpa_clist } - \int_set:Nn \l__nb_pages_total_int + \int_set:Nn \l__@@_pages_total_int { \fp_eval:n - { ceil(\clist_count:N \l__nb_tmpa_clist/\l__includebm_nup_int,0) } - 1 + { + ceil(\clist_count:N \l__@@_tmpa_clist/\l__@@_include_nup_int,0) + } - 1 } - \int_set:Nn \l__nb_pages_residue_int + \int_set:Nn \l__@@_pages_residue_int { \int_eval:n { - \clist_count:N \l__nb_tmpa_clist - - \l__includebm_nup_int * \l__nb_pages_total_int + \clist_count:N \l__@@_tmpa_clist - + \l__@@_include_nup_int * \l__@@_pages_total_int } } - \int_step_inline:nn { \int_use:N \l__nb_pages_total_int } + \int_step_inline:nn { \int_use:N \l__@@_pages_total_int } { \clearpage - \__nb_empty_note_aux: - \int_step_inline:nn { \l__includebm_nup_int } + \__@@_empty_note_aux: + \int_step_inline:nn { \l__@@_include_nup_int } { \tikz [ remember~picture, overlay ] - \node [ xshift = \l__includebm_ratio_dim/2, - yshift = \fp_eval:n { -####1 + .5 } \l__nb_nup_dim + \node [ xshift = \l__@@_include_ratio_dim/2, + yshift = \fp_eval:n { -####1 + .5 } \l__@@_nup_dim ] at (current~page~text~area.north~west) { \includegraphics [ height = \dim_eval:n - { \l__nb_nup_dim - \l__includebm_sep_dim }, - page = \clist_item:Nn \l__nb_tmpa_clist - { ####1 + \l__includebm_nup_int * ( ##1 - 1 ) } + { \l__@@_nup_dim - \l__@@_include_sep_dim }, + page = \clist_item:Nn \l__@@_tmpa_clist + { ####1 + \l__@@_include_nup_int * ( ##1 - 1 ) } ] {#1} }; } \clearpage } - \__nb_empty_note_aux: - \int_step_inline:nn { \int_use:N \l__nb_pages_residue_int } + \__@@_empty_note_aux: + \int_step_inline:nn { \int_use:N \l__@@_pages_residue_int } { \tikz [ remember~picture, overlay ] - \node [ xshift = \l__includebm_ratio_dim/2, - yshift = \fp_eval:n {( -##1 + .5 )} \l__nb_nup_dim + \node [ xshift = \l__@@_include_ratio_dim/2, + yshift = \fp_eval:n {( -##1 + .5 )} \l__@@_nup_dim ] at (current~page~text~area.north~west) { \includegraphics [ height = \dim_eval:n - { \l__nb_nup_dim - \l__includebm_sep_dim }, - page = \clist_item:Nn \l__nb_tmpa_clist - { \l__includebm_nup_int * \l__nb_pages_total_int + ##1 } + { \l__@@_nup_dim - \l__@@_include_sep_dim }, + page = \clist_item:Nn \l__@@_tmpa_clist + { \l__@@_include_nup_int * \l__@@_pages_total_int + ##1 } ] {#1} }; } @@ -322,29 +323,29 @@ Copyright and License % \end{macrocode} % \end{macro} % -% \begin{macro}{\__nb_empty_note_aux:} +% \begin{macro}{\__@@_empty_note_aux:} % Define the auxiliary command for creating empty note line page. % \begin{macrocode} -\cs_new_protected_nopar:Nn \__nb_empty_note_aux: +\cs_new_protected_nopar:Nn \__@@_empty_note_aux: { \tikzpicture [ remember~picture, overlay ] - \draw [ very~thick, \l__includebm_color_tl!80 ] + \draw [ very~thick, \l__@@_include_color_tl!80 ] (current~page~text~area.north~west) -- (current~page~text~area.north~east) node [ at~start, above~right, font = \Large \bfseries ] - { \l__includebm_lefthead_tl } + { \l__@@_include_lefthead_tl } node [ above~left, font = \Large \bfseries ] - { \l__includebm_righthead_tl }; - \draw [ very~thick, \l__includebm_color_tl!80 ] + { \l__@@_include_righthead_tl }; + \draw [ very~thick, \l__@@_include_color_tl!80 ] (current~page~text~area.south~west) -- (current~page~text~area.south~east); - \int_step_inline:nn { \l__includebm_lines_int - 1 } + \int_step_inline:nn { \l__@@_include_lines_int - 1 } { - \draw [ thick, \l__includebm_color_tl!60 ] - ([xshift = \l__includebm_ratio_dim, - yshift = -\textheight/\l__includebm_lines_int * ##1 + \draw [ thick, \l__@@_include_color_tl!60 ] + ([xshift = \l__@@_include_ratio_dim, + yshift = -\textheight/\l__@@_include_lines_int * ##1 ]current~page~text~area.north~west) --++ - (\dim_eval:n { \textwidth - \l__includebm_ratio_dim },0); + (\dim_eval:n { \textwidth - \l__@@_include_ratio_dim },0); } \endtikzpicture \pagestyle{empty} @@ -352,29 +353,29 @@ Copyright and License % \end{macrocode} % \end{macro} % -% \begin{variable}{\l__nb_tmpa_seq,\l__nb_tmpb_seq} +% \begin{variable}{\l__@@_tmpa_seq,\l__@@_tmpb_seq} % Store the results of 2D array segmentation. % \begin{macrocode} -\seq_new:N \l__nb_tmpa_seq -\seq_new:N \l__nb_tmpb_seq +\seq_new:N \l__@@_tmpa_seq +\seq_new:N \l__@@_tmpb_seq % \end{macrocode} % \end{variable} % -% \begin{macro}{\nb_range_to_list:nN} +% \begin{macro}{\@@_range_to_list:nN} % Convert the combination of number and number range to a list. % \begin{macrocode} -\cs_new_protected_nopar:Npn \nb_range_to_list:nN #1#2 +\cs_new_protected_nopar:Npn \@@_range_to_list:nN #1#2 { \clist_clear:N #2 - \seq_set_split:Nnn \l__nb_tmpa_seq { , } {#1} - \seq_map_inline:Nn \l__nb_tmpa_seq + \seq_set_split:Nnn \l__@@_tmpa_seq { , } {#1} + \seq_map_inline:Nn \l__@@_tmpa_seq { \tl_if_in:nnTF {##1} { - } { - \seq_set_split:Nnn \l__nb_tmpb_seq { - } {##1} + \seq_set_split:Nnn \l__@@_tmpb_seq { - } {##1} \int_step_inline:nnn - { \seq_item:Nn \l__nb_tmpb_seq { 1 } } - { \seq_item:Nn \l__nb_tmpb_seq { 2 } } + { \seq_item:Nn \l__@@_tmpb_seq { 1 } } + { \seq_item:Nn \l__@@_tmpb_seq { 2 } } { \clist_put_right:Nn #2 {####1} } } { \clist_put_right:Nn #2 {##1} } } @@ -383,6 +384,12 @@ Copyright and License % \end{macro} % % \begin{macrocode} +%<@@=> +% \end{macrocode} +% +% The package ends here. +% +% \begin{macrocode} %</package> % \end{macrocode} % diff --git a/macros/latex/contrib/notebeamer/notebeamer.ins b/macros/latex/contrib/notebeamer/notebeamer.ins index 9d8877ef21..73f568f66a 100644 --- a/macros/latex/contrib/notebeamer/notebeamer.ins +++ b/macros/latex/contrib/notebeamer/notebeamer.ins @@ -11,7 +11,7 @@ File: notebeamer.ins * http://www.latex-project.org/lppl.txt * * - This work has the LPPL maintenance status `maintained'. * + This work has the LPPL maintenance status `maintained`. * * The Current Maintainer of this work is Mingyu Xia. * * @@ -43,7 +43,7 @@ File: notebeamer.ins * http://www.latex-project.org/lppl.txt * * - This work has the LPPL maintenance status `maintained'. * + This work has the LPPL maintenance status `maintained`. * * The Current Maintainer of this work is Mingyu Xia. * ----------------------------------------------------------------------- diff --git a/macros/latex/contrib/notebeamer/notebeamer.pdf b/macros/latex/contrib/notebeamer/notebeamer.pdf Binary files differindex c42af966ac..2d9cd9f5dc 100644 --- a/macros/latex/contrib/notebeamer/notebeamer.pdf +++ b/macros/latex/contrib/notebeamer/notebeamer.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-badge-cor-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-badge-cor-red.pdf Binary files differnew file mode 100644 index 0000000000..cf92dbc341 --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-badge-cor-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-badge-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-badge-red.pdf Binary files differdeleted file mode 100644 index 7b34ecf219..0000000000 --- a/macros/latex/contrib/sjtutex/sjtu-vi-badge-red.pdf +++ /dev/null diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-badge-reg-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-badge-reg-red.pdf Binary files differnew file mode 100644 index 0000000000..f4095d10a1 --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-badge-reg-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-badge-small-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-badge-small-red.pdf Binary files differdeleted file mode 100644 index 53901f695b..0000000000 --- a/macros/latex/contrib/sjtutex/sjtu-vi-badge-small-red.pdf +++ /dev/null diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-eng-h-cor-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-eng-h-cor-red.pdf Binary files differnew file mode 100644 index 0000000000..31214dc758 --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-logo-eng-h-cor-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-eng-h-reg-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-eng-h-reg-red.pdf Binary files differnew file mode 100644 index 0000000000..ce55f82641 --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-logo-eng-h-reg-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-red.pdf Binary files differdeleted file mode 100644 index 08a405be04..0000000000 --- a/macros/latex/contrib/sjtutex/sjtu-vi-logo-red.pdf +++ /dev/null diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-small-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-small-red.pdf Binary files differdeleted file mode 100644 index a1ec93ed9c..0000000000 --- a/macros/latex/contrib/sjtutex/sjtu-vi-logo-small-red.pdf +++ /dev/null diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-c-cor-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-c-cor-red.pdf Binary files differnew file mode 100644 index 0000000000..38f30699d8 --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-c-cor-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-c-reg-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-c-reg-red.pdf Binary files differnew file mode 100644 index 0000000000..98fa38a179 --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-c-reg-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-h-cor-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-h-cor-red.pdf Binary files differnew file mode 100644 index 0000000000..48c721b5b6 --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-h-cor-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-h-reg-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-h-reg-red.pdf Binary files differnew file mode 100644 index 0000000000..edf9fbcd55 --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-h-reg-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-v-cor-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-v-cor-red.pdf Binary files differnew file mode 100644 index 0000000000..9001d515ad --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-v-cor-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-v-reg-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-v-reg-red.pdf Binary files differnew file mode 100644 index 0000000000..a75996e204 --- /dev/null +++ b/macros/latex/contrib/sjtutex/sjtu-vi-logo-std-v-reg-red.pdf diff --git a/macros/latex/contrib/sjtutex/sjtu-vi-name-red.pdf b/macros/latex/contrib/sjtutex/sjtu-vi-name-red.pdf Binary files differdeleted file mode 100644 index 26a249e41b..0000000000 --- a/macros/latex/contrib/sjtutex/sjtu-vi-name-red.pdf +++ /dev/null diff --git a/macros/latex/contrib/sjtutex/sjtutex.dtx b/macros/latex/contrib/sjtutex/sjtutex.dtx index 01f771c2f4..916ed2c89c 100644 --- a/macros/latex/contrib/sjtutex/sjtutex.dtx +++ b/macros/latex/contrib/sjtutex/sjtutex.dtx @@ -1,8 +1,9 @@ % \iffalse meta-comment % % Copyright (C) SJTUG -% 2018--2024 Weijian Wu <alexarawu@outlook.com> -% 2022--2024 Zilong Li <logcreative@outlook.com> +% 2018--2025 Weijian Wu <alexarawu@outlook.com> +% 2022--2025 Zilong Li <logcreative@outlook.com> +% 2024--2025 Boshi Yuan <nemoyuan2008@outlook.com> % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -34,8 +35,9 @@ \preamble Copyright (C) SJTUG - 2018--2024 Weijian Wu <alexarawu@outlook.com> - 2022--2024 Zilong Li <logcreative@outlook.com> + 2018--2025 Weijian Wu <alexarawu@outlook.com> + 2022--2025 Zilong Li <logcreative@outlook.com> + 2024--2025 Boshi Yuan <nemoyuan2008@outlook.com> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -54,62 +56,43 @@ \file{sjtuthesis.cls} {\from{\jobname.dtx}{class,thesis}} \file{sjtureport.cls} {\from{\jobname.dtx}{class,report}} \file{sjtuarticle.cls} {\from{\jobname.dtx}{class,article}} - \file{sjtu-lang-thesis-zh.def} {\from{\jobname.dtx}{lang,thesis,zh}} - \file{sjtu-lang-thesis-en.def} {\from{\jobname.dtx}{lang,thesis,en}} - \file{sjtu-lang-thesis-de.def} {\from{\jobname.dtx}{lang,thesis,de}} - \file{sjtu-lang-thesis-ja.def} {\from{\jobname.dtx}{lang,thesis,ja}} - \file{sjtu-lang-generic-zh.def} {\from{\jobname.dtx}{lang,generic,zh}} - \file{sjtu-lang-generic-en.def} {\from{\jobname.dtx}{lang,generic,en}} - \file{sjtu-lang-generic-de.def} {\from{\jobname.dtx}{lang,generic,de}} - \file{sjtu-lang-generic-ja.def} {\from{\jobname.dtx}{lang,generic,ja}} - \file{sjtu-name-thesis-zh.def} {\from{\jobname.dtx}{name,thesis,zh}} - \file{sjtu-name-thesis-en.def} {\from{\jobname.dtx}{name,thesis,en}} - \file{sjtu-name-thesis-de.def} {\from{\jobname.dtx}{name,thesis,de}} - \file{sjtu-name-thesis-ja.def} {\from{\jobname.dtx}{name,thesis,ja}} - \file{sjtu-name-generic-zh.def} {\from{\jobname.dtx}{name,generic,zh}} - \file{sjtu-name-generic-en.def} {\from{\jobname.dtx}{name,generic,en}} - \file{sjtu-name-generic-de.def} {\from{\jobname.dtx}{name,generic,de}} - \file{sjtu-name-generic-ja.def} {\from{\jobname.dtx}{name,generic,ja}} + \file{sjtu-lang-zh.def} {\from{\jobname.dtx}{lang,zh}} + \file{sjtu-lang-en.def} {\from{\jobname.dtx}{lang,en}} + \file{sjtu-lang-de.def} {\from{\jobname.dtx}{lang,de}} + \file{sjtu-lang-ja.def} {\from{\jobname.dtx}{lang,ja}} \file{sjtu-scheme-zh.def} {\from{\jobname.dtx}{scheme,zh}} \file{sjtu-scheme-en.def} {\from{\jobname.dtx}{scheme,en}} \file{sjtu-scheme-de.def} {\from{\jobname.dtx}{scheme,de}} \file{sjtu-scheme-ja.def} {\from{\jobname.dtx}{scheme,ja}} - \file{sjtu-text-font-newtx.def} {\from{\jobname.dtx}{font,text,newtx}} - \file{sjtu-text-font-newpx.def} {\from{\jobname.dtx}{font,text,newpx}} - \file{sjtu-text-font-lm.def} {\from{\jobname.dtx}{font,text,lm}} + \file{sjtu-thesis-zh.def} {\from{\jobname.dtx}{thesis-i18n,zh}} + \file{sjtu-thesis-en.def} {\from{\jobname.dtx}{thesis-i18n,en}} + \file{sjtu-thesis-de.def} {\from{\jobname.dtx}{thesis-i18n,de}} + \file{sjtu-thesis-ja.def} {\from{\jobname.dtx}{thesis-i18n,ja}} + \file{sjtu-text-font-newtx.def} {\from{\jobname.dtx}{font,text,type1,newtx}} + \file{sjtu-text-font-newpx.def} {\from{\jobname.dtx}{font,text,type1,newpx}} + \file{sjtu-text-font-lm.def} {\from{\jobname.dtx}{font,text,type1,lm}} + \file{sjtu-text-font-times.def} {\from{\jobname.dtx}{font,text,type1,times}} \file{sjtu-text-font-libertinus.def}{\from{\jobname.dtx}{font,text,libertinus}} \file{sjtu-text-font-stixtwo.def} {\from{\jobname.dtx}{font,text,stixtwo}} - \file{sjtu-text-font-xits.def} {\from{\jobname.dtx}{font,text,xits}} - \file{sjtu-text-font-newcm.def} {\from{\jobname.dtx}{font,text,newcm}} - \file{sjtu-text-font-cambria.def} {\from{\jobname.dtx}{font,text,cambria}} - \file{sjtu-text-font-times.def} {\from{\jobname.dtx}{font,text,times}} - \file{sjtu-math-font-newtx.def} {\from{\jobname.dtx}{font,math,newtx}} - \file{sjtu-math-font-newpx.def} {\from{\jobname.dtx}{font,math,newpx}} - \file{sjtu-math-font-lm.def} {\from{\jobname.dtx}{font,math,lm}} + \file{sjtu-text-font-cambria.def} {\from{\jobname.dtx}{font,text,otf,cambria}} + \file{sjtu-text-font-newcm.def} {\from{\jobname.dtx}{font,text,otf,newcm}} + \file{sjtu-text-font-xits.def} {\from{\jobname.dtx}{font,text,otf,xits}} + \file{sjtu-math-font-newtx.def} {\from{\jobname.dtx}{font,math,type1,newtx}} + \file{sjtu-math-font-newpx.def} {\from{\jobname.dtx}{font,math,type1,newpx}} + \file{sjtu-math-font-lm.def} {\from{\jobname.dtx}{font,math,type1,lm}} + \file{sjtu-math-font-times.def} {\from{\jobname.dtx}{font,math,type1,times}} \file{sjtu-math-font-libertinus.def}{\from{\jobname.dtx}{font,math,libertinus}} \file{sjtu-math-font-stixtwo.def} {\from{\jobname.dtx}{font,math,stixtwo}} - \file{sjtu-math-font-xits.def} {\from{\jobname.dtx}{font,math,xits}} - \file{sjtu-math-font-newcm.def} {\from{\jobname.dtx}{font,math,newcm}} - \file{sjtu-math-font-cambria.def} {\from{\jobname.dtx}{font,math,cambria}} - \file{sjtu-math-font-times.def} {\from{\jobname.dtx}{font,math,times}} - \file{sjtu-cjk-font-windows.def} {\from{\jobname.dtx}{font,cjk,windows,und}} - \file{sjtu-cjk-font-windows-zh.def} {\from{\jobname.dtx}{font,cjk,windows,zh}} - \file{sjtu-cjk-font-windows-ja.def} {\from{\jobname.dtx}{font,cjk,windows,ja}} - \file{sjtu-cjk-font-mac.def} {\from{\jobname.dtx}{font,cjk,mac,und}} - \file{sjtu-cjk-font-mac-zh.def} {\from{\jobname.dtx}{font,cjk,mac,zh}} - \file{sjtu-cjk-font-mac-ja.def} {\from{\jobname.dtx}{font,cjk,mac,ja}} - \file{sjtu-cjk-font-ubuntu.def} {\from{\jobname.dtx}{font,cjk,ubuntu,und}} - \file{sjtu-cjk-font-ubuntu-zh.def} {\from{\jobname.dtx}{font,cjk,ubuntu,zh}} - \file{sjtu-cjk-font-ubuntu-ja.def} {\from{\jobname.dtx}{font,cjk,ubuntu,ja}} - \file{sjtu-cjk-font-adobe.def} {\from{\jobname.dtx}{font,cjk,adobe,und}} - \file{sjtu-cjk-font-adobe-zh.def} {\from{\jobname.dtx}{font,cjk,adobe,zh}} - \file{sjtu-cjk-font-adobe-ja.def} {\from{\jobname.dtx}{font,cjk,adobe,ja}} - \file{sjtu-cjk-font-fandol.def} {\from{\jobname.dtx}{font,cjk,fandol,und}} - \file{sjtu-cjk-font-fandol-zh.def} {\from{\jobname.dtx}{font,cjk,fandol,zh}} - \file{sjtu-cjk-font-fandol-ja.def} {\from{\jobname.dtx}{font,cjk,fandol,ja}} - \file{sjtu-cjk-font-founder.def} {\from{\jobname.dtx}{font,cjk,founder,und}} - \file{sjtu-cjk-font-founder-zh.def} {\from{\jobname.dtx}{font,cjk,founder,zh}} - \file{sjtu-cjk-font-founder-ja.def} {\from{\jobname.dtx}{font,cjk,founder,ja}} + \file{sjtu-math-font-cambria.def} {\from{\jobname.dtx}{font,math,otf,cambria}} + \file{sjtu-math-font-newcm.def} {\from{\jobname.dtx}{font,math,otf,newcm}} + \file{sjtu-math-font-xits.def} {\from{\jobname.dtx}{font,math,otf,xits}} + \file{sjtu-cjk-font-windows.def} {\from{\jobname.dtx}{font,cjk,windows}} + \file{sjtu-cjk-font-mac.def} {\from{\jobname.dtx}{font,cjk,mac}} + \file{sjtu-cjk-font-ubuntu.def} {\from{\jobname.dtx}{font,cjk,ubuntu}} + \file{sjtu-cjk-font-adobe.def} {\from{\jobname.dtx}{font,cjk,adobe}} + \file{sjtu-cjk-font-fandol.def} {\from{\jobname.dtx}{font,cjk,fandol}} + \file{sjtu-cjk-font-founder.def} {\from{\jobname.dtx}{font,cjk,founder}} + \file{sjtu-cjk-font-hanyi.def} {\from{\jobname.dtx}{font,cjk,hanyi}} %</install> %<*internal> \usedir{source/latex/sjtutex} @@ -129,26 +112,18 @@ \Msg{* sjtuthesis.cls *} \Msg{* sjtureport.cls *} \Msg{* sjtuarticle.cls *} -\Msg{* sjtu-lang-generic-de.def *} -\Msg{* sjtu-lang-generic-en.def *} -\Msg{* sjtu-lang-generic-ja.def *} -\Msg{* sjtu-lang-generic-zh.def *} -\Msg{* sjtu-lang-thesis-de.def *} -\Msg{* sjtu-lang-thesis-en.def *} -\Msg{* sjtu-lang-thesis-ja.def *} -\Msg{* sjtu-lang-thesis-zh.def *} -\Msg{* sjtu-name-generic-de.def *} -\Msg{* sjtu-name-generic-en.def *} -\Msg{* sjtu-name-generic-ja.def *} -\Msg{* sjtu-name-generic-zh.def *} -\Msg{* sjtu-name-thesis-de.def *} -\Msg{* sjtu-name-thesis-en.def *} -\Msg{* sjtu-name-thesis-ja.def *} -\Msg{* sjtu-name-thesis-zh.def *} +\Msg{* sjtu-lang-de.def *} +\Msg{* sjtu-lang-en.def *} +\Msg{* sjtu-lang-ja.def *} +\Msg{* sjtu-lang-zh.def *} \Msg{* sjtu-scheme-de.def *} \Msg{* sjtu-scheme-en.def *} \Msg{* sjtu-scheme-ja.def *} \Msg{* sjtu-scheme-zh.def *} +\Msg{* sjtu-thesis-de.def *} +\Msg{* sjtu-thesis-en.def *} +\Msg{* sjtu-thesis-ja.def *} +\Msg{* sjtu-thesis-zh.def *} \Msg{* sjtu-text-font-cambria.def *} \Msg{* sjtu-text-font-libertinus.def *} \Msg{* sjtu-text-font-lm.def *} @@ -167,29 +142,23 @@ \Msg{* sjtu-math-font-stixtwo.def *} \Msg{* sjtu-math-font-times.def *} \Msg{* sjtu-math-font-xits.def *} -\Msg{* sjtu-cjk-font-adobe-ja.def *} -\Msg{* sjtu-cjk-font-adobe-zh.def *} \Msg{* sjtu-cjk-font-adobe.def *} -\Msg{* sjtu-cjk-font-fandol-ja.def *} -\Msg{* sjtu-cjk-font-fandol-zh.def *} \Msg{* sjtu-cjk-font-fandol.def *} -\Msg{* sjtu-cjk-font-founder-ja.def *} -\Msg{* sjtu-cjk-font-founder-zh.def *} \Msg{* sjtu-cjk-font-founder.def *} -\Msg{* sjtu-cjk-font-mac-ja.def *} -\Msg{* sjtu-cjk-font-mac-zh.def *} +\Msg{* sjtu-cjk-font-hanyi.def *} \Msg{* sjtu-cjk-font-mac.def *} -\Msg{* sjtu-cjk-font-ubuntu-ja.def *} -\Msg{* sjtu-cjk-font-ubuntu-zh.def *} \Msg{* sjtu-cjk-font-ubuntu.def *} -\Msg{* sjtu-cjk-font-windows-ja.def *} -\Msg{* sjtu-cjk-font-windows-zh.def *} \Msg{* sjtu-cjk-font-windows.def *} -\Msg{* sjtu-vi-badge-red.pdf *} -\Msg{* sjtu-vi-badge-small-red.pdf *} -\Msg{* sjtu-vi-logo-red.pdf *} -\Msg{* sjtu-vi-logo-small-red.pdf *} -\Msg{* sjtu-vi-name-red.pdf *} +\Msg{* sjtu-vi-badge-cor-red.pdf *} +\Msg{* sjtu-vi-badge-reg-red.pdf *} +\Msg{* sjtu-vi-logo-eng-h-cor-red.pdf *} +\Msg{* sjtu-vi-logo-eng-h-reg-red.pdf *} +\Msg{* sjtu-vi-logo-std-c-cor-red.pdf *} +\Msg{* sjtu-vi-logo-std-c-reg-red.pdf *} +\Msg{* sjtu-vi-logo-std-h-cor-red.pdf *} +\Msg{* sjtu-vi-logo-std-h-reg-red.pdf *} +\Msg{* sjtu-vi-logo-std-v-cor-red.pdf *} +\Msg{* sjtu-vi-logo-std-v-reg-red.pdf *} \Msg{* *} \Msg{* To produce the documentation, run the file sjtutex.dtx *} \Msg{* through XeLaTeX. *} @@ -206,55 +175,31 @@ %</internal> % %<*class> -\NeedsTeXFormat{LaTeX2e}[2020/10/01] +\NeedsTeXFormat{LaTeX2e}[2024-06-01] \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} -\IfFormatAtLeastTF{2020/10/01}{} +\IfFormatAtLeastTF{2024-06-01}{} {\PackageError{sjtutex} {Your LaTeX format is outdated!\MessageBreak\MessageBreak - Release `2020/10/01' or newer is required to\MessageBreak + Release '2024-06-01' or newer is required to\MessageBreak compile this document.\MessageBreak\MessageBreak Please update your TeX distribution}{}} %</class> %<*!(driver|install)> -%<+!driver>\GetIdInfo$Id: sjtutex.dtx 879eea9 2024-11-06 19:54:03 +0800 Alexara Wu <alexarawu@outlook.com> $ +%<+!driver>\GetIdInfo$Id: sjtutex.dtx d611a82 2025-02-12 23:33:21 +0800 Alexara Wu <alexarawu@outlook.com> $ %<class&thesis> {Thesis document class for Shanghai Jiao Tong University (SJTUTeX)} %<class&thesis>\ProvidesExplClass{sjtuthesis} %<class&report> {Report document class for Shanghai Jiao Tong University (SJTUTeX)} %<class&report>\ProvidesExplClass{sjtureport} %<class&article> {Article document class for Shanghai Jiao Tong University (SJTUTeX)} %<class&article>\ProvidesExplClass{sjtuarticle} -%<lang&thesis&zh> {Chinese specific definition for thesis (SJTUTeX)} -%<lang&thesis&zh>\ProvidesExplFile{sjtu-lang-thesis-zh.def} -%<lang&thesis&en> {English specific definition for thesis (SJTUTeX)} -%<lang&thesis&en>\ProvidesExplFile{sjtu-lang-thesis-en.def} -%<lang&thesis&de> {German specific definition for thesis (SJTUTeX)} -%<lang&thesis&de>\ProvidesExplFile{sjtu-lang-thesis-de.def} -%<lang&thesis&ja> {Japanese specific definition for thesis (SJTUTeX)} -%<lang&thesis&ja>\ProvidesExplFile{sjtu-lang-thesis-ja.def} -%<lang&generic&zh> {Chinese specific definition for generic (SJTUTeX)} -%<lang&generic&zh>\ProvidesExplFile{sjtu-lang-generic-zh.def} -%<lang&generic&en> {English specific definition for generic (SJTUTeX)} -%<lang&generic&en>\ProvidesExplFile{sjtu-lang-generic-en.def} -%<lang&generic&de> {German specific definition for generic (SJTUTeX)} -%<lang&generic&de>\ProvidesExplFile{sjtu-lang-generic-de.def} -%<lang&generic&ja> {Japanese specific definition for generic (SJTUTeX)} -%<lang&generic&ja>\ProvidesExplFile{sjtu-lang-generic-ja.def} -%<name&thesis&zh> {Chinese name config for thesis (SJTUTeX)} -%<name&thesis&zh>\ProvidesExplFile{sjtu-name-thesis-zh.def} -%<name&thesis&en> {English name config for thesis (SJTUTeX)} -%<name&thesis&en>\ProvidesExplFile{sjtu-name-thesis-en.def} -%<name&thesis&de> {German name config for thesis (SJTUTeX)} -%<name&thesis&de>\ProvidesExplFile{sjtu-name-thesis-de.def} -%<name&thesis&ja> {Japanese name config for thesis (SJTUTeX)} -%<name&thesis&ja>\ProvidesExplFile{sjtu-name-thesis-ja.def} -%<name&generic&zh> {Chinese name config for generic (SJTUTeX)} -%<name&generic&zh>\ProvidesExplFile{sjtu-name-generic-zh.def} -%<name&generic&en> {English name config for generic (SJTUTeX)} -%<name&generic&en>\ProvidesExplFile{sjtu-name-generic-en.def} -%<name&generic&de> {German name config for generic (SJTUTeX)} -%<name&generic&de>\ProvidesExplFile{sjtu-name-generic-de.def} -%<name&generic&ja> {Japanese name config for generic (SJTUTeX)} -%<name&generic&ja>\ProvidesExplFile{sjtu-name-generic-ja.def} +%<lang&zh> {Chinese specific definition (SJTUTeX)} +%<lang&zh>\ProvidesExplFile{sjtu-lang-zh.def} +%<lang&en> {English specific definition (SJTUTeX)} +%<lang&en>\ProvidesExplFile{sjtu-lang-en.def} +%<lang&de> {German specific definition (SJTUTeX)} +%<lang&de>\ProvidesExplFile{sjtu-lang-de.def} +%<lang&ja> {Japanese specific definition (SJTUTeX)} +%<lang&ja>\ProvidesExplFile{sjtu-lang-ja.def} %<scheme&zh> {Chinese scheme (SJTUTeX)} %<scheme&zh>\ProvidesExplFile{sjtu-scheme-zh.def} %<scheme&en> {English scheme (SJTUTeX)} @@ -263,79 +208,65 @@ %<scheme&de>\ProvidesExplFile{sjtu-scheme-de.def} %<scheme&ja> {Japanese scheme (SJTUTeX)} %<scheme&ja>\ProvidesExplFile{sjtu-scheme-ja.def} +%<thesis-i18n&zh> {Chinese config for thesis (SJTUTeX)} +%<thesis-i18n&zh>\ProvidesExplFile{sjtu-thesis-zh.def} +%<thesis-i18n&en> {English config for thesis (SJTUTeX)} +%<thesis-i18n&en>\ProvidesExplFile{sjtu-thesis-en.def} +%<thesis-i18n&de> {German config for thesis (SJTUTeX)} +%<thesis-i18n&de>\ProvidesExplFile{sjtu-thesis-de.def} +%<thesis-i18n&ja> {Japanese config for thesis (SJTUTeX)} +%<thesis-i18n&ja>\ProvidesExplFile{sjtu-thesis-ja.def} %<font&text&newtx> {New TX text fonts definition (SJTUTeX)} %<font&text&newtx>\ProvidesExplFile{sjtu-text-font-newtx.def} %<font&text&newpx> {New PX text fonts definition (SJTUTeX)} %<font&text&newpx>\ProvidesExplFile{sjtu-text-font-newpx.def} -%<font&text&stixtwo> {STIX Two text fonts definition (SJTUTeX)} -%<font&text&stixtwo>\ProvidesExplFile{sjtu-text-font-stixtwo.def} -%<font&text&xits> {XITS text fonts definition (SJTUTeX)} -%<font&text&xits>\ProvidesExplFile{sjtu-text-font-xits.def} %<font&text&lm> {Latin Modern text fonts definition (SJTUTeX)} %<font&text&lm>\ProvidesExplFile{sjtu-text-font-lm.def} +%<font&text×> {Times text fonts definition (SJTUTeX)} +%<font&text×>\ProvidesExplFile{sjtu-text-font-times.def} +%<font&text&stixtwo> {STIX Two text fonts definition (SJTUTeX)} +%<font&text&stixtwo>\ProvidesExplFile{sjtu-text-font-stixtwo.def} %<font&text&libertinus> {Libertinus text fonts definition (SJTUTeX)} %<font&text&libertinus>\ProvidesExplFile{sjtu-text-font-libertinus.def} -%<font&text&newcm> {New Computer Modern text fonts definition (SJTUTeX)} -%<font&text&newcm>\ProvidesExplFile{sjtu-text-font-newcm.def} %<font&text&cambria> {Cambria text fonts definition (SJTUTeX)} %<font&text&cambria>\ProvidesExplFile{sjtu-text-font-cambria.def} -%<font&text×> {Times text fonts definition (SJTUTeX)} -%<font&text×>\ProvidesExplFile{sjtu-text-font-times.def} +%<font&text&newcm> {New Computer Modern text fonts definition (SJTUTeX)} +%<font&text&newcm>\ProvidesExplFile{sjtu-text-font-newcm.def} +%<font&text&xits> {XITS text fonts definition (SJTUTeX)} +%<font&text&xits>\ProvidesExplFile{sjtu-text-font-xits.def} %<font&math&newtx> {New TX math fonts definition (SJTUTeX)} %<font&math&newtx>\ProvidesExplFile{sjtu-math-font-newtx.def} %<font&math&newpx> {New PX math fonts definition (SJTUTeX)} %<font&math&newpx>\ProvidesExplFile{sjtu-math-font-newpx.def} -%<font&math&stixtwo> {STIX Two math fonts definition (SJTUTeX)} -%<font&math&stixtwo>\ProvidesExplFile{sjtu-math-font-stixtwo.def} -%<font&math&xits> {XITS math fonts definition (SJTUTeX)} -%<font&math&xits>\ProvidesExplFile{sjtu-math-font-xits.def} %<font&math&lm> {Latin Modern math fonts definition (SJTUTeX)} %<font&math&lm>\ProvidesExplFile{sjtu-math-font-lm.def} +%<font&math×> {Times math fonts definition (SJTUTeX)} +%<font&math×>\ProvidesExplFile{sjtu-math-font-times.def} +%<font&math&stixtwo> {STIX Two math fonts definition (SJTUTeX)} +%<font&math&stixtwo>\ProvidesExplFile{sjtu-math-font-stixtwo.def} %<font&math&libertinus> {Libertinus math fonts definition (SJTUTeX)} %<font&math&libertinus>\ProvidesExplFile{sjtu-math-font-libertinus.def} -%<font&math&newcm> {New Computer Modern math fonts definition (SJTUTeX)} -%<font&math&newcm>\ProvidesExplFile{sjtu-math-font-newcm.def} %<font&math&cambria> {Cambria math fonts definition (SJTUTeX)} %<font&math&cambria>\ProvidesExplFile{sjtu-math-font-cambria.def} -%<font&math×> {Times math fonts definition (SJTUTeX)} -%<font&math×>\ProvidesExplFile{sjtu-math-font-times.def} -%<font&cjk&windows&und> {Windows CJK fonts definition (SJTUTeX)} -%<font&cjk&windows&und>\ProvidesExplFile{sjtu-cjk-font-windows.def} -%<font&cjk&windows&zh> {Windows CJK fonts definition for Chinese (SJTUTeX)} -%<font&cjk&windows&zh>\ProvidesExplFile{sjtu-cjk-font-windows-zh.def} -%<font&cjk&windows&ja> {Windows CJK fonts definition for Japanese (SJTUTeX)} -%<font&cjk&windows&ja>\ProvidesExplFile{sjtu-cjk-font-windows-ja.def} -%<font&cjk&mac&und> {macOS CJK fonts definition (SJTUTeX)} -%<font&cjk&mac&und>\ProvidesExplFile{sjtu-cjk-font-mac.def} -%<font&cjk&mac&zh> {macOS CJK fonts definition for Chinese (SJTUTeX)} -%<font&cjk&mac&zh>\ProvidesExplFile{sjtu-cjk-font-mac-zh.def} -%<font&cjk&mac&ja> {macOS CJK fonts definition for Japanese (SJTUTeX)} -%<font&cjk&mac&ja>\ProvidesExplFile{sjtu-cjk-font-mac-ja.def} -%<font&cjk&ubuntu&und> {Ubuntu CJK fonts definition (SJTUTeX)} -%<font&cjk&ubuntu&und>\ProvidesExplFile{sjtu-cjk-font-ubuntu.def} -%<font&cjk&ubuntu&zh> {Ubuntu CJK fonts definition for Chinese (SJTUTeX)} -%<font&cjk&ubuntu&zh>\ProvidesExplFile{sjtu-cjk-font-ubuntu-zh.def} -%<font&cjk&ubuntu&ja> {Ubuntu CJK fonts definition for Japanese (SJTUTeX)} -%<font&cjk&ubuntu&ja>\ProvidesExplFile{sjtu-cjk-font-ubuntu-ja.def} -%<font&cjk&adobe&und> {Adobe CJK fonts definition (SJTUTeX)} -%<font&cjk&adobe&und>\ProvidesExplFile{sjtu-cjk-font-adobe.def} -%<font&cjk&adobe&zh> {Adobe CJK fonts definition for Chinese (SJTUTeX)} -%<font&cjk&adobe&zh>\ProvidesExplFile{sjtu-cjk-font-adobe-zh.def} -%<font&cjk&adobe&ja> {Adobe CJK fonts definition for Japanese (SJTUTeX)} -%<font&cjk&adobe&ja>\ProvidesExplFile{sjtu-cjk-font-adobe-ja.def} -%<font&cjk&fandol&und> {Fandol CJK fonts definition (SJTUTeX)} -%<font&cjk&fandol&und>\ProvidesExplFile{sjtu-cjk-font-fandol.def} -%<font&cjk&fandol&zh> {Fandol CJK fonts definition for Chinese (SJTUTeX)} -%<font&cjk&fandol&zh>\ProvidesExplFile{sjtu-cjk-font-fandol-zh.def} -%<font&cjk&fandol&ja> {Fandol CJK fonts definition for Japanese (SJTUTeX)} -%<font&cjk&fandol&ja>\ProvidesExplFile{sjtu-cjk-font-fandol-ja.def} -%<font&cjk&founder&und> {Founder CJK fonts definition (SJTUTeX)} -%<font&cjk&founder&und>\ProvidesExplFile{sjtu-cjk-font-founder.def} -%<font&cjk&founder&zh> {Founder CJK fonts definition for Chinese (SJTUTeX)} -%<font&cjk&founder&zh>\ProvidesExplFile{sjtu-cjk-font-founder-zh.def} -%<font&cjk&founder&ja> {Founder CJK fonts definition for Japanese (SJTUTeX)} -%<font&cjk&founder&ja>\ProvidesExplFile{sjtu-cjk-font-founder-ja.def} -%<!driver> {\ExplFileDate}{2.1.5}{\ExplFileDescription} +%<font&math&newcm> {New Computer Modern math fonts definition (SJTUTeX)} +%<font&math&newcm>\ProvidesExplFile{sjtu-math-font-newcm.def} +%<font&math&xits> {XITS math fonts definition (SJTUTeX)} +%<font&math&xits>\ProvidesExplFile{sjtu-math-font-xits.def} +%<font&cjk&windows> {Windows CJK fonts definition (SJTUTeX)} +%<font&cjk&windows>\ProvidesExplFile{sjtu-cjk-font-windows.def} +%<font&cjk&mac> {macOS CJK fonts definition (SJTUTeX)} +%<font&cjk&mac>\ProvidesExplFile{sjtu-cjk-font-mac.def} +%<font&cjk&ubuntu> {Ubuntu CJK fonts definition (SJTUTeX)} +%<font&cjk&ubuntu>\ProvidesExplFile{sjtu-cjk-font-ubuntu.def} +%<font&cjk&adobe> {Adobe CJK fonts definition (SJTUTeX)} +%<font&cjk&adobe>\ProvidesExplFile{sjtu-cjk-font-adobe.def} +%<font&cjk&fandol> {Fandol CJK fonts definition (SJTUTeX)} +%<font&cjk&fandol>\ProvidesExplFile{sjtu-cjk-font-fandol.def} +%<font&cjk&founder> {Founder CJK fonts definition (SJTUTeX)} +%<font&cjk&founder>\ProvidesExplFile{sjtu-cjk-font-founder.def} +%<font&cjk&hanyi> {Hanyi CJK fonts definition (SJTUTeX)} +%<font&cjk&hanyi>\ProvidesExplFile{sjtu-cjk-font-hanyi.def} +%<!driver> {\ExplFileDate}{2.2}{\ExplFileDescription} %</!(driver|install)> % %<*driver> @@ -343,7 +274,7 @@ \documentclass{ctxdoc} \newcommand{\sjtutex}{SJTU\TeX} \expandafter\def\csname ver@\jobname.dtx\endcsname - {2024/11/06 v2.1.5 SJTUTeX} + {2025/02/12 v2.2 SJTUTeX} \usepackage{float} \usepackage{multirow} \usepackage{longtable} @@ -448,15 +379,14 @@ % {\LaTeX{} Project Public License (1.3c)},使用前请认真阅读协议内容。 % \item 学位论文模板根据 \href{https://www.gs.sjtu.edu.cn/post/detail/Z3MxNDc=} % {《上海交通大学博士、硕士学位论文撰写指南》} ,并参考 -% \href{https://bysj.jwc.sjtu.edu.cn/ShowNews.aspx?newsno=Yr2wg3ibJJhIZh0A52amXw....} +% \href{https://www.jwc.sjtu.edu.cn/info/1041/117021.htm} % {《上海交通大学本科生毕业设计(论文)撰写规范》} -% 编写而成。旨在供上海交通大学准毕业生撰 -% 写学位论文使用。 -% \item 学位论文模板仅为撰写指南的参考实现,不保证审查老师不提意见。任何由于使用本模板 -% 而引起的论文格式审查问题均与本模板作者无关。 +% 编写而成。旨在供上海交通大学准毕业生撰写学位论文使用。 +% \item 学位论文模板仅为撰写指南的参考实现,不保证审查老师不提意见。任何由于使用 +% 本模板而引起的论文格式审查问题均与本模板作者无关。 % \item 任何个人或组织以本模板为基础进行修改、扩展而生成的新的专用模板,请严格遵 -% 守 \LaTeX{} Project Public License 协议。由于违犯协议而引起的任何纠纷 -% 争端均与本模板作者无关。 +% 守 \LaTeX{} Project Public License 协议。由于违犯协议而引起的任何纠纷争端均 +% 与本模板作者无关。 % \end{enumerate} % \end{abstract} % @@ -466,33 +396,35 @@ % % \section{介绍} % -% 最早的一版 \LaTeX{} 学位论文模板由一位热心的物理系同学制作,中文字符处理采用了当时最为流行的 -% CJK--\LaTeX{} 方案。在此基础上,weijianwen 根据交大研究生院对学位论文的要求,完成 -% 了一份基本可用的交大 \LaTeX{} 学位论文模板。由于 CJK--\LaTeX{} 方案不易使用, -% weijianwen 与 William Wang 开始着手把模板向 \XeTeX{} 引擎移植。之后 weijianwen -% 又断断续续做了一些完善模板的工作,在原有硕士学位论文模板的基础上完成了交大学士 -% 和博士学位论文模板。 +% 最早的一版 \LaTeX{} 学位论文模板由一位热心的物理系同学制作,中文字符处理采用了 +% 当时最为流行的 CJK--\LaTeX{} 方案。在此基础上,weijianwen 根据交大研究生院对学 +% 位论文的要求,完成了一份基本可用的交大 \LaTeX{} 学位论文模板。由于 CJK--\LaTeX{} +% 方案不易使用,weijianwen 与 William Wang 开始着手把模板向 \XeTeX{} 引擎移植。 +% 之后 weijianwen又断断续续做了一些完善模板的工作,在原有硕士学位论文模板的基础 +% 上完成了交大学士和博士学位论文模板。 % % 2012 年 5 月模板开始在 GitHub^^A % \footnote{\url{https://github.com/weijianwen/SJTUThesis},项目转移后该链接已重定向。}^^A -% 上管理和更新,2018 年 1 月项目转移至 SJTUG 名 -% 下。2019 年 6 月 Alexara Wu 重构了整个宏包的代码,并使用 Doc\TeX{} 文档和 -% \textsc{DocStrip} 工具进行代码的管理,升级版本号为 1.0。2022 年 11 月,论文模板 -% 改版后,使用 \LaTeXiii{} 重构了代码,添加 \cls{sjtureport} 和 \cls{sjtuarticle} -% 文档类,升级版本号为 2.0。 +% 上管理和更新,2018 年 1 月项目转移至 SJTUG 名下。2019 年 6 月 Alexara Wu 重构 +% 了整个宏包的代码,并使用 Doc\TeX{} 文档和\textsc{DocStrip} 工具进行代码的管理, +% 升级版本号为 1.0。2022 年 11 月,论文模板改版后,使用 \LaTeXiii{} 重构了代码, +% 添加 \cls{sjtureport} 和 \cls{sjtuarticle} 文档类,升级版本号为 2.0。 +% 2024 年 2 月,\pkg{sjtutex} 文档类集在 CTAN 上发布,被 \TeX{} Live 2024 及之后 +% 的版本收录。 % % 现在,\sjtutex{} 代码在 GitHub^^A % \footnote{\url{https://github.com/sjtug/SJTUTeX}}^^A -% 上维护。 -% 原 \href{https://github.com/sjtug/SJTUThesis}{SJTUThesis} 仓库则作为学位论文示例文档,提供开箱即用的模板。 -% 学位论文模板用户可以在 \href{https://github.com/sjtug/SJTUThesis/discussions}{Discussions} -% 上提问使用问题,也可以在 \href{https://github.com/sjtug/SJTUThesis/issues}{Issues} +% 上维护,并同步发布至 CTAN\footnote{\url{https://www.ctan.org/pkg/sjtutex}} 上。 +% 原 \href{https://github.com/sjtug/SJTUThesis}{SJTUThesis} 仓库则作为学位论文 +% 示例文档,提供开箱即用的模板。学位论文模板用户可以在 +% \href{https://github.com/sjtug/SJTUThesis/discussions}{Discussions} +% 上提问使用问题,也可以在 +% \href{https://github.com/sjtug/SJTUThesis/issues}{Issues} % 中进行 Bug 反馈与新功能提案。如果需要对文档类代码进行修改,欢迎前往 % \href{https://github.com/sjtug/SJTUTeX}{\sjtutex} 仓库进行 Pull Request。 % \sjtutex{} 模板的许多实现细节离不开 -% \href{https://github.com/sjtug/SJTUThesis/graphs/contributors} -% {热心同学们} 的贡献,在此感谢所有为模板贡献过代码的同学们,以及所有测试和使用 -% 模板的各位同学! +% \href{https://github.com/sjtug/SJTUThesis/graphs/contributors}{热心同学们} +% 的贡献,在此感谢所有为模板贡献过代码的同学们,以及所有测试和使用模板的各位同学! % % \note{模板的作用在于减少论文写作过程中格式调整的时间,前提是遵守模板的用法,否 % 则即便用了 \sjtutex{} 也难以保证输出的论文符合学校规范。} @@ -507,8 +439,8 @@ % \href{https://github.com/sjtug/SJTUThesis/wiki/TeX-发行版及其安装} % {Wiki 页面《\TeX{} 发行版及其安装》}。 % -% \sjtutex{} 最低支持至 2021 年发行的 \TeX{} 发行版,\pkg{ctex} 宏包版本应当在 -% v2.5 及以上。版本过低将无法正常编译。 +% \sjtutex{} 需要 \LaTeXe{} 内核 2024-06-01 或以上版本,\pkg{ctex} 宏包版本应当 +% 在 v2.5 及以上。版本过低将无法正常编译。 % % \subsection{文件组成} % @@ -521,22 +453,21 @@ % \label{tab:files} % \begin{tabular}{l|l|p{4cm}} % \toprule -% \strong{类别} & \strong{文件} & \strong{说明} \\ +% \strong{类别} & \strong{文件} & \strong{说明} \\ % \midrule -% 文档类 & \file{sjtuthesis.cls} & 学位论文文档类 \\ -% & \file{sjtureport.cls} & 报告文档类 \\ -% & \file{sjtuarticle.cls} & 文稿文档类 \\ -% & \file{sjtu-name-*.def} & 文档类名称配置 \\ -% & \file{sjtu-lang-*.def} & 文档类语言配置 \\ -% & \file{sjtu-scheme-*.def} & 文档类语言方案 \\ +% 文档类 & \file{sjtuthesis.cls} & 学位论文文档类 \\ +% & \file{sjtureport.cls} & 报告文档类 \\ +% & \file{sjtuarticle.cls} & 文稿文档类 \\ +% & \file{sjtu-lang-*.def} & 文档类语言配置 \\ +% & \file{sjtu-scheme-*.def} & 文档类语言方案 \\ +% & \file{sjtu-thesis-*.def} & 学位论文语言配置 \\ % \midrule -% 字体配置文件 & \file{sjtu-text-font-*.def} & 西文字体配置 \\ -% & \file{sjtu-math-font-*.def} & 数学字体配置 \\ -% & \file{sjtu-cjk-font-*.def} & CJK 字体配置 \\ +% 字体配置文件 & \file{sjtu-text-font-*.def} & 西文字体配置 \\ +% & \file{sjtu-math-font-*.def} & 数学字体配置 \\ +% & \file{sjtu-cjk-font-*.def} & CJK 字体配置 \\ % \midrule -% 视觉形象系统\tnote{a} & \file{sjtu-vi-logo-*.pdf} & 校标图片 \\ -% & \file{sjtu-vi-badge-*.pdf} & 校徽图片 \\ -% & \file{sjtu-vi-name-*.pdf} & 校名图片 \\ +% 视觉形象系统\tnote{a} & \file{sjtu-vi-logo-*.pdf} & 校标图片 \\ +% & \file{sjtu-vi-badge-*.pdf} & 校徽图片 \\ % % \bottomrule % \end{tabular} @@ -549,16 +480,21 @@ % % \subsection{使用文档类} % -% 共有 3 种文档类,\cls{sjtuthesis} 用于学位论文的排版,\cls{sjtureport} 用于课程大报告的排版, -% \cls{sjtuarticle} 用于课程小论文的排版。 -% -% 将文档保存在下载好的 \sjtutex{} 模板根目录下,文件以 \texttt{.tex} 后缀结尾。 -% 注意在使用文档类时,需要将涉及到的所有源文件使用 UTF-8 编码保存。对于不同的文档类,使用方法 -% 略有不同,这里给出这三种文档类的最小使用示例。 -% -% 下面这份 \TeX{} 文档展示了 \cls{sjtuthesis} 文档类的基本用法,一般需要指定中英文名称。 -% 该文档将包含中英文封面,页眉为文档主题及章节名称。 -% \begin{latex}[moretexcs={\sjtusetup,\maketitle,\tableofcontents*,\chapter}, +% 共有 3 种文档类,\cls{sjtuthesis} 用于学位论文的排版,\cls{sjtureport} +% 用于课程大报告的排版,\cls{sjtuarticle} 用于课程小论文的排版。 +% +% 将文档保存在下载好的 \sjtutex{} 模板根目录下,或者直接使用 \TeX{} 发行版 +% 中的 \pkg{sjtutex} 文档类集^^A +% \footnote{为了使用最新版本的 \sjtutex{},请及时更新发行版至最新的版本:^^A +% \TeX{} Live 用户请使用命令 \texttt{tlmgr update --self --all} 来更新全部宏包;^^A +% \hologo{MiKTeX} 用户请在 MiKTeX Console 更新选项卡中更新所有宏包。}, +% 文件以 \texttt{.tex} 后缀结尾。 +% 注意在使用文档类时,需要将涉及到的所有源文件使用 UTF-8 编码保存。 +% 对于不同的文档类,使用方法略有不同,这里给出这三种文档类的最小使用示例。 +% +% 下面这份 \TeX{} 文档展示了 \cls{sjtuthesis} 文档类的基本用法,一般需要指定 +% 中英文名称。该文档将包含中英文封面,页眉为文档主题及章节名称。 +% \begin{latex}[moretexcs={\sjtusetup,\maketitle,\tableofcontents,\chapter}, % morekeywords={\frontmatter,\mainmatter}, emph={[1]sjtuthesis,document}, % emph={[2]info},emph={[3]type,zh,en,title,author}] % \documentclass[type=master]{sjtuthesis} @@ -573,7 +509,7 @@ % \begin{document} % \maketitle % \frontmatter -% \tableofcontents* +% \tableofcontents % \mainmatter % \chapter{欢迎} % \section{欢迎使用 SJTUThesis} @@ -581,8 +517,8 @@ % \end{document} % \end{latex} % -% 下面这份 \TeX{} 文档展示了 \cls{sjtureport} 文档类的基本用法,建议使用标准命令定义中文名称。 -% 该文档将包含标题页,页眉为校标图片、文档主题及章节名称。 +% 下面这份 \TeX{} 文档展示了 \cls{sjtureport} 文档类的基本用法,建议使用标准命令 +% 定义中文名称。该文档将包含标题页,页眉为校标图片、文档主题及章节名称。 % \begin{latex}[moretexcs={\subject,\keywords,\maketitle,\chapter}, % emph={[1]sjtureport,document}] % \documentclass{sjtureport} @@ -598,8 +534,9 @@ % \end{document} % \end{latex} % -% 下面这份 \TeX{} 文档展示了 \cls{sjtuarticle} 文档类的基本用法,建议使用标准命令定义中文名称, -% 不能够使用 \tn{chapter} 这一级。该文档包含标题栏,页眉为校标图片、文档主题及章节名称。 +% 下面这份 \TeX{} 文档展示了 \cls{sjtuarticle} 文档类的基本用法,建议使用标准 +% 命令定义中文名称,不能够使用 \tn{chapter} 这一级。该文档包含标题栏,页眉为 +% 校标图片、文档主题及章节名称。 % \begin{latex}[moretexcs={\maketitle}, emph={[1]sjtuarticle,document}] % \documentclass{sjtuarticle} % \title{示例文档} @@ -619,7 +556,7 @@ % 在实际使用中,一般推荐使用自动生成工具 \pkg{latexmk} 编译文档。\pkg{latexmk} % 命令可以自动进行多步编译,直到交叉引用都被解决。 % 假设您的 \TeX{} 源文件名为 \file{main.tex}, -% 可在命令行中执行如下命令使用 \XeLaTeX{} 编译文档 +% 可在命令行中执行如下命令使用 \XeLaTeX{} 编译文档: % \begin{shell}[morekeywords={latexmk},emph={-xelatex}] % latexmk -xelatex main % \end{shell} @@ -630,9 +567,12 @@ % % 本模板中的选项、命令或环境可以分为以下三类: % \begin{itemize} -% \item 名字后面带有 \rexptarget\rexpstar{} 的,表示只能在 \cls{sjtuthesis} 文档类中使用; -% \item 名字后面带有 \exptarget\expstar{} 的,表示只能在 \cls{sjtureport} 和 \cls{sjtuarticle} 文档类中使用; -% \item 名字后面不带有特殊符号的,一般表示在 \cls{sjtuthesis}、\cls{sjtureport} 和 \cls{sjtuarticle} 文档类中都可以使用,特殊情况另作说明。 +% \item 名字后面带有 \rexptarget\rexpstar{} 的,表示只能在 \cls{sjtuthesis} +% 文档类中使用; +% \item 名字后面带有 \exptarget\expstar{} 的,表示只能在 \cls{sjtureport} +% 和 \cls{sjtuarticle} 文档类中使用; +% \item 名字后面不带有特殊符号的,一般表示在 \cls{sjtuthesis}、\cls{sjtureport} +% 和 \cls{sjtuarticle} 文档类中都可以使用,特殊情况另作说明。 % \end{itemize} % % \subsection{文档类选项} @@ -644,7 +584,8 @@ % \end{latex} % % 部分选项采用 \meta{key}|=|\meta{value} 的形式,需要使用逗号分隔各选项。 -% 当 \meta{value} 省略时,将采用默认值。在下文的说明中,将用\textbf{粗体}表示默认值。 +% 当 \meta{value} 省略时,将采用默认值。 +% 在下文的说明中,将用\textbf{粗体}表示默认值。 % % \subsubsection{通用选项} % @@ -670,9 +611,11 @@ % 默认为 \opt{final}。 % \end{function} % -% \begin{function}[rEXP]{review} -% 盲审模式。开启盲审模式将隐去作者姓名、导师姓名、班级、学号等个人信息, -% 删去版权使用授权书、原创性声明和致谢页。默认关闭。 +% \begin{function}[rEXP,updated=2025-01-14]{review} +% 盲审模式。开启盲审模式会将作者姓名、导师姓名、学号、基金等个人信息留空, +% 并使得标题页的信息表格强制显示相关字段, +% 相关说明详见第 \ref{sec:sjtuthesiskey} 节; +% 开启盲审模式还会删去版权使用授权书、原创性声明和致谢页。默认关闭。 % \end{function} % % \subsubsection{页面设置} @@ -748,7 +691,7 @@ % % \begin{function}{cjk-font} % \begin{syntax} -% \OPT{cjk-font} = <(auto)|(fandol)|windows|mac|ubuntu|adobe|founder|none> +% \OPT{cjk-font} = <(auto)|windows|mac|ubuntu|adobe|(fandol)|founder|hanyi|none> % \end{syntax} % 指定 CJK 字体集。\sjtutex{} 预定义了一些 CJK 字体组合, % 具体配置见表 \ref{tab:cjkfonts}。 @@ -758,7 +701,7 @@ % Linux 系统默认使用 \opt{fandol}。 % 找不到对应定义的 CJK 字体集时的回退选项为 \opt{fandol}。 % -% \textbf{仅} \opt{windows} 和 \opt{founder} 字体集支持 \pdfLaTeX{} 直接生成 PDF。 +% \textbf{仅} \opt{windows}、\opt{founder} 和 \opt{hanyi} 字体集支持 \pdfLaTeX{} 直接生成 PDF。 % 其他 CJK 字体集使用 \pdfTeX{} 引擎需要先通过 \LaTeX{} 生成 DVI, % 然后再使用 DVIPDFM\textit{x} 转换为 PDF。 % \end{function} @@ -774,12 +717,13 @@ % \toprule % & \strong{宋体} & \strong{黑体} & \strong{仿宋} & \strong{楷体} & \strong{明朝体}\tnote{c} & \strong{哥特体}\tnote{c} \\ % \midrule -% |fandol|\tnote{a} & Fandol 宋体 & Fandol 黑体 & Fandol 仿宋 & Fandol 楷体 & HaranoAjiMincho & HaranoAjiGothic \\ % |windows| & (中易)宋体 & (中易)黑体 & (中易)仿宋 & (中易)楷体 & MS Mincho & MS Gothic \\ % |mac| & (华文)宋体-简 & (华文)黑体-简 & 华文仿宋 & (华文)楷体-简 & Hiragino Mincho ProN & Hiragino Kaku Gothic ProN \\ % |ubuntu| & Noto Serif CJK SC & Noto Sans CJK SC & --- & 文鼎 PL 简中楷 & Noto Serif CJK JP & Noto Sans CJK JP \\ -% |adobe| & Adobe 宋体 & Adobe 黑体 & Adobe 仿宋 & Adobe 楷体 & Kozuka Mincho Pr6N & Kozuka Gothic Pr6N \\ +% |adobe| & Adobe 宋体 & Adobe 黑体 & Adobe 仿宋 & Adobe 楷体 & Kozuka Mincho Pr6N & Kozuka Gothic Pr6N \\ +% |fandol|\tnote{a} & Fandol 宋体 & Fandol 黑体 & Fandol 仿宋 & Fandol 楷体 & HaranoAjiMincho & HaranoAjiGothic \\ % |founder|\tnote{b} & 方正书宋 & 方正黑体 & 方正仿宋 & 方正楷体 & IPAMincho & IPAGothic \\ +% |hanyi| & 汉仪书宋二 S & 汉仪中黑 S & 汉仪仿宋 S & 汉仪楷体 S & HaranoAjiMincho & HaranoAjiGothic \\ % \bottomrule % \end{tabular} % \begin{tablenotes} @@ -883,6 +827,11 @@ % 该选项只影响行间公式,行内公式统一居右侧,不受影响。 % \end{function} % +% \subsubsection{其他选项} +% +% 其他的文档类选项会被传递给对应的 \CTeX{} 文档类, +% 请注意 \opt{GBK}、\opt{scheme} 等选项不受 \sjtutex{} 支持。 +% % \subsection{论文信息设置} % % \begin{function}{\sjtusetup} @@ -919,7 +868,7 @@ % % \subsubsection{信息域} % -% \begin{function}[updated=2023-03-14]{info} +% \begin{function}[updated=2025-01-14]{info} % \begin{syntax} % \OPS{info} = \marg{键值列表} % \end{syntax} @@ -929,7 +878,13 @@ % (比如 \opt{zh} 或 \opt{en})的键来设定对应语言的论文信息,见第 % \ref{sec:sjtuthesiskey} 节;省略语言前缀不带“*”的项目表示对应的中文 % 字段、带“*”的项目表示对应的英文字段属于老用法,仍然兼容但请及时更新 -% 至新用法。 +% 至新用法;各标题页中的信息表格会根据设定信息的顺序进行显示与排列, +% 未设置的信息将不会显示,但在盲审模式开启时会例外地强制显示相关字段, +% 中文标题页会强制显示 \texttt{info/zh} 中的 \texttt{author, id, +% supervisor, assoc_supervisor, co_supervisor, department, major, degree} +% 字段,其他语言标题页会强制显示 \texttt{info/<lang>} 中的 +% \texttt{author, supervisor, assoc_supervisor, co_supervisor} 字段, +% 这种顺序也是这些信息的推荐设置顺序。 % \item 在 \cls{sjtureport} 和 \cls{sjtuarticle} 文档类中,不需要使用语言代 % 码前缀。此时推荐直接使用标准接口来设定这些信息,这些标准接口不属于键 % 值列表,应当直接写在导言区内,见第 \ref{sec:sjtureportcmd} 节。 @@ -995,15 +950,6 @@ % 导师、副导师、联合导师姓名。 % \end{function} % -% \begin{function}[rEXP,updated=2023-03-14]{info/<lang>/degree} -% \begin{syntax} -% \OPT{\meta{lang}}/\OPT{degree} = \marg{学位名称} -% \end{syntax} -% 申请学位中英文名称。 -% 包括申请的学位类别和级别,如“工学硕士”、“理学博士”等。 -% 学士论文无需标注。 -% \end{function} -% % \begin{function}[rEXP,updated=2023-03-14]{info/<lang>/department} % \begin{syntax} % \OPT{\meta{lang}}/\OPT{department} = \marg{院系名称} @@ -1018,6 +964,14 @@ % 专业名称。 % \end{function} % +% \begin{function}[rEXP,updated=2023-03-14]{info/<lang>/degree} +% \begin{syntax} +% \OPT{\meta{lang}}/\OPT{degree} = \marg{学位名称} +% \end{syntax} +% 申请学位中英文名称。 +% 包括申请的学位类别和级别,如“工学硕士”、“理学博士”等。 +% \end{function} +% % \begin{function}[rEXP,updated=2023-03-14]{info/<lang>/fund} % \begin{syntax} % \OPT{\meta{lang}}/\OPT{fund} = \marg{资助基金名称} @@ -1042,6 +996,19 @@ % 设定该键时,将会覆盖 \opt{info/date} 键在对应语言下的设定。 % \end{function} % +% \begin{function}[rEXP,added=2025-01-14]{info/<lang>/custom} +% \begin{syntax} +% \OPT{\meta{lang}}/\OPT{custom}/\OPT{\meta{变量名}} = \marg{第一列内容}\marg{第二列内容} +% \end{syntax} +% 对应语言标题页信息表格中显示的额外信息,可以设置多个变量。 +% 需要使用一个变量名作为索引键(变量名应当由英文字母、数字、 +% 连字符 \texttt{-} 组成,且第一个位置只能为英文字母); +% 并赋予两个参数来设置信息表格中两列的内容: +% 通常第一列作为该信息的属性名称会被加粗,第二列作为该信息的内容。 +% 该信息会根据在 \cmd{\sjtusetup} 中的设置相对位置显示在对应的位置上。 +% 当 \opt{review} 选项开启时,该选项的设置不会生效。 +% \end{function} +% % \paragraph{适用于 \cls{sjtureport} 和 \cls{sjtuarticle} 文档类的命令} % \label{sec:sjtureportcmd} % @@ -1228,12 +1195,13 @@ % 页脚字体。默认为 |\zihao{-5}|,小五号字。 % \end{function} % -% \begin{function}[added=2022-12-03]{style/page-number} +% \begin{function}[added=2022-12-03,updated=2024-12-30]{style/page-number} % \begin{syntax} -% \OPT{page-number} = \marg{页码设置} +% \OPT{page-number} = \marg{格式定义} % \end{syntax} -% 设置页码的显示样式,其中 |#1| 代表当前页码。 -% 默认为 |{#1}|,即仅显示页码本身。 +% 设置页码的显示格式,\meta{格式定义} 有两个参数:参数 |#1| 是当前页码,参数 |#2| 是当前编码的总页码数。 +% 获取总页码数需要使用 \pkg{pageslts} 宏包。 +% 默认为 |{#1}|,即仅显示当前页码。 % \end{function} % % \begin{function}[added=2023-11-30]{style/keywords-format} @@ -1283,7 +1251,7 @@ % |listtable| & 表格 & List of Tables & Tabellenverzeichnis & 表目次 \\ % |figure| & 图 & Figure & Abbildung & 図 \\ % |table| & 表 & Table & Tabelle & 表 \\ -% |abstract| \rexpstar & 摘要 & Abstract & Zusammenfassung & 概要 \\ +% |abstract| \expstar & 摘要 & Abstract & Zusammenfassung & 概要 \\ % |index| & 索引 & Index & Index & 索引 \\ % |appendix| & 附录 & Appendix & Anhang & 付録 \\ % |proof| & 证明 & Proof & Beweis & 证明 \\ @@ -1310,9 +1278,56 @@ % \ \meta{文档内容} % \EEV{document} % \end{syntax} -% 在文档开始后进行内容编写,文档内容由 |document| 环境包裹。 +% 在文档开始后进行内容编写,文档内容由 |document| 环境包裹。 % \end{function} % +% \subsection{用于本节环境或命令的参数} +% +% 本节描述的部分环境和命令提供 \meta{标题参数},用于进行局部的标题相关设置。 +% 可以使用逗号分隔的选项列表作为可选参数传入该环境,例如: +% \begin{latex} +% \begin{acknowledgements}[intoc,title={自定义标题}] +% \end{acknowledgements} +% \end{latex} +% +% \begin{function}[added=2025-01-12]{intoc, notintoc} +% 指明该环境的小标题是否在目录中出现。 +% \opt{intoc} 表示出现在目录中, +% \opt{notintoc} 表示不出现在目录中。 +% 默认 \tn{mainmatter} 之前的环境为 \opt{notintoc}, +% \tn{mainmatter} 之后的环境为 \opt{intoc}。 +% \end{function} +% +% \begin{function}[added=2025-01-12]{title} +% \begin{syntax} +% \OPT{title} = \marg{小标题} +% \end{syntax} +% 设置该环境的小标题,默认是全局语言下的小标题。 +% \end{function} +% +% \begin{function}[added=2025-01-12]{marking} +% \begin{syntax} +% \OPT{marking} = \marg{目录中的小标题} +% \end{syntax} +% 设置该环境在目录中的小标题,默认与小标题相同。 +% 只有在设置 \opt{intoc} 小标题出现在目录中才会显示。 +% \end{function} +% +% 部分环境还提供了参数 \opt{lang},用于设置环境的语言。 +% \begin{function}[added=2025-01-12,label=]{lang} +% \begin{syntax} +% \OPT{lang} = <(zh)|en|de|ja> +% \end{syntax} +% 设置该环境的局部语言选项,默认与全局语言选项相同。 +% 该选项会设置该环境的局部语言排版设置。 +% \end{function} +% +% 对于同时提供了 \meta{标题参数} 和 \opt{lang} 参数的环境,二者可以一同使用,例如: +% \begin{latex} +% \begin{abstract}[lang=en,intoc,title={自定义标题},marking={目录中的标题}] +% \end{abstract} +% \end{latex} +% % \subsection{标题页和声明页} % % \begin{function}[updated=2022-12-03]{\maketitle} @@ -1330,13 +1345,14 @@ % \end{itemize} % \end{function} % -% \begin{function}[rEXP,updated=2022-12-20]{\copyrightpage} +% \begin{function}[rEXP,updated=2024-12-21]{\copyrightpage} % \begin{syntax} % \TNA{copyrightpage} -% \TNA{copyrightpage}\oarg{授权书扫描件} +% \TNA{copyrightpage}\oarg{file=授权书扫描件,额外选项} % \end{syntax} % 生成空白版权使用授权书。 -% 接受一个可选参数用于插入版权使用授权书扫描件,使用可选参数时需要手动加载 \pkg{pdfpages} 宏包。 +% 接受可选参数用于插入版权使用授权书扫描件,插入外置 PDF 页时需要手动加载 \pkg{pdfpages} 宏包。 +% 额外选项将传递给 \tn{includepdf} 命令。 % \end{function} % % \subsection{前文部分} @@ -1348,31 +1364,32 @@ % 声明前文部分开始。 % \end{function} % -% \begin{function}[updated=2023-11-29]{abstract} +% \begin{function}[updated=2024-12-20]{abstract} % \begin{syntax} -% \BEV{abstract}\oarg{lang} -% \ \meta{摘要} +% \BEV{abstract}\oarg{lang=<(zh)|en|de|ja>,标题参数} +% \ \meta{\textup{\cls{sjtuthesis}} 中的摘要} % \EEV{abstract} % \BEV{abstract} -% \ \meta{摘要} +% \ \meta{\textup{\cls{sjtuarticle}} 和 \textup{\cls{sjtureport}} 中的摘要} % \EEV{abstract} % \end{syntax} % 摘要环境。会在结尾添加关键词。 % \begin{itemize} -% \item \cls{sjtuthesis} 文档类中,可以设置可选参数指定摘要的语言, -% 默认为 \opt{zh}。 -% \item \cls{sjtuarticle} 和 \cls{sjtureport} 文档类中,不需要可选参数。 +% \item \cls{sjtuthesis} 文档类中,可以设置可选参数, +% 指定摘要的局部语言会同步更改小标题为对应语言设置。 +% \item \cls{sjtuarticle} 和 \cls{sjtureport} 文档类中,不设置可选参数。 % \end{itemize} % \end{function} % -% \begin{function}[rEXP,updated=2023-11-29]{abstract*} -% \cls{sjtuthesis} 文档类中使用带星号的 \env{abstract*} 环境不会出现在目录中。 -% \end{function} -% -% \begin{function}{\tableofcontents,\tableofcontents*,\listoffigures,\listoffigures*, -% \listoftables,\listoftables*,\listofalgorithms,\listofalgorithms*} +% \begin{function}[updated=2024-12-20]{\tableofcontents,\listoffigures,\listoftables,\listofalgorithms} +% \begin{syntax} +% \TNA{tableofcontents}\oarg{标题参数} +% \TNA{listoffigures}\oarg{标题参数} +% \TNA{listoftables}\oarg{标题参数} +% \TNA{listofalgorithms}\oarg{标题参数} +% \end{syntax} % 目录、插图、表格和算法等索引命令如表 \ref{tab:list} 所示,将其插入到期望的 -% 位置即可。带*的命令表示对应的索引表不会出现在目录中。 +% 位置即可,这些命令可以使用可选的 \meta{标题参数} 来调整标题相关设置。 % \begin{table}[H] % \centering\small % \begin{threeparttable} @@ -1383,10 +1400,8 @@ % \strong{用途} & \strong{命令} & \strong{用途} & \strong{命令} \\ % \midrule % 目录 & \tn{tableofcontents} & 插图索引 & \tn{listoffigures} \\ -% & \tn{tableofcontents*} & & \tn{listoffigures*} \\ % \midrule % 表格索引 & \tn{listoftables} & 算法索引\tnote{a} & \tn{listofalgorithms} \\ -% & \tn{listoftables*} & & \tn{listofalgorithms*} \\ % \bottomrule % \end{tabular} % \begin{tablenotes} @@ -1447,24 +1462,24 @@ % 附录由 \tn{appendix} 命令开启,然后像正文一样书写。 % \end{function} % -% \begin{function}[rEXP,updated=2022-03-02]{nomenclature,nomenclature*} +% \begin{function}[rEXP,updated=2024-12-20]{nomenclature} % \begin{syntax} -% \BEV{nomenclature}\oarg{标题} +% \BEV{nomenclature}\oarg{标题参数} % \ \meta{符号对照表} % \EEV{nomenclature} % \end{syntax} -% 符号对照表环境。带星号的版本不会出现在目录中。可以使用可选参数手动设置标题。 -% 符号对照表环境仅设置标题,内部实现可由用户自行决定。 +% 符号对照表环境。可以使用 \meta{标题参数} 手动设置标题。 +% 符号对照表环境仅设置标题,内部实现可由用户自行决定: % 可以使用 \pkg{longtable},也可以使用 \pkg{nomencl} 宏包。 % \end{function} % -% \begin{function}[rEXP,updated=2022-03-02]{abbreviation,abbreviation*} +% \begin{function}[rEXP,updated=2024-12-20]{abbreviation} % \begin{syntax} -% \BEV{abbreviation}\oarg{标题} +% \BEV{abbreviation}\oarg{标题参数} % \ \meta{缩略语对照表} % \EEV{abbreviation} % \end{syntax} -% 缩略语对照表环境。带星号的版本不会出现在目录中。可以使用可选参数手动设置标题。 +% 缩略语对照表环境。可以使用可选参数手动设置标题。 % 缩略语对照表环境仅设置标题,内部实现可由用户自行决定。 % \end{function} % @@ -1477,60 +1492,61 @@ % 声明后文部分开始。 后文部分包含致谢等。 % \end{function} % -% \begin{function}[rEXP,updated=2022-02-24]{acknowledgements} +% \begin{function}[rEXP,updated=2024-12-20]{acknowledgements} % \begin{syntax} -% \BEV{acknowledgements}\oarg{标题} +% \BEV{acknowledgements}\oarg{标题参数} % \ \meta{致谢内容} % \EEV{acknowledgements} % \end{syntax} -% 致谢环境。盲审模式下致谢将被隐去。可以使用可选参数手动设置标题。 +% 致谢环境。盲审模式下致谢将被隐去。可以使用 \meta{标题参数} 手动设置标题。 % \end{function} % -% \begin{function}[rEXP,updated=2022-02-24]{achievements} +% \begin{function}[rEXP,updated=2024-12-20]{achievements} % \begin{syntax} -% \BEV{achievements}\oarg{标题} +% \BEV{achievements}\oarg{标题参数} % \ \meta{获得的科研成果} % \EEV{achievements} % \end{syntax} -% 科研成果环境,可以使用可选参数手动设置标题。内部请配合使用下面的附录用文献列表环境 +% 科研成果环境,可以使用 \meta{标题参数} 手动设置标题。内部请配合使用下面的附录用文献列表环境 % \env{bibliolist} 和 \env{bibliolist*}。你可以在该环境中使用带星号的节次命令 % 以分隔不同的类型的成果(比如学术论文、专利等);你也可以使用多个 \env{achievements} -% 环境,配合不同的可选参数作为标题,展示不同类型的成果。 +% 环境,配合不同的 \meta{标题参数},展示不同类型的成果。 % \end{function} % -% \begin{function}[rEXP,updated=2022-03-23]{bibliolist,bibliolist*} +% \begin{function}[rEXP,updated=2024-12-08]{bibliolist,bibliolist*} % \begin{syntax} -% \BEV{bibliolist}\marg{最长条目编号} +% \BEV{bibliolist}\oarg{可选参数}\marg{最长条目编号} % \ \TNA{item} \meta{文献条目} % \EEV{bibliolist} -% \BEV{bibliolist*}\marg{最长条目编号} +% \BEV{bibliolist*}\oarg{可选参数}\marg{最长条目编号} % \ \TNA{item} \meta{文献条目(隐去姓名)} % \EEV{bibliolist*} % \end{syntax} -% 附录用文献环境,只允许在 \env{achievements} 环境中使用。 +% 用于展示科研成果的文献列表,比如学术论文、专利等。 % 需要指定最长条目的编号作为参数,比如 \opt{99}; % 如果将该强制参数被指定为空,将不显示编号,每条以悬挂缩进做区分。 -% 环境内部使用 \tn{item} 来分隔各条目,在同一个 \env{achievements} 环境内、不同的 -% \env{bibliolist} 或 \env{bibliolist*} 环境中编号连续递增、不会间断。 +% 可以使用可选参数 \opt{resume} 设置连续编号。 +% 环境内部使用 \tn{item} 来分隔各条目。 % 普通模式下显示 \env{bibliolist} 中的内容,盲审模式下显示 \env{bibliolist*} 中的内容。 % \end{function} % -% \begin{function}[rEXP,updated=2022-02-24]{resume} +% \begin{function}[rEXP,updated=2024-12-20]{resume} % \begin{syntax} -% \BEV{resume}\oarg{标题} +% \BEV{resume}\oarg{标题参数} % \ \meta{简历内容} % \EEV{resume} % \end{syntax} -% 简历环境。盲审模式下简历将被隐去。可以使用可选参数手动设置标题。 +% 简历环境。盲审模式下简历将被隐去。可以使用 \meta{标题参数} 手动设置标题。 % \end{function} % -% \begin{function}[rEXP]{digest} +% \begin{function}[rEXP,updated=2024-12-20]{digest} % \begin{syntax} -% \BEV{digest}\oarg{lang} +% \BEV{digest}\oarg{lang=<zh|(en)|de|ja>,标题参数} % \ \meta{大摘要} % \EEV{digest} % \end{syntax} -% 学士论文大摘要,使用可选参数设定语言,默认为 \opt{en}。 +% 学士论文大摘要,可以设置可选参数,指定大摘要的局部语言会同步更改小标题 +% 为对应语言设置,默认为 \opt{lang=en}。 % \end{function} % % \section{宏包依赖情况} @@ -1543,6 +1559,7 @@ % \begin{itemize} % \item \cls{ctexbook}、\cls{ctexrep} 和 \cls{ctexart}, % 提供中文排版的通用框架。属于 \CTeX{} 宏集 \cite{CTeX}。 +% \item \pkg{array},提供表格环境的增强功能。 % \item \pkg{mathtools},对 \LaTeX{} 的数学排版功能进行了全面扩展。 % 是 \pkg{amsmath} 的扩充。 % \item \pkg{geometry},用于调整页面尺寸。 @@ -1553,13 +1570,12 @@ % \item \pkg{graphicx},提供图形插入的接口。 % \item \pkg{enumitem},设置列表环境格式。 % \end{itemize} -% \item \cls{sjtuthesis} 会调用 \pkg{xtemplate} 和 \pkg{array},用于辅助 -% 标题页等特殊页面的排版。 % \item 部分西文与数学字体预设会调用相关的字体宏包,具体调用情况请参见对应的 % 字体预设文件。 % \item 部分数字字体预设会调用 \pkg{unicode-math} 处理 Unicode 编码的 % OpenType 数学字体。在未启用 \pkg{unicode-math} 的情况下,会调用 \pkg{bm} % 来选择粗体数学符号。 +% \item 当需要显示总页码数时,会调用 \pkg{pageslts} 宏包。 % \end{itemize} % % 这里只列出了本模板直接调用的宏包。这些宏包自身的调用情况, @@ -1619,14 +1635,14 @@ % \bibitem{source2e} % \textsc{Braams J}, \textsc{Carlisle D}, \textsc{Jeffrey A}, et~al. % \newblock \textit{The \LaTeXe{} Sources}\allowbreak[CP/OL]. -% \newblock (2023-11-01). +% \newblock (2024-11-01). % \urlprefix\url{https://ctan.org/pkg/latex} % \urlprefix\CTANurl[源代码:]{macros/latex/base/source2e.pdf} % % \bibitem{interface3} % \textsc{The \LaTeX{} Project}. % \newblock \textit{The \LaTeXiii{} Interfaces}\allowbreak[EB/OL]. -% \newblock (2023-11-09). +% \newblock (2024-11-02). % \urlprefix\url{https://ctan.org/pkg/l3kernel} % \urlprefix\CTANurl[文档:]{macros/latex/l3kernel/interface3.pdf} % @@ -1657,8 +1673,8 @@ % \bibitem{thuthesis} % 清华大学 TUNA 协会. % \newblock \textit{\textsc{ThuThesis}:清华大学学位论文模板}\allowbreak[EB/OL]. -% \newblock version 7.4.0, -% \newblock (2023-05-15). +% \newblock version 7.5.2, +% \newblock (2025-07-01). % \urlprefix\url{https://ctan.org/pkg/thuthesis} % \urlprefix\CTANurl[文档及源代码:]{macros/latex/contrib/thuthesis/thuthesis.pdf} % @@ -1671,30 +1687,140 @@ % \clearpage % \section{代码实现} % -% \changes{v2.1}{2023/12/05}{同步 \LaTeX{} 2020/10/01,无需显式调用 +% \changes{v2.1}{2023/12/05}{同步 \LaTeX{} 2020-10-01,无需显式调用 % \pkg{expl3} 和 \pkg{xparse} 宏包。} +% \changes{v2.2}{2024/11/22}{同步 \LaTeX{} 2024-06-01,无需显式调用 +% \pkg{xtemplate} 宏包。} +% \changes{v2.2}{2025/02/10}{重命名视觉形象系统文件名称。} % 本模板使用 \LaTeXiii{} 语法编写,依赖 \pkg{expl3} 环境, % 并需调用 \pkg{l3packages} 中的相关宏包。 % +% \subsection{前置准备} +% +% 目前 \pkg{sjtutex} 文档类仅支持 \XeLaTeX{}、\LuaLaTeX{} 和 \pdfLaTeX{} 编译。 % \begin{macrocode} %<@@=sjtu> +%<*class> +\msg_new:nnn { sjtutex } { unsupported-engine } + { + The~sjtutex~classes~does~NOT~support~'#1'~engine. \\\\ + Please~set~your~typesetting~program~to~either~ + 'xelatex'~or~'lualatex'. + } +\bool_lazy_any:nF + { + { \sys_if_engine_xetex_p: } + { \sys_if_engine_luatex_p: } + { \sys_if_engine_pdftex_p: } + } + { \msg_fatal:nnV { sjtutex } { unsupported-engine } \c_sys_engine_str } % \end{macrocode} % -% \subsection{内部变量} +% \subsection{内部定义} % -% \begin{variable}{\l_@@_tmp_bool,\l_@@_tmp_clist,\l_@@_tmp_dim, -% \l_@@_tmp_skip,\l_@@_tmp_box} +% \begin{variable}{\l_@@_tmp_tl,\l_@@_tmp_clist,\l_@@_tmp_box} % 临时变量。 % \begin{macrocode} -%<*class> -%<thesis>\bool_new:N \l_@@_tmp_bool -%<thesis>\clist_new:N \l_@@_tmp_clist -\dim_new:N \l_@@_tmp_dim -\skip_new:N \l_@@_tmp_skip -\box_new:N \l_@@_tmp_box +\tl_new:N \l_@@_tmp_tl +\clist_new:N \l_@@_tmp_clist +%<thesis>\box_new:N \l_@@_tmp_box % \end{macrocode} % \end{variable} % +% \begin{macro}[int]{\clist_use:Nv,\clist_use:cv, +% \exp_args:NNnv,\exp_last_unbraced:ce} +% \LaTeX3{} 函数变体。 +% \begin{macrocode} +\cs_generate_variant:Nn \clist_use:Nn { Nv, cv } +\exp_args_generate:n { Nnv } +\cs_generate_variant:Nn \exp_last_unbraced:Ne { ce } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\@@_conditional_const:nn} +% \begin{macrocode} +\cs_new_protected:Npn \@@_conditional_const:nn #1#2 + { + \bool_if:nTF {#2} + { + \cs_new_eq:cN { @@_if_ #1 :T } \use:n + \cs_new_eq:cN { @@_if_ #1 :F } \use_none:n + \cs_new_eq:cN { @@_if_ #1 :TF } \use_i:nn + \cs_new_eq:cN { @@_if_ #1 _p: } \c_true_bool + } + { + \cs_new_eq:cN { @@_if_ #1 :T } \use_none:n + \cs_new_eq:cN { @@_if_ #1 :F } \use:n + \cs_new_eq:cN { @@_if_ #1 :TF } \use_ii:nn + \cs_new_eq:cN { @@_if_ #1 _p: } \c_false_bool + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int,pTF]{\@@_if_engine_opentype:} +% \begin{macrocode} +\@@_conditional_const:nn { engine_opentype } + { + \bool_lazy_or_p:nn + { \sys_if_engine_xetex_p: } + { \sys_if_engine_luatex_p: } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\@@_disable_package_load:n} +% \begin{macrocode} +\msg_new:nnn { sjtutex } { package-disabled } + { The~loading~of~package~'#1'~is~disabled. } +\cs_new_protected:Npn \@@_disable_package_load:n #1 + { + \disable@package@load {#1} + { \msg_warning:nnn { sjtutex } { package-disabled } {#1} } + } +% \end{macrocode} +% \end{macro} +% +% \changes{v2.0.2}{2023/03/31}{区分 \texttt{dim} 与 \texttt{skip} 类型变量。} +% \begin{macro}[int]{\@@_dim_set_to_wd:Nn} +% 操作长度变量的辅助函数。 +% \begin{macrocode} +%<*thesis> +\cs_new:Npn \@@_dim_set_to_wd:Nn #1#2 + { + \hbox_set:Nn \l_@@_tmp_box {#2} + \dim_set:Nn #1 { \box_wd:N \l_@@_tmp_box } + } +\cs_generate_variant:Nn \@@_dim_set_to_wd:Nn { Nv } +%</thesis> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\@@_cs_provide_eq:NN} +% \begin{macrocode} +\cs_new_protected:Npn \@@_cs_provide_eq:NN #1#2 + { \cs_if_exist:NF #1 { \cs_set_eq:NN #1 #2 } } +\cs_generate_variant:Nn \@@_cs_provide_eq:NN { cc } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\@@_name_set:nnn,\@@_name_const:nnn, +% \@@_name_const_from_clist:nnnn} +% 定义默认名称的辅助函数。 +% \begin{macrocode} +\cs_new_protected:Npn \@@_name_set:nnn #1#2#3 + { \tl_set:cn { l_@@_name_ #2 _ #1 _tl } {#3} } +\cs_new_protected:Npn \@@_name_const:nnn #1#2#3 + { \tl_const:cn { c_@@_name_ #2 _ #1 _tl } {#3} } +%<*thesis> +\cs_new_protected:Npn \@@_name_const_from_clist:nnnn #1#2#3#4 + { \tl_const:ce { c_@@_name_ #2 _ #1 _tl } { \clist_item:nn {#4} {#3} } } +%</thesis> +% \end{macrocode} +% \end{macro} +% +% \subsection{文档选项} +% % \begin{variable}{\g_@@_thesis_type_int} % 论文类型。 % \begin{macrocode} @@ -1702,33 +1828,23 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_lang_tl,\g_@@_lang_clist, -% \c_@@_lang_de_tl,\c_@@_lang_ja_tl } -% 论文语言。 +% \begin{variable}{\g_@@_lang_tl,\g_@@_lang_clist} +% 论文主要语言。 % \begin{macrocode} \tl_new:N \g_@@_lang_tl %<thesis>\clist_set:Nn \g_@@_lang_clist { zh, en } -\tl_const:Nn \c_@@_lang_de_tl { de } -\tl_const:Nn \c_@@_lang_ja_tl { ja } % \end{macrocode} % \end{variable} % -% \begin{variable} -% {\g_@@_zihao_tl,\g_@@_font_size_int,\g_@@_font_size_dim, -% \g_@@_baseline_skip_dim,\g_@@_fixed_baselineskip_bool,\g_@@_line_spread_fp} -% 字号大小与行距。 +% \begin{variable}{\g_@@_baseline_skip_dim,\g_@@_fixed_baselineskip_bool} +% 固定行距。 % \begin{macrocode} -\tl_new:N \g_@@_zihao_tl -\int_new:N \g_@@_font_size_int -\dim_new:N \g_@@_font_size_dim \dim_new:N \g_@@_baseline_skip_dim \bool_new:N \g_@@_fixed_baselineskip_bool -\fp_new:N \g_@@_line_spread_fp % \end{macrocode} % \end{variable} % -% \begin{variable} -% {\g_@@_text_font_tl,\g_@@_math_font_tl,\g_@@_cjk_font_tl} +% \begin{variable}{\g_@@_text_font_tl,\g_@@_math_font_tl,\g_@@_cjk_font_tl} % 字体配置。 % \begin{macrocode} \tl_new:N \g_@@_text_font_tl @@ -1776,69 +1892,57 @@ % 保存由 \pkg{sjtutex} 传入 \pkg{ctex} 文档类的选项列表。 % 默认 \pkg{ctex} 文档类的选项: % 使用 UTF8 编码,不调整基础类的版式以及不载入 \pkg{ctex} 字体预设配置。 +% \cls{sjtuthesis} 和 \cls{sjtureport} 文档类默认字号为小四号。 +% \cls{sjtureport} 和 \cls{sjtuarticle} 文档类默认使用 1.3 行距倍数。 % \begin{macrocode} \clist_set:Nn \g_@@_options_to_ctex_class_clist - { a4paper, UTF8, scheme = plain, fontset = none } + { + UTF8, +%<!article> zihao = -4, +%<!thesis> linespread = 1.3, + scheme = plain, + fontset = none + } % \end{macrocode} % \end{variable} % % \begin{variable}{\g_@@_options_to_packages_clist} % 保存由传入其他宏包的选项列表。 % \begin{macrocode} -\clist_new:N \g_@@_options_to_packages_clist -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\g_@@_twoside_bool} -% 是否开启双页模式。 -% \begin{macrocode} -\bool_new:N \g_@@_twoside_bool -%<thesis>\bool_set_true:N \g_@@_twoside_bool -%<!thesis>\bool_set_false:N \g_@@_twoside_bool -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\g_@@_openright_bool} -% 是否在奇数页开始新章。 -% \begin{macrocode} -%<!article>\bool_new:N \g_@@_openright_bool -%<thesis>\bool_set_true:N \g_@@_openright_bool -%<report>\bool_set_false:N \g_@@_openright_bool -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\g_@@_titlepage_bool} -% 是否生成标题页。 -% \begin{macrocode} -%<!thesis>\bool_new:N \g_@@_titlepage_bool -%<report>\bool_set_true:N \g_@@_titlepage_bool -%<article>\bool_set_false:N \g_@@_titlepage_bool -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\g_@@_draft_bool} -% 是否开启草稿模式。 -% \begin{macrocode} -\bool_new:N \g_@@_draft_bool +\clist_set:Nn \g_@@_options_to_packages_clist + { + { no-math } { fontspec } , + { list = off } { bicaption } , + { warnings-off = + { + mathtools-overbracket, + mathtools-colon + } + } { unicode-math } , +%<!article> { chapter } { algorithm } , +%<!article> { algochapter } { algorithm2e } , + { amsmath, thmmarks } { ntheorem } + } % \end{macrocode} % \end{variable} % -% \begin{macro}[int]{\@@_deprecated_option:n,\@@_set_deprecated_option:n} +% \begin{macro}[int]{\@@_set_deprecated_option:n} % 对过时选项给出警告。 % \begin{macrocode} -\cs_new_protected:Npn \@@_deprecated_option:n - { \msg_warning:nnn { sjtutex } { deprecated-option } } +\msg_new:nnn { sjtutex } { deprecated-option } + { Option~'\l_keys_key_str'~is~deprecated! \\ #1 } \cs_new_protected:Npn \@@_set_deprecated_option:n #1 { - \@@_deprecated_option:n { Option~ `#1'~ is~ set. } + \msg_warning:nnn { sjtutex } { deprecated-option } { Option~'#1'~is~set. } \keys_set:nn { sjtu / option } {#1} } -\msg_new:nnn { sjtutex } { deprecated-option } - { Option~ `\l_keys_key_tl'~ is~ deprecated. \\ #1 } % \end{macrocode} % \end{macro} % -% \subsection{选项处理} +% \begin{macrocode} +\msg_new:nnn { sjtutex } { unsupported-option } + { Option~'\l_keys_key_str'~is~not~supported! \\ Will~be~ignored. } +% \end{macrocode} % % 定义 |sjtu/option| 键值类。 % \begin{macrocode} @@ -1882,37 +1986,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{zihao} -% 字号大小。 -% \begin{macrocode} - zihao .choice: , - zihao .value_required:n = true , - zihao / 5 .code:n = - { - \tl_gset:Nn \g_@@_zihao_tl {#1} - \int_gset:Nn \g_@@_font_size_int { 1 } - \dim_gset:Nn \g_@@_font_size_dim { 10.5 bp } - } , - zihao / -4 .code:n = - { - \tl_gset:Nn \g_@@_zihao_tl {#1} - \int_gset:Nn \g_@@_font_size_int { 2 } - \dim_gset:Nn \g_@@_font_size_dim { 12 bp } - } , -%<!article> zihao .initial:n = { -4 } , -%<article> zihao .initial:n = { 5 } , -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{linespread} -% 行距倍数。 -% \begin{macrocode} - linespread .fp_gset:N = \g_@@_line_spread_fp , - linespread .initial:n = { \c_nan_fp } , - linespread .value_required:n = true , -% \end{macrocode} -% \end{macro} -% % \changes{v2.0}{2022/12/03}{添加 \opt{lineskip} 文档类选项。} % \changes{v2.1}{2023/10/24}{添加 \opt{baselineskip} 文档类选项, % 替换原 \opt{lineskip} 选项。} @@ -1943,9 +2016,12 @@ % \end{macrocode} % \end{macro} % -% \opt{fontset} 是过时选项。 +% \opt{fontset} 等是过时选项。 % \begin{macrocode} - fontset .code:n = { \@@_set_deprecated_option:n { cjk-font = #1 } } , + fontset .code:n = { \@@_set_deprecated_option:n { cjk-font = #1 } } , + nofonts .code:n = { \@@_set_deprecated_option:n { cjk-font = none } } , + adobefonts .code:n = { \@@_set_deprecated_option:n { cjk-font = adobe } } , + winfonts .code:n = { \@@_set_deprecated_option:n { cjk-font = windows } } , % \end{macrocode} % % \changes{v2.0}{2023/01/05}{添加 \opt{math-style} 文档类选项,默认值为 \opt{ISO}。} @@ -2006,58 +2082,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{oneside,twoside} -% 单面或双面模式。 -% \begin{macrocode} - oneside .value_forbidden:n = true, - twoside .value_forbidden:n = true, - oneside .code:n = - { \bool_gset_false:N \g_@@_twoside_bool } , - twoside .code:n = - { \bool_gset_true:N \g_@@_twoside_bool } , -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{openany,openright} -% 是否奇数页开章。 -% \begin{macrocode} -%<*!article> - openany .value_forbidden:n = true, - openright .value_forbidden:n = true, - openany .code:n = - { \bool_gset_false:N \g_@@_openright_bool } , - openright .code:n = - { \bool_gset_true:N \g_@@_openright_bool } , -%</!article> -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{titlepage,notitlepage} -% 是否生成标题页。 -% \begin{macrocode} -%<*!thesis> - titlepage .value_forbidden:n = true, - notitlepage .value_forbidden:n = true, - titlepage .code:n = - { \bool_gset_true:N \g_@@_titlepage_bool } , - notitlepage .code:n = - { \bool_gset_false:N \g_@@_titlepage_bool } , -%</!thesis> -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{draft,final} -% 是否开启草稿模式。 -% \begin{macrocode} - draft .value_forbidden:n = true, - final .value_forbidden:n = true, - draft .code:n = - { \bool_gset_true:N \g_@@_draft_bool } , - final .code:n = - { \bool_gset_false:N \g_@@_draft_bool } , -% \end{macrocode} -% \end{macro} -% % \begin{macro}{review} % 盲审模式。 % \begin{macrocode} @@ -2066,76 +2090,81 @@ % \end{macrocode} % \end{macro} % -% 处理未知选项。 +% 将未知选项传给标准文档类。 % \begin{macrocode} - unknown .code:n = { \msg_error:nn { sjtutex } { unknown-option } } + unknown .code:n = + { \clist_gput_right:No \g_@@_options_to_ctex_class_clist { \CurrentOption } } } -\msg_new:nnn { sjtutex } { unknown-option } - { Class~ option~ "\l_keys_key_tl"~ is~ unknown. } % \end{macrocode} % -% 将文档类选项传给 |sjtu/option|。 +% 屏蔽不支持的 \pkg{ctex} 选项。 % \begin{macrocode} -\cs_if_exist:NTF \ProcessKeyOptions - { \ProcessKeyOptions [ sjtu / option ] } +\clist_map_inline:nn + { GBK, scheme, cap, nocap } { - \RequirePackage { l3keys2e } - \ProcessKeysOptions { sjtu / option } + \keys_define:nn { sjtu / option } + { + #1 .code:n = + { \msg_warning:nn { sjtutex } { unsupported-option } } + } } % \end{macrocode} -% \cls{sjtureport} 和 \cls{sjtuarticle} 文档类默认使用 1.3 行距倍数。 +% +% 将文档类选项传给 |sjtu/option|。 % \begin{macrocode} -%<*!thesis> -\bool_if:NF \g_@@_fixed_baselineskip_bool - { - \fp_if_nan:nT { \g_@@_line_spread_fp } - { \fp_set:Nn \g_@@_line_spread_fp { 1.3 } } - } -%</!thesis> +\ProcessKeyOptions [ sjtu / option ] +% \end{macrocode} +% +% \begin{macro}[int,pTF]{\@@_if_main_lang_de:,\@@_if_main_lang_ja:} +% 快捷判断主要语言。 +% \begin{macrocode} +\@@_conditional_const:nn { main_lang_de } + { \str_if_eq_p:Vn \g_@@_lang_tl { de } } +\@@_conditional_const:nn { main_lang_ja } + { \str_if_eq_p:Vn \g_@@_lang_tl { ja } } % \end{macrocode} +% \end{macro} % % 数字字体宏包选项。 % \begin{macrocode} -\clist_set:Nx \g_@@_math_font_options_clist - { - \bool_if:NT \g_@@_slanted_uppercase_greek_bool - { slantedGreek } , - \bool_if:NT \g_@@_upright_integral_bool - { upint } - } +\bool_if:NT \g_@@_slanted_uppercase_greek_bool + { \clist_put_right:Nn \g_@@_math_font_options_clist { slantedGreek } } +\bool_if:NT \g_@@_upright_integral_bool + { \clist_put_right:Nn \g_@@_math_font_options_clist { upint } } % \end{macrocode} % -% 追加全局选项。 +% 追加选项。 % \begin{macrocode} -\clist_put_right:Nx \@classoptionslist +\clist_put_left:Nn \@classoptionslist { a4paper } +\@@_if_main_lang_de:T + { \clist_put_right:Nn \@classoptionslist { german, ngerman } } +\bool_if:NTF \g_@@_integral_limits_bool + { + \clist_put_right:Nn \@classoptionslist { intlimits } + \clist_put_right:Nn \g_@@_options_to_packages_clist + { { displaylimits } { cmupint } } + } { - a4paper , - \tl_if_eq:NNT \g_@@_lang_tl \c_@@_lang_de_tl - { german, ngerman } , - \bool_if:NT \g_@@_integral_limits_bool - { intlimits } , - \g_@@_math_font_options_clist + \clist_put_right:Nn \g_@@_options_to_packages_clist + { { nolimits } { cmupint } } } +\clist_concat:NNN \@classoptionslist + \@classoptionslist \g_@@_math_font_options_clist % \end{macrocode} % -% 设置传入 \pkg{ctex} 文档类的选项。 +% 内部设置接口。 % \begin{macrocode} -\clist_put_right:Nx \g_@@_options_to_ctex_class_clist +%<*thesis> +\cs_set_protected:Npe \@@_setup:n { - zihao = \g_@@_zihao_tl , - \fp_if_nan:nF { \g_@@_line_spread_fp } - { linespread = \fp_use:N \g_@@_line_spread_fp } , - \bool_if:NTF \g_@@_twoside_bool - { twoside } { oneside } , -%<!article> \bool_if:NTF \g_@@_openright_bool -%<!article> { openright } { openany } , -%<!thesis> \bool_if:NTF \g_@@_titlepage_bool -%<!thesis> { titlepage } { notitlepage } , - \bool_if:NTF \g_@@_draft_bool - { draft } { final } + \bool_if:NTF \g_@@_review_bool + { \exp_not:N \keys_set_exclude_groups:nnn { sjtu } { sensitive } } + { \exp_not:N \keys_set:nn { sjtu } } } +%</thesis> % \end{macrocode} % +% % \subsection{载入宏包、文档类} % % 将选项传入 \pkg{ctex} 文档类。 @@ -2149,24 +2178,6 @@ % % 传入各宏包选项。 % \begin{macrocode} -\clist_set:Nx \g_@@_options_to_packages_clist - { - { no-math } { fontspec } , - { list = off } { bicaption } , - { warnings-off = - { - mathtools-overbracket, - mathtools-colon - } - } { unicode-math } , - { amsmath, thmmarks } { ntheorem } , -%<!article> { chapter } { algorithm } , -%<!article> { algochapter } { algorithm2e } , - { - \bool_if:NTF \g_@@_integral_limits_bool - { displaylimits } { nolimits } - } { cmupint } - } \clist_map_inline:Nn \g_@@_options_to_packages_clist { \PassOptionsToPackage #1 } % \end{macrocode} @@ -2185,8 +2196,7 @@ % \begin{macrocode} \RequirePackage { -%<thesis> xtemplate, -%<thesis> array, + array, mathtools, geometry, fancyhdr, @@ -2200,315 +2210,41 @@ } % \end{macrocode} % -% \subsection{内部定义} -% -% \subsubsection{内部函数} -% -% \begin{macro}[int]{\cs_gset:cpo,\tl_const:Nv, -% \clist_use:NV,\clist_use:cv, -% \exp_args:NNnv,\exp_last_unbraced:ce, -% \regex_match:neTF} -% \LaTeX3{} 函数变体。 -% \begin{macrocode} -\cs_generate_variant:Nn \cs_gset:Npn { cpo } -\cs_generate_variant:Nn \tl_const:Nn { Nv } -\cs_generate_variant:Nn \clist_use:Nn { NV, cv } -\exp_args_generate:n { Nnv } -\cs_generate_variant:Nn \exp_last_unbraced:Ne { ce } -\prg_generate_conditional_variant:Nnn \regex_match:nn { ne } { T, TF } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_engine_case:nn} -% 2 个参数依次为 \pdfTeX 和 \XeTeX/\LuaTeX。 -% \begin{macrocode} -\cs_new:Npx \@@_engine_case:nn #1#2 - { - \bool_lazy_or:nnTF - { \sys_if_engine_xetex_p: } - { \sys_if_engine_luatex_p: } - {#2} - { \sys_if_engine_pdftex:T {#1} } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_engine_case:nnn} -% 3 个参数依次为 \pdfTeX、 \XeTeX 和 \LuaTeX。 -% \begin{macrocode} -\cs_new:Npx \@@_engine_case:nnn #1#2#3 - { - \sys_if_engine_xetex:TF - {#2} - { - \sys_if_engine_luatex:TF - {#3} - { \sys_if_engine_pdftex:T {#1} } - } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_unicode_engine_case:nn} -% 2 个参数依次为 \XeTeX 和 \LuaTeX。 -% \begin{macrocode} -\cs_new:Npx \@@_unicode_engine_case:nn #1#2 - { - \sys_if_engine_xetex:TF - {#1} - { \sys_if_engine_luatex:T {#2} } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_unicode_char:n} -% \begin{macrocode} -\@@_engine_case:nn - { - \cs_new:Npn \@@_unicode_char:n #1 - { - \exp_not:N \Unicode - { \int_div_truncate:nn {#1} { 256 } } - { \int_mod:nn {#1} { 256 } } - } - } - { \cs_new:Npn \@@_unicode_char:n #1 { \tex_Uchar:D #1 \scan_stop: } } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_preto_cmd:Nn,\@@_appto_cmd:Nn} -% 补丁工具,来自 \pkg{ctexpatch} 宏包,在宏的原本定义前后增加钩子。 -% \begin{macrocode} -%<*!thesis> -\cs_new_protected:Npn \@@_preto_cmd:Nn #1#2 - { - \ctex_preto_cmd:NnnTF #1 { } {#2} - { } { \ctex_patch_failure:N #1 } - } -\cs_new_protected:Npn \@@_appto_cmd:Nn #1#2 - { - \ctex_appto_cmd:NnnTF #1 { } {#2} - { } { \ctex_patch_failure:N #1 } - } -%</!thesis> -% \end{macrocode} -% \end{macro} +% \subsection{文档格式} % -% \changes{v2.0.2}{2023/03/31}{区分 \texttt{dim} 与 \texttt{skip} 类型变量。} -% \begin{macro}[int]{\@@_dim_set_to_wd:Nn,\@@_skip_add_to_wd:Nn} -% 操作长度变量的辅助函数。 -% \begin{macrocode} -%<*thesis> -\cs_new:Npn \@@_dim_set_to_wd:Nn #1#2 - { - \hbox_set:Nn \l_@@_tmp_box {#2} - \dim_set:Nn #1 { \box_wd:N \l_@@_tmp_box } - } -%</thesis> -\cs_new:Npn \@@_skip_add_to_wd:Nn #1#2 - { - \hbox_set:Nn \l_@@_tmp_box {#2} - \skip_add:Nn #1 { \box_wd:N \l_@@_tmp_box } - } -%<thesis>\cs_generate_variant:Nn \@@_dim_set_to_wd:Nn { Nv } -\cs_generate_variant:Nn \@@_skip_add_to_wd:Nn { cv } -% \end{macrocode} -% \end{macro} +% \subsubsection{字号行距} % -% \begin{macro}[int]{\@@_cs_provide_eq:NN} +% \begin{macro}[int]{\SJTU@orig@normalsize} +% 保存原始 \tn{normalsize} 字号大小。 % \begin{macrocode} -\cs_new:Npn \@@_cs_provide_eq:NN #1#2 - { \cs_if_exist:NF #1 { \cs_set_eq:NN #1 #2 } } -\cs_generate_variant:Nn \@@_cs_provide_eq:NN { cc } +\normalsize +\cs_set_protected:Npe \SJTU@orig@normalsize + { \exp_not:N \fontsize { \f@size } { \f@baselineskip } \exp_not:N \selectfont } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_vspace:N,\@@_vspace:n, -% \@@_vspace_r:N,\@@_vspace_r:n} -% 类似 \LaTeXe{} 中的 \tn{vspace} 和 \tn{vspace*}。 -% \begin{macrocode} -%<*thesis> -\cs_new_protected:Npn \@@_vspace:N #1 - { - \skip_vertical:N #1 - \skip_vertical:N \c_zero_skip - } -\cs_new_protected:Npn \@@_vspace:n #1 - { - \skip_set:Nn \l_@@_tmp_skip {#1} - \@@_vspace:N \l_@@_tmp_skip - } -\cs_new_protected:Npn \@@_vspace_r:N #1 - { - \dim_set_eq:NN \l_@@_tmp_dim \prevdepth - \hrule height \c_zero_dim - \nobreak - \skip_vertical:N #1 - \skip_vertical:N \c_zero_skip - \dim_set_eq:NN \prevdepth \l_@@_tmp_dim - } -\cs_new_protected:Npn \@@_vspace_r:n #1 - { - \skip_set:Nn \l_@@_tmp_skip {#1} - \@@_vspace_r:N \l_@@_tmp_skip - } -%</thesis> -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_define_name:nn,\@@_define_name:nv,\@@_define_name:nnn, -% \@@_define_name_from_clist:nnnn} -% 定义默认名称的辅助函数。 -% \begin{macrocode} -\cs_new_protected:Npn \@@_define_name:nn #1#2 - { \tl_const:cn { c_@@_name_ #1 _tl } {#2} } -\cs_new_protected:Npn \@@_define_name:nnn #1#2#3 - { \tl_const:cn { c_@@_name_ #2 _ #1 _tl } {#3} } -%<*thesis> -\cs_new_protected:Npn \@@_define_name_from_clist:nnnn #1#2#3#4 - { \tl_const:cx { c_@@_name_ #2 _ #1 _tl } { \clist_item:nn {#4} {#3} } } -\cs_generate_variant:Nn \@@_define_name:nn { nv } -%</thesis> -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_define_symbol:nn} -% 定义符号的辅助函数。 -% \begin{macrocode} -\cs_new_protected:Npn \@@_define_symbol:nn #1#2 - { \tl_const:cx { c_@@_symbol_ #1 _tl } { \@@_unicode_char:n {#2} } } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_if_lang_valid:nTF} -% 验证语言选项的函数。 -% \begin{macrocode} -%<*thesis> -\cs_new_protected:Npn \@@_if_lang_valid:nTF #1 - { \clist_if_in:NnTF \g_@@_lang_clist {#1} } -\msg_new:nnn { sjtutex } { lang-validation } - { Invalid~ language~ argument~ `#1'! } -% \end{macrocode} -% \end{macro} -% -% \subsubsection{页面模板} -% -% 使用 \pkg{xtemplate} 构建页面模板,用于绘制标题页与版权页。 -% -% 页面部件模板。 -% \begin{macrocode} -\DeclareObjectType { sjtu } { 0 } -\DeclareTemplateInterface { sjtu } { component } { 0 } - { - format : tokenlist = \c_empty_tl , - content : tokenlist = \c_empty_tl , - bottom-skip : skip = \c_zero_skip , - align : choice { left, right, center, normal } = center - } -\DeclareTemplateCode { sjtu } { component } { 0 } - { - format = \l_@@_component_format_tl , - content = \l_@@_component_content_tl , - bottom-skip = \l_@@_component_bottom_skip , - align = - { - left = - \cs_set_eq:NN \l_@@_component_align: \raggedright , - right = - \cs_set_eq:NN \l_@@_component_align: \raggedleft , - center = - \cs_set_eq:NN \l_@@_component_align: \centering , - normal = - \cs_set_eq:NN \l_@@_component_align: \prg_do_nothing: - } - } - { - \AssignTemplateKeys - \group_begin: - \l_@@_component_align: - \l_@@_component_format_tl - \l_@@_component_content_tl - \par - \group_end: - \@@_vspace:N \l_@@_component_bottom_skip - } -% \end{macrocode} -% -% 页面模板。 -% \begin{macrocode} -\DeclareTemplateInterface { sjtu } { page } { 0 } - { - bookmark : boolean = false , - bookmark-text : tokenlist = \c_empty_tl , - style : tokenlist = empty , - format : tokenlist = \c_empty_tl , - prefix : tokenlist , - components : commalist , - top-skip : skip = \c_zero_skip , - bottom-skip : skip = \c_zero_skip - } -\DeclareTemplateCode { sjtu } { page } { 0 } - { - bookmark = \l_@@_page_bookmark_bool , - bookmark-text = \l_@@_page_bookmark_text_tl , - style = \l_@@_page_style_tl , - format = \l_@@_page_format_tl , - prefix = \l_@@_page_prefix_tl , - components = \l_@@_page_components_clist , - top-skip = \l_@@_page_top_skip , - bottom-skip = \l_@@_page_bottom_skip - } - { - \AssignTemplateKeys - \bool_if:NTF \g_@@_openright_bool - { \cleardoublepage } { \clearpage } - \bool_if:NT \l_@@_page_bookmark_bool - { \@@_pdf_bookmark:nn { 0 } { \l_@@_page_bookmark_text_tl } } - \exp_args:No \thispagestyle { \l_@@_page_style_tl } -% \end{macrocode} -% 移除页面顶部 \tn{vspace*} 的多余空白。 -% 见 \url{https://tex.stackexchange.com/questions/247513}。 -% \begin{macrocode} - \@@_vspace_r:N \l_@@_page_top_skip - \@@_vspace:n { - \tex_parskip:D } - \@@_vspace:n { - \tex_baselineskip:D } - \group_begin: - \l_@@_page_format_tl - \clist_map_inline:Nn \l_@@_page_components_clist - { \UseInstance { sjtu } { \l_@@_page_prefix_tl / ##1 } } - \group_end: - \@@_vspace:N \l_@@_page_bottom_skip - \clearpage - } -% \end{macrocode} -% -% 辅助函数。 -% \begin{macrocode} -\cs_new:Npn \@@_declare_component:nnn #1#2#3 - { \DeclareInstance { sjtu } {#1/#2} { component } {#3} } -\cs_new:Npn \@@_declare_page:nn #1#2 - { \DeclareInstance { sjtu } {#1} { page } {#2} } -%</thesis> -% \end{macrocode} -% -% \subsection{字号行距} -% % \begin{macro}[int]{\@@_set_font_size:nnNn} % \begin{macro}{\normalsize} % 重定义 \tn{normalsize},设置正文的基线间距。 % \begin{macrocode} +\msg_new:nnn { sjtutex } { baselineskip-invalid } + { Invalid~baselineskip~value~'#1'! \\ Using~default~value~instead. } \cs_new_protected:Npn \@@_set_font_size:nnNn #1#2#3#4 { \cs_set_protected:Npn #3 { \@setfontsize #3 {#1} {#2} #4 } } -\tl_set:Nx \l_@@_font_size_tl - { - { \dim_to_decimal:n { \g_@@_font_size_dim } } - { \dim_to_decimal:n { \g_@@_baseline_skip_dim } } - } \bool_if:NT \g_@@_fixed_baselineskip_bool { - \int_case:nn { \g_@@_font_size_int } + \dim_compare:nNnTF { \f@size pt } > { \g_@@_baseline_skip_dim } + { + \msg_warning:nne { sjtutex } { baselineskip-invalid } + { \dim_to_decimal:n { \g_@@_baseline_skip_dim } pt } + } { - { 1 } { + \tl_set:Ne \l_@@_font_size_tl + { { \f@size } { \dim_to_decimal:n { \g_@@_baseline_skip_dim } } } + \int_case:nn { \@ptsize } + { + { 0 } + { \exp_after:wN \@@_set_font_size:nnNn \l_@@_font_size_tl \normalsize { @@ -2519,7 +2255,20 @@ \let\@listi\@listI } } - { 2 } { + { 1 } + { + \exp_after:wN \@@_set_font_size:nnNn \l_@@_font_size_tl + \normalsize + { + \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI + } + } + { 2 } + { \exp_after:wN \@@_set_font_size:nnNn \l_@@_font_size_tl \normalsize { @@ -2530,8 +2279,9 @@ \let\@listi\@listI } } + } + \normalsize } - \normalsize } % \end{macrocode} % \end{macro} @@ -2545,35 +2295,17 @@ % \end{macrocode} % \end{macro} % -% \subsection{字体配置} +% \subsubsection{字体配置} % % \begin{macro}[int]{\@@_fontset_error:nn} % 字库不可用时给出紧急错误信息,停止读取定义文件。 % \begin{macrocode} -\cs_new_protected:Npn \@@_fontset_error:nn #1#2 - { \msg_error:nnnn { sjtutex } { font-unavailable } {#1} {#2} } \msg_new:nnn { sjtutex } { font-unavailable } - { `#1-font~ =~ #2'~ is~ unavailable~ in~ current~ mode. } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_fontset_case:nn} -% 2 个参数依次为 \pdfTeX 和 \XeTeX/\LuaTeX。 -% \begin{macrocode} -\cs_new_eq:NN \@@_fontset_case:nn \@@_engine_case:nn -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_fontset_case:nnn} -% 3 个参数依次为 \pdfTeX(生成 PDF)、\pdfTeX(生成 DVI) 和 -% \XeTeX/\LuaTeX。 -% \begin{macrocode} -\cs_new:Npx \@@_fontset_case:nnn #1#2#3 - { - \@@_engine_case:nn - { \sys_if_output_pdf:TF {#1} {#2} } - {#3} - } + { '#1-font~=~#2'~is~unavailable~in~current~mode. } +\cs_new_protected:Npn \@@_fontset_error:nn #1#2 + { \msg_critical:nnnn { sjtutex } { font-unavailable } {#1} {#2} } +\cs_set_protected:Npn \ctex_fontset_error:n #1 + { \msg_critical:nnnn { sjtutex } { font-unavailable } { cjk } {#1} } % \end{macrocode} % \end{macro} % @@ -2644,9 +2376,14 @@ % \begin{macro}[int]{\@@_load_font:nn,\@@_load_fontset:} % 如果字体配置文件不存在,则载入默认值,并给出警告。 % \begin{macrocode} +\msg_new:nnn { sjtutex } { invalid-font } + { + Invalid~value~'#1-font~=~\tl_use:c { g_@@_ #1 _font_tl }'! \\ + Using~'#2'~instead. + } \cs_new_protected:Npn \@@_load_font:nn #1#2 { - \str_if_eq:eeF { \tl_use:c { g_@@_ #1 _font_tl } } { none } + \str_if_eq:vnF { g_@@_ #1 _font_tl } { none } { \file_if_exist:nF { sjtu- #1 -font- \tl_use:c { g_@@_ #1 _font_tl } .def } @@ -2658,11 +2395,6 @@ { sjtu- #1 -font- \tl_use:c { g_@@_ #1 _font_tl } .def } } } -\msg_new:nnn { sjtutex } { invalid-font } - { - Invalid~ value~ `#1-font~ =~ \tl_use:c { g_@@_ #1 _font_tl }~ '! \\\\ - Using~ `#2'~ instead. - } \cs_new_protected:Nn \@@_load_fontset: { \clist_map_inline:nn @@ -2679,67 +2411,75 @@ % \end{macrocode} % \end{macro} % -% \subsubsection{西文与数学字体} +% \paragraph{西文与数学字体} % % \changes{v2.0.3}{2023/09/25}{新增 \opt{libertinus} 字体配置。} % \begin{macrocode} %<*font&(math|text)> -%<*stixtwo> -\@@_fontset_case:nn - { -%<*math> - \DeclareSizeFunction { sub } { \sub@sfcnt \@font@info } - \PassOptionsToPackage { notext } { stix2 } - \RequirePackage { stix2 } - \clist_map_inline:nn - { - \upalpha { "0B } , - \upbeta { "0C } , - \upgamma { "0D } , - \updelta { "0E } , - \upepsilon { "0F } , - \upzeta { "10 } , - \upeta { "11 } , - \uptheta { "12 } , - \upiota { "13 } , - \upkappa { "14 } , - \uplambda { "15 } , - \upmu { "16 } , - \upnu { "17 } , - \upxi { "18 } , - \uppi { "19 } , - \uprho { "1A } , - \upsigma { "1B } , - \uptau { "1C } , - \upupsilon { "1D } , - \upphi { "1E } , - \upchi { "1F } , - \uppsi { "20 } , - \upomega { "21 } , - \upvarepsilon { "22 } , - \upvartheta { "23 } , - \upvarpi { "24 } , - \upvarrho { "25 } , - \upvarsigma { "26 } , - \upvarphi { "27 } - } - { \@@_declare_math_symbol:nnNn { \stix@lcgc } { operators } #1 } - \@@_set_slanted_greek: -%</math> -%<*text> - \tl_set:Nn \encodingdefault { T1 } - \DeclareEncodingSubset { TS1 } { ? } { 0 } - \UndeclareTextCommand { \textpertenthousand } { T1 } - \DeclareTextSymbolDefault { \textpertenthousand } { TS1 } - \tl_set:Nn \rmdefault { stix2 } - \tl_set:Nn \qhv@scale { 0.94 } - \tl_set:Nn \sfdefault { qhv } - \tl_set:Nn \ttdefault { qcr } -%</text> - } +%<*math&type1> +%<*newtx|newpx> +\tl_set_eq:NN \l_@@_save_encodingdefault_tl \encodingdefault +\tl_set_eq:NN \l_@@_save_rmdefault_tl \rmdefault +\tl_set_eq:NN \l_@@_save_sfdefault_tl \sfdefault +\tl_set_eq:NN \l_@@_save_ttdefault_tl \ttdefault +\tl_set:Nn \encodingdefault { OT1 } +%<newtx>\tl_set:Nn \rmdefault { ntxtlf } +%<newpx>\tl_set:Nn \rmdefault { zplTLF } +\tl_set:Nn \qhv@scale { 0.94 } +\tl_set:Nn \sfdefault { qhv } +\tl_set:Nn \ttdefault { qcr } +%<newtx>\RequirePackage { newtxmath } +%<newpx>\RequirePackage { newpxmath } +\tl_set_eq:NN \encodingdefault \l_@@_save_encodingdefault_tl +\tl_set_eq:NN \rmdefault \l_@@_save_rmdefault_tl +\tl_set_eq:NN \sfdefault \l_@@_save_sfdefault_tl +\tl_set_eq:NN \ttdefault \l_@@_save_ttdefault_tl +%</newtx|newpx> +%<times>\PassOptionsToPackage { Symbol } { upgreek } +%<lm|times>\RequirePackage { amssymb, upgreek } +%<*lm> +\SetSymbolFont { operators } { normal } { OT1 } { lmr } { m } { n } +\SetSymbolFont { letters } { normal } { OML } { lmm } { m } { it } +\SetSymbolFont { symbols } { normal } { OMS } { lmsy } { m } { n } +\SetSymbolFont { largesymbols } { normal } { OMX } { lmex } { m } { n } +\SetSymbolFont { operators } { bold } { OT1 } { lmr } { bx } { n } +\SetSymbolFont { letters } { bold } { OML } { lmm } { b } { it } +\SetSymbolFont { symbols } { bold } { OMS } { lmsy } { b } { n } +\SetSymbolFont { largesymbols } { bold } { OMX } { lmex } { m } { n } +\SetMathAlphabet { \mathbf } { normal } { OT1 } { lmr } { bx } { n } +\SetMathAlphabet { \mathsf } { normal } { OT1 } { lmss } { m } { n } +\SetMathAlphabet { \mathit } { normal } { OT1 } { lmr } { m } { it } +\SetMathAlphabet { \mathtt } { normal } { OT1 } { lmtt } { m } { n } +\SetMathAlphabet { \mathbf } { bold } { OT1 } { lmr } { bx } { n } +\SetMathAlphabet { \mathsf } { bold } { OT1 } { lmss } { bx } { n } +\SetMathAlphabet { \mathit } { bold } { OT1 } { lmr } { bx } { it } +\SetMathAlphabet { \mathtt } { bold } { OT1 } { lmtt } { m } { n } +\@@_set_slanted_greek: +%</lm> +%<*times> +\tl_set_eq:NN \l_@@_save_rmdefault_tl \rmdefault + \RequirePackage { mathptmx } +\tl_set_eq:NN \rmdefault \l_@@_save_rmdefault_tl +\tl_set:Nn \Hv@scale { 0.94 } +\DeclareMathAlphabet { \mathsf } { OT1 } { phv } { m } { n } +\DeclareMathAlphabet { \mathtt } { OT1 } { pcr } { m } { n } +\SetMathAlphabet { \mathsf } { bold } { OT1 } { phv } { b } { n } +\SetMathAlphabet { \mathtt } { bold } { OT1 } { pcr } { b } { n } +\DeclareSymbolFont { SJTU@ptm } { OML } { ptmcm } { m } { it } +\@@_declare_math_symbol:nnNn { \mathord } { SJTU@ptm } \upvarsigma { "26 } +%</times> +%<lm|times>\bool_if:NT \g_@@_upright_integral_bool +%<lm|times> { \RequirePackage { cmupint } } +\@@_set_unimath_symbol: +%</math&type1> +%<*!(math&type1)> +%<lm>\@@_if_engine_opentype:F +%<*!lm> +\@@_if_engine_opentype:TF { %<*math> \RequirePackage { unicode-math } +%<*stixtwo> \bool_if:NTF \g_@@_upright_integral_bool { \setmathfont { STIXTwoMath-Regular.otf } @@ -2751,25 +2491,31 @@ range = { scr, bfscr }, StylisticSet = 1 ] -%</math> -%<math> \setmathrm -%<text> \setmainfont - { STIXTwoText } +%</stixtwo> +%<*libertinus> + \bool_if:NTF \g_@@_upright_integral_bool + { \setmathfont { LibertinusMath-Regular.otf } } + { + \setmathfont { LibertinusMath-Regular.otf } + [ StylisticSet = 8 ] + } + \setmathfont { latinmodern-math.otf } [ range = \checkmark ] +%</libertinus> +%<cambria> \setmathfont { Cambria~Math } +%<*newcm> + \bool_if:NTF \g_@@_upright_integral_bool + { + \setmathfont { NewCMMath-Book.otf } + [ StylisticSet = 2 ] + } + { \setmathfont { NewCMMath-Book.otf } } + \setmathfont { NewCMMath-Book.otf } [ - Extension = .otf, - UprightFont = *-Regular, - BoldFont = *-Bold, - ItalicFont = *-Italic, - BoldItalicFont = *-BoldItalic + range = { scr, bfscr }, + StylisticSet = 1 ] -%</stixtwo> +%</newcm> %<*xits> -\@@_fontset_case:nn -%<math> { \@@_fontset_error:nn { math } { xits } } -%<text> { \@@_fontset_error:nn { text } { xits } } - { -%<*math> - \RequirePackage { unicode-math } \bool_if:NTF \g_@@_upright_integral_bool { \setmathfont { XITSMath-Regular } @@ -2791,10 +2537,15 @@ range = { cal, bfcal }, StylisticSet = 1 ] +%</xits> %</math> +%<*newtx|newpx|stixtwo|xits> %<math> \setmathrm %<text> \setmainfont - { XITS } +%<newtx> { TeXGyreTermesX } +%<newpx> { TeXGyrePagellaX } +%<stixtwo> { STIXTwoText } +%<xits> { XITS } [ Extension = .otf, UprightFont = *-Regular, @@ -2802,49 +2553,6 @@ ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic ] -%</xits> -%<*newtx|newpx> -%<*math> -\tl_set_eq:NN \l_@@_save_encodingdefault_tl \encodingdefault -\tl_set_eq:NN \l_@@_save_rmdefault_tl \rmdefault -\tl_set_eq:NN \l_@@_save_sfdefault_tl \sfdefault -\tl_set_eq:NN \l_@@_save_ttdefault_tl \ttdefault -\tl_set:Nn \encodingdefault { OT1 } -%<newtx>\tl_set:Nn \rmdefault { ntxtlf } -%<newpx>\tl_set:Nn \rmdefault { zplTLF } -\tl_set:Nn \qhv@scale { 0.94 } -\tl_set:Nn \sfdefault { qhv } -\tl_set:Nn \ttdefault { qcr } -%<newtx>\RequirePackage { newtxmath } -%<newpx>\RequirePackage { newpxmath } -\tl_set_eq:NN \encodingdefault \l_@@_save_encodingdefault_tl -\tl_set_eq:NN \rmdefault \l_@@_save_rmdefault_tl -\tl_set_eq:NN \sfdefault \l_@@_save_sfdefault_tl -\tl_set_eq:NN \ttdefault \l_@@_save_ttdefault_tl -\@@_set_unimath_symbol: -%</math> -%<*text> -\@@_fontset_case:nn - { - \tl_set:Nn \encodingdefault { T1 } -%<newtx> \RequirePackage { newtxtext } -%<newpx> \RequirePackage { newpxtext } - \tl_set:Nn \ttdefault { qcr } - } - { - \setmainfont -%<newtx> { TeXGyreTermesX } -%<newpx> { TeXGyrePagellaX } - [ - Extension = .otf, - UprightFont = *-Regular, - BoldFont = *-Bold, - ItalicFont = *-Italic, - BoldItalicFont = *-BoldItalic - ] -%</text> -%</newtx|newpx> -%<*text&(newtx|newpx)|stixtwo|xits> %<math> \setmathsf %<text> \setsansfont { texgyreheros } @@ -2854,7 +2562,7 @@ BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic, - Scale = 0.94, + Scale = 0.94 ] %<math> \setmathtt %<text> \setmonofont @@ -2867,68 +2575,13 @@ BoldItalicFont = *-bolditalic, Ligatures = CommonOff ] - } -%</text&(newtx|newpx)|stixtwo|xits> -%<*lm> -%<*text> -\@@_fontset_case:nn - { - \tl_set:Nn \encodingdefault { T1 } - \tl_set:Nn \rmdefault { lmr } - \tl_set:Nn \sfdefault { lmss } - \tl_set:Nn \ttdefault { lmtt } - } { } -%</text> -%<*math> -\RequirePackage { amssymb, upgreek } -\SetSymbolFont { operators } { normal } { OT1 } { lmr } { m } { n } -\SetSymbolFont { letters } { normal } { OML } { lmm } { m } { it } -\SetSymbolFont { symbols } { normal } { OMS } { lmsy } { m } { n } -\SetSymbolFont { largesymbols } { normal } { OMX } { lmex } { m } { n } -\SetSymbolFont { operators } { bold } { OT1 } { lmr } { bx } { n } -\SetSymbolFont { letters } { bold } { OML } { lmm } { b } { it } -\SetSymbolFont { symbols } { bold } { OMS } { lmsy } { b } { n } -\SetSymbolFont { largesymbols } { bold } { OMX } { lmex } { m } { n } -\SetMathAlphabet { \mathbf } { normal } { OT1 } { lmr } { bx } { n } -\SetMathAlphabet { \mathsf } { normal } { OT1 } { lmss } { m } { n } -\SetMathAlphabet { \mathit } { normal } { OT1 } { lmr } { m } { it } -\SetMathAlphabet { \mathtt } { normal } { OT1 } { lmtt } { m } { n } -\SetMathAlphabet { \mathbf } { bold } { OT1 } { lmr } { bx } { n } -\SetMathAlphabet { \mathsf } { bold } { OT1 } { lmss } { bx } { n } -\SetMathAlphabet { \mathit } { bold } { OT1 } { lmr } { bx } { it } -\SetMathAlphabet { \mathtt } { bold } { OT1 } { lmtt } { m } { n } -\bool_if:NT \g_@@_upright_integral_bool - { \RequirePackage { cmupint } } -\@@_set_slanted_greek: -\@@_set_unimath_symbol: -%</math> -%</lm> +%</newtx|newpx|stixtwo|xits> +%<*text×> + \setmainfont { Times~New~Roman } [ Ligatures = Rare ] + \setsansfont { Arial } [ Scale = 0.94 ] + \setmonofont { Courier~New } +%</text×> %<*libertinus> -\@@_fontset_case:nn - { -%<*text> - \tl_set:Nn \encodingdefault { T1 } - \tl_set:Nn \rmdefault { LibertinusSerif-TLF } - \tl_set:Nn \sfdefault { LibertinusSans-TLF } - \tl_set:Nn \ttdefault { lmtt } -%</text> -%<*math> - \exp_args:No \PassOptionsToPackage - { \g_@@_math_font_options_clist } { libertinust1math } - \RequirePackage { libertinust1math } -%</math> - } - { -%<*math> - \RequirePackage { unicode-math } - \bool_if:NTF \g_@@_upright_integral_bool - { \setmathfont { LibertinusMath-Regular.otf } } - { - \setmathfont { LibertinusMath-Regular.otf } - [ StylisticSet = 8 ] - } - \setmathfont { latinmodern-math.otf } [ range = \checkmark ] -%</math> %<math> \setmathrm %<text> \setmainfont { LibertinusSerif } @@ -2958,61 +2611,20 @@ SlantedFeatures = { FakeSlant = 0.2 }, BoldSlantedFeatures = { FakeSlant = 0.2 } ] - } %</libertinus> -%<*times> +%<*cambria> %<*math> -\PassOptionsToPackage { Symbol } { upgreek } -\RequirePackage { amssymb, upgreek } -\tl_set_eq:NN \l_@@_save_rmdefault_tl \rmdefault - \RequirePackage { mathptmx } -\tl_set_eq:NN \rmdefault \l_@@_save_rmdefault_tl -\tl_set:Nn \Hv@scale { 0.94 } -\DeclareMathAlphabet { \mathsf } { OT1 } { phv } { m } { n } -\DeclareMathAlphabet { \mathtt } { OT1 } { pcr } { m } { n } -\SetMathAlphabet { \mathsf } { bold } { OT1 } { phv } { b } { n } -\SetMathAlphabet { \mathtt } { bold } { OT1 } { pcr } { b } { n } -\DeclareSymbolFont { SJTU@ptm } { OML } { ptmcm } { m } { it } -\@@_declare_math_symbol:nnNn { \mathord } { SJTU@ptm } \upvarsigma { "26 } -\bool_if:NT \g_@@_upright_integral_bool - { \RequirePackage { cmupint } } -\@@_set_unimath_symbol: + \setmathrm { Cambria } + \setmathsf { Calibri } + \setmathtt { Consolas } [ Scale = 0.95 ] %</math> %<*text> -\@@_fontset_case:nn - { - \tl_set:Nn \encodingdefault { T1 } - \tl_set:Nn \rmdefault { ptm } - \tl_set:Nn \Hv@scale { 0.94 } - \tl_set:Nn \sfdefault { phv } - \tl_set:Nn \ttdefault { pcr } - } - { - \setmainfont { Times~New~Roman } [ Ligatures = Rare ] - \setsansfont { Arial } [ Scale = 0.94 ] - \setmonofont { Courier~New } - } + \setmainfont { Cambria } + \setsansfont { Calibri } + \setmonofont { Consolas } [ Scale = 0.95 ] %</text> -%</times> +%</cambria> %<*newcm> -\@@_fontset_case:nn -%<math> { \@@_fontset_error:nn { math } { newcm } } -%<text> { \@@_fontset_error:nn { text } { newcm } } - { -%<*math> - \RequirePackage { unicode-math } - \bool_if:NTF \g_@@_upright_integral_bool - { - \setmathfont { NewCMMath-Book.otf } - [ StylisticSet = 2 ] - } - { \setmathfont { NewCMMath-Book.otf } } - \setmathfont { NewCMMath-Book.otf } - [ - range = { scr, bfscr }, - StylisticSet = 1 - ] -%</math> %<math> \setmathrm %<text> \setmainfont { NewCM10 } @@ -3070,27 +2682,97 @@ BoldSlantedFont = *-Bold, BoldSlantedFeatures = { FakeSlant = 0.25 } ] - } %</newcm> -%<*cambria> -\@@_fontset_case:nn -%<math> { \@@_fontset_error:nn { math } { cambria } } -%<text> { \@@_fontset_error:nn { text } { cambria } } + } +%</!lm> +%<*text&!otf> { -%<*math> - \RequirePackage { unicode-math } - \setmathfont { Cambria~Math } - \setmathrm { Cambria } - \setmathsf { Calibri } - \setmathtt { Consolas } [ Scale = 0.95 ] -%</math> -%<*text> - \setmainfont { Cambria } - \setsansfont { Calibri } - \setmonofont { Consolas } [ Scale = 0.95 ] -%</text> + \tl_set:Nn \encodingdefault { T1 } +%<lm> \tl_set:Nn \rmdefault { lmr } +%<lm> \tl_set:Nn \sfdefault { lmss } +%<libertinus> \tl_set:Nn \rmdefault { LibertinusSerif-TLF } +%<libertinus> \tl_set:Nn \sfdefault { LibertinusSans-TLF } +%<lm|libertinus> \tl_set:Nn \ttdefault { lmtt } +%<newtx> \PassOptionsToPackage { nohelv, nott } { newtxtext } +%<newpx> \PassOptionsToPackage { nohelv, nott } { newpxtext } +%<newtx> \RequirePackage { newtxtext } +%<newpx> \RequirePackage { newpxtext } +%<*stixtwo> + \DeclareEncodingSubset { TS1 } { ? } { 0 } + \UndeclareTextCommand { \textpertenthousand } { T1 } + \DeclareTextSymbolDefault { \textpertenthousand } { TS1 } + \tl_set:Nn \rmdefault { stix2 } +%</stixtwo> +%<newtx|newpx|stixtwo> \tl_set:Nn \qhv@scale { 0.94 } +%<newtx|newpx|stixtwo> \tl_set:Nn \sfdefault { qhv } +%<newtx|newpx|stixtwo> \tl_set:Nn \ttdefault { qcr } +%<*times> + \tl_set:Nn \rmdefault { ptm } + \tl_set:Nn \Hv@scale { 0.94 } + \tl_set:Nn \sfdefault { phv } + \tl_set:Nn \ttdefault { pcr } +%</times> } -%</cambria> +%</text&!otf> +%<*text&otf> +%<cambria> { \@@_fontset_error:nn { text } { cambria } } +%<newcm> { \@@_fontset_error:nn { text } { newcm } } +%<xits> { \@@_fontset_error:nn { text } { xits } } +%</text&otf> +%<*math&!otf> + { +%<*libertinus> + \exp_args:No \PassOptionsToPackage + { \g_@@_math_font_options_clist } { libertinust1math } + \RequirePackage { libertinust1math } +%</libertinus> +%<*stixtwo> + \DeclareSizeFunction { sub } { \sub@sfcnt \@font@info } + \PassOptionsToPackage { notext } { stix2 } + \RequirePackage { stix2 } + \clist_map_inline:nn + { + \upalpha { "0B } , + \upbeta { "0C } , + \upgamma { "0D } , + \updelta { "0E } , + \upepsilon { "0F } , + \upzeta { "10 } , + \upeta { "11 } , + \uptheta { "12 } , + \upiota { "13 } , + \upkappa { "14 } , + \uplambda { "15 } , + \upmu { "16 } , + \upnu { "17 } , + \upxi { "18 } , + \uppi { "19 } , + \uprho { "1A } , + \upsigma { "1B } , + \uptau { "1C } , + \upupsilon { "1D } , + \upphi { "1E } , + \upchi { "1F } , + \uppsi { "20 } , + \upomega { "21 } , + \upvarepsilon { "22 } , + \upvartheta { "23 } , + \upvarpi { "24 } , + \upvarrho { "25 } , + \upvarsigma { "26 } , + \upvarphi { "27 } + } + { \@@_declare_math_symbol:nnNn { \stix@lcgc } { operators } #1 } + \@@_set_slanted_greek: +%</stixtwo> + } +%</math&!otf> +%<*math&otf> +%<cambria> { \@@_fontset_error:nn { math } { cambria } } +%<newcm> { \@@_fontset_error:nn { math } { newcm } } +%<xits> { \@@_fontset_error:nn { math } { xits } } +%</math&otf> +%</!(math&type1)> %</font&(math|text)> % \end{macrocode} % @@ -3115,123 +2797,190 @@ \scpolint\npolint\pointint\sqint\intlarhk\intx \intcap\intcup\upint\lowint } + \clist_map_inline:nn + { amsfonts, amssymb, bm, upgreek } + { \@@_disable_package_load:n {#1} } } % \end{macrocode} % -% 若未使用 \pkg{unicode-math} 配置数学字体,则自动调用 \pkg{bm}。 +% 若未使用 \pkg{unicode-math} 配置数学字体,则自动调用 \pkg{bm}, +% 并在未定义 \tn{uppi} 和 \tn{checkmark} 时分别调用 \pkg{upgreek} 和 \pkg{amsfonts}。 % \begin{macrocode} \ctex_at_end_preamble:n { - \@ifpackageloaded { unicode-math } - { } { \RequirePackage { bm } } + \IfPackageLoadedF { unicode-math } + { + \RequirePackage { bm } + \cs_if_exist:NF \uppi + { \RequirePackage { upgreek } } + \cs_if_exist:NF \checkmark + { \RequirePackage { amsfonts } } + } } %</class> % \end{macrocode} % -% \subsubsection{CJK 字体} +% \paragraph{CJK 字体} % +% \changes{v2.2}{2024/11/28}{新增 \opt{hanyi} 字体配置。} % 在字体未提供对应粗体的情况下,允许使用伪粗。 % \begin{macrocode} %<*font&cjk> -%<*windows> -%<*und> -\tl_if_eq:NNTF \g_@@_lang_tl \c_@@_lang_ja_tl - { \ctex_file_input:n { sjtu-cjk-font-windows-ja.def } } - { \ctex_file_input:n { sjtu-cjk-font-windows-zh.def } } -%</und> -%<*zh|ja> -\@@_fontset_case:nn -%<*zh> - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { windows } - \ctex_punct_set:n { windows } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } -%</zh> -%<ja> { \@@_fontset_error:nn { cjk } { windows } } +\@@_if_engine_opentype:TF { -%<*zh> - \setCJKmainfont { SimSun } - [ AutoFakeBold = 3 , ItalicFont = KaiTi ] - \setCJKsansfont { SimHei } [ AutoFakeBold = 3 ] - \setCJKmonofont { FangSong } -%</zh> -%<*ja> - \setCJKmainfont { MS~Mincho } [ AutoFakeBold = 3 ] - \setCJKsansfont { MS~Gothic } [ AutoFakeBold = 3 ] - \setCJKmonofont { MS~Mincho } - \setCJKfamilyfont { jamin } { MS~Mincho } [ AutoFakeBold = 3 ] - \setCJKfamilyfont { jagoth } { MS~Gothic } [ AutoFakeBold = 3 ] -%</ja> + \@@_if_main_lang_ja:TF + { +%<*windows> + \setCJKmainfont { MS~Mincho } [ AutoFakeBold = 3 ] + \setCJKsansfont { MS~Gothic } [ AutoFakeBold = 3 ] + \setCJKmonofont { MS~Mincho } + \setCJKfamilyfont { jamin } { MS~Mincho } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { jagoth } { MS~Gothic } [ AutoFakeBold = 3 ] +%</windows> +%<*mac> + \setCJKmainfont { HiraMinProN } + [ + UprightFont = *-W3 , + BoldFont = *-W6 + ] + \setCJKsansfont { HiraKakuProN } + [ + UprightFont = *-W3 , + BoldFont = *-W6 + ] + \setCJKmonofont { HiraMinProN-W3 } + \setCJKfamilyfont { jamin } { HiraMinProN } + [ + UprightFont = *-W3 , + BoldFont = *-W6 + ] + \setCJKfamilyfont { jagoth } { HiraKakuProN } + [ + UprightFont = *-W3 , + BoldFont = *-W6 + ] +%</mac> +%<*ubuntu> + \setCJKmainfont { Noto~Serif~CJK~JP } + [ + UprightFont = *~Light , + BoldFont = *~Bold + ] + \setCJKsansfont { Noto~Sans~CJK~JP } + [ + UprightFont = *~Medium , + BoldFont = *~Bold + ] + \setCJKmonofont { Noto~Serif~CJK~JP } + [ + UprightFont = *~Light , + BoldFont = *~Bold + ] + \setCJKfamilyfont { jamin } { Noto~Serif~CJK~JP } + [ + UprightFont = *~Light , + BoldFont = *~Bold + ] + \setCJKfamilyfont { jagoth } { Noto~Sans~CJK~JP } + [ + UprightFont = *~Medium , + BoldFont = *~Bold + ] +%</ubuntu> +%<*adobe> + \setCJKmainfont { KozMinPr6N } + [ + UprightFont = *-Light , + BoldFont = *-Bold + ] + \setCJKsansfont { KozGoPr6N } + [ + UprightFont = *-Medium , + BoldFont = *-Bold + ] + \setCJKmonofont { KozMinPr6N-Light } + \setCJKfamilyfont { jamin } { KozMinPr6N } + [ + UprightFont = *-Light , + BoldFont = *-Bold + ] + \setCJKfamilyfont { jagoth } { KozGoPr6N } + [ + UprightFont = *-Medium , + BoldFont = *-Bold + ] +%</adobe> +%<*fandol|hanyi> + \setCJKmainfont { HaranoAjiMincho } + [ + Extension = .otf , + UprightFont = *-Regular , +%<fandol> BoldFont = *-Bold +%<hanyi> BoldFont = *-Medium + ] + \setCJKsansfont { HaranoAjiGothic } + [ + Extension = .otf , + UprightFont = *-Medium , + BoldFont = *-Bold + ] + \setCJKmonofont { HaranoAjiGothic } + [ + Extension = .otf , + UprightFont = *-Regular + ] + \setCJKfamilyfont { jamin } { HaranoAjiMincho } + [ + Extension = .otf , +%<fandol> BoldFont = *-Bold +%<hanyi> BoldFont = *-Medium + ] + \setCJKfamilyfont { jagoth } { HaranoAjiGothic } + [ + Extension = .otf , + UprightFont = *-Medium , + BoldFont = *-Bold + ] +%</fandol|hanyi> +%<*founder> + \setCJKmainfont { ipam.ttf } [ AutoFakeBold = 3 ] + \setCJKsansfont { ipag.ttf } [ AutoFakeBold = 3 ] + \setCJKmonofont { ipag.ttf } + \setCJKfamilyfont { jamin } { ipam.ttf } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { jagoth } { ipag.ttf } [ AutoFakeBold = 3 ] +%</founder> + \NewDocumentCommand \mincho { } { \CJKfamily { jamin } } + \NewDocumentCommand \gothic { } { \CJKfamily { jagoth } } + } +%<*windows> + { + \setCJKmainfont { SimSun } + [ AutoFakeBold = 3 , ItalicFont = KaiTi ] + \setCJKsansfont { SimHei } [ AutoFakeBold = 3 ] + \setCJKmonofont { FangSong } + } \setCJKfamilyfont { zhsong } { SimSun } [ AutoFakeBold = 3 , ItalicFont = KaiTi ] \setCJKfamilyfont { zhhei } { SimHei } [ AutoFakeBold = 3 ] \setCJKfamilyfont { zhkai } { KaiTi } \setCJKfamilyfont { zhfs } { FangSong } - } -%</zh|ja> %</windows> %<*mac> -%<*und> -\tl_if_eq:NNTF \g_@@_lang_tl \c_@@_lang_ja_tl - { \ctex_file_input:n { sjtu-cjk-font-mac-ja.def } } - { \ctex_file_input:n { sjtu-cjk-font-mac-zh.def } } -%</und> -%<*zh|ja> -%<zh>\@@_fontset_case:nnn -%<ja>\@@_fontset_case:nn - { \@@_fontset_error:nn { cjk } { mac } } -%<*zh> - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { mac } - \ctex_punct_set:n { mac } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_family:nn { \CJKsfdefault } { zhpf } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhpf } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } -%</zh> - { -%<*zh> - \setCJKmainfont { Songti~SC } - [ - UprightFont = *~Light , - BoldFont = *~Bold , - ItalicFont = Kaiti~SC~Regular , - BoldItalicFont = Kaiti~SC~Bold - ] - \setCJKsansfont { Heiti~SC } - [ - UprightFont = *~Medium , - AutoFakeBold = 3 - ] - \setCJKmonofont { STFangsong } -%</zh> -%<*ja> - \setCJKmainfont { HiraMinProN } - [ - UprightFont = *-W3 , - BoldFont = *-W6 - ] - \setCJKsansfont { HiraKakuProN } - [ - UprightFont = *-W3 , - BoldFont = *-W6 - ] - \setCJKmonofont { HiraMinProN-W3 } - \setCJKfamilyfont { jamin } { HiraMinProN } - [ - UprightFont = *-W3 , - BoldFont = *-W6 - ] - \setCJKfamilyfont { jagoth } { HiraKakuProN } - [ - UprightFont = *-W3 , - BoldFont = *-W6 - ] -%</ja> + { + \setCJKmainfont { Songti~SC } + [ + UprightFont = *~Light , + BoldFont = *~Bold , + ItalicFont = Kaiti~SC~Regular , + BoldItalicFont = Kaiti~SC~Bold + ] + \setCJKsansfont { Heiti~SC } + [ + UprightFont = *~Medium , + AutoFakeBold = 3 + ] + \setCJKmonofont { STFangsong } + } \setCJKfamilyfont { zhsong } { Songti~SC } [ UprightFont = *~Light , @@ -3249,75 +2998,27 @@ [ UprightFont = *~Regular , BoldFont = *~Bold - ] - } -%</zh|ja> + ] %</mac> %<*ubuntu> -%<*und> -\tl_if_eq:NNTF \g_@@_lang_tl \c_@@_lang_ja_tl - { \ctex_file_input:n { sjtu-cjk-font-ubuntu-ja.def } } - { \ctex_file_input:n { sjtu-cjk-font-ubuntu-zh.def } } -%</und> -%<*zh|ja> -%<zh>\@@_fontset_case:nnn -%<ja>\@@_fontset_case:nn - { \@@_fontset_error:nn { cjk } { ubuntu } } -%<*zh> - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhsong } { ubuntu } - \ctex_punct_set:n { ubuntu } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } -%</zh> - { -%<*zh> - \setCJKmainfont { Noto~Serif~CJK~SC } - [ - UprightFont = *~Light , - BoldFont = *~Bold , - ItalicFont = AR~PL~KaitiM~GB - ] - \setCJKsansfont { Noto~Sans~CJK~SC } - [ - UprightFont = *~Medium , - BoldFont = *~Bold - ] - \setCJKmonofont { Noto~Serif~CJK~SC } - [ - UprightFont = *~Light , - BoldFont = *~Bold - ] -%</zh> -%<*ja> - \setCJKmainfont { Noto~Serif~CJK~JP } - [ - UprightFont = *~Light , - BoldFont = *~Bold - ] - \setCJKsansfont { Noto~Sans~CJK~JP } - [ - UprightFont = *~Medium , - BoldFont = *~Bold - ] - \setCJKmonofont { Noto~Serif~CJK~JP } - [ - UprightFont = *~Light , - BoldFont = *~Bold - ] - \setCJKfamilyfont { jamin } { Noto~Serif~CJK~JP } - [ - UprightFont = *~Light , - BoldFont = *~Bold - ] - \setCJKfamilyfont { jagoth } { Noto~Sans~CJK~JP } - [ - UprightFont = *~Medium , - BoldFont = *~Bold - ] -%</ja> + { + \setCJKmainfont { Noto~Serif~CJK~SC } + [ + UprightFont = *~Light , + BoldFont = *~Bold , + ItalicFont = AR~PL~KaitiM~GB + ] + \setCJKsansfont { Noto~Sans~CJK~SC } + [ + UprightFont = *~Medium , + BoldFont = *~Bold + ] + \setCJKmonofont { Noto~Serif~CJK~SC } + [ + UprightFont = *~Light , + BoldFont = *~Bold + ] + } \setCJKfamilyfont { zhsong } { Noto~Serif~CJK~SC } [ UprightFont = *~Light , @@ -3330,137 +3031,41 @@ BoldFont = *~Bold ] \setCJKfamilyfont { zhkai } { AR~PL~KaitiM~GB } - } -%</zh|ja> %</ubuntu> %<*adobe> -%<*und> -\tl_if_eq:NNTF \g_@@_lang_tl \c_@@_lang_ja_tl - { \ctex_file_input:n { sjtu-cjk-font-adobe-ja.def } } - { \ctex_file_input:n { sjtu-cjk-font-adobe-zh.def } } -%</und> -%<*zh|ja> -%<zh>\@@_fontset_case:nnn -%<ja>\@@_fontset_case:nn - { \@@_fontset_error:nn { cjk } { adobe } } -%<*zh> - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { adobe } - \ctex_punct_set:n { adobe } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } -%</zh> - { -%<*zh> - \setCJKmainfont { AdobeSongStd-Light } - [ AutoFakeBold = 3 , ItalicFont = AdobeKaitiStd-Regular ] - \setCJKsansfont { AdobeHeitiStd-Regular } [ AutoFakeBold = 3 ] - \setCJKmonofont { AdobeFangsongStd-Regular } -%</zh> -%<*ja> - \setCJKmainfont { KozMinPr6N } - [ - UprightFont = *-Light , - BoldFont = *-Bold - ] - \setCJKsansfont { KozGoPr6N } - [ - UprightFont = *-Medium , - BoldFont = *-Bold - ] - \setCJKmonofont { KozMinPr6N-Light } - \setCJKfamilyfont { jamin } { KozMinPr6N } - [ - UprightFont = *-Light , - BoldFont = *-Bold - ] - \setCJKfamilyfont { jagoth } { KozGoPr6N } - [ - UprightFont = *-Medium , - BoldFont = *-Bold - ] -%</ja> + { + \setCJKmainfont { AdobeSongStd-Light } + [ AutoFakeBold = 3 , ItalicFont = AdobeKaitiStd-Regular ] + \setCJKsansfont { AdobeHeitiStd-Regular } [ AutoFakeBold = 3 ] + \setCJKmonofont { AdobeFangsongStd-Regular } + } \setCJKfamilyfont { zhsong } { AdobeSongStd-Light } [ AutoFakeBold = 3 , ItalicFont = AdobeKaitiStd-Regular ] \setCJKfamilyfont { zhhei } { AdobeHeitiStd-Regular } [ AutoFakeBold = 3 ] \setCJKfamilyfont { zhfs } { AdobeFangsongStd-Regular } \setCJKfamilyfont { zhkai } { AdobeKaitiStd-Regular } - } -%</zh|ja> %</adobe> %<*fandol> -%<*und> -\tl_if_eq:NNTF \g_@@_lang_tl \c_@@_lang_ja_tl - { \ctex_file_input:n { sjtu-cjk-font-fandol-ja.def } } - { \ctex_file_input:n { sjtu-cjk-font-fandol-zh.def } } -%</und> -%<*zh|ja> -%<zh>\@@_fontset_case:nnn -%<ja>\@@_fontset_case:nn - { \@@_fontset_error:nn { cjk } { fandol } } -%<*zh> - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { fandol } - \ctex_punct_set:n { fandol } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } -%</zh> - { -%<*zh> - \setCJKmainfont { FandolSong } - [ - Extension = .otf , - UprightFont = *-Regular , - BoldFont = *-Bold , - ItalicFont = FandolKai-Regular - ] - \setCJKsansfont { FandolHei } - [ - Extension = .otf , - UprightFont = *-Regular , - BoldFont = *-Bold - ] - \setCJKmonofont { FandolFang } - [ - Extension = .otf , - UprightFont = *-Regular - ] -%</zh> -%<*ja> - \setCJKmainfont { HaranoAjiMincho } - [ - Extension = .otf , - UprightFont = *-Regular , - BoldFont = *-Bold - ] - \setCJKsansfont { HaranoAjiGothic } - [ - Extension = .otf , - UprightFont = *-Medium , - BoldFont = *-Bold - ] - \setCJKmonofont { HaranoAjiGothic } - [ - Extension = .otf , - UprightFont = *-Regular - ] - \setCJKfamilyfont { jamin } { HaranoAjiMincho } - [ - Extension = .otf , - UprightFont = *-Regular , - BoldFont = *-Bold - ] - \setCJKfamilyfont { jagoth } { HaranoAjiGothic } - [ - Extension = .otf , - UprightFont = *-Medium , - BoldFont = *-Bold - ] -%</ja> + { + \setCJKmainfont { FandolSong } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold , + ItalicFont = FandolKai-Regular + ] + \setCJKsansfont { FandolHei } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold + ] + \setCJKmonofont { FandolFang } + [ + Extension = .otf , + UprightFont = *-Regular + ] + } \setCJKfamilyfont { zhsong } { FandolSong } [ Extension = .otf , @@ -3484,57 +3089,56 @@ Extension = .otf , UprightFont = *-Regular ] - } -%</zh|ja> %</fandol> %<*founder> -%<*und> -\tl_if_eq:NNTF \g_@@_lang_tl \c_@@_lang_ja_tl - { \ctex_file_input:n { sjtu-cjk-font-founder-ja.def } } - { \ctex_file_input:n { sjtu-cjk-font-founder-zh.def } } -%</und> -%<*zh|ja> -\@@_fontset_case:nn -%<*zh> - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { founder } - \ctex_punct_set:n { founder } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } -%</zh> -%<ja> { \@@_fontset_error:nn { cjk } { founder } } - { -%<*zh> - \setCJKmainfont { FZShuSong-Z01 } - [ AutoFakeBold = 3 , ItalicFont = FZKai-Z03 ] - \setCJKsansfont { FZHei-B01 } [ AutoFakeBold = 3 ] - \setCJKmonofont { FZFangSong-Z02 } -%</zh> -%<*ja> - \setCJKmainfont { ipam.ttf } [ AutoFakeBold = 3 ] - \setCJKsansfont { ipag.ttf } [ AutoFakeBold = 3 ] - \setCJKmonofont { ipag.ttf } - \setCJKfamilyfont { jamin } { ipam.ttf } [ AutoFakeBold = 3 ] - \setCJKfamilyfont { jagoth } { ipag.ttf } [ AutoFakeBold = 3 ] -%</ja> + { + \setCJKmainfont { FZShuSong-Z01 } + [ AutoFakeBold = 3 , ItalicFont = FZKai-Z03 ] + \setCJKsansfont { FZHei-B01 } [ AutoFakeBold = 3 ] + \setCJKmonofont { FZFangSong-Z02 } + } \setCJKfamilyfont { zhsong } { FZShuSong-Z01 } [ AutoFakeBold = 3 , ItalicFont = FZKai-Z03 ] \setCJKfamilyfont { zhhei } { FZHei-B01 } [ AutoFakeBold = 3 ] \setCJKfamilyfont { zhkai } { FZKai-Z03 } \setCJKfamilyfont { zhfs } { FZFangSong-Z02 } - } -%</zh|ja> %</founder> -%<*!und> -\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } -\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } -%<!ubuntu>\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } -\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } -%<ja>\NewDocumentCommand \mincho { } { \CJKfamily { jamin } } -%<ja>\NewDocumentCommand \gothic { } { \CJKfamily { jagoth } } -%</!und> +%<*hanyi> + { + \setCJKmainfont { HYShuSongEr~S } + [ BoldFont = HYZhongSong~S, ItalicFont = HYKaiTi~S ] + \setCJKsansfont { HYZhongHei~S } [ BoldFont = HYDaHei~S ] + \setCJKmonofont { HYFangSong~S } + } + \setCJKfamilyfont { zhsong } { HYShuSongEr~S } + [ BoldFont = HYZhongSong~S ] + \setCJKfamilyfont { zhhei } { HYZhongHei~S } + [ BoldFont = HYDaHei~S ] + \setCJKfamilyfont { zhkai } { HYKaiTi~S } + \setCJKfamilyfont { zhfs } { HYFangSong~S } +%</hanyi> + \NewDocumentCommand \songti { } { \CJKfamily { zhsong } } + \NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +%<!ubuntu> \NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } + \NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } + } + { + \@@_if_main_lang_ja:TF +%<windows> { \@@_fontset_error:nn { cjk } { windows } } +%<windows> { \ctex_file_input:n { ctex-fontset-windows.def } } +%<mac> { \@@_fontset_error:nn { cjk } { mac } } +%<mac> { \ctex_file_input:n { ctex-fontset-mac.def } } +%<ubuntu> { \@@_fontset_error:nn { cjk } { ubuntu } } +%<ubuntu> { \ctex_file_input:n { ctex-fontset-ubuntu.def } } +%<adobe> { \@@_fontset_error:nn { cjk } { adobe } } +%<adobe> { \ctex_file_input:n { ctex-fontset-adobe.def } } +%<fandol> { \@@_fontset_error:nn { cjk } { fandol } } +%<fandol> { \ctex_file_input:n { ctex-fontset-fandol.def } } +%<founder> { \@@_fontset_error:nn { cjk } { founder } } +%<founder> { \ctex_file_input:n { ctex-fontset-founder.def } } +%<hanyi> { \@@_fontset_error:nn { cjk } { hanyi } } +%<hanyi> { \ctex_file_input:n { ctex-fontset-hanyi.def } } + } %</font&cjk> % \end{macrocode} % @@ -3550,18 +3154,43 @@ % % 带圈数字使用 CJK 字体。 % \begin{macrocode} -\@@_unicode_engine_case:nn +\sys_if_engine_xetex:T { \xeCJK_declare_char_class:nn { CJK } { "24EA, "2460->"2473, "3251->"32BF, "25A1 } } +\sys_if_engine_luatex:T { \ltjdefcharrange { 99 } - { "24EA, "2460-"2473, "3251-"32BF, "25A1 } + { "24EA, "2460- "2473, "3251- "32BF, "25A1 } \ltjsetparameter { jacharrange = { +99 } } } % \end{macrocode} % +% \begin{macro}[int]{\@@_unicode_char:n} +% 由 Unicode 码位直接调用字符的辅助函数。 +% \begin{macrocode} +\sys_if_engine_pdftex:TF + { + \cs_new:Npn \@@_unicode_char:n #1 + { + \exp_not:N \Unicode + { \int_div_truncate:nn {#1} { 256 } } + { \int_mod:nn {#1} { 256 } } + } + } + { \cs_new:Npn \@@_unicode_char:n #1 { \tex_Uchar:D #1 \scan_stop: } } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\@@_symbol_const:nn} +% 定义符号的辅助函数。 +% \begin{macrocode} +\cs_new_protected:Npn \@@_symbol_const:nn #1#2 + { \tl_const:ce { c_@@_symbol_ #1 _tl } { \@@_unicode_char:n {#2} } } +% \end{macrocode} +% \end{macro} +% % \changes{v2.0.2}{2023/04/01}{延迟载入字体配置,修复 \pkg{unicode-math} % 设置不生效的问题。} % 载入字体配置。 @@ -3569,7 +3198,7 @@ \@@_load_fontset: % \end{macrocode} % -% \subsection{名称设置} +% \subsubsection{名称选项} % % 定义 |sjtu/name| 键值类。 % @@ -3618,111 +3247,9 @@ achv .initial:n = { List~of~Research~Achievements }, %</thesis> } -%</class> -% \end{macrocode} -% -% \begin{macrocode} -%<*scheme> -%<*zh> -\keys_set_known:nn { sjtu / name } - { - contents = { 目 \protect \quad 录 } , - listfigure = { 插 \protect \quad 图 } , - listtable = { 表 \protect \quad 格 } , - figure = { 图 } , - table = { 表 } , - abstract = { 摘 \protect \quad 要 } , - index = { 索 \protect \quad 引 } , - appendix = { 附录 } , - proof = { 证明 } , - bib = { 参考文献 } , - figure* = { Figure } , - table* = { Table } , - algorithm = { 算法 } , - listalgorithm = { 算 \protect \quad 法 } , - abbr = { 缩略语对照表 } , - nom = { 符号对照表 } , - ack = { 致 \protect \quad 谢 } , - resume = { 个人简历 } , - digest = { 大摘要 } , - achv = { 学术论文和科研成果目录 } - } -%</zh> -% \end{macrocode} -% -% \begin{macrocode} -%<*de> -\keys_set_known:nn { sjtu / name } - { - contents = { Inhaltsverzeichnis } , - listfigure = { Abbildungsverzeichnis } , - listtable = { Tabellenverzeichnis } , - figure = { Abbildung } , - table = { Tabelle } , - abstract = { Zusammenfassung } , - index = { Index } , - appendix = { Anhang } , - proof = { Beweis } , - bib = { Literaturverzeichnis } , - part = { Teil } , - chapter = { Kapitel } , - figure* = { Figure } , - table* = { Table } , - algorithm = { Algorithmus } , - listalgorithm = { Algorithmenverzeichnis } , - abbr = { Abkürzungsverzeichnis } , - nom = { Symbolverzeichnis } , - ack = { Danksagungen } , - resume = { Lebenslauf } , - digest = { Kurzfassung } , - achv = { Forschungsleistungen } - } -%</de> % \end{macrocode} % -% \begin{macrocode} -%<*ja> -\keys_set_known:nn { sjtu / name } - { - contents = { 目 \protect \quad 次 } , - listfigure = { 図目次 } , - listtable = { 表目次 } , - figure = { 図 } , - table = { 表 } , - abstract = { 概 \protect \quad 要 } , - index = { 索 \protect \quad 引 } , - appendix = { 付録 } , - proof = { 证明 } , - bib = { 参考文献 } , - figure* = { Figure } , - table* = { Table } , - algorithm = { アルゴリズム } , - listalgorithm = { アルゴリズム目次 } , - abbr = { 略語表 } , - nom = { 記号表 } , - ack = { 謝 \protect \quad 辞 } , - resume = { 履歴書 } , - digest = { 要 \protect \quad 約 } , - achv = { 研究業績書 } - } -%</ja> -%</scheme> -% \end{macrocode} -% -% 载入名称配置。 -% \begin{macrocode} -%<*class> -%<*thesis> -\clist_map_inline:Nn \g_@@_lang_clist - { \file_input:n { sjtu-name-thesis- #1 .def } } -\clist_map_inline:nn - { title_page, declaration, abstract } - { \@@_define_name:nv {#1} { c_@@_name_ #1 _ \g_@@_lang_tl _tl } } -%</thesis> -%<!thesis>\file_input:n { sjtu-name-generic- \g_@@_lang_tl .def } -% \end{macrocode} -% -% \subsection{页面设置} +% \subsubsection{页面设置} % % 利用 \pkg{geometry} 宏包设置页面边距以及页眉高度。 % \begin{macrocode} @@ -3747,7 +3274,7 @@ %</thesis> % \end{macrocode} % -% \subsection{页眉页脚} +% \subsubsection{页眉页脚} % % \pkg{ctex} 宏包使用 \opt{heading} 选项后,会把页面格式设置为 |headings|。 % 因此必须在 \pkg{ctex} 调用之后重新设置 \tn{pagestyle} 为 |fancy|。 @@ -3797,13 +3324,31 @@ % \end{macro} % % \begin{macro}{style/page-number} -% \begin{macro}[int]{\@@_page:n} +% \begin{macro}[int]{\@@_page:nn} % 页脚页码格式。 % \begin{macrocode} -\cs_new:Nn \@@_thepage: { \thepage } +\tl_set:Nn \@@_the_page_tl { \thepage } +\tl_new:N \@@_the_last_page_tl +\msg_new:nnn { sjtutex } { require-pageslts } + { + Add~'\token_to_str:N \usepackage{pageslts}'~in~your~preamble \\ + to~enable~the~page~number~of~the~last~page. + } \keys_define:nn { sjtu / style } { - page-number .cs_set:Np = \@@_page:n #1 , + page-number .code:n = + { + \regex_match:nnT { \#2 } { #1 } + { + \ctex_if_preamble:TF + { \RequirePackage { pageslts } } + { + \IfPackageLoadedF { pageslts } + { \msg_warning:nn { sjtutex } { require-pageslts } } + } + } + \cs_set:Nn \@@_page:nn { #1 } + } , page-number .initial:n = { {#1} } } % \end{macrocode} @@ -3814,15 +3359,10 @@ % \begin{macrocode} \tl_set:Nn \l_@@_header_tl { -%<*thesis> - { - \@@_set_cjk_default_zh: \normalfont - \l_@@_info_subject_zh_tl - } -%</thesis> +%<thesis> { \songti \l_@@_info_subject_zh_tl } %<*!thesis> \includegraphics [ height = 1.2 cm ] - { sjtu-vi-logo-small-red.pdf } + { sjtu-vi-logo-std-h-cor-red.pdf } %</!thesis> } %<thesis>\tl_set:Nn \l_@@_leftmark_tl { \leftmark } @@ -3832,7 +3372,7 @@ % % 设置页眉页脚。 % \begin{macrocode} -\bool_if:NTF \g_@@_twoside_bool +\legacy_if:nTF { @twoside } { \fancyhead [ LO, RE ] { \l_@@_header_tl } \fancyhead [ LE ] { \@@_nouppercase:V \l_@@_leftmark_tl } @@ -3842,14 +3382,15 @@ \fancyhead [ L ] { \l_@@_header_tl } \fancyhead [ R ] { \@@_nouppercase:V \l_@@_rightmark_tl } } -\fancyfoot [ C ] { \@@_page:n { \@@_thepage: } } +\fancyfoot [ C ] + { \@@_page:nn { \@@_the_page_tl } { \@@_the_last_page_tl } } % \end{macrocode} % % \begin{macro}{\headrule} % \cls{sjtuthesis} 的页眉线。 % \begin{macrocode} %<*thesis> -\cs_set:Npn \headrule +\tl_set:Nn \headrule { \hrule height 2.25 pt width \headwidth \skip_vertical:n { 0.75 pt } @@ -3860,21 +3401,25 @@ % \end{macrocode} % \end{macro} % +% \changes{v2.2}{2024/11/08}{更新 \cls{sjtureport} 和 \cls{sjtuarticle} 的 +% \texttt{plain} 页面样式。} % 重定义 |plain| 样式。 % \begin{macrocode} %<*!thesis> -\bool_if:NTF \g_@@_twoside_bool +\legacy_if:nTF { @twoside } { \fancypagestyle { plain } { - \fancyhead [ LE, RO ] { } + \fancyhead { } + \fancyhead [ LO, RE ] { \l_@@_header_tl } \tl_set:Nn \headrulewidth { 0 pt } } } { \fancypagestyle { plain } { - \fancyhead [ R ] { } + \fancyhead { } + \fancyhead [ L ] { \l_@@_header_tl } \tl_set:Nn \headrulewidth { 0 pt } } } @@ -3892,7 +3437,7 @@ \RenewDocumentCommand \cleardoublepage { } { \clearpage - \bool_if:NT \g_@@_twoside_bool + \legacy_if:nT { @twoside } { \int_if_odd:nF \c@page { \hbox:n { } \thispagestyle { empty } \newpage } @@ -3901,7 +3446,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{页码设置} +% \subsubsection{页码设置} % % 文档初始页码编码设置。 % \begin{macrocode} @@ -3922,7 +3467,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{章节标题结构} +% \subsubsection{章节标题} % % 设置章节标题样式。 % \begin{macrocode} @@ -3974,7 +3519,7 @@ \CJKsffamily } %</thesis> -%<!thesis> { format = \normalsize \bfseries \CJKsffamily } +%<!thesis> { format = \SJTU@orig@normalsize \bfseries \CJKsffamily } \ctex_set:nn { subsubsection } %<*thesis> { @@ -3983,7 +3528,7 @@ format = \zihao { -4 } \setbaselineskip { 16 bp } \normalfont } %</thesis> -%<!thesis> { format = \normalsize \normalfont } +%<!thesis> { format = \SJTU@orig@normalsize \normalfont } \ctex_set:n { secnumdepth = 3 } % \end{macrocode} % @@ -4012,39 +3557,16 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\SJTU@head,\@@_head_aux_s:nn,\@@_head_aux_s:nx, -% \@@_pdf_bookmark:nn,\@@_phantom_section:} -% 定义一个灵活的章节标题命令专门处理不同的需求。 +% \begin{macro}[int]{\@@_pdf_bookmark:nn,\@@_phantom_section:} +% 在 \pkg{hyperref} 载入后才有意义。 % \begin{macrocode} -\NewDocumentCommand \SJTU@head { s O{#3} m O{#2} } - { -%<!article> \CTEX@chapter@break - \IfBooleanTF {#1} - { \tl_if_empty:nF {#4} { \@@_pdf_bookmark:nn { 0 } {#4} } } - { - \@@_phantom_section: -%<!article> \addcontentsline { toc } { chapter } {#4} -%<article> \addcontentsline { toc } { section } {#4} - } - \cs_set_eq:NN \@@_orig_ctex_gettitle:n \CTEX@gettitle - \cs_set:Npn \CTEX@gettitle ##1 { \@@_orig_ctex_gettitle:n {#2} } -%<!article> \chapter* {#3} -%<article> \section* {#3} - \cs_set_eq:NN \CTEX@gettitle \@@_orig_ctex_gettitle:n - \@mkboth { \MakeUppercase {#2} } { \MakeUppercase {#2} } - } -%<*thesis> -\cs_new:Npn \@@_head_aux_s:nn #1#2 - { \SJTU@head* [#1] {#2} } -\cs_generate_variant:Nn \@@_head_aux_s:nn { nx } -%</thesis> \cs_new_eq:NN \@@_pdf_bookmark:nn \use_none:nn \cs_new_eq:NN \@@_phantom_section: \prg_do_nothing: %</class> % \end{macrocode} % \end{macro} % -% \subsection{段落} +% \subsubsection{段落} % % 设置全文首行缩进。 % \begin{macrocode} @@ -4071,7 +3593,7 @@ \setlist { nosep } % \end{macrocode} % -% \subsection{数学公式} +% \subsubsection{数学公式} % % \changes{v2.1}{2023/11/30}{新增 \opt{style/equation-font} 选项。} % \begin{macro}{style/equation-font} @@ -4080,8 +3602,7 @@ \keys_define:nn { sjtu / style } { equation-font .tl_set:N = \SJTU@style@equation@font , -%<thesis> equation-font .initial:x = \exp_not:N \linespread { } -%<thesis> \exp_not:N \zihao { \g_@@_zihao_tl } +%<thesis> equation-font .initial:n = \linespread { } \SJTU@orig@normalsize %<!thesis> equation-font .initial:V = \c_empty_tl } % \end{macrocode} @@ -4115,7 +3636,7 @@ } % \end{macrocode} % -% \subsection{数学环境} +% \subsubsection{数学环境} % % 可以选用 \pkg{amsthm} 或 \pkg{ntheorem} 宏包控制数学环境样式, % 并提供对证明环境 \env{proof} 的支持。 @@ -4135,7 +3656,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{浮动体} +% \subsubsection{浮动体} % % 下面这组命令使浮动对象的缺省值稍微宽松一点,从而防止幅度对象占据过多的 % 文本页面,也可以防止在很大空白的浮动页上放置很小的图形。 @@ -4242,7 +3763,7 @@ \@addtoreset {#4} {#5} \IfBooleanF {#1} { - \cs_gset:cpo { the #4 } + \exp_args:Nco \cs_gset:Npn { the #4 } { \cs:w the #5 \cs_end: #2 #3 {#4} } } } @@ -4259,7 +3780,7 @@ %</!article> % \end{macrocode} % -% \begin{macro}[int]{\l_@@_counter_without_chapter_clist} +% \begin{variable}{\l_@@_counter_without_chapter_clist} % 大摘要中不需要随章编号的各计数器。 % \begin{macrocode} %<*thesis> @@ -4267,24 +3788,16 @@ { section, figure, table, equation } %</thesis> % \end{macrocode} -% \end{macro} -% -% \subsection{脚注} +% \end{variable} % -% \begin{macro}[int]{\@@_makefnmark_plain:,\@@_thefootnote_plain:, -% \@@_thempfootnote_plain:} -% 储存原始的脚注相关命令。 -% \begin{macrocode} -\cs_set_eq:NN \@@_makefnmark_plain: \@makefnmark -\cs_set_eq:NN \@@_thefootnote_plain: \thefootnote -\cs_set_eq:NN \@@_thempfootnote_plain: \thempfootnote -% \end{macrocode} -% \end{macro} +% \subsubsection{脚注} % -% \begin{macro}[int]{\@@_footnote_number:N} +% \begin{macro}[int]{\@@_circled_number:N} % 通过 Unicode 码位调用带圈数字。 % \begin{macrocode} -\cs_new:Npn \@@_footnote_number:N #1 +\msg_new:nnn { sjtutex } { circled-number-exceed } + { Circled~number~exceed~50! } +\cs_new:Npn \@@_circled_number:N #1 { \int_compare:nNnTF {#1} < { 21 } { \@@_unicode_char:n { \int_eval:n { "2460 - 1 + #1 } } } @@ -4294,20 +3807,13 @@ { \int_compare:nNnTF {#1} < { 51 } { \@@_unicode_char:n { \int_eval:n { "32B1 - 36 + #1 } } } - { \msg_warning:nn { sjtutex } { too-many-footnotes } } + { + \msg_warning:nn { sjtutex } { circled-number-exceed } + \int_to_arabic:n {#1} + } } } } -\msg_new:nnn { sjtutex } { too-many-footnotes } - { Too~ many~ footnotes. } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_makefnmark_circled:} -% 重定义内部脚注文字命令,使用带圈数字编号时,脚注不使用上标。 -% 见 \url{https://www.zhihu.com/question/53030087}。 -% \begin{macrocode} -\cs_new:Nn \@@_makefnmark_circled: { \hbox:n { \@thefnmark } } % \end{macrocode} % \end{macro} % @@ -4319,8 +3825,7 @@ fnmark-font .choice: , fnmark-font / haranoaji .code:n = { - \@@_engine_case:nn - { \tl_set_eq:NN \l_@@_style_fnmark_font_tl \c_empty_tl } + \@@_if_engine_opentype:TF { \tl_set:Nn \l_@@_style_fnmark_font_tl { @@ -4332,6 +3837,7 @@ ] } } + { \tl_set_eq:NN \l_@@_style_fnmark_font_tl \c_empty_tl } } , fnmark-font / unknown .tl_set:N = \l_@@_style_fnmark_font_tl , fnmark-font .initial:V = \c_empty_tl @@ -4339,33 +3845,31 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_thefootnote_circled:,\@@_thempfootnote_circled:} -% 使用带圈数字编号脚注。 -% \begin{macrocode} -\cs_new:Nn \@@_thefootnote_circled: - { { \l_@@_style_fnmark_font_tl \@@_footnote_number:N \c@footnote } } -\cs_new:Nn \@@_thempfootnote_circled: - { { \l_@@_style_fnmark_font_tl \@@_footnote_number:N \c@mpfootnote } } -% \end{macrocode} -% \end{macro} -% % \begin{macro}{style/fnmark-style} % 脚注编号样式。 +% 重定义内部脚注文字命令,使用带圈数字编号时,脚注不使用上标。 +% 见 \url{https://www.zhihu.com/question/53030087}。 % \begin{macrocode} \keys_define:nn { sjtu / style } { fnmark-style .choice: , fnmark-style / plain .code:n = { - \cs_set_eq:NN \@@_makefnmark: \@@_makefnmark_plain: - \cs_set_eq:NN \thefootnote \@@_thefootnote_plain: - \cs_set_eq:NN \thempfootnote \@@_thempfootnote_plain: + \cs_set:Npn \SJTU@makefnmark + { \hbox:n { \@textsuperscript { \normalfont \@thefnmark } } } + \tl_set:Nn \thefootnote + { \arabic { footnote } } + \tl_set:Nn \thempfootnote + { { \itshape \alph { mpfootnote } } } } , fnmark-style / circled .code:n = { - \cs_set_eq:NN \@@_makefnmark: \@@_makefnmark_circled: - \cs_set_eq:NN \thefootnote \@@_thefootnote_circled: - \cs_set_eq:NN \thempfootnote \@@_thempfootnote_circled: + \cs_set:Npn \SJTU@makefnmark + { \hbox:n { \@thefnmark } } + \tl_set:Nn \thefootnote + { { \l_@@_style_fnmark_font_tl \@@_circled_number:N \c@footnote } } + \tl_set:Nn \thempfootnote + { { \l_@@_style_fnmark_font_tl \@@_circled_number:N \c@mpfootnote } } } } %</class> @@ -4383,145 +3887,330 @@ % 在导言末尾修改 \tn{@makefntext},支持使用 \pkg{footmisc} 修改脚注格式。 % \begin{macrocode} %<*class> -\ctex_at_end_preamble:n { - \cs_set_eq:NN \@@_orig_make_fntext:n \@makefntext - \cs_set:Npn \@makefntext #1 - { - \group_begin: - \cs_set_eq:NN \@makefnmark \@@_makefnmark: - \@@_orig_make_fntext:n {#1} - \group_end: - } -} +\ctex_at_end_preamble:n + { + \cs_set_eq:NN \SJTU@orig@makefntext \@makefntext + \cs_set:Npn \@makefntext #1 + { + \group_begin: + \cs_set_eq:NN \@makefnmark \SJTU@makefnmark + \SJTU@orig@makefntext {#1} + \group_end: + } + } % \end{macrocode} % -% \subsection{信息录入} +% \subsection{多语言支持} % -% \changes{v2.0}{2022/12/17}{添加 \opt{display-date} 键。} -% \changes{v2.0}{2022/12/23}{使用 \opt{assoc-supervisor} 键表示副导师, -% 使用 \opt{co-supervisor} 键表示联合导师。} -% \changes{v2.0}{2022/12/23}{添加 \opt{subject} 键。} -% \changes{v2.0}{2023/03/17}{使用语言代码前缀区别不同语种的 \opt{sjtu/info} 键。} -% \begin{macro}[int]{\@@_info_keys_define:n} -% 定义 \cls{sjtuthesis} 不同语种 |sjtu/info| 键值类的辅助函数。 +% \begin{variable}{\l_@@_lang_tl} % \begin{macrocode} -%<*thesis> -\cs_new:Npn \@@_info_keys_define:n #1 +\tl_set_eq:NN \l_@@_lang_tl \g_@@_lang_tl +% \end{macrocode} +% \end{variable} +% +% \begin{macrocode} +\msg_new:nnn { sjtutex } { lang-validation } + { Invalid~language~argument~'#1'! } +\keys_define:nn { sjtu / private } { - \clist_map_inline:nn - { - title, display_title, subject, author, date, - supervisor, assoc_supervisor, department, - co_supervisor, major, degree - } - { \tl_new:c { l_@@_info_ ##1 _ #1 _tl } } - \clist_map_inline:nn - { keywords, fund } - { \clist_new:c { l_@@_info_ ##1 _ #1 _clist } } - \keys_define:nn { sjtu } - { info / #1 .meta:nn = { sjtu / info / #1 } {##1} } - \keys_define:nn { sjtu / info } - { #1 .meta:nn = { sjtu / info / #1 } {##1} } - \keys_define:nn { sjtu / info / #1 } - { - title .code:n = - { - \tl_set:cn { l_@@_info_title_ #1 _tl } {##1} - \tl_if_empty:cT { l_@@_info_display_title_ #1 _tl } - { \tl_set:cn { l_@@_info_display_title_ #1 _tl } {##1} } - } , - display-title .tl_set:c = l_@@_info_display_title_ #1 _tl , - subject .tl_set:c = l_@@_info_subject_ #1 _tl , - keywords .clist_set:c = l_@@_info_keywords_ #1 _clist , - author .tl_set:c = l_@@_info_author_ #1 _tl , - id .meta:nn = { sjtu / info } { id = {##1} } , - supervisor .tl_set:c = l_@@_info_supervisor_ #1 _tl , - assoc-supervisor .tl_set:c = l_@@_info_assoc_supervisor_ #1 _tl , - co-supervisor .tl_set:c = l_@@_info_co_supervisor_ #1 _tl , - degree .tl_set:c = l_@@_info_degree_ #1 _tl , - department .tl_set:c = l_@@_info_department_ #1 _tl , - major .tl_set:c = l_@@_info_major_ #1 _tl , - fund .clist_set:c = l_@@_info_fund_ #1 _clist , - date .meta:nn = { sjtu / info } { date = {##1} } , - display-date .tl_set:c = l_@@_info_date_ #1 _tl , - } + lang .choice: , + lang .value_required:n = true , + lang .groups:n = { lang } , + lang / unknown .code:n = + { \msg_warning:nnn { sjtutex } { lang-validation } {#1} } } % \end{macrocode} +% +% \begin{macro}[int]{\@@_select_language:n} +% 选择局部语言。 +% \begin{macrocode} +\cs_new_protected:Npn \@@_select_language:n + { \keys_set_groups:nnn { sjtu / private } { lang } } +% \end{macrocode} % \end{macro} % -% \begin{variable}{\l_@@_info_id_zh_tl} -% 单独处理学号。 +% 载入语言配置文件。 % \begin{macrocode} -\tl_new:N \l_@@_info_id_zh_tl -\keys_define:nn { sjtu / info } - { id .tl_set:N = \l_@@_info_id_zh_tl } +%<thesis>\clist_map_inline:Nn \g_@@_lang_clist +%<thesis> { \file_input:n { sjtu-lang- #1 .def } } +%<!thesis>\file_input:n { sjtu-lang- \g_@@_lang_tl .def } +\file_input:n { sjtu-scheme- \g_@@_lang_tl .def } +%</class> % \end{macrocode} -% \end{variable} % -% \begin{variable}{\l_@@_info_supervisors_clist} -% 标题中需要显示的导师列表。 +% \begin{macro}[int]{\@@_set_cjk_default_zh:,\@@_set_cjk_default_ja:} +% 设置 CJK 默认字体族的辅助命令。 % \begin{macrocode} -\clist_set:Nn \l_@@_info_supervisors_clist { supervisor } +%<*lang> +%<*zh> +\cs_new_protected:Nn \@@_set_cjk_default_zh: + { + \tl_set:Nn \CJKrmdefault { zhsong } + \tl_set:Nn \CJKsfdefault { zhhei } + \tl_set:Nn \CJKttdefault { zhfs } + } +%</zh> +%<*ja> +\cs_new_protected:Nn \@@_set_cjk_default_ja: + { + \tl_set:Nn \CJKrmdefault { jamin } + \tl_set:Nn \CJKsfdefault { jagoth } + \tl_set:Nn \CJKttdefault { jagoth } + } +%</ja> % \end{macrocode} -% \end{variable} +% \end{macro} % -% 盲审模式下隐藏作者、导师姓名等信息。 % \begin{macrocode} -\ctex_at_end_preamble:n +\keys_define:nn { sjtu / private } { - \bool_if:NT \g_@@_review_bool +%<zh> lang / zh .code:n = +%<en> lang / en .code:n = +%<de> lang / de .code:n = +%<ja> lang / ja .code:n = { - \clist_map_inline:Nn \g_@@_lang_clist - { - \clist_map_inline:nn - { author, supervisor, assoc_supervisor, co_supervisor } - { \tl_clear:c { l_@@_info_ ##1 _ #1 _tl } } - \clist_clear:c { l_@@_info_fund_ #1 _clist } - } - \tl_clear:N \l_@@_info_id_zh_tl - } + \tl_set_eq:NN \l_@@_lang_tl \l_keys_value_tl +%<zh> \tl_set:Nn \languagename { chinese } +%<en> \tl_set:Nn \languagename { english } +%<de> \tl_set:Nn \languagename { ngerman } +%<ja> \tl_set:Nn \languagename { japanese } +%<zh> \@@_set_cjk_default_zh: +%<ja> \@@_set_cjk_default_ja: + \normalfont +%<zh> \ctex_set:n { autoindent = true } +%<en|de> \ctex_set:n { autoindent = 1.5 em } +%<ja> \ctex_set:n { autoindent = 1 } + } , +%<zh> zh .meta:n = { lang = zh } , +%<zh> zh .groups:n = { lang } +%<en> en .meta:n = { lang = en } , +%<en> en .groups:n = { lang } +%<de> de .meta:n = { lang = de } , +%<de> de .groups:n = { lang } +%<ja> ja .meta:n = { lang = ja } , +%<ja> ja .groups:n = { lang } } -%</thesis> -%</class> % \end{macrocode} % +% \begin{macro}[int]{\@@_title_case_aux_zh:n,\@@_title_case_aux_en:n, +% \@@_title_case_aux_de:n,\@@_title_case_aux_ja:n} +% 设置标题大小写转换的辅助命令。 % \begin{macrocode} -%<lang&thesis&zh>\@@_info_keys_define:n { zh } -%<lang&thesis&en>\@@_info_keys_define:n { en } -%<lang&thesis&de>\@@_info_keys_define:n { de } -%<lang&thesis&ja>\@@_info_keys_define:n { ja } +%<zh>\cs_set_eq:NN \@@_title_case_aux_zh:n \use:n +%<en>\cs_set_eq:NN \@@_title_case_aux_en:n \MakeUppercase +%<de>\cs_set_eq:NN \@@_title_case_aux_de:n \MakeUppercase +%<ja>\cs_set_eq:NN \@@_title_case_aux_ja:n \use:n % \end{macrocode} +% \end{macro} % -% \begin{variable}{\l_@@_info_subject_tl,\l_@@_info_keywords_clist} +% 通用名称常量。 % \begin{macrocode} -%<*class&!thesis> -\tl_new:N \l_@@_info_subject_tl -\clist_new:N \l_@@_info_keywords_clist -\keys_define:nn { sjtu / info } +\clist_map_inline:nn { - title .tl_set:N = \@title , - author .tl_set:N = \@author , - display-date .tl_set:N = \@date , - subject .tl_set:N = \l_@@_info_subject_tl , - keywords .clist_set:N = \l_@@_info_keywords_clist , +%<zh> { keywords } { 关键词 } , +%<en> { keywords } { Key~words } , +%<de> { keywords } { Schlüsselwörter } , +%<ja> { keywords } { キーワード } , +%<zh|ja> { info_sep } { : \null } , +%<en|de> { info_sep } { \hbox { :~ } } , +%<zh> { item_sep } { , } +%<en|de> { item_sep } { ,~ } +%<ja> { item_sep } { \quad } + } +%<zh> { \@@_name_const:nnn { zh } #1 } +%<en> { \@@_name_const:nnn { en } #1 } +%<de> { \@@_name_const:nnn { de } #1 } +%<ja> { \@@_name_const:nnn { ja } #1 } +%</lang> +% \end{macrocode} +% +% 初始化语言名称。 +% \begin{macrocode} +%<*scheme> +%<zh>\tl_set:Nn \languagename { chinese } +%<en>\tl_set:Nn \languagename { english } +%<de>\tl_set:Nn \languagename { ngerman } +%<ja>\tl_set:Nn \languagename { japanese } +% \end{macrocode} +% +% 设置名称选项。默认值为英文,只需修改其他语种。 +% \begin{macrocode} +%<*!en> +\keys_set_known:nn { sjtu / name } + { +%<*zh> + contents = { 目 \protect \quad 录 } , + listfigure = { 插 \protect \quad 图 } , + listtable = { 表 \protect \quad 格 } , + figure = { 图 } , + table = { 表 } , + abstract = { 摘 \protect \quad 要 } , + index = { 索 \protect \quad 引 } , + appendix = { 附录 } , + proof = { 证明 } , + bib = { 参考文献 } , + figure* = { Figure } , + table* = { Table } , + algorithm = { 算法 } , + listalgorithm = { 算 \protect \quad 法 } , + abbr = { 缩略语对照表 } , + nom = { 符号对照表 } , + ack = { 致 \protect \quad 谢 } , + resume = { 个人简历 } , + digest = { 大摘要 } , + achv = { 学术论文和科研成果目录 } +%</zh> +%<*de> + contents = { Inhaltsverzeichnis } , + listfigure = { Abbildungsverzeichnis } , + listtable = { Tabellenverzeichnis } , + figure = { Abbildung } , + table = { Tabelle } , + abstract = { Zusammenfassung } , + index = { Index } , + appendix = { Anhang } , + proof = { Beweis } , + bib = { Literaturverzeichnis } , + part = { Teil } , + chapter = { Kapitel } , + figure* = { Figure } , + table* = { Table } , + algorithm = { Algorithmus } , + listalgorithm = { Algorithmenverzeichnis } , + abbr = { Abkürzungsverzeichnis } , + nom = { Symbolverzeichnis } , + ack = { Danksagungen } , + resume = { Lebenslauf } , + digest = { Kurzfassung } , + achv = { Forschungsleistungen } +%</de> +%<*ja> + contents = { 目 \protect \quad 次 } , + listfigure = { 図目次 } , + listtable = { 表目次 } , + figure = { 図 } , + table = { 表 } , + abstract = { 概 \protect \quad 要 } , + index = { 索 \protect \quad 引 } , + appendix = { 付録 } , + proof = { 证明 } , + bib = { 参考文献 } , + figure* = { Figure } , + table* = { Table } , + algorithm = { アルゴリズム } , + listalgorithm = { アルゴリズム目次 } , + abbr = { 略語表 } , + nom = { 記号表 } , + ack = { 謝 \protect \quad 辞 } , + resume = { 履歴書 } , + digest = { 要 \protect \quad 約 } , + achv = { 研究業績書 } +%</ja> } -%</class&!thesis> +%</!en> +%</scheme> % \end{macrocode} -% \end{variable} % -% \subsection{多语言支持} +% 学位论文名称常量。 +% \begin{macrocode} +%<*thesis-i18n> +%<zh>\@@_symbol_const:nn { white_square } { "25A1 } +%<zh>\@@_name_const_from_clist:nnnn { zh } +%<en>\@@_name_const_from_clist:nnnn { en } +%<de>\@@_name_const_from_clist:nnnn { de } +%<ja>\@@_name_const_from_clist:nnnn { ja } + { degree_level } { \g_@@_thesis_type_int } +%<zh> { 学士, 硕士, 博士 } +%<en> { Bachelor, Master, Doctor } +%<de> { Bachelor, Master, Doktor } +%<ja> { 学士, 修士, 博士 } +\clist_map_inline:nn + { +%<*zh> + { univ } { 上海交通大学 } , + { address } { 中国・上海 } , + { thesis } { 学位论文 } , + { title_page } { 题名页 } , + { declaration } { 原创性声明及使用授权书 } , + { orig_decl } { 原创性声明 } , + { auth_decl } { 使用授权书 } , + { decl_author } { 学位论文作者 } , + { decl_supervisor } { 指导教师 } , + { abstract } { 摘 \protect \quad 要 } +%</zh> +%<*en> + { univ } { Shanghai~ Jiao~ Tong~ University } , + { address } { Shanghai,~ P.R.~ China } , + { title_page } { Title~ Page } , + { declaration } { Statutory~ Declaration } , + { abstract } { Abstract } +%</en> +%<*de> + { univ } { Shanghai~ Jiao~ Tong~ Universität } , + { address } { Shanghai,~ VR~ China } , + { title_page } { Titelblatt } , + { declaration } { Eidesstattliche~ Erklärung } , + { abstract } { Abstrakt } +%</de> +%<*ja> + { univ } { 上海交通大学 } , + { address } { 中国・上海 } , + { thesis } { 学位請求論文 } , + { title_page } { 標題紙 } , + { declaration } { 誓約書・公表許諾書 } , + { abstract } { 要 \protect \quad 旨 } +%</ja> + } +%<zh> { \@@_name_const:nnn { zh } #1 } +%<en> { \@@_name_const:nnn { en } #1 } +%<de> { \@@_name_const:nnn { de } #1 } +%<ja> { \@@_name_const:nnn { ja } #1 } +\clist_map_inline:nn + { +%<*zh> + { author } { 姓名 } , + { id } { 学号 } , + { supervisor } { 导师 } , + { assoc_supervisor } { 副导师 } , + { co_supervisor } { 联合导师 } , + { department } { 院系 } , + { major } { 学科 \, / \, 专业 } , + { degree } { 申请学位 } +%</zh> +%<*en> + { author } { Author } , + { supervisor } { Supervisor } , + { assoc_supervisor } { Assoc.\ Supervisor } , + { co_supervisor } { Co-supervisor } +%</en> +%<*de> + { author } { Autor/in } , + { supervisor } { Betreuer/in } , + { assoc_supervisor } { Zweitbetreuer/in } , + { co_supervisor } { Co-Betreuer/in } +%</de> +%<*ja> + { author } { 氏名 } , + { supervisor } { 指導教員 } , + { assoc_supervisor } { 副指導教員 } , + { co_supervisor } { 共同指導 } +%</ja> + } +%<zh> { \@@_name_set:nnn { zh } #1 } +%<en> { \@@_name_set:nnn { en } #1 } +%<de> { \@@_name_set:nnn { de } #1 } +%<ja> { \@@_name_set:nnn { ja } #1 } +% \end{macrocode} % % \changes{v2.0.3}{2023/04/08}{更新学位论文初始英文主题。} % 初始化主题。 % \begin{macrocode} -%<*lang> -%<*thesis> %<zh>\keys_define:nn { sjtu / info / zh } %<en>\keys_define:nn { sjtu / info / en } %<de>\keys_define:nn { sjtu / info / de } %<ja>\keys_define:nn { sjtu / info / ja } { - subject .initial:x = + subject .initial:e = { %<*zh> \exp_not:V \c_@@_name_univ_zh_tl @@ -4545,11 +4234,40 @@ %</ja> } } -%</thesis> +%</thesis-i18n> % \end{macrocode} % % 将形如 |yyyy-mm-dd| 或 |yyyy-mm| 的 ISO 日期格式字符串转化为日期表示。 % +% 日期常量。 +% \begin{macrocode} +%<*lang> +%<*zh|ja> +\clist_map_inline:nn + { + { year } { 年 } , + { month } { 月 } , + { day } { 日 } + } +%<zh> { \@@_name_const:nnn { zh } #1 } +%<ja> { \@@_name_const:nnn { ja } #1 } +%</zh|ja> +%<*en> +\clist_const:Nn \c_@@_name_month_en_clist + { + January, February, March, April, May, June, + July, August, September, October, November, December + } +%</en> +%<*de> +\clist_const:Nn \c_@@_name_month_de_clist + { + Januar, Februar, März, April, Mai, Juni, + Juli, August, September, Oktober, November, Dezember + } +%</de> +% \end{macrocode} +% % \begin{macro}[int]{\@@_date_aux_zh:nnn,\@@_date_aux_zh:w, % \@@_date_aux_short_zh:nn,\@@_date_aux_short_zh:w} % 中文日期。 @@ -4670,119 +4388,192 @@ \cs_new:Npn \@@_date_aux_short_ja:w #1-#2 \q_stop { \@@_date_aux_short_ja:nn {#1} {#2} } %</ja> +%</lang> % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_set_language_zh:,\@@_set_language_en:, -% \@@_set_language_de:,\@@_set_language_ja:, -% \@@_set_cjk_default_zh:,\@@_set_cjk_default_ja:} -% 设置语言格式辅助命令 +% \subsection{信息录入} +% +% \changes{v2.0}{2022/12/17}{添加 \opt{display-date} 键。} +% \changes{v2.0}{2022/12/23}{使用 \opt{assoc-supervisor} 键表示副导师, +% 使用 \opt{co-supervisor} 键表示联合导师。} +% \changes{v2.0}{2022/12/23}{添加 \opt{subject} 键。} +% \changes{v2.0}{2023/03/17}{使用语言代码前缀区别不同语种的 \opt{sjtu/info} 键。} +% \begin{macro}[int]{\@@_info_keys_define:n} +% 定义 \cls{sjtuthesis} 不同语种 |sjtu/info| 键值类的辅助函数。 % \begin{macrocode} -%<*zh> -\cs_new:Nn \@@_set_cjk_default_zh: - { - \tl_set:Nn \CJKrmdefault { zhsong } - \tl_set:Nn \CJKsfdefault { zhhei } - \tl_set:Nn \CJKttdefault { zhfs } - } -\cs_new_protected:Nn \@@_set_language_zh: - { - \tl_set:Nn \languagename { chinese } - \ctex_set:n { autoindent = true } - \@@_set_cjk_default_zh: - \normalfont - } -%</zh> -%<*en|de> -%<en>\cs_new_protected:Nn \@@_set_language_en: -%<de>\cs_new_protected:Nn \@@_set_language_de: - { -%<en> \tl_set:Nn \languagename { english } -%<de> \tl_set:Nn \languagename { ngerman } - \ctex_set:n { autoindent = 1.5 em } - \normalfont - } -%</en|de> -%<*ja> -\cs_new:Nn \@@_set_cjk_default_ja: - { - \tl_set:Nn \CJKrmdefault { jamin } - \tl_set:Nn \CJKsfdefault { jagoth } - \tl_set:Nn \CJKttdefault { jagoth } - } -\cs_new_protected:Nn \@@_set_language_ja: +%<*class> +%<*thesis> +\msg_new:nnn { sjtutex } { key-already-defined } + { Key~'#1'~is~already~defined~and~redefination~is~being~ignored. } +\msg_new:nnn { sjtutex } { key-invalid } + { Key~'#1'~is~invalid~and~ignored. } +\msg_new:nnn { sjtutex } { key-needs-two-arguments } + { Key~'#1'~needs~two~arguments~otherwise~ignored. } +\cs_new_protected:Npn \@@_info_keys_define:n #1 { - \tl_set:Nn \languagename { japanese } - \ctex_set:n { autoindent = 1 } - \@@_set_cjk_default_ja: - \normalfont + \clist_map_inline:nn + { + title, display_title, subject, date, department, major, + author, supervisor, assoc_supervisor, co_supervisor, degree + } + { \tl_new:c { l_@@_info_ ##1 _ #1 _tl } } + \clist_map_inline:nn + { keywords, fund } + { \clist_new:c { l_@@_info_ ##1 _ #1 _clist } } + \bool_if:NTF \g_@@_review_bool + { + \seq_set_from_clist:cn { l_@@_info_show_ #1 _seq } + { author, id, supervisor, department, major, degree } + } + { \seq_new:c { l_@@_info_show_ #1 _seq } } + \keys_define:nn { sjtu } + { info / #1 .meta:nn = { sjtu / info / #1 } {##1} } + \keys_define:nn { sjtu / info } + { #1 .meta:nn = { sjtu / info / #1 } {##1} } + \keys_define:nn { sjtu / info / #1 } + { + display-title .code:n = + { + \tl_set:co { l_@@_info_display_title_ #1 _tl } + { \cs:w @@_title_case_aux_ #1 :n \cs_end: {##1} } + } , + title .code:n = + { + \tl_set:cn { l_@@_info_title_ #1 _tl } {##1} + \tl_if_empty:cT { l_@@_info_display_title_ #1 _tl } + { \keys_set:nn { sjtu / info / #1 } { display-title = {##1} } } + } , + subject .tl_set:c = { l_@@_info_subject_ #1 _tl } , + keywords .clist_set:c = { l_@@_info_keywords_ #1 _clist } , + fund .clist_set:c = { l_@@_info_fund_ #1 _clist } , + fund .groups:n = { sensitive } , + date .meta:nn = { sjtu / info } { date = {##1} } , + display-date .tl_set:c = { l_@@_info_date_ #1 _tl } , + @show+ .code:n = + { + \seq_if_in:cnF { l_@@_info_show_ #1 _seq } {##1} + { \seq_put_right:cn { l_@@_info_show_ #1 _seq } {##1} } + } , + @show+ .groups:n = { sensitive } , + custom .meta:nn = { sjtu / info / #1 / custom } {##1} , + custom / unknown .code:n = + { + \regex_match:nVTF { \A [a-z] [a-z0-9\-]* \Z } \l_keys_key_str + { + \keys_if_exist:neTF { sjtu / info / #1 } \l_keys_key_str + { + \msg_warning:nne { sjtutex } { key-already-defined } + \l_keys_path_str + } + { + \int_compare:nNnTF { \tl_count:n {##1} } = { 2 } + { + \tl_set_eq:NN \l_@@_tmp_tl \l_keys_key_str + \tl_replace_all:Nnn \l_@@_tmp_tl { - } { _ } + \tl_set:co { l_@@_name_ \l_@@_tmp_tl _ #1 _tl } + { \use_i:nn ##1 } + \tl_set:co { l_@@_info_ \l_@@_tmp_tl _ #1 _tl } + { \use_ii:nn ##1 } + \exp_args:Ne \@@_setup:n + { info / #1 / @show+ = \l_@@_tmp_tl } + } + { + \msg_warning:nne { sjtutex } { key-needs-two-arguments } + \l_keys_path_str + } + } + } + { \msg_warning:nne { sjtutex } { key-invalid } \l_keys_path_str } + } + } + \clist_map_inline:nn + { + author, supervisor, assoc-supervisor, co-supervisor, + department, major, degree + } + { + \tl_set:Nn \l_@@_tmp_tl {##1} + \tl_replace_all:Nnn \l_@@_tmp_tl { - } { _ } + \keys_define:ne { sjtu / info / #1 } + { + ##1 .code:n = + { + \exp_not:N \tl_set:cn + { l_@@_info_ \l_@@_tmp_tl _ #1 _tl } {####1} + \exp_not:N \@@_setup:n + { info / #1 / @show+ = \l_@@_tmp_tl } + } + } + } + \clist_map_inline:nn + { author, supervisor, assoc-supervisor, co-supervisor } + { \keys_define:nn { sjtu / info / #1 } { ##1 .groups:n = { sensitive } } } } -%</ja> % \end{macrocode} % \end{macro} % -% 标题页页面样式,页脚添加资助基金信息。 +% \begin{macro}{info/id} +% \begin{variable}{\l_@@_info_id_zh_tl} +% 单独处理学号。 % \begin{macrocode} -%<*thesis> -%<zh>\cs_new:Npn \ps@SJTU@fund@zh -%<en>\cs_new:Npn \ps@SJTU@fund@en -%<de>\cs_new:Npn \ps@SJTU@fund@de -%<ja>\cs_new:Npn \ps@SJTU@fund@ja +\tl_new:N \l_@@_info_id_zh_tl +\keys_define:nn { sjtu / info } { - \ps@empty - \cs_set:Npn \@oddfoot + id .code:n = { - \minipage [ t ] { \textwidth } - \centering \zihao { - 5 } -%<zh> \clist_use:Nn \l_@@_info_fund_zh_clist { \par } -%<en> \clist_use:Nn \l_@@_info_fund_en_clist { \par } -%<de> \clist_use:Nn \l_@@_info_fund_de_clist { \par } -%<ja> \clist_use:Nn \l_@@_info_fund_ja_clist { \par } - \endminipage - } - \cs_set_eq:NN \@evenfoot \@oddfoot + \tl_set:Nn \l_@@_info_id_zh_tl {#1} + \@@_setup:n { info / zh / @show+ = id } + } , + id .groups:n = { sensitive } } -%</thesis> -%</lang> % \end{macrocode} +% \end{variable} +% \end{macro} % -% 初始化语言名称。 +% 定义 \cls{sjtuthesis} 中不同语种的信息键值类。 % \begin{macrocode} -%<*scheme> -%<zh>\tl_set:Nn \languagename { chinese } -%<en>\tl_set:Nn \languagename { english } -%<de>\tl_set:Nn \languagename { ngerman } -%<ja>\tl_set:Nn \languagename { japanese } -%</scheme> +\clist_map_inline:Nn \g_@@_lang_clist + { \@@_info_keys_define:n {#1} } +%</thesis> % \end{macrocode} % -% 载入语言配置。 +% 定义 \cls{sjtureport} 和 \cls{sjtuarticle} 中的信息键值类。 +% \begin{variable}{\l_@@_info_subject_tl,\l_@@_info_keywords_clist} % \begin{macrocode} -%<*class> -%<thesis>\clist_map_inline:Nn \g_@@_lang_clist -%<thesis> { \file_input:n { sjtu-lang-thesis- #1 .def } } -%<!thesis>\file_input:n { sjtu-lang-generic- \g_@@_lang_tl .def } -\file_input:n { sjtu-scheme- \g_@@_lang_tl .def } +%<*!thesis> +\tl_new:N \l_@@_info_subject_tl +\clist_new:N \l_@@_info_keywords_clist +\keys_define:nn { sjtu / info } + { + title .tl_set:N = \@title , + author .tl_set:N = \@author , + display-date .tl_set:N = \@date , + subject .tl_set:N = \l_@@_info_subject_tl , + keywords .clist_set:N = \l_@@_info_keywords_clist , + } +%</!thesis> % \end{macrocode} +% \end{variable} % % \begin{macro}{info/date} -% 初始化日期。 +% 日期。 % \begin{macrocode} \keys_define:nn { sjtu / info } { date .code:n = { - \regex_match:neTF { \d+-\d+-\d+ } {#1} + \regex_match:nnTF { \A \d+ \- \d+ \- \d+ \Z } {#1} { %<*thesis> \clist_map_inline:Nn \g_@@_lang_clist { - \tl_set:cx { l_@@_info_date_ ##1 _tl } + \tl_set:ce { l_@@_info_date_ ##1 _tl } { \exp_last_unbraced:ce { @@_date_aux_ ##1 :w } #1 \q_stop } } %</thesis> %<*!thesis> - \tl_set:Nx \@date + \tl_set:Ne \@date { \exp_last_unbraced:ce { @@_date_aux_ \g_@@_lang_tl :w } #1 \q_stop @@ -4790,17 +4581,17 @@ %</!thesis> } { - \regex_match:neT { \d+-\d+ } {#1} + \regex_match:nnT { \A \d+ \- \d+ \Z } {#1} { %<*thesis> \clist_map_inline:Nn \g_@@_lang_clist { - \tl_set:cx { l_@@_info_date_ ##1 _tl } + \tl_set:ce { l_@@_info_date_ ##1 _tl } { \exp_last_unbraced:ce { @@_date_aux_short_ ##1 :w } #1 \q_stop } } %</thesis> %<*!thesis> - \tl_set:Nx \@date + \tl_set:Ne \@date { \exp_last_unbraced:ce { @@_date_aux_short_ \g_@@_lang_tl :w } #1 \q_stop @@ -4809,129 +4600,208 @@ } } } , - date .initial:x = + date .initial:e = { \int_to_arabic:n { \c_sys_year_int } - \int_to_arabic:n { \c_sys_month_int } - \int_to_arabic:n { \c_sys_day_int } } } -%<thesis>\tl_set:Nv \today { l_@@_info_date_ \g_@@_lang_tl _tl } -%<!thesis>\tl_set:NV \today \@date +%<thesis>\tl_set_eq:Nc \today { l_@@_info_date_ \g_@@_lang_tl _tl } +%<!thesis>\tl_set_eq:NN \today \@date % \end{macrocode} % \end{macro} % -% \subsection{标题页} +% \subsection{特殊页面} +% +% \subsubsection{页面模板} % -% \subsubsection{定义内部函数} +% 使用 \pkg{lttemplates} 构建页面模板,用于绘制标题页与版权页。 % -% 汉字分散对齐的环境。 +% 页面元素模板。 % \begin{macrocode} %<*thesis> -\@@_engine_case:nnn +\NewTemplateType { sjtu / element } { 0 } +\DeclareTemplateInterface { sjtu / element } { plain } { 0 } { - \NewDocumentEnvironment { SJTU@CJK@FTS } { m } - { - \mode_leave_vertical: - \bool_set_false:N \l_@@_tmp_bool - \cs_set_eq:NN \SJTU@CJK@FTS@Symbol \CJKsymbol - \cs_set:Npn \CJKsymbol ##1 - { - \bool_if:NTF \l_@@_tmp_bool - { \hfil \SJTU@CJK@FTS@Symbol { ##1 } } - { - \SJTU@CJK@FTS@Symbol { ##1 } - \bool_set_true:N \l_@@_tmp_bool - } - } - \use:e { \exp_not:N \tex_hbox:D to \dim_eval:n {#1} } - \bgroup \ignorespaces - } - { \egroup } + format : tokenlist = \c_empty_tl , + content : tokenlist = \c_empty_tl , + bottom-skip : skip = \c_zero_skip , + align : choice { left, right, center, normal } = center } +\DeclareTemplateCode { sjtu / element } { plain } { 0 } { - \NewDocumentEnvironment { SJTU@CJK@FTS } { m } + format = \l_@@_element_format_tl , + content = \l_@@_element_content_tl , + bottom-skip = \l_@@_element_bottom_skip , + align = { - \mode_leave_vertical: - \cs_set:Npn \CJKglue - { \skip_horizontal:n { \c_zero_dim plus 1 filll } } - \use:e { \exp_not:N \tex_hbox:D to \dim_eval:n {#1} } - \bgroup \ignorespaces + left = + \cs_set_eq:NN \l_@@_element_align: \raggedright , + right = + \cs_set_eq:NN \l_@@_element_align: \raggedleft , + center = + \cs_set_eq:NN \l_@@_element_align: \centering , + normal = + \cs_set_eq:NN \l_@@_element_align: \prg_do_nothing: } - { \egroup } } { - \NewDocumentEnvironment { SJTU@CJK@FTS } { m } - { - \mode_leave_vertical: - \ltjsetparameter { kanjiskip = { \c_zero_dim plus 1 filll } } - \use:e { \exp_not:N \tex_hbox:D to \dim_eval:n {#1} } - \bgroup \ignorespaces - } - { \egroup } + \AssignTemplateKeys + \group_begin: + \l_@@_element_align: + \l_@@_element_format_tl + \l_@@_element_content_tl + \par + \group_end: + \skip_vertical:N \l_@@_element_bottom_skip + \skip_vertical:N \c_zero_skip } % \end{macrocode} % -% 汉字分散对齐的表格列说明符。 +% 页面模板。 +% \begin{macrocode} +\NewTemplateType { sjtu / page } { 1 } +\DeclareTemplateInterface { sjtu / page } { title } { 1 } + { + bookmark : tokenlist , + style : tokenlist = empty , + format : tokenlist = \linespread { } \selectfont , + prefix : tokenlist , + elements : commalist + } +\DeclareTemplateCode { sjtu / page } { title } { 1 } + { + bookmark = \l_@@_page_bookmark_tl , + style = \l_@@_page_style_tl , + format = \l_@@_page_format_tl , + prefix = \l_@@_page_prefix_tl , + elements = \l_@@_page_elements_clist + } + { + \tl_set_eq:NN \l_@@_page_bookmark_tl \c_novalue_tl + \AssignTemplateKeys + \group_begin: + \@@_select_language:n {#1} + \clist_gset_eq:Nc \l_@@_info_fund_clist + { l_@@_info_fund_ \l_@@_lang_tl _clist } + \legacy_if:nTF { @openright } + { \cleardoublepage } { \clearpage } + \exp_args:No \tl_if_novalue:nF { \l_@@_page_bookmark_tl } + { \@@_pdf_bookmark:nn { 0 } { \l_@@_page_bookmark_tl } } + \exp_args:No \thispagestyle { \l_@@_page_style_tl } + \l_@@_page_format_tl + \clist_map_inline:Nn \l_@@_page_elements_clist + { \UseInstance { sjtu / element } { \l_@@_page_prefix_tl / ##1 } } + \group_end: + \clearpage + } +% \end{macrocode} +% +% 声明模板实例的辅助函数。 % \begin{macrocode} -\newcolumntype { \SJTU@CT@D } [ 1 ] - { > { \begin { SJTU@CJK@FTS } {#1} } c < { \end { SJTU@CJK@FTS } } } +\cs_new_protected:Npn \@@_declare_element_instance:nnn #1#2#3 + { \DeclareInstance { sjtu / element } {#1/#2} { plain } {#3} } +\cs_new_protected:Npn \@@_declare_page_instance:nnn #1#2 + { \DeclareInstance { sjtu / page } {#1} { title } {#2} } % \end{macrocode} % +% \subsubsection{标题页} +% +% \changes{v2.0}{2022/12/13}{启用新版封面。} +% \changes{v2.0.2}{2023/04/01}{标题页日期底部增加空白。} % \changes{v2.1}{2023/11/30}{标题页信息栏改用表格实现。} % \changes{v2.1.4}{2024/08/14}{标题页信息栏允许手动换行。} -% \begin{macro}[int]{\@@_title_page_info_i:nnn,\@@_title_page_info_i:nxx, -% \@@_title_page_info_ii:n} +% \changes{v2.1.5}{2024/11/06}{修复了 \pkg{array} 更新造成的标题页生成失败的问题。} +% +% \begin{variable}{\SJTU@CT@W@width} +% \begin{macrocode} +\tl_set:Nn \SJTU@CT@W@width { 5 em } +% \end{macrocode} +% \end{variable} +% +% \begin{macro}[int]{\SJTU@CT@W,\SJTU@CT@R,\SJTU@CT@L} +% \begin{macrocode} +\newcolumntype { \SJTU@CT@W } [ 1 ] + { + w {#1} { \SJTU@CT@W@width } + @{ \tl_use:c { c_@@_name_info_sep_ \l_@@_lang_tl _tl } } + } +\newcolumntype { \SJTU@CT@R } + { r @{ \tl_use:c { c_@@_name_info_sep_ \l_@@_lang_tl _tl } } } +\newcolumntype { \SJTU@CT@L } + { >{ \linespread { 0.75 } \normalfont } l } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\@@_info_table_row:nn,\@@_info_table_row:vv, +% \@@_title_page_info_table:n} % 信息输出。 % \begin{macrocode} -\cs_new:Npn \@@_title_page_info_i:nnn #1#2#3 +\cs_new:Npn \@@_info_table_row:nn #1#2 { - \clist_clear:N \l_@@_tmp_clist - \clist_map_inline:nn {#3} + \exp_not:n {#1} + & + \exp_not:N \hbox:n { - \clist_put_right:Nx \l_@@_tmp_clist - { - \exp_not:o { \cs:w c_@@_name_ ##1 _ #1 _tl \cs_end: } - & - \exp_not:N \hbox:n - { - \exp_not:N \tabular [ t ] { @{} l @{} } - \exp_not:o { \cs:w l_@@_info_ ##1 _ #1 _tl \cs_end: } - \exp_not:N \endtabular - } - } + \exp_not:N \tabular [ t ] { @{} l @{} } + \exp_not:n {#2} + \exp_not:N \endtabular } + } +\cs_generate_variant:Nn \@@_info_table_row:nn { vv } +\cs_new_protected:Npn \@@_title_page_info_table:n #1 + { \group_begin: + \clist_clear:N \l_@@_tmp_clist + \seq_map_inline:cn { l_@@_info_show_ \l_@@_lang_tl _seq } + { + \bool_lazy_all:nT + { + { \tl_if_exist_p:c { l_@@_name_ ##1 _ \l_@@_lang_tl _tl } } + { \tl_if_exist_p:c { l_@@_info_ ##1 _ \l_@@_lang_tl _tl } } + } + { + \clist_put_right:Ne \l_@@_tmp_clist + { + \@@_info_table_row:vv + { l_@@_name_ ##1 _ \l_@@_lang_tl _tl } + { l_@@_info_ ##1 _ \l_@@_lang_tl _tl } + } + } + } \tl_set:Nn \arraystretch { 1 } - \tabular {#2} + \int_set_eq:NN \hbadness \c_max_int + \tabular {#1} \clist_use:Nn \l_@@_tmp_clist { \\ } \endtabular \group_end: } -\cs_new:Npn \@@_title_page_info_ii:n #1 +% \end{macrocode} +% \end{macro} +% +% 标题页页面样式,页脚添加资助基金信息。 +% \begin{macrocode} +\cs_new:Npn \ps@SJTU@fund { - \tl_use:c { l_@@_info_department_ #1 _tl } - \skip_vertical:N \c_zero_skip - \tl_use:c { c_@@_name_univ_ #1 _tl } - \skip_vertical:N \c_zero_skip - \tl_use:c { c_@@_name_address_ #1 _tl } - \skip_vertical:N \c_zero_skip - \tl_use:c { l_@@_info_date_ #1 _tl } + \ps@empty + \tl_set:Nn \@oddfoot + { + \hfil + \minipage [ t ] { \textwidth } + \centering \zihao { - 5 } + \clist_use:Nn \l_@@_info_fund_clist { \par } + \endminipage + \hfil + } + \tl_set_eq:NN \@evenfoot \@oddfoot } -\cs_generate_variant:Nn \@@_title_page_info_i:nnn { nxx } -%</thesis> -%</class> % \end{macrocode} -% \end{macro} % -% \subsubsection{构建标题页} +% 构建标题页。 % -% \changes{v2.0}{2022/12/13}{启用新版封面。} -% \changes{v2.0.2}{2023/04/01}{标题页日期底部增加空白。} +% 样式 A 标题页元素实例。 % \begin{macrocode} -%<*lang> -%<*thesis> -%<*zh> \clist_map_inline:nn { { logo } @@ -4939,175 +4809,184 @@ content = { \includegraphics [ width = 3 cm ] - { sjtu-vi-badge-red.pdf } + { sjtu-vi-badge-reg-red.pdf } } - }, + } , { subject } { format = \zihao { -2 } \setbaselineskip { 30 bp } , - content = \l_@@_info_subject_zh_tl , + content = \tl_use:c { l_@@_info_subject_ \l_@@_lang_tl _tl } , bottom-skip = \c_zero_dim plus 1 fill - }, + } , { title } { format = \zihao { 2 } \setbaselineskip { 36 bp } \bfseries , - content = \l_@@_info_display_title_zh_tl , + content = \tl_use:c { l_@@_info_display_title_ \l_@@_lang_tl _tl } , bottom-skip = 30 bp plus 1 fill - }, + } , { info } { format = \zihao { 4 } \setbaselineskip { 30 bp } \heiti , - content = - { - \@@_title_page_info_i:nxx { zh } - { - \exp_not:N \SJTU@CT@D { 5 em } - @ { \exp_not:V \c_@@_name_info_sep_zh_tl } - > { \exp_not:N \setbaselineskip { 22.5 bp } \exp_not:N \normalfont } l - } - { - author, - id, - \l_@@_info_supervisors_clist , - department, - major, - \int_compare:nNnF { \g_@@_thesis_type_int } = { 1 } - { degree } - } - } , + content = \@@_title_page_info_table:n + { \SJTU@CT@W { s } \SJTU@CT@L } , bottom-skip = 30 bp - }, + } , { date } { format = \zihao { 4 } \setbaselineskip { 30 bp } \bfseries , - content = \l_@@_info_date_zh_tl , + content = \tl_use:c { l_@@_info_date_ \l_@@_lang_tl _tl } , } } + { \@@_declare_element_instance:nnn { title a } #1 } +% \end{macrocode} +% +% 样式 A 标题页实例。 +% \begin{macrocode} +\@@_declare_page_instance:nnn { title a } { - \@@_declare_component:nnn { title / zh } #1 - } -\@@_declare_page:nn { title / zh } - { - bookmark = true , - bookmark-text = \c_@@_name_title_page_tl , - style = SJTU@fund@zh , - format = \linespread { } \@@_set_language_zh: , - prefix = title / zh , - components = { logo, subject, title, info, date } + bookmark = \tl_use:c { c_@@_name_title_page_ \g_@@_lang_tl _tl } , + style = SJTU@fund , + prefix = title a , + elements = { logo, subject, title, info, date } } -%</zh> -%<*en|de|ja> +% \end{macrocode} +% +% 样式 B 标题页元素实例。 +% \begin{macrocode} \clist_map_inline:nn { { subject } { format = \zihao { 4 } \setbaselineskip { 24 bp } \bfseries , -%<en> content = \l_@@_info_subject_en_tl , -%<de> content = \l_@@_info_subject_de_tl , -%<ja> content = \l_@@_info_subject_ja_tl , + content = \tl_use:c { l_@@_info_subject_ \l_@@_lang_tl _tl } , bottom-skip = \c_zero_dim plus 1 fill - }, + } , { title } { format = \zihao { -2 } \setbaselineskip { 30 bp } \bfseries , -%<en> content = \MakeUppercase \l_@@_info_display_title_en_tl , -%<de> content = \MakeUppercase \l_@@_info_display_title_de_tl , -%<ja> content = \l_@@_info_display_title_ja_tl , + content = \tl_use:c { l_@@_info_display_title_ \l_@@_lang_tl _tl } , bottom-skip = \c_zero_dim plus 1 fill - }, + } , { info } { format = \zihao { 3 } \setbaselineskip { 30 bp } \bfseries , - content = - { -%<en> \@@_title_page_info_i:nxx { en } -%<de> \@@_title_page_info_i:nxx { de } -%<ja> \@@_title_page_info_i:nxx { ja } - { -%<en> r @ { \exp_not:V \c_@@_name_info_sep_en_tl } -%<de> r @ { \exp_not:V \c_@@_name_info_sep_de_tl } -%<ja> r @ { \exp_not:V \c_@@_name_info_sep_ja_tl } - > { \exp_not:N \setbaselineskip { 22.5 bp } \exp_not:N \normalfont } l - } - { author, \l_@@_info_supervisors_clist } - } , + content = \@@_title_page_info_table:n + { \SJTU@CT@R \SJTU@CT@L } , bottom-skip = 30 bp plus 1 fill - }, + } , { date } { format = \zihao { 3 } \setbaselineskip { 30 bp } , content = -%<en> { \@@_title_page_info_ii:n { en } } , -%<de> { \@@_title_page_info_ii:n { de } } , -%<ja> { \@@_title_page_info_ii:n { ja } } , - }, - } - { -%<en> \@@_declare_component:nnn { title / en } #1 -%<de> \@@_declare_component:nnn { title / de } #1 -%<ja> \@@_declare_component:nnn { title / ja } #1 - } -%<*en> -\@@_declare_page:nn { title / en } - { - style = SJTU@fund@en , - format = \linespread { } \@@_set_language_en: , - prefix = title / en , - components = { subject, title, info, date } - } -%</en> -%<*de> -\@@_declare_page:nn { title / de } - { - style = SJTU@fund@de , - format = \linespread { } \@@_set_language_de: , - prefix = title / de , - components = { subject, title, info, date } + { + \tl_use:c { l_@@_info_department_ \l_@@_lang_tl _tl } + \skip_vertical:N \c_zero_skip + \tl_use:c { c_@@_name_univ_ \l_@@_lang_tl _tl } + \skip_vertical:N \c_zero_skip + \tl_use:c { c_@@_name_address_ \l_@@_lang_tl _tl } + \skip_vertical:N \c_zero_skip + \tl_use:c { l_@@_info_date_ \l_@@_lang_tl _tl } + } + } } -%</de> -%<*ja> -\@@_declare_page:nn { title / ja } + { \@@_declare_element_instance:nnn { title b } #1 } +% \end{macrocode} +% +% 样式 B 标题页实例。 +% \begin{macrocode} +\@@_declare_page_instance:nnn { title b } { - style = SJTU@fund@ja , - format = \linespread { } \@@_set_language_ja: , - prefix = title / ja , - components = { subject, title, info, date } + prefix = title b , + style = SJTU@fund , + elements = { subject, title, info, date } } -%</ja> -%</en|de|ja> +% \end{macrocode} +% +% 载入学位论文语言配置文件。 +% \begin{macrocode} +\clist_map_inline:Nn \g_@@_lang_clist + { \file_input:n { sjtu-thesis- #1 .def } } %</thesis> -%</lang> +%</class> +% \end{macrocode} +% +% 中文标题页使用样式 A,其他语种使用样式 B。 +% \begin{macrocode} +%<*thesis-i18n> +\DeclareInstanceCopy { sjtu / page } +%<zh> { title / zh } { title a } +%<en> { title / en } { title b } +%<de> { title / de } { title b } +%<ja> { title / ja } { title b } +%</thesis-i18n> % \end{macrocode} % % \begin{macro}{\maketitle} -% 生成标题页,输出前先确定需要显示的导师列表。 +% 生成标题页。 % \begin{macrocode} %<*class> %<*thesis> \RenewDocumentCommand \maketitle { } { - \clist_map_inline:nn - { assoc_supervisor, co_supervisor } - { - \tl_if_empty:cF { l_@@_info_ ##1 _zh_tl } - { \clist_put_right:Nn \l_@@_info_supervisors_clist {##1} } - } \clist_map_inline:Nn \g_@@_lang_clist - { \UseInstance { sjtu } { title / ##1 } } + { \UseInstance { sjtu / page } { title / ##1 } { ##1 } } } -%</thesis> % \end{macrocode} % \end{macro} % -% \subsection{原创性声明及使用授权书} +% \subsubsection{原创性声明及使用授权书} % +% 声明及授权书文本。 % \begin{macrocode} -%<*thesis> +\tl_const:Nn \c_@@_orig_decl_text_zh_tl + { + 本人郑重声明:所呈交的学位论文,是本人在导师的指导下,独立进行研究工 + 作所取得的成果。除文中已经注明引用的内容外,本论文不包含任何其他个人 + 或集体已经发表或撰写过的作品成果。对本文的研究做出重要贡献的个人和集 + 体,均已在文中以明确方式标明。本人完全知晓本声明的法律后果由本人承 + 担。 + } +\tl_const:Nn \c_@@_auth_decl_text_zh_tl + { + 本人同意学校保留并向国家有关部门或机构送交论文的复印件和电子版,允许 + 论文被查阅和借阅。 \par + \vskip 6 bp + \noindent + 本学位论文属于: \par + { \c_@@_symbol_white_square_tl } \, \textbf { 公开论文 } \par + { \c_@@_symbol_white_square_tl } \, \textbf { 内部论文 }, + 保密 \, { \c_@@_symbol_white_square_tl } \, 1 \, 年 \, / + \, { \c_@@_symbol_white_square_tl } \, 2 \, 年 \, / + \, { \c_@@_symbol_white_square_tl } \, 3 \, 年, + 过保密期后适用本授权书。 \par + { \c_@@_symbol_white_square_tl } \, \textbf { 秘密论文 }, + 保密 \, \underline { \hspace { 2 em } } \, 年(不超过~ 10~ 年), + 过保密期后适用本授权书。 \par + { \c_@@_symbol_white_square_tl } \, \textbf { 机密论文 }, + 保密 \, \underline { \hspace { 2 em } } \, 年(不超过~ 20~ 年), + 过保密期后适用本授权书。 \par + \hspace { 6 em }(请在以上方框内选择打“ \ensuremath { \checkmark } ”) + } +% \end{macrocode} +% +% 签名框。 +% \begin{macrocode} +\tl_const:Nn \c_@@_signature_text_zh_tl + { + 签名: \\ + 日期: \hspace { \stretch { 3 } } 年 + \hspace { \stretch { 2 } } 月 + \hspace { \stretch { 2 } } 日 + } \cs_new_protected:Npn \@@_signature:N #1 { \parbox [ t ] { 12 em } { #1 \c_@@_signature_text_zh_tl } } +% \end{macrocode} +% +% 声明及授权书元素实例。 +% \begin{macrocode} \clist_map_inline:nn { { orig / title } @@ -5176,56 +5055,165 @@ } } { - \@@_declare_component:nnn { copyright } #1 + \@@_declare_element_instance:nnn { copyright } #1 } -\@@_declare_page:nn { copyright } +% \end{macrocode} +% +% 声明及授权书模板实例。 +% \begin{macrocode} +\@@_declare_page_instance:nnn { copyright } { - bookmark = true , - bookmark-text = \c_@@_name_declaration_tl , - format = \linespread { } \@@_set_language_zh: , - prefix = copyright , - components = + bookmark = \tl_use:c { c_@@_name_declaration_ \g_@@_lang_tl _tl } , + prefix = copyright , + elements = { orig / title, orig / text, orig / sign, auth / title, auth / text, auth / sign } } -\msg_new:nnn { sjtutex } { require-pdfpages } +% \end{macrocode} +% +% \begin{variable}{\l_@@_copyright_page_file_tl} +% \begin{macrocode} +\tl_new:N \l_@@_copyright_page_file_tl +% \end{macrocode} +% \end{variable} +% +% \begin{macrocode} +\keys_define:nn { sjtu / private / copyright } { - Add~"\token_to_str:N \usepackage{pdfpages}"~ in~ your~ preamble \\ - before~ inserting~ pages~ of~ external~ PDF. + file .tl_set:N = \l_@@_copyright_page_file_tl , + file .value_required:n = true , + filename .meta:n = { file = #1 } } % \end{macrocode} % % \changes{v2.0}{2022/12/20}{不再自动载入 \pkg{pdfpages} 宏包。} +% \begin{macrocode} +\msg_new:nnn { sjtutex } { require-pdfpages } + { + Add~'\token_to_str:N \usepackage{pdfpages}'~in~your~preamble \\ + before~inserting~pages~of~external~PDF. + } +% \end{macrocode} +% % \begin{macro}{\copyrightpage} +% 生成声明及授权书。 % \begin{macrocode} \NewDocumentCommand \copyrightpage { O{ } } { \bool_if:NF \g_@@_review_bool { - \tl_if_blank:nTF {#1} - { \UseInstance { sjtu } { copyright } } + \group_begin: + \keys_set_known:nnN { sjtu / private / copyright } + {#1} \l_@@_tmp_tl + \tl_if_empty:NTF \l_@@_copyright_page_file_tl + { \UseInstance { sjtu / page } { copyright } { zh } } + { + \cs_if_exist:NTF \includepdf + { + \legacy_if:nTF { @openright } + { \cleardoublepage } { \clearpage } + \@@_pdf_bookmark:nn { 0 } { \c_@@_name_declaration_tl } + \tl_set_rescan:NnV \l_@@_tmp_tl { } \l_@@_tmp_tl + \exp_args:NNo \includepdf [ \l_@@_tmp_tl ] + { \l_@@_copyright_page_file_tl } + } + { + \msg_warning:nn { sjtutex } { require-pdfpages } + \UseInstance { sjtu / page } { copyright } { zh } + } + } + \group_end: + } + } +%</thesis> +% \end{macrocode} +% \end{macro} +% +% \subsection{文档组成} +% +% \changes{v2.2}{2024/12/20}{内置文档命令与环境修改为使用键值对参数,废弃对应的带星号版本。} +% +% \subsubsection{统一接口} +% +% 定义文档组成部分的统一键值对接口。 +% +% \begin{variable}{\l_@@_heading_numbering_bool,\l_@@_heading_in_toc_bool, +% \l_@@_heading_title_tl,\l_@@_heading_marking_tl} +% \begin{macrocode} +\bool_new:N \l_@@_heading_numbering_bool +\bool_new:N \l_@@_heading_in_toc_bool +\tl_new:N \l_@@_heading_title_tl +\tl_new:N \l_@@_heading_marking_tl +% \end{macrocode} +% \end{variable} +% +% 默认 \tn{mainmatter} 之后的章节标题加入目录。 +% \begin{macrocode} +%<*thesis> +\AddToHook { cmd / mainmatter / after } + { \bool_set_true:N \l_@@_heading_in_toc_bool } +%</thesis> +% \end{macrocode} +% +% \begin{macro}{intoc,notintoc,title,marking} +% \begin{macrocode} +\keys_define:nn { sjtu / private } + { + intoc .value_forbidden:n = true, + intoc .groups:n = { heading } , + intoc .code:n = { \bool_set_true:N \l_@@_heading_in_toc_bool } , + notintoc .value_forbidden:n = true, + notintoc .groups:n = { heading } , + notintoc .code:n = { \bool_set_false:N \l_@@_heading_in_toc_bool } , + title .tl_set:N = \l_@@_heading_title_tl , + title .groups:n = { heading } , + marking .tl_set:N = \l_@@_heading_marking_tl , + marking .groups:n = { heading } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\SJTU@heading,\@@_heading:nn,\@@_heading:VV, +% \@@_make_heading:n} +% 定义一个灵活的章节标题命令专门处理不同的需求。 +% \begin{macrocode} +\NewDocumentCommand \SJTU@heading { O{#2} m } + { + \bool_if:nTF + { \l_@@_heading_numbering_bool && \l_@@_heading_in_toc_bool } +%<!article> { \chapter [#1] {#2} } +%<article> { \section [#1] {#2} } + { +%<!article> \CTEX@chapter@break + \bool_if:NTF \l_@@_heading_in_toc_bool { - \cs_if_exist:NTF \includepdf - { - \bool_if:NTF \g_@@_openright_bool - { \cleardoublepage } { \clearpage } - \@@_pdf_bookmark:nn { 0 } { \c_@@_name_declaration_tl } - \includepdf {#1} - } - { - \msg_warning:nn { sjtutex } { require-pdfpages } - \UseInstance { sjtu } { copyright } - } + \@@_phantom_section: +%<!article> \addcontentsline { toc } { chapter } {#1} +%<article> \addcontentsline { toc } { section } {#1} } + { \@@_pdf_bookmark:nn { 0 } {#1} } +%<!article> \chapter* {#2} +%<article> \section* {#2} + \CTEX@gettitle {#1} + \@mkboth { \MakeUppercase {#1} } { \MakeUppercase {#1} } } } -%</thesis> +\cs_new_protected:Npn \@@_heading:nn #1#2 + { \SJTU@heading [#1] {#2} } +\cs_generate_variant:Nn \@@_heading:nn { VV } +\cs_new_protected:Npn \@@_make_heading:n #1 + { + \tl_set_eq:NN \l_@@_heading_marking_tl \c_novalue_tl + \keys_set_groups:nnn { sjtu / private } { heading } {#1} + \@@_heading:VV + \l_@@_heading_marking_tl \l_@@_heading_title_tl + } % \end{macrocode} % \end{macro} % -% \subsection{摘要} +% \subsubsection{摘要} % % \changes{v2.1}{2023/11/30}{新增 \opt{style/keywords-format} 选项。} % \begin{macro}{style/keywords-format} @@ -5246,77 +5234,55 @@ % \changes{v2.0}{2023/03/17}{\env{abstract} 环境新增指定语言的可选参数。} % \changes{v2.1}{2023/11/29}{\env{abstract} 环境添加目录条目, % \env{abstract*} 环境对应修改为不添加目录条目。} -% \begin{macro}{abstract,abstract*} +% \begin{macro}{abstract} % 学位论文摘要环境。 % \begin{macrocode} %<*thesis> -\DeclareDocumentEnvironment { abstract } { O{ zh } +b } +\DeclareDocumentEnvironment { abstract } { O{ } } { - \@@_if_lang_valid:nTF {#1} - { - \use:c { @@_set_language_ #1 : } - \exp_args:Nv \SJTU@head { c_@@_name_abstract_ #1 _tl } - #2 - \clist_if_empty:cF { l_@@_info_keywords_ #1 _clist } - { - \par \mode_leave_vertical: \par - \@@_keywords_format:n - { - \tl_use:c { c_@@_name_keywords_ #1 _tl } - \tl_use:c { c_@@_name_info_sep_ #1 _tl } - } - \clist_use:cv { l_@@_info_keywords_ #1 _clist } - { c_@@_name_item_sep_ #1 _tl } - \par - } - } - { \msg_error:nnn { sjtutex } { lang-validation } {#1} } - } { } -\DeclareDocumentEnvironment { abstract* } { O{ zh } +b } + \@@_select_language:n {#1} + \tl_set_eq:Nc \l_@@_heading_title_tl + { c_@@_name_abstract_ \l_@@_lang_tl _tl } + \@@_make_heading:n {#1} + } { - \@@_if_lang_valid:nTF {#1} + \clist_if_empty:cF { l_@@_info_keywords_ \l_@@_lang_tl _clist } { - \use:c { @@_set_language_ #1 : } - \exp_args:NNv \SJTU@head* { c_@@_name_abstract_ #1 _tl } - #2 - \clist_if_empty:cF { l_@@_info_keywords_ #1 _clist } + \par \mode_leave_vertical: \par + \@@_keywords_format:n { - \par \mode_leave_vertical: \par - \@@_keywords_format:n - { - \tl_use:c { c_@@_name_keywords_ #1 _tl } - \tl_use:c { c_@@_name_info_sep_ #1 _tl } - } - \clist_use:cv { l_@@_info_keywords_ #1 _clist } - { c_@@_name_item_sep_ #1 _tl } - \par + \tl_use:c { c_@@_name_keywords_ \l_@@_lang_tl _tl } + \tl_use:c { c_@@_name_info_sep_ \l_@@_lang_tl _tl } } + \clist_use:cv { l_@@_info_keywords_ \l_@@_lang_tl _clist } + { c_@@_name_item_sep_ \l_@@_lang_tl _tl } + \par } - { \msg_error:nnn { sjtutex } { lang-validation } {#1} } - } { } + } %</thesis> % \end{macrocode} % % 修复通用模板摘要段首缩进。 % \begin{macrocode} %<*!thesis> -\bool_if:NT \g_@@_titlepage_bool - { \@@_appto_cmd:Nn \abstract { \par } } +\legacy_if:nT { @titlepage } + { \AddToHook { cmd / abstract / after } { \par } } % \end{macrocode} % % 通用模板摘要后添加关键词。 % \begin{macrocode} -\@@_preto_cmd:Nn \endabstract +\AddToHook { env / abstract / end } { \clist_if_empty:NF \l_@@_info_keywords_clist { \par \mode_leave_vertical: \par \@@_keywords_format:n { - \c_@@_name_keywords_tl - \c_@@_name_info_sep_tl + \tl_use:c { c_@@_name_keywords_ \g_@@_lang_tl _tl } + \tl_use:c { c_@@_name_info_sep_ \g_@@_lang_tl _tl } } - \clist_use:NV \l_@@_info_keywords_clist \c_@@_name_item_sep_tl + \clist_use:Nv \l_@@_info_keywords_clist + { c_@@_name_item_sep_ \g_@@_lang_tl _tl } \par } } @@ -5324,19 +5290,19 @@ % \end{macrocode} % \end{macro} % -% \subsection{目录} +% \subsubsection{目录列表} % % \changes{v2.1}{2023/11/29}{\tn{tableofcontents} 添加目录条目, % \tn{tableofcontents*} 对应修改为不添加目录条目。} -% \begin{macro}{\tableofcontents,\tableofcontents*} +% \begin{macro}{\tableofcontents} % 目录。 % \begin{macrocode} -\DeclareDocumentCommand \tableofcontents { s } +\DeclareDocumentCommand \tableofcontents { O{ } } { - \IfBooleanTF {#1} - { \SJTU@head* { \contentsname } } - { \SJTU@head { \contentsname } } - \@starttoc { toc } + \group_begin: + \@@_make_heading:n { title = \contentsname, #1 } + \@starttoc { toc } + \group_end: } % \end{macrocode} % \end{macro} @@ -5366,15 +5332,15 @@ % \changes{v2.0.1}{2023/03/31}{插图、表格和算法等索引不缩进。} % \changes{v2.0.1}{2023/03/31}{调整插图、表格和算法等索引编号宽度。} % \begin{macro}[int]{\SJTU@listof,\@@_new_list_of:Nnnn} -% \begin{macro}{\listoffigures,\listoffigures*,\listoftables,\listoftables*} +% \begin{macro}{\listoffigures,\listoftables} % 图表索引。 % \begin{macrocode} -\NewDocumentCommand \SJTU@listof { m m s } +\NewDocumentCommand \SJTU@listof { m m O{ } } { - \IfBooleanTF {#3} - { \SJTU@head* {#1} } - { \SJTU@head {#1} } - \exp_args:Nv \@starttoc { ext@ #2 } + \group_begin: + \@@_make_heading:n { title = #1, #3 } + \exp_args:Nv \@starttoc { ext@ #2 } + \group_end: } \cs_new_protected:Npn \@@_new_list_of:Nnnn #1#2#3#4 { @@ -5394,36 +5360,28 @@ % \end{macro} % \end{macro} % -% \subsection{预定义环境} +% \subsubsection{预定义环境} % -% \begin{macro}{abbreviation,abbreviation*} +% \begin{macro}{abbreviation} % 缩略语对照表。 % \begin{macrocode} %<*thesis> -\NewDocumentEnvironment { abbreviation } { O{ \SJTU@abbrname } } +\NewDocumentEnvironment { abbreviation } { O{ } } { - \chapter {#1} - \tl_clear:N \SJTU@style@float@font - } { } -\NewDocumentEnvironment { abbreviation* } { O{ \SJTU@abbrname } } - { - \SJTU@head* {#1} + \bool_set_true:N \l_@@_heading_numbering_bool + \@@_make_heading:n { title = \SJTU@abbrname, #1 } \tl_clear:N \SJTU@style@float@font } { } % \end{macrocode} % \end{macro} % -% \begin{macro}{nomenclature,nomenclature*} +% \begin{macro}{nomenclature} % 符号对照表。 % \begin{macrocode} -\NewDocumentEnvironment { nomenclature } { O{ \SJTU@nomname } } - { - \chapter {#1} - \tl_clear:N \SJTU@style@float@font - } { } -\NewDocumentEnvironment { nomenclature* } { O{ \SJTU@nomname } } +\NewDocumentEnvironment { nomenclature } { O{ } } { - \SJTU@head* {#1} + \bool_set_true:N \l_@@_heading_numbering_bool + \@@_make_heading:n { title = \SJTU@nomname, #1 } \tl_clear:N \SJTU@style@float@font } { } % \end{macrocode} @@ -5434,32 +5392,45 @@ % \begin{macro}{acknowledgements} % 致谢,盲审模式下隐藏致谢。 % \begin{macrocode} -\NewDocumentEnvironment { acknowledgements } { O{ \SJTU@ackname } +b } +\NewDocumentEnvironment { acknowledgements } { O{ } +b } { \bool_if:NF \g_@@_review_bool { - \SJTU@head {#1} + \@@_select_language:n {#1} + \@@_make_heading:n { title = \SJTU@ackname, #1 } #2 } } { } % \end{macrocode} % \end{macro} % +% \changes{v2.2}{2024/12/08}{移除 \env{bibliolist} 环境的使用限制, +% 默认重置计数,新增 \opt{resume} 选项。} % \begin{macro}{achievements,bibliolist,bibliolist*} % 发表论文与学术成果。 % \begin{macrocode} \newcounter { SJTU@bib } -\NewDocumentEnvironment { @bibliolist } { m } +\bool_new:N \l_@@_bibliolist_resume_bool +\keys_define:nn { sjtu / private / bibliolist } { + resume .value_forbidden:n = true, + resume .code:n = + { \bool_set_true:N \l_@@_bibliolist_resume_bool } + } +\msg_new:nnn { sjtutex } { empty-environment } + { Empty~'#1'~environment. } +\NewDocumentEnvironment { @bibliolist } { m m } + { + \keys_set:nn { sjtu / private / bibliolist } {#1} \cs_if_exist_use:N \bibfont \list { - \tl_if_blank:nTF {#1} + \tl_if_blank:nTF {#2} { \hfill } { \@biblabel { \arabic{ SJTU@bib } } } } { - \tl_if_blank:nTF {#1} + \tl_if_blank:nTF {#2} { \skip_if_exist:NTF \bibhang { \dim_set_eq:NN \leftmargin \bibhang } @@ -5467,7 +5438,7 @@ \dim_set:Nn \itemindent { - \leftmargin } } { - \@@_dim_set_to_wd:Nn \labelwidth { \@biblabel {#1} } + \@@_dim_set_to_wd:Nn \labelwidth { \@biblabel {#2} } \dim_set_eq:NN \leftmargin \labelwidth \dim_add:Nn \leftmargin { \labelsep } } @@ -5485,9 +5456,11 @@ } } \@nmbrlisttrue - \tl_set:Nn \@listctr { SJTU@bib } - \cs_set:Npn \p@SJTU@bib { } - \cs_set:Npn \theSJTU@bib { \arabic { SJTU@bib } } + \tl_set:Nn \@listctr { SJTU@bib } + \tl_clear:N \p@SJTU@bib + \bool_if:NF \l_@@_bibliolist_resume_bool + { \setcounter { SJTU@bib } { 0 } } + \tl_set:Nn \theSJTU@bib { \arabic { SJTU@bib } } } \sloppy \int_set:Nn \clubpenalty { 4000 } @@ -5496,62 +5469,45 @@ \char_set_sfcode:nn { `\. } { 1000 } } { - \cs_set:Npn \@noitemerr + \tl_set:Nn \@noitemerr { \msg_warning:nnn { sjtutex } { empty-environment } { bibliolist } } \endlist } -\msg_new:nnn { sjtutex } { empty-environment } - { Empty~ `#1'~ environment. } -\bool_new:N \l_@@_achievements_bool -\NewDocumentEnvironment { achievements } { O{ \SJTU@achvname } } +\NewDocumentEnvironment { achievements } { O{ } } { - \SJTU@head {#1} - \setcounter { SJTU@bib } { 0 } - \bool_set_true:N \l_@@_achievements_bool + \@@_select_language:n {#1} + \@@_make_heading:n { title = \SJTU@achvname, #1 } } { } -\NewDocumentEnvironment { bibliolist } { m +b } +\NewDocumentEnvironment { bibliolist } { O{ } m +b } { - \bool_if:NF \l_@@_achievements_bool - { - \msg_error:nnnn { sjtutex } { environment-validation } - { bibliolist } { achievements } - } \bool_if:NF \g_@@_review_bool { - \cs_set:Npn \@noitemerr { } - \begin { @bibliolist } {#1} - #2 + \begin { @bibliolist } {#1} {#2} + #3 \end { @bibliolist } } } { } -\NewDocumentEnvironment { bibliolist* } { m +b } +\NewDocumentEnvironment { bibliolist* } { O{ } m +b } { - \bool_if:NF \l_@@_achievements_bool - { - \msg_error:nnnn { sjtutex } { environment-validation } - { bibliolist* } { achievements } - } \bool_if:NT \g_@@_review_bool { - \cs_set:Npn \@noitemerr { } - \begin { @bibliolist } {#1} - #2 + \begin { @bibliolist } {#1} {#2} + #3 \end { @bibliolist } } } { } -\msg_new:nnn { sjtutex } { environment-validation } - { `#1'~ is~ only~ valid~ in~ `#2'~ environment. } % \end{macrocode} % \end{macro} % % \begin{macro}{resume} % 简历。 % \begin{macrocode} -\NewDocumentEnvironment { resume } { O{ \SJTU@resumename } +b } +\NewDocumentEnvironment { resume } { O{ } +b } { \bool_if:NF \g_@@_review_bool { - \SJTU@head {#1} + \@@_select_language:n {#1} + \@@_make_heading:n { title = \SJTU@resumename, #1 } #2 } } { } @@ -5562,32 +5518,30 @@ % \begin{macro}{digest} % 大摘要。 % \begin{macrocode} -\NewDocumentEnvironment { digest } { O{ en } +b } +\NewHook { sjtutex / digest } +\NewDocumentEnvironment { digest } { O{ } +b } { - \@@_if_lang_valid:nTF {#1} + \AtEndDocument { - \AtEndDocument - { - \use:c { @@_set_language_ #1 : } - \bool_if:NTF \g_@@_openright_bool - { \cleardoublepage } { \clearpage } - \pagenumbering { roman } - \cs_gset:Nn \@@_thepage: { \arabic { page } } - \cs_gset_eq:NN \addcontentsline \use_none:nnn - \clist_map_inline:Nn \l_@@_counter_without_chapter_clist - { - \counterwithout {##1} { chapter } - \setcounter {##1} { 0 } - } - \@@_head_aux_s:nx { \SJTU@digestname } - { - \exp_not:N \MakeUppercase - { \exp_not:v { l_@@_info_title_ #1 _tl } } - } - #2 - } + \group_begin: + \@@_select_language:n { en, #1 } + \legacy_if:nTF { @openright } + { \cleardoublepage } { \clearpage } + \pagenumbering { roman } + \tl_gset:Nn \@@_the_page_tl { \arabic { page } } + \UseHook { sjtutex / digest } + \cs_gset_eq:NN \addcontentsline \use_none:nnn + \clist_map_inline:Nn \l_@@_counter_without_chapter_clist + { + \counterwithout {##1} { chapter } + \setcounter {##1} { 0 } + } + \tl_set_eq:Nc \l_@@_heading_title_tl + { l_@@_info_display_title_ \l_@@_lang_tl _tl } + \@@_make_heading:n { marking = \SJTU@digestname, #1, notintoc } + #2 + \group_end: } - { \msg_error:nnn { sjtutex } { lang-validation } {#1} } } { } %</thesis> % \end{macrocode} @@ -5597,8 +5551,10 @@ % % \begin{macro}{\sjtusetup} % 用户设置接口。 +% 盲审模式下不会设置敏感信息。 % \begin{macrocode} -\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } +%<!thesis>\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } +%<thesis>\NewDocumentCommand \sjtusetup { } { \@@_setup:n } % \end{macrocode} % \end{macro} % @@ -5691,20 +5647,23 @@ pdfdisplaydoctitle = true } \int_new:N \g_@@_bookmark_int - \cs_gset_protected:Npn \@@_pdf_bookmark:nn #1#2 + \cs_set_protected:Npn \@@_pdf_bookmark:nn #1#2 { \phantomsection \int_gincr:N \g_@@_bookmark_int \pdfbookmark [#1] {#2} { sjtubookmark. \int_use:N \g_@@_bookmark_int } } - \cs_gset_eq:NN \@@_phantom_section: \phantomsection + \cs_set_eq:NN \@@_phantom_section: \phantomsection + \DeclareExpandableDocumentCommand + { \@@_pdfstring_newline:w } { s o m } {#3} \pdfstringdefDisableCommands { - \cs_set_eq:NN \\ \prg_do_nothing: - \cs_set_eq:NN \quad \c_empty_tl - \cs_set_eq:NN \qquad \c_empty_tl + \cs_set_eq:NN \\ \@@_pdfstring_newline:w \cs_set_eq:NN \hspace \use_none:n + \cs_set_eq:NN \zihao \use_none:n + \tl_set_eq:NN \quad \c_empty_tl + \tl_set_eq:NN \qquad \c_empty_tl } \ctex_after_end_preamble:n { @@ -5727,6 +5686,26 @@ } % \end{macrocode} % +% \changes{v2.2}{2024/12/30}{使用 \pkg{pageslts} 宏包获取总页码。} +% \subsubsection{\pkg{pageslts} 宏包} +% +% \begin{macrocode} +\ctex_at_end_package:nn { pageslts } + { +%<thesis> \pagenumbering { Alph } +%<!thesis> \pagenumbering { arabic } + \tl_set:Nn \@@_the_last_page_tl + { \lastpageref { pagesLTS.\pagesLTS@pnc } } +%<*thesis> + \AddToHook { sjtutex / digest } + { + \tl_gset:Nn \@@_the_last_page_tl + { \lastpageref { pagesLTS.roman.local } } + } +%</thesis> + } +% \end{macrocode} +% % \subsubsection{\pkg{threeparttable} 宏包} % % \begin{macrocode} @@ -5739,6 +5718,7 @@ % \begin{macrocode} \ctex_at_end_package:nn { longtable } { \AtBeginEnvironment { longtable } { \SJTU@style@float@font } } +%</class> % \end{macrocode} % % \changes{v2.1.1}{2024/03/21}{预定义的数学环境声明移至导言区末尾, @@ -5746,8 +5726,81 @@ % \subsubsection{\pkg{amsthm} 宏包和 \pkg{ntheorem} 宏包} % % 预定义的数学环境,不包括证明环境 \env{proof}。 +% \begin{macrocode} +%<*scheme> +\clist_map_inline:nn + { +%<*zh> + { assumption } { 假设 } , + { axiom } { 公理 } , + { conjecture } { 猜想 } , + { corollary } { 推论 } , + { definition } { 定义 } , + { example } { 例 } , + { exercise } { 练习 } , + { lemma } { 引理 } , + { problem } { 问题 } , + { proposition } { 命题 } , + { remark } { 注 } , + { solution } { 解 } , + { theorem } { 定理 } +%</zh> +%<*en> + { assumption } { Assumption } , + { axiom } { Axiom } , + { conjecture } { Conjecture } , + { corollary } { Corollary } , + { definition } { Definition } , + { example } { Example } , + { exercise } { Exercise } , + { lemma } { Lemma } , + { problem } { Problem } , + { proposition } { Proposition } , + { remark } { Remark } , + { solution } { Solution } , + { theorem } { Theorem } +%</en> +%<*de> + { assumption } { Annahme } , + { axiom } { Axiom } , + { conjecture } { Hypothese } , + { corollary } { Korollar } , + { definition } { Definition } , + { example } { Beispiel } , + { exercise } { Übung } , + { lemma } { Lemma } , + { problem } { Problem } , + { proposition } { Proposition } , + { remark } { Anmerkung } , + { solution } { Lösung } , + { theorem } { Theorem } +%</de> +%<*ja> + { assumption } { 仮定 } , + { axiom } { 公理 } , + { conjecture } { 予想 } , + { corollary } { 系 } , + { definition } { 定義 } , + { example } { 例 } , + { exercise } { 練習 } , + { lemma } { 補題 } , + { problem } { 問題 } , + { proposition } { 命題 } , + { remark } { 注意 } , + { solution } { 解法 } , + { theorem } { 定理 } +%</ja> + } +%<zh> { \@@_name_const:nnn { zh } #1 } +%<en> { \@@_name_const:nnn { en } #1 } +%<de> { \@@_name_const:nnn { de } #1 } +%<ja> { \@@_name_const:nnn { ja } #1 } +%</scheme> +% \end{macrocode} +% % 定义前会检测环境是否已经存在,避免覆盖用户的定义。 % \begin{macrocode} +%<*class> \cs_new_protected:Nn \@@_new_theorems: { \clist_map_inline:nn @@ -5757,19 +5810,20 @@ } { \cs_if_exist:cF {##1} -%<*!article> { - \exp_args:Nnv \newtheorem {##1} { c_@@_name_ ##1 _tl } - [ chapter ] + \exp_args:Nnv \newtheorem {##1} +%<!article> { c_@@_name_ ##1 _ \g_@@_lang_tl _tl } [ chapter ] +%<article> { c_@@_name_ ##1 _ \g_@@_lang_tl _tl } } -%</!article> -%<article> { \exp_args:Nnv \newtheorem {##1} { c_@@_name_ ##1 _tl } } } \clist_map_inline:nn { remark, solution } { \cs_if_exist:cF {##1} - { \exp_args:NNnv \newtheorem* {##1} { c_@@_name_ ##1 _tl } } + { + \exp_args:NNnv \newtheorem* {##1} + { c_@@_name_ ##1 _ \g_@@_lang_tl _tl } + } } } % \end{macrocode} @@ -5781,15 +5835,15 @@ { \cs_if_exist:NT \openbox { - \cs_new_eq:NN \@@_save_openbox: \openbox + \cs_new_eq:NN \SJTU@orig@openbox \openbox \cs_undefine:N \openbox } } \ctex_at_end_package:nn { amsthm } { \@@_cs_provide_eq:NN \QED \openbox - \cs_if_exist:NT \@@_save_openbox: - { \cs_set_eq:NN \openbox \@@_save_openbox: } + \cs_if_exist:NT \SJTU@orig@openbox + { \cs_set_eq:NN \openbox \SJTU@orig@openbox } \tl_set:Nn \qedsymbol { \ensuremath { \QED } } \RenewDocumentEnvironment { proof } { O{ \proofname } } { @@ -5807,34 +5861,33 @@ \newtheoremstyle { sjtu } { } { } { \SJTU@style@thm@body@font } { } { \SJTU@style@thm@header@font } { } { \ccwd } { } + \@@_disable_package_load:n { ntheorem } + \ctex_at_end_preamble:n + { + \theoremstyle { sjtu } + \@@_new_theorems: + } } % \end{macrocode} % -% 如果用户加载了 \pkg{amsthm} 或 \pkg{ntheorem} 宏包, -% 则在导言区末尾应用预设的样式定义定理环境。 +% \pkg{ntheorem} 宏包。 % \begin{macrocode} -\ctex_at_end_preamble:n +\ctex_at_end_package:nn { ntheorem } { - \@ifpackageloaded { amsthm } + \@@_disable_package_load:n { amsthm } + \ctex_at_end_preamble:n { - \theoremstyle { sjtu } + \@@_cs_provide_eq:NN \QED \c_empty_tl + \theoremheaderfont { \SJTU@style@thm@header@font } + \theorembodyfont { \SJTU@style@thm@body@font } + \theoremseparator { \enskip } + \theoremsymbol { \ensuremath { \QED } } + \qedsymbol { \ensuremath { \QED } } + \cs_if_exist:NF \proof + { \newtheorem* { proof } { \proofname } } + \theoremsymbol { } \@@_new_theorems: } - { - \@ifpackageloaded { ntheorem } - { - \@@_cs_provide_eq:NN \QED \c_empty_tl - \theoremheaderfont { \SJTU@style@thm@header@font } - \theorembodyfont { \SJTU@style@thm@body@font } - \theoremseparator { \enskip } - \theoremsymbol { \ensuremath { \QED } } - \qedsymbol { \ensuremath { \QED } } - \cs_if_exist:NF \proof - { \newtheorem* { proof } { \proofname } } - \theoremsymbol { } - \@@_new_theorems: - } { } - } } % \end{macrocode} % @@ -5855,13 +5908,16 @@ \exp_args:NV \contentsuse \thmt@envname { loe } } \cs_set:Npn \thmtlo@chaptervspacehack { } - \RenewDocumentCommand \listoftheorems { s O{ } } + \RenewDocumentCommand \listoftheorems { O{ } } { \group_begin: - \setlisttheoremstyle {#2} - \IfBooleanTF {#1} - { \SJTU@head* { \listtheoremname } } - { \SJTU@head { \listtheoremname } } + \tl_set_eq:NN \l_@@_heading_marking_tl \c_novalue_tl + \keys_set_groups:nnnN { sjtu / private } { heading } + { title = \listtheoremname, #1 } \l_@@_tmp_tl + \tl_set_rescan:NnV \l_@@_tmp_tl { } \l_@@_tmp_tl + \@@_heading:VV + \l_@@_heading_marking_tl \l_@@_heading_title_tl + \exp_args:No \setlisttheoremstyle { \l_@@_tmp_tl } \cs_set:Npn \contentsline ##1 { \use:c { thmt@contentsline@ ##1 } {##1} } \clist_map_inline:Nn \thmt@allenvs @@ -5904,10 +5960,10 @@ % \pkg{algorithm2e} 宏包。 % \begin{macrocode} %<!article>\ctex_at_begin_package:nn { algorithm2e } -%<!article> { \cs_set_eq:NN \@@_save_chapter:w \@chapter } +%<!article> { \cs_set_eq:NN \SJTU@orig@at@chapter \@chapter } \ctex_at_end_package:nn { algorithm2e } { -%<!article> \cs_set_eq:NN \@chapter \@@_save_chapter:w +%<!article> \cs_set_eq:NN \@chapter \SJTU@orig@at@chapter \SetAlgorithmName { \SJTU@algorithmname } { \SJTU@algorithmname } { \SJTU@listalgorithmname } @@ -5976,270 +6032,9 @@ } } } -% \end{macrocode} -% -% \begin{macrocode} %</class> % \end{macrocode} % -% \subsection{名称配置} -% \begin{macrocode} -%<*name> -%<*zh|ja> -\clist_map_inline:nn - { - { year } { 年 } , - { month } { 月 } , - { day } { 日 } - } -%<zh> { \@@_define_name:nnn { zh } #1 } -%<ja> { \@@_define_name:nnn { ja } #1 } -%</zh|ja> -%<*en> -\clist_const:Nn \c_@@_name_month_en_clist - { - January, February, March, April, May, June, - July, August, September, October, November, December - } -%</en> -%<*de> -\clist_const:Nn \c_@@_name_month_de_clist - { - Januar, Februar, März, April, Mai, Juni, - Juli, August, September, Oktober, November, Dezember - } -%</de> -%<*thesis> -%<*zh> -\@@_define_symbol:nn { white_square } { "25A1 } -\@@_define_name_from_clist:nnnn { zh } - { degree_level } { \g_@@_thesis_type_int } - { 学士, 硕士, 博士 } -%</zh> -%<*en> -\@@_define_name_from_clist:nnnn { en } - { degree_level } { \g_@@_thesis_type_int } - { Bachelor, Master, Doctor } -%</en> -%<*de> -\@@_define_name_from_clist:nnnn { de } - { degree_level } { \g_@@_thesis_type_int } - { Bachelor, Master, Doktor } -%</de> -%<*ja> -\@@_define_name_from_clist:nnnn { ja } - { degree_level } { \g_@@_thesis_type_int } - { 学士, 修士, 博士 } -%</ja> -%</thesis> -%<*zh> -\clist_map_inline:nn - { -%<*thesis> - { univ } { 上海交通大学 } , - { author } { 姓名 } , - { id } { 学号 } , - { supervisor } { 导师 } , - { assoc_supervisor } { 副导师 } , - { department } { 院系 } , - { co_supervisor } { 联合导师 } , - { major } { 学科 / 专业 } , - { degree } { 申请学位 } , - { thesis } { 学位论文 } , - { title_page } { 题名页 } , - { declaration } { 原创性声明及使用授权书 } , - { orig_decl } { 原创性声明 } , - { auth_decl } { 使用授权书 } , - { decl_author } { 学位论文作者 } , - { decl_supervisor } { 指导教师 } , - { abstract } { 摘 \protect \quad 要 } , -%</thesis> - { keywords } { 关键词 } , - { info_sep } { : \null } , - { item_sep } { , } - } -%<thesis> { \@@_define_name:nnn { zh } #1 } -%<!thesis> { \@@_define_name:nn #1 } -%</zh> -%<*en> -\clist_map_inline:nn - { -%<*thesis> - { univ } { Shanghai~ Jiao~ Tong~ University } , - { address } { Shanghai,~ P.R.~ China } , - { author } { Author } , - { supervisor } { Supervisor } , - { assoc_supervisor } { Assoc.\ Supervisor } , - { co_supervisor } { Co-supervisor } , - { title_page } { Title~ Page } , - { declaration } { Statutory~ Declaration } , - { abstract } { Abstract } , -%</thesis> - { keywords } { Key~words } , - { info_sep } { :~ } , - { item_sep } { ,~ } - } -%<thesis> { \@@_define_name:nnn { en } #1 } -%<!thesis> { \@@_define_name:nn #1 } -%</en> -%<*de> -\clist_map_inline:nn - { -%<*thesis> - { univ } { Shanghai~ Jiao~ Tong~ Universität } , - { address } { Shanghai,~ VR~ China } , - { author } { Autor/in } , - { supervisor } { Betreuer/in } , - { assoc_supervisor } { Zweitbetreuer/in } , - { co_supervisor } { Co-Betreuer/in } , - { title_page } { Titelblatt } , - { declaration } { Eidesstattliche~ Erklärung } , - { abstract } { Abstrakt } , -%</thesis> - { keywords } { Schlüsselwörter } , - { info_sep } { :~ } , - { item_sep } { ,~ } - } -%<thesis> { \@@_define_name:nnn { de } #1 } -%<!thesis> { \@@_define_name:nn #1 } -%</de> -%<*ja> -\clist_map_inline:nn - { -%<*thesis> - { univ } { 上海交通大学 } , - { address } { 中国・上海 } , - { author } { 氏名 } , - { supervisor } { 指導教員 } , - { assoc_supervisor } { 副指導教員 } , - { co_supervisor } { 共同指導 } , - { thesis } { 学位請求論文 } , - { title_page } { 標題紙 } , - { declaration } { 誓約書・公表許諾書 } , - { abstract } { 要 \protect \quad 旨 } , -%</thesis> - { keywords } { キーワード } , - { info_sep } { : \null } , - { item_sep } { \quad } - } -%<thesis> { \@@_define_name:nnn { ja } #1 } -%<!thesis> { \@@_define_name:nn #1 } -%</ja> -%<*thesis> -%<*zh> -\tl_const:Nn \c_@@_orig_decl_text_zh_tl - { - 本人郑重声明:所呈交的学位论文,是本人在导师的指导下,独立进行研究工 - 作所取得的成果。除文中已经注明引用的内容外,本论文不包含任何其他个人 - 或集体已经发表或撰写过的作品成果。对本文的研究做出重要贡献的个人和集 - 体,均已在文中以明确方式标明。本人完全知晓本声明的法律后果由本人承 - 担。 - } -\tl_const:Nn \c_@@_auth_decl_text_zh_tl - { - 本人同意学校保留并向国家有关部门或机构送交论文的复印件和电子版,允许 - 论文被查阅和借阅。 \par - \vskip 6 bp - \noindent - 本学位论文属于: \par - { \c_@@_symbol_white_square_tl } \textbf { 公开论文 } \par - { \c_@@_symbol_white_square_tl } \textbf { 内部论文 }, - 保密 { \c_@@_symbol_white_square_tl }~ 1~ 年 / - { \c_@@_symbol_white_square_tl }~ 2~ 年 / - { \c_@@_symbol_white_square_tl }~ 3~ 年, - 过保密期后适用本授权书。 \par - { \c_@@_symbol_white_square_tl } \textbf { 秘密论文 }, - 保密 \underline { \hspace { 2 em } } 年(不超过~ 10~ 年), - 过保密期后适用本授权书。 \par - { \c_@@_symbol_white_square_tl } \textbf { 机密论文 }, - 保密 \underline { \hspace { 2 em } } 年(不超过~ 20~ 年), - 过保密期后适用本授权书。 \par - \hspace { 6 em }(请在以上方框内选择打“ \ensuremath { \checkmark } ”) - } -\tl_const:Nn \c_@@_signature_text_zh_tl - { - 签名: \\ - 日期: \hspace { \stretch { 3 } } 年 - \hspace { \stretch { 2 } } 月 - \hspace { \stretch { 2 } } 日 - } -%</zh> -%</thesis> -%</name> -% \end{macrocode} -% -% \begin{macrocode} -%<*scheme> -\clist_map_inline:nn - { -%<*zh> - { assumption } { 假设 } , - { axiom } { 公理 } , - { conjecture } { 猜想 } , - { corollary } { 推论 } , - { definition } { 定义 } , - { example } { 例 } , - { exercise } { 练习 } , - { lemma } { 引理 } , - { problem } { 问题 } , - { proposition } { 命题 } , - { remark } { 注 } , - { solution } { 解 } , - { theorem } { 定理 } -%</zh> -%<*en> - { assumption } { Assumption } , - { axiom } { Axiom } , - { conjecture } { Conjecture } , - { corollary } { Corollary } , - { definition } { Definition } , - { example } { Example } , - { exercise } { Exercise } , - { lemma } { Lemma } , - { problem } { Problem } , - { proposition } { Proposition } , - { remark } { Remark } , - { solution } { Solution } , - { theorem } { Theorem } -%</en> -%<*de> - { assumption } { Annahme } , - { axiom } { Axiom } , - { conjecture } { Hypothese } , - { corollary } { Korollar } , - { definition } { Definition } , - { example } { Beispiel } , - { exercise } { Übung } , - { lemma } { Lemma } , - { problem } { Problem } , - { proposition } { Proposition } , - { remark } { Anmerkung } , - { solution } { Lösung } , - { theorem } { Theorem } -%</de> -%<*ja> - { assumption } { 仮定 } , - { axiom } { 公理 } , - { conjecture } { 予想 } , - { corollary } { 系 } , - { definition } { 定義 } , - { example } { 例 } , - { exercise } { 練習 } , - { lemma } { 補題 } , - { problem } { 問題 } , - { proposition } { 命題 } , - { remark } { 注意 } , - { solution } { 解法 } , - { theorem } { 定理 } -%</ja> - } - { \@@_define_name:nn #1 } -% \end{macrocode} -% -% \begin{macrocode} -%</scheme> -% \end{macrocode} -% % \end{implementation} % % \Finale diff --git a/macros/latex/contrib/sjtutex/sjtutex.pdf b/macros/latex/contrib/sjtutex/sjtutex.pdf Binary files differindex 1f99883c43..4b978d0b9e 100644 --- a/macros/latex/contrib/sjtutex/sjtutex.pdf +++ b/macros/latex/contrib/sjtutex/sjtutex.pdf diff --git a/macros/luatex/generic/penlightplus/penlightplus.lua b/macros/luatex/generic/penlightplus/penlightplus.lua index 848c4f9709..b982d45a0a 100644 --- a/macros/luatex/generic/penlightplus/penlightplus.lua +++ b/macros/luatex/generic/penlightplus/penlightplus.lua @@ -1,5 +1,5 @@ --% Kale Ewasiuk (kalekje@gmail.com) ---% 2025-01-18 +--% 2025-02-11 --% Copyright (C) 2021-2025 Kale Ewasiuk --% --% Permission is hereby granted, free of charge, to any person obtaining a copy @@ -1145,7 +1145,7 @@ penlight.tex.writePDFmetadata = function(t) -- write PDF metadata to xmpdata fil for k, v in pairs(t) do str = str..'\\'..k..'{'..v..'}'..'\n' end - penlight.utils.writefile(tex.jobname..'.xmpdata', str) + penlight.utils.writefile(tex.jobname:gsub('"','')..'.xmpdata', str) end diff --git a/macros/luatex/generic/penlightplus/penlightplus.pdf b/macros/luatex/generic/penlightplus/penlightplus.pdf Binary files differindex f9903b974d..0b5b2744dd 100644 --- a/macros/luatex/generic/penlightplus/penlightplus.pdf +++ b/macros/luatex/generic/penlightplus/penlightplus.pdf diff --git a/macros/luatex/generic/penlightplus/penlightplus.sty b/macros/luatex/generic/penlightplus/penlightplus.sty index eee51f29c9..f50ac14faf 100644 --- a/macros/luatex/generic/penlightplus/penlightplus.sty +++ b/macros/luatex/generic/penlightplus/penlightplus.sty @@ -1,5 +1,5 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2025-01-18 +% 2025-02-11 % Copyright (C) 2021-2025 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy @@ -22,7 +22,7 @@ % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE % OR OTHER DEALINGS IN THE SOFTWARE. -\ProvidesPackage{penlightplus}[2025-01-18] +\ProvidesPackage{penlightplus}[2025-02-11] \RequirePackage{luacode} \RequirePackage{luakeys} diff --git a/macros/luatex/generic/penlightplus/penlightplus.tex b/macros/luatex/generic/penlightplus/penlightplus.tex index fba8ba9e3e..09d63fbca5 100644 --- a/macros/luatex/generic/penlightplus/penlightplus.tex +++ b/macros/luatex/generic/penlightplus/penlightplus.tex @@ -1,5 +1,5 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2025-01-18 +% 2025-02-11 % Copyright (C) 2021-2025 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/macros/luatex/latex/yamlvars/yamlvars.lua b/macros/luatex/latex/yamlvars/yamlvars.lua index b63dabeccb..ca3fcac058 100644 --- a/macros/luatex/latex/yamlvars/yamlvars.lua +++ b/macros/luatex/latex/yamlvars/yamlvars.lua @@ -1,6 +1,6 @@ --% Kale Ewasiuk (kalekje@gmail.com) ---% 2024-08-17 ---% Copyright (C) 2021-2023 Kale Ewasiuk +--% 2025-02-11 +--% Copyright (C) 2021-2025 Kale Ewasiuk --% --% Permission is hereby granted, free of charge, to any person obtaining a copy --% of this software and associated documentation files (the "Software"), to deal @@ -28,6 +28,7 @@ YAMLvars = {} -- self table YAMLvars.yaml = require'tinyyaml' -- note: YAMLvars.sty will have checked existence of this already + YAMLvars.luakeys = require'luakeys'() -- note: YAMLvars.sty will have checked existence of this already local pl = penlight @@ -57,7 +58,7 @@ YAMLvars.setts.overwrite = false YAMLvars.setts.lowercase = false YAMLvars.setts.stripvars = true -- todo add this as an option accessible in latex YAMLvars.setts.tabmidrule = 'midrule' -YAMLvars.setts.prcstring = true +YAMLvars.setts.prcstring = 'number' YAMLvars.setts.xfm = {} YAMLvars.setts.prc = 'gdef' YAMLvars.setts.dft = '' @@ -296,6 +297,29 @@ end -- -- + +YAMLvars.curr_keyvals = {} +function YAMLvars.prc.keyvals(var, val) + YAMLvars.curr_keyvals[var] = val +end +function YAMLvars.callkeyvals() + for var, tbl in pairs(YAMLvars.curr_keyvals) do + local cmd = '\\'..var..'{' + for key, val in pairs(tbl) do + if tonumber(key) ~= nil then + cmd = cmd .. val + else + cmd = cmd .. key .. '=' .. val + end + cmd = cmd .. ',' + end + tex.sprint(cmd..'}') + end + YAMLvars.curr_keyvals = {} +end + + + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- function YAMLvars.makecmd(cs, val) -- provide command via lua @@ -427,7 +451,7 @@ local function transform_and_prc(var, val) YAMLvars.debugtalk('function: '..YAMLvars.varspecs[var]['prc']..'\nvariable: '.. var .. '\n' .. 'value: '.. tostring(val) .. '\nval type: ' ..type(val), "Applying processing (prc) function") - if YAMLvars.setts.prcstring then + if YAMLvars.setts.prcstring:find(type(val)) then val = tostring(val) end f(pl.stringx.strip(var), val) -- prc the value of the variable diff --git a/macros/luatex/latex/yamlvars/yamlvars.pdf b/macros/luatex/latex/yamlvars/yamlvars.pdf Binary files differindex ae8bb01507..3ae5f9a53b 100644 --- a/macros/luatex/latex/yamlvars/yamlvars.pdf +++ b/macros/luatex/latex/yamlvars/yamlvars.pdf diff --git a/macros/luatex/latex/yamlvars/yamlvars.sty b/macros/luatex/latex/yamlvars/yamlvars.sty index 8bc387a0f5..4d7203c018 100644 --- a/macros/luatex/latex/yamlvars/yamlvars.sty +++ b/macros/luatex/latex/yamlvars/yamlvars.sty @@ -1,6 +1,6 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2024-08-17 -% Copyright (C) 2021-2023 Kale Ewasiuk +% 2025-02-11 +% Copyright (C) 2021-2025 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy % of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,7 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{yamlvars}[2024-08-17] +\ProvidesPackage{yamlvars}[2025-02-11] \RequirePackage{luacode} \RequirePackage{etoolbox} @@ -37,6 +37,11 @@ \luadirect{YAMLvars = require('YAMLvars')} +\luadirect{ + if YAMLvars.yaml == nil then + tex.sprint('\\PackageError{yamlvars}{"tinyyaml.lua" not found. Install the "lua-tinyyaml" package from CTAN or include "tinyyaml.lua" in your project}{}') + end +} @@ -92,6 +97,9 @@ YAMLvars.xfmDefault = {'lb2nl','addxspace'} \luadirect{YAMLvars.setts2default()} +\NewDocumentCommand{\YAMLvarsSetKeyVals}{}{\luadirect{YAMLvars.callkeyvals()}} + + \newcommand{\declareYAMLvarsFile}[1]{\luadirect{YAMLvars.declareYAMLvarsFile(\luastring{#1})}} \NewDocumentCommand{\parseYAMLvarsFile}{m}{\luadirect{ YAMLvars.parseYAMLvarsFile(\luastring{#1}) @@ -110,7 +118,7 @@ YAMLvars.xfmDefault = {'lb2nl','addxspace'} {\luadirect{ penlight.tex.stoprecording() }} -\AfterEndEnvironment{parseYAMLvars}{\luadirect{YAMLvars.parseYAMLvarsStr(penlight.tex.recordedbuf)}} +\AfterEndEnvironment{parseYAMLvars}{\luadirect{YAMLvars.parseYAMLvarsStr(penlight.tex.recordedbuf)}\YAMLvarsSetKeyVals} % necessary hack to get rohead and lohead to work.. % .. https://tex.stackexchange.com/questions/637018/setting-koma-heading-within-lua/637021?noredirect=1#comment1587387_637021 diff --git a/macros/luatex/latex/yamlvars/yamlvars.tex b/macros/luatex/latex/yamlvars/yamlvars.tex index 3e08dc883d..0170fb3cdf 100644 --- a/macros/luatex/latex/yamlvars/yamlvars.tex +++ b/macros/luatex/latex/yamlvars/yamlvars.tex @@ -1,6 +1,6 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2024-08-17 -% Copyright (C) 2021-2023 Kale Ewasiuk +% 2025-02-11 +% Copyright (C) 2021-2025 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy % of this software and associated documentation files (the "Software"), to deal @@ -55,8 +55,26 @@ \usepackage[overwritedefs]{yamlvars} \yamlvarsdebugon -\title{YAMLvars} \subtitle{a YAML variable parser for LuaLaTeX} +\usepackage{geometry} +\begin{declareYAMLvars} + title: + prc: setdocvar + geometry: + prc: keyvals + writePDFmetadatakv: + prc: keyvals +\end{declareYAMLvars} + +\begin{parseYAMLvars} + title: YAMLvars + geometry: + left: 2in + right: 3in + writePDFmetadatakv: + title: yamlvars +\end{parseYAMLvars} + \begin{document} @@ -64,11 +82,8 @@ \maketitle -%%%%% - -%{NOTE::: \Huge todo use LTXexample and improve examples/testing\\ -%todo need way better error tracing for this pkg} +%todo need way better error tracing for this pkg} %%%%%%%%%%% @@ -130,7 +145,7 @@ like \cmd{undeclared} boolean for allowing parsing of undeclared vars \\ \cmd{overwrite} boolean for allowing overwriting of previous definitions \\ \cmd{lowercase} boolean for auto-changing vars to lowercase \\ -\cmd{prcstring} boolean for auto-converting final value before processing (sometimes) numbers can have odd effects \\ +\cmd{prcstring} a string with types (default 'number') for auto-converting final value before processing (sometimes) numbers can have odd effects. You might also include 'table' \\ %\cmd{tabmidrule} type of rule for tabu \\ \cmd{xfm} default xfm function(s) if none passed to declared key, separated by space \\ \cmd{prc} default prc function if none passed to declared key \\ @@ -404,34 +419,7 @@ Items: \clearpage \section{xfm, dec, prc functions (from yamlvars.lua)} -\lstinputlisting[linerange=111-315]{yamlvars.lua} - -% -%\AllowUndeclaredYV -%\luadirect{YAMLvars.xfmDefault={'lb2nl','addxspace'}} - -% -%\luadirect{YAMLvars.debug = true} -%\setYAMLvars{undeclared, xfm= lb2nl addxspace} -%\begin{parseYAMLvars} -%kale: |- -% kale -% eee -%\end{parseYAMLvars} -% -%\kale ee -% -%\setYAMLvars{undeclared, xfm=list2items} -%\begin{parseYAMLvars} -%lllist: -% - one -% - two -% - three -%\end{parseYAMLvars} -% -%\begin{itemize} -% \lllist -%\end{itemize} +\lstinputlisting[linerange=103-319]{yamlvars.lua} \end{document} |