summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-04-21 21:15:13 +0000
committerKarl Berry <karl@freefriends.org>2023-04-21 21:15:13 +0000
commit00dc458fc0aeab9ca0748f91d147afe769305d27 (patch)
tree7141faf58cde7db61c9460413870045877559990
parent3a90fe134e979c533a33f593c61b2df22e226588 (diff)
emo (21apr23)
git-svn-id: svn://tug.org/texlive/trunk@66909 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/emo/README.md20
-rwxr-xr-xMaster/texmf-dist/doc/latex/emo/config/emo.py25
-rw-r--r--Master/texmf-dist/doc/latex/emo/emo.pdfbin212523 -> 216284 bytes
-rw-r--r--Master/texmf-dist/source/latex/emo/emo.dtx273
-rw-r--r--Master/texmf-dist/tex/latex/emo/emo-graphics/emo-chart-increasing.pdfbin0 -> 1138 bytes
-rw-r--r--Master/texmf-dist/tex/latex/emo/emo-graphics/emo-japanese-bargain-button.pdfbin0 -> 3452 bytes
-rw-r--r--Master/texmf-dist/tex/latex/emo/emo-graphics/emo-person-facepalming.pdfbin0 -> 19683 bytes
-rw-r--r--Master/texmf-dist/tex/latex/emo/emo-graphics/emo-plus.pdfbin0 -> 1643 bytes
-rw-r--r--Master/texmf-dist/tex/latex/emo/emo.def11
-rw-r--r--Master/texmf-dist/tex/latex/emo/emo.sty94
-rw-r--r--Master/texmf-dist/tex/latex/emo/emo.sty.ltxml2
11 files changed, 249 insertions, 176 deletions
diff --git a/Master/texmf-dist/doc/latex/emo/README.md b/Master/texmf-dist/doc/latex/emo/README.md
index a7c65083c82..07ea51071ea 100644
--- a/Master/texmf-dist/doc/latex/emo/README.md
+++ b/Master/texmf-dist/doc/latex/emo/README.md
@@ -9,8 +9,10 @@ provide only minimal support for non-Latin scripts (cough,
[ACM](https://www.acm.org), cough).
Emo's source repository is <https://github.com/apparebit/emo>. It also is
-available [through CTAN](https://ctan.org/pkg/emo). Emo supports conversion
-to HTML [with LaTeXML](https://github.com/brucemiller/LaTeXML).
+available [through CTAN](https://ctan.org/pkg/emo). Emo supports conversion to
+HTML with [LaTeXML](https://github.com/brucemiller/LaTeXML) or
+[TeX4ht](https://tug.org/tex4ht/). When using the latter tool, please be sure to
+use |make4ht -l| as invocation.
## Package Options
@@ -44,13 +46,15 @@ somewhere where LaTeX can find them. In a pinch, your project directory will do.
By default, emo supports only a few emoji:
-1️⃣ ☣️ ⚖️ ✔️ 🇪🇺 🌁 🌍 🏛️ 🏝️ 🏟️ 🏳️‍🌈 🏷️ 👁️ 👥 💥 💱 💾 📐 📟 🔍 🕵️ 🗑️ 😡 🛑 🤖 🤝 🤯 🦜 🧑‍⚖️ 🧻 🧾
+1️⃣ ☣️ ⚖️ ✔️ ➕ 🇪🇺 🉐 🌁 🌍 🏛️ 🏝️ 🏟️ 🏳️‍🌈 🏷️ 👁️ 👥 💥 💱 💾 📈 📐 📟 🔍
+🕵️ 🗑️ 😡 🛑 🤖 🤝 🤦 🤯 🦜 🧑‍⚖️ 🧻 🧾
-Their names are keycap-one, biohazard, balance-scale, check-mark, eu, foggy,
-globe-africa-europe, classical-building, desert-island, stadium, rainbow-flag,
-label, eye, busts, collision, currency-exchange, floppy-disk, triangular-ruler,
-pager, loupe-left, detective, wastebasket, enraged-face, stop-sign, robot,
-handshake, exploding-head, parrot, judge, roll-of-paper, and receipt.
+Their names are keycap-one, biohazard, balance-scale, check-mark, plus, eu,
+japanese-bargain-button, foggy, globe-africa-europe, classical-building,
+desert-island, stadium, rainbow-flag, label, eye, busts, collision,
+currency-exchange, floppy-disk, chart-increasing, triangular-ruler, pager,
+loupe-left, detective, wastebasket, enraged-face, stop-sign, robot, handshake,
+person-facepalming, exploding-head, parrot, judge, roll-of-paper, and receipt.
The [package's documentation](emo.pdf) explains the underlying naming scheme and
also how to reconfigure which emoji are supported. The [emo.py](config/emo.py)
diff --git a/Master/texmf-dist/doc/latex/emo/config/emo.py b/Master/texmf-dist/doc/latex/emo/config/emo.py
index 7d45b983071..302cd8a4d14 100755
--- a/Master/texmf-dist/doc/latex/emo/config/emo.py
+++ b/Master/texmf-dist/doc/latex/emo/config/emo.py
@@ -1029,15 +1029,16 @@ def show_names(registry: Registry, options: Any) -> bool:
SPECIAL_FILES = ('emo-lingchi.pdf', 'emo-YHWH.pdf')
def create_inventory(registry: Registry, options: Any) -> List[Emoji]:
+ specials = list(SPECIAL_FILES)
inventory: List[Emoji] = []
if options.graphics.exists() and options.graphics.is_dir():
for entry in options.graphics.iterdir():
- if (
- not entry.is_file()
- or not entry.match('emo-*.pdf')
- or entry.name in SPECIAL_FILES
- ):
+ if not entry.is_file() or not entry.match('emo-*.pdf'):
+ continue
+
+ if entry.name in SPECIAL_FILES:
+ specials.remove(entry.name)
continue
emoji = registry.lookup(entry.stem[4:])
@@ -1046,6 +1047,14 @@ def create_inventory(registry: Registry, options: Any) -> List[Emoji]:
elif options.verbose:
logger.warning(f'"{entry.name}" does not depict an emoji')
+ if len(specials) == 1:
+ raise FileNotFoundError(f'PDF graphic "emo-graphics/{specials[0]}" is missing!')
+ elif len(specials) == 2:
+ raise FileNotFoundError(
+ f'PDF graphics "{specials[0]}" and "{specials[1]}" '
+ 'in "emo-graphics" are missing!'
+ )
+
return inventory
# --------------------------------------------------------------------------------------
@@ -1065,6 +1074,12 @@ def write_emoji_table(
for emoji in all_emoji:
file.write(emoji.latex_table_entry)
file.write('\n')
+ file.write("""
+\\ifemo@extra
+\\def\\emo@emoji@lingchi{凌遲}
+\\def\\emo@emoji@YHWH{\\begingroup\\textdir TRT יהוה\\endgroup}
+\\fi
+""")
tmp_table.replace(options.latex_table)
return all_emoji
diff --git a/Master/texmf-dist/doc/latex/emo/emo.pdf b/Master/texmf-dist/doc/latex/emo/emo.pdf
index 74d69b83d56..6c8f4137fed 100644
--- a/Master/texmf-dist/doc/latex/emo/emo.pdf
+++ b/Master/texmf-dist/doc/latex/emo/emo.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/emo/emo.dtx b/Master/texmf-dist/source/latex/emo/emo.dtx
index e6940d46c2d..66b4e53492a 100644
--- a/Master/texmf-dist/source/latex/emo/emo.dtx
+++ b/Master/texmf-dist/source/latex/emo/emo.dtx
@@ -24,8 +24,10 @@ provide only minimal support for non-Latin scripts (cough,
[ACM](https://www.acm.org), cough).
Emo's source repository is <https://github.com/apparebit/emo>. It also is
-available [through CTAN](https://ctan.org/pkg/emo). Emo supports conversion
-to HTML [with LaTeXML](https://github.com/brucemiller/LaTeXML).
+available [through CTAN](https://ctan.org/pkg/emo). Emo supports conversion to
+HTML with [LaTeXML](https://github.com/brucemiller/LaTeXML) or
+[TeX4ht](https://tug.org/tex4ht/). When using the latter tool, please be sure to
+use |make4ht -l| as invocation.
## Package Options
@@ -62,13 +64,15 @@ somewhere where LaTeX can find them. In a pinch, your project directory will do.
By default, emo supports only a few emoji:
-1️⃣ ☣️ ⚖️ ✔️ 🇪🇺 🌁 🌍 🏛️ 🏝️ 🏟️ 🏳️‍🌈 🏷️ 👁️ 👥 💥 💱 💾 📐 📟 🔍 🕵️ 🗑️ 😡 🛑 🤖 🤝 🤯 🦜 🧑‍⚖️ 🧻 🧾
+1️⃣ ☣️ ⚖️ ✔️ ➕ 🇪🇺 🉐 🌁 🌍 🏛️ 🏝️ 🏟️ 🏳️‍🌈 🏷️ 👁️ 👥 💥 💱 💾 📈 📐 📟 🔍
+🕵️ 🗑️ 😡 🛑 🤖 🤝 🤦 🤯 🦜 🧑‍⚖️ 🧻 🧾
-Their names are keycap-one, biohazard, balance-scale, check-mark, eu, foggy,
-globe-africa-europe, classical-building, desert-island, stadium, rainbow-flag,
-label, eye, busts, collision, currency-exchange, floppy-disk, triangular-ruler,
-pager, loupe-left, detective, wastebasket, enraged-face, stop-sign, robot,
-handshake, exploding-head, parrot, judge, roll-of-paper, and receipt.
+Their names are keycap-one, biohazard, balance-scale, check-mark, plus, eu,
+japanese-bargain-button, foggy, globe-africa-europe, classical-building,
+desert-island, stadium, rainbow-flag, label, eye, busts, collision,
+currency-exchange, floppy-disk, chart-increasing, triangular-ruler, pager,
+loupe-left, detective, wastebasket, enraged-face, stop-sign, robot, handshake,
+person-facepalming, exploding-head, parrot, judge, roll-of-paper, and receipt.
The [package's documentation](emo.pdf) explains the underlying naming scheme and
also how to reconfigure which emoji are supported. The [emo.py](config/emo.py)
@@ -161,7 +165,7 @@ Released under LPPL v1.3c or later
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{emo}
%<*scaffold,package>
- [2023/04/01 v0.2 emo•ji for all (LaTeX engines)]
+ [2023/04/21 v0.3 emo•ji for all (LaTeX engines)]
%</scaffold,package>
% ======================================================================================
%<*driver>
@@ -198,6 +202,8 @@ Released under LPPL v1.3c or later
% \changes{0.1}{}{Initial release}
% \changes{0.2}{}{Prefix PDF and font files with ``emo-''}
% \changes{0.2}{}{Support pdftex for extracting emo.dtx}
+% \changes{0.3}{}{Refactor implementation to simplify public macros}
+% \changes{0.3}{}{Support conversion to HTML with TeX4ht}
%
% \GetFileInfo{\jobname.dtx}
%
@@ -230,7 +236,8 @@ Released under LPPL v1.3c or later
% color emoji such as |\emo{desert-island}| for \emo{desert-island} or
% |\emo{parrot}| for \emo{parrot} in your documents independent of LaTeX engine.
% The implementation uses the Noto color emoji font if the engine supports it
-% and includes PDF graphics otherwise. The latter are automatically derived from
+% and includes PDF graphics otherwise. It also supports conversion to HTML with
+% either LaTeXML or TeX4ht. Next, PDF graphics are automatically derived from
% Noto's SVG sources, so the visual appearance is very similar. The source
% repository is at \url{https://github.com/apparebit/emo}. Emo may come in
% particularly handy when dealing with academic publishers that provide only
@@ -311,13 +318,16 @@ Released under LPPL v1.3c or later
% options:
% \begin{description}
% \item[extra] Also define the |\lingchi| and |\YHWH| macros, which produce
-% \lingchi and \YHWH, respectively, and are documented below.
+% \lingchi and \YHWH.
% \item[index] Create an emoji index tagged |emo| with the |.edx| extension for
% the raw index and the |.end| extension for the processed index. This
% option relies on the |index| package, generates the raw |.edx| file,
% but does not build or use the processed index.
% \end{description}
%
+%
+% ^^A ----------------------------------------------------------------------------------
+% \subsection{One Main Macro}
% \DescribeMacro{\emo}
% An |\emo|\marg{emoji-name} invocation expands to the named emoji. For
% LuaLaTeX, it uses the Noto color emoji font. For all other engines, it uses
@@ -331,7 +341,7 @@ Released under LPPL v1.3c or later
%
%
% ^^A ----------------------------------------------------------------------------------
-% \subsection{Emoji Names}
+% \subsubsection{Emoji Names}
%
% With some exceptions, emo's names for emoji are automatically derived from
% their Unicode names, with letters converted to lowercase, punctuation such as
@@ -401,9 +411,9 @@ Released under LPPL v1.3c or later
% \end{table}
%
% Emo's |emo.def| contains the names and codepoints of all currently supported
-% emoji. Its distribution also includes the |emoji-test.txt| file, which is part
-% of \href{https://unicode.org/reports/tr51/}{Unicode TR-51} and contains the
-% names and codepoints of all \emph{potentially} supported emoji, i.e., all
+% emoji. Emo's distribution also includes the |emoji-test.txt| file, which is
+% part of \href{https://unicode.org/reports/tr51/}{Unicode TR-51} and contains
+% the names and codepoints of all \emph{potentially} supported emoji, i.e., all
% emoji. It further organizes emoji into groups and subgroups, with the current
% (sub)group being the one named on the closest line above the emoji that starts
% with |# |(|sub|)|group:|. As described in the next section, the group and
@@ -412,20 +422,32 @@ Released under LPPL v1.3c or later
%
%
% ^^A ----------------------------------------------------------------------------------
-% \subsection{Extras}
+% \subsection{Two Extra Macros}
%
% \DescribeMacro{\lingchi}
% \DescribeMacro{\YHWH}
% The |\lingchi| and |\YHWH| macros take no arguments and produce \lingchi and
-% \YHWH, respectively. They are only available if emo is used with the
-% \textsf{extra} option. The former renders the Chinese term for ``death by a
-% thousand cuts.'' While originally an execution method, the term applies to
-% surprisingly many software systems as well. The latter produces the
-% Tetragrammaton, the Hebrew name for God. Observant Jews never utter what's
-% written, not even in their thoughts, substituting Adonai (``My Lord''), Elohim
-% (``God''), or HaShem (``The Name'') instead. In my mind, that nicely mirrors
-% the very incomprehensibility of \YHWH. Both macros preserve a subsequent space
-% as space, no backslash needed.
+% \YHWH. They are only available if emo is used with the \textsf{extra} option.
+% The former renders the Chinese term for ``death by a thousand cuts.'' While
+% originally an execution method, the term applies to surprisingly many software
+% systems as well. The latter produces the Tetragrammaton, the Hebrew name for
+% God. Observant Jews never utter what's written, not even in their thoughts,
+% substituting Adonai (``My Lord''), Elohim (``God''), or HaShem (``The Name'')
+% instead. In my mind, that nicely mirrors the very incomprehensibility of
+% \YHWH. Both macros preserve a subsequent space as space, no backslash needed.
+%
+%
+% ^^A ----------------------------------------------------------------------------------
+% \subsection{Conversion to HTML}
+%
+% Emo supports conversion to HTML with either
+% \href{https://github.com/brucemiller/LaTeXML}{LaTeXML} or
+% \href{https://tug.org/tex4ht/}{TeX4ht}. LaTeXML support is implemented by a
+% separate ``binding'' against LaTeXML's Perl API. I chronicled my exploration
+% of suitable options leading to that less than ideal choice in a
+% \href{https://github.com/brucemiller/LaTeXML/issues/2063}{GitHub issue}.
+% TeX4ht support is implemented by the emo package itself. It requires
+% processing with LuaLaTeX e.g., by passing |-l| to the |make4ht| tool.
%
%
% ^^A ==================================================================================
@@ -567,34 +589,57 @@ Released under LPPL v1.3c or later
\RequirePackage[utf8]{inputenc}
% \end{macrocode}
%
-% \begin{macro}{\ifemo@usefont}
-% Define a third conditional for selecting the backend. Originally, I didn't
-% bother with this, simply required |iftex|, and used |\ifluatex| throughout the
-% package. But that unnecessarily complicates support for other LaTeX-like
-% engines.
-% \changes{0.2}{}{Abstract over backend selection}
+% \begin{macro}{\emo@use@unicode}
+% \begin{macro}{\emo@use@font}
+% \begin{macro}{\emo@use@pdf}
+% \begin{macro}{\emo@backend}
+% Emo currently supports three different backends for actually rendering emoji,
+% namely the backend named |\emo@use@unicode| emits Unicode codepoints in a
+% group, the one named |\emo@use@font| emits font selection before those same
+% Unicode codepoints in the group, and the one named |\emo@use@pdf| emits PDF
+% graphics. Once we know to name the backends, we can set |\emo@backend| to the
+% currently active backend, determined by interrogating the runtime environment.
+% Alas, we still need to implement the three backends; but |\emo@content| is
+% defined closer to the end of the package implementation.
+% \changes{0.3}{}{Generalize backend selection}
% \begin{macrocode}
-\newif\ifemo@usefont\emo@usefontfalse
+\def\emo@use@unicode{backend:unicode}
+\def\emo@use@font{backend:font+unicode}
+\def\emo@use@pdf{backend:pdf}
\RequirePackage{iftex}
-\ifluatex\emo@usefonttrue\fi
+\ifdefined\HCode
+ \let\emo@backend=\emo@use@unicode
+\else
+\ifluatex
+ \let\emo@backend=\emo@use@font
+\else
+ \let\emo@backend=\emo@use@pdf
+\fi
+\fi
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% By now |\ifemo@usefont| should be correctly set up. So we use it for loading
-% the right emoji-emitting backend, |fontspec| or |graphicx|:
+% With the backend selected, we can now require backend-specific packages,
+% namely |fontspec| for selecting fonts in the |\emo@use@font| backend and
+% |graphicx| for including PDF graphics in the |\emo@use@pdf| backend. The
+% |\emo@use@unicode| backend has no similar requirements.
% \begin{macrocode}
-\ifemo@usefont
-\RequirePackage{fontspec}
-\else
-\RequirePackage{graphicx}
+\ifx\emo@backend\emo@use@font
+ \RequirePackage{fontspec}
+\fi
+\ifx\emo@backend\emo@use@pdf
+ \RequirePackage{graphicx}
\fi
% \end{macrocode}
%
-% Emo requires |xcolor| for formatting highly visible error messages within the
-% text. Always including another package that is only used when there are errors
-% is not ideal. But when I tried calling |\RequirePackage| for |xcolor| from
-% inside the error macro, it didn't work. Alternatively, I could make in-text
-% errors optional.
+% Next, emo requires |xcolor| for formatting highly visible error messages
+% within the text. Always including another package that is only used when there
+% are errors is not ideal. But when I tried calling |\RequirePackage| for
+% |xcolor| from inside the error macro, it didn't work. Alternatively, I could
+% make in-text errors optional.
% \begin{macrocode}
\RequirePackage{xcolor}
% \end{macrocode}
@@ -603,10 +648,10 @@ Released under LPPL v1.3c or later
% the |xspace| package and \textsf{index} requiring the |index| package:
% \begin{macrocode}
\ifemo@extra
-\RequirePackage{xspace}
+ \RequirePackage{xspace}
\fi
\ifemo@indexing
-\RequirePackage{index}
+ \RequirePackage{index}
\fi
% \end{macrocode}
%
@@ -615,15 +660,17 @@ Released under LPPL v1.3c or later
% \subsection{The Emoji Table}
%
% \begin{macro}{\emo@emoji@<name>}
-% For each emoji with a PDF graphic in the |emo-graphics| directory, a macro
-% named |\emo@emoji@|\meta{emoji-name} expands to its Unicode sequence. With
+% For each emoji with a PDF graphic in the |emo-graphics| directory and, if
+% enabled, the two extra macros, the corresponding
+% |\emo@emoji@|\meta{emoji-name} macro expands to its Unicode sequence. With
% over 3,000 distinct emoji in Unicode 15, emo relies on a Python script for
% populating the graphics directory and writing the table to the
% \texttt{\jobname.def} file. Since the package code does not change after
-% installation but the emoji table may very well change, they are kept separate
-% for now. Alternatively, we could use DocStrip to assemble the package file
-% from three parts, the code from the previous sections, then the contents of
-% the emoji table in |emo.def|, and then all subsequent code.
+% installation but the emoji table may very well change, they are kept separate.
+% Alternatively, we could use DocStrip to assemble the package file from three
+% parts, the code from the previous sections, then the contents of the emoji
+% table in |emo.def|, and then all subsequent code. Alas, that seems a bit much
+% for turning two files into one.
% \begin{macrocode}
\input{emo.def}
% \end{macrocode}
@@ -673,10 +720,33 @@ Released under LPPL v1.3c or later
% If indexing is enabled, record the use of an emoji. Otherwise, do nothing.
% \begin{macrocode}
\ifemo@indexing
-\newindex{emo}{edx}{end}{Emoji Index}
-\def\emo@index#1{\index[emo]{#1}}
+ \newindex{emo}{edx}{end}{Emoji Index}
+ \def\emo@index#1{\index[emo]{#1}}
+\else
+ \def\emo@index#1{}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\emo@content}
+% Render the emoji content. This macro interfaces with the backend and thus
+% needs to be defined as many times as there are backends: The Unicode backend
+% just expands the entry from the emoji table. The font backend does the same,
+% but sets the font to Noto Color Emoji first. The PDF backend instead includes
+% the corresponding PDF graphic.
+% \begin{macrocode}
+\ifx\emo@backend\emo@use@unicode
+ \def\emo@content#1{\begingroup\csname emo@emoji@#1\endcsname\endgroup}
+\else
+\ifx\emo@backend\emo@use@font
+ \newfontface\emo@font[Renderer=Harfbuzz]{NotoColorEmoji.ttf}
+ \def\emo@content#1{\begingroup\emo@font\csname emo@emoji@#1\endcsname\endgroup}
\else
-\def\emo@index#1{}
+ \def\emo@content#1{%
+ \raisebox{-0.2ex}{%
+ \includegraphics[height=1em]{emo-graphics/emo-#1}}
+ }
+\fi
\fi
% \end{macrocode}
% \end{macro}
@@ -686,74 +756,47 @@ Released under LPPL v1.3c or later
% \subsection{User Macros}
%
% \begin{macro}{\emo}
-% Emit the named color emoji. Both the font-based version for LuaTeX and the
-% graphics-based fallback validate the emoji name and then invoke the
-% |\emo@index| macro. But they differ in how they actually display the emoji.
-% The LuaTeX version turns the emoji name into its Unicode sequence and wraps
-% that in a group that also uses the previously declared Noto color emoji font.
-% The fallback version instead includes a suitably sized PDF graphic.
+% Thanks to the just introduced internal macros, the main |\emo| macro is really
+% simple: If the emoji name is defined, possibly emit an index entry for that
+% emoji and, critically, render the emoji content.
% \begin{macrocode}
-\ifemo@usefont
-\newfontface\emo@font[Renderer=Harfbuzz]{NotoColorEmoji.ttf}
\newcommand\emo[1]{%
\emo@ifdef{#1}{%
\emo@index{#1}%
- {\emo@font\csname emo@emoji@#1\endcsname}%
+ \emo@content{#1}%
}%
}
-\else
-\newcommand\emo[1]{%
- \emo@ifdef{#1}{%
- \emo@index{#1}%
- \raisebox{-0.2ex}{%
- \includegraphics[height=1em]{emo-graphics/emo-#1}}%
- }%
-}
-\fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\lingchi}
% \begin{macro}{\YHWH}
-% The definitions for the optional |\lingchi| and |\YHWH| macros follow from
-% that of |\emo|, except that
-% \begin{inlinenum}
-% \item there are no arguments to validate and hence no equivalent to
-% |\emo@ifdef|;
-% \item Hebrew is written right-to-left and hence |\YHWH| requires a
-% |\textdir TRT|;
-% \item subsequent space should be preserved and hence both macros end
-% with |\xspace|.
-% \end{inlinenum}
-% While it would be nice to use Unicode inside the groups for font-using
-% versions, this version is more robust given TeX pre-Unicode heritage.
+% With such a simple yet generally useful definition for |\emo|, the default
+% implementations for |\lingchi| and |\YHWH| can just delegate to |\emo|
+% followed by |\xspace|. That's possible because, just like emoji, both macros
+% render either as Unicode characters or PDF graphics. Alas, that cannot work
+% for the font backend because |\emo| uses Noto Color Emoji whereas |\lingchi|
+% uses Traditional Chinese and |\YHWH| Hebrew. Since these two macros are the
+% two only font exceptions, we simply define alternate versions for the font
+% backend that use the correct fonts. Of course, all this happens only when the
+% \textsf{extra} option is enabled.
+% \changes{0.3}{}{Implement in terms of |\emo|}
% \begin{macrocode}
\ifemo@extra
-\ifemo@usefont
-\newfontface\emo@chinese{emo-lingchi.ttf}
-\newfontface\emo@hebrew{LinLibertine_R.otf}
-\newcommand\lingchi{%
- \emo@index{lingchi}%
- \begingroup\emo@chinese \char"51CC\char"9072\endgroup%
- \xspace}
-\newcommand\YHWH{%
- \emo@index{YHWH}%
- \begingroup%
- \textdir TRT%
- \emo@hebrew \char"5D9\char"5D4\char"5D5\char"5D4%
- \endgroup%
- \xspace}
+\ifx\emo@backend\emo@use@font
+ \newfontface\emo@chinese{emo-lingchi.ttf}
+ \newfontface\emo@hebrew{LinLibertine_R.otf}
+ \newcommand\lingchi{%
+ \emo@index{lingchi}%
+ \begingroup\emo@chinese\emo@emoji@lingchi\endgroup%
+ \xspace}
+ \newcommand\YHWH{%
+ \emo@index{YHWH}%
+ \begingroup\emo@hebrew\emo@emoji@YHWH\endgroup%
+ \xspace}
\else
-\newcommand\lingchi{%
- \emo@index{lingchi}%
- \raisebox{-0.2ex}{%
- \includegraphics[height=1em]{emo-graphics/emo-lingchi}}%
- \xspace}
-\newcommand\YHWH{%
- \emo@index{YHWH}%
- \raisebox{-0.2ex}{%
- \includegraphics[height=1em]{emo-graphics/emo-YHWH}}%
- \xspace}
+ \newcommand\lingchi{\emo{lingchi}\xspace}
+ \newcommand\YHWH{\emo{YHWH}\xspace}
\fi
\fi
% \end{macrocode}
@@ -785,11 +828,11 @@ Released under LPPL v1.3c or later
% burden on package authors. Yet, right after announcing emo, the question of
% LaTeXML support came up. LaTeXML includes the |latexml.sty| package, which
% defines |\iflatexml|. I would have used that command to make the three-line
-% change to |emo.sty| necessary for LaTeX support, except |latexml.sty| contains
-% lots of other stuff that isn't needed. Always loading that only to detect
-% LaTeXML seems like a bad idea. Since reimplementing |\iflatexml| would require
-% a binding anyways, I just wrote a minimal binding. As I said, LaTeXML's
-% approach is broken.
+% change to |emo.sty| necessary to support LaTeXML, except |latexml.sty|
+% contains lots of other stuff that isn't needed. Always loading lots of macros
+% only to detect LaTeXML slows down compilation and wastes memory. Since
+% reimplementing |\iflatexml| would require a binding anyways, I just wrote a
+% minimal binding. As I said, LaTeXML's approach is broken.
%
% With that out of the way, let's get started:
% \begin{macrocode}
@@ -815,7 +858,7 @@ use LaTeXML::Package;
% \begin{macrocode}
RawTeX(<<'EOTeX');
\ProvidesPackage{emo}
- [2023/03/21 v0.2a1 emo•ji for all (LaTeX engines)]
+ [2023/04/21 v0.3 emo•ji for all (LaTeX engines)]
\newif\ifemo@extra\emo@extrafalse
EOTeX
% \end{macrocode}
diff --git a/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-chart-increasing.pdf b/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-chart-increasing.pdf
new file mode 100644
index 00000000000..88386572c31
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-chart-increasing.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-japanese-bargain-button.pdf b/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-japanese-bargain-button.pdf
new file mode 100644
index 00000000000..b517c208b35
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-japanese-bargain-button.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-person-facepalming.pdf b/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-person-facepalming.pdf
new file mode 100644
index 00000000000..8add549028f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-person-facepalming.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-plus.pdf b/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-plus.pdf
new file mode 100644
index 00000000000..1e63a5976c6
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/emo/emo-graphics/emo-plus.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/emo/emo.def b/Master/texmf-dist/tex/latex/emo/emo.def
index 8e578056b53..6a50455da17 100644
--- a/Master/texmf-dist/tex/latex/emo/emo.def
+++ b/Master/texmf-dist/tex/latex/emo/emo.def
@@ -1,9 +1,11 @@
-\ProvidesFile{emo.def}[2023-04-01]
+\ProvidesFile{emo.def}[2023-04-19]
\expandafter\def\csname emo@emoji@keycap-one\endcsname{1️⃣}
\def\emo@emoji@biohazard{☣️}
\expandafter\def\csname emo@emoji@balance-scale\endcsname{⚖️}
\expandafter\def\csname emo@emoji@check-mark\endcsname{✔️}
+\def\emo@emoji@plus{➕}
\def\emo@emoji@eu{🇪🇺}
+\expandafter\def\csname emo@emoji@japanese-bargain-button\endcsname{🉐}
\def\emo@emoji@foggy{🌁}
\expandafter\def\csname emo@emoji@globe-africa-europe\endcsname{🌍}
\expandafter\def\csname emo@emoji@classical-building\endcsname{🏛️}
@@ -16,6 +18,7 @@
\def\emo@emoji@collision{💥}
\expandafter\def\csname emo@emoji@currency-exchange\endcsname{💱}
\expandafter\def\csname emo@emoji@floppy-disk\endcsname{💾}
+\expandafter\def\csname emo@emoji@chart-increasing\endcsname{📈}
\expandafter\def\csname emo@emoji@triangular-ruler\endcsname{📐}
\def\emo@emoji@pager{📟}
\expandafter\def\csname emo@emoji@loupe-left\endcsname{🔍}
@@ -25,8 +28,14 @@
\expandafter\def\csname emo@emoji@stop-sign\endcsname{🛑}
\def\emo@emoji@robot{🤖}
\def\emo@emoji@handshake{🤝}
+\expandafter\def\csname emo@emoji@person-facepalming\endcsname{🤦}
\expandafter\def\csname emo@emoji@exploding-head\endcsname{🤯}
\def\emo@emoji@parrot{🦜}
\def\emo@emoji@judge{🧑‍⚖️}
\expandafter\def\csname emo@emoji@roll-of-paper\endcsname{🧻}
\def\emo@emoji@receipt{🧾}
+
+\ifemo@extra
+\def\emo@emoji@lingchi{凌遲}
+\def\emo@emoji@YHWH{\begingroup\textdir TRT יהוה\endgroup}
+\fi
diff --git a/Master/texmf-dist/tex/latex/emo/emo.sty b/Master/texmf-dist/tex/latex/emo/emo.sty
index ecb067a44a0..ac7f2162c80 100644
--- a/Master/texmf-dist/tex/latex/emo/emo.sty
+++ b/Master/texmf-dist/tex/latex/emo/emo.sty
@@ -13,27 +13,38 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{emo}
- [2023/04/01 v0.2 emo•ji for all (LaTeX engines)]
+ [2023/04/21 v0.3 emo•ji for all (LaTeX engines)]
\newif\ifemo@extra\emo@extrafalse
\DeclareOption{extra}{\emo@extratrue}
\newif\ifemo@indexing\emo@indexingfalse
\DeclareOption{index}{\emo@indexingtrue}
\ProcessOptions\relax
\RequirePackage[utf8]{inputenc}
-\newif\ifemo@usefont\emo@usefontfalse
+\def\emo@use@unicode{backend:unicode}
+\def\emo@use@font{backend:font+unicode}
+\def\emo@use@pdf{backend:pdf}
\RequirePackage{iftex}
-\ifluatex\emo@usefonttrue\fi
-\ifemo@usefont
-\RequirePackage{fontspec}
+\ifdefined\HCode
+ \let\emo@backend=\emo@use@unicode
\else
-\RequirePackage{graphicx}
+\ifluatex
+ \let\emo@backend=\emo@use@font
+\else
+ \let\emo@backend=\emo@use@pdf
+\fi
+\fi
+\ifx\emo@backend\emo@use@font
+ \RequirePackage{fontspec}
+\fi
+\ifx\emo@backend\emo@use@pdf
+ \RequirePackage{graphicx}
\fi
\RequirePackage{xcolor}
\ifemo@extra
-\RequirePackage{xspace}
+ \RequirePackage{xspace}
\fi
\ifemo@indexing
-\RequirePackage{index}
+ \RequirePackage{index}
\fi
\input{emo.def}
\definecolor{emo@error@fg}{rgb}{1,1,1}
@@ -52,54 +63,45 @@
\fi%
}
\ifemo@indexing
-\newindex{emo}{edx}{end}{Emoji Index}
-\def\emo@index#1{\index[emo]{#1}}
+ \newindex{emo}{edx}{end}{Emoji Index}
+ \def\emo@index#1{\index[emo]{#1}}
\else
-\def\emo@index#1{}
+ \def\emo@index#1{}
\fi
-\ifemo@usefont
-\newfontface\emo@font[Renderer=Harfbuzz]{NotoColorEmoji.ttf}
-\newcommand\emo[1]{%
- \emo@ifdef{#1}{%
- \emo@index{#1}%
- {\emo@font\csname emo@emoji@#1\endcsname}%
- }%
-}
+\ifx\emo@backend\emo@use@unicode
+ \def\emo@content#1{\begingroup\csname emo@emoji@#1\endcsname\endgroup}
+\else
+\ifx\emo@backend\emo@use@font
+ \newfontface\emo@font[Renderer=Harfbuzz]{NotoColorEmoji.ttf}
+ \def\emo@content#1{\begingroup\emo@font\csname emo@emoji@#1\endcsname\endgroup}
\else
+ \def\emo@content#1{%
+ \raisebox{-0.2ex}{%
+ \includegraphics[height=1em]{emo-graphics/emo-#1}}
+ }
+\fi
+\fi
\newcommand\emo[1]{%
\emo@ifdef{#1}{%
\emo@index{#1}%
- \raisebox{-0.2ex}{%
- \includegraphics[height=1em]{emo-graphics/emo-#1}}%
+ \emo@content{#1}%
}%
}
-\fi
\ifemo@extra
-\ifemo@usefont
-\newfontface\emo@chinese{emo-lingchi.ttf}
-\newfontface\emo@hebrew{LinLibertine_R.otf}
-\newcommand\lingchi{%
- \emo@index{lingchi}%
- \begingroup\emo@chinese \char"51CC\char"9072\endgroup%
- \xspace}
-\newcommand\YHWH{%
- \emo@index{YHWH}%
- \begingroup%
- \textdir TRT%
- \emo@hebrew \char"5D9\char"5D4\char"5D5\char"5D4%
- \endgroup%
- \xspace}
+\ifx\emo@backend\emo@use@font
+ \newfontface\emo@chinese{emo-lingchi.ttf}
+ \newfontface\emo@hebrew{LinLibertine_R.otf}
+ \newcommand\lingchi{%
+ \emo@index{lingchi}%
+ \begingroup\emo@chinese\emo@emoji@lingchi\endgroup%
+ \xspace}
+ \newcommand\YHWH{%
+ \emo@index{YHWH}%
+ \begingroup\emo@hebrew\emo@emoji@YHWH\endgroup%
+ \xspace}
\else
-\newcommand\lingchi{%
- \emo@index{lingchi}%
- \raisebox{-0.2ex}{%
- \includegraphics[height=1em]{emo-graphics/emo-lingchi}}%
- \xspace}
-\newcommand\YHWH{%
- \emo@index{YHWH}%
- \raisebox{-0.2ex}{%
- \includegraphics[height=1em]{emo-graphics/emo-YHWH}}%
- \xspace}
+ \newcommand\lingchi{\emo{lingchi}\xspace}
+ \newcommand\YHWH{\emo{YHWH}\xspace}
\fi
\fi
\endinput
diff --git a/Master/texmf-dist/tex/latex/emo/emo.sty.ltxml b/Master/texmf-dist/tex/latex/emo/emo.sty.ltxml
index b540461c08c..a4c8901f26c 100644
--- a/Master/texmf-dist/tex/latex/emo/emo.sty.ltxml
+++ b/Master/texmf-dist/tex/latex/emo/emo.sty.ltxml
@@ -6,7 +6,7 @@ use warnings;
use LaTeXML::Package;
RawTeX(<<'EOTeX');
\ProvidesPackage{emo}
- [2023/03/21 v0.2a1 emo•ji for all (LaTeX engines)]
+ [2023/04/21 v0.3 emo•ji for all (LaTeX engines)]
\newif\ifemo@extra\emo@extrafalse
EOTeX
DeclareOption('extra', '\emo@extratrue');