在Mac 15.5下,用vs code编译lualatex时,中文和emoji不能同时显示,
\documentclass[12pt,a4paper]{ctexart}
\usepackage{emotion}
\emotionsetup{Twemoji Mozilla}
\begin{document}
你好
\emotion{☘}
\emotion{☝}
\emotion{☠}
\emotion{🥵}
你好
\end{document}
该问题的mwe可以更短
emotion
或者emoji
宏包只是使用lualatex
编译的理由
% lualatex
\documentclass{ctexart}
\begin{document}
你好
\end{document}
可能有关:
给一个 lualatex 编译的 mwe
\documentclass{article}
\usepackage[fontset=macnew]{ctex}
\usepackage{fontspec}
% 使用macOS系统自带的字体
\setmainfont{Times New Roman}
\setCJKmainfont{Songti SC}[
BoldFont = Heiti SC,
ItalicFont = Kaiti SC
]
\setCJKsansfont{Heiti SC}
\setCJKmonofont{Apple LiSung} % 或者使用其他等宽字体
\begin{document}
你好,世界。这是什么?
\end{document}
需要做以下 patch 才可使用:新版的 mac 的 Kaiti 字体不在 /Library/Fonts 下面,因此你需要找到楷体并放到这个文件夹下。
我的楷体在 /System/Library/AssetsV2/com_apple_MobileAsset_Font7/54a2ad3dac6cac875ad675d7d273dc425010a877.asset/AssetData
下面,我不确定这个是否因人而异。我建议先进入到/System/Library/AssetsV2/com_apple_MobileAsset_Font7
然后使用 find ./ -iname "kaiti*"
进行查找,
找到之后拷贝到 /Library/Fonts/
下面就可以了。 之后这个 mwe 使用 lualatex <name>.tex
正常编译即可。