1

I wish to have my theorem environments (theorem, lemma, corollary, definition) etc have a hanging indentation as follows:

Theorem 1:  This is the one, It should be emphasized that an option gives the holder the 
            right to do something.The holder does not have to exercise this right. This 
            is what distinguishes options from forwards and futures, where the holder is 
            obligated to buy or sell the underlying asset.

However, I am failing to produce this type of hanging indentation and below is the MWE which I got from How can I change the typeface used in my theorem environments :

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsthm}
\usepackage{xcolor}

\newtheoremstyle{mytheoremstyle} % name
{\topsep}                    % Space above
{\topsep}                    % Space below
{\itshape\fontfamily{ptm}\selectfont}                   % Body font
{}                           % Indent amount
{\fontfamily{ptm}\selectfont\scshape\color{blue}}                   % Theorem head font
{:}                          % Punctuation after theorem head
{.5em}                       % Space after theorem head
{}  % Theorem head spec (can be left empty, meaning ‘normal’)
\theoremstyle{mytheoremstyle}
\newtheorem{lemma}{Lemma}

\usepackage{lipsum}

\begin{document}
    \begin{lemma}[foo bar]
        \lipsum[3]
    \end{lemma}
    
\end{document}

2 Answers 2

1

Some what manual suggestion, but it works as per your wish:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsthm}
\usepackage{xcolor}

\newbox\thmbox%
\setbox\thmbox=\hbox{\fontfamily{ptm}\selectfont\scshape\color{blue}Lemma 1 (foo bar)}%
\newtheoremstyle{mytheoremstyle} % name
{\topsep}                    % Space above
{\topsep}                    % Space below
{\hangindent\wd\thmbox\itshape\fontfamily{ptm}\selectfont}                   % Body font
{}                           % Indent amount
{\fontfamily{ptm}\selectfont\scshape\color{blue}}                   % Theorem head font
{:}                          % Punctuation after theorem head
{.5em}                       % Space after theorem head
{}  % Theorem head spec (can be left empty, meaning ‘normal’)
\theoremstyle{mytheoremstyle}
\newtheorem{lemma}{Lemma}

\usepackage{lipsum}

\begin{document}
    \begin{lemma}[foo bar]
        \lipsum[3]
    \end{lemma}
    
\end{document}

enter image description here

2
  • This works for a theorem-like environment called Lemma and an associated single-digit number, but not so well for theorem-like environments named, say, Corollary, Definition, or Proposition.
    – Mico
    Commented Aug 10, 2022 at 7:41
  • @Mico Yes, I already noticed, so only I mentioned as manual work... Sorry....
    – GowriSaro
    Commented Aug 10, 2022 at 15:03
1

You could add

\hangafter=1\hangindent=3em

to the argument of the "Body font" line of the \newtheoremstyle directive:

{\itshape\fontfamily{ptm}\selectfont\hangafter=1\hangindent=3em}

I would recommend that you not make the indentation amount (3em in the lines above) depend on whether the theorem-like environment is called Lemma (a fairly short string) or Proposition (a fairly long string). Just choose a value that will guarantee that your readers will have no choice but to notice that hanging indentation is in force.


enter image description here

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsthm}
\usepackage{xcolor,lipsum}

\newtheoremstyle{mytheoremstyle} % name
{\topsep}                    % Space above
{\topsep}                    % Space below
{\itshape\fontfamily{ptm}\selectfont\hangafter=1\hangindent=3em} % Body font
{}                           % Indent amount for first line
{\fontfamily{ptm}\selectfont\scshape\color{blue}}        % Theorem head font
{.}                          % Punctuation after theorem head
{.5em}                       % Space after theorem head
{}  % Theorem head spec (can be left empty, meaning ‘normal’)
\theoremstyle{mytheoremstyle}
\newtheorem{lemma}{Lemma}

\begin{document}
    \begin{lemma}[foo bar] 
    \lipsum[3][1-8]
    \end{lemma} 
\end{document}
3
  • Thank you very much @Mico. I have adjusted the hangindent command to \hangindent=8.5em but the indentation is still not perfectly hanging. Can you please assist with the adjustment on the \hangindent command that gives the hanging indentation I am looking.
    – itc
    Commented Aug 10, 2022 at 5:07
  • @itc - Give 8.85em a try... Seriously, though: Setting the amount of hanging indentation close to 9em is almost certainly going to be utterly counterproductive: Your readers will definitely notice the enormous amount of indentation, but that's all they'll notice; they will likely not take in a single word of the lemma itself. Is that really what you want to achieve? A hallmark of fine typography is that it enhances and clarifies the material being typeset, without drawing attention to itself. Enormous amounts of hanging indentation blatantly violate this cardinal rule.
    – Mico
    Commented Aug 10, 2022 at 5:23
  • Noted @Mico. I agree.
    – itc
    Commented Aug 10, 2022 at 5:25

You must log in to answer this question.

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