2

The following minimal working example demonstrates that the vruler code causes the synctex mechanism to fail. You'll see this by rendering this TeX file and trying to click anywhere. It will not send you where you clicked. Does someone see a fix?

The code was munged together by some predecessor of mine.


\documentclass{article}
\usepackage{eso-pic}

\makeatletter
\newbox\GOOrulerbox
\newcount\GOOrulercount
\newdimen\GOOruleroffset
\newdimen\cv@lineheight
\newdimen\cv@boxheight
\newbox\cv@tmpbox
\newcount\cv@refno
\newcount\cv@tot
% NUMBER with left flushed zeros  \fillzeros[<WIDTH>]<NUMBER>
\newcount\cv@tmpc@ \newcount\cv@tmpc
\def\fillzeros[#1]#2{\cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi
\cv@tmpc=1 %
\loop\ifnum\cv@tmpc@<10 \else \divide\cv@tmpc@ by 10 \advance\cv@tmpc by 1 \fi
   \ifnum\cv@tmpc@=10\relax\cv@tmpc@=11\relax\fi \ifnum\cv@tmpc@>10 \repeat
\ifnum#2<0\advance\cv@tmpc1\relax-\fi
\loop\ifnum\cv@tmpc<#1\relax0\advance\cv@tmpc1\relax\fi \ifnum\cv@tmpc<#1 \repeat
\cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi \relax\the\cv@tmpc@}%
% \makevruler[<SCALE>][<INITIAL_COUNT>][<STEP>][<DIGITS>][<HEIGHT>]
\def\makevruler[#1][#2][#3][#4][#5]{
    \begingroup\offinterlineskip
        \textheight=#5\vbadness=10000\vfuzz=120ex\overfullrule=0pt%
        \global\setbox\GOOrulerbox=\vbox to \textheight{%
            {
                \parskip=0pt\hfuzz=150em\cv@boxheight=\textheight
                \cv@lineheight=#1\global\GOOrulercount=#2%
                \cv@tot\cv@boxheight\divide\cv@tot\cv@lineheight\advance\cv@tot2%
                \cv@refno1\vskip-\cv@lineheight\vskip1ex%
                \loop\setbox\cv@tmpbox=\hbox to0cm{                  % side margin
                    \hfil {\hfil\fillzeros[#4]\GOOrulercount}
                }%
                \ht\cv@tmpbox\cv@lineheight\dp\cv@tmpbox0pt\box\cv@tmpbox\break
                \advance\cv@refno1\global\advance\GOOrulercount#3\relax
                \ifnum\cv@refno<\cv@tot\repeat
            }
        }
    \endgroup
}%
\makeatother
% ----- end of vruler


% \makevruler[<SCALE>][<INITIAL_COUNT>][<STEP>][<DIGITS>][<HEIGHT>]
\def\GOOruler#1{\makevruler[12pt][#1][1][3][\textheight]\usebox{\GOOrulerbox}}
\AddToShipoutPicture{%
\GOOruleroffset=\textheight
\advance\GOOruleroffset by 5.2pt % top margin
  \color[rgb]{.7,.7,.7}
%  \ifdefined\isaccepted \else
      \AtTextUpperLeft{%
        \put(\LenToUnit{-35pt},\LenToUnit{-\GOOruleroffset}){%left ruler
          \GOOruler{\GOOrulercount}}
        \put(\LenToUnit{1.04\textwidth},\LenToUnit{-\GOOruleroffset}){%right ruler
          \GOOruler{\GOOrulercount}}
      }
%    \fi
}


\begin{document}

aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 

aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 

aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 

aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 
aoeusthaoeusnh  to uhsaoeuahoes aoesuthaoeu sntoeuhsnao uatoesh oeust aocr3g09o7u lroheushaeo [8aoeusaoehaoe 

\end{document}
jon
  • 22,325
  • If I drop the second \put inside \AtTextUpperLeft, then the sync works "almost". It's then only off a few words. It seems that I'm "blocking" the text somehow and confusing synctex. – Wannabe Mathematician Feb 08 '17 at 18:02

0 Answers0