在vscode中使用如下代码
\documentclass[12pt,a4paper]{ctexart}
\usepackage{emotion}
\setCJKfamilyfont{STsong2}{Aa剑豪体.ttf}
\newcommand{\jianhao}{\CJKfamily{STsong2}}
\begin{document}
{\jianhao 你好}
\emotion{A}
证明如下格式:
\end{document}
查看emotion宏包发现支持xelatex编译
是在何处看到的?我在文档里没有看到。
\emotion{A}
这个用法是在何处获知?
实际测试发现xelatex
确实不可行,lualatex
可以顺利运行...
\documentclass[12pt,a4paper]{ctexart}
\usepackage{emotion}
\emotionsetup{Twemoji Mozilla}
\begin{document}
你好
\emotion{A} % 这个A你是在哪里看到的...
% \emotion{🇦}
\emotion{☃}
\emotion{☘}
\emotion{☝}
\emotion{☠}
\emotion{🥵}
\emotion{✌🏾}
\emotiondef{apple}{🍎}
\emotiondef{tea}{🍵}
\emotion{apple}
\emotion{tea}
你好
\end{document}
我不是很懂lualatex
,但使用xelatex
编译出现如下警告:
Package fontspec:
(fontspec) Ignored LuaTeX-only feature:
(fontspec) 'Renderer=Full/Basic/Node/Base/HarfBuzz'.
在emotion.sty
中我们可以看到:
%Line 8~14
% add emotion command
\newfontface \emotionfont: { Twemoji~Mozilla } [ Renderer = Harfbuzz ]
% enable update emoji font
\newcommand{\emotionsetup}[1]{
\renewfontface \emotionfont: {#1} [ Renderer = HarfBuzz]
}
此处已经指定了似乎只有luatex
才支持的fontspec
选项Renderer = Harfbuzz
,这有可能是xelatex
编译不出emoji的一个原因。
PS.剑豪体中文字体的设置与本问题无关,不需要写在mwe内。且提问时插入代码必须使用markdown的围栏代码块。
With issues #2: