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

公式行距应比中文小 #500

Closed
YDX-2147483647 opened this issue May 11, 2024 · 2 comments · Fixed by #537
Closed

公式行距应比中文小 #500

YDX-2147483647 opened this issue May 11, 2024 · 2 comments · Fixed by #537
Assignees
Labels
dependencies Pull requests that update a dependency file 🚀 enhancement New feature or request

Comments

@YDX-2147483647
Copy link
Collaborator

YDX-2147483647 commented May 11, 2024

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

\usepackage{zhlineskip}  % 默认 restoremathleading=true

CTeX-org/ctex-kit#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 YDX-2147483647 added 🚀 enhancement New feature or request dependencies Pull requests that update a dependency file labels May 11, 2024
@YDX-2147483647
Copy link
Collaborator Author

YDX-2147483647 commented Jun 18, 2024

我认为不应引入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
Copy link
Collaborator Author

YDX-2147483647 commented Jul 3, 2024

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

  \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。


以上只适用于中文模板。

@YDX-2147483647 YDX-2147483647 self-assigned this Jul 3, 2024
YDX-2147483647 added a commit to YDX-2147483647/BIThesis that referenced this issue Jul 4, 2024
如需恢复数学行距至原先的中文水平,可在导言区将倍数从1调大至1.53:

```latex
\SetMathEnvironmentSinglespace{1.53}
```

Resolves BITNP#500
YDX-2147483647 added a commit to YDX-2147483647/BIThesis that referenced this issue Jul 4, 2024
如需恢复数学行距至原先的中文水平,可在导言区将倍数从1调大至1.53:

```latex
\SetMathEnvironmentSinglespace{1.53}
```

Resolves BITNP#500
github-merge-queue bot pushed a commit that referenced this issue Jul 5, 2024
如需恢复数学行距至原先的中文水平,可在导言区将倍数从1调大至1.53:

```latex
\SetMathEnvironmentSinglespace{1.53}
```

Resolves #500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file 🚀 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant