From d6747f52ad4ea07c696eadab957f0ab3f464a6fc Mon Sep 17 00:00:00 2001 From: "Casper Ti. Vector" Date: Thu, 25 Mar 2021 01:54:45 +0800 Subject: [PATCH] Fix misuse of \newline in centring mode. --- doc/example/thesis.tex | 2 +- doc/readme/chap/pkuthss-chap2.tex | 11 +++++++---- doc/readme/chap/pkuthss-chap3.tex | 4 ++-- doc/readme/pkuthss.tex | 4 ++-- tex/pkuthss.cls | 4 +++- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/doc/example/thesis.tex b/doc/example/thesis.tex index 7da9486..30bc89d 100644 --- a/doc/example/thesis.tex +++ b/doc/example/thesis.tex @@ -36,7 +36,7 @@ \pkuthssinfo{ cthesisname = {博士学位论文}, ethesisname = {Doctor Thesis}, thesiscover = {博士研究生学位论文}, - % 长标题可用 \newline 强制换行,不能用“\\”(双盲版会出错)。 + % 长标题可用 \thssnl 强制换行,不能用“\\”(双盲版会出错)。 ctitle = {测试文档}, etitle = {Test Document}, cauthor = {某某}, eauthor = {Test}, date = {某年某月}, diff --git a/doc/readme/chap/pkuthss-chap2.tex b/doc/readme/chap/pkuthss-chap2.tex index 67533f8..5d2f911 100644 --- a/doc/readme/chap/pkuthss-chap2.tex +++ b/doc/readme/chap/pkuthss-chap2.tex @@ -150,7 +150,7 @@ \end{Verbatim} \section{pkuthss 文档类提供的命令和环境} -\subsection{设定文档信息的命令} +\subsection{设定文档信息的命令}\label{ssec:set-cmd} 这一类命令的语法为 \begin{Verbatim} @@ -160,9 +160,9 @@ 这些命令总结如下: \begin{itemize} \item \texttt{\bfseries\string\ctitle}:设定论文中文标题\footnote{% - 因为 pkuthss 内部实现机制的缘故,% - \myemph{双盲版论文的(中文和西文)标题如须强制换行,必须使用 - \texttt{\string\newline} 而非 \texttt{\string\\}},否则会出错。% + 因为 pkuthss 内部实现机制的缘故,\myemph{双盲版论文的(中文和西文) + 标题如须强制换行,必须使用 pkuthss 提供的 \texttt{\string\thssnl} + 命令而非 \texttt{\string\\}},否则会出错。% }; \item \texttt{\bfseries\string\etitle}:设定论文西文标题; \item \texttt{\bfseries\string\cauthor}:设定作者的中文名; @@ -270,6 +270,9 @@ 此时就须要在设定完文档信息之后调用 \verb|\setpdfproperties|。% \myemph{注意:须要启用 \texttt{pdfprop} 选项才能使用此命令。} +\texttt{\bfseries\string\thssnl} 命令用于在双盲版论文的(中文和西文)标题中 +强制换行,见第 \ref{ssec:set-cmd} 小节中关于 \verb|\ctitle| 说明的脚注。 + \section{从其它文档类和宏包继承的功能}\label{sec:thirdparty} pkuthss 文档类建立在 ctexbook\cupercite{ctex} 文档类之上, diff --git a/doc/readme/chap/pkuthss-chap3.tex b/doc/readme/chap/pkuthss-chap3.tex index ae0ccfa..b5482a0 100644 --- a/doc/readme/chap/pkuthss-chap3.tex +++ b/doc/readme/chap/pkuthss-chap3.tex @@ -33,8 +33,8 @@ 文档默认情况下是双面模式,章末可能产生空白页, 解决方式见第 \ref{sec:options} 节。 -双盲版论文的(中文和西文)标题只能使用 \verb|\newline| -而非 \verb|\\| 换行,见第 \ref{sec:options} 节。 +双盲版论文的(中文和西文)标题只能使用 pkuthss 提供的 +\verb|\thssnl| 命令而非 \verb|\\| 换行,见第 \ref{sec:options} 节。 通过一些设置,还可以满足例如被引用的文献按照引用顺序排序, 而未引用的文献按照西文文献在前、中文文献在后排序这样的需求, diff --git a/doc/readme/pkuthss.tex b/doc/readme/pkuthss.tex index f523a3a..50d140d 100644 --- a/doc/readme/pkuthss.tex +++ b/doc/readme/pkuthss.tex @@ -54,10 +54,10 @@ \newcommand*{\docversion}{v1.8.3} \pkuthssinfo{ cthesisname = {本科生毕业论文}, ethesisname = {Undergraduate Thesis}, - ctitle = {北京大学学位论文模版\newline{}pkuthss \docversion}, + ctitle = {北京大学学位论文模版{\thssnl}pkuthss \docversion}, etitle = {% PKU dissertation document class% - \texorpdfstring{\newline}{: }pkuthss \docversion% + \texorpdfstring{\thssnl}{: }pkuthss \docversion% }, cauthor = {盖茨波·钛·维克托}, eauthor = {Casper Ti.\ Vector}, date = {\zhdigits{2020}年\zhnumber{11}月}, diff --git a/tex/pkuthss.cls b/tex/pkuthss.cls index 942e506..e48906e 100644 --- a/tex/pkuthss.cls +++ b/tex/pkuthss.cls @@ -252,6 +252,8 @@ \thss@int@infoitemb{eabstractname} % Set up document information using the `key = value' grammar. \newcommand*{\pkuthssinfo}[1]{\setkeys{thss@info}{#1}} +% Becomes \newline in the \makeblind scope. +\newcommand{\thssnl}{\\} % Set up page layout. \geometry{a4paper, hmargin = 2.6cm, headheight = 0.5cm, headsep = 0.6cm} @@ -404,7 +406,7 @@ % Typeset the title page for double-blind review. \newcommand{\makeblind}{% \thss@int@pdfmark{\titlepagename}{titlepage} - \begin{titlepage}\begingroup + \begin{titlepage}\begingroup\renewcommand{\thssnl}{\newline} \centering\zihao{3}\selectfont\fangsong\vspace*{0.5cm} {\zihao{-0}\heiti\cuniversity\cthesisname}\\[0.36\baselineskip] {\zihao{-2}\fangsong\label@blindcover}%