## LaTeX forum ⇒ LyX ⇒ Alpha-numerical chapters Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
aerus
Posts: 4
Joined: Sat Feb 04, 2012 11:33 am

### Alpha-numerical chapters

Hello,

I try to use LyX to write my german law thesis. If I add chapters and sections, I get a structure like I, 1, 1.1 what I want is though: A, I, 1, a), aa, (i), (ii)

Is it possible with LyX? If yes, how?

Stefan Kottwitz
Posts: 9768
Joined: Mon Mar 10, 2008 9:44 pm
Hi Aerus,

welcome to the board!

You could place LaTeX redefinitions in your LyX document preamble for that.

\renewcommand*{\thechapter}{\Alph{chapter}}
...
\renewcommand*{\thesubsubsection}{(\roman{subsubsection})}

Stefan

aerus
Posts: 4
Joined: Sat Feb 04, 2012 11:33 am

If I set this into preamble, I get this error message:

LaTex Error: \thechapter undefined

What can it be?

Stefan Kottwitz
Posts: 9768
Joined: Mon Mar 10, 2008 9:44 pm
Obviously you use a document class which doesn't provide chapters, such as article. Or which one did you choose?

Stefan

aerus
Posts: 4
Joined: Sat Feb 04, 2012 11:33 am
Ok, thanks, I figured it out now. I have another question. My TOC looks now like in the attachment.

I don't need the spacing between the number and the caption. How can I change this, too?
Attachments
alphanum-chapters.png (115.27 KiB) Viewed 8826 times
Last edited by Stefan Kottwitz on Sat Feb 04, 2012 1:04 pm, edited 1 time in total.

Stefan Kottwitz
Posts: 9768
Joined: Mon Mar 10, 2008 9:44 pm
Perhaps post your settings here, or the LyX preamble, as attachment. We cannot see yet how you produce that space or which settings cause that.

Stefan

aerus
Posts: 4
Joined: Sat Feb 04, 2012 11:33 am
I use article with KOMA-Script. My preamble looks like this:
\renewcommand*{\thepart}{\Alph{part}}
\renewcommand*{\thesection}{\Roman{section}}
\renewcommand*{\thesubsection}{\arabic{subsection}}
\renewcommand*{\thesubsubsection}{\alph{subsubsection}}
\renewcommand*{\theparagraph}{\roman{paragraph}}
\renewcommand*{\thesubparagraph}{(\arabic{subparagraph})}

Stefan Kottwitz
Posts: 9768
Joined: Mon Mar 10, 2008 9:44 pm
Ok, let's make a minimal working example, with your settings and class:

\documentclass{scrartcl}
\renewcommand*{\thepart}{\Alph{part}}
\renewcommand*{\thesection}{\Roman{section}}
\renewcommand*{\thesubsection}{\arabic{subsection}}
\renewcommand*{\thesubsubsection}{\alph{subsubsection}}
\renewcommand*{\theparagraph}{\roman{paragraph}}
\renewcommand*{\thesubparagraph}{(\arabic{subparagraph})}
\begin{document}
\tableofcontents
\section{Section level}
\subsection{Subsection level}
\subsubsection{Subsubsection level}
\subsubsection{Subsubsection level}
\paragraph{Paragraph level}
\end{document}

You will get the default look, which reserves space for wider numbers, because numbering such as I.1.a. is expected.

default-look.png (8.07 KiB) Viewed 8822 times

Now let's load tocstyle. It belongs to KOMA-Script, which you have installed, and provides an option for automatically calculating the indentation in the toc.

\usepackage[tocindentauto]{tocstyle}

It will calculate during several LaTeX compiler runs, then it will finally look this way:

tocstyle-look.png (8.06 KiB) Viewed 8822 times

Stefan