3

I have a document I created several months back, and maybe with a new version of PGF/TikZ it is not working as previously (currently using Arch Linux, TexLive 2011, pgf version 2.10). The fast question is that I have a picture like this:

\begin{tikzpicture}[remember picture,overlay]
\draw [line width=4pt,->,line join=round,line cap=round,red!50] (tl2) -- (tl1);

where tl2 and tl1 are previously defined nodes. Line is displayed right, with a width of 4pt, but the cap is displayed as if the line had a smaller width, obtaining the following:

arrow tip with inconsistent width

The question is, how can I get the tip of the same width as the line?

This may be related with this other question regarding line width in layers, but I'm not sure: Bug in TikZ? Line width on layers

EDIT:

I include minimal compilable code to show the behavior:

\documentclass[a4paper,12pt,oneside]{scrreprt}
\usepackage[left=2.5cm,right=3.5cm,top=3cm,bottom=3cm]{geometry}
\usepackage{tikz}

\begin{document}

I have ...

\begin{tikzpicture}[remember picture,overlay]
\coordinate[xshift=-1.8cm] (tl1) at ([yshift=-2cm]current page.north east);
\coordinate[xshift=-1.8cm,yshift=2cm] (tl2) at (current page.south east);
\draw [line cap=round,line width=4pt,->,red!50] (tl2)  -- (tl1);
\node [above,right=5pt,scale=.7,color=black!50] at (tl1) {timeline};
\end{tikzpicture}

\newpage

\end{document}

I use remember picture because I reuse the tl1 and tl2 nodes defined here.

SOLUTION:

Well, I found pdflatex fails with that rendering, but the combination, for example, of latex + dvipdf works as expected. I checked this with Ubuntu 11.10 and Arch Linux, both running TexLive 2011, so the problem may reside in the TL2011's pdflatex.

2
  • 2
    I get an arrow tip with the same width. It would be good if you would provide a compilable minimal example which shows the inconsistency.
    – Stefan Kottwitz
    Jan 14, 2012 at 12:28
  • OK, I'll prepare it ASAP. Jan 14, 2012 at 13:02

1 Answer 1

4

An minimal example, which shows a correct arrow tip:

\documentclass{article}
\usepackage{tikz}
\newcommand{\putnode}[2][]{\tikz[overlay,remember picture]{\node (#2) {#1};}}
\begin{document}
\putnode{tl1}

\vspace{2cm}
\putnode{tl2}

\begin{tikzpicture}[remember picture,overlay]
  \draw [line width=4pt,->,line join=round,line cap=round,red!50] (tl2) -- (tl1);
  \node [right of=tl1, color=gray] {\Large\textsf{timeline}};
\end{tikzpicture}
\end{document}​

Compiled also with TeX Live 2011 and pgf 2.10:

arrow with tip

2
  • Yes, this is the minimal example. I found the error. My pdflatex is not working properly. I don't know exactly why. I tried latex, then dvipdf and the final document shows the expected result. I'll try reinstall my latex package. Jan 14, 2012 at 13:19
  • Amazing, it is consistently failing in pdflatex in Ubuntu 11.10 and Arch Linux (both with TexLive 2011). This has to be a problem in pdflatex from that distro. I'll stick to latex+dvipdf in the meantime... Thanks for the example. Jan 14, 2012 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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