[Tex/LaTex] How to use comicsans only for the text but not for the math

fontsmath-mode

Considerations:

  • Most of us might know the Latin alphabet well.
  • Some of us might not be familiar with Greek alphabet.

As a result, comic sans for text contents does not seem to be an issue but it is not the case for math contents with Greek alphabet.

As you can see, the \lambda looks unclear, so I want to cancel the comic sans font for the math. Shortly speaking, how to use comicsans only for the text but not for the math?

\documentclass[preview,border=12pt,12pt]{standalone}
\usepackage{mathtools,comicsans}

\begin{document}
If you cannot be the best, be the worst!
\[
\int_a^b f(\lambda)\, \mathrm{d}\lambda = F(b) -F(a)
\]
where bla bla bla \ldots.
\end{document}

enter image description here

Best Answer

Here's a LuaLaTeX-based solution. Tested on a MacBook running MacOSX 10.9.2, MacTeX 2013, and LuaTeX 0.76.0. (Update June 2017: The answer given below works with MacOS 10.12.5 "Sierra", MacTeX2017, and LuaTeX 1.0.4 as well.)

A personal remark: To me, the use of Comic Sans in a document is almost invariably not a solution but a problem...

enter image description here

% !TEX TS-program = lualatex
\documentclass[12pt]{article}
\usepackage[no-math]{fontspec}
\setmainfont{Comic Sans MS}
\usepackage{mathtools}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math} % choose your favorite Opentype math font here

\begin{document}
If you cannot be the best, be the worst!
\[
\int_a^b f(\lambda)\, \mathrm{d}\lambda = F(b) -F(a)
\]
where bla bla bla \ldots
\end{document}