逐字逐句地添加表情符号

逐字逐句地添加表情符号

这是任意大小页面上的这个

如何在逐字环境中包含表情符号?

例如

\begin{verbatim}
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| Row   | Persp. |                                     |                                   |                                                          |
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| i     | SCEN   | SCEN/MODEXP                         | FAILURE_KNOWN_TO_RAM              |                                                          |
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| i + 1 | MISC   | MMU

答案1

你可以用精彩的答案https://tex.stackexchange.com/a/572220/36296并选择带有表情符号的后备字体。如果您想在逐字文本中使用它们,则需要设置单色字体而不是主字体:

% !TeX TS-program = lualatex
\documentclass[varwidth=\maxdimen,margin=0.5cm,multi={verbatim}]{standalone}

\usepackage{fontspec}
\directlua{luaotfload.add_fallback
   ("emojifallback",
    {
      "NotoColorEmoji:mode=harf;"
    }
   )}

\setmonofont{JetBrains Mono NL Regular}[
  RawFeature={fallback=emojifallback}
]

\begin{document}
\begin{verbatim}
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| Row   | Persp. |                                     |                                   |                                                          |
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| i     | SCEN   | SCEN/MODEXP                         | FAILURE_KNOWN_TO_RAM              |                                                          |
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| i + 4 | MISC   | MMU

答案2

与 XeLaTeX 配合使用的简单版本,使用fancyvrbwith Verbatim(而不是小写)来运行更改字体的verbatim命令。\emj

\documentclass{article}
\usepackage[landscape,left=5mm,right=5mm]{geometry}
\usepackage{fontspec}
\usepackage{fancyvrb}

\newcommand{\emj}[1]{{\fontspec{Symbola}#1}}
\begin{document}
\small
\begin{Verbatim}[commandchars=\\\{\}]
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| Row   | Persp. |                                     |                                   |                                                          |
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| i     | SCEN   | SCEN/MODEXP                         | FAILURE_KNOWN_TO_RAM              |                                                          |
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| i + 1 | MISC   | MMU\emj{

相关内容