Discussion:
LyX support for including unnumbered sections in TOC
Scott Kostyshak
2014-06-24 23:35:06 UTC
Permalink
This has come up twice (in the context of LyX) in the past week on
Stack Exchange:
http://tex.stackexchange.com/questions/185367/add-an-unnmbered-section-to-the-table-of-contents-in-lyx
http://tex.stackexchange.com/questions/186398/how-to-remove-enumerated-chapter-latex-in-lyx

Is this something that would be useful to add support for in LyX?

Thoughts on interface:
One way that would not clutter the GUI too much would be a checkbox
that says something like "add unnumbered divisions to TOC if numbered
counterparts are added".
I think there is more demand for a categorical solution than a
solution that allows the user to decided whether each individual
unnumbered division should be in the TOC.

Thoughts on implementation:
(a) We could export \addcontentsline where appropriate depending on
document settings.
(b) Werner posted a preamble solution (see the answer to the first
link above) that causes all unnumbered chapters to be put in the table
of contents. We could add this to the preamble for each of
section/chapter/etc that exists as unnumbered that should be in the
TOC (as determined by document settings).

Thoughts?

Scott
Richard Heck
2014-06-25 02:26:27 UTC
Permalink
Post by Scott Kostyshak
This has come up twice (in the context of LyX) in the past week on
http://tex.stackexchange.com/questions/185367/add-an-unnmbered-section-to-the-table-of-contents-in-lyx
http://tex.stackexchange.com/questions/186398/how-to-remove-enumerated-chapter-latex-in-lyx
Is this something that would be useful to add support for in LyX?
Yes, it's a very common question.
Post by Scott Kostyshak
One way that would not clutter the GUI too much would be a checkbox
that says something like "add unnumbered divisions to TOC if numbered
counterparts are added".
I think there is more demand for a categorical solution than a
solution that allows the user to decided whether each individual
unnumbered division should be in the TOC.
The categorical solution is definitely easier, and of course it does not
preclude the other
solution at some later date. They're really independent.
Post by Scott Kostyshak
(a) We could export \addcontentsline where appropriate depending on
document settings.
(b) Werner posted a preamble solution (see the answer to the first
link above) that causes all unnumbered chapters to be put in the table
of contents. We could add this to the preamble for each of
section/chapter/etc that exists as unnumbered that should be in the
TOC (as determined by document settings).
I think I would go with (a). That kind of redefinition scares me, since
we support so many
document classes, etc, and you never know exactly how sectioning
commands are defined
in any particular one.

Richard
Georg Baum
2014-06-25 20:05:10 UTC
Permalink
Post by Richard Heck
Post by Scott Kostyshak
This has come up twice (in the context of LyX) in the past week on
http://tex.stackexchange.com/questions/185367/add-an-unnmbered-section-
to-the-table-of-contents-in-lyx
Post by Richard Heck
Post by Scott Kostyshak
http://tex.stackexchange.com/questions/186398/how-to-remove-enumerated-
chapter-latex-in-lyx
Post by Richard Heck
Post by Scott Kostyshak
Is this something that would be useful to add support for in LyX?
Yes, it's a very common question.
Yes indeed. And it is already supported, depending on the document class.
Post by Richard Heck
Post by Scott Kostyshak
One way that would not clutter the GUI too much would be a checkbox
that says something like "add unnumbered divisions to TOC if numbered
counterparts are added".
I think there is more demand for a categorical solution than a
solution that allows the user to decided whether each individual
unnumbered division should be in the TOC.
Is it really the common case that all unnumbered sections of a certain kind
should be added? IMHO the solution offered by the KOMA classes is the best
one: They offer additional unnumbered environements with TOC entries. This
is even supported by LyX. For other classes one could easily write a module
that adds equivalent environments.
Post by Richard Heck
I think I would go with (a). That kind of redefinition scares me, since
we support so many
document classes, etc, and you never know exactly how sectioning
commands are defined
in any particular one.
I don't like the redefinition either. I'd put the \addcontentsline in a
module (and not hardcoded in LyX).


Georg
Scott Kostyshak
2014-06-25 20:18:26 UTC
Permalink
On Wed, Jun 25, 2014 at 4:05 PM, Georg Baum
Post by Georg Baum
I don't like the redefinition either. I'd put the \addcontentsline in a
module (and not hardcoded in LyX).
A module sounds like a good idea. So the module would add new layouts
such as Section* (TOC), Chapter* (TOC). Any other ideas for the name?
Section* (+TOC) ?

Scott
Georg Baum
2014-06-25 20:24:03 UTC
Permalink
Post by Scott Kostyshak
A module sounds like a good idea. So the module would add new layouts
such as Section* (TOC), Chapter* (TOC). Any other ideas for the name?
Section* (+TOC) ?
I'd steal the ones from src*.layout. This has the advantage that the styles
stay intact if you change the document class to or from e.g. scrbook. The
are called Addchap, Addsec etc. in LyX and addchap, addsec etc. in LaTeX.
Another advantage is that no new translations are needed.

Georg
Scott Kostyshak
2014-06-25 20:33:06 UTC
Permalink
On Wed, Jun 25, 2014 at 4:24 PM, Georg Baum
Post by Georg Baum
Post by Scott Kostyshak
A module sounds like a good idea. So the module would add new layouts
such as Section* (TOC), Chapter* (TOC). Any other ideas for the name?
Section* (+TOC) ?
I'd steal the ones from src*.layout. This has the advantage that the styles
stay intact if you change the document class to or from e.g. scrbook. The
are called Addchap, Addsec etc. in LyX and addchap, addsec etc. in LaTeX.
Another advantage is that no new translations are needed.
That makes sense. Thanks for the ideas.

Scott

Loading...