8

I'm using siunitx to format units correctly. One of the units I need to use is litres - but the default l looks too much like a numerical 1 for me. I'd like to use a lower-case curly l (\ell will serve the purpose well).

The problem is, I don't seem to be able to redefine the existing unit macro. Creating a new macro does work though.

Code below.

\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit{\l}{\ell}
\DeclareSIUnit{\myl}{\ell}

\begin{document}
\si{\l} \si{\myl} $\ell$
\end{document}

Output: \l does not get redefined correctly

  • @mico This doesn't explain why the \si{\l} doesn't work as expected though. I'm still curious ;-) – Thorbjørn E. K. Christensen Mar 28 '18 at 10:28
  • If you read section 5.11 of the siunitx manual, \l is an abbreviated unit (full list in table 21). Also, it might be worth (me) noting that by default, \litre will output l, and \liter will output L. – JustinT Mar 28 '18 at 10:36
10

This is (possibly) really silly - but the comments above gave me the clue. The \l macro is an abbreviation of the \litre macro. Redefining \litre also redefines \l.

\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit{\litre}{\ell}

\begin{document}
\si{\l} $\ell$
\end{document}

\litre redefines \l

| improve this answer | |
  • 1
    Section 5.11 of the siunitx manual. As standard, siunitx loads a set of abbreviated versions of the SI units (Table 21). – JustinT Mar 28 '18 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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