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.

  • 2
    We need more detail. What version of TeXworks and TeX system (MiKTeX, TeXLive) do you use? What are the file names involved: are there spaces or special characters in the name of the problematic file?
    – Joseph Wright
    Nov 15, 2011 at 16:39
  • 1
    It is always best to compose a MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. Personally, I have often solved my own problems in the process of reducing the amount of code actually required to reproduce the problem. So, in this case try removing most of the code before and after and try to minimize the size of the included file. Nov 15, 2011 at 16:41
  • Thanks! I'll try to make a MWE, which I haven't managed to yet. Nov 16, 2011 at 14:29
  • There are no weird characters in the filename; everthing is in [A-Za-z0-9_] followed by .tex. Path contains no spaces and no weird characters either. Oh, and the \input command uses the same capitalization as the filename to avoid windows case-insensitivity issues. Nov 16, 2011 at 14:32
  • 1
    I have exactly the same problem with synctex and multiple files, using the TikZ-package for drawing. It turned out that uncommenting a certain \input{tikzpicture.tex} in a (working) file that is parsed just before the problematic file 'resolves' the problem. Currently I'm trying to figure out which part of the TikZ-code causes the problem. It seems to have no problems with a minimal TikZ-example as an \input{tikzpicture2.tex} and synctex also links correctly into tikzpicture2.tex.
    – user9705
    Nov 30, 2011 at 10:34

3 Answers 3


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:




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.

  • It helped, actually :) May 29, 2014 at 15:04
  • Thank you so much. I was facing the same problem while in my case the documents were more nested and the chapter facing the problem was the first one among the ones in the same depth. The \clearpage trick worked.
    – theOne
    Sep 19, 2016 at 9:03

I have ran across a similar problem on WinEdt and SumatraPDF. After trials and errors, I found that if I use \input for both files (e.g., the first one contains a "complicated" tikzpicture, and the second one is where a synctex search error may occur), instead of \include, the error goes away. If I need \newpage or \clearpage for the second file, I use the command inside the file, not before the \input command in the main file.

For an example of "complicated tikzpicture", you can try the example "Fancy tables with TikZ", a blog by Stefan Kottwitz:


Hope my experience might be any of help.

Here is an MWE:

main file

\usepackage{tikz} %% to construct a complex tikzpicture

\section{Main File}
Three more tex files will be added below.

% part1 contains a tikzpicture

%\newpage, \clearpage or \include may break synctex

\newpage  % now without it, synctex in part 3 is broken



\section{Part 1}
a complex tikzpicture

\node (mynode) {\Large This tikzpicture may cause synctex failure.};%
%% without pgfonlayer, synctex works fine regardless include or input
%% draw a box
\draw[rounded corners,top color=red,bottom color=black!40!red,draw=white]
    ($(mynode.south west)-(0.1,0.1)$) rectangle ($(mynode.north east)+(0.1,0.1)$);

You can write anything in synctex-part2.tex and synctex-part3.tex to test.

  • Thanks for the tip - I'm using only \input already anyhow, and the "main" file contains virtually no content beyond \input already - just the title and TOC, not even usepackages etc. Jan 21, 2012 at 12:19
  • @Eamon Nerbonne, I added an MWE, see if it helps.
    – ltxsun
    Jan 22, 2012 at 3:20

For me, renaming the chapter file did the trick.

I renamed...

  • The file ch1_intro.tex to ch1_intro2.tex (in the chapters directory)
  • The include reference in the main document \include{chapters/ch1_intro2}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .