LyXachemso | ToC shows only Chapters

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
jhunandyn
Posts: 2
Joined: Wed Nov 28, 2012 4:16 pm

achemso | ToC shows only Chapters

Post by jhunandyn »

Hello everyone

I'm new to LaTeX and decided to use LyX to hopefully ease the transition from word-type programs. I had a look at different document classes and found a really nice one: article (ACS) using the achemso LaTeX package to write articles for journals of the American Chemical Society. The formatting of the bibliography this class provides is awesome, the added options for citations as well; and the little widget to type chemistry formulas and getting the formatting (like subscripts) done automatically is just icing on the cake. A really great document class for what I need most often.

There's an issue that makes using it for anything but articles a hassle though: The ToC doesn't show sections or paragraphs only chapters (parts) regardless of the options chosen in the Document->Settings->Numbering & ToC menu.
The two sliders can be used to adjust the depth of display in ToC and the Outline in LyX reflects this just fine, but when I convert the file to a PDF, only the chapters show up in the ToC.

Since the "problem" appears upon conversion of LyX code to PDF I suppose it has something to do with the layout file behind that document class. I tried to compare this with those of other document classes like article (Elsevier) which have a ToC by default but I wasn't able to do anything useful with it ... there's too much I don't understand what line does what ... and to many linked files I have no idea what they're good for.
I also tried to compare the LaTeX source code shown in LyX of a dummy text using the article (ACS) document class with the code of the same text using the article (Elsevier) document class. I wasn't able to make out a difference in that code related to the ToC.

Any help regarding the layout file or how to get the ToC to show sections, subsections and so on using LaTeX code inside LyX is very much appreciated. The other option I could try is to copy all the "good stuff" like the options for the bibliography and the chemical formula widget into the layout file of another generic document class...but I suppose this is going to be more complicated than adjusting the ToC options for this document class.

The LyX version I downloaded (the "starter bundle" with LyX 2.0.5 and MiKTeX 2.9) already included all that was needed to use this document class and even a dummy document using this class to show off its features, I'll attach the achemso layout file and the dummy document anyway though for people with older versions. There's no ToC in the sample file so you might want to add it yourself.


Thanks a lot,
jhunandyn
Attachments
achemso.zip
achemso.layout: layout file for the article (ACS) document class. Zipped because the forum doesn't let me upload .layout files directly.
(1.6 KiB) Downloaded 386 times
achemso.lyx
achemso.lyx: dummy document using the achemso layout; note: the title is implemented as LaTeX preamble; you can access this via Document->Settings->LaTeX preamble in LyX
(8.49 KiB) Downloaded 347 times
Last edited by jhunandyn on Thu Nov 29, 2012 12:06 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

achemso | ToC shows only Chapters

Post by meho_r »

A somehow similar question was asked here. Maybe \SectionNumbersOn will do the trick.
jhunandyn
Posts: 2
Joined: Wed Nov 28, 2012 4:16 pm

achemso | ToC shows only Chapters

Post by jhunandyn »

This worked; thanks a lot. I didn't put the line right after \documentclass as advised in the post linked above (because I don't know how to access that part in LyX, just have a look at it using View->View Source); but at the beginning of the preamble with the title, authors and so on and it worked just fine as well.
Post Reply