我遇到了使用 Overleaf 和 Texstudio 时出现如下解释的问题。
MWE 是
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\noindent The coding
\begin{verbatim}
$\Omegaˆ+$ and $\omegaˆ+$ superscripts do not work.
But subscripts work, as here $\Omega_+$ \ and here \ $\omega_+$.
\end{verbatim}
\noindent produces
\medskip
$\Omegaˆ+$ and $\omegaˆ+$ superscripts do not work.
But subscripts work, as here $\Omega_+$ \ and here \ $\omega_+$.
\medskip
\noindent \begin{verbatim}
Using \(, $$, or \[ does not fix the problem.
\end{verbatim}
\noindent However, \begin{verbatim}
\(n_0\cdot 2^{\ell(n_1)}+n_1\)
\end{verbatim}
\smallskip
produces
\(n_0\cdot 2^{\ell(n_1)}+n_1. \)
\medskip
\noindent Test with other Greek letters give
\medskip
\noindent $\alpha^+\beta^+\gamma^+\Gamma^+\delta^+\Delta^+\epsilon^+\eta^+\zeta^+\eta^+\theta^+\Theta^+\iota^+\kappa^+\lambda^+\Lambda^+\mu^+\nu^+\xi^+\Xi^+\pi^+\Pi^+\rho^+\sigma^+\Sigma^+\tau^+\upsilon^+\phi^+\Phi^+\chi^+\psi^+\Psi^+ $
\medskip
\noindent The document has 403 other occurrences of the superscript-construction as in $a^b$, from
\begin{verbatim}
$a^b$,
\end{verbatim}
and there does not appear to be any problems with any of those.
\end{document}
答案1
正如 Werner 在评论中所说,ˆ
used at与used at$\Omegaˆ+$ and $\omegaˆ+$
不同。 第一个是错误的,最后一个是正确的。 因此:^
$\alpha^+\beta^+\gamma^+…
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\noindent The coding
\begin{verbatim}
$\Omega^+$ and $\omega^+$ superscripts do work.
But subscripts work, as here $\Omega_+$ \ and here \ $\omega_+$.
\end{verbatim}
\noindent produces
\medskip
$\Omega^+$ and $\omega^+$ superscripts do work.
But subscripts work, as here $\Omega_+$ \ and here \ $\omega_+$.
\medskip
\noindent \begin{verbatim}
Using \(, $$, or \[ does not fix the problem.
\end{verbatim}
\noindent However, \begin{verbatim}
\(n_0\cdot 2^{\ell(n_1)}+n_1\)
\end{verbatim}
\smallskip
produces
\(n_0\cdot 2^{\ell(n_1)}+n_1. \)
\medskip
\noindent Test with other Greek letters give
\medskip
\noindent $\alpha^+\beta^+\gamma^+\Gamma^+\delta^+\Delta^+\epsilon^+\eta^+\zeta^+\eta^+\theta^+\Theta^+\iota^+\kappa^+\lambda^+\Lambda^+\mu^+\nu^+\xi^+\Xi^+\pi^+\Pi^+\rho^+\sigma^+\Sigma^+\tau^+\upsilon^+\phi^+\Phi^+\chi^+\psi^+\Psi^+ $
\medskip
\noindent The document has 403 other occurrences of the superscript-construction as in $a^b$, from
\begin{verbatim}
$a^b$,
\end{verbatim}
and there does not appear to be any problems with any of those.
\end{document}
有效。所以问题不是\Omega
但是ˆ
,你应该对错误的字符进行全局搜索和替换。
顺便说一句:ˆ
定义为\textasciicircum
,因此您应该收到一条警告消息:
LaTeX Warning: Command \textasciicircum invalid in math mode on input line 22.
用你的例子。
答案2
我们utf8enc.dfu
发现
\DeclareUnicodeCharacter{02C6}{\textasciicircum}
事实上你的日志文件包含两个实例
LaTeX Warning: Command \textasciicircum invalid in math mode on input line 22.
请注意,U+02C6 修饰字母卷动符与 U+005E 卷动符不同。
只有后者可以用于上标。
也许您的键盘有奇怪的设置(或者您正在从 PDF 复制粘贴而操作系统做出了错误的猜测)。
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\noindent The coding
\begin{verbatim}
$\Omegaˆ+$ and $\omegaˆ+$ superscripts do not work.
\end{verbatim}
produces
$\Omegaˆ+$ and $\omegaˆ+$ superscripts do not work.
\medskip
\noindent Yes, they do if you use the proper character
\medskip
\noindent The coding
\begin{verbatim}
$\Omega^+$ and $\omega^+$ works.
\end{verbatim}
produces
$\Omega^+$ and $\omega^+$ works.
\end{document}
最好进行“搜索和替换”,但您也可以决定使用 U+02C6 来代表^
。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{newunicodechar}
\newunicodechar{ˆ}{^}
\begin{document}
$\Omegaˆ+$ and $\omegaˆ+$ works.
$\Omega^+$ and $\omega^+$ works.
\end{document}
但我不建议这么做。