有没有办法增加\errmessage
和的输出行长度\typeout
?我的问题是控制台和日志文件中的一些错误消息在错误内容中被截断:
--> Error: This is my very long<LF>
error message.
相反,我想要的是:
--> Error: This is my very long error message.
在一行中,因为我必须解析日志文件。
提前谢谢了。
答案1
你不能在 TeX 中控制这一点,但基于 web2c 的实现有
% It's probably inadvisable to change these. At any rate, we must have:
% 45 < error_line < 255;
% 30 < half_error_line < error_line - 15;
% 60 <= max_print_line;
% These apply to TeX, Metafont, and MetaPost.
error_line = 79
half_error_line = 50
max_print_line = 79
这些设置通常在texmf.cnf
文件中设置,但您也可以在命令行上设置它们,以便
\documentclass{article}
\begin{document}
\typeout{+123456789+123456789+123456789+123456789+123456789+123456789+123456789+123456789+123456789+123456789}
\end{document}
生产
$ pdflatex bb076
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2022/dev) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./bb076.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-08-27>
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/02/12 v1.4n Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(./bb076.aux)
+123456789+123456789+123456789+123456789+123456789+123456789+123456789+12345678
9+123456789+123456789
(./bb076.aux) )
No pages of output.
Transcript written on bb076.log.
但
$ pdflatex --cnf-line=max_print_line=100 bb076
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2022/dev) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./bb076.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-08-27> (/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/02/12 v1.4n Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./bb076.aux)
+123456789+123456789+123456789+123456789+123456789+123456789+123456789+123456789+123456789+123456789
(./bb076.aux) )
No pages of output.
Transcript written on bb076.log.