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

jiazhu 宏包在 tabularray 环境中使用会使得单元格莫名多出一行 #658

Open
ChihSee-Hsie opened this issue Apr 17, 2023 · 2 comments

Comments

@ChihSee-Hsie
Copy link

如题,在 tabularray 宏包中使用夹注,用了夹注的单元格会在底部多出一行的空间。

MWE 如下:

\documentclass{article}
\usepackage{jiazhu}
\usepackage{tabularx}
\usepackage{tabularray}
\usepackage{ctex}

\begin{document}
\begin{tblr}{colspec={XX}, hlines, vlines, columns={0.2\textwidth, l}} % tabularray
〇〇\jiazhu{〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇} & 〇〇\jiazhu{〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇}\\
〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇              & 〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇\\
〇〇\jiazhu{〇〇}                                 & 〇〇\jiazhu{〇〇}\\
\end{tblr}

\begin{tabularx}{0.4\textwidth}{|X|X|} % tabularx 作为比对
\hline
〇〇\jiazhu{〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇} & 〇〇\jiazhu{〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇}\\
\hline
〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇              & 〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇〇\\
\hline
〇〇\jiazhu{〇〇}                                 & 〇〇\jiazhu{〇〇}\\
\hline
\end{tabularx}
\end{document}

编译结果(TL 2023,XeLaTeX)如下:

test.pdf

对这个问题,我在 tabularray 的 GitHub 页面下也有提问。

@Sophanatprime
Copy link

jiazhu 宏包会在夹注后面加上一些代码(\__jiazhu_good_break:)以便后面的文字能在合适的位置断行,一般情况下这没什么问题,因为这个断行策略并不激进。可能是 tblr 环境影响了 jiazhu 的断行策略。
临时的解决办法是加上:

\ExplSyntaxOn
\newcommand{\jiazhunobrk}{ \cs_set:Npn \__jiazhu_good_break: { \tex_penalty:D \c_zero_int } }
\ExplSyntaxOff
\AtBeginEnvironment[./jiazhu]{tblr}{\jiazhunobrk}

@muzimuzhi
Copy link
Contributor

对这个问题,我在 tabularray 的 GitHub 页面下也有提问。

lvjr/tabularray#392 (总是建议让相关或相同的讨论「联起来」)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants