\LaTeX中的maketitle出现错误“quot;”;!插入的美元丢失。<;插入的文本>;$\maketitle";。什么';原因是什么?

\LaTeX中的maketitle出现错误“quot;”;!插入的美元丢失。<;插入的文本>;$\maketitle";。什么';原因是什么?,latex,pdflatex,xelatex,latex-environment,Latex,Pdflatex,Xelatex,Latex Environment,以下是最简单的LaTeX文件: \documentclass[12pt]{article} \title{How to write a report in LaTeX} \author{ABC\\abc_z@yahoo.com} \date{May 2021} \begin{document} \maketitle Hello World \end{document} 但当我快速构建时,它会出现以下错误: ! Missing $ inserted.<inserted text>$

以下是最简单的LaTeX文件:

\documentclass[12pt]{article}
\title{How to write a report in LaTeX}
\author{ABC\\abc_z@yahoo.com}
\date{May 2021}
\begin{document}
\maketitle
Hello World
\end{document}
但当我快速构建时,它会出现以下错误:

! Missing $ inserted.<inserted text>$ \maketitle
! Extra }, or forgotten $.<template> \unskip \hfil }\hskip \tabcolsep \endtemplate \maketitle
! Missing $ inserted.<inserted text>$ \maketitle
! Missing } inserted.<inserted text>} \maketitle
!缺少插入的$。$\maketitle
! 额外},或遗忘美元\unskip\hfil}\hskip\tabcolsep\endtemplate\maketitle
! 缺少插入的$。$\maketitle
! 缺少}已插入。}\maketitle

我明白了。我已经使用了
\uu
,它给出了错误。您需要删除
\
或将
\
与一起使用,如
\\
,然后它才能工作。

您需要在
\author
条目中转义下划线。LaTeX使用下划线来格式化下标,这需要在数学模式下进行

假设您不想为任何内容下标,您需要通过转义下划线来明确地告诉LaTeX您想要一个下划线字符

\documentclass[12pt]{article}
\标题{如何用LaTeX编写报告}
\作者{ABC\\ABC\_z@yahoo.com}
\日期{2021年5月}
\开始{document}
\maketitle
你好,世界
\结束{document}

它为我编译find。确定这是您得到错误的确切版本吗?如何编译?能否显示完整的.log文件?如何添加日志文件@samcarter_在_topanswers.xyz。有一个文本文件,是日志文件吗?您应该能够在与.tex文件相同的文件夹中找到日志文件。它的名称相同,只是文件的结尾是
.log
。你可以在任何普通的文本编辑器中打开它,将内容复制粘贴到你的问题上。我找到了解决方案。请参阅答案部分中的我的答案@samcarter_在_topanswers.xyz。谢谢您应该查看
url
hyperref
包以正确包含电子邮件地址。这样你就不必担心特殊字符,读者也可以点击它