TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Title says it all, but here's an example: the KOMA-Script classes provide the option toc which can have multiple values that don't interfere with each other, like values that enable the Bibliography in the TOC and others that just influence the layout of the TOC. When I need several of these values for the class option toc, how can I pass them all together to toc without having to repeat toc= all the time?

What I have currently:

\documentclass[toc=listof, toc=bibliography, toc=flat]{scrbook}

Idea of what I'd like to have (but what does not work)

\documentclass[toc={listof, bibliography, flat}]{scrbook}

Is this somehow possible? If yes, how?

share|improve this question
write a feature request to the author of the KOMA classes – Herbert Jan 15 '13 at 10:39
Ah, so this depends on the class itself and not on some general Latex syntax? – Foo Bar Jan 15 '13 at 10:41
yes, it depends on how the class reads and sets its options. – Herbert Jan 15 '13 at 10:43
up vote 13 down vote accepted

The standard LaTeX \documentclass syntax doesn't use = at all, just a comma separated list of values like [12pt,twoside] so

\documentclass[toc=listof, toc=bibliography, toc=flat]{article}

would just be three (undefined) options toc=listof , toc=bibliography and toc=flat There is no mechanism for passing values to an option toc.

Some classes load keyval or similar packages and redefine \documentclass to use that so then your example passes the three values listof, bibliography and flat to the toc key defined by that class.

In your example toc={listof, bibliography, flat} the keyval parser will pass the single value listof, bibliography, flat to the toc key, but then it is up to the definition of that key in the class whether it treats this as an unknown value or whether it further processes it as a comma separated list.

share|improve this answer
Thanks for explaining the details. :) – Foo Bar Jan 15 '13 at 10:54

The easiest way I found for solving OP's problem is to introduce a new class file xscrbook. See below.

\ProvidesClass{xscrbook}[2013/01/17 v0.1 Extends KOMA-script-book class (AM)]
        \edef\scr@value{\zap@space##2 \@empty}%



\documentclass[toc={listof, bibliography, flat}]{xscrbook}

share|improve this answer
You certainly can pass keyval options using the \documentclass line: this is standard in KOMA. What you have to watch is that expansion and space-stripping takes place. – Joseph Wright Jan 16 '13 at 6:55
What's with all the trailing % signs? – DanielSank Sep 30 '14 at 6:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.