Text FormattingHow to number definitions ... ?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm

How to number definitions ... ?

Post by helllo »

Hi everyone :) ,
I've got a quick question :
I don't have numbers with my definitions using this :

Code: Select all

\newenvironment{definition}[1][Definition]{\begin{trivlist}
Do you know how to change it so I can get numbered definitions ?
Thanks :ugeek: !
Last edited by helllo on Wed Sep 01, 2010 2:12 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

How to number definitions ... ?

Post by meho_r »

You don't have anything at all using that. By now, you should be well acquainted with Board Rules.

However, why not using amsmath's theorem? E.g.:

Code: Select all

\documentclass{article}

\usepackage{lipsum}% just to generate some dummy text

\usepackage{amsmath}

\newtheorem{definition}{Definition}
\newcommand{\mydef}[1]{\begin{definition}#1\end{definition}}

\begin{document}

\section{A section}

\begin{definition}
\lipsum[1]
\end{definition}

\mydef{\lipsum[2]} 

\section{Another section}

\mydef{\lipsum[3]}

\end{document}

More infos and how to do further customizations can be found here.
helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm

Re: How to number definitions ... ?

Post by helllo »

Hi,
I don't have the "lipsum" package, but the rest worked!
Thanks :)
Post Reply