2

Below MWE shows four paragraphs of text and two vertical lines on top as shown on the left side of the following picture:

PDF of MWE with problematic area marked red

By using inverse search in the PDF viewer, that is, by clicking on any text (and not on one of the two lines), I would expect that the cursor is placed at the corresponding \lipsum line in the TeX editor.

But if clicking inside a certain area in the PDF which is marked red in the picture above, the cursor is misplaced at the picture-environment. How can we change this (kind of annoying) behaviour?

\documentclass{article}
\usepackage{lipsum}
\setlength\parindent{20ex} % There is no problem within the parindent-area.
\begin{document}
\setlength{\unitlength}{1cm}
\begin{picture}(0,0)
\put(2,-17){\line(0,0){15}}
\put(6,-17){\line(0,1){15}}
% To visualize the affected area, uncomment the following line.
%\linethickness{60mm}\put(3,-17){\line(0,0){15}}
\end{picture}
%We add separate lipsum blocks to recognize the misleading inverse search better.
\lipsum[1]
\lipsum[1]
\lipsum[1]
\lipsum[2]
\end{document}

(By the way, the "crop" package uses the picture-environment, doesn't it? In this case a solution to this question is a good starting point for an answer of the question "Inverse search jumps to wrong position in tex-file if using crop package".)

e-birk
  • 4,373
  • Why exactly? I mean, it isn't usual to want to put a picture over the top of your text, is it? – cfr May 19 '14 at 02:15
  • @cfr To show the effect more clearly I put the lines on top of the text. In practice one might put them at the sides of the text and then the inverse search is misled all the time. But in my example you can clearly see the affected area. (As stated at the end of my question, the crop package uses this setup - rendering inverse search more or less useless...) – e-birk May 19 '14 at 11:02

1 Answers1

1

The LaTeX picture-environment has been redefined and improved by the LaTeX package pict2e. Simply load this package in the preamble of the document:

\usepackage{pict2e}

The inverse search should work as expected if your output format is supported by the pict2e package. At the moment these are PostScript and PDF format.

e-birk
  • 4,373