KileForward & Reverse DVI with multiple file document

Information and discussion about Kile, an integrated LaTeX environment for Linux KDE
Post Reply
dj_bridges
Posts: 8
Joined: Fri Sep 21, 2007 12:59 pm

Forward & Reverse DVI with multiple file document

Post by dj_bridges »

I have been searching for an answer to this, but so far have failed to find it. Sorry if it has already been answered somewhere. Tried asking in the general latex forum http://www.latex-community.org/viewtopi ... 161#p13161, but it seems to be an issue with kile so am hoping someone knows the answer here.....

Essentially I am writing a large report (similar to a PhD thesis) that is written in a number of tex files, with a master file that includes all of the daughter files. I often want to work on the layout of individual files and go between the DVI and tex file using the forward and reverse search functions. However it appears that when working with multiple file documents, the reverse DVI merely takes one to the \include{chapter} and not to the chapter tex file. Is there anyway that I can get the reverse DVI to take me to the relevant tex file and the relevant position in that tex file? In the same way can I go from the chapter file in kile direct to the point in the DVI file?

I understand that I could put all of the information in the master document in each of the chapter documents i.e. make them seperate single file documents, but I assume there must be a way to do it from the master document, as apparently this can be done with Vim?

Any help would be greatly appreciated. I am using Kile with KDVI and TeTex.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Forward & Reverse DVI with multiple file document

Post by localghost »

Should normally no problem in case that source special are written to the DVI file. Perhaps a matter of settings in Kile. Check your settings and make sure that the "Modern" configuration is used for the "LaTeX" build tool. It adds the -src switch to the command line arguments. In the attachment you can see the settings of Kile on my (german) system².


Best regards
Thorsten¹
Attachments
Modern configuration for DVI build in Kile.
Modern configuration for DVI build in Kile.
settings-kile.png (66.69 KiB) Viewed 12307 times
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
dj_bridges
Posts: 8
Joined: Fri Sep 21, 2007 12:59 pm

Re: Forward & Reverse DVI with multiple file document

Post by dj_bridges »

Thanks for your reply Thorsten.

I checked my settings and they were identical, except I had -src -interaction=nonstopmode '%source' instead of -src -interaction=nonstopmode -shell-escape '%source'

Have changed it so the settings are the same as yours, but it still doesn't work. I am sure it can be made to work as in the DVI at the info bar at the bottom, moving over the text shows the line number and the file name where the text has come from (see screenshot). However the reverse DVI only takes me to the master document.

I get the following error when I try to Forward DVI from one of the daughter documents:
[ForwardDVI] The file Histamine/Histamine.dvi does not exist; did you compile the source file?

Is there some way that I can put in a bit of code to point to the master file so that the forward DVI will take me from the daughter chapter .tex file to the daughter chapter in KDVI?

Appreciate your help!
Dan
Attachments
KDVI.png
KDVI.png (136.88 KiB) Viewed 12296 times
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Forward & Reverse DVI with multiple file document

Post by localghost »

The switch -shell-escape is not the important one. It enables the compiler to call external programs. But the message of Kile seems familiar to me.

Code: Select all

[ForwardDVI] The file Histamine/Histamine.dvi does not exist; did you compile the source file?
All your opened files should be part of a project with your main file as master document. For me reverse as well as forward search in a DVI file are working fine inside a project.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
dj_bridges
Posts: 8
Joined: Fri Sep 21, 2007 12:59 pm

Forward & Reverse DVI with multiple file document

Post by dj_bridges »

localghost - thanks for your reply. Good to know the -shell-escape wasn't the important issue.

All of the documents on which I am trying to forrward and reverseDVI are part of a master document (as you say). The master essentially looks like this:

Code: Select all

\begin{document}
\chapter{Some text}
Introductory text POSITION A
% The various chapters:
\include{Haemostasis/Haemostasis}
\include{Histamine/Histamine}

\end{document}
Is this how you structure a multi-file document?

To summarise the problem - If I forwardDVI from POSITION A or reverse DVI from KDVI at POSITION A everything works fine. However if I try to ForwardDVI from within any of the included chapters e.g. Histamine, then it doesn't work (gives the previous error message about the file not being compiled). Likewise when I try to reverseDVI in KDVI from within a chapter it just takes me back to the Kile window, but not to the correct Chapter file or correct position within that file.

To me anyway, it kind of makes sense that the ForwardDVI from Kile within a chapter doesn't work as there is nothing in the document to say where the master file is located i.e. I was expecting to put in something at the start of the chapter e.g. \master{rel_path_to_master/master} to tell kile when I latex or ForwardDVI or whatever to link it to the master. Perhaps I am missing something???

Hope that was clear.
dj_bridges
Posts: 8
Joined: Fri Sep 21, 2007 12:59 pm

Re: Forward & Reverse DVI with multiple file document

Post by dj_bridges »

Ok I have been a bit of a fool, and have just found out about projects properly - I wasn't adding the files to the current project. Anyway am pleased to say that the forwardDVI is now working perfectly. Unfortunately I am still having trouble with the reverseDVI so any suggestions on that front would be useful....

My settings in KDVI are set to Kile as the Editor using the default settings (kile %f --line %l) should it be something different?
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Forward & Reverse DVI with multiple file document

Post by localghost »

dj_bridges wrote:[...] Unfortunately I am still having trouble with the reverseDVI so any suggestions on that front would be useful [...] My settings in KDVI are set to Kile as the Editor using the default settings (kile %f --line %l) should it be something different?
The settings are OK. Reverse search should be working with a click on the middle mouse button (wheel) in KDVI.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
dj_bridges
Posts: 8
Joined: Fri Sep 21, 2007 12:59 pm

Forward & Reverse DVI with multiple file document

Post by dj_bridges »

localghost wrote:The settings are OK. Reverse search should be working with a click on the middle mouse button (wheel) in KDVI.
Glad to hear the settings are correct. However the reverseDVI still doesn't work. I have gone through every menu in kile and kdvi to see if there is something obvious, but I can't find anything.

I believe the problem is with kile as kdvi displays the correct line number and document etc wherever I hover the mouse. Unfortunately wherever I click with the middle mouse button (wheel) I just get taken back to kile, but not to the correct document or position in that document.

Not sure what else to try.....
Post Reply