LaTeX forum ⇒ Document ClassesUsing default values from keys

Information and discussion about specific document classes and how to create your own document classes.
Posts: 3
Joined: Sun Nov 05, 2023 10:51 pm

Using default values from keys

Postby Borgia » Mon Nov 06, 2023 2:01 pm

In this code, the third level picks up the colour value from level two. But I want the third level to take the default red colour value.

How can I apply a default set of keys at the start of each environment ?



    left=0pt, parsep=0pt, itemindent=8pt,

\tl_new:N \tlapis_kl_tl
\tl_new:N \tlapis_lv_tl

\keys_define:nn { tlapis_keys }
  %% Define Key-Value Interface within namespace tlapis_keys.
    kl .tl_set:N = \tlapis_kl_tl,
    kl .default:n = {red},
    kl .initial:n = {red},

    lv .tl_set:N = \tlapis_lv_tl,
    lv .default:n = {},
    lv .initial:n = {},

\NewDocumentEnvironment {wvTlapis} { O{} }
      \keys_set:nn {tlapis_keys} {#1}

      \tl_if_empty:NTF {\tlapis_lv_tl}
    { \end{wvTlaps} }



    \item First level
        \item Second level
            \item Third level


Recommended reading 2021: • •
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics

Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 6 guests