0

The twemojis package does not seem to get along with [applemac]{inputenc}.

MWE:

\documentclass{standalone}
\usepackage[applemac]{inputenc}
\usepackage{twemojis}
\begin{document}
\end{document}

Error message:

Missing $ insert
ed.
<inserted text> 
                $
l.143 ...{1f1e6-1f1fd}{flag: ^^c3^^85land Islands}

If I uncomment either line 2 or line 3, the file compiles without problems. Is there a way for me to use both packages?

(I've noticed that twemojis can cause other problems, as reported here, and that {applemac}[inputenc] can have issues with other packages, like this one but I do not seem able to find advice on this particular problem.)

NCH32
  • 188
  • 1
    Is your editor really still saving files in the legacy Apple encoding? In 2022, I find that hard to believe … – Ingmar Feb 11 '22 at 12:41

1 Answers1

0

Apologies but I realised only now that it works if I load twemojis before [applemac]{inputenc}. Not sure why but this solved my problem.

This works for me:

\documentclass{standalone}
\usepackage{twemojis}
\usepackage[applemac]{inputenc}
\begin{document}
\end{document}
NCH32
  • 188
  • 3
    well, nowadays hardly any normal document should be using anything but utf8 encoding. applemac, latin1 and ansinew should be left for legacy documents. – daleif Feb 11 '22 at 12:27
  • utf8 does not play well with my bibliography – NCH32 Feb 11 '22 at 12:32
  • Then convert your bibliography to something more modern. The TeXStudio editor can change the encoding of a file. Besides it also very much depends on how you make your bibliography. If you're using bibtex then the bibliography should strictly speaking be written in ascii, aka no special letter, they all need to the written using LaTeX macros. – daleif Feb 11 '22 at 12:36
  • 2
    @NCH32 then better correct your bibliography. Your files will be much more portable if you use utf8 everywhere. – Ulrike Fischer Feb 11 '22 at 12:36
  • Yes, we had this conversation over here: https://tex.stackexchange.com/questions/604788/texshop-loses-umlauts-in-tex-files – NCH32 Feb 11 '22 at 12:44
  • @daleif: Thanks for this pointer: "the bibliography should strictly speaking be written in ascii, aka no special letter, they all need to the written using LaTeX macros." Is there a fool-proof way to do this? I tried re-encoding the bib file in utf8 but it is ten or fifteen years old, quite long, and I have so far not succeeded creating a version that would work well with all my other files. – NCH32 Feb 11 '22 at 13:02
  • 1
    For such a file you might have a mixture of encodings in the same file and then it can be very very hard to convert. I'd probably use tools that can identify non ascii letters and then replace by hand. Doing it automatically is sadly error prone. – daleif Feb 11 '22 at 13:06