In computer science, the use of
as the letter lambda is quite recognisable as a symbol. How can I get this in LaTeX without changing the entire font of the document/math mode? I only want to change my lambdas.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityCombining Alan Munn's comment with egreg's answer:
\documentclass{article}
% ref.: egreg at https://tex.stackexchange.com/a/14406/
\usepackage{pifont}
\makeatletter
\newcommand\Pimathsymbol[3][\mathord]{%
#1{\@Pimathsymbol{#2}{#3}}}
\def\@Pimathsymbol#1#2{\mathchoice
{\@Pim@thsymbol{#1}{#2}\tf@size}
{\@Pim@thsymbol{#1}{#2}\tf@size}
{\@Pim@thsymbol{#1}{#2}\sf@size}
{\@Pim@thsymbol{#1}{#2}\ssf@size}}
\def\@Pim@thsymbol#1#2#3{%
\mbox{\fontsize{#3}{#3}\Pisymbol{#1}{#2}}}
\makeatother
% the next two lines are needed to avoid LaTeX substituting upright from another font
\input{utxmia.fd}
\DeclareFontShape{U}{txmia}{m}{n}{<->ssub * txmia/m/it}{}
% you may also want
\DeclareFontShape{U}{txmia}{bx}{n}{<->ssub * txmia/bx/it}{}
% just in case
%\DeclareFontShape{U}{txmia}{l}{n}{<->ssub * txmia/l/it}{}
%\DeclareFontShape{U}{txmia}{b}{n}{<->ssub * txmia/b/it}{}
% plus info from Alan Munn at https://tex.stackexchange.com/questions/290165/how-do-i-get-a-nicer-lambda?noredirect=1#comment702120_290165
\newcommand{\pilambdaup}{\Pimathsymbol[\mathord]{txmia}{21}}
\begin{document}
$\pilambdaup$
\end{document}
txfonts
package\lambdaup
. See also Importing a Single Symbol From a Different Font for using just this symbol.