7

In the current paper I am writing I make an extensive use of definitions, therefore I've added the amsthm package to my document and I've defined a new command:

\newtheorem{definition}{Definition}

so that I can call it in my document in the following way:

\begin{definition}
...
\end{definition}

Everything works ok, but I would like to change the appearance of these definitions, giving them a cleaner look. By default, this is how the definitions look like:

enter image description here

This is what I would like to have:

  1. Make the text normal and not italicized, so that \emph{} commands can look the way they are supposed to
  2. After Definition 10 I would like to have the name of the defined notion, so for example: Definition 10 - Algebra
  3. I would like to break the line after the end of the definition heading, so that the actual definition begins on the following line
  4. Finally, it would be nice to have a way to separate the definition title from the definition itself, for example with a line above and below the definition title (something like a box)

Are all of these things possible?

2
  • 1
    this doesn't address all of your requests (gonzalo has done that), but i would like to point out that if all you wanted was for the text of the definition to be roman rather than italic, amsthm has three theorem styles, two of which have roman text. this answer explains the differences. Commented Feb 18, 2013 at 19:15
  • @barbarabeeton thanks for the link, I didn't know that :) Commented Feb 18, 2013 at 21:05

1 Answer 1

9

You can use \newtheoremstyle and \theoremstyle (from amsthm) to give your structure the desired formatting; the optional argument od the definition environment can be used to include the "name" of the definition:

\documentclass{article}
\usepackage{amsthm}

\newtheoremstyle{mydef}
{\topsep}{\topsep}%
{}{}%
{\bfseries}{}
{\newline}
{%
  \rule{\textwidth}{0.4pt}\\*%
  \thmname{#1}~\thmnumber{#2}\thmnote{\ -\ #3}.\\*[-1.5ex]%
  \rule{\textwidth}{0.4pt}}%

\theoremstyle{mydef}
\newtheorem{definition}{Definition}

\begin{document}

\begin{definition}[Algebra]
Test definition.
\end{definition}

\end{document}

enter image description here

1
  • begin{itemize} doesn't seem to produce a list with this definition. Can you modify it to allow this option?
    – user341502
    Commented Nov 21, 2017 at 17:50

You must log in to answer this question.

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