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

I have read the docs and the tutorial about kvoptions and xkeyval but I can not get my xkeyval example to compile.

This is the error:

! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
l.10 \define@choicekey*{test}[war

which I get with this code:


% Test using xkeyval

Errorlevel is: \KV@test@errorlevel%



what am I doing wrong?

(posted also on de.comp.text.tex, but with no answer)

share|improve this question
up vote 3 down vote accepted

According to the syntax


check delimiters, the first argument is optional, the second argument cannot be in brackets. For example:


Also consider specifying the family for \ProcessOptionsX, such as

share|improve this answer

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.