# Text Alignment within \psframebox

I'm trying to represent the functionning of a device. It has 2 ports, and make computations on the payload of a data packet.

I use pst-node from the PSTricks suite to realise it, b I came across some problems...

1. I'd like to have a data packet made up of 2 parts : header and payload. But the y in Payload causes a bad alignment of the two words. Moreover, it messes up the whole dimensions of the \psframebox. The 2 packets drawn features the 2 problems.

2. I'd like to have the Payload box "concatenated" to the Header box. I tried using the [tl] and [tr] otpions for the rput command, but it's messed up when it comes to binding boxes... Moreover, as the [cr] and [cl] doesn't exist, the data packet boxes aren't vertically aligned with the other (Process and Port 1)

My MWE hereunder summarizes all the problems I have :

\documentclass[￼pstricks, float]{standalone}
\usepackage{graphicx}
\usepackage[table, usenames, dvipsnames]{xcolor}
\usepackage{pstricks, pst-node, pst-circ, pst-plot, pst-3dplot, pst-solides3d, pst-sigsys, pstricks-add, pst-eucl}
\usepackage[frenchb]{babel}
\usepackage[locale=FR, per-mode=symbol, abbreviations]{siunitx}

\begin{document}
\bgroup
%\scalebox{0.8}{
\begin{pspicture}[labelangle=:U, showgrid=false](-5, 1)(13, 6)
\rput[c](-4,4.5){\rnode{priv}{Port 1}}
\rput[cl](12,2.5){\rnode{publ}{Port 1}}

\rput[c](5.5,4.5){\rnode{ipsec}{\psframebox[framesep=10pt,cornersize=absolute,linearc=0.2, linecolor=red]{\textcolor{red}{Process}}}}

\psframe[framearc=.3,linestyle=dashed, linecolor=black!40](-1.5, 1.5)(9.5,5.75)

\end{pspicture}
%}
\egroup
\end{document}


And its output :

Any ideas on how to right this ?

Is that ok that you have a straight line from Port1 to Process??

\documentclass[￼pstricks, float]{standalone}
\usepackage{graphicx}
\usepackage[table, usenames, dvipsnames]{xcolor}
\usepackage[frenchb]{babel}
\usepackage[locale=FR, per-mode=symbol, abbreviations]{siunitx}

\begin{document}
\begin{pspicture}(-5, 1)(13, 6)
\rput[c](-4,4.5){\rnode{priv}{Port 1}}
\rput[cl](12,2.5){\rnode{publ}{Port 1}}
\rput[c](5.5,4.5){\rnode{ipsec}{\psframebox[framesep=10pt,
cornersize=absolute,linearc=0.2, linecolor=red]{\textcolor{red}{Process}}}}
\psframe[framearc=.3,linestyle=dashed, linecolor=black!40](-1.5, 1.5)(9.5,5.75)
\end{pspicture}
\end{document}


• The arrow from Port has to stop at Payload1... – EisenHeim Apr 13 '16 at 13:08
• see edited answer – user2478 Apr 13 '16 at 16:34

Is it what you want? It's easier to do with psmatrix.

Note you don't have to load all PSTricks related packages, as pstricks-add already loads pstricks, pst-plot, pst-node, pst-3d, pst-math and multido. Also, the option usenames for xcolor is unnecessary, as it is the default nowadays. I loaded the x11names option, as it defines may more colours than dvipsnames.

\documentclass[￼pstricks, border=3pt]{standalone}

\usepackage[table, dvipsnames, x11names]{xcolor}
\usepackage{eqparbox}
\usepackage{auto-pst-pdf}

\begin{document}

\def\mylength{\dimexpr1.5cm + \pslinewidth\relax}
\def\pscolhookiii{\hspace*{-\mylength}}
\def\pscolhookv{\hspace*{-\mylength}}
\newlength\mysep
\psset{framesep=4pt, arrowinset=0.15, linejoin=1}
\begin{psmatrix}%
[name=publ] Port1
\setlength{\mysep}{\dimexpr\eqboxwidth{ips}/2+10pt +\pslinewidth\relax}

• One ) is missing at the line \setlength{\mysep}{\dimexpr(\eqboxwidth{ips}/2+10pt +\pslinewidth\relax}. Is it after the /2 ? – EisenHeim Apr 13 '16 at 13:31