Text FormattingExample environment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Blaze
Posts: 6
Joined: Sat Jan 21, 2012 10:44 pm

Example environment

Post by Blaze »

Hello everybody.

I would like to create a new environment for the examples on my documents. I would like that it seems like the one on the picture:
example-env.jpg
example-env.jpg (4.73 KiB) Viewed 1662 times
I know how to fill the background of the text I´ll write in there... but I don´t know how to put in to a rectangle the "Exercise 1" like it´s shown on the picture. I wish someone knows how to do this.

Thanks.
Last edited by localghost on Fri Jan 27, 2012 6:17 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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Example environment

Post by Stefan Kottwitz »

Hi,

you could use \fbox for this, such as

Code: Select all

\fbox{Ejem 3}
or \fbox{\yourmacro}, if this would actually be a macro.

Stefan
LaTeX.org admin
Post Reply