BITNP / BIThesis

📖 北京理工大学非官方 LaTeX 模板集合,包含本科、研究生毕业设计模板及更多。🎉 (更多文档请访问 wiki 和 release 中的手册)
https://bithesis.bitnp.net
LaTeX Project Public License v1.3c
689 stars 97 forks source link

公式行距应比中文小 #500

Closed YDX-2147483647 closed 3 months ago

YDX-2147483647 commented 4 months ago

目前矩阵的行距和正文一样,显得非常散。应当和西文默认的一样。

\usepackage{zhlineskip}  % 默认 restoremathleading=true

https://github.com/CTeX-org/ctex-kit/issues/549

需要新安装xintpoormanlog两个宏包。

Relates-to: #496 英文模板可能需进一步恢复西文间距。

Relates-to: #498 不过即使设为1也还散,据说0.8差不多。

可能还要更新unicode-math相关文档。

如果数学字体来自 newpxmath 或是 TeX Gyre Pagella Math,那么数学行距在字号 1.2 倍的基础上再扩大 1.05 倍更加合适。此时,只需指定\SetMathEnvironmentSinglespace{1.05}即可。

YDX-2147483647 commented 3 months ago

我认为不应引入zhlineskip,原因如下。

zhlineskip一引入就有作用,影响前置内容,比如《研究成果声明》篇幅明显缩短,《关于学位论文使用权的说明》前几行提前到前一页。

\AtBeginDocument{%
  \linespread{\ZhLS@bodylinespread}\selectfont
  % 这将 \baselinestretch 从 1.3 改成了 1.250000263919929。
}

事实上zhlineskip的实现很简单,就是在数学环境开头设置\linespread,完全可以自己实现。

  \newcommand*\SetMathEnvironmentSinglespace[1]{%
    \def\ZhLS@mathlinespread{#1}%
  }
  \SetMathEnvironmentSinglespace{1}
  \newcommand*\RestoreMathEnvironmentLeading[1]{%
    \forcsvlist\ZhLS@restoremathenvironmentleading{#1}%
  }
  \def\ZhLS@restoremathenvironmentleading#1{%
    \AtBeginEnvironment{#1}{%
      \linespread{\ZhLS@mathlinespread}\selectfont\ignorespaces
    }%
  }
  \RestoreMathEnvironmentLeading{array}
  \RestoreMathEnvironmentLeading{matrix}
  \RestoreMathEnvironmentLeading{pmatrix}
  \RestoreMathEnvironmentLeading{bmatrix}
YDX-2147483647 commented 3 months ago

但数学环境太多了,还有这种不规则的……还是想办法把副作用规避掉吧。

  \patchcmd\start@gather
    {\collect@body}
    {\linespread{\ZhLS@mathlinespread}\selectfont\collect@body}
    {}{}

似乎这样就可以:

\usepackage[bodytextleadingratio=1.56]{zhlineskip}

zhlineskip 的默认是 1.5,导致\baselinestretch是 1.25;现在改为 1.56,\baselinestretch恢复为 1.25 / 1.5 × 1.56 = 1.3。


以上只适用于中文模板。