From 467b00040fe6d3809979d537faa6d55cfe53a719 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 14 Feb 2021 22:32:36 +0000 Subject: shtthesis (14feb21) git-svn-id: svn://tug.org/texlive/trunk@57740 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md | 7 +++ Master/texmf-dist/doc/latex/shtthesis/LICENSE | 4 +- Master/texmf-dist/doc/latex/shtthesis/README.md | 4 +- .../doc/latex/shtthesis/shtthesis-user-guide.pdf | Bin 2172646 -> 2173716 bytes .../doc/latex/shtthesis/shtthesis-user-guide.tex | 20 +++---- .../texmf-dist/tex/latex/shtthesis/shtthesis.cls | 59 +++++++++++++-------- 6 files changed, 57 insertions(+), 37 deletions(-) diff --git a/Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md b/Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md index 9dd9f07ef47..73356830a7a 100644 --- a/Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/shtthesis/CHANGELOG.md @@ -2,6 +2,13 @@ `sht-thesis` 项目派生于 `ucasthesis`,一个在 GPLv3 License 下分发的项目。根据该许可证条款,`sht-thesis` 项目列出基于 `ucasthesis` (commit `faad94b` 之后) 的所有修改条目: +## 2021-02-14 +> Release: v0.3.2 + +1. 修复 TexLive 2020 宏包升级后 ulem 的兼容性问题,使用更为鲁棒的 lastpage 实现本科生论文*第X页 共Y页*的排版需求; +2. 更新文档内校徽文件下载链接; +3. 修复 issue [#1](https://github.com/lirundong/shtthesis/issues/1) 关于本科生论文格式的问题; + ## 2020-06-30 > Release: v0.3.1 diff --git a/Master/texmf-dist/doc/latex/shtthesis/LICENSE b/Master/texmf-dist/doc/latex/shtthesis/LICENSE index cec6f6b1f8b..633be1564f5 100644 --- a/Master/texmf-dist/doc/latex/shtthesis/LICENSE +++ b/Master/texmf-dist/doc/latex/shtthesis/LICENSE @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. shtthesis, an unofficial LaTeX thesis template for ShanghaiTech University. - Copyright (C) 2020 Li Rundong + Copyright (C) 2021 Li Rundong This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - shtthesis Copyright (C) 2020 Li Rundong + shtthesis Copyright (C) 2021 Li Rundong This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/Master/texmf-dist/doc/latex/shtthesis/README.md b/Master/texmf-dist/doc/latex/shtthesis/README.md index 794511d3f2c..48ef2f9c5f0 100644 --- a/Master/texmf-dist/doc/latex/shtthesis/README.md +++ b/Master/texmf-dist/doc/latex/shtthesis/README.md @@ -31,7 +31,7 @@ tlmgr update shtthesis ``` - **Note**: `shtthesis` package on CTAN does not include the university logo file. Please download [`shanghaitech-logo.pdf`](https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf) from this repository and put it in the root of your project directory. + **Note**: `shtthesis` package on CTAN does not include the university logo file. Please download [`shanghaitech-emblem.pdf`](https://github.com/lirundong/shtthesis/raw/master/shanghaitech-emblem.pdf) from this repository and put it in the root of your project directory. - [Overleaf](https://www.overleaf.com/latex/templates/shanghaitech-university-thesis-template/mskbxkmfxqpt): Please compile with XeLaTeX. Since compilation time for Overleaf free-plan is limited to *1 minute*, you might encounter with timeout issue if compiling with LuaLaTeX - GitHub Release: Please refer to the [release](https://github.com/lirundong/sht-thesis/releases) page and download required files based on release information - Develop version: Directly clone the GitHub repo @@ -57,5 +57,5 @@ After cloning or downloading this template, please 2. Open the document source file [shtthesis-user-guide.tex](shtthesis-user-guide.tex) and enjoy TeXing :smirk: ## License -- The copyright of ShanghaiTech University logo (`shanghaitech-logo.pdf`) is owned by ShanghaiTech University +- The copyright of ShanghaiTech University logo (`shanghaitech-emblem.pdf`) is owned by ShanghaiTech University - The rest of `shtthesis` project is licensed under GNU Public License v3, see [LICENSE](LICENSE) for details diff --git a/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.pdf b/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.pdf index 3badd9ad136..5a51b6aa2de 100644 Binary files a/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.pdf and b/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.pdf differ diff --git a/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.tex b/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.tex index 16e951a3ff4..ae0ff1d4c00 100644 --- a/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.tex +++ b/Master/texmf-dist/doc/latex/shtthesis/shtthesis-user-guide.tex @@ -1,5 +1,5 @@ % shtthesis, an unofficial LaTeX thesis template for ShanghaiTech University. -% Copyright (C) 2020 Li Rundong +% Copyright (C) 2021 Li Rundong % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -44,8 +44,8 @@ % title* = {A~User's~Guide~to\\\ShtThesis{}~v\version{}}, % keywords = {上海科技大学,学位论文,\LaTeX{}}, % keywords* = {ShanghaiTech~University, Thesis, \LaTeX{}}, -% date = {2020~年~06~月}, -% date* = {06~/~2020}, +% date = {2021~年~02~月}, +% date* = {02~/~2021}, % author = {李润东}, % author* = {Rundong~Li}, % author-id = {36273800}, @@ -268,7 +268,7 @@ 本文档将尽量详细地阐释 \shtthesis{} 的使用方法和技巧。同时本文档直接使用 \shtthesis{} 排版,其源代码文件 \jobname.tex 也可以作为一个实际样例以供读者参考使用。 -我们计划在 \shtthesis{} 后续版本中加入本科学位论文的排版选项,因此亟需有上海科技大学本科论文排版经验的同学参与到 \shtthesis{} 项目中。我们也计划将该使用说明和模板文件 shtthesis.cls 使用 \textsf{DocStrip} 统一重构,并逐步向 \LaTeX3 迁移。我们非常希望得到用户宝贵的反馈和建议,若您有意为 \shtthesis{} 贡献 issues 和 pull requests,请移步至项目主页 \url{https://github.com/lirundong/shtthesis}。 +目前 \shtthesis{} 已\emph{试验性地}加入对本科学位论文的支持,但仍亟需有上海科技大学本科论文排版经验的同学参与到 \shtthesis{} 项目中。我们也计划将该使用说明和模板文件 shtthesis.cls 使用 \textsf{DocStrip} 统一重构,并逐步向 \LaTeX3 迁移。我们非常希望得到用户宝贵的反馈和建议,若您有意为 \shtthesis{} 贡献 issues 和 pull requests,请移步至项目主页 \url{https://github.com/lirundong/shtthesis}。 \section*{文档排版样式说明} 本文档针对各部分不同内容使用不同的排版样式:文档正文使用宋体和英文衬线体(serif),\emph{强调部分}使用\emph{楷体}和英文意大利体(\emph{italic}),宏包名称使用英文无衬线体(\textsf{sans serif},例如 \textsf{hyperref}),代码及选项使用英文等宽体(\texttt{typewriter})和\texttt{仿宋体}排版。 @@ -293,7 +293,7 @@ `\prompt' tlmgr update shtthesis \end{shell} -为避免版权问题,上传至 CTAN 的 \shtthesis{} 并不包含校徽文件,需要至项目主页下载 shanghaitech-logo.pdf\footnote{\url{https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf}}。假设用户的论文文档为 thesis.tex,参考文献数据库为 reference.bib (本文档的 bib 数据库由 \jobname.tex 自动生成),则需要将下载的校徽文件与它们放在同一目录下,下文称为\emph{工作目录}。工作目录中必要的文件包括: +为避免版权问题,上传至 CTAN 的 \shtthesis{} 并不包含校徽文件,需要至项目主页下载 shanghaitech-emblem.pdf\footnote{\url{https://github.com/lirundong/shtthesis/raw/master/shanghaitech-emblem.pdf}}。假设用户的论文文档为 thesis.tex,参考文献数据库为 reference.bib (本文档的 bib 数据库由 \jobname.tex 自动生成),则需要将下载的校徽文件与它们放在同一目录下,下文称为\emph{工作目录}。工作目录中必要的文件包括: \begin{center} \begin{tabular}{ll} \toprule @@ -301,7 +301,7 @@ \midrule thesis.tex & 论文文档 \\ reference.bib & 参考文献数据库 \\ - shanghaitech-logo.pdf & 上海科技大学校徽 \\ + shanghaitech-emblem.pdf & 上海科技大学校徽 \\ \bottomrule \end{tabular} \end{center} @@ -604,7 +604,7 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} \end{align} 同时重载了 \verb|\eqref|,使得公式编号格式修改后,其引用格式仍与 \textsf{amsmath} 无异:贝叶斯定理~\eqref{eq::bayesian}。排版本科生论文时不修改公式编号格式。 -\shtthesis{} 使用 \textsf{unicode-math} 宏包进行公式排版,因此在数学环境内既可以用标准 \LaTeX{} 宏,也可以直接输入 Unicode 符号。例如 $\oiint$ 符号可以通过 \verb|\oiint| 宏录入,也可以通过 Unicode 符号 $∯$ (对应 \verb|U+0222F| 码点) 录入。以下测试公式来自 \citet{clerkma2013unicode},其中所有字符均直接使用对应 Unicode 符号录入。 +\shtthesis{} 使用 \textsf{unicode-math} 宏包进行公式排版,因此在数学环境内既可以用标准 \LaTeX{} 宏,也可以直接输入 Unicode 符号。例如 $\oiint$ 符号可以通过 \verb|$\oiint$| 录入,也可以直接使用 Unicode 符号 \verb|$|$∯$\verb|$| (对应 \verb|U+0222F| 码点) 录入。以下测试公式来自 \citet{clerkma2013unicode},其中所有字符均直接使用对应 Unicode 符号录入。 \begin{align} & ⊢ ∀x[(Fx ∨ Gx) → \mathord{∼}Hx] \\ & ⊨ ¬∃y∀x[x∈y ↔ x∉x] \\ @@ -733,13 +733,13 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} 《规范》要求正文中所有图形、表格标题使用中英双语。此需求可以通过 \textsf{bicaption} 宏包实现,如图~\ref{img::sht_logo} 所示。 \begin{figure}[htb] \centering - \IfFileExists{shanghaitech-logo.pdf}{% - \includegraphics[width=0.5\columnwidth]{shanghaitech-logo.pdf}% + \IfFileExists{shanghaitech-emblem.pdf}{% + \includegraphics[width=0.5\columnwidth]{shanghaitech-emblem.pdf}% }{% \fbox{% \begin{minipage}[b][2.5cm][c]{0.75\columnwidth}% \centering\zihao{-5}\bfseries\sffamily\color{ShtRed}% - 校徽文件 \texttt{shanghaitech-logo.pdf} 缺失% + 校徽文件 \texttt{shanghaitech-emblem.pdf} 缺失% \end{minipage}% }% }% diff --git a/Master/texmf-dist/tex/latex/shtthesis/shtthesis.cls b/Master/texmf-dist/tex/latex/shtthesis/shtthesis.cls index 1d616c240c2..d1bcc8fcdc4 100644 --- a/Master/texmf-dist/tex/latex/shtthesis/shtthesis.cls +++ b/Master/texmf-dist/tex/latex/shtthesis/shtthesis.cls @@ -1,5 +1,5 @@ % shtthesis, an unofficial LaTeX thesis template for ShanghaiTech University. -% Copyright (C) 2020 Li Rundong +% Copyright (C) 2021 Li Rundong % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -17,8 +17,8 @@ % Identification % ============================================================================== \NeedsTeXFormat{LaTeX2e} -\newcommand\version{0.3.1} -\newcommand\versiondate{2020/06/30} +\newcommand\version{0.3.2} +\newcommand\versiondate{2021/01/23} \ProvidesClass{shtthesis}[% \versiondate\space% v\version\space% @@ -313,7 +313,7 @@ \RequirePackage{indentfirst} \RequirePackage[normalem]{ulem} \RequirePackage{fancyhdr} -\RequirePackage{pageslts} +\RequirePackage{lastpage} \RequirePackage{tocvsec2} \RequirePackage{letltxmacro} \RequirePackage{fontspec} @@ -373,7 +373,7 @@ \definecolor{ShtRed}{RGB}{146,46,23} \def\school@logo@missing{% 校徽文件缺失,请至\href{https://github.com/lirundong/shtthesis/raw/master/% - shanghaitech-logo.pdf}{项目主页}下载!% + shanghaitech-emblem.pdf}{项目主页}下载!% } % ------------------------------------------------------------------------------ % Geometry and layouts @@ -418,11 +418,14 @@ % ------------------------------------------------------------------------------ % Headers and footers % ------------------------------------------------------------------------------ -\def\sht@flat@title{\renewcommand\\{\space} \@title} -\def\sht@flat@title@en{\renewcommand\\{\space} \sht@title@en} +\def\sht@flat@title{\renewcommand\\{\space} \sht@title} +\def\sht@flat@title@upper@en{% + \renewcommand\\{\space}% + \MakeUppercase{\sht@title@en}% +} \newcommand\sht@head@logo{% - \IfFileExists{shanghaitech-logo.pdf}{% - \includegraphics[height=\sht@head@logo@height]{shanghaitech-logo.pdf}% + \IfFileExists{shanghaitech-emblem.pdf}{% + \includegraphics[height=\sht@head@logo@height]{shanghaitech-emblem.pdf}% }{% \fbox{% \begin{minipage}[b][\sht@head@logo@height][c]{0.4\columnwidth}% @@ -475,7 +478,7 @@ \fancyhead[R]{\zihao{-5}\sffamily\sht@flat@title} \fancyfoot[C]{% \footnotesize% - 第~\thepage~页\hspace*{1\ccwd}共~\lastpageref*{VeryLastPage}~页% + 第~\thepage~页\hspace*{1\ccwd}共~\pageref*{LastPage}~页% } \renewcommand{\headrulewidth}{0.8pt} \renewcommand{\footrulewidth}{0pt} @@ -494,16 +497,14 @@ \LetLtxMacro{\TmpMainmatter}{\mainmatter} \renewcommand{\mainmatter}{% \TmpMainmatter% + \renewcommand{\chaptermark}[1]{% + \markboth{第~\thechapter~章\hspace{1\ccwd}##1}{}% + }% \ifsht@undergraduate% \pagestyle{MNNumberedWithLogo}% \else% \pagestyle{LRNumbered}% \fi% - \pagenumbering{arabic}% - \setcounter{page}{1}% -} -\AtBeginDocument{% - \pagenumbering{arabic}% } % ------------------------------------------------------------------------------ % Font utilities @@ -1095,8 +1096,8 @@ } \ExplSyntaxOff \newcommand\sht@schoollogo{% - \IfFileExists{shanghaitech-logo.pdf}{% - \includegraphics[width=10.48cm]{shanghaitech-logo.pdf}% + \IfFileExists{shanghaitech-emblem.pdf}{% + \includegraphics[width=10.48cm]{shanghaitech-emblem.pdf}% }{% \begin{center}% \fbox{% @@ -1109,8 +1110,8 @@ } \newcommand\sht@schoollogo@undergraduate{% \noindent% - \IfFileExists{shanghaitech-logo.pdf}{% - \includegraphics[width=5.39cm]{shanghaitech-logo.pdf}% + \IfFileExists{shanghaitech-emblem.pdf}{% + \includegraphics[width=5.39cm]{shanghaitech-emblem.pdf}% }{% \fbox{% \begin{minipage}[t][1.45cm][c]{0.75\columnwidth}% @@ -1517,7 +1518,7 @@ 毕业论文(设计)。 \hspace*{6\ccwd}\textbf{保\hspace*{1\ccwd}密}$\square$,% - 在\uline{\hspace*{2\ccwd}}年解密后适用本授权书。 + 在\uline{\mbox{\hspace*{2\ccwd}}}年解密后适用本授权书。 本论文属于 @@ -1565,8 +1566,15 @@ \end{center}% \vspace*{\baselineskip}% \ctexset{chapter/format += \zihao{4}, chapter/beforeskip = 0pt}% + \ifsht@comfort% + \def\sht@abstract@name{摘\hspace{1\ccwd}要} + \else% + \def\sht@abstract@name{摘要} + \fi + \else% + \def\sht@abstract@name{摘\hspace{1\ccwd}要} \fi - \intobmk\chapter*{摘\hspace{1\ccwd}要}% + \intobmk\chapter*{\sht@abstract@name}% }{% \vspace{\baselineskip}% \ifsht@undergraduate% @@ -1582,7 +1590,7 @@ \newenvironment{abstract*}[1][\sht@null@arg]{% \cleardoublepage% \ifthenelse{\equal{#1}{flattitle}}{% - \def\sht@abs@title@en{\sht@flat@title@en}% + \def\sht@abs@title@en{\sht@flat@title@upper@en}% }{% \def\sht@abs@title@en{\sht@title@en}% }% @@ -1594,8 +1602,10 @@ \end{center}% \vspace*{\baselineskip}% \ctexset{chapter/format += \zihao{4}\rmfamily, chapter/beforeskip = 0pt}% + \intobmk\chapter*{ABSTRACT}% + \else + \intobmk\chapter*{Abstract}% \fi - \intobmk\chapter*{Abstract}% }{% \vspace{\baselineskip}% \ifsht@undergraduate% @@ -1676,6 +1686,9 @@ \renewcommand{\backmatter}{% \origin@backmatter% \settocdepth{chapter}% + \renewcommand{\chaptermark}[1]{% + \markboth{##1}{}% + }% \ifsht@undergraduate% \pagestyle{MNNumberedWithLogo}% \else% -- cgit v1.2.3