
我有以下情況
\begin{itemize}
\item[(A_s)] Item (A_s) such that
\begin{equation}\label{sob}
\sum_{n}n
\end{equation}
\item[(B_s)] Item (B_s)
\end{itemize}
結果是黑屏。之後我將其放在$
專案的開頭和結尾
\begin{itemize}
\item[$(A_s)$] Item (A_s) such that
\begin{equation}\label{sob}
\sum_{n}n
\end{equation}
\item[$(B_s)$] Item (B_s)
\end{itemize}
一切都很好。我浪費了很多時間才找到這個。問題出在哪裡?
答案1
_
是一個特殊字符,表示下標的開頭,並且僅在數學模式下允許。因此,插入$
大約數學相關的內容,問題就迴避了。
環境equation
會自動啟動數學模式,因此無需額外進入數學模式。
如果您確實想要下劃線,那麼您可以使用以下任何方法。另請參閱單字中的底線(文字)。
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\begin{itemize}
\item[$(A_s)$] Item ($A_s$) such that
\begin{equation}\label{sob}
\sum_{n}n
\end{equation}
\item[$(B_s)$] Item ($B_s$)
\item[(C\string_s)] Item (\detokenize{C_s}) and (C\textunderscore s)
\end{itemize}
\end{document}