5

I'm trying to connect GEdit and xdvi. I don't use the gedit LaTeX plugin as I don't use LaTeX, but plain TeX. Well, for the inverse search I compile the TeX file with the "external tools" plugin and the following code:

#!/bin/bash
TEXFILE=$GEDIT_CURRENT_DOCUMENT_NAME
DVIFILE=${TEXFILE/%.*/.dvi}
LOGFILE=${TEXFILE/%.*/.log}
if pdftex -output-format=dvi -src-specials -halt-on-error $TEXFILE; then
    xdvi -editor gedit $DVIFILE
    else gedit $LOGFILE
    fi

and the inverse search works quite well.

BUT I'm not able to set the direct search correctly. I'm trying the following code

#!/bin/bash
TEXFILE=$GEDIT_CURRENT_DOCUMENT_NAME
DVIFILE=${TEXFILE/%.*/.dvi}
xdvi -sourceposition $GEDIT_CURRENT_LINE_NUMBER $DVIFILE

but it doesn't work. The error message is "No reference to source file "test.dvi" in DVI file."

Where is the fault?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.