Wednesday, April 22, 2009

Reverse DVI Search in TeXmaker

Since my Winedt trial expired, I switched to TeXmaker. It's got a pretty interface, but needs some tweaking to make work right...for instance installing a dictionary...

I had a hell of a time figuring out how to make the Reverse DVI search work in TeXmaker. Here is the solution

in Texmaker Options>Configure Texmaker, replace the LaTex commands with
latex --src -interaction=nonstopmode %.tex %0 "%N%T"

This tells Texmaker to generate "source links" so Yap can link backwards.

in Yap click View>Options>Inverse DVI search>New
Give it a name, navigate to the Texmaker.exe file and add
"%f" "%l"
be sure to INCLUDE the quotation marks or else it won't work (even though it lets you click 'ok' without them)

Set Texmaker as the default and you're done.

*UPDATE See the discussion in the comments section for some good suggestions

4 comments:

wwwq said...

thank you for the POST... I had the same problem, thank´s , its work great!!

Unknown said...

Hi Josh

Thanks for taking the trouble to find out how to perform reverse search.

I have done as you write. Unfortunately it does not work.
Where exactly do I have to add

"%f" "%l"

?

jbatters said...

Sorry I didn't get back right away. In case you haven't found your answer else where

In Yap click on View>Options>Inverse DVI search

if you have already created the settings for Texmaker click "Change" on the right

if you haven't see the 5th paragraph in the post and create the settings.

A window should open that says TeX Editor at the top and has 3 inputs to specify. The 3rd says Specify Program Arguments. In that space add the
"%f" "%l"

When you go back to the options window the bottom box should say Command Line:
"C:\Program Files\Texmaker\texmaker.exe" "%f" "%l"

Unknown said...

It didn't work for me... Compilation reports me errors with the given latex command, I use instead the following:
latex --src -interaction=nonstopmode %.tex

Also, in YAP, I use the arguments given in TexMaker's doc:
"%f" -line %l
(otherwise, the cursor in TexMaker wasn't placed at the right line)

And I'd like also to add that (for me) when double-clicking on a sentence in YAP, nothing seems to happen, but actually the cursor in TexMaker moved to the correct line (this is because TexMaker is already running and doesn't ask for attention).

Last point which was not clear on the original post: to set TexMaker as the defaut in YAP, one should select the entry in the list and press OK or APPLY. (the defaut entry is the one selected, not the one on the top)