2

How do we display unicode characters in LaTex using the corresponding string?

I copied the following from an application:

Original

I got this as the LaTex string:

\begin{equation}
\alpha  \beta  \unicode{043e} \copyright  \text{\` a} \unicode{01b0}
\end{equation}

But my TeXMaker can't interpret it:

In TeXMaker

I found some related posts however couldn't draw a conclusion on how to proceed. A clean set of instructions would be very helpful!

Thanks

1

This worked for me in XeLaTeX:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Arial Unicode MS}
\usepackage{xeCJK} % for Japanese - just for testing
\setCJKmainfont{Arial Unicode MS} % for Japanese
\usepackage[russian,english,japanese]{babel}
\usepackage{unicode-math}
\begin{document}
\char"0416 \char"6771 \char"043E \char"01B0
\begin{equation}
\alpha  \beta  \text{\char"043E} \copyright  \text{\` a} \text{\char"01B0}
\end{equation}
\end{document}

Mention capital "E" and "B" in hex codes, it's important. unicode-math package is also required.

Output:

enter image description here

1

Must compile in xelatex or lualatex, and choose a font that provides all your symbols. Use \symbol{} to access unicode slots.

Also key is that the hexidecimal digits beyond 9 must specified with capital letters ("043E rather than "043e).

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Cambria}
\usepackage{unicode-math}
\begin{document}
\begin{equation}
\alpha  \beta  \text{\symbol{"043E}} \copyright  \text{\` a} 
  \text{\symbol{"01B0}}
\end{equation}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.