I made a PSTricks
figure to represent some IPSec
behavior, but when \include
-ing it, I have a scaling problem.
Here's what I produces. When compiling the separate file, everything is right, and all the frames have the same height.
I try this answer, but it didn't work.
Here's my MWE :
\documentclass[pstricks, float]{standalone}
\usepackage{graphicx}
\usepackage[table, usenames, dvipsnames]{xcolor}
\usepackage{pstricks-add}
\usepackage[frenchb]{babel}
\usepackage[locale=FR, per-mode=symbol, abbreviations]{siunitx}
\begin{document}
\begin{pspicture}[showgrid=f](0, 0.75)(12.6, 5.2)
{\psset{framesep=10pt, cornersize=absolute,linecolor=black}
{\psset{fillstyle=solid, fillcolor=lightgray}
\rput[c](5.49,4.5){\rnode{ipsec1}{\psframebox[framesep=5pt]
{\parbox{2.37cm}{\centering IPv4 Header\vphantom{y}\\
next : \textcolor{Cerulean}{\bfseries TCP}}}}}
}
{\psset{fillstyle=solid, fillcolor=Cerulean}
\rput[c](7.6,4.5){\rnode{tcp1}{\psframebox{TCP\vphantom{ay}}}}
\rput[c](9.32,4.5){\rnode{payload1}{\psframebox{Payload}}}
}
\ncbar[angle=-90, armA=0.5cm, linecolor=Cerulean,offsetA=.5cm]{->}{ipsec1}{tcp1}
{\psset{fillstyle=solid, fillcolor=lightgray}
\rput[c](5.49,2){\rnode{ipsec2}{\psframebox[framesep=5pt]
{\parbox{2.37cm}{\centering IPv4 Header\vphantom{y}\\
next : \textcolor{BurntOrange}{\bfseries AH}}}}}
}
{\psset{fillstyle=solid, fillcolor=BurntOrange}
\rput[c](7.96,2){\rnode{ah2}{\psframebox[framesep=5pt]
{\parbox{1.85cm}{\centering AH Header\vphantom{y}\\
next : \textcolor{Cerulean}{\bfseries TCP}}}}}
}
{\psset{fillstyle=solid, fillcolor=Cerulean}
\rput[c](9.8,2){\rnode{tcp2}{\psframebox{{TCP\vphantom{ay}}}}
\rput[c](11.52,2){\rnode{payload2}{\psframebox{Payload}}}
}
\ncbar[angle=-90, armA=0.5cm, linecolor=BurntOrange,offsetA=.5cm]{->}{ipsec2}{ah2}
\ncbar[angle=-90, armA=0.5cm, linecolor=Cerulean,offsetA=.5cm]{->}{ah2}{tcp2}
}
\rput[c](2,4.5){IPv4 Datagram}
\rput[c](2,2){AH Datagram}
\end{pspicture}
\end{document}
BTW I don't think my code is optimal, so feel free to improve it !