> El 23 feb 2025, a las 12:54, Ihor Radchenko <yanta...@posteo.net> escribió:
> 
> Pedro Andres Aranda Gutierrez <paag...@gmail.com> writes:
> 
>> We would forget unnumbered sections with alt_title…
> 
> May you elaborate?

Maybe I didn’t understand completely, so let’s go one step back.

Why do we all need this (from a LaTeX point of view)?

In numbered sections, we have \section[]{}. The {} is what appears in the 
document.
If the [] exists, it goes to the ToC instead of the {}.
This can be used when we explicitly want an alternative title or when we want 
to suppress the footnotes, because they don’t play well in the ToC.

In the unnumbered sections, we have the addcontentsline if we want to include 
an unnumbered section header in the ToC. Provided this,
again the clear case is when we  have an alternative title. The second is when 
we want to include the heading.
And here again, we need to suppress the \fotonotes in order to avoid errors.

This is how the LaTeX manual tells you to do things, how they are taught and 
how anyone with a 101 in LaTeX expects the exported document to look like.

Would \addcontentsline be possible? Yes, but we would add complexity 
unnecessarily. See 
https://tex.stackexchange.com/questions/101538/addcontentsline-lines-added-to-toc-not-numbered-and-lines-added-to-tot-not-sh
 
<https://tex.stackexchange.com/questions/101538/addcontentsline-lines-added-to-toc-not-numbered-and-lines-added-to-tot-not-sh>
Citing:

As Werner mentioned, \addcontentsline doesn't include the numbering of the line 
added, according to the level where it was added (ex.: subsubsection). So, we 
have to add the numbers (value of the chapter, value of the section, value of 
the subsection, value of the subsubsection), with the help of counters (see 
http://en.wikibooks.org/wiki/LaTeX/Counters 
<http://en.wikibooks.org/wiki/LaTeX/Counters>).

Best, /PA

Reply via email to