Search code examples
unicodelatex

Why can't I show the ð symbol in LaTeX?


I can use \DeclareUnicodeCharacter{0278}{\phi} and then $ɸ$ to display the ɸ symbol in LaTeX. However, when I try to use:

\usepackage[utf8]{inputenc}

\DeclareUnicodeCharacter{0360}{\eth}

\begin{document}

$ð$

\end{document}

ð doesn't display. Why doesn't this work?


Solution

  • You need

    • a package which provides the \eth macro in the encoding you are using, e.g. stix
    • the \eth macro from this package is, unlike \phi, a text macro and not a math macro, so either use it outside of a math environment or surround it with \text{..} from the amsmath package
    • if your tex distribution is not totally out of date, you don't need \usepackage[utf8]{inputenc}, that's the default since a couple of years

    \documentclass{article}
    
    \usepackage{amsmath}
    \usepackage{stix}
    \DeclareUnicodeCharacter{0360}{\eth}
    
    \begin{document}
    
    ð
    
    $\text{ð}$
    
    \end{document}
    

    or avoid all the trouble and simply use an unicode aware engine like lualatex:

    % !TeX TS-program = lualatex
    \documentclass{article}
    
    \begin{document}
    
    ð
    
    \end{document}