2

I want to use the emoji package from texlive luatex. I have TexLive 2019 under Ubuntu 20.04.

I utilized the following commands to install the package, which is not part of the ubuntu texlive distribution:

tlmgr init-usertree

tlmgr repository add ftp://tug.org/historic/systems/texlive/2019/tlnet-final
tlmgr repository list
tlmgr repository remove http://mirror.ctan.org/systems/texlive/tlnet
tlmgr option repository ftp://tug.org/historic/systems/texlive/2019/tlnet-final

tlmgr install emoji  --verify-repo=none

My minimal example:

\documentclass{article}
\usepackage{emoji}
\setemojifont{Noto Color Emoji}

\begin{document}

\emoji{grinning}

\end{document}

Trying to compile this with lualatex-dev results in no PDF-file but a warning and an error message:

This is LuaTeX, Version 1.10.0 (TeX Live 2019/Debian) 
 restricted system commands enabled.
(./emoji.tex
LaTeX2e <2020-02-02> patch level 2
 L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/home/andreas/texmf/tex/lualatex/emoji/emoji.sty
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))) (./emoji.aux
) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd)

Package emoji Warning: It seems that you have not declare an emoji font.
(emoji)                You should use "\setemojifont " to set a font.

[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./emoji.aux))
 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:1,2:17,3:2,4:1,5:21,6:1,7:13,9:7
</usr/share/texmf/fonts/opentype/public/lm/lmroman10-regular.otf></usr/share/fo
nts/truetype/noto/NotoColorEmoji.ttf
! error:  (file /usr/share/fonts/truetype/noto/NotoColorEmoji.ttf) (ttf): loca 
table not found
!  ==> Fatal error occurred, no output PDF file produced!

I also tried \setemojifont{NotoColorEmoji.ttf}[Path=/usr/share/fonts/truetype/noto/] and \setemojifont{Emoji One} but I get an equivalent result.

The fonts are installed, and in the place indicated by the lualatex message. Lualatex works, and I can set different fonts using \setmainfont{}.

I looked at loca table not found and How to use Noto Color Emoji with lualatex? but neither concerns the emoji package and neither contains a working solution for my problem. The first is closed and the second does not contemplate the relevant error message loca table not found.

I can use the emoji package with Twitter Color Emoji and Segoe UI Emoji, but the result is black and white.

So, is there any way to get the emoji package to work with TexLive 2019, Ubuntu 20.04 and Noto Color Emoji or Emoji One?

5
  • At best get a current texlive 21. You need a luatex with HarfBuzz included, and that is rather new, and there have been some development in the last years Commented Mar 27, 2021 at 8:12
  • My luatex from texlive 19 already includes harfbuzz. I also tried to use the option Renderer=Halfbuzz but nothing changes.
    – newtothis
    Commented Mar 27, 2021 at 17:59
  • no, your log shows that you are using luatex, that hasn't harfbuzz. You need luahbtex. Try to compile with lualatex-dev, perhaps that uses already luahbtex on your system. Commented Mar 27, 2021 at 18:02
  • Actually, I was compiling with lualatex-dev. But now I discovered that for Ubuntu's (Debian's) texlive lualatex-dev is a softlink to luatex as is lualatex. Could that be the reason? Altough luatex act's differently when called as lualatex and when called as luatex.
    – newtothis
    Commented Mar 27, 2021 at 18:37
  • as long as your log says This is LuaTeX, you are using the wrong engine. You need This is LuaHBTeX. I can't tell you if your system has it, it was added to some texlive 2019 in fall 2019 for testing, but it is available in all texlive only in texlive 2020. Commented Mar 27, 2021 at 18:41

1 Answer 1

1

To answer my own question: Ubuntu 20.04's TeX Live 2019 claims to provide luahbtex (in the description of the texlive-luatex package) but in fact it doesn't. To make matters worse it silently links lualatex-dev, which is supposed to run on luahbtex, to luatex.

One can use the following workaround:

  1. Download https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/archive/luahbtex.x86_64-linux.tar.xz (or whatever corresponds to your architecture). You can use another mirror, of course.

  2. Put the luahbtex binary from this package into /usr/local/bin and in the same directory create lualatex-dev as a soft link to luahbtex.

  3. In /var/lib/texmf/fmtutil.cnf-TEXLIVEDIST change the line

    lualatex-dev luatex language.dat,language.dat.lua lualatex.ini

    to

    lualatex-dev luahbtex language.dat,language.dat.lua lualatex.ini.

    (That is, change the engine from luatex to luahbtex.)

  4. Run sudo fmtutil-sys --byfmt=lualatex-dev.

  5. Using lualatex-dev you can now compile any TeX file using the emoji package or otherwise relying on luahbtex without problem. (In case of emoji here's no need to use \setemojifont{} except you want to change the font the package chooses by itself.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .