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 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}
share|improve this question

closed as too localized by percusse, Claudio Fiandrino, Marco Daniel, lockstep, Paul Gaborit Sep 15 '12 at 21:43

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

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 8 '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 9 '12 at 0: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 9 '12 at 6:37

1 Answer 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.

share|improve this answer

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