Skip to content

Commit

Permalink
refactor: 让硕博模板书脊上下居中,并适应长标题
Browse files Browse the repository at this point in the history
Resolves BITNP#505

具体修改如下。

- `\vskip` → `\newgeometry` + `\restoregeometry`

  原来的`\vskip`没生效(删掉后编译结果相同),而且需要从上边距开始算。干脆改边距好了。

- `center`环境 → `\centering`

  lshort-zh-cn:`center`等环境会在上下文产生一个额外间距,而`\centering`等命令不产生,只是改变对齐方式。

- `minipage`环境的对齐方式 `t` → `c`

  这样遇到超长标题时,可以向两边溢出。

- `\vfill` → `\par` + `\vpace`

  `\vspace`可以设置间距最小值,避免标题稍长就和姓名学校粘在一起。

  另外,`\vfill`会直接生效,而`\vspace`不会,所以要加`\par`。
  • Loading branch information
YDX-2147483647 committed May 22, 2024
1 parent 8673d0a commit 3115666
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions bithesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1916,24 +1916,29 @@
\cleardoublepage
\currentpdfbookmark{书脊}{frontmatter:paperback}
\begin{titlepage}
\vskip 5cm
\begin{center}
% 上下各留出规定的边距,到下一页再恢复。
% 若标题超长,自然会向上下溢出。
\newgeometry{
vmargin = 5cm,
}
\centering
% 实现竖排——将水平宽度设得很窄,让文字自动换行,并改小行距
\linespread{1.1}\selectfont
\begin{minipage}[t][19.7cm]{2em}
\begin{center}
{
\heiti\zihao{3}
\tl_if_blank:VTF \l_@@_value_vertical_title_tl
{\l_@@_value_title_tl}{\l_@@_value_vertical_title_tl}
}
\vfill
{\heiti\zihao{3}\@@_secret_info:nn{\l_@@_value_author_tl}{\g_@@_const_substitute_symbol_tl\quad\g_@@_const_substitute_symbol_tl\quad\g_@@_const_substitute_symbol_tl}}
\vfill
{\heiti\zihao{3}\c_@@_label_university_tl}
\end{center}
\begin{minipage}[c][19.7cm]{2em}
\centering
{
\heiti\zihao{3}
\tl_if_blank:VTF \l_@@_value_vertical_title_tl
{\l_@@_value_title_tl}{\l_@@_value_vertical_title_tl}
}
\par
\vspace{1em plus 1fill}
{\heiti\zihao{3}\@@_secret_info:nn{\l_@@_value_author_tl}{\g_@@_const_substitute_symbol_tl\quad\g_@@_const_substitute_symbol_tl\quad\g_@@_const_substitute_symbol_tl}}
\par
\vspace{1em plus 1fill}
{\heiti\zihao{3}\c_@@_label_university_tl}
\end{minipage}
\end{center}
% \vskip 5cm
\restoregeometry
\end{titlepage}
}
% \end{macrocode}
Expand Down

0 comments on commit 3115666

Please sign in to comment.