TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have drawn a picture using tikz the code of which is shown below:

  \draw [rounded corners=10pt] (0,0) rectangle (4,2);       
    \draw (-3,1) -- (0,1) node [near start, above]{incoming communication};
    \draw (2,3) -- (2,2) node [near start,left]{ input};
    \draw (2,-1.5) -- (2,0) node [midway, left] {subroutine output};
    \draw (1, 1.3) -- (3.5, 1.3) node [midway, above] {identity};
    \draw (1, 0.5) -- (3.5, 0.5) node [midway, above] {sec. param.};

the output is like this:
alt text

Is it possible that the text inside the rectangle be underlined and the line to be as long as the text (like a simple underlined text)?

Is it possible to have each line leading to the rectangle to be like a negative (photo film). I can imagine that some rectangles of thick borders which are set aside each other can do the job of the negative. is there any possibility of scaling a picture of negative and using the pattern for a line? or I must draw those rectangles and have them glued together? :D

share|improve this question
For the underlining: why not simply use \ul from the ulem package? – Caramdir Dec 19 '10 at 12:53
You mean I draw an invisible path and make the text underlined in normal way? I don't know how to make invisible path. It is possible to draw the path as white but the text would be white too (I don't know how to change the color of the text itself and not the whole path). – Yasser Sobhdel Dec 19 '10 at 13:06
You should use \node to place text at arbitrary positions (see the TikZ manual). (btw, the command is \uline, not \ul). – Caramdir Dec 19 '10 at 13:28
up vote 7 down vote accepted

To create underlined text, simply use the ulem package:


        \node at (0,0.5) {\uline{some underlined text}};
        \node at (0,0) {\uline{a second line}};


To create the filmstrip effect, you could use decorations. See chapter 72 of the TikZ manual (v2.10) for how to define your own decoration (the use of decorations is described in chapter 21). The following could get you started (it won't look good with curved paths or paths with edges):


        \fill (0,-5pt) rectangle (10.2pt,5pt);
        \fill[white,rounded corners=1pt] (2pt,-4pt) rectangle (8pt,4pt);
            \clip (0,-5pt) rectangle (\pgfdecoratedremainingdistance,5pt);
            \fill (0,-5pt) rectangle (10pt,5pt);
            \fill[white,rounded corners=1pt] (2pt,-4pt) rectangle (8pt,4pt);

    \draw [decorate] (0,0) -- (3,0);


share|improve this answer

Your Answer


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.