1

I have the following code that works just fine when I compile with pdflatex, but does not work right with latex. In the second case, the lines are fine (at least to my eyes) but all labels are written in (0,0), superimposed one to the other.

In either case, compiling ends with no errors.

Running on Debian Sid, pgfversion 2.10, pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian). Any help is greatly appreciated.

\begin{tikzpicture}
 \draw (0,0) arc (0:360: 1.1cm and 1.1cm);
 \draw[line width = 2pt] (0,0) arc (0:70: 1.1cm and 1.1cm);

 \draw (3,.6) -- (8,.6);
 \draw[line width = 2 pt] (3,.6) -- (5,.6);
 \draw (3 cm, .56cm) -- (3 cm, .65cm) node[anchor=north] {$0$};
 \draw (8 cm, .56cm) -- (8 cm, .65cm) node[anchor=north] {$L$};
 \draw (5 cm, .56cm) -- (5 cm, .65cm) node[anchor=north] {$\ell$};

 \draw (3,-.6) -- (8,-.6);
 \draw[line width = 2 pt] (4.5,-.6) -- (6.5,-.6);
 \draw (3 cm, -.56cm) -- (3 cm, -.65cm) node[anchor=north] {$0$};
 \draw (8 cm, -.56cm) -- (8 cm, -.65cm) node[anchor=north] {$L$};
 \draw (4.5 cm, -.56cm) -- (4.5 cm, -.65cm) node[anchor=north] {$\frac{L-\ell}{2}$};
 \draw (6.5 cm, -.56cm) -- (6.5 cm, -.65cm) node[anchor=north] {$\frac{L+\ell}{2}$};
\end{tikzpicture}
percusse
  • 157,807
japs
  • 111
  • 1
    If you're looking at the dvi file, then it's perfectly normal that the nodes are not showing where they should. You must convert the file to PS or PDF to obtain a correct result. – Philippe Goutet Sep 08 '12 at 20:23
  • I didn't know that. However, when I convert dvi->pdf, the figure shows up even worse than in dvi, while dvi->ps works fine. Any suggestion? What is the recommended way to handle these kind of situations? dvi->ps->pdf (no hyperref :( ), pdflatex? – japs Sep 09 '12 at 00:11
  • 1
    If you can, it's more straightforward to use pdflatex. But if you need to produce an intermediate dvi file (e.g. for pstricks or for .eps images), then you should prefer dvi -> ps -> pdf over dvi -> pdf. And there's no problem using dvi -> ps -> pdf with hyperref. Just be sure that you haven't made the mistake of specifying a driver you're not using (e.g. a \documentclass or \usepackage{hyperref} with option [pdftex]). Nowadays, driver detection is automatic so not specifying one allows you to compile with the engine you want. – Philippe Goutet Sep 09 '12 at 06:37

1 Answers1

1

i run your code with MikTeX 64-bit installation (Windows 7 OS) with recent CVS TikZ. as expected, in the both cases -- with pdfLaTeX and LaTeX -- the results is correct and the same. it is unlikely, that in other TeX distribution and different OS gives different results, so from your code is not possible to see, what is going wrong at you.

Zarko
  • 296,517