
私はtextsc
、Theorem 環境に表示される方程式内で を使用しています。方程式内のテキストは、textsc
Theorem 環境によって強制される斜体ではなく、通常のフォントで表示されるようにしたいです。
つまり、ここで気づいた違いを避けたいのです (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}