From: Ihor Radchenko <yantar92@posteo.net>
To: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: PATCH: ox-latex table of contents patch consolidated
Date: Tue, 21 Jan 2025 19:12:16 +0000 [thread overview]
Message-ID: <87frlcq8vj.fsf@localhost> (raw)
In-Reply-To: <CAO48Bk_YbSEEQVkTeFAWDDhbWp+2x3KAjX8rkP=U40Zc7gX+gQ@mail.gmail.com>
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>
parent reply other threads:[~2025-01-21 19:11 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CAO48Bk_YbSEEQVkTeFAWDDhbWp+2x3KAjX8rkP=U40Zc7gX+gQ@mail.gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87frlcq8vj.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=paaguti@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).