我刚刚从 TeXStudio 中的模板创建了一个新文件。我选择了字母模板。因此我生成了以下代码:
\documentclass[]{letter}
\begin{document}
% If you want headings on subsequent pages,
% remove the ``%'' on the next line:
\pagestyle{headings}
\begin{letter}{TO_ADDRESS}
\address{ADDRESS}
\opening{SALUTATION}
\signature{}
\closing{}
%enclosure listing
%\encl{}
\end{letter}
\end{document}
到目前为止,我甚至没有触碰代码,而且由于存在以下错误,我无法编译它:
Missing $ inserted \opening{SALUTATION}
There's no line here to end. \opening{SALUTATION}
Missing $ inserted \opening{SALUTATION}
There's no line here to end. \closing{}
知道为什么吗?我想从这个模板开始,但我不知道如何修复此类错误。
答案1
我将错误改为最小可工作示例......
\documentclass[]{letter}
\begin{document}
% If you want headings on subsequent pages,
% remove the ``%'' on the next line:
\pagestyle{headings}
\begin{letter}{William Shakespeare} % Since good old William's 450th birthday in a few days ;-)
\address{London}
\opening{Dear William}
\signature{Ben Jonson}
\closing{Well roared, lion}\relax
%enclosure listing
%\encl{}
\end{letter}
\end{document}