2

I'm using synctex on a beamer presentation, and I'm having some trouble. Unlike this question, I can live with the fact that synctex will put me at the end of the current frame. However, for fragile frames, I end up in slides.vrb, which basically contains the last fragile frame of the presentation.

fragile frames without overlays are OK, as the fragile=singleslide option will make synctex find the appropriate line, but some of my fragile frames have several overlays. Is there something that can be done for them?

Update: As a matter of fact, the issue seems to only occurs when using listings. Here is a way to reproduce the problem (Note that it assumes that you have configured your pdf viewer, okular in my case, to be able to perform an inverse search to your editor, emacs in my case).

Consider the following slide.tex file:

\documentclass{beamer}
\usepackage{listings}
\begin{document}
\begin{frame}[fragile]{title}
\begin{lstlisting}
foo
\end{lstlisting}
bar

\lstinline|bla|
\end{frame}
\end{document}
  1. Compile it with synctex enabled: pdflatex -synctex=1 slide.tex
  2. open slide.pdf with a synctex-aware viewer: okular slide.pdf
  3. perform an inverse search (shift+click in okular) on bar: it should move the cursor of your editor at the end of the frame as expected.
  4. perform an inverse search on foo, which is in an lstlisting environment: it should open the auxiliary slide.vrb file in your editor and point you there instead of slide.tex.
  5. The same issue occurs with \lstinline|bla|: if you shift+click on bla, it opens slide.vrb.
Virgile
  • 235
  • 2
  • 7
  • 1
    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – samcarter_is_at_topanswers.xyz Nov 22 '16 at 00:51
  • @samcarter I was under the impression that your comment was a little bit stereotypical, but in the end, it made me realize that synctex, beamer and fragile were not the only needed ingredients to the issue and that you had to throw in listings as well. Thus thank you for forcing me to be a bit more rigorous in my description. – Virgile Nov 22 '16 at 08:12
  • 3
    There's not much you can do, I'm afraid. SyncTeX takes note of the file where the input is coming from and, for a fragile frame, the file \jobname.vrb is used. So that's the one which is opened, but of course it changes every time fragile is found. – egreg Nov 22 '16 at 11:47
  • 1
    @egreg Maybe convert your comment into an answer? It might not solve the OP's problem, but it explains why. – samcarter_is_at_topanswers.xyz Mar 12 '17 at 13:51
  • @samcarter I'm not sure about it; it seems that listings is doing something strange: I get a mysterious “Successfully formatted [0] pages” with the OP's example. Overlays clearly are out of the question, as it's impossible to keep track of the multiple \input{\jobname.vrb}. – egreg Mar 12 '17 at 14:25

0 Answers0