whutug / whu-thesis

:memo: 武汉大学毕业论文 LaTeX 模版 2024
LaTeX Project Public License v1.3c
907 stars 200 forks source link

如何在导师栏目中添加多个导师并换行 #231

Closed wuchuanjun closed 8 months ago

wuchuanjun commented 8 months ago

检查

编译环境

描述问题

最小工作示例(MWE)

\documentclass{whu-thesis}
\begin{document}
Hello, \LaTex!
\end{document}

(用 XeLaTeX 编译后)输出

! Undefined control sequence.
l.3 Hello, \LaTex
                 !
?

链接

我还做了这些尝试

附件

SwitWu commented 8 months ago

本科的还是硕博的?

wuchuanjun commented 8 months ago

硕博,博士论文的模板

SwitWu commented 8 months ago

模版在设计时并没有考虑双导师的情形,你可以自己改一下文档类文件 whu-thesis.cls。找到下面这一行

\cs_new_protected:Npn \__whu_make_cover_master_doctor:

博士论文封面的代码是:

        \tl_if_eq:NnTF \g__whu_option_type_tl { doctor }
          {
            \__whu_spread_with:nn { 研究生姓名 } { \hfill } &
            \__whu_spread_with:nn
              { \g__whu_info_author_tl } { \hfill } \\ [ 0.5 em ]
            \__whu_spread_with:nn { 指导教师姓名、职称 } { \hfill } &
            \__whu_spread_with:nn
              { \clist_use:Nn \g__whu_info_advisor_clist { \quad } }
              { \hfill } \\ [ 0.5 em ]
            \__whu_spread_with:nn { 学科、专业名称 } { \hfill } &
            \__whu_spread_with:nn
              { \g__whu_info_subject_tl 、 \g__whu_info_major_tl }
              { \hfill } \\ [ 0.5 em ]
            \__whu_spread_with:nn { 研究方向 } { \hfill } &
            \__whu_spread_with:nn
              { \g__whu_info_direction_tl } { \hfill } \\ [ 0.5 em ]
          }

现在我们直接在这里加第二个导师,将上述代码改为:

        \tl_if_eq:NnTF \g__whu_option_type_tl { doctor }
          {
            \__whu_spread_with:nn { 研究生姓名 } { \hfill } &
            \__whu_spread_with:nn
              { \g__whu_info_author_tl } { \hfill } \\ [ 0.5 em ]
            \__whu_spread_with:nn { 指导教师姓名、职称 } { \hfill } &
            \__whu_spread_with:nn
              { \clist_use:Nn \g__whu_info_advisor_clist { \quad } }
              { \hfill } \\ [ 0.5 em ]
            \multicolumn{1}{c}{}  
            & \__whu_spread_with:nn
                { \clist_use:nn {李四, 教授} { \quad } }
                { \hfill } \\ [ 0.5em ]
            \__whu_spread_with:nn { 学科、专业名称 } { \hfill } &
            \__whu_spread_with:nn
              { \g__whu_info_subject_tl 、 \g__whu_info_major_tl }
              { \hfill } \\ [ 0.5 em ]
            \__whu_spread_with:nn { 研究方向 } { \hfill } &
            \__whu_spread_with:nn
              { \g__whu_info_direction_tl } { \hfill } \\ [ 0.5 em ]
          }

主文件保持不变,编译后的效果为

image
wuchuanjun commented 8 months ago

perfect!!!