如何将 QED 符号重新定义为 Unicode 字符?

如何将 QED 符号重新定义为 Unicode 字符?

我想将默认的 QED 符号重新定义为某个 Unicode 字符从大名单中,例如 26C4,一个雪人。我写了这个 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}

但在编译时,它会引发一个错误:

! Undefined control sequence.
\qedsymbol ->\snowman 

我在 Windows 7 x64 上使用 Miktex 2.9 和 PDFLatex。我是不是没有加载正确的字体?我尝试按照Wikibooks 指南:在 Latex 中使用 Unicode,我就在这里找到了该DeclareUnicodeCharacter命令。

答案1

Unicode 参考实际上是一个转移注意力的借口,对于 pdftex,您需要一个具有这种字符的经典(256 个字符)字体。可能有这样的字体,但使用图形实际上更简单。最好的是可缩放图像。如果您有系统字体,请制作一个小的 pdf,但位图图像也可以,我刚画了一个。然后您可以\snowman通过以下方式定义

在此处输入图片描述

\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}

相关内容