我试着用乳胶写以下内容:

\begin{itemize}
    \item \textbf{insert(element|text)} inserts the element or text passed at the start of the selection.
    \item \textbf{insert_after(element|text)} inserts the element or text passed at the end of the selection.
    \item \textbf{replace(element|text)} replaces the selection with the passed text/element.
    \item \textbf{delete()} deletes the selected text.
    \item \textbf{annotate(name,value)} annotates the selected text with the passed name and value-pair. This can either be a hidden meta-data about the selection, or can alter the visible appearance.
    \item \textbf{clear_annotation()} removes any annotation for this specific selection.
    \item \textbf{update_element(value)} performs an update of the element at the selection with the passed value.
\end{itemize}

出于某种原因,我得到了一堆错误。我认为“插入”这个词的使用有一定的意义。我得到像“缺少$ insert”这样的错误,所以似乎解析器试图修复我的部分上的一些“错误”。我需要转义像"insert"这样的词吗,我该怎么做?


“缺少$ insert”可能是由下划线和条造成的。LaTeX中的这些字符在数学模式(由$ characters分隔)中具有特殊含义。试着逃离它们;例如,更新\_element而不是update_element。

但是,如果您试图显示代码,更好的解决方案是使用\verb命令,该命令将以等宽字体对文本进行排版,并将自动正确处理下划线和横条(不需要使用\转义)。


我的第一个猜测是LaTeX在数学环境之外阻塞了|。缺少$ insert通常是类似的症状。


实际上是下划线。使用\_代替,或者包含下划线包。


此外,我有这个问题,但围嘴文件不会重新编译。我删除了问题,即注释字段中的下划线,并再次编译tex文件,但仍然得到相同的错误。最后,我删除了编译的bib文件(。bbl我认为),它工作得很好。我必须使用反斜杠转义_。


我也有这个问题。我通过去掉方程标签之间不必要的空行来解决这个问题。这给出了错误:

\begin{equation}
P(\underline{\hat{X}} | \underline{Y}) = ...

\end{equation}

当这段代码成功编译时:

\begin{equation}
P(\underline{\hat{X}} | \underline{Y}) = ...
\end{equation}

我也遇到过同样的问题——我读过所有这些答案,但不幸的是,没有一个对我有用。最后我试着去掉这条线

%\usepackage[latin1]{inputenc}

所有的错误都消失了。


我认为它给出错误是因为下划线符号。

注意:下划线符号不能直接写,必须像\_一样写。

所以修复这些特殊的符号错误。


如果在数学模式之外使用特殊字符希腊字母,如\alpha \beta等,也会出现这个错误。 当我把它们包在…中时,错误就消失了。


我有这个符号_在一个表的头部,代码没有运行,所以我必须删除。


在我的代码中,当我得到错误时,我检查了可能的来源,在一行中,我输入了一个开始\[和一个结束\],由于缺少$的错误出现,尽管我尝试使用$两个括号。删除括号或使用$[$而不是$\[$解决了我的问题。如果你有类似的情况,试着改变。


我的情况和艾德里安的情况类似。这是一个写错的在线围嘴来源。

我有

 @online{some_pretty_website, 
    title={Pretty Website}, 
    url={https://www.prettywebsite.com/foo_bar.pdf}
 } 

我不得不转义url中的“_”符号

 @online{some_pretty_website, 
    title={Pretty Website}, 
    url={https://www.prettywebsite.com/foo\_bar.pdf}
 }