Text FormattingSection Font Size Needs To Be smaller In The TOC

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
insipidtoast
Posts: 128
Joined: Wed Jul 04, 2012 5:34 pm

Section Font Size Needs To Be smaller In The TOC

Post by insipidtoast »

In order to help make my section titles stand out, I manually changed their font size to "huge." However, the problem is that this huge font also ends up in my table of contents, where I need it to be smaller.

Because of this, the section titles are actually bigger than the chapter titles in my table of contents. I need the section titles to be smaller than the chapter titles in my table of contents.

How do I do this?

Is there a fancyTOC package or something? If so, how do I use it?
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Section Font Size Needs To Be smaller In The TOC

Post by Stefan Kottwitz »

I remember you use KOMA classes, there are features which you can use in your preamble, such as

Code: Select all

\addtokomafont{section}{\huge}
\setkomafont, \addtokomafont and supported elements are explained and listed in the manual.

Stefan
LaTeX.org admin
insipidtoast
Posts: 128
Joined: Wed Jul 04, 2012 5:34 pm

Re: Section Font Size Needs To Be smaller In The TOC

Post by insipidtoast »

1) I don't know what "manual" you're talking about.

2) I need to specifically change the section fonts only in the table of contents. In text they are huge (what I want). In the table of contents they are also huge (not what I want).

3) What's the quick fix command to change that?
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
insipidtoast
Posts: 128
Joined: Wed Jul 04, 2012 5:34 pm

Re: Section Font Size Needs To Be smaller In The TOC

Post by insipidtoast »

*Edit: Deleted, because I remembered you don't like having multiple topics in a thread ;)
Last edited by insipidtoast on Thu Sep 20, 2012 1:02 am, edited 1 time in total.
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Section Font Size Needs To Be smaller In The TOC

Post by Stefan Kottwitz »

insipidtoast wrote:I don't know what "manual" you're talking about.
The KOMA-Script manual which I already mentioned in your topic Margins for books need to be closer to outer edge.
insipidtoast wrote:I need to specifically change the section fonts only in the table of contents. In text they are huge (what I want). In the table of contents they are also huge (not what I want).
How did you makle them huge in the text? Note, it's not good to choose a font size locally, i.e. within a section heading, it should be done globally.
insipidtoast wrote:What's the quick fix command to change that?
\addtokomafont or \setkomafont with a KOMA-Script class, with other classes you could use \titleformat of the titlesec package.

Stefan
LaTeX.org admin
insipidtoast
Posts: 128
Joined: Wed Jul 04, 2012 5:34 pm

Section Font Size Needs To Be smaller In The TOC

Post by insipidtoast »

OK Stefan,

I searched through that KOMA-Script manual using the search terms:
\setkomafont
and
\addtokomafont
and I found a few results. However, none (as far as I can tell) show me what I need to do in order to modify the font ONLY in the table of contents ONLY for the "section" headings.

Most of what appears in that manual seems over my head, so it's definitely possible that I may have missed the solution.
How did you makle them huge in the text? Note, it's not good to choose a font size locally, i.e. within a section heading, it should be done globally.
In Lyx it is easy to modify the text in the body of a document, but it doesn't let you modify text in the list of figures or table of contents sections (at least not very easily).

To change the font size of a section heading in the body of a document all you have to do is highlight the text, right click, then click on Text style ---> customized...

I wish it was that simple to modify the text in the table of contents.

Basically, what I want to do is be able to modify the font of the table of contents independently of what I do to the font in the body of the document. Actually, I'd like to be able to treat the table of contents and list of figures as completely independent entities. Aside from just modifying their font independently, I'd also like to be able to add text to them that doesn't appear in the body of the document.
FYI:
I'm using windows with LyX 2.0 and MiKTeX 2.9
I'm designing a book using the Koma-script class
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Section Font Size Needs To Be smaller In The TOC

Post by cgnieder »

Doesn't this do what you want?

Code: Select all

\documentclass{scrbook}
% this is the preamble
\addtokomafont{section}{\huge}
% preamble ends now
\begin{document}

\tableofcontents

\chapter{A chapter}
\section{First test}
\section{Second test}

\end{document}
The table of contents:
koma1.png
koma1.png (6.5 KiB) Viewed 13072 times
The section titles:
koma2.png
koma2.png (7.88 KiB) Viewed 13072 times
Regards
Last edited by cgnieder on Thu Sep 20, 2012 9:09 pm, edited 1 time in total.
site moderator & package author
Post Reply