sikouhjw / gdutthesis

广东工业大学 LaTeX 论文模板
LaTeX Project Public License v1.3c
223 stars 38 forks source link

标题出现字数多字数直接换页问题 #19

Closed ZJMHub closed 2 years ago

ZJMHub commented 2 years ago

你好,我发现当标题出现字数过多时,不是实现换行功能,而是直接换页的问题,这是字体问题还是需要调整哪个格式? image

sikouhjw commented 2 years ago

是模板的 bug,标题换行后,当页放不下,就放下一页去了。

解决方案:在导言区加上

\ExplSyntaxOn
\makeatletter
\cs_set:Npn \gdutmaketitle {
  \__gdut_background_type:
  \frontmatter\pagestyle{empty}\pagenumbering{Alph}
  \bool_if:NTF \l__gdut_cover_bool
  {
    \gdutcover
    \linespread{\ZhLS@bodylinespread}\selectfont
  }
  { }
  \vspace*{0.4\baselineskip-1.5pt}
  \begingroup \centering
    \begin{tabular}{>{\zihao{4}}r@{\hspace*{8\ccwd}}>{\zihao{4}\raggedright\arraybackslash}p{6\ccwd}@{\hspace*{6\ccwd}}>{\zihao{4}}p{12\ccwd}}
      分类号: &        & 学校代号:11845 \\[5pt]
      UDC:    & 密级:\bool_if:NT \l__gdut_secret_bool {\l__gdut_info_secret_level_tl} & 学\hspace*{2\ccwd}号:\l__gdut_info_student_id_tl
    \end{tabular}
  \par \endgroup
  \vspace*{1.5\baselineskip+4pt}
  \begingroup \centering\bfseries\zihao{-2} 广东工业大学 \__gdut_thesis_type: 论文\par \endgroup
  \begingroup \centering\zihao{4} ( \l__gdut_info_degree_tl ) \par \endgroup
  \vspace*{0.8\baselineskip+0.75pt}
  \begingroup \centering\sffamily\zihao{2} \l__gdut_info_title_tl\par \endgroup
  \vspace*{\baselineskip+5.75pt}
  \begingroup \centering\zihao{3} \l__gdut_info_author_tl\par \endgroup
  \vspace*{7\baselineskip}
  \begingroup \centering\zihao{4}
  \begin{tabular}{c>{\centering\arraybackslash}p{14\ccwd}}
    \multirow{1}*{
      \begin{CJKfilltwosides*}{11.3\ccwd}
        导师姓名(职称):
      \end{CJKfilltwosides*}
    } & \l__gdut_info_supervisor_tl \\
    \cline{2-2}
    \str_if_eq:NNTF \l__gdut_info_supervisor_two_tl {none}
    {}
    {& \l__gdut_info_supervisor_two_tl \\
    \cline{2-2}}
    \multirow{4}*{
      \begin{CJKfilltwosides*}{0pt}
        学科(专业)或领域名称:\\
        学生所属学院:\\
        答辩委员会主席:\\
        论文答辩日期:
      \end{CJKfilltwosides*}
    }
    & \l__gdut_info_major_tl \\
    \cline{2-2}
    & \l__gdut_info_department_tl \\
    \cline{2-2}
    & \l__gdut_info_chairman_clist \\
    \cline{2-2}
    & \exp_args:No \zhdate{\l__gdut_info_date_tl} \\
    \cline{2-2}
  \end{tabular}
  \par \endgroup
  \newpage
  \begingroup \centering\zihao{4}
    A~Dissertation~Submitted~to~Guangdong~University~of~Technology\\[-0.15\baselineskip] for~the~Degree~of~\__gdut_thesis_en_type:
  \par \endgroup
  \begingroup \centering\zihao{-4} (\l__gdut_info_degree_en_tl) \par \endgroup
  \vspace*{2\baselineskip}
  \begingroup \centering\zihao{-2}\sffamily
    \l__gdut_info_title_en_tl
  \par \endgroup
  \vspace*{6\baselineskip}
  \begingroup \centering\zihao{-3}\sffamily
    Candidate:~\l__gdut_info_author_en_tl\\
    Supervisor:~\l__gdut_info_supervisor_en_tl
  \par \endgroup
  \vspace*{9\baselineskip}
  \begingroup \centering\zihao{-4}\sffamily\linespread{1.15}\selectfont
    \exp_args:No \engdate{\l__gdut_info_date_tl}\\
    School~of~\l__gdut_info_department_en_tl\\
    Guangdong~University~of~Technology\\
    Guangzhou,~Guangdong,~P.~R.~China,~510006
  \par \endgroup
  \if@openright \cleardoublepage \else \clearpage \fi
  \pagestyle{fancy}
}
\makeatother
\ExplSyntaxOff
sikouhjw commented 2 years ago

纵向间距这部分,当初是手动设置成跟 Word 差不多效果的,代码实现差了点,以后用 xtemplate 重构好了,也方便修改。

sikouhjw commented 2 years ago

如果上面那段代码报错,就下载最新版^1,然后替换一下 cls 就行了

ZJMHub commented 2 years ago

如果上面那段代码报错,就下载最新版1,然后替换一下 cls 就行了

Footnotes

  1. https://github.com/sikouhjw/gdutthesis/releases/latest 好的,谢谢~已解决了