1

Reading 'source2e.dtx' suggests that the 'l3keys' property '.default' should be available. The following MWE doesn't work as I expected though:

\documentclass[a4paper]{article}
\usepackage{color}
\newcommand*{\test}[1]{\textcolor{\mycolor}{#1}}

\DeclareKeys{ ref.default = red , ref.store = \mycolor , }

\begin{document}

\SetKeys{ ref = blue, } \test{Blue}

\SetKeys{ ref, } \test{Red} \end{document}

I get an error [TeXLive 2023 updated today]:

"./DeclareKey.tex:9: LaTeX Error: The key property '.default' is unknown."

and The "Red" text is printed in black (I expected red).

What am I missing?

Daniel Flipo
  • 2,059

1 Answers1

2

The key property to set a default value doesn't have a LaTeX2e equivalent (yet?), you'll have to use .default:n instead for now (see the documentation of the l3keys-module in interface3.pdf).

\documentclass[a4paper]{article}
\usepackage{color}
\newcommand*{\test}[1]{\textcolor{\mycolor}{#1}}

\DeclareKeys{ ref.store = \mycolor , ref.default:n = red , }

\begin{document}

\SetKeys{ ref = blue, } \test{Blue}

\SetKeys{ ref, } \test{Red} \end{document}

Skillmon
  • 60,462