![错误消息和换行符](https://linux22.com/image/256321/%E9%94%99%E8%AF%AF%E6%B6%88%E6%81%AF%E5%92%8C%E6%8D%A2%E8%A1%8C%E7%AC%A6.png)
!
以下错误信息中,为什么感叹号( )会重复出现?
\def\error#1#2{%
\begingroup
\errhelp{#2}%
\errmessage{^^J! package Error: #1^^J}%
\endgroup
}
\error{Stop now.}{Hi, don't go on.}
!
! package Error: Stop now.
答案1
第一个感叹号是\errmessage
单独提供的:
\def\error#1#2{%
\begingroup
\errhelp{[ERRHELP: #2]}%
\errmessage{[ERRMESSAGE: #1]}
\endgroup
}
\error{Stop now.}{Hi, don't go on.}
文件.log
:
This is TeX, Version 3.1415926 (TeX Live 2011)
(./test.tex
! [ERRMESSAGE: Stop now.].
\error ...HELP: #2]}\errmessage {[ERRMESSAGE: #1]}
\endgroup
l.7 \error{Stop now.}{Hi, don't go on.}
? h
[ERRHELP: Hi, don't go on.]
? x
No pages of output.
Transcript written on test.log.