The KILE builtin functionality currently adds as space and "./" to the source file when clicking ForwardDVI under windows with the current KDE Windows release. I do not have this behavior in Linux Ubuntu 10.04 with latest patches installed.
Still, this annoys me and I came up with a workaround for Windows:
You need:
- Cygwin with sed installed
- Okular (any other dvi viewer should do fine)
Generate a build command in Kile-> Settings -> Configure Kile --> Build which is exactly the same as ForwardDVI.
Than change this new command to the following:
Command: cmd
Options: /c open_okular.bat '%target'
This should call the batch file open_okular.bat within the DOS CMD shell and pass along the string containing everything you need for doing forward search.
Now place the following DOS CMD script in your TEX Project Root folder:
FILE open_okular.bat
echo "Start"
set PATH=%PATH%;c:\programdata\kde\bin\;c:\cygwin\bin\;c:\Users\<username>\kderoot\bin\
echo %INPUT%
for /f %%a in ('echo %1 ^| sed.exe -e"s/ \.\///"') do set OUTPUT=%%a
@echo %OUTPUT%
okular.exe %OUTPUT% --unique
echo "End"
What the script does:
Line 2 updates your path so that okular.exe and sed.exe are known. Adjust paths appropriatley
Line 4 removes the " ./" in words: space dot slash; from the string and stores it in OUTPUT
Line 6 calls okular with the new string.
This should give you the forward search for Kile and Okular in Windows.
Adoptions to any other DVI viewer should be straight forward.
Adoptions to Linux should be easy as string manipulation is usually a lot easier.