We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
现象: 如果指定了超过预定义数量的段落数(例如 \zhlipsum[1000]),即使已经是 nonstopmode,编译也会在显示警告 "invalid-range" 后挂住。
\zhlipsum[1000]
例子
\nonstopmode \documentclass{article} \usepackage{zhlipsum} \begin{document} \zhlipsum[1000] \end{document}
分析: 问题出在 \zhlipsum_use:nn 的定义部分 https://github.com/stone-zeng/zhlipsum/blob/28e7300dd27d94b89e6c8dbf312165217e18cba9/source/zhlipsum.dtx#L1168-L1188
\zhlipsum_use:nn
#2
\l_@@_par_num_seq
\l_@@_tmpa_tl
\q_no_value
texdoc interface3
\seq_pop_right:NN
\l_@@_tmpa_tl (== \q_no_value)
\int_compare_p:nNn
一种可能的方案: 在 \zhlipsum_use:nn 内部增加 seq 是否为空的判断,为空时跳过 \l_@@_before_tl 和 \l_@@_after_tl 在内的整段输出代码,以和警告 "invalid-range" 的提示信息 "Nothing~ will~ be~ output." 保持一致。详见 muzimuzhi@ce60f02
\l_@@_before_tl
\l_@@_after_tl
补充信息:
\@@_use:nn {#1} { \tl_use:N \l_@@_tmpa_tl }
\tl_use:N
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
783ca9b
No branches or pull requests
现象:
如果指定了超过预定义数量的段落数(例如
\zhlipsum[1000]
),即使已经是 nonstopmode,编译也会在显示警告 "invalid-range" 后挂住。例子
分析:
问题出在
\zhlipsum_use:nn
的定义部分https://github.com/stone-zeng/zhlipsum/blob/28e7300dd27d94b89e6c8dbf312165217e18cba9/source/zhlipsum.dtx#L1168-L1188
#2
超过预定义段落数量,且使用了 nonstopmode 时, 1174 行会为\l_@@_par_num_seq
赋空值\l_@@_tmpa_tl
成为\q_no_value
(参见
texdoc interface3
,sec X.3,\seq_pop_right:NN
的文档)\l_@@_tmpa_tl (== \q_no_value)
的调用,会导致内部代码在展开https://github.com/stone-zeng/zhlipsum/blob/28e7300dd27d94b89e6c8dbf312165217e18cba9/source/zhlipsum.dtx#L1351-L1355
的第一处
\int_compare_p:nNn
时,发生让编译挂住的情况。一种可能的方案:
在
\zhlipsum_use:nn
内部增加 seq 是否为空的判断,为空时跳过\l_@@_before_tl
和\l_@@_after_tl
在内的整段输出代码,以和警告 "invalid-range" 的提示信息 "Nothing~ will~ be~ output." 保持一致。详见 muzimuzhi@ce60f02补充信息:
\@@_use:nn {#1} { \tl_use:N \l_@@_tmpa_tl }
这一行中的\tl_use:N
似为多余The text was updated successfully, but these errors were encountered: