theorem formatting - tex - latex stack exchange

2
sign up log in tour help × TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required. Theorem formaing Theorem formaing \theoremstyle{remark} \newtheorem{example}{Example} Then: \begin{example} Some text \end{example} Output is: Example 1. Some text What is the way to automatically obtain without indent: Example 1. Some text ? I tried to write: \begin{example} \\Some text \end{example} But there are two drawbacks, first it must be done every-time, second drawback is that it doesn't compile and Latex error is: ./doc.tex:60:There's no line here to end.\\S {formatting} {theorems} asked May 20 '11 at 15:07 scdmb 413 413 413 413 3 10 1 thmtools may help, otherwise switch to the ntheorem pacakge and learn to use it. It also have a concept, but it is not about the fonts (as it is with ), \theoremstyle amsthm \theoremstyle{break} will do what you want daleif May 20 '11 at 15:16 1 Answer Here's an example of the required new style definition using : amsthm \documentclass{article} \usepackage{amsthm} \newtheoremstyle{mystyle}% name {3pt}%Space above {3pt}%Space below {\normalfont}%Body font {0pt}%Indent amount {\itshape}% Theorem head font {.}%Punctuation after theorem head {\newline}%Space after theorem head 2 {}%Theorem head spec (can be left empty, meaning ‘normal’) \theoremstyle{mystyle} \newtheorem{exam}{Example} \begin{document} \begin{exam} Test exam Theorem formatting - TeX - LaTeX Stack Exchange http://tex.stackexchange.com/questions/18698/theorem-formatting 1 of 2 12/25/2013 12:56 PM

Upload: aseliajulia-julia

Post on 21-Jan-2016

14 views

Category:

Documents


0 download

DESCRIPTION

LATeX, exchange ,....

TRANSCRIPT

Page 1: Theorem Formatting - TeX - LaTeX Stack Exchange

sign up log in tour help

×

TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting

systems. It's 100% free, no registration required.

Theorem formaingTheorem formaing

\theoremstyle{remark} \newtheorem{example}{Example}

Then:

\begin{example}

Some text

\end{example}

Output is:

Example 1. Some text

What is the way to automatically obtain without indent:

Example 1.

Some text

?

I tried to write:

\begin{example}

\\Some text

\end{example}

But there are two drawbacks, first it must be done every-time, second drawback is that it doesn't compile and

Latex error is:

./doc.tex:60:There's no line here to end.\\S

{ formatting} {theorems}

asked May 20 '11 at 15:07

scdmb

413413413413 3 10

1111

thmtools may help, otherwise switch to the ntheorem pacakge and learn to use it. It also have a

concept, but it is not about the fonts (as it is with ), \theoremstyle amsthm \theoremstyle{break}

will do what you want daleif May 20 '11 at 15:16

1 Answer

Here's an example of the required new style definition using :amsthm

\documentclass{article}

\usepackage{amsthm}

\newtheoremstyle{mystyle}% name

{3pt}%Space above

{3pt}%Space below

{\normalfont}%Body font

{0pt}%Indent amount

{\itshape}% Theorem head font

{.}%Punctuation after theorem head

{\newline}%Space after theorem head 2

{}%Theorem head spec (can be left empty, meaning ‘normal’)

\theoremstyle{mystyle}

\newtheorem{exam}{Example}

\begin{document}

\begin{exam}

Test exam

Theorem formatting - TeX - LaTeX Stack Exchange http://tex.stackexchange.com/questions/18698/theorem-formatting

1 of 2 12/25/2013 12:56 PM

Page 2: Theorem Formatting - TeX - LaTeX Stack Exchange

\end{exam}

\end{document}

Here's an example using now the predefined style from the

package:

break ntheorem

\documentclass{article}

\usepackage{ntheorem}

\theoremstyle{break}

\theoremheaderfont{\normalfont\itshape}

\theorembodyfont{\normalfont}

\theoremseparator{.}

\newtheorem{exam}{Example}

\begin{document}

\begin{exam}

Test exam

\end{exam}

\end{document}

Finally, here's an example using and as its backend:thmtools amsthm

\documentclass{article}

\usepackage{amsthm}

\usepackage{thmtools}

\declaretheoremstyle[

spaceabove=3pt, spacebelow=3pt,

headfont=\normalfont\itshape,

notefont=\normalfont, notebraces={(}{)},

bodyfont=\normalfont,

postheadspace=\newline,

qed=\qedsymbol

]{mystyle}

\declaretheorem[style=mystyle]{example}

\begin{document}

\begin{example}

Test exam

\end{example}

\end{document}

edited May 20 '11 at 18:30 answered May 20 '11 at18:20

Gonzalo Medina

167k167k167k167k 10 411 612

Theorem formatting - TeX - LaTeX Stack Exchange http://tex.stackexchange.com/questions/18698/theorem-formatting

2 of 2 12/25/2013 12:56 PM