Tell me more ×
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.

I am writing a mathematical report. where i need to include some examples, e.g., solving odes. is there a package which provide a good environment for writing examples?

share|improve this question
2  
What in particular would you expect this package to do? amsthm, for example, will let you define a new "theorem-like" environment, i.e. it has a numbered heading ("Example 1.1") that can be referenced. – Ulrich Schwarz Apr 4 '11 at 7:15
@Ulrich. Thanks Schwarz. Can you please post the latex-source. The document will contain lots of "examples" (e.g. solving a ode, solving a matrix equation). It is a very common thing. Is there a package to achieve it? Thanks again for your time. – Mia Apr 4 '11 at 7:47

1 Answer

up vote 5 down vote accepted

One possibility is to add amsthm package and then add something like:

\newtheorem{example}{Example}

for the definition of the Example environment. You can adjust the counters and such things as well.

Here's a minimal example:

\documentclass{article}

\usepackage{amsthm}
\newtheorem{example}{Example}

\begin{document}
    Here is the first example:
    \begin{example}
        First example
    \end{example}
    and here's the second
    \begin{example}
        last example
    \end{example}
\end{document}
share|improve this answer
Thank you Dror. – Mia Apr 4 '11 at 9:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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