Graphics, Figures & TablesBox / Frame around a list

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
cbeberge
Posts: 10
Joined: Sat Mar 13, 2010 3:03 pm

Box / Frame around a list

Post by cbeberge »

Can anyone please tell me how to make a box / frame around a list, the box / frame should have a background color. See attachment!
Attachments
Untitled.jpg
Untitled.jpg (18.91 KiB) Viewed 13501 times

Recommended reading 2024:

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

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

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Box / Frame around a list

Post by frabjous »

How's this?

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[charter]{mathdesign}
\usepackage{eulervm}
\usepackage{enumitem}
\usepackage{xcolor}
\begin{document}

\fcolorbox{black}[HTML]{E9F0E9}{\parbox{\textwidth}{%
\noindent \textbf{Eksempel.}
\begin{enumerate}[nolistsep]
\item Input $h$
\item Input $g$
\item $areal \rightarrow h \cdot g$
\item $areal \rightarrow \frac{areal}{2}$
\item Output $areal$
\end{enumerate}}}

\end{document}
cbeberge
Posts: 10
Joined: Sat Mar 13, 2010 3:03 pm

Re: Box / Frame around a list

Post by cbeberge »

Thank You
cbeberge
Posts: 10
Joined: Sat Mar 13, 2010 3:03 pm

Re: Box / Frame around a list

Post by cbeberge »

Is there anyway to put a horisontal \hline under the pseudocode, ant then put text under the horisontal line ?
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Box / Frame around a list

Post by frabjous »

I don't understand what you're asking for, sorry. What pseudo-code?
cbeberge
Posts: 10
Joined: Sat Mar 13, 2010 3:03 pm

Box / Frame around a list

Post by cbeberge »

Oh Sorry!

In matematic this is called a pseudocode, describes a algorithm.

Code: Select all

\begin{enumerate}[nolistsep]
\item Input $h$
\item Input $g$
\item $areal \rightarrow h \cdot g$
\item $areal \rightarrow \frac{areal}{2}$
\item Output $areal$
\end{enumerate}}}
I wont a \hline, or a line under this code sow i can write with words what the code do :D
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Box / Frame around a list

Post by frabjous »

Inside the colored box, or outside?

Here it is inside:

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[charter]{mathdesign}
\usepackage{eulervm}
\usepackage{enumitem}
\usepackage{xcolor}
\begin{document}

\fcolorbox{black}[HTML]{E9F0E9}{\parbox{\textwidth}{%
\noindent \textbf{Eksempel.}
\begin{enumerate}[nolistsep]
\item Input $h$
\item Input $g$
\item $areal \rightarrow h \cdot g$
\item $areal \rightarrow \frac{areal}{2}$
\item Output $areal$
\end{enumerate}

\hrulefill

Text

}}

\end{document}
cbeberge
Posts: 10
Joined: Sat Mar 13, 2010 3:03 pm

Re: Box / Frame around a list

Post by cbeberge »

Inside, Thank You :D
Post Reply