Hello everybody,
I am writing a lecture note where I insert some examples to explain somethings.
I would like the examples to be appeared differently from the rest (distinguished from the rest). So, I have been
looking for an environment that can do this. Say, text in example should be smaller
or put in a box or having a vertical line on the right.
Could you please help me which environment should be used?
Many thanks in advance.
Vinh Phu
General ⇒ how to write numbered examples in lecture notes
-
- Posts: 3
- Joined: Thu Oct 23, 2008 4:35 pm
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
how to write numbered examples in lecture notes
Have a look at packages like amsthm or ntheorem. If these do not provide suitable environments, describe your ideas more precise. Perhaps we then could create an environment that fits your needs.
Best regards and welcome to the board
Thorsten¹
Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 3
- Joined: Thu Oct 23, 2008 4:35 pm
Re: how to write numbered examples in lecture notes
Hi localghost,
It seemed that the ntheorem package is what I am looking for but when I used
\usepackage[framed,amsmath,thmmarks]{ntheorem}
\usepackage{framed}
I got the following error
Package ntheorem Error: Theorem style plain already defined.
How to remove it please.
Thanks.
It seemed that the ntheorem package is what I am looking for but when I used
\usepackage[framed,amsmath,thmmarks]{ntheorem}
\usepackage{framed}
I got the following error
Package ntheorem Error: Theorem style plain already defined.
How to remove it please.
Thanks.
-
- Posts: 3
- Joined: Thu Oct 23, 2008 4:35 pm
Re: how to write numbered examples in lecture notes
Sorry for stupid questions, I figured out how to do. That's it.
\usepackage{amsmath,amssymb,amsfonts,stmaryrd}
\usepackage[framed,amsmath,thmmarks]{ntheorem}
(can not put amsmath in both)
Then, the following define a Example environment with a vertical line along the left side:
\theoremstyle{example}
\theorembodyfont{\small}
\definecolor{gray}{rgb}{0.6,0.6,0.6}
\renewcommand*\FrameCommand{{\color{gray}\vrule width 5pt \hspace{10pt}}}
\newframedtheorem{exam}{Example}[section]
Thanks a lot.
P
\usepackage{amsmath,amssymb,amsfonts,stmaryrd}
\usepackage[framed,amsmath,thmmarks]{ntheorem}
(can not put amsmath in both)
Then, the following define a Example environment with a vertical line along the left side:
\theoremstyle{example}
\theorembodyfont{\small}
\definecolor{gray}{rgb}{0.6,0.6,0.6}
\renewcommand*\FrameCommand{{\color{gray}\vrule width 5pt \hspace{10pt}}}
\newframedtheorem{exam}{Example}[section]
Thanks a lot.
P