[Tex/LaTex] TeXworks: synctex works only partially

forward-inverse-searchtexworks

I've got a document that compiles without error or warnings (and looks about right) but for some segments of the document synctex doesn't seem to be working. What could be wrong?

The document consists of one root .tex file which \inputs a bunch of others. Synctex works for all these sub-documents – except for one. In practice, this means I can Ctrl-Click in the viewer and find the appropriate spot both in parts of the text before and after this particular subdocument. Conversely, I can Ctrl-Click in the editor and jump to the right spot in the view in all subdocuments but this one.

However, when I Ctrl-Click on a part of the output corresponding to this particular subdocument I get the following error popup: Cannot read file "E:/emn/uni/Thesis/doc": Access is denied. in the TeXworks viewer. The path in this error message exists but is a directory: namely the one containing the tex files.

  • All filenames consist of only latin letters, numbers, and underscores and the extension .tex. The problematic file is called G2MLVQ_9_Refinements.tex whereas a (working) file is called G2MLVQ_7_Implementation.tex
  • I can't make a small example which fails – small examples don't fail; however the order of files seems to matter, so perhaps something in an earlier file is affecting synctex later on… (once I've isolated this, I'll update the question).
  • Concerns MiKTeX 2.9 and the bundled TeXworks version 0.4.3 r.857.

I'm stumped: what could be going wrong?

Edit: user59152 tried to isolate the error:

It is virtually impossible to create a minimum working example (MWE) for this problem, so I have posted a "jing" (screencast) movie illustrating the error. You can see the file names at the tops of the windows. The one being edited (Introduction.tex) comes BEFORE the file that can't be opened using inverse search (SourceAndSinkFreeContinuumRVtracking.tex). The screencapture movie confirms that \clearpage restores inverse search capability, but fouls up the layout of the document, so this problem appears to remain unsolved. I'm using TeXworks version 0.4.4 r.1003 and MikTex 2.9.

Best Answer

I had exactly the same problem after moving the last section from one capter_y.tex to somewhere in chapter_x.tex. After moving, the chapter after chapter_y.tex, chapter_z.tex, failed when trying "jump to pdf"/"jump to source"

I have no idea why this worked, but solved the problem by including \clearpage before the failing chapter:

\documentclass[a4paper,norsk,11pt,twoside]{book}
\usepackage[utf8]{inputenc}
...
\input{chapter_x}
\input{chapter_y}
\input{chapter_z}

to

...
\input{chapter_x}
\input{chapter_y}
\clearpage
\input{chapter_z}

In my case, using \include{.}, instead of \input{.} for both the chapter preceding the problem chapter, and the problem chapter itself also worked, since

\include{.} == \clearpage \input{.} \clearpage

I'm using MikTex 2.9, Windows 7 32bit.

Hope this helps.

Related Question