[pstricks] Shaded boxes request for ideas

Herbert Voss Herbert.Voss at FU-Berlin.DE
Mon Mar 9 07:42:32 CET 2009


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



More information about the PSTricks mailing list