# Why is it discouraged to use starred sectioning commands?

I'm currently considering to use \section* to add a nomenclature. Unfortunately I can't find the exact answer, but I've read on stackexchange that using starred versions of sectioning commands is considered bad practice.

Can anyone tell me why?

• it's a mystery to me why using starred sectioning commands is considered bad practice. i happen to believe that leaving starred commands out of the toc (as is the default with the basic latex classes) is a mistake, but that doesn't mean that they're not valuable in many situations. can you cite some reference questions where this point of view is presented (either explicitly or implicitly)? Sep 9, 2013 at 17:47
• @barbarabeeton Section 4.2 of the titlesec documentation, for example: "Using sectioning commands in the starred version is strongly discouraged. Instead, you can use a set of markup oriented commands which are easy to define and modify, if necessary." Sep 9, 2013 at 17:48
• @AlanMunn With titlesec, perhaps. Sep 9, 2013 at 17:51
• @egreg Perhaps, but I think the objection in the titlesec documentation is conceptual, and not purely technical. Sep 9, 2013 at 17:54
• @alan-munn Thanks for the reference, I read it in the titlesec documentation. If no one knows a reason why it is discouraged, then it probably isn't so bad. Sep 9, 2013 at 17:59

Some consider it bad practice, as the holy grail of document mark-up is the separation of semantics from styling. An ideal almost achievable with the standard classes. However, the ideal breaks with the starred version of LaTeX sectioning commands as they have the same semantics (but are mostly used for styling).

A different approach is to expand the sectioning commands to include additional book sections with properties, for example one could have:

 Nomenclature
toc = true
name = Nomenclature
numbering = none

Foreward
toc = false,
name = Foreward  % Can change based on language
numbering = none


I don't know what Javier Bezos had in mind when he wrote "Using sectioning commands in the starred version is strongly discouraged...", but his idea is very similar as one can guess from his examples. In addition he is advocating environments rather than simple \section type commands. I share similar thoughts on the subject, for complicated sectioning commands (i.e., cases where one might have an image for the Chapter head, and additional image for the toc, Foreward, Nomenclature etc).

See for example this document, Page 5, Pages 42-50, which is the doc for a class, that I have been developing on and off for a while now (code at github). The code is still under development and not ready for general consumption (still buggy), but currently aiming at a just after Christmas release! Some examples the chapter head at left, has an image and goes into toc, where the one on the right (for a magazine has no number, has an image and a by-line and the heading can go into a toc).

LaTeX can do so much more than just maths. Anyone that has more time than I and wants to help the Project, please buzz me at chat.

• You and your fantastic images.... Sep 9, 2013 at 20:52
• @percusse ... if only I could do more LaTeX3 and tikz:) Sep 9, 2013 at 20:57
• @YiannisLazarides -- good examples, worthy of an answer, not just a comment. the environment concept is a good one -- it allows much more flexibility than a simple command, although there are complications that need to be allowed for (handling of verbatim, for example). but those can be overcome. no time to help your project in the near future, but if you're still doing interesting things this time next year, i might; i'm really good at "destructive testing". Sep 9, 2013 at 21:21
• @barbarabeeton Thanks! My biggest complication at the moment is electronic docs and hyperref. Looking forward to "destructive testing" and given current workload at the moment timing is probably just about right. Sep 9, 2013 at 21:28
• These are good examples. I don't understand the code about section properties, can you link to an explanation? Your package doc seems to be about chapter headings, I didn't find something related to the code example there. Sep 9, 2013 at 23:48