# Synctex limited ability to jump to floats within \input chain + directory tree

I have been searching for solutions or hints to this problem on and off. It's one of those things that slightly annoy me, but then again I'm struggling with procrastination to write my thesis, so I procrastinated on finding a solution for the problem I'm having with synctex and its ability to inverse search from the pdf to the source location.

I cannot reproduce the problem with a MWE. I'm providing one to describe under what conditions synctex fails along with the source tree (see below).

My tree structure, looks like this:

phd_thesis
|-- abstract.tex
|-- thesis.tex                % The main file
|-- Appendix
|   |-- appendix1.tex
|   |__ ...
|-- Chapter1
|   |-- chapter1_main.tex
|   |-- chapter1_sec1.tex
|   |-- chapter1_sec1_table1.tex
|   |-- chapter1_sec2.tex
|   |-- chapter1_subsec12.tex
|   |__ ...
|...
|__ ChapterN
|   |__ ...


which is not too complex. All source files pertaining to a certain Chapter are included within a corresponding directory and it doesn't go any deeper than this.

I'm using LaTeXTools with Sublime Text 3 and visualizing the pdf document in Okular. Synctex forward and backward search work fine for all other LaTeX documents, especially for a single .tex file. on certain .tex files only.

At Chapter5, it all blows up. There are no (relevant) warnings produced by the latexmk command employed, at least Sublime console displays an empty list after Warnings. All the solutions procured are for getting synctex too work, while mine is kindly stopping to work after a certain point in the document.

In the transition, between where the synctex working and stop working happens is just a regular section transition. What could this be? Synctex overflow? The MWE shows the packages I'm loading, but it shows no trace of what I described. Into what should I be looking to find the answer to my problem? All the fancy configurations take place at the prologue, some outside the document, others, redefinitions and such, happen at the prologue of the document. Then, I'm using floats of the type Figures, Tables, Listings and Algorithms. Has anyone stumbled into a similar problem?

\documentclass{report}

\usepackage[retainorgcmds]{IEEEtrantools}
\def\@IEEEcompsocdiamondline{\vrule depth 0pt height 0.5pt width 4cm\hspace{7.5pt}%
\raisebox{-3.5pt}{\fontfamily{pzd}\fontencoding{U}\fontseries{m}\fontshape{n}\fontsize{11}{12}\selectfont\char70}%
\hspace{7.5pt}\vrule depth 0pt height 0.5pt width 4cm\relax}

\usepackage[english]{babel}
\usepackage[noprefix]{nomencl}
\usepackage{filecontents,setspace,latexsym,multirow,colortbl,graphics,graphicx,epsfig,epstopdf,lipsum,mfirstuc,breakcites,pdflscape,amsmath,amssymb,amsfonts,multicol,threeparttable,etoolbox,mathpazo,mathrsfs,psfrag,xargs,textcomp,appendix,url,pdftexcmds,minted,bibentry,mathtools,pdfpages,rotating,longtable,wrapfig,booktabs,algorithmic,algorithm}
\renewcommand{\thealgorithm}{\arabic{chapter}.\arabic{algorithm}}
\usemintedstyle{borland}
\usepackage[all]{nowidow}
\usepackage[T1]{fontenc}
\usepackage[super]{nth}
\usepackage[utf8]{inputenc}
\usepackage[usenames,dvipsnames,table]{xcolor}
\usepackage[footnotesize,bf]{caption}
\usepackage[super,square,numbers,sort&compress]{natbib}
\usepackage[hang,small,bf]{subfigure}
\usepackage[shortcuts]{extdash}
\RequirePackage{ifthen}
\newtheorem{prop}{Proposition}
\usepackage[shortlabels]{enumitem}
\usepackage{acro}

%%%% This is not for the MWE to work, only for reference of the packages I'm using
% Please create a directory tree where required
% <this_mwe_root_folder>
%   |-- mwe_source.tex              (this file from TeX stackexchange)
%   |-- mwe_chapter1                (mkdir mwe_chapter1)
%   |   |-- chapter1.tex            (mwe writes it)
%   |   |-- chapter1_sec1.tex       (mwe writes it)
%   |   |-- chapter1_sec1_table.tex (mwe writes it)
%   |   |-- chapter1_sec2.tex       (mwe writes it)
%   |   |-- chapter1_sec2_table.tex (mwe writes it)
%   |   |__ ...
%   |-- mwe_chapter5                (mkdir mwe_chapter5)
%   |   |-- chapter5.tex            (mwe writes it)
%   |__ ...

\begin{filecontents}{mwe_chapter1/chapter1}
%!TEX root = ../mwe_source.tex
\chapter{Introduction}
The Chapter prologue. This is backward search-able. Herein, we input the Sections.
\input{mwe_chapter1/chapter1_sec1}
\input{mwe_chapter1/chapter1_sec2}
\end{filecontents}

\begin{filecontents}{mwe_chapter1/chapter1_sec1}
%!TEX root = ../mwe_source.tex
\section{Section 1: Does backward search work?}
This is Section 1 prologue. This is backward search-able. Herein, we would input the Subsections.

At a certain stage, a complex Table is included from its own source, too reduce unintended verbosity.
\input{mwe_chapter1/chapter1_sec1_table}
\end{filecontents}

\begin{filecontents}{mwe_chapter1/chapter1_sec2}
%!TEX root = ../mwe_source.tex
\section{Section 2: Does backward still search work?}
This is Section 2 prologue. This is backward search-able. Herein, we would input the Subsections.

A complex Table is included from its own source, containing some text as well.
\input{mwe_chapter1/chapter1_sec2_table}

The source of the snippet redirects to the annotations produced by pygmentize, which is expected.
\input{mwe_chapter1/chapter1_sec2_code_listing}
\end{filecontents}

\begin{filecontents}{mwe_chapter1/chapter1_sec2_code_listing}
\begin{listing}[htpb]
\begin{minted}[frame=single,framerule=0.25pt,fontsize=\scriptsize,fontfamily=courier]{c}
while(!0)
a++;
\end{minted}
\caption{Endless loop}
\label{code:snippet}
\end{listing}
\end{filecontents}

\begin{filecontents}{mwe_chapter1/chapter1_sec1_table}
%!TEX root = ../mwe_source.tex
\begin{table}[htpb]
\caption{Backward search redirects to a file designated as \emph{this\_mwe\_root\_folder} in my case.}
\begin{tabular}{ r|c|c| }
\multicolumn{1}{r}{}
&  \multicolumn{1}{c}{noninteractive}
& \multicolumn{1}{c}{interactive} \\
\cline{2-3}
massively multiple & Library & University \\
\cline{2-3}
one-to-one & Book & Tutor \\
\cline{2-3}
\end{tabular}
\end{table}
\end{filecontents}

\begin{filecontents}{mwe_chapter1/chapter1_sec2_table}
%!TEX root = ../mwe_source.tex
This text is completely search-able from the pdf (backward search).
\begin{table}[htpb]
\caption{Backward search redirects to a file designated as \emph{this\_mwe\_root\_folder} in my case.}
\begin{tabular}{ r|c|c| }
\multicolumn{1}{r}{}
&  \multicolumn{1}{c}{noninteractive}
& \multicolumn{1}{c}{interactive} \\
\cline{2-3}
massively multiple & Library & University \\
\cline{2-3}
one-to-one & Book & Tutor \\
\cline{2-3}
\end{tabular}
\end{table}
As well as this one.
\end{filecontents}

\begin{filecontents}{mwe_chapter5/chapter5}
%!TEX root = ../mwe_source.tex
\chapter{This is getting long}
\section{Section N: Does backward search work?}
Here it stopped, when it should go carry on. Now the redirection opens a file designated as the tree source folder name.
\end{filecontents}

\begin{document}
\title{Synctex Failure Details w/ tree structure}
\maketitle

\input{mwe_chapter1/chapter1}

\input{mwe_chapter5/chapter5}

\end{document}


Please mkdir mwe_chapter1 and mwe_chapter5 for the example. The warnings I see are:

** WARNING: IEEEtran.bst: No hyphenation pattern has been
** loaded for the language English'. Using the pattern for
** WARNING: IEEEtran.bst: No hyphenation pattern has been
** loaded for the language English'. Using the pattern for


and

pdfTeX warning (ext4): destination with the same identifier name{cite.author-conferenceYear}) has been already used, duplicate ignored


The latter on all the references that I included inline in a list of contributions using the bibentry package.

• I get a bunch of "pdfTeX warning (ext4): destination with the same identifier", which according to this is due to certain unnumbered pages on the document, and the other is IEEEtran.bst complaining about hyphenation for the English language "WARNING: IEEEtran.bst: No hyphenation pattern has been loaded for the language English'. Using the pattern for the default language instead." – Joao Andrade Aug 19 '15 at 16:51
• Should have made a proper cleaning of that. It's reflected on the new MWE the (lack of) redundancy. – Joao Andrade Oct 5 '15 at 13:58
• Thanks for spending your time compiling this. I cannot reproduce the problem with this MWE, either. The problem does show for the complex latex document/project that is my thesis. What should I do about the calling of packages? There are certain dependencies, AFAIK. Xcolor requires to be called prior to other packages, for instance. And most of them are not used in the MWE but are eventually used in the original document... – Joao Andrade Oct 5 '15 at 21:54
• Never add or call packages you did not really need in your document. Call only packages you need! Never add packages you do not know or you didn't read the complete documentation. Okay, now copy the main file into a test file and start to comment the packages you do not call. (comment one, compile, no error, comment next one, ...) Then check the order of the needed packages. Read the doc for dependencies and resort the order off calls ... And reduce the using of \input`. Have one file for chapter 1, one file for chapter two etc. (without inputting other files there). – Mensch Oct 5 '15 at 22:08
• Is your problem solved? – Mensch Nov 6 '15 at 22:35