Nick Kuzmik wrote:
Among other things I like to use Lyx to create study guides for my math
courses. I use Section/subsection/subsubsection to organize that info in a
reasonable fashion. I also like to use a TOC as some of these study guides
can get a tad large, and the TOC speads up the studying.
What I've found awkward is that when a create a study guide for say chapters 2.5-4.4, and start using Section and such, Lyx automatically starts at Section 1
I've tried using Section* and manually titeling my headings, but they they don't appear in the TOC.
What I'm asking is does anybody know of some ERT that will allow me to insert a section heading and dispite being the first section on the page, have that be section 4, and still have it show up in the TOC?
Am I trying to have my cake and eat it too?
You can use ERT to set the chapter, section, subsection etc. counters to
anything you want. The command is \setcounter{x}{n} where x is the name
of the counter (chapter, section, subsection, subsubsection, ...) and n
is a positive integer. You put the command in ERT prior to the heading
where you want it to take effect, and you can do so repeatedly if you
want the heading numbers to skip around. Two things to keep in mind:
1. The counter must be defined. (For instance, the article class does
not have a chapter counter.)
2. The heading environment will increment the corresponding counter, so
you need to make allowances for that. Suppose you want the first
heading to be a subsection numbered 2.5. You would put the following in
ERT prior to the subsection environment:
\setcounter{section}{2}\setcounter{subsection}{4}.
The subsection environment will increment the subsection counter to 5
(but will not change the section counter).
Paul