使用 xelatex (和 unicode-math)的铅笔符号

使用 xelatex (和 unicode-math)的铅笔符号

我不知道如何使用 xelatex(和 unicode-math)生成一个能给我铅笔符号的命令。

我想要一支铅笔,例如 U+270E Unicode 字符或类似的符号。 http://www.fileformat.info/info/unicode/char/270e/index.htm

谢谢你的帮助。

编辑:那么如何获得带有 CMU 字体的铅笔?

\documentclass[a4paper,11pt]{article}

\usepackage[tuenc]{fontspec}
    \setmainfont[Ligatures=TeX]{CMU Serif} %needed for me to get small-bold caps
    \setsansfont{CMU Sans Serif}
    \setmonofont{CMU Typewriter Text}
\usepackage[a4paper]{geometry}
\usepackage[french]{babel}

\usepackage{unicode-math} %works without this

\begin{document}

%\symbol{"270E} doesnt' work ...

\end{document}

答案1

该字形不在 CMU Serif 中,但很容易从其他字体中获取它。

\documentclass[a4paper,11pt]{article}
\usepackage[a4paper]{geometry}

\usepackage{fontspec}
\usepackage[french]{babel}
\usepackage{newunicodechar}

\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}

\newfontface{\pencilfont}{DejaVu Sans}[Scale=MatchUppercase]

\newunicodechar{✎}{{\pencilfont ✎}}

\begin{document}

Here's a pencil ✎ with text around it.

\end{document}

在此处输入图片描述

您也可以输入^^^^270e而不是

请注意,tuenc是默认设置,使用最新版本的fontspec。也Ligatures=TeX一直是默认设置(等宽字体除外)。

答案2

文件格式网站还包含支持您角色的字体列表。因此,您可以轻松获取带有以下符号的字体:

\documentclass[]{article}
\usepackage{fontspec}
\setmainfont{DejaVu Sans}

\begin{document}
a pencil \symbol{"270E}
\end{document}

在此处输入图片描述

相关内容