# How to use comicsans only for the text but not for the math?

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}


• – Werner May 14 '14 at 18:26
• Oh my! The lambda looks ugly! You don't say!? – Brent.Longborough May 14 '14 at 19:13
• @Brent.Longborough: OK. – kiss my armpit May 14 '14 at 19:29
• It is the idea of a document which contains both Comic Sans and mathematics which is getting me. What could possibly require such a combination?! – cfr May 15 '14 at 1:42
• @cfr Perhaps a treatise(!) on Clown Theory? – Brent.Longborough May 15 '14 at 17:45

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...

% !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}

• Wow, when you think nothing could be more ugly than Jabba the Hutt... – Stephan Lehmke May 14 '14 at 20:25
• Note that you can use either of luatex or xetex for this—anything that will work with fontspec. – Sean Allred May 14 '14 at 20:29
• @SeanAllred - In my experience, the fontspec package works equally well with XeLaTeX and LuaLaTeX. However, the same can unfortunately not be said -- at least not currently -- for the unicode-math package and Opentype math fonts: There, LuaLaTeX seems to have a decided advantage. More specifically, it's easier for me to generate math material that's not typeset quite right when compiled with XeLaTeX than when compiled with LuaLaTeX. – Mico May 14 '14 at 20:35
• @Mico It would seem that it does? Or is this a planned feature and not an implemented one? Or (more likely now that I think about it) is it the simple matter of an OpenType math font? edit: Ah I see… strange. – Sean Allred May 14 '14 at 20:38
• Why worry about it not being 'typeset quite right' when the rest of it is in Comic Sans? (Just wondering.) – cfr May 15 '14 at 1:40