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

指定超限的段落数时,出现死循环 #4

Closed
muzimuzhi opened this issue Aug 9, 2019 · 1 comment
Closed

指定超限的段落数时,出现死循环 #4

muzimuzhi opened this issue Aug 9, 2019 · 1 comment
Labels

Comments

@muzimuzhi
Copy link
Contributor

muzimuzhi commented Aug 9, 2019

现象
如果指定了超过预定义数量的段落数(例如 \zhlipsum[1000]),即使已经是 nonstopmode,编译也会在显示警告 "invalid-range" 后挂住。

例子

\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 内部增加 seq 是否为空的判断,为空时跳过 \l_@@_before_tl\l_@@_after_tl 在内的整段输出代码,以和警告 "invalid-range" 的提示信息 "Nothing~ will~ be~ output." 保持一致。详见 muzimuzhi@ce60f02

补充信息

  • 上述方案没有跑 ci
  • \@@_use:nn {#1} { \tl_use:N \l_@@_tmpa_tl } 这一行中的 \tl_use:N 似为多余
@muzimuzhi muzimuzhi changed the title 段落数超限时,nonstopmode 模式下出现死循环 指定超限的段落数时,出现死循环 Aug 9, 2019
@muzimuzhi
Copy link
Contributor Author

  • 更新了 issue 详情
  • 修复了可能方案中,提交里的问题

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

No branches or pull requests

2 participants