證明 + \mathaccent 錯誤

證明 + \mathaccent 錯誤

對於以下程式碼,我收到錯誤:「請在數學模式下使用 \mathaccent 作為重音符號」。我猜這是 的問題$Vˆ{\infty}$,但我不太確定為什麼它是錯的,因為它是$.

\begin{proof}
(4) can be written component-wise for all $t$ 
as $v=Qv$, where $Q$ is the operator 
on $Vˆ{\infty}$ defined on the R.H.S of (4). 
\end{proof}

答案1

您正在使用非 ASCII 字元 ,ˆ而不是^作為上標起始符。字元ˆ也可以輸入為\textasciicircum。這在文字模式下可能沒問題(只要使用 utf8 輸入編碼),但在數學模式下不起作用。

結果:僅^在數學模式下使用。

MWE(最小工作範例):

\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
$Vˆ{\infty}$ vs.\ $V^{\infty}$
\end{document}

完整的警告訊息實際上是:

LaTeX Warning: Command \textasciicircum invalid in math mode on input line 4.

LaTeX Warning: Command \^ invalid in math mode on input line 4.

! Please use \mathaccent for accents in math mode.

\add@accent ...@spacefactor \spacefactor }\accent 

                                                 #1 #2\egroup \spacefactor ...

l.4 $Vˆ

        {\infty}$ vs.\ $V^{\infty}$

? 

TeX 的錯誤和警告訊息以簡潔著稱(有時幾乎難以理解)。關鍵是要尋找第一的錯誤或警告訊息,在本例中為「LaTeX 警告:\textasciicircum數學模式下的命令無效」。這可能已經為你帶來了提示;然而,它可能並不明顯 [!]ˆ也可以輸入為\textasciicircum

相關內容