7
$\begingroup$

There are several ways one may format a definition in latex, but each has their problems.

  1. Use the amsthm package, and the usual style for theorems. This will result in everything italicized. It is difficult to catch the term you are defining, even if you non-italicize it.

  2. Use the amsthm package, and the style for definitions. This time the term you are defining is the only word/phrase italicized, but the problem is that one does not know where the definition ends. Unlike the proof environment, there is no QED marker, so it is unclear where the definition ends and when the next paragraph starts.

  3. End a definition with a QED-type marker (like a flower or whatever). The problem with this is that there is an over-abundance of markers. Flowers and square boxers.

How do you format your definitions in latex?

$\endgroup$
7
  • 1
    $\begingroup$ My suggestion is #1 but put the term being defined in bold or bold italic. $\endgroup$
    – Deane Yang
    Nov 19, 2010 at 4:15
  • 18
    $\begingroup$ I prefer #2. Although there is not an explicit marker, there is automatically a certain amount of vertical space inserted between the definition's end and the start of the next paragraph. $\endgroup$ Nov 19, 2010 at 4:24
  • 8
    $\begingroup$ I think perhaps this is a better question for the latex.SE site? Or, rather, your question mentions LaTeX at the beginning, but then is mostly about formatting, not about LaTeX use. To the question of formatting, my answer is: make it easy to read. In any case, it really doesn't matter: the journal will impose a house style anyway. $\endgroup$ Nov 19, 2010 at 7:22
  • $\begingroup$ Actually I'm more interested about how to format definitions, rather than about Latex in particular. Perhaps I should edit my question to show my focus? $\endgroup$
    – user2529
    Nov 19, 2010 at 14:03
  • $\begingroup$ My advice: Follow the format of the journal or the publisher. For the term defined I use a macro \Def that puts its argument in bold italic; then if the journal wants something else I make that one change. $\endgroup$ Nov 19, 2010 at 15:34

6 Answers 6

7
$\begingroup$

Since Colin's comment indicates that this is not about $\LaTeX$ and some answers have given good specific advice I want to throw in a more abstract answer:

make sure you write markup

  • worry more about structuring your content
  • and realize a typesetting for your own purposes (say according to established typesetting/layout rules for screen reading, website design, epaper or good old printouts, whichever you prefer to read your own stuff with)
  • BUT do it in such a way that anyone with access to the source (e.g. journal, website) can easily modify the layout (e.g. in $\LaTeX$ make sure redefining your environment is easy, maybe even via options for your own sty file, for a website use good css)

This is not as hard as it sounds -- you just have to overcome the urge to control your layout and focus on your content.

$\endgroup$
4
$\begingroup$

I format mine like this (say we're in "Section 1"):

Definition 1.1 (G-Parking Function) A G-Parking Function, relative to a vertex q, is...

This way, you know what's being defined, and the end of the italics tells you where the defintion ends.

$\endgroup$
2
$\begingroup$

I set my definitions in roman font with the defined term in italic. Just switch to roman font inside the definition environment.

This way avoids the visual confusion caused by reverse emphasis of roman font inside slant or italic font. With my solution, the definition looks like normal text, but is set off formally like a theorem. Meanwhile, it also distinguishes the formal definitions from the theorems, since the font is roman.

$\endgroup$
3
  • $\begingroup$ I used to do this, until \theoremstyle became available (or, rather, until I became aware of it); it produces the same effect. In the old days, I had temporary environments like dftemp defined with \newtheorem (to handle the heading and numbering) and then I defined environments like df that invoke dftemp but add, at the beginning, \normalfont. De-italicizing is, in my opinion, good for definitions and absolutely essential for things like examples that may go on for several paragraphs. $\endgroup$ Nov 19, 2010 at 13:24
  • $\begingroup$ Yes, there are numerous ways to automate it; the main thing is the effect: a formally set definition, but with a normal font. $\endgroup$ Nov 19, 2010 at 13:33
  • 1
    $\begingroup$ This is roughly #2 among the suggestions I wrote. Joel, How do you signal the end of the definition? Generally because theorems environments don't have a clear end point, but usually they are followed by a proof environment rather than some text. $\endgroup$
    – user2529
    Nov 19, 2010 at 14:02
2
$\begingroup$

This is how I format my definitions in LaTeX:

\documentclass{article}
\usepackage{color,amsmath,amssymb}
\usepackage{framed}
\makeatletter
\newdimen\errorsize \errorsize=0.2pt
% Frame with a label at top
\newcommand\LabFrame[2]{%
    \fboxrule=\FrameRule
    \fboxsep=-\errorsize
    \textcolor{FrameColor}{%
    \fbox{%
      \vbox{\nobreak
      \advance\FrameSep\errorsize
      \begingroup
        \advance\baselineskip\FrameSep
        \hrule height \baselineskip
        \nobreak
        \vskip-\baselineskip
      \endgroup
      \vskip 0.5\FrameSep
      \hbox{\hskip\FrameSep \strut
        \textcolor{TitleColor}{\textbf{#1}}}%
      \nobreak \nointerlineskip
      \vskip 1.3\FrameSep
      \hbox{\hskip\FrameSep
        {\normalcolor#2}%
        \hskip\FrameSep}%
      \vskip\FrameSep
    }}%
}}
\definecolor{FrameColor}{rgb}{0.25,0.25,1.0}
\definecolor{TitleColor}{rgb}{1.0,1.0,1.0}

\newenvironment{contlabelframe}[2][\Frame@Lab\ (cont.)]{% 
  % Optional continuation label defaults to the first label plus
  \def\Frame@Lab{#2}%
  \def\FrameCommand{\LabFrame{#2}}%
  \def\FirstFrameCommand{\LabFrame{#2}}%
  \def\MidFrameCommand{\LabFrame{#1}}%
  \def\LastFrameCommand{\LabFrame{#1}}%
  \MakeFramed{\advance\hsize-\width \FrameRestore} 
}{\endMakeFramed} 
\newcounter{definition}
\newenvironment{definition}[1]{%
  \par
  \refstepcounter{definition}%
  \begin{contlabelframe}{Definition \thedefinition:\quad #1}
 \noindent\ignorespaces}
{\end{contlabelframe}} 
\makeatother
\begin{document}
\begin{definition}{Quadratic Equation}
A Quadratic Equation is an equation in the form:
\begin{equation}
ax^2+bx+c=0
\end{equation}
where \(a,b,c\in\mathbb{R}\).
\end{definition}
\end{document}

and this is what you get (mirror1, mirror2):

$\endgroup$
1
  • 2
    $\begingroup$ Link to result is dead. $\endgroup$
    – Vlad
    Oct 16, 2015 at 5:58
1
$\begingroup$

My preamble typically includes

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem*{corollary}{Corollary}`

\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{conjecture}{Conjecture}
\newtheorem*{example}{Example}
\newtheorem{algorithm}{Algorithm}

\theoremstyle{remark}
\newtheorem*{remark}{Remark}
\newtheorem*{note}{Note}
\newtheorem{case}{Case}

and I'm using the AMS packages. I'm not too sure what code you're using, but with mine I get a forced jump after the \end{definition} command that makes it clear where the definition stops.

I would also suggest putting the term you're defining in bold or italic within the definition.

$\endgroup$
0
$\begingroup$

1) If use an (i.e., any) environment for your definitions, there will be a little vskip after it, so it is easy to see where it ends.

2) You can control the font used in the definition (or any) environment. Use \tt or \sf if you want different than \it.

3) Put the \emph{defined} word in \emph as here. That will automatically use an alternate font: if the text is otherwise \rm, it will use \it and if the text is in \it, it will use \rm. I think that under some documentclass-es it might produce \bf, but that is usually by the choice of the publisher.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.