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?

  • 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. – barbara beeton Feb 18 '13 at 19:15
  • @barbarabeeton thanks for the link, I didn't know that :) – user1301428 Feb 18 '13 at 21:05
8

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.