注釈環境の斜体のコロン(`amsthm` を使用)ですが、番号は通常のフォントです

注釈環境の斜体のコロン(`amsthm` を使用)ですが、番号は通常のフォントです

通常、私は定理のヘッダーの後のドットが好きではありません。そのため、私は前文に次の行を追加しました。

\g@addto@macro{\thm@space@setup}{\thm@headpunct{:}}

これは非常にうまく機能します。しかし、そのオプションを使用すると、ヘッダーの後に斜体のコロンが表示されますremark。これは番号付けがない場合には良いのですが、番号付けを有効にすると、番号は斜体ではなく通常のフォントで書かれます。番号も斜体フォントにすることはできますか、または代わりにコロンを通常のフォントにするには、ない新しい定理のスタイルを定義しますか?

コロンを、一方では通常のフォントで、他方では同時に斜体フォントで表示したい、あるいは、数字を斜体フォントで表示したい。

\documentclass{article}
\usepackage{amsthm}

\theoremstyle{remark}
\newtheorem{remark}{Remark}
\newtheorem*{remark*}{Remark}

\makeatletter
\g@addto@macro{\thm@space@setup}{\thm@headpunct{:}}
\makeatother

\begin{document}
    \begin{remark}
        Here is a numbered remark.
    \end{remark}
    \begin{remark*}
        Here is an unnumbered remark.
    \end{remark*}
\end{document}

ここに画像の説明を入力してください

アップデート:私にとって、上向きのコロンをどこでも使用する場合の問題は、番号なしの斜体のヘッダーとコロンの間のスペースでした。\/すべてがうまく機能している場合は、以下のコメントを参照してください。

答え1

パッケージは、ヘッドのフォントに関係なく、数字を垂直に保つためのamsthmマクロを内部的に定義します\@upn。これを空のマクロに再定義すると、数字はヘッドのフォントで印刷されます。

\documentclass{article}
\usepackage{amsthm}

\theoremstyle{remark}
\newtheorem{remark}{Remark}
\newtheorem*{remark*}{Remark}

\makeatletter
\g@addto@macro{\thm@space@setup}{\thm@headpunct{:}}
\renewcommand{\@upn}{} % to use the same font for the number as for the head
\makeatother

\begin{document}
    \begin{remark}
        Here is a numbered remark.
    \end{remark}
    \begin{remark*}
        Here is an unnumbered remark.
    \end{remark*}
\end{document}

答え2

このような変更は、 を使用して対処するのが最適ですthmtools

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

\declaretheoremstyle[
  headfont=\normalfont\itshape,
  headpunct=\textup{:},
  bodyfont=\normalfont,
]{myremark}

\declaretheoremstyle[
  headfont=\normalfont\itshape,
  headpunct=:,
  bodyfont=\normalfont,
]{myremarknonum}

\theoremstyle{myremark}
\newtheorem{remark}{Remark}
\theoremstyle{myremarknonum}
\newtheorem*{remark*}{Remark}

\begin{document}

Some text to show the context. Some text to show the context.
Some text to show the context. Some text to show the context.
Some text to show the context.

\begin{remark}
Here is a numbered remark.
\end{remark}

\begin{remark*}
Here is an unnumbered remark.
\end{remark*}

\end{document}

ここに画像の説明を入力してください

正直に言うと、どちらの場合も直立したコロンの方が好みです。

関連情報