【问题标题】:\maketitle in LaTeX gives error "! Missing $ inserted.<inserted text>$ \maketitle". What's the reason?LaTeX 中的 \maketitle 给出错误“!缺少插入的 $。<插入的文本>$ \maketitle”。什么原因?
【发布时间】:2021-05-21 05:53:13
【问题描述】:

这是最简单的 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

【问题讨论】:

  • 它为我编译 find 。确定这是您收到错误的确切版本吗?你是怎么编译的?
  • 你能显示完整的.log文件吗?
  • 如何添加日志文件? @samcarter_is_at_topanswers.xyz。有一个文本文件,是日志文件吗?
  • 您应该能够在 .tex 文件所在的文件夹中找到日志文件。它具有相同的名称,只是文件以.log 结尾。您可以在任何普通文本编辑器中打开它,然后将内容复制并粘贴到您的问题中。
  • 我找到了解决方案。在答案部分查看我的答案。 @samcarter_is_at_topanswers.xyz 。谢谢

标签: latex pdflatex xelatex latex-environment


【解决方案1】:

我明白了。我用过 _ ,它给出了错误。需要删除 _ 或将 \\_ 一起使用,然后才能正常工作。

【讨论】:

  • 您应该查看urlhyperref 包以正确包含电子邮件地址。这样您就不必担心特殊字符,读者可以点击它
猜你喜欢
  • 2011-04-07
  • 1970-01-01
  • 2021-11-22
  • 1970-01-01
  • 1970-01-01
  • 2016-11-30
  • 2019-05-05
  • 1970-01-01
  • 2018-08-20
相关资源
最近更新 更多