0

I want to redefine the default QED symbol to be some Unicode character from the big list, e.g. 26C4, a snowman. I wrote this MWE:

\documentclass[12pt]{article}

\usepackage{amsmath, amsthm, amssymb}
\usepackage{etoolbox}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{mathtools}
\usepackage{microtype}

\DeclareUnicodeCharacter{26C4}{\snowman}
\renewrobustcmd{\qedsymbol}{\snowman}

\newtheorem{theorem}{Theorem}[section]

\begin{document}
\section{Introduction}

\begin{theorem}
a = b
\end{theorem}

\begin{proof}
Trivial.
\end{proof}
\end{document}

but at compilation, it throws an error:

! Undefined control sequence.
\qedsymbol ->\snowman 

I'm using Miktex 2.9 on Windows 7 x64 with PDFLatex. Am I simply not loading the correct font? I tried to follow the Wikibooks guide to using Unicode in Latex, which is where I found the DeclareUnicodeCharacter command.

3
  • You're providing no definition for \snowman. But the fonts you're loading don't have it anyway.
    – egreg
    Feb 24 '15 at 20:43
  • @egreg I guess I thought that the \DeclareUnicodeCharacter defined the command.
    – Michael A
    Feb 24 '15 at 20:44
  • You are reading the command backwards, the declaration says that if you have the character U+2C64 (⛄) in the file, to execute the command \snowman (which you then need to define in some way). Feb 24 '15 at 20:49
5

The Unicode reference is a red herring really, for pdftex you would need a classic (256 character) font that has such a character. There may be such a font but it is simpler really just to use a graphic. best would be a scalable image. If you have a system font with it in, make a small pdf, but a bitmap image also works, I just drew one. You can then define \snowman by

enter image description here

\documentclass[12pt]{article}

\usepackage{amsmath, amsthm, amssymb}
\usepackage{etoolbox}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{microtype}


\renewrobustcmd{\qedsymbol}{\includegraphics[height=1em]{snowman}}

\newtheorem{theorem}{Theorem}[section]

\begin{document}
\section{Introduction}

\begin{theorem}
a = b
\end{theorem}

\begin{proof}
Trivial.
\end{proof}
\end{document}
0

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.