* Re: PATCH: ox-latex table of contents patch consolidated
[not found] <CAO48Bk_YbSEEQVkTeFAWDDhbWp+2x3KAjX8rkP=U40Zc7gX+gQ@mail.gmail.com>
@ 2025-01-21 19:12 ` Ihor Radchenko
0 siblings, 0 replies; only message in thread
From: Ihor Radchenko @ 2025-01-21 19:12 UTC (permalink / raw)
To: Pedro Andres Aranda Gutierrez; +Cc: Org Mode List
Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:
> I will need a couple of days offline. I'm sending the last consolidated
> version of the ToC patch for ox-latex.el
Thanks!
Looks like you omitted some of the points discussed (your patch changes
how opt-title is handled in unnumbered sections with footnotes that are
to be included inside TOC. [line: (setq opt-title full-text-no-footnote)]
> +*** ox-latex: Table of contents generation has been fixed and augmented
> +
> +The LaTeX exporter differs from other exporters in that it *does not*
> +export unnumbered sections by default.
does not include unnumbered sections into TOC, while most other backends
do include them.
It is also a good idea to explain why (closer to how latex does it)
> +A new property =:UNNUMBERED: toc= has been defined to include
> +unnumbered sections in the table of contents.
new value of property.
Also, it is worth mentioning that UNNUMBERED: toc will keep working for
other backends (equivalent to UNNUMBERED: t)
> +Additionally, a new custom variable ~org-latex-consistent-toc~ has
> +been introduced to enable the inclusion of unnumbered sections in the
> +ToC like other exporters. In this case, to exclude a section from the
> +table of contents, mark it as =:UNNUMBERED: notoc=
I do not like the variable name here.
Let's make up something a bit more comprehensive to people not familiar
with all the intricacies. For example,
org-latex-toc-include-unnumbered-style (values: 'latex or 'org).
> +#+cindex: LaTeX ToC export á la ~org~
"a la" is a bit hard to search from latin keyboard.
> +(defconst org-latex-unnumbered-section-re
> + "^\\\\\\(chapter\\|\\(sub\\)*section\\)[*]"
> + "Regexp to get the unnumbered section unit from the heading.
> +Use this to get the unit (chapter, section, subsection, etc.)
> +you want to add to the table of contents.
> +
> +The *first* match will be included in the
match group?
> (level (org-export-get-relative-level headline info))
> + ;; "LEGACY MODE"
> + ;; :unnumbered: toc will add the heading to the ToC
> + ;; "BREAKING MODE"
> + ;; :unnumbered: notoc to suppress heading from the ToC
> + ;; else include all headings (including unnumbered) like other modes
> + (unnumbered-type (org-export-get-node-property :UNNUMBERED headline t))
Maybe "Latex TOC style" and "Org TOC style".
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] only message in thread