I want to create a document like normal but be able to insert emoji and have it be in comic sans. As some context I need to hand in math homework but as a fun prank I want to make everything comic sans and make the variable names emojis. edit: By the way I'm using TEXmaker.
Asked
Active
Viewed 959 times
1 Answers
6
I assume you're working on Windows and you want color emojis, so you have Comic Sans MS and Segoe UI Emoji installed. If it is so, the following code will be perfect for you. However, you have to compile with lualatex-dev (TeXLive) or luahblatex/harflatex (MiKTeX):
lualatex-dev name_of_file tex
luahblatex name_of_file tex
harflatex name_of_file tex
That's a MWE for purposes of testing
\documentclass{article}
\usepackage{amsmath}
\usepackage{metalogo}
%In case you use harflatex/luahblatex
%usepackage{harfload}
\usepackage{fontspec}
\setmainfont{Comic Sans MS}
%Another emoji font will work as well
\newfontfamily\emojifont{Segoe UI Emoji}[Renderer=Harfbuzz]
%In case you use harflatex/luahblatex
%\newfontfamily\emoji{Segoe UI Emoji}[RawFeature={mode=harf}]
\newcommand{\emoji}[1]{\emojifont #1}
\newcommand{\Heart}{\ifmmode \text{\emoji{❤️}} \else \emoji{❤️}\fi}
%Some predefined emojis if you're gonna use them often
\newcommand{\Grin}{\ifmmode \text{\emoji{}} \else \emoji{}\fi}
\newcommand{\Memoji}[1]{\ifmmode \text{\emoji{#1}} \else \emoji{#1}\fi}
\begin{document}
Hi, Ralph. This is \LuaLaTeX\ using Comic Sans MS and emojis \Memoji{}.
\begin{gather*}
\int_{0}^{\infty}\frac{1}{\Memoji{❤️}^2+1}d\Memoji{❤️}=\frac{\pi}{2}\quad\Memoji{} \\
(\Memoji{❤️} + \Memoji{})^2=\Memoji{❤️}^2+\Memoji{}^2+2\Memoji{❤️}
\end{gather*}
\end{document}

usepackage{comicsans}for comic sans and here is something about emojis. – Andreas Schneider Jan 01 '20 at 18:52