[pstricks] Shaded boxes request for ideas
David Arnold
dwarnold45 at suddenlink.net
Mon Mar 9 07:59:36 CET 2009
All,
This is brilliant and should work in most of my situations.
But is there a way we can make the cyan boxes expand to fit their
content? Here I've added an extra word and it follows outside the
cyan background area.
\documentclass[12pt]{article}
\usepackage{pstricks-add}
\newpsstyle{bgCyan}{fillstyle=solid,fillcolor=cyan!10,linestyle=none}
\def\pBox#1{\psframebox[style=bgCyan]{\makebox[1.4cm]{%
\tabular{@{}c@{}}#1\endtabular}}}
\begin{document}
\begin{tabular}{ccccc}
\pBox{4} & more than & \pBox{number} & is & \pBox{12}\\
4 & $+$ & $x$ & $=$ & 12\\
\pBox{Original Dollar\\Balance} & + & \pBox{Mandy's\\Deposit}
& is & \pBox{New\\Balance}
\end{tabular}
\end{document}
I guess I could just adjust the makebox width as needed, but it would
be much better if it were automatic.
D.
On Mar 8, 2009, at 11:42 PM, Herbert Voss wrote:
David Arnold schrieb:
> However, on the first line I'd like to put the 4, number, and 12 is
> boxes of equal size, no boundary, but background shading in cyan. On
> the first line, I'd like the + and the = to centered vertically in
> relation to the boxes around the 4, number, and 12.
>
> Later, I'd like to expand this idea to a first row containing
>
> Original\\Balance & plus & Mandy's\\Deposit & is & New\\Balance
>
> The \\ means to imply that "Original Balance" is typeset as two lines
> in one shaded background box, again vertically centered on the "plus."
>
> Possible with PSTricks?
\documentclass[12pt]{article}
\usepackage{pstricks-add}
\newpsstyle{bgCyan}{fillstyle=solid,fillcolor=cyan,linestyle=none}
\def\pBox#1{\psframebox[style=bgCyan]{\makebox[1.4cm]{%
\tabular{@{}c@{}}#1\endtabular}}}
\begin{document}
\begin{tabular}{ccccc}
\pBox{4} & more than & \pBox{number} & is & \pBox{12}\\
4 & $+$ & $x$ & $=$ & 12\\
\pBox{Original\\Balance} & + & \pBox{Mandy's\\Deposit}
& is & \pBox{New\\Balance}
\end{tabular}
\end{document}
Herbert
_______________________________________________
PSTricks mailing list
PSTricks at tug.org
http://tug.org/mailman/listinfo/pstricks
More information about the PSTricks
mailing list