[comp.text.tex] Latex questions regarding theorems, \newtheorem

gordon@cs.uwa.oz.au (Gordon Royle) (06/12/91)

I am writing mathematics, hence have theorems, lemmas etc.
I can use \newtheorem in the usual way to get my things labelled
appropriately with Theorem 6.2 and Lemma 4.5 etc.
However I do not like having all the theorems typeset in italics. I
would like to change the "theorem-like environment" so that the theorems
are typeset in slanted type.
The LaTeX book does not mention at all how to do it, or in fact where
the "theorem-like environment" is defined....


I would be grateful if anyone could help.

Thanks

Gordon
gordon@cs.uwa.oz.au

geyer@galton.uchicago.edu (06/14/91)

In article <gordon.676703279@ningaui> gordon@cs.uwa.oz.au (Gordon Royle) writes:

> I do not like having all the theorems typeset in italics. I
> would like to change the "theorem-like environment" so that the theorems
> are typeset in slanted type.
> The LaTeX book does not mention at all how to do it, or in fact where
> the "theorem-like environment" is defined....

I'll take this one because its so easy.  It is defined in latex.tex, where
under the heading THEOREM ENVIRONMENTS are defined (the only macros in this
section containing \it)

  \def\@begintheorem#1#2{\it \trivlist \item[\hskip \labelsep{\bf #1\ #2}]}
  \def\@opargbegintheorem#1#2#3{\it \trivlist
        \item[\hskip \labelsep{\bf #1\ #2\ (#3)}]}

redefine them without the \it and you're in business.  Since these macro
names contain a @ they can only be redefined in a style file.  Make your
own, say foo.sty, and then add it to the list in /documentstyle, e. g.,

  \documentstyle[12pt,foo]{article}

This is a good easy example of how to hack style files.  Often you don't
have to understand much about how LaTeX works to make the required changes.

Charles Geyer
Department of Statistics
University of Chicago
geyer@galton.uchicago.edu

antoy@antares.cs.pdx.edu (Sergio Antoy; Assistant Prof of CS) (06/14/91)

In article <gordon.676703279@ningaui> gordon@cs.uwa.oz.au (Gordon Royle) writes:
>
[...deleted stuff...]
>However I do not like having all the theorems typeset in italics. I
>would like to change the "theorem-like environment" so that the theorems
>are typeset in slanted type.
[...deleted stuff...]

Try
\begin{theorem}{\sl
	Your theorem goes here
}\end{theorem}

Sergio Antoy
  Portland State University
  Dept. of Computer Science
  P.O.Box 751
  Portland, OR 97207
  (503) 725-3009
  antoy@cs.pdx.edu

nico@cs.ruu.nl (Nico Verwer) (06/14/91)

In <gordon.676703279@ningaui> gordon@cs.uwa.oz.au (Gordon Royle) writes:

>I can use \newtheorem in the usual way to get my things labelled
>appropriately with Theorem 6.2 and Lemma 4.5 etc.
>However I do not like having all the theorems typeset in italics. I
>would like to change the "theorem-like environment" so that the theorems
>are typeset in slanted type.

I once made a style file which does almost that.
All you'll want to do is a \renewcommand{\theoremstyle}{\sl}.
If you do not want any \theoremclosing, do
\renewcommand{\theoremclosing}{\relax}.
------------------------8<--------------------------
% rmthm.sty, by nico@cs.ruu.nl
% This version is of 14 June 1991.
% You can change the style in which your \newtheorems are typeset with
% \renewcommand{\theoremstyle}{...}.
% Default is \rm (hence the name of this file).
% You can also specify an end-of-theorem marker with
% \renewcommand{\theoremclosing}{...}.
% Default is a box flushed right.
% If you don't want your theorems to be numbered, number them like
% the nonumtheorem theorem environment, i.e.
% \newtheorem{thm}[nonumthm]{Thm}.

\def\@begintheorem#1#2{\theoremstyle 
                       \trivlist \item[\hskip \labelsep{\bf #1\ #2}]}
\def\@opargbegintheorem#1#2#3{\theoremstyle 
                       \trivlist \item[\hskip \labelsep{\bf #1\ #2\ (#3)}]}
\def\@endtheorem{\nopagebreak\theoremclosing\endtrivlist}
\def\theoremstyle{\rm}
\def\theoremclosing{\hfill$\Box$}
\newtheorem{nonumthm}{\relax}
\renewcommand{\thenonumthm}{\relax}
------------------------8<--------------------------

-- 
Nico Verwer                                       | nico@cs.ruu.nl
Dept. of Computer Science, University of Utrecht  | phone: +31 30 533921
p.o. box 80.089, 3508 TB Utrecht, The Netherlands | fax:   +31 30 513791

ms361@leah.albany.edu (Mark Steinberger) (06/14/91)

In article <gordon.676703279@ningaui> gordon@cs.uwa.oz.au (Gordon Royle) writes:
>I would like to change the "theorem-like environment" so that the theorems
>are typeset in slanted type.

Note the \sl below.

\newtheorem{theorem}{Theorem}[section]
\newenvironment{Thm}{\begin{theorem}\sl}{\end{theorem}}


--Mark

texinfo1@rusmv1.rus.uni-stuttgart.de (Rainer Schoepf) (06/15/91)

In article <1991Jun14.024242.6256@midway.uchicago.edu> geyer@galton.uchicago.edu writes:
>
>In article <gordon.676703279@ningaui> gordon@cs.uwa.oz.au (Gordon Royle) writes:
>
>> I do not like having all the theorems typeset in italics. I
>> would like to change the "theorem-like environment" so that the theorems
>> are typeset in slanted type.
>> The LaTeX book does not mention at all how to do it, or in fact where
>> the "theorem-like environment" is defined....
>
>I'll take this one because its so easy.  It is defined in latex.tex, where
>under the heading THEOREM ENVIRONMENTS are defined (the only macros in this
>section containing \it)
>
>  \def\@begintheorem#1#2{\it \trivlist \item[\hskip \labelsep{\bf #1\ #2}]}
>  \def\@opargbegintheorem#1#2#3{\it \trivlist
>        \item[\hskip \labelsep{\bf #1\ #2\ (#3)}]}
>
>redefine them without the \it and you're in business.  Since these macro
>names contain a @ they can only be redefined in a style file.  Make your
>own, say foo.sty, and then add it to the list in /documentstyle, e. g.,
>
>  \documentstyle[12pt,foo]{article}
>
>This is a good easy example of how to hack style files.  Often you don't
>have to understand much about how LaTeX works to make the required changes.
>
>Charles Geyer
>Department of Statistics
>University of Chicago
>geyer@galton.uchicago.edu


No need to re-invent the wheel. I recommend the use of Frank Mittelbach's
excellent set of theorem style options. They are now used even in the AMS's
AMS-LaTeX package.

How to get them? Well, look into one of the large servers. I'm sure that it's
somewhere on ymir.claremont.edu, probably in [.tex.inputs...].

Rainer Sch"opf