12

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

11

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}
  • 7
    Wow, when you think nothing could be more ugly than Jabba the Hutt... – Stephan Lehmke May 14 '14 at 20:25
  • 1
    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
  • 1
    @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
  • 2
    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

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.