Bug 283447 - TOC of dvi files is shown flat
Summary: TOC of dvi files is shown flat
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: DVI backend (show other bugs)
Version: 0.12.5
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-06 06:41 UTC by Oliver Sander
Modified: 2011-10-06 12:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.7.3


Attachments
Example tex file (286 bytes, application/x-tex)
2011-10-06 06:41 UTC, Oliver Sander
Details
The dvi file I get when running latex on the demo tex file (3.10 KB, application/x-dvi)
2011-10-06 06:42 UTC, Oliver Sander
Details

Note You need to log in before you can comment on or make changes to this bug.
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.