Inverse search is a very useful feature when you are writing a TeX document yourself. If everything is properly set up, you can click into KDVI's window with the mouse button (on some systems, when you don't have a three-button mouse, you can simultaneously use the and the button). After that, your favorite editor will open, load the TeX source file and jump to the proper paragraph. To use inverse search, do the following:
Produce a DVI file that contains inverse search
information. This is explained in the section Producing TeX files for inverse
search below. If you just want to test the inverse
search feature, you can also use the example file
KDVI-features.dvi
Let KDVI know which editor you would like to use. Choose an editor in the Preferences dialog (this dialog can be reached by choosing in the menu). The next section of this documentation, Rendering Options, explains this dialog in more detail.
Some editors need to be started manually, or need additional configuration. You will find a description of all supported editors in the section Setting up your editor for inverse search below.
Test your setup. Open your DVI file in KDVI and use the mouse button to click into KDVI. The editor should pop up and display the TeX file.
There are essentially two ways to produce DVI files which contain inverse search information: you can either use a TeX/LaTeX binary which generates and includes the necessary information automatically, or you can include an extra package which is written in TeX/LaTeX.
A TeX binary which generates and includes the necessary information automatically is certainly the preferred method of including inverse search information. If you use version 2 or greater of the TeTeX TeX distribution, you can use the 'src-specials' command line option of the tex or latex command, as follows.
tex --src-specials myfile.texor
latex --src-specials myfile.tex
If you do not have a TeX binary which includes inverse
search information natively, copy the files
srcltx.sty
and
srctex.sty
to the folder where your TeX file resides (you
can do that by pressing the Shift key and mouse button while the
mouse pointer is on a hyperlink.) If you use LaTeX, add the
line
\usepackage[active]{srcltx}to the preamble of your LaTeX file. If you use plain TeX, the line
\include{srctex}will do the trick.
While inverse search is extremely useful when you are typing a document yourself, it might be a good idea to remove the inverse search information before sending the DVI file to someone else.
Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team