![缺失数字,在简单的 parbox/spacebox 宏中视为零](https://linux22.com/image/431466/%E7%BC%BA%E5%A4%B1%E6%95%B0%E5%AD%97%EF%BC%8C%E5%9C%A8%E7%AE%80%E5%8D%95%E7%9A%84%20parbox%2Fspacebox%20%E5%AE%8F%E4%B8%AD%E8%A7%86%E4%B8%BA%E9%9B%B6.png)
我有一个使用 parbox、spacebox 和一些更简单的空格的宏。每次使用宏时,都会生成“缺失数字,视为零。”错误。它仍然可以在至少一些发行版中成功编译为 PDF。(Overleaf 成功;Windows MikTeX 失败某物在文件中,但我不确定是否是这个。)但是发生了什么?
\newcommand{\PersonalEntry}[2]{
\noindent\hangafter % Indentation
\parbox{\spacebox}{ % Box to align text
\textit{#1}}#2 \par} % Entry value
(...)
\PersonalEntry{Phone}{555 555 5555}
完整错误信息:
! Missing number, treated as zero.
<to be read again>
\protect
\parbox ->\protect
\parbox
\PersonalEntry ...-> \noindent \hangafter \parbox
{\spacebox }{ \textit {#1}...
l.128 \PersonalEntry{Phone}{555 555 5555}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)