On 6/15/24 08:15, Stef Pillaert wrote:
I have a Preface ("Voorwoord" in Dutch) in frontmatter, this is intended to be a non numbered chapter ("Hoofdstuk" in Dutch). This chapter should be in the TOC. In mainmatter, the numbering of the chapters should start by "1". The the first chapter is "Inleiding" (= introduction). The output is oke, see second screenshot: the chapter in the frontmatter has no number, and is in the TOC. Also, the first chapter of mainmatter has number "1". But is there a (not too difficult) way that LyX also shows the correct numbers in front of the chapters? You can see that it puts "1" in front of "Voorwoord", and the first chapter gets "2". A bit confusing...

It looks like you used a numbered section for the Voorwoord. If so, then of course LyX numbers it "1", and the rest go accordingly. I am guessing you have done that because unnumbered sections do not show up in the TOC. So the way to handle this would be to create a new layout that is both unnumbered and shows up in the TOC (or to manually add the Voorwoord to the TOC using ERT).


Like this:


# Marks the page headings

Style ChapterStar
    CopyStyle Chapter*
    LaTeXName chapstar
    Argument 1
        LabelString    "Page Heading"
    EndArgument
    Preamble
        \newcommand\chapstar[2][xxx]{
            \chapter*{#2}
\ifthenelse{\equal{#1}{xxx}}{\chaptermark{#2}}{\chaptermark{#1}
        }
    EndPreamble
}
End


# Also add to TOC
Style ChapStarTOC
    CopyStyle ChapterStar
    LaTeXName chapstartoc
    Preamble
        \newcommand\chapstartoc[2][xxx]{
            \chapstar[#1]{#2}
            \addcontentsline{toc}{chapter}{#2}
        }
    EndPreamble
End


Or perhaps more generally: perhaps there is an easier way to deal with frontmatter/mainmatter/... in LyX, hopefully without using  ERT?

There are frontmatter, etc, layouts in the Springer layouts. Probably we should copy those into other classes. But they're a bit hackish.


Riki

-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users

Reply via email to