5

I need italic and non-italic \lambda in the same document. Since the \mathit{\lambda} does not work, I got idea to simulate italic by changing fonts (Times New Roman for italic lambda, and Latin Modern for non-italic).

I made the following example based on answers from here and here

\documentclass{article}
\usepackage{amsmath}
\usepackage{lmodern}     % set math font to Latin modern math 
\usepackage[T1]{fontenc}
\renewcommand\rmdefault{ptm} %change text font to Times New Roman


\DeclareMathVersion{mymath}
\DeclareSymbolFont{myletters}{T1}{ptm}{m}{it}
\SetSymbolFont{letters}{mymath}{T1}{ptm}{m}{it}
\DeclareSymbolFont{myoperators}{T1}{ptm}{m}{n}
\SetSymbolFont{operators}{mymath}{T1}{ptm}{m}{n}


\newenvironment{myfont}{\mathversion{mymath}}{}
\DeclareTextFontCommand{\mathmyfont}{\myfont}

% Define lambda with Times New Roman font
\newcommand{\lambdaTimes}{\mathmyfont{$\lambda$}}

\begin{document}

\begin{align}
\textrm{Lambda in Latin modern:} \lambda \\
\textrm{Lambda in Times New Roman:}\lambdaTimes
\end{align}
\end{document}

This example does not work, it produce - instead of lambda in Times font. What is wrong in this example?

Is there a easier way to make italic and non-italic lambda in the same document?

P.S. I am using Times New Roman in text mode, and Latin modern in math mode in document.

7

Latin Modern math doesn't blend with Times New Roman. You're better using NewTX:

\documentclass{article}
\usepackage{newtxtext,newtxmath}

\begin{document}

The text is in Times; $\lambda\lambdaup$.

\end{document}

enter image description here

If you insist in using Latin Modern math symbols, here's how you can do:

\documentclass{article}
\usepackage{amsmath}
\usepackage{lmodern}     % set math font to Latin modern math
\usepackage[T1]{fontenc}
\renewcommand\rmdefault{ptm} %change text font to Times New Roman

\DeclareSymbolFont{myletters}{OML}{ztmcm}{m}{it}
\DeclareMathSymbol{\uplambda}{\mathord}{myletters}{"15}

\begin{document}

\begin{align}
\textrm{Lambda in Latin modern:} \lambda \\
\textrm{Lambda in Times New Roman:}\uplambda
\end{align}
\end{document}

enter image description here

  • What do you mean with Latin Modern math doesn't blend with Times New Roman. Is it impossible to use these two fonts in same equation? – Dejan Feb 24 '15 at 13:42
  • 1
    @Petar They're typographically incompatible with each other. – egreg Feb 24 '15 at 13:42
  • Ok, I didn't know this. I was thinking that I can mix any two fonts. However, the previous example does not work if we for example include package amsthm. The error is that \openbox is already defined. – Dejan Feb 24 '15 at 13:47
  • @Petar Load amsthm and amsmath before newtxmath. – egreg Feb 24 '15 at 13:55
  • 1
    @Petar You can mix any two fonts. egreg was talking about style and taste. Typographically incompatible means that they look bad together. – LaRiFaRi Feb 24 '15 at 13:58
3

If you are able to use Lua- or XeLaTeX, I would recommend the package unicode-math:

% arara: lualatex

\documentclass{article} 
\usepackage{unicode-math}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage{blindtext}

\begin{document} 
\blindtext
$\mathup{\lambda}\lambda$
\end{document}

enter image description here

  • Tnx for answer, however I am looking for solution in Latex, I forgot to specify this in question. – Dejan Feb 24 '15 at 13:23
  • @Petar - Both XeLaTeX and LuaLaTeX are LaTeX. Their difference to pdfLaTeX is that they use other underlying engines to accomplish the typesetting jobs. – Mico Apr 12 '16 at 9:33

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.