Take the 2-minute tour ×

I'm using the SyncTeX plugin in gedit and it seems that ctrl-clicking in gedit (forward-searching) opens up a new instance of Evince even if there was already an instance open.

Is there a way to prevent this from happening? The SyncTeX forward search clearly calls evince in a way that is not the same as e.g. nautilus would.

By the way, I compile my tex files with a script using the "external tools" plugin. The line that opens the pdf file uses xdg-open.

share|improve this question
add comment

1 Answer

I figured out how to solve this. The problem was that the instance started by Synctex wasn't recognized by the command in my 'External Tools' script.

The Synctex instance was listed as /usr/bin/evince file:///path/to/my/file.pdf, whereas the instance called by xdg-open was listed as evince file.pdf.

So, I just changed my script such that it will also be listed as /usr/bin/evince file:///path/to/my/file.pdf. My External Tools script now reads:


if [ "$GEDIT_CURRENT_DOCUMENT_TYPE" == "text/html" ]; then


elif [ "$GEDIT_CURRENT_DOCUMENT_TYPE" == "text/x-tex" ]; then

    shortname=`echo $filename | sed 's/\(.*\)\.tex$/\1/'`

    shortpath=`echo $path | sed 's/\(.*\)\.tex$/\1/'`

    latex -synctex=1 -interaction batchmode -src $filename
    dvips -t a4 $shortname.dvi
    ps2pdf -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true $shortname.ps
    rm --interactive=never $shortname.dvi $shortname.out $shortname.ps $shortname.blg $shortname.toc $shortname.log
    #xdg-open $shortname.pdf
    /usr/bin/evince $shortpath.pdf


    echo "I don't know how to compile files of the type:" "$GEDIT_CURRENT_DOCUMENT_TYPE"

share|improve this answer
add comment

Your Answer


