I would like to have two commands to reduce the code in my document for managing lettrine capitals. The first should work like normal with small caps; but the second should use italic shape. Is there a way to define macros that I can use after the preamble and which will change the font that lettrine uses?
Minimal code example:
\documentclass{scrartcl}
\usepackage{xltxtra}
\usepackage{xcolor} % für farbigen Text
\setromanfont[SmallCapsFont={Alegreya Sans SC}]{Alegreya Sans}
\usepackage{lettrine}
\renewcommand{\LettrineFontHook}{%
\fontseries{\seriesdefault}
\fontshape{\shapedefault}
}
\renewcommand{\LettrineFontHook}{%
\fontfamily{\familydefault}
\fontseries{\seriesdefault}
\fontshape{\itdefault}
\selectfont
}
\newcommand{\LettrineA}[2]{\lettrine[lines=3,findent=.5em]{\color{olive}#1}{#2}}
\newcommand{\LettrineB}[2]{\lettrine[lines=3,findent=.5em]{\color{orange}#1}{#2}}
\begin{document}
\LettrineA{T}{his text} is written in a normal font. The first 2 words are in small caps. The following words are only here to fill the paper and waste some space, time and hopefully no money. But if it is wasting time it is wasting money aswell if we trust old phrases.
\LettrineB{T}{his text} is written in a normal font. The first 2 words are in italic shape. The following words are only here to fill the paper and waste some space, time and hopefully no money. But if it is wasting time it is wasting money aswell if we trust old phrases.
\end{document}


\LettrineFontHookin place of doing\begingroupand to restore it instead of doing\endgroup. – egreg Mar 26 '17 at 20:37