LaTeX forum ⇒ LyXAlpha-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

Postby aerus » Sat Feb 04, 2012 11:46 am

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?

Thank you in advance

User avatar
Stefan Kottwitz
Site Admin
Posts: 9768
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Feb 04, 2012 12:21 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})}


Have a look at Manipulating the way counters are printed to learn more about that.

Stefan
LaTeX.org admin

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

Postby aerus » Sat Feb 04, 2012 12:29 pm

Thanks for your rapid reply.

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

LaTex Error: \thechapter undefined

What can it be?

User avatar
Stefan Kottwitz
Site Admin
Posts: 9768
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Feb 04, 2012 12:34 pm

Obviously you use a document class which doesn't provide chapters, such as article. Or which one did you choose?

Stefan
LaTeX.org admin

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

Postby aerus » Sat Feb 04, 2012 1:01 pm

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
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.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9768
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Feb 04, 2012 1:07 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
LaTeX.org admin

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

Postby aerus » Sat Feb 04, 2012 1:11 pm

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})}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9768
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Feb 04, 2012 1:43 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
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
tocstyle-look.png (8.06 KiB) Viewed 8822 times


Stefan
LaTeX.org admin


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 3 guests