Unicode 字符 ✰ (U+2730) 未设置为用于 LaTeX

Unicode 字符 ✰ (U+2730) 未设置为用于 LaTeX

我在 latex 文档中遇到了错误“Unicode 字符 ✰ (U+2730) 未设置为用于 LaTeX。”。但是,我没有在代码中找到“阴影星号”,尽管它不是我写的。请问我该如何找到它并删除它,或者如何解决这个错误!

注意:我在 Ubuntu 20.04 操作系统上以及 TeXStudio 编辑器和 TeXMaker 编辑器上运行它。

我非常感谢您提供的任何帮助。

答案1

使用xelatexlualatex,只需使用带有字形的主字体:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{FreeSerif}
\begin{document}
Hello ✰
\end{document}

或者仅适用于符号:

\documentclass{article}
\usepackage{fontspec}
\usepackage{xcolor}
\newfontfamily{\stars}{FreeSerif}[Scale=1.5,Color=blue]
\begin{document}
 Hello {\stars ✩ ✰ ✱ ✲} stars !!
\end{document}

姆韦

因为pdflatex\FiveStarShadow{} 该软件包提供了另一种解决方案bbding

答案2

这对我有用:

\documentclass{article}
\usepackage{pifont}
\DeclareUnicodeCharacter{2730}{\ding{80}}
\begin{document}
\end{document}

相关内容