synctex problem using miktex 2.9 with pdf-xchange

The PDF-XChange Viewer for End Users
+++ FREE +++

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

alex4321
User
Posts: 2
Joined: Thu Jul 14, 2011 1:34 am

synctex problem using miktex 2.9 with pdf-xchange

Post by alex4321 »

Hi,

The forward pdf search feature on a latex document no longer works when upgrading from miktex 2.8 to miktex 2.9. I traced the problem to miktex 2.9 generating backslashes (as opposed to slashes in v2.8) for directory separators in the .synctex file. The backslashes/slashes was the only difference between the synctex files generated from the same latex document using miktex v2.8 vs. v2.9.

A possible solution is that pdf-xchange is updated to treat either a "/" or "\" in a .synctex file as a directory separator, and thus making the nice pdf search feature which highlights in yellow the text in the pdf file where the latex document cursor location is, functional for all versions of miktex.

I am using pdf-xchange viewer v2.5.197
As latex editor: Winedt Build: 20110315 (v. 6.0)
and MiKTeX 2.9 (latest updates as of July 13, 2011).

Thanks,
Alex
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19930
Joined: Mon Jan 12, 2009 8:07 am

Re: synctex problem using miktex 2.9 with pdf-xchange

Post by Stefan - PDF-XChange »

Hello Alex,

I have worked with MikTeX a bit, but one of my colleagues in the Canadian office is much more "on it" - so I have asked him for an advise in this case. He should be able to give some reply later today, and I have also created a ticket in our internal system:
#1151: Synctex, problem using miktex 2.9 with pdf-xchange
So that we can all monitor how this case is going.

I hope that Walter will be able to give you some further advise later today.

Best,
Stefan
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: synctex problem using miktex 2.9 with pdf-xchange

Post by Walter-Tracker Supp »

Hi Alex,

I have tested this with a simple document for both MiKTeX distributions 2.8 and 2.9, using Winedt 6.0, and PDF-XChange viewer v2.5 (build 196.0). Examining the synctex files from both MiKTeX distributions shows they both contain forward slashes in the directory names (unix style), and I am able to perform forward searching in both cases.

Example:

MiKTeX v2.8 (default post-installation settings - pdfTeX 1.40.10):

Code: Select all

SyncTeX Version:1
Input:1:C:/Users/Walter/Desktop/Test1.tex
Input:2:C:/Program Files (x86)/MiKTeX 2.8/tex/latex/base/article.cls
Input:3:C:/Program Files (x86)/MiKTeX 2.8/tex/latex/base/size11.clo
Input:4:C:/Program Files (x86)/MiKTeX 2.8/tex/latex/base/inputenc.sty
Input:5:C:/Program Files (x86)/MiKTeX 2.8/tex/latex/base/utf8.def
Input:6:C:/Program Files (x86)/MiKTeX 2.8/tex/latex/base/t1enc.dfu
Input:7:C:/Program Files (x86)/MiKTeX 2.8/tex/latex/base/ot1enc.dfu
Input:8:C:/Program Files (x86)/MiKTeX 2.8/tex/latex/base/omsenc.dfu
....
....
MiKTeX v2.9 (default post-installation settings - pdfTeX 1.40.11):

Code: Select all

SyncTeX Version:1
Input:1:C:/Users/Walter/Desktop/Test1.tex
Input:2:C:/Program Files (x86)/MiKTeX 2.9/tex/latex/base/article.cls
Input:3:C:/Program Files (x86)/MiKTeX 2.9/tex/latex/base/size11.clo
Input:4:C:/Program Files (x86)/MiKTeX 2.9/tex/latex/base/inputenc.sty
Input:5:C:/Program Files (x86)/MiKTeX 2.9/tex/latex/base/utf8.def
Input:6:C:/Program Files (x86)/MiKTeX 2.9/tex/latex/base/t1enc.dfu
Input:7:C:/Program Files (x86)/MiKTeX 2.9/tex/latex/base/ot1enc.dfu
Input:8:C:/Program Files (x86)/MiKTeX 2.9/tex/latex/base/omsenc.dfu
In other words, in my limited testing I cannot see any real difference between behaviour with MiKTeX 2.8 and 2.9. Can you give more information to help us reproduce this? You could send a sample LaTeX source file for which you see this behaviour to support@pdf-xchange.com and I will take a look at it.

Thank you,
Walter Ash
Tracker Support
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: synctex problem using miktex 2.9 with pdf-xchange

Post by Walter-Tracker Supp »

Just a quick update; I also tried this with the latest build of PDF-XChange Viewer (Version 2.5 build 197.0), and could not reproduce the issue.

Any additional information you can provide to help us reproduce this problem would be appreciated!

Thank you,
Walter Ash
Tracker Support
alex4321
User
Posts: 2
Joined: Thu Jul 14, 2011 1:34 am

Re: synctex problem using miktex 2.9 with pdf-xchange

Post by alex4321 »

Hi Walter, Stefan,

First of all, I'm impressed with the prompt and thorough response.

I looked into this some more, and I was wrong with attributing the forward search not working on pdf-xchange using miktex 2.9 to slash vs. backslash difference in the .synctex files generated from miktex 2.9 (compared to 2.8). The two versions of miktex I was running are 2.8, and the 64-bit version of 2.9, and although miktex 2.9 (x64) produces "\" as line separators for "Input:2:..." and above in the .synctex file, that was not what was causing the problem. The issue is with line feed terminators being different. I uninstalled miktex 2.9 (x64), and installed the 32-bit version of miktex 2.9. As you show, I got what looks to be identical .synctex files (both with "/" as folder separators). However, the two .synctex files were of different size: one was 66KB, and the other 64KB. The .synctex generated from miktex 2.9 turns out to also have a "^M" (carriage return) at the end of the lines, which is what's causing the forward search to malfunction in pdf-xchange, although YAP forward search is unaffected and works using both .synctex files.

I confirmed this by changing the line terminations of the .synctex file using emacs. I open the .synctex file generated from miktex 2.9 in emacs, and then change line terminations by: M-x set-buffer-file-coding-system, where you can type either: "dos" (^M^J line termination), or "unix" (^J line termination), and save the file. I toggled back and forth saving the terminators as "dos" and "unix". The forward pdf search from winedt did not work when using "dos" terminators, and did when I re-saved with "unix" type terminators, highlighting the right part in yellow. For emacs and changing line terminators, see:
http://xahlee.org/emacs/emacs_line_ending_char.html
I suggest that the forward pdf search of pdf-xchange be more robust by not being affected whether the line end is ^J, or ^J^M in the .synctex file.

I run Windows 7 x64 Professional, SP1 (latest updates). I generate the pdf from winedt not directly (using pdflatex), but by distilling the .ps file using Acrobat Distiller (v.10.1), and then doing a forward search with pdf-xchange as the pdf reader. That is, in winedt (v6), "Options" -> "Execution Modes...", select "TeX Options", and select "dvi -> ps -> pdf" as the PDF TeXify method. I do this so that I do not need to convert .eps figures in .pdf form when incorporating graphics in my latex documents, and I simply convert the final postscript document to pdf form using distiller.

I appreciate you looking into this,
Alex
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: synctex problem using miktex 2.9 with pdf-xchange

Post by Walter-Tracker Supp »

Hi Alex,

Thank you for the detailed explanation of this - we will look into it and will keep you updated. Thank you also for forwarding the samples to us.

Sincerely,
Walter Ash
Tracker Support