diff options
Diffstat (limited to 'macros/luatex/optex/outlines.opm')
-rw-r--r-- | macros/luatex/optex/outlines.opm | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/macros/luatex/optex/outlines.opm b/macros/luatex/optex/outlines.opm index 90e9a4a0aa..a66c316129 100644 --- a/macros/luatex/optex/outlines.opm +++ b/macros/luatex/optex/outlines.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \pdfunidef {PDF outlines <2020-03-12>} % preloaded in format +\_codedecl \outlines {PDF outlines <2020-03-12>} % preloaded in format \_def\_outlines#1{\_pdfcatalog{/PageMode/UseOutlines}\_openref \_ifx\_toclist\_empty @@ -50,9 +50,7 @@ \_pdfunidef\_tmp{#1}% \_pdfoutline goto name{oul:\_the\_oulnum} count0 {\_tmp}\_relax } - -\_public - \outlines \insertoutline ; +\_public \outlines \insertoutline ; \_endcode % ---------------------------- @@ -62,27 +60,27 @@ outlines. But we know only the level of each outline. The required data should be calculated from TOC data. We use two steps over TOC data saved in the `\_toclist` where each record is represented by one `\_tocline`. -First step, the `\outline` macro sets `\_tocline` to `\_outlineA` and +First step, the \`\outlines` macro sets `\_tocline` to \`\_outlinesA` and calculates the number of direct descendants of each record. Second step, -the `\outline` macro sets `\_tocline` to `\_codlineB` and it uses prepared -data and crete outlines. +the `\outlines` macro sets `\_tocline` to \`\_outlinesB` and it uses prepared +data and create outlines. Each ouline is mapped to the control sequence of the type `\_ol:<num>` or `\_ol:<num>:<num>` or `\_ol:<num>:<num>:<num>` or etc. The first one is reserved for level 0, the second one for level 1 (chapters), third one for level 2 (sections) etc. The number of direct descentants will be stored -in these macros after first step i finished. Each new outline of given level -incerases the <num> at given level. When the first step is processed then +in these macros after first step is finished. Each new outline of given level +increases the `<num>` at given level. When the first step is processed then (above that) the `\_ol:..` sequence of the parent inceases its value too. The `_ol:...` sequences are implemented by `\_ol:\_count0:\_count1:\count2` etc. -For example, when section (level 2) is processed in the fisrst step then we do: +For example, when section (level 2) is processed in the first step then we do: \begtt \advance \count2 by 1 - % incerases the mapping pointer of the type + % increases the mapping pointer of the type % \_ol:<\_count0:\_count1:\_count2> of this section \advance \<_ol:\_count0:\_count1> by 1 - % incerases the number of descendants connected + % increases the number of descendants connected % to the parent of this section. \endtt @@ -90,10 +88,10 @@ When second step is processed, then we only read the stored data about the number of descentants. Ad we use it in `count` parameter of `\_pdfoutline` primitive. -For linking we use the same links as in TOC, i.e. the `toc:\_the\_tocrefnum` +For linking, we use the same links as in TOC, i.e. the `toc:\_the\_tocrefnum` labels are used. -`\insertoutline {<text>}` inserts one outline with zero direct descendants. +\`\insertoutline` `{<text>}` inserts one outline with zero direct descendants. It creates link destination of the type `oul:<num>` into the document -(where `\isertoutline` is used) and the link itself is created too in the +(where \^`\insertoutline` is used) and the link itself is created too in the outline. |