Graphics, Figures & Tablescolor inside a box

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
abu aasiyah
Posts: 26
Joined: Wed Sep 30, 2009 7:04 pm

color inside a box

Post by abu aasiyah »

Hey,

How do I put a background color inside a box. For instance:

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[danish]{babel} % danske overskrifter
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amsmath}

\begin{document}

\framebox[0.95\linewidth]{
\begin{minipage}{0.90\linewidth}
\noindent \underline{\textbf{Geometriske betingelser}}:
\begin{align}
\kappa=\frac{d^{2}\omega}{dx^{2}}, \qquad \epsilon=\frac{d\nu}{dx}
\end{align}
\end{minipage}
}

\end{document}

PS! I hope thisis the right place to ask such a question.

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

color inside a box

Post by gmedina »

That depends on your intent; for instance, you could use \colorbox (from the xcolor package), or a variation on one of the environments provided by the framed package, or some of the methods offered by the empheq package.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

color inside a box

Post by Stefan Kottwitz »

You could use \fcolorbox, for example:

Code: Select all

\fcolorbox{black}{yellow}{
\begin{minipage}{0.90\linewidth}
...
\end{minipage}
}
Stefan
LaTeX.org admin
Post Reply