3

Is there a way to ensure that we may use \label{key}[Theoremtitle] while avoiding getting "[Theoremtitle]" and instead getting "(Theoremtitle)" - as with [Theoremtitle]\label{key} in the example below.

Using [Name]\label{key} created problems for the line breaking.

\documentclass{article}

\usepackage{amsthm}

\theoremstyle{remark}
\newtheorem{Theorem}[equation]{\em{ T{\footnotesize HEOREM}}}
\begin{document}

\begin{Theorem}\label{key}[Theoremtitle]
2=2
    \end{Theorem}

\begin{Theorem}[Theoremtitle]\label{key}
    2=2
\end{Theorem}
\end{document}
2
  • 1
    Are you trying to create the look of small-cap letters? If so, please don't use T{\footnotesize HEOREM}; instead, use \textsc{Theorem}.
    – Mico
    Commented Dec 5, 2023 at 19:31
  • 2
    Just out of curiosity: What makes you think it's a good idea to write \begin{Theorem}\label{key}[Theoremtitle] instead of \begin{Theorem}[Theoremtitle] \label{key}? Relatedly, in view of the fact that \label{...} doesn't output anything visible, what's the basis for your claim that \begin{Theorem}[Name]\label{key} "create[s] problems for the line breaking"?
    – Mico
    Commented Dec 5, 2023 at 19:55

2 Answers 2

3

Main problem: \label must go after the entire theorem header specification. There is no sensible way to support the syntax you seem to want that doesn't really make sense. Moreover

  1. \em doesn't take an argument;
  2. you don't want \em anyway, because the theorem style remark already uses \itshape for the header;
  3. you want proper slanted small caps, not the hack with \footnotesize.
\documentclass{article}
\usepackage{lmodern}
\usepackage{amsthm}
\usepackage{fixcmex}% because of lmodern

\theoremstyle{remark}
\newtheorem{Theorem}[equation]{{\normalfont\scshape\slshape Theorem}}

\begin{document}

\begin{Theorem}[Theoremtitle]\label{key}
Something here.
\end{Theorem}

\end{document}

enter image description here

In a better way:

\documentclass{article}
\usepackage{lmodern}
\usepackage{amsthm}
\usepackage{fixcmex}% because of lmodern

% see https://tex.stackexchange.com/a/17555/4427
\newtheoremstyle{scslheader}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\normalfont}  % BODYFONT
  {0pt}       % INDENT (empty value is the same as 0pt)
  {\normalfont} % HEADFONT
  {.}         % HEADPUNCT
  {5pt plus 1pt minus 1pt} % HEADSPACE
  {\thmname{\textsc{\textsl{#1}}}\thmnumber{ #2}\thmnote{ (#3)}} % CUSTOM-HEAD-SPEC

\theoremstyle{scslheader}
\newtheorem{Theorem}[equation]{Theorem}

\begin{document}

\begin{Theorem}[Theoremtitle]\label{key}
Something here.
\end{Theorem}

\end{document}
7
  • Thanks! I get the error message Package fixcmex Warning: No change in the math extension font, and do not obtain such changes as you. Commented Dec 6, 2023 at 18:15
  • @FrodeAlfsonBjørdal You possibly have an outdated LaTeX distribution.
    – egreg
    Commented Dec 6, 2023 at 18:17
  • I write with Overleaf Commented Dec 6, 2023 at 20:01
  • @FrodeAlfsonBjørdal What version of TeX LIve? Choose 2023.
    – egreg
    Commented Dec 6, 2023 at 20:29
  • Now 2023 chosen. This line {\thmname{\textsc{\textsl{#1}}}\thmnumber{ #2}\thmnote{ (#3)}} % CUSTOM-HEAD-SPEC creates problems. Is it an abbreviation for possible choices to be made somewhere? Commented Dec 6, 2023 at 21:13
2

If I understand your code correctly, you're looking to write "Theorem" with an italic/smallcap lettering combination. The basic Computer Modern/Latin Modern font family doesn't provide such a combination. I suggest you employ the newtxtext and newtxmath packages, which provide a Times Roman clone. Or, consider employing the newpxtext and newpxmath packages, which provide a Palatino clone.

enter image description here

\documentclass{article}

\usepackage{amsthm}
\theoremstyle{remark} % use upright lettering, no extra vertical whitespace space
\newtheorem{Theorem}[equation]{\textit{\textsc{Theorem}}}

\usepackage{newtxtext,newtxmath} 
  % Times Roman clone that provides italic-smallcap combination
  
\begin{document}

\begin{Theorem}[Theoremtitle] \label{thm:112}
\begin{equation} \label{eq:112}
1+1=2
\end{equation}
\end{Theorem}

\noindent
A cross-reference to Theorem \ref{thm:112}, and another one to equation \eqref{eq:112}.

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .