使textsc對環境不敏感

使textsc對環境不敏感

我正在使用textsc一個方程,然後該方程出現在定理環境中。我希望方程內的文字textsc以常規字體顯示,而不是斜體(這是由定理環境強制執行的)。

也就是說,我想避免這裡注意到的差異(CLIQUE 應該以與第一行相同的樣式在定理內部呈現)。

We have the following result for $\textsc{Clique}$.
\begin{proposition}
$\textsc{Clique}$ is $\NP$-complete.
\end{proposition}

在此輸入影像描述

有沒有辦法做到這一點?理想情況下,這可以透過重命名命令來完成嗎textsc? (因為有更複雜的巨集使用它,也應該以這種方式改變它們的外觀)

答案1

您可能有幾個問題想要分析 NP 完整性,因此最好定義一個特定的指令。最大的優點是您甚至可以在最後一刻決定排版實現。

\documentclass{article}
\usepackage{amsmath,amsthm}

\newcommand{\NP}{\mathbf{NP}}
\newcommand{\prb}[1]{\textnormal{\scshape #1}}

\newtheorem{proposition}{Proposition}

\begin{document}

We have the following result for \prb{Clique}.

\begin{proposition}
\prb{Clique} is $\NP$-complete.
\end{proposition}

Also in math mode: $\prb{Clique}^2$

\end{document}

在此輸入影像描述

相關內容