Viewers for PDF, PS, and DVIProblem with sumatrapdf - could it be document's class file?

Information and discussion about output viewers related to LaTeX (e.g. Adobe Reader, Ghostview, YAP, ...)
Post Reply
ralphey
Posts: 9
Joined: Wed Feb 03, 2010 8:35 pm

Problem with sumatrapdf - could it be document's class file?

Post by ralphey »

Well I'm having a strange problem compiling my .tex file with TexnicCenter and viewing with SumatraPDF. It compiles and views fine in Acrobat Reader. When compiling and viewing in SumatraPDF, however, the following error message appears in a pop-up window:

********************************************
[ForwardSearch("%bm.pdf","%Wc",%l,0,0,1)]

Cannot execute the command.
********************************************

The funny thing is that SumatraPDF works great most of the time, I'm only getting this error message with this file for some reason. The class file is elsarticle.cls used in Elsevier journals - could that be what's causing this? On another machine I even attempted to set up Texlipse (instead of TexnicCenter) with SumatraPDF, and got the same error message from SumatraPDF when compiling and viewing, while Acrobat Reader again worked fine.

Can anyone point me in the right direction to get this fixed?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Problem with sumatrapdf - could it be document's class file?

Post by localghost »

This problem is certainly not related to the used document class. I can confirm this problem, but only when using the »LaTeX => PS => PDF« build profile. This might be caused by the fact that SumatraPDF expects some data from a SyncTeX file for forward and inverse search, which is only useful when compiling with pdflatex. Nevertheless the resulting PDF file should be displayed correctly.


Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
ralphey
Posts: 9
Joined: Wed Feb 03, 2010 8:35 pm

Problem with sumatrapdf - could it be document's class file?

Post by ralphey »

Hi Thorsten,

Thank you for your reply and the kind welcome to this great site.

This is perplexing... I am only compiling with pdflatex, using the LaTeX =>PDF build profile (well, I actually made a copy of the original, renaming it "LaTeX =>PDF (SumatraPDF)", and adjusted the necessary viewer settings, etc.).

I've went through my preamble and verified that there are no extraneous commands there (i.e., I have only kept those which, if removed, cause a compilation error). Even after this, the file does not compile in TeXnicCenter using pdflatex -- the error message still pops up, though the previously compiled version of the PDF does appear in SumatraPDF.

Are there any other suggestions as to why this is happening, other than it not having to do with the document class?
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Problem with sumatrapdf - could it be document's class file?

Post by localghost »

You have to do a little bit more. As shown in the attachment, you have to add the synctex=1 option to the command line arguments for the compiler. (Although the screenshot is from the older TXC2 alpha 1, it also works for TXC1 RC1 and TXC alpha 2 this way.)
Attachments
TXC2alpha1-pdflatex-profile-modified.png
TXC2alpha1-pdflatex-profile-modified.png (46.78 KiB) Viewed 11675 times
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
ralphey
Posts: 9
Joined: Wed Feb 03, 2010 8:35 pm

Problem with sumatrapdf - could it be document's class file?

Post by ralphey »

Hey again localghost, thanks for your reply. I think I have been setting the synctex switch... I'm attaching screenshots of the profile windows. Here's the LaTeX tab:
profile_LaTeX.png
profile_LaTeX.png (21.59 KiB) Viewed 11668 times
and the Viewer tab:
profile_viewer.png
profile_viewer.png (18.79 KiB) Viewed 11668 times
and, finally, the text that's too long to fit in the box reads:

"C:\USER\ANDY\SUMATRAPDF\SUMATRAPDF.EXE" -inverse-search "\"C:\Program Files\TeXnicCenter\TEXCNTR.EXE\" /ddecmd \"[goto('%f','%l')]\""

Do you see anything missing? And is there a difference between setting "-synctex=1" vs. "-synctex=-1"? Does it matter whether there is 1 vs. 2 dashes before synctex (i.e., "-synctex=" vs. "--synctex=..."?)

Thanks for all of your help!
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Problem with sumatrapdf - could it be document's class file?

Post by localghost »

There are two main resources with instructions on how to set up TeXnicCenter (TXC) with Sumatra PDF [1,2]. Compare your settings with those you find there (especially in [1]).
ralphey wrote:Do you see anything missing? And is there a difference between setting "-synctex=1" vs. "-synctex=-1"? Does it matter whether there is 1 vs. 2 dashes before synctex (i.e., "-synctex=" vs. "--synctex=..."?)
For the front dash see the attachment in my last reply. The »-1« is an older setting and in opposite to »1« does not compress the SyncTeX data file. But this should not affect the functionality. The only possible values are -1, 0 or 1.

[1] TeXnicCenter.org - Tutorials
[2] william.familie-blum.org news - Configuring editors with SumatraPDF
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
ralphey
Posts: 9
Joined: Wed Feb 03, 2010 8:35 pm

Re: Problem with sumatrapdf - could it be document's class f

Post by ralphey »

localghost: I probably should have mentioned that I used the first resource in your list to initially set up TexnicCenter + SumatraPDF configuration! The configuration has worked beautifully on every file except this particular .tex file - which, again, displays just fine when compiled with pdflatex and viewed using Acrobat Reader.

Any other recommendations?
jonasson
Posts: 1
Joined: Sun Jan 24, 2010 8:13 pm

Re: Problem with sumatrapdf - could it be document's class f

Post by jonasson »

I just want to confirm Ralphey's observation: I get the error with some tex files and not others...
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Problem with sumatrapdf - could it be document's class file?

Post by localghost »

jonasson wrote:I just want to confirm Ralphey's observation: I get the error with some tex files and not others...
Give a concrete example, which means that you have to reduce a problematic document to a minimal working example (MWE) that exactly reproduces the undesired behaviour. The page behind the link gives detailed instructions.


Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
cirasj
Posts: 25
Joined: Mon Mar 09, 2009 3:26 pm

Re: Problem with sumatrapdf - could it be document's class f

Post by cirasj »

I am receiving the same error with this file. This program has worked many times in the past.

I just ran this program in XP and it work. It has worked in the past using Win 7. I have not tried uninstalling and reinstalling the software.

Why would it stop working?
Attachments
JACPASLetterhead.tex
(1.56 KiB) Downloaded 532 times
Post Reply