0

I have the following code that works fine, but would like to make it to lowercase which I have not quiet accomplished yet

\documentclass{scrlttr2}

\usepackage{graphicx}
\setkomavar{fromname}{t}

\def\mylogo{class_\csname scr@fromname@var\endcsname}

\begin{document}

\includegraphics{\mylogo}

\end{document}

Any ideas on how I could make sure that whatever is in the komavar is in lowercase?

  • Related (maybe duplicate?): https://tex.stackexchange.com/questions/204541/use-of-lowercase – Marijn Mar 18 '20 at 14:45
  • @Marijn it is related but I cannot just sub \lowercase\expandafter\expandafter\expandafter{\csname scr@fromname@var\endcsname} for \csname ...\endcsname. Do I need more \expandafter or is there another way? – diophantus7 Mar 19 '20 at 16:13
  • There is another way, see for example https://tex.stackexchange.com/questions/173481/expandably-change-letter-case-and-use-inside-csname-without-a-package. I tried \setkomavar{fromname}{B}\usepackage{stringstrings}\caselower[q]{\csname scr@fromname@var\endcsname}\def\mylogolc{example-image-\thestring} and that works for your code as well (generating the filename example-image-b, which is a special demo image file that is part of the graphicx package). – Marijn Mar 19 '20 at 16:59
  • @Marijn Thanks that works for me! – diophantus7 Mar 21 '20 at 07:36

0 Answers0