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.

I have a single line matrix made with TikZ:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\node [matrix,fill=white!20,draw=blue] (my matrix) at (3,2)
{
\node(a) {40}; & \node{AE}; & \node{B0}; & \node(b) {05}; & \node(b) {05};\\
};
\end{tikzpicture}
\end{document}

Is there a way to "twist" this matrix along a curve (I would like to illustrate something like a flow ...) and to "open it" at both ends?

share|improve this question
    
Please provide a minimal example and state your dependencies. Your replace ampersand with doesn't work work for me. Are you using a recent CVS version? –  Marc van Dongen Feb 26 '12 at 10:04
    
OK. I removed the "replace ampersand". I am using texlive 2010. The code I show compile without problem. My question is about the possibility to "twist" this matrix. (thanks percusse) –  jean Feb 26 '12 at 10:11
    
I have completed your code, however effectively you can do the same with :\matrix [fill=white!20,draw=blue,matrix of nodes] (my matrix) {40 & AE & B0& 05 & 05 \\};. You don't need to enter \node in each cell. Moreover, I don't think matrix is the way to go but you can do that with text decorations. See manual Section 30.6 –  percusse Feb 26 '12 at 10:17
    
thanks percusse; il will have a look to text decorations ! –  jean Feb 26 '12 at 10:32
    
How to do you want to specify the curve? –  Peter Grill Feb 26 '12 at 17:13

1 Answer 1

¡Viva la Answering the unanswered movement !

I have written a simple code demonstrating the detail in my comment. The details are given in the manual section 30.6 (version 2.10)

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,decorations.text}
\begin{document}
\begin{tikzpicture}
\draw[style=help lines,opacity=0.3] (-2,-1) grid[step=1cm] (4,5);
\matrix [fill=white!20,draw=blue,matrix of nodes] (my matrix) {40 & AE & B0 & 05 & 05 \\};
\draw[decoration={raise=-1.2mm,
                    text along path,
                    text align={center,left indent=2.5cm},
                    text={40 AE B0 05 05},
                    %
                },
                postaction={decorate},
                double,
                double distance=5mm,
                blue] (2,0) -- (2,4) -- (0.5,1.5) -- ++(10:3cm);
\end{tikzpicture}
\end{document}

Notice that the text might get weird while trying hard to follow the curve so use responsibly. I think I overdid this when I was testing out different options but anyway here is an image with some further examples:

enter image description here

share|improve this answer
    
Nice.. Any reason you don't just post the code corresponding to the image? –  Peter Grill Mar 23 '12 at 2:05
    
@PeterGrill It's just longish for such a simple detail. Basically I draw two more paths with ..controls (p1) and (p2)... –  percusse Mar 23 '12 at 2:16

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.