3

This is a follow-up question to this one on arbitrary size pages.

How would one include emojis in a verbatim environment?

E.g.

\begin{verbatim}
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| Row   | Persp. |                                     |                                   |                                                          |
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| i     | SCEN   | SCEN/MODEXP                         | FAILURE_KNOWN_TO_RAM              |                                                          |
|-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------|
| i + 1 | MISC   | MMU = 0                           | EXP = 0                         | OOB = 1                                                |
\end{verbatim}

Produces the following enter image description here

Edit. I get errors when running the proposed solution: enter image description here Row 5 in my file contains

\directlua{luaotfload.add_fallback

Hm. I guess tectonic has limited support of lualatex, see https://wiki.archlinux.org/title/Tectonic.

oob/populating/modexp on  boulot [$!?] 
❯ cat representation.log 
This is LuaHBTeX, Version 1.17.0 (TeX Live 2023)  (format=lualatex 2023.12.20)  20 DEC 2023 16:00
 restricted system commands enabled.
**representation.tex
(./representation.tex
LaTeX2e <2023-11-01>
L3 programming layer <2023-12-11>
Lua module: luaotfload 2023-08-31 3.26 Lua based OpenType font support
Lua module: lualibs 2023-07-13 2.76 ConTeXt Lua standard libraries.
Lua module: lualibs-extended 2023-07-13 2.76 ConTeXt Lua libraries -- extended c
ollection.
luaotfload | conf : Root cache directory is "/usr/local/texlive/2023/texmf-var/l
uatex-cache/generic/names".
luaotfload | init : Loading fontloader "fontloader-2023-08-19.lua" from kpse-res
olved path "/usr/local/texlive/2023/texmf-dist/tex/luatex/luaotfload/fontloader-
2023-08-19.lua".
Lua-only attribute luaotfload@noligature = 1
luaotfload | init : Context OpenType loader version 3.133
Inserting `luaotfload.node_processor' in `pre_linebreak_filter'.
Inserting `luaotfload.node_processor' in `hpack_filter'.
Inserting `luaotfload.glyph_stream' in `glyph_stream_provider'.
Inserting `luaotfload.define_font' in `define_font'.
Lua-only attribute luaotfload_color_attribute = 2
luaotfload | conf : Root cache directory is "/usr/local/texlive/2023/texmf-var/l
uatex-cache/generic/names".
Inserting `luaotfload.harf.strip_prefix' in `find_opentype_file'.
Inserting `luaotfload.harf.strip_prefix' in `find_truetype_file'.
Removing  `luaotfload.glyph_stream' from `glyph_stream_provider'.
Inserting `luaotfload.harf.glyphstream' in `glyph_stream_provider'.
Inserting `luaotfload.harf.finalize_vlist' in `post_linebreak_filter'.
Inserting `luaotfload.harf.finalize_hlist' in `hpack_filter'.
Inserting `luaotfload.cleanup_files' in `wrapup_run'.
Inserting `luaotfload.harf.finalize_unicode' in `finish_pdffile'.
Inserting `luaotfload.glyphinfo' in `glyph_info'.
Lua-only attribute luaotfload.letterspace_done = 3
Inserting `luaotfload.aux.set_sscale_dimens' in `luaotfload.patch_font'.
Inserting `luaotfload.aux.set_font_index' in `luaotfload.patch_font'.
Inserting `luaotfload.aux.patch_cambria_domh' in `luaotfload.patch_font'.
Inserting `luaotfload.aux.fixup_fontdata' in `luaotfload.patch_font_unsafe'.
Inserting `luaotfload.aux.set_capheight' in `luaotfload.patch_font'.
Inserting `luaotfload.aux.set_xheight' in `luaotfload.patch_font'.
Inserting `luaotfload.rewrite_fontname' in `luaotfload.patch_font'.
Inserting `tracingstacklevels' in `input_level_string'. (/usr/local/texlive/202
3/texmf-dist/tex/latex/standalone/standalone.cls
Document Class: standalone 2022/10/10 v1.3b Class to compile TeX sub-files stan
dalone
(/usr/local/texlive/2023/texmf-dist/tex/latex/tools/shellesc.sty
Package: shellesc 2023/07/08 v1.0d unified shell escape interface for LaTeX
Package shellesc Info: Restricted shell escape enabled on input line 77.
)
(/usr/local/texlive/2023/texmf-dist/tex/generic/iftex/ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.

(/usr/local/texlive/2023/texmf-dist/tex/generic/iftex/iftex.sty Package: iftex 2022/02/03 v1.0f TeX engine tests )) (/usr/local/texlive/2023/texmf-dist/tex/latex/xkeyval/xkeyval.sty Package: xkeyval 2022/06/16 v2.9 package option processing (HA)

(/usr/local/texlive/2023/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/local/texlive/2023/texmf-dist/tex/generic/xkeyval/xkvutils.tex \XKV@toks=\toks17 \XKV@tempa@toks=\toks18

(/usr/local/texlive/2023/texmf-dist/tex/generic/xkeyval/keyval.tex)) \XKV@depth=\count185 File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) )) \sa@internal=\count186 \c@sapage=\count187

(/usr/local/texlive/2023/texmf-dist/tex/latex/standalone/standalone.cfg File: standalone.cfg 2022/10/10 v1.3b Default configuration file for 'standalon e' class ) (/usr/local/texlive/2023/texmf-dist/tex/latex/base/article.cls Document Class: article 2023/05/17 v1.4n Standard LaTeX document class (/usr/local/texlive/2023/texmf-dist/tex/latex/base/size10.clo File: size10.clo 2023/05/17 v1.4n Standard LaTeX file (size option) luaotfload | db : Font names database loaded from /usr/local/texlive/2023/texmf- var/luatex-cache/generic/names/luaotfload-names.luc.gz) \c@part=\count188 \c@section=\count189 \c@subsection=\count190 \c@subsubsection=\count191 \c@paragraph=\count192 \c@subparagraph=\count193 \c@figure=\count194 \c@table=\count195 \abovecaptionskip=\skip48 \belowcaptionskip=\skip49 \bibindent=\dimen139 ) (/usr/local/texlive/2023/texmf-dist/tex/generic/luatex85/luatex85.sty Package: luatex85 2016/06/15 v1.4 pdftex aliases for luatex ) (/usr/local/texlive/2023/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO )

(/usr/local/texlive/2023/texmf-dist/tex/generic/infwarerr/infwarerr.sty Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) ) (/usr/local/texlive/2023/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty Package: ltxcmds 2023-12-04 v1.26 LaTeX kernel commands for general use (HO) ) Package pdftexcmds Info: \pdf@primitive is available. Package pdftexcmds Info: \pdf@ifprimitive is available. Package pdftexcmds Info: \pdfdraftmode found. \pdftexcmds@toks=\toks19 ) (/usr/local/texlive/2023/texmf-dist/tex/latex/varwidth/varwidth.sty Package: varwidth 2009/03/30 ver 0.92; Variable-width minipages @vwid@box=\box51 \sift@deathcycles=\count196 @vwid@loff=\dimen140 @vwid@roff=\dimen141 ) \sa@box=\box52 ) (/usr/local/texlive/2023/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/l3kernel/expl3.sty Package: expl3 2023-12-11 L3 programming layer (loader)

(/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-luatex.def File: l3backend-luatex.def 2023-11-09 L3 backend support: PDF output (LuaTeX) \l__color_backend_stack_int=\count197 Inserting l3color' inluaotfload.parse_color'. \l__pdf_internal_box=\box53 )) Package: xparse 2023-10-10 L3 Experimental document command parser ) Package: fontspec 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX Lua module: fontspec 2022/01/15 2.8a Font selection for XeLaTeX and LuaLaTeX (/ usr/local/texlive/2023/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty Package: fontspec-luatex 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaT eX \l__fontspec_script_int=\count198 \l__fontspec_language_int=\count199 \l__fontspec_strnum_int=\count266 \l__fontspec_tmp_int=\count267 \l__fontspec_tmpa_int=\count268 \l__fontspec_tmpb_int=\count269 \l__fontspec_tmpc_int=\count270 \l__fontspec_em_int=\count271 \l__fontspec_emdef_int=\count272 \l__fontspec_strong_int=\count273 \l__fontspec_strongdef_int=\count274 \l__fontspec_tmpa_dim=\dimen142 \l__fontspec_tmpb_dim=\dimen143 \l__fontspec_tmpc_dim=\dimen144

(/usr/local/texlive/2023/texmf-dist/tex/latex/base/fontenc.sty Package: fontenc 2021/04/29 v2.0v Standard LaTeX package ) (/usr/local/texlive/2023/texmf-dist/tex/latex/fontspec/fontspec.cfg))) luaotfload | cache : Lookup cache loaded from /usr/local/texlive/2023/texmf-var/ luatex-cache/generic/names/luaotfload-lookup-cache.luc. luaotfload | aux : font no 18 (nil) defines no feature for script latn luaotfload | aux : font no 18 (nil) defines no feature for script dflt

Package fontspec Info: Could not resolve font "NotoMono/BI" (it probably (fontspec) doesn't exist).

Package fontspec Info: Could not resolve font "NotoMono/B" (it probably (fontspec) doesn't exist).

Package fontspec Info: Could not resolve font "NotoMono/I" (it probably (fontspec) doesn't exist).

Package fontspec Info: Font family 'NotoMono(0)' created for font 'Noto Mono' (fontspec) with options (fontspec) [WordSpace={1,0,0},HyphenChar=None,PunctuationSpace=Word Space,RawFeature={fallback=emojifallback}]. (fontspec)
(fontspec) This font family consists of the following NFSS (fontspec) series/shapes: (fontspec)
(fontspec) - 'normal' (m/n) with NFSS spec.: (fontspec) <->"NotoMono:mode=node;language=dflt;fallback=emojifallb ack;" (fontspec) - 'small caps' (m/sc) with NFSS spec.: (fontspec) and font adjustment code: (fontspec) \fontdimen 2\font =1\fontdimen 2\font \fontdimen 3\font (fontspec) =0\fontdimen 3\font \fontdimen 4\font =0\fontdimen (fontspec) 4\font \fontdimen 7\font =0\fontdimen 2\font (fontspec) \tex_hyphenchar:D \font =-1\scan_stop:

(./representation.aux) \openout1 = representation.aux

LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 16. LaTeX Font Info: Trying to load font information for TS1+cmr on input line 1 6.

(/usr/local/texlive/2023/texmf-dist/tex/latex/base/ts1cmr.fd File: ts1cmr.fd 2023/04/13 v2.5m Standard LaTeX font definitions ) LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 16. LaTeX Font Info: ... okay on input line 16.

Package fontspec Info: Adjusting the maths setup (use [no-math] to avoid (fontspec) this).

\symlegacymaths=\mathgroup4 LaTeX Font Info: Overwriting symbol font legacymaths' in versionbold' (Font) OT1/cmr/m/n --> OT1/cmr/bx/n on input line 16. LaTeX Font Info: Redeclaring math accent \acute on input line 16. LaTeX Font Info: Redeclaring math accent \grave on input line 16. LaTeX Font Info: Redeclaring math accent \ddot on input line 16. LaTeX Font Info: Redeclaring math accent \tilde on input line 16. LaTeX Font Info: Redeclaring math accent \bar on input line 16. LaTeX Font Info: Redeclaring math accent \breve on input line 16. LaTeX Font Info: Redeclaring math accent \check on input line 16. LaTeX Font Info: Redeclaring math accent \hat on input line 16. LaTeX Font Info: Redeclaring math accent \dot on input line 16. LaTeX Font Info: Redeclaring math accent \mathring on input line 16. LaTeX Font Info: Redeclaring math symbol \colon on input line 16. LaTeX Font Info: Redeclaring math symbol \Gamma on input line 16. LaTeX Font Info: Redeclaring math symbol \Delta on input line 16. LaTeX Font Info: Redeclaring math symbol \Theta on input line 16. LaTeX Font Info: Redeclaring math symbol \Lambda on input line 16. LaTeX Font Info: Redeclaring math symbol \Xi on input line 16. LaTeX Font Info: Redeclaring math symbol \Pi on input line 16. LaTeX Font Info: Redeclaring math symbol \Sigma on input line 16. LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 16. LaTeX Font Info: Redeclaring math symbol \Phi on input line 16. LaTeX Font Info: Redeclaring math symbol \Psi on input line 16. LaTeX Font Info: Redeclaring math symbol \Omega on input line 16. LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 16. LaTeX Font Info: Redeclaring symbol font operators' on input line 16. LaTeX Font Info: EncodingOT1' has changed to TU' for symbol font (Font)operators' in the math version normal' on input line 16. LaTeX Font Info: Overwriting symbol fontoperators' in version normal' (Font) OT1/cmr/m/n --&gt; TU/lmr/m/n on input line 16. LaTeX Font Info: EncodingOT1' has changed to TU' for symbol font (Font)operators' in the math version bold' on input line 16. LaTeX Font Info: Overwriting symbol fontoperators' in version bold' (Font) OT1/cmr/bx/n --&gt; TU/lmr/m/n on input line 16. LaTeX Font Info: Overwriting symbol fontoperators' in version normal' (Font) TU/lmr/m/n --&gt; TU/lmr/m/n on input line 16. LaTeX Font Info: Overwriting math alphabet\mathit' in version normal' (Font) OT1/cmr/m/it --&gt; TU/lmr/m/it on input line 16. LaTeX Font Info: Overwriting math alphabet\mathbf' in version normal' (Font) OT1/cmr/bx/n --&gt; TU/lmr/b/n on input line 16. LaTeX Font Info: Overwriting math alphabet\mathsf' in version normal' (Font) OT1/cmss/m/n --&gt; TU/lmss/m/n on input line 16. LaTeX Font Info: Overwriting math alphabet\mathtt' in version normal' (Font) OT1/cmtt/m/n --&gt; TU/NotoMono(0)/m/n on input line 16. LaTeX Font Info: Overwriting symbol fontoperators' in version bold' (Font) TU/lmr/m/n --&gt; TU/lmr/b/n on input line 16. LaTeX Font Info: Overwriting math alphabet\mathit' in version bold' (Font) OT1/cmr/bx/it --&gt; TU/lmr/b/it on input line 16. LaTeX Font Info: Overwriting math alphabet\mathsf' in version bold' (Font) OT1/cmss/bx/n --&gt; TU/lmss/b/n on input line 16. LaTeX Font Info: Overwriting math alphabet\mathtt' in version bold' (Font) OT1/cmtt/m/n --&gt; TU/NotoMono(0)/b/n on input line 16. LaTeX Font Info: External fontcmex10' loaded for size (Font) <7> on input line 66. LaTeX Font Info: External font `cmex10' loaded for size (Font) <5> on input line 66. [1

{/usr/local/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map} Missing character: There is no ∧ (U+2227) in font NotoMono:mode=node;language= dflt;fallback=emojifallback;! Missing character: There is no ∧ (U+2227) in font NotoMono:mode=node;language= dflt;fallback=emojifallback;! Missing character: There is no ∧ (U+2227) in font NotoMono:mode=node;language= dflt;fallback=emojifallback;! Missing character: There is no ∨ (U+2228) in font NotoMono:mode=node;language= dflt;fallback=emojifallback;! Missing character: There is no ∧ (U+2227) in font NotoMono:mode=node;language= dflt;fallback=emojifallback;! Missing character: There is no ∨ (U+2228) in font NotoMono:mode=node;language= dflt;fallback=emojifallback;! Missing character: There is no ∧ (U+2227) in font NotoMono:mode=node;language= dflt;fallback=emojifallback;! Missing character: There is no ∨ (U+2228) in font NotoMono:mode=node;language= dflt;fallback=emojifallback;! Missing character: There is no ∧ (U+2227) in font NotoMono:mode=node;language= dflt;fallback=emojifallback;! </tmp/lua_jXG30F>] (./representation.aux)


LaTeX2e <2023-11-01> L3 programming layer <2023-12-11>


)

Here is how much of LuaTeX's memory you used: 3712 strings out of 476506 244175,1977958 words of node,token memory allocated 406 words of node memory still in use: 3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 4 attribute, 48 glue_spec, 4 attribute_list, 1 write nodes avail lists: 1:2,2:620,3:13264,4:2,5:4283,6:149,7:22199,8:1,9:469,11:135 25733 multiletter control sequences out of 65536+600000 33 fonts using 3140863 bytes 79i,5n,89p,249b,231s stack positions out of 10000i,1000n,20000p,200000b,200000s </usr/share/fonts/truetype/noto/NotoMono-Regular.ttf> Output written on representation.pdf (1 page, 18378 bytes).

PDF statistics: 18 PDF objects out of 1000 (max. 8388607) 8 compressed objects within 1 object stream 0 named destinations out of 1000 (max. 131072) 1 words of extra memory for PDF output out of 10000 (max. 100000000)

The symbol between bbs and mbs should be a vee: enter image description here

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

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

\setmonofont{Noto Mono}[ RawFeature={fallback=emojifallback} ]

\begin{document} \begin{verbatim} |-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------| | Row | Persp. | | | | |-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------| | i | SCEN | SCEN/MODEXP | FAILURE_KNOWN_TO_RAM | | |-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------| | i + 4 | MISC | MMU = extract_raw_mbs | EXP = trim_raw_mbs | OOB = extract_raw_mbs | | | | | | | | | | MMU_INST = MLOAD, offset = cdo + 64 | EXP_INST = trimBytesBeyond | (implicit check) mbs ≤ 512 | | | | | | OOB_INST = MODEXP_modulus | | | | | | max_bbs_mbs := bbs ∨ mbs | |-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------| \end{verbatim} \end{document}

enter image description here

With Jet Brains Mono I get an error: enter image description here

2 Answers2

5

You could use the brilliant answer https://tex.stackexchange.com/a/572220/36296 and choose a fallback font which has your emoji. If you want to use them in verbatim text, you'll need to set the mono font instead of the main font:

% !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 = extract_raw_mbs | EXP = trim_raw_mbs | OOB = extract_raw_mbs | | | | | | | | | | MMU_INST = MLOAD, offset = cdo + 64 | EXP_INST = trimBytesBeyond | (implicit check) mbs ≤ 512 | | | | | | OOB_INST = MODEXP_modulus | | | | | | max_bbs_mbs := bbs ∨ mbs | |-------+--------+-------------------------------------+-----------------------------------+----------------------------------------------------------| \end{verbatim} \end{document}

enter image description here

(to find out which fonts on your system have the emoji, you can use the command line tool albatross using this command: albatross )

4

Simple version that works with XeLaTeX, using fancyvrb with Verbatim (instead of lower case verbatim) to run a command \emj that changes the font.

\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{ } = 0 | EXP\emj{ } = 0 | OOB\emj{ ,,} = 1 | \end{Verbatim} \end{document}

Result:

enter image description here

Note that switching the font disturbs the monospace so you need some tricks with extra spaces or whitespace commands like \, to align the bars - this would also be needed with the LuaLaTeX solution in the other answer. Note also that the flag in Symbola is ugly but that is not really the point :)

Marijn
  • 37,699