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}

Mico
  • 506,678
  • 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 Dec 05 '23 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 Dec 05 '23 at 19:55

2 Answers2

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}

egreg
  • 1,121,712
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}

Mico
  • 506,678