Pedro Andres Aranda Gutierrez <paag...@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>