Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问指导教师这个小栏目如何改成多行? #60

Closed
ArcturusZhang opened this issue Mar 17, 2019 · 9 comments
Closed

请问指导教师这个小栏目如何改成多行? #60

ArcturusZhang opened this issue Mar 17, 2019 · 9 comments

Comments

@ArcturusZhang
Copy link

例如希望两位导师能够并列于此栏位,希望能够让标题页上的指导教师后面能够多行显示,每行一个名字。
我尝试了一下直接使用

supervisor = {某某某\quad 教授 \\ 某某某\quad 教授}

是不能通过编译的。
那么这种该如何操作呢?感谢~

@stone-zeng
Copy link
Owner

目前不支持这个功能,只能硬改了:

% 放在导言区
\ExplSyntaxOn
\cs_set_protected:Npn \__fdu_cover_info:
  {
    \begin{minipage} [ c ] { \textwidth }
      \centering \zihao { 4 }
      \clist_set:Nx \l__fdu_tmpb_clist
        {
          { \l__fdu_info_department_tl },
          { \l__fdu_info_major_tl      },
          { \l__fdu_info_author_tl     },
          { \l__fdu_info_supervisor_tl },
          { \l__fdu_info_date_tl       }
        }
      \__fdu_get_max_text_width:NN \l__fdu_tmpb_dim \l__fdu_tmpb_clist

      \__fdu_spread_box:nn { 6 em } { \c__fdu_name_department_tl } \c__fdu_fullwidth_colon_tl
      \__fdu_center_box:Vn \l__fdu_tmpb_dim { \l__fdu_info_department_tl }
      \skip_vertical:n { 1 ex }

      \__fdu_spread_box:nn { 6 em } { \c__fdu_name_major_tl      } \c__fdu_fullwidth_colon_tl
      \__fdu_center_box:Vn \l__fdu_tmpb_dim { \l__fdu_info_major_tl      }
      \skip_vertical:n { 1 ex }

      \__fdu_spread_box:nn { 6 em } { \c__fdu_name_author_tl     } \c__fdu_fullwidth_colon_tl
      \__fdu_center_box:Vn \l__fdu_tmpb_dim { \l__fdu_info_author_tl     }
      \skip_vertical:n { 1 ex }

      % 第一行
      \__fdu_spread_box:nn { 6 em } { \c__fdu_name_supervisor_tl } \c__fdu_fullwidth_colon_tl
      \__fdu_center_box:Vn \l__fdu_tmpb_dim { 某某某 \quad\quad 授 }
      \skip_vertical:n { 1 ex }

      % 第二行
      \__fdu_spread_box:nn { 6 em } {  } \phantom { \c__fdu_fullwidth_colon_tl }
      \__fdu_center_box:Vn \l__fdu_tmpb_dim { 某 \quad\quad 研究员 }
      \skip_vertical:n { 1 ex }

      \__fdu_spread_box:nn { 6 em } { \c__fdu_name_date_tl       } \c__fdu_fullwidth_colon_tl
      \__fdu_center_box:Vn \l__fdu_tmpb_dim { \l__fdu_info_date_tl       }
      \skip_vertical:n { 1 ex }
    \end{minipage}
  }
\ExplSyntaxOff

image

名字、职称的对齐需要手动处理,但还是可能会出问题。

@ArcturusZhang
Copy link
Author

太强了,感谢~

@prlWanted
Copy link

曾同学,很感谢你写的这个模板。我也碰到和ufo同学一样的问题,但是我把你这段代码加入导言区之后编译还是通不过,请问是为啥啊?报错undefined control。谢谢

@stone-zeng
Copy link
Owner

具体的报错信息可以提供一下吗?比如哪个命令 undefined?

@prlWanted
Copy link

prlWanted commented Jun 10, 2019

不好意思,是这个:

! Undefined control sequence.
\__fdu_cover_info: ...}\c__fdu_fullwidth_colon_tl 
                                                  \__fdu_center_box:Vn \l__f...
l.72 \begin{document}

@stone-zeng
Copy link
Owner

\c__fdu_fullwidth_colon_tl 这个命令被重命名为了 \c__fdu_fwid_colon_tl,上面的代码里面把它替换掉。

@prlWanted
Copy link

成功了,非常感谢!

stone-zeng added a commit that referenced this issue Feb 5, 2023
@stone-zeng
Copy link
Owner

f5560dd 之后可以直接用 \parbox 插入多行内容:

supervisor = {
  % 7em = 包含空格的总宽度,根据具体情况调整
  \parbox[t]{7em}{
    % 可用 \quad 手工对齐,也可用 \centering 之类的命令
    某某某\quad\quad\\
    % \\[1ex] 用来调整间距\quad\quad 研究员 \\[1ex]
  }
},

@LucifierZ
Copy link

LucifierZ commented Feb 9, 2023

请问新方案是直接就能用吗?直接改好像会报错

f5560dd 之后可以直接用 \parbox 插入多行内容:

supervisor = {
  % 7em = 包含空格的总宽度,根据具体情况调整
  \parbox[t]{7em}{
    % 可用 \quad 手工对齐,也可用 \centering 之类的命令
    某某某\quad     教\quad 授 \\
    % \\[1ex] 用来调整间距
    某\quad 某\quad 研究员 \\[1ex]
  }
},

发现是dev里版本,刚用github不是很熟不好意思

@stone-zeng stone-zeng added this to the v0.9 milestone Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants