2

Usually I don't like the dot after theorem headers. Because of that, I added the following line to my preamble:

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

which works very well. But with that option, I get an italic colon after the remark header, which is good when there is no numbering, but with enabled numbering, the number is written in normal font, not in italic. Is it possible to get the number into italic font, too, or alternatively get the colon into normal font by not defining a new theorem style?

I want the colon to be in normal font in one case and in italic font in the other case at the same time, or alternatively to get the number into italic font.

\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}

enter image description here

Update: The problem for me of using an upshape colon everywhere was the spacing between unnumbered italic headers and the colon. With \/ everything works well, see comments below.

  • 1
    ther are about 10000 packages for defining theorems, which are you using? Your question would be much easier to answer and to test any posted code) if you posted an example document showing the declaration that you are patching – David Carlisle Jul 1 '17 at 19:42
  • I'm using amsthm. – Thrash Jul 1 '17 at 19:43
  • 1
    Still please post a small one page document with a remark enviornment that you want to change – David Carlisle Jul 1 '17 at 19:46
  • Okay, I've done it. – Thrash Jul 1 '17 at 19:55
  • 1
    if you'd accept the colon to always be upright, then \g@addto@macro{\thm@space@setup}{\thm@headpunct{\upshape:}} should give that result. – barbara beeton Jul 3 '17 at 20:29
3

The amsthm package internally defines a macro \@upn to keep the number upright, regardless of the font for the head. By refefining it to an empty macro the number will be printed in the font for the head.

\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

Changes like these are best addressed with 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}

enter image description here

To be honest, I'd prefer an upright colon in both cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.