Text Formattingonly one argument wanted for theorem

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

only one argument wanted for theorem

Post by juliette »

I only want the third argument to show up in my theorem environment, so I made the last argument of \newthoremstyle: {\thmnote{ #3}}

But now I'm getting the error message that 'the missing number is being treated as 0'

Here is my document:

Code: Select all

\documentclass{revtex4}
\usepackage{amsmath}
\usepackage{amsthm}

\newtheoremstyle{examplestyle}  % name of the style to be used
  {}       % measure of space to leave above the theorem. E.g.: 3pt
  {}       % measure of space to leave below the theorem. E.g.: 3pt
  {}   % name of font to use in the body of the theorem
  {}        % measure of space to indent
  {}  % name of head font
  {}   % punctuation between head and body
  {}       % space after theorem head
  {\thmnote{ #3}}           % Manually specify head
\theoremstyle{examplestyle}

\newtheorem{thm}{Theorem}[section]

\begin{document}
\begin{thm}[theorem]
\end{thm}
\end{document}
Do I need to have all three arguments ? Or Could I just have the name of the theorem like I want

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

only one argument wanted for theorem

Post by gmedina »

Hi juliette,

the error that you are getting comes from using an empty argument for the parameter that controls the space after the theorem head; the following code compiles with no problem:

Code: Select all

\documentclass{revtex4}
\usepackage{amsmath}
\usepackage{amsthm}

\newtheoremstyle{examplestyle}  % name of the style to be used
  {}       % measure of space to leave above the theorem. E.g.: 3pt
  {}       % measure of space to leave below the theorem. E.g.: 3pt
  {}   % name of font to use in the body of the theorem
  {}        % measure of space to indent
  {}  % name of head font
  {}   % punctuation between head and body
  {1em}       % space after theorem head
  {\thmnote{ #3}}           % Manually specify head
\theoremstyle{examplestyle}

\newtheorem{thm}{Theorem}[section]

\begin{document}
\begin{thm}[theorem] 
text text
\end{thm}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

Re: only one argument wanted for theorem

Post by juliette »

Thank you very much gmedina!

strange how all the other arguments can be left empty except for that one,

Thank you once again! =)
Post Reply