I' writing a test macro to evaluate the Lettrine arguments for different letters & different sizes (lines). The scenario is this:

  1. The main prog calls a one arg macro to test the Lettrine for a given letter: \TestLettrine{A}
  2. The \TestLettrine macro calls another macro to get the right options passing it the letter & the size (line numbers) to pass it to Lettrine: \LettrineOpts{A}{3}.

When I compile this (I'm using LuaLatex) I get the message:

! Argument of \xs_IfStringCase_ii has an extra }.
<inserted text>
l.179 \TestLettrine{A}

Ran it on Overleaf got more errors including the one mentioned here.

Here's my MWE:



  Opts for char #1 and size 3:\\ \opts 
  \lettrine[\opts]{#1}{}3 lines (\opts). One liner.

  Opts for char #1 and size 4:\\ \opts 
  \lettrine[\opts]{#1}{}4 lignes. \\ \lipsum


\TestLettrine{A} \par
% covering all the letters

  • Giving a command as parameter, that is interpreted as by keyval seems to be a problem. Minimal example: \documentclass{article} \usepackage{lettrine} \newcommand{\LettrineOpts}{lines=3} \newcommand{\TestLettrine}[1]{\lettrine[\LettrineOpts]{#1}{}} \begin{document} \TestLettrine{A} \end{document}
    – dexteritas
    Commented Mar 25, 2023 at 11:34
  • Thanks @dexteritas,
    – Reza
    Commented Mar 25, 2023 at 12:40

1 Answer 1


Your code generates another error and does not allow me to play the size variation (lines=n).

In the meantime I found another solution which I'm going to adopt. It uses the Lettrine config file where I can define the options for every char I want. I though initially that defining the size will override those definitions. Which is not the case. Lettrine MERGES my options with those already in the config file.

Excellent work of Daniel Flipo!

In case this solution might help someone here is the snippets of the final code.

Config file (options.cfl):

\LettrineOptionsFor{A}{slope=0.1\LettrineWidth, findent=-.5em, nindent=.7em}
\LettrineOptionsFor{À}{slope=0.1\LettrineWidth, findent=-.5em, nindent=0.7em}
\LettrineOptionsFor{V}{slope=-0.1\LettrineWidth, lhang=0.5, nindent=0pt}
\LettrineOptionsFor{Q}{loversize=-0.1, lraise=0.1}

And the macros and their call:


  \lettrine[lines=3]{#1}{} lines: 3 \\ \blah
  \lettrine[lines=4]{#1}{} lines: 4 \\ \blah

  \foreach \char in {A, À, C', Q, V }{%
    \TestLettrine{\char} \par%


The options are given for the example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .