Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Why aren't the vertical borders of my nodes overlapping, as the horizontal ones do? How can I force them to overlap (thereby preventing the vertical lines between nodes from looking stronger) and avoid the length problem at the right of the second line?

By the way, is there a command I can use instead of minimal width, perhaps something like exact width?

enter image description here

\documentclass[tikz]{standalone}
\usepackage{fourier}
\begin{document}
\xdef\LW{.99*241pt}%\linewidth
\xdef\BLS{\baselineskip} 

\begin{tikzpicture}[y={(0,-\BLS)},inner sep=0pt]

\node[draw,minimum width=1.2,minimum height=2.5*\BLS,text width=1cm,align=flush center,font=\scriptsize] (11) at (0,0) {Poids jusqu'\`a} ; 

\node[draw,anchor=north west,minimum width=(\LW-1.2cm),minimum height=\BLS,] at (11.north east) {Tarifs nets (\$)};

\node[draw,anchor=south west,minimum width=(\LW-1.2cm)*.24,minimum height=1.5*\BLS,align=flush center,font=\scriptsize,text width=1.6cm] (22) at (11.south east) {Vers France m\'etropolitaine};

\node[draw,anchor=south west,minimum width=(\LW-1.2cm)*.38,minimum height=1.5*\BLS,align=flush center,font=\scriptsize,text width=1.8cm] (23) at (22.south east) {Vers zone outre-mer 1};

\node[draw,anchor=south west,minimum width=(\LW-1.2cm)*.38,minimum height=1.5*\BLS,align=flush center,font=\scriptsize,text width=1.8cm] at (23.south east) {Vers zone outre-mer 2};

\end{tikzpicture}

\end{document}
share|improve this question
5  
try to add "outer sep=0pt" in tikzpicture option. this should help –  Zarko Mar 31 at 11:59
    
Bingo ! if you write an answer I'll give you the bonus ;-) –  Tarass Mar 31 at 12:01

1 Answer 1

up vote 6 down vote accepted

OK, there is answer, where i take -- to my opinion -- more simple way to draw your picture:

\documentclass[tikz]{standalone}
    \usetikzlibrary{calc,chains}
    \usepackage{fourier}
\begin{document}
    \begin{tikzpicture}[
    node distance=0mm,
    start chain=going right,
box/.style = {name=n#1,
              draw, minimum height=9mm, text width=17mm, 
              inner sep=1mm, outer sep=0pt,
              font=\scriptsize, align=flush center, on chain}
                        ]
\node[box=11]       {Vers France m\'etropolitaine};
\node[box=12]       {Vers zone outre-mer 1\vphantom{p}};
\node[box=13]       {Vers zone outre-mer 2\vphantom{p}};
    \path let   \p1=(n11.west),
                \p2=(n13.east) ,
                \n1={veclen(\x2-\x1,\y2-\y1)} in
     node[box=21,minimum width=\n1,above right=of n11.north west]      
                    {Tarifs nets (\$)};
    \path let   \p1=(n11.south west),
                \p2=(n21.north west) ,
                \n1={veclen(\x2-\x1,\y2-\y1)} in
     node[box=0,minimum height=\n1,text width=9mm, above left=of n11.south west]
                    {Poids jusqu'\`a};
\end{tikzpicture}

\end{document} 

If you like to have different width of bottom boxes, you just move text width from common deffinitinion of box shape to particular boxes. Measurement of their width and height with \path let \p1=(...) ... will take a care that the length of above box and height of the box will be always correct.

share|improve this answer
    
Thank for this interesting example. I found this more complex and less readable. This was just a try yo avoid complex tabular work, and I'll certainly make macros to avoid repetitive pieces of code. –  Tarass Mar 31 at 13:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.