51

The package amsthm contains the predefined theorem styles plain, definition and remark which you can employ using \theoremstyle before your \newtheorem.

You can also create new theorem styles like this: \newtheoremstyle{NAME}{ABOVESPACE}{BELOWSPACE}{BODYFONT}{INDENT}{HEADFONT}{HEADPUNCT}{HEADSPACE}{CUSTOM-HEAD-SPEC}. I.e. you have to set all properties of your new style at once.

But I mostly like them as they are, I only want to change like 1 parameter. Therefore I'd like to know the \newtheoremstyle parameters which produce the predefined styles, so I can copy them and only change what I want. I would expect that information to be in the documentation of the package, but it isn't. Does anyone know what they are?

lockstep
  • 250,273
peter
  • 2,895

1 Answers1

50

The style "plain" should be equivalent to

\newtheoremstyle{plain}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\itshape}  % BODYFONT
  {0pt}       % INDENT (empty value is the same as 0pt)
  {\bfseries} % HEADFONT
  {.}         % HEADPUNCT
  {5pt plus 1pt minus 1pt} % HEADSPACE
  {}          % CUSTOM-HEAD-SPEC

The style "definition" is the same except for the body font, which is \normalfont; in "remark" the spaces above and below are 0.5\topsep, the head font is \itshape and the body font is \normalfont.

egreg
  • 1,121,712
  • 3
    @egreg: should be? did you guess it by the looks, or did you find that information somewhere? here http://tex.stackexchange.com/questions/1931/how-to-change-the-way-theorems-are-displayed it looks a bit different. is a space the same as .5em and is \noindent the same as leaving it blank? – peter May 06 '11 at 10:05
  • 1
    @peter: \noindent is wrong, and actually the space between the header and the text is 5pt plus 1pt minus 1pt. Thanks for remarking. – egreg May 06 '11 at 10:17
  • @egreg: what's the effect of +1-1? shouldnt this be the same as dropping it? – peter May 06 '11 at 10:29
  • 1
    @peter: no; this means that the space may be stretched up to 6pt or shrinked up to 4pt. It's a "rubber length" as it's called in Lamport's manual. – egreg May 06 '11 at 10:32
  • 2
    @egreg, @peter -- the plus in a rubber length may actually be stretched to more than the stated value, though the minus is the absolute limit. stretch is applied proportionally to all horizontal spaces in a paragraph or vertical spaces on a page; if a fil is present, it overwhelms anything else, but if there is no other stretch in the scope of what's being stretched, the `1pt' would expand to fill the entire amount needed to justify or make a page flush bottom. – barbara beeton May 06 '11 at 12:29
  • @barbara: You're right, but when the stretch is more than the stated value, the badness of the box increases. Stated in a different way: the space may be stretched optimally up to 6pt, but if really necessary TeX will stretch it more, possibly producing an underfull box. – egreg May 06 '11 at 12:40
  • First, I just want to thank egreg for his comment. Saved me a lot of time! I have a question though - when I try to put "\underline" as the Thm head font, it doesn't change anything. Does anyone know if there's a special command for an underlined font? I'm using "\scshape" as a nice-looking alternative for now. – AmadeusDrZaius May 21 '13 at 17:18
  • @ChrisMiddleton \underline is not a font changing command. And underlining is frowned upon in typographic circles. – egreg May 21 '13 at 17:27
  • 1
    Is there no way to "inherit" a new style from an existing one, overriding only some parameters? – Alexey Mar 27 '22 at 12:13
  • 1
    @Alexey I don't think there's a very good way, the actual numbers are lost after the command is executed as they're packed into the \th@⟨style name⟩ macro for efficiency reason (so e.g. \th@customstyle may be defined to be \itshape \let \thm@indent \noindent \thm@headsep 5pt␣plus␣1pt␣minus␣1pt\relax \thm@preskip 8.0pt␣plus␣2.0pt␣minus␣4.0pt\thm@postskip 8.0pt␣plus␣2.0pt␣minus␣4.0pt\relax \thm@headfont {\bfseries }\thm@headpunct {.}), and it isn't exactly trivial to parse out the values from that. The built-in styles are special cased (e.g. \th@plain = \itshape) so even harder. – user202729 Sep 13 '22 at 21:03
  • @egreg I think the "5pt plus 1pt minus 1pt" should actually be ".5em"; I ran an example on my local TeX installation and found that the spacing given by your answer is too small (at least in the example that I tried). – xFioraMstr18 Nov 28 '23 at 10:38
  • @xFioraMstr18 No, the package has \thm@headsep=5pt plus 1pt minus 1pt – egreg Nov 28 '23 at 11:25