Bug 283447

Summary: TOC of dvi files is shown flat
Product: [Applications] okular Reporter: Oliver Sander <oliver.sander>
Component: DVI backendAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 0.12.5   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In: 4.7.3
Attachments: Example tex file
The dvi file I get when running latex on the demo tex file

Description Oliver Sander 2011-10-06 06:41:12 UTC
Created attachment 64270 [details]
Example tex file

Version:           0.12.5 (using KDE 4.6.5) 
OS:                Linux

I use okular to look at dvi files that I create with LaTeX.  Unfortunately, the table of contents shown by okular does not contain any hierarchy.  All chapter, section, subsection titles appear in one long list.  The information must be in the dvi file, however, because if I use dvipdf to create a pdf file, the latter is shown with a proper hierarchical toc.

Reproducible: Always

Steps to Reproduce:
Take any tex file that uses the hyperref package,
run latex on it.

Actual Results:  
Toc is shown by okular, but without a hierarchy

Expected Results:  
Toc should be hierarchical
Comment 1 Oliver Sander 2011-10-06 06:42:01 UTC
Created attachment 64271 [details]
The dvi file I get when running latex on the demo tex file
Comment 2 Albert Astals Cid 2011-10-06 11:12:40 UTC
Git commit 83df127ac057d98e6e4f67e07074675c8830198a by Albert Astals Cid.
Committed on 06/10/2011 at 13:09.
Pushed by aacid into branch 'KDE/4.7'.

Fix creation of the TOC tree for dvi files

The old code assumed the number of children would be
"-NUMBER "
while this file has
"-NUMBER/"
so what we do now is looping after the - until we find a non digit
All this code would better be done using a regexp and not that many section calls
but i did not want to touch it more than needed
BUGS: 283447
FIXED-IN: 4.7.3

M  +9    -2    generators/dvi/dviRenderer_prescan.cpp

http://commits.kde.org/okular/83df127ac057d98e6e4f67e07074675c8830198a
Comment 3 Albert Astals Cid 2011-10-06 11:13:10 UTC
Git commit 9d6926f9b8d5b4128ec317d6c4ee6fce5de20626 by Albert Astals Cid.
Committed on 06/10/2011 at 13:09.
Pushed by aacid into branch 'master'.

Fix creation of the TOC tree for dvi files

The old code assumed the number of children would be
"-NUMBER "
while this file has
"-NUMBER/"
so what we do now is looping after the - until we find a non digit
All this code would better be done using a regexp and not that many section calls
but i did not want to touch it more than needed
BUGS: 283447
FIXED-IN: 4.7.3
(cherry picked from commit 83df127ac057d98e6e4f67e07074675c8830198a)

M  +9    -2    generators/dvi/dviRenderer_prescan.cpp

http://commits.kde.org/okular/9d6926f9b8d5b4128ec317d6c4ee6fce5de20626
Comment 4 Oliver Sander 2011-10-06 12:25:57 UTC
Thanks! Btw I can help you test if you want to try the regexp after all.