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.

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

wanna thing

I want to make the number line as above. How could I make this for TeX?

Thanks in advance.

share|improve this question
Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – mvkorpel Jul 9 '14 at 11:49
TikZ / PGF is a package capable of producing such pictures. – mvkorpel Jul 9 '14 at 11:52
up vote 6 down vote accepted

A much shorter solution


      letter/.style={circle, minimum size=3pt, inner sep=0, outer sep=0, fill=black, label=below:#1},
      number/.style={fill=white, pos=.5}
      \draw (0,0) --

          (A) to[bend left]      node[number]{2} (C)
          (C) to[bend right=50]     node[number]{1} (B)
          (A) to[bend left=50] node[number]{3} (B)

enter image description here

First you draw a line between two arbitrary points, here I choose (0,0) and (8,0) (horizontal line of length 8). While doing so you create the three nodes A B and C at some percentage of the length (20, 60 and 80 in our case). You name them (A) (B) and (C). Then to draw the dashed lines you connect them with a to path specifying that you want them dashed and bent. While you do that you also create a node midway with the number label.

share|improve this answer

number line with tikz


\clip(-2.5,-1) rectangle (11.5,2.5);
\draw (-2,0)-- (3,0);
\draw (5,0)-- (10,0);
\draw [dash pattern=on 2pt off 2pt](-1,0)..controls (0.25,1) and (1,1) .. (2,0)  ;
\draw [dash pattern=on 2pt off 2pt](-1,0)..controls (-0.25,0.4) and (0.25,0.4) .. (1,0)    ;
\draw [dash pattern=on 2pt off 2pt](1,0)..controls (1.25,-0.35) and (1.75,-0.35) .. (2,0)  ;
\draw [dash pattern=on 2pt off 2pt](6,0)..controls (7,-1) and (8,-1) .. (9,0)  ;
\draw [dash pattern=on 2pt off 2pt](7,0)..controls (7.75,0.8) and (8.25,0.8) .. (9,0)    ;
\draw [dash pattern=on 2pt off 2pt](6,0)..controls (6.25,0.35) and (6.75,0.35) .. (7,0)  ;

\draw [fill=black] (-1,0) circle (1.5pt);
\draw[color=black] (-1,-0.3) node {$A$};
\draw [fill=black] (2,0) circle (1.5pt);
\draw[color=black] (2,-0.3) node {$C$};
\draw [fill=black] (1,0) circle (1.5pt);
\draw[color=black] (1,-0.3) node {$B$};
\draw [fill=black] (6,0) circle (1.5pt);
\draw[color=black] (6,-0.3) node {$C$};
\draw [fill=black] (7,0) circle (1.5pt);
\draw[color=black] (7,-0.3) node {$A$};
\draw [fill=black] (9,0) circle (1.5pt);
\draw[color=black] (9,-0.3) node {$B$};

\draw (0.6,0.75) node [fill=white]
\draw (0,0.32) node [fill=white]
\draw (1.5,-0.3) node [fill=white]
\draw (7.5,-0.75) node [fill=white]
\draw (8,0.6) node [fill=white]
\draw (6.5,0.25) node [fill=white]


and the result enter image description here

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.