[pstricks] Problem placing boxes and undwanted space

Herbert Voss LaTeX at zedat.fu-berlin.de
Thu May 26 21:22:47 CEST 2005


Ulrik Stervbo wrote:

>Hello everyone,
>
>I'm working on making it easier (for me) to make posters with latex. To comply
>with the CVI of Novo Nordisk, I need a box with rounded corners and on the top
>of that a heading:
>
>+-- Abstract ---------+
>| text text text text |
>| text text text text |
>+---------------------+
>  
>
\documentclass{article}
\usepackage{calc,pstricks}

\newlength\postercolwidth
\newlength\postercolsep
\def\roundedness{0.2}

\newcount\postercolnum \postercolnum=2
\setlength\postercolsep{0.5cm}
\setlength\postercolwidth{(\textwidth - \postercolsep) / \postercolnum}


\newpsstyle{boxstyle}{framearc=\roundedness,fillstyle=solid,fillcolor=lightgray,framesep=4mm}
\newsavebox\PBox
\def\myBox#1#2#3{%
  \sbox\PBox{\psframebox[style=boxstyle]{\parbox{#1}{#3}}}
  \begin{pspicture}(\wd\PBox,2.2\ht\PBox)%\psgrid
    \rput[lb](0,0){\usebox\PBox}
    \rput[l](5\fboxsep,1.9\ht\PBox){\colorbox{yellow}{#2\hspace{\fboxsep}}}
  \end{pspicture}%
}

\begin{document}

>One problem is that there is a space between the textbox and the page margin,
>another problem is that the headingbox is placed at the top of the textbox
>minus some length, which I have no idea of what is.
>
>  
>

>\usepackage{calc}
>\usepackage[dvips,a0paper,portrait,noheadfoot,
>  
>
option dvips is not needed, it is dione by the configure script of geometry.

>% Set the rounding of the archs to Novo's default according to theis CVI:
>% 1/5 of the shortest side
>\newcount\roundedness
>\pst at divide{1pt}{5pt}\roundedness
>  
>
\def\roundedness{0.2}

>\def\abstractbox{\@ifnextchar [{\abstractbox at i}{\abstractbox at i[]}}%
>\def\abstractbox at i[#1]#2{%
>        % Create the textbox'
>       
>\savebox{\sb at Postertextheadingbox}{\psframebox[framesep=0pt,linestyle=none,fillstyle=solid,fillcolor=yellow]{%
>                \hspace{3pt}\Large Abstract\hspace{3pt}}}
>        \savebox{\sb at Postertextbox}{
>  
>
        \savebox{\sb at Postertextbox}{% <--!!!!!

and once more later

Herbert





More information about the PSTricks mailing list