extra indented space in parbox within colorbox within colorbox

490 views
Skip to first unread message

Arne

unread,
Nov 20, 2011, 5:59:02 PM11/20/11
to LaTeX Users Group
I am looking for a solution to my problem related to an extra space
indent in a
colorbox that is within another colorbox. Specifically, the
``inside'' color box is
indented about one space from the left boundary of the ``outside''
color box. See the
example code.

\documentclass[letterpaper]{article}
\usepackage[svgnames]{xcolor}
\usepackage{calc}
\usepackage{fancybox}

\begin{document}
\begin{center}
\shadowbox{%
\colorbox{Wheat}{%
\begin{minipage}{12cm}
\colorbox{BurlyWood}{\parbox[t]{\textwidth-\fboxsep}{\textbf{Short
Heading for this
Box}}}\par\vspace{1ex}
\small I am looking for a solution to my problem related to an extra
space indent in a
colorbox that is within another colorbox. Specifically, the
``inside'' color box is
indented about one space from the left boundary of the ``outside''
color box. See the
example code.
\end{minipage}}%
}%
\end{center}

\end{document}

Peter Flynn

unread,
Nov 20, 2011, 6:54:21 PM11/20/11
to latexus...@googlegroups.com
On Sun, Nov 20, 2011 at 10:59 PM, Arne <aha...@iastate.edu> wrote:
I am looking for a solution to my problem related to an extra space indent in a colorbox that is within another colorbox.  Specifically, the ``inside'' color box is indented about one space from the left boundary of the ``outside'' color box.  See the
example code.

You need to set and reset the \fboxsep at the right points to do this:
 

\documentclass[letterpaper]{article}
\usepackage[svgnames]{xcolor}
\usepackage{calc}
\usepackage{fancybox}

\begin{document}
\begin{center}\fboxsep0pt
\shadowbox{\fboxsep3pt

\colorbox{Wheat}{%
\begin{minipage}{12cm}
\colorbox{BurlyWood}{\parbox[t]{\textwidth-\fboxsep}{\textbf{Short
Heading for this
Box}}}\par\vspace{1ex}
\small I am looking for a solution to my problem related to an extra
space indent in a
colorbox that is within another colorbox.  Specifically, the
``inside'' color box is
indented about one space from the left boundary of the ``outside''
color box.  See the
example code.
\end{minipage}}%
}%
\end{center}

\end{document}

///Peter

Arne

unread,
Nov 20, 2011, 9:39:33 PM11/20/11
to LaTeX Users Group
Thanks Peter.


What you provided was close to what I wanted and made clear what I
needed to do.

The following works.

\documentclass[letterpaper]{article}
\usepackage[svgnames]{xcolor}
\usepackage{calc}
\usepackage{fancybox}

\begin{document}
\begin{center}
\shadowbox{\fboxsep0pt


\colorbox{Wheat}{%
\begin{minipage}{12cm}

\colorbox{BurlyWood}{\parbox[c][3ex]{\textwidth-\fboxsep}


{\textbf{Short Heading for this Box}}}\par\vspace{1ex}
\small I am looking for a solution to my problem related to an extra
space indent in a colorbox that is within another color box.
Specifically, the ``inside'' color box is indented about one space
from the left boundary of the ``outside'' color box. See the example
code.
\end{minipage}}%
}%
\end{center}

\end{document}

Werner Grundlingh

unread,
Dec 16, 2011, 2:11:43 AM12/16/11
to latexus...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages