Fixed -labels-progress

This commit is contained in:
John Whitington 2020-02-07 13:48:09 +00:00
parent b54e4c84c3
commit ca49e9d25e
2 changed files with 6 additions and 2 deletions

View File

@ -4177,7 +4177,10 @@ let add_page_labels pdf progress style prefix startval range =
and labels = Pdfpagelabels.read pdf in
assert (length ranges > 0);
let startval_additions =
0 :: map (fun x -> x - fst (List.hd ranges) - 1) (List.tl (List.map fst ranges))
let r = ref [] in
let sofar = ref 0 in
iter (fun (s, e) -> r := !sofar :: !r; sofar := e - s + 1 + !sofar) ranges;
rev !r
in
let labels =
if not (page1 labels) then
@ -4195,7 +4198,7 @@ let add_page_labels pdf progress style prefix startval range =
{Pdfpagelabels.labelstyle = style;
Pdfpagelabels.labelprefix = prefix;
Pdfpagelabels.startpage = s;
Pdfpagelabels.startvalue = startval + addition}
Pdfpagelabels.startvalue = startval + if progress then addition else 0}
in
labels := Pdfpagelabels.add_label (Pdfpage.endpage pdf) !labels label e)
ranges

View File

@ -1,4 +1,5 @@
%Document \n in bookmark files
%Document -labels-progress
\documentclass{book}
\usepackage{palatino}
\usepackage{microtype}