# Using Unicode in latex math (case)

How can i write a case math like this?

i tried:

\begin{align}
BP = \begin{cases}  1 & nếu \space c > r \\e^{1-\frac{r}{c}} & nếu c \leq r \end{cases}
\end{align}


but it does not work: the string "nếu", which contains a unicode-encoded glyph, displays incorrectly!

Thanks for any help!

• Please complete your code so that we can compile it to reproduce the same incorrect output. Please also tell us which engine you are using. I assume XeTeX or LuaTeX since you're using unicode-math. We need a complete example to see the details e.g. the fonts you are specifying etc. Are you sure that should not be marked up as text e.g. with \text{}? – cfr Nov 24 '16 at 3:17
• I can only reproduce the output you are showing by using \text{}. – cfr Nov 24 '16 at 3:23

I originally misread your question and saw the character you'd typed as an e with a tilde accent. However, I now see it is really a to bach and an acute. So, for these two accents on the e, I believe you want something like this which typesets the character in text mode rather than maths mode:

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\begin{document}
\begin{align}
BP = \begin{cases}  1 & \text{nếu } c > r \\e^{1-\frac{r}{c}} & \text{nếu } c \leq r \end{cases}
\end{align}
\end{document}


I'd like to know how to type this, though. (Other than copy-pasting from your question!)

• It should be a circumflex with an acute above it. You can make it out of combining diacritical marks, does ế not copy across for you? – Au101 Nov 24 '16 at 3:36
• @Au101 It just isn't very easy to see it is meant to be that with my eyes and my screen, I think. I actually was editing when you commented. Please see above. But I'd still like to know how to type it. – cfr Nov 24 '16 at 3:37
• You need maybe a Vietnamese keyboard layout or you can do it by unicode character codes, or with a character map. For me with an international keyboard AltGr+; AltGr+' e - to my surprise - does work ế but I originally made it using Ubuntu's "Character Map" I guess Windows might have something similar. OS X does but I can't remember what it's called – Au101 Nov 24 '16 at 3:40
• And yes, sorry, I didn't mean to come across as brusque, your original cut ended with a sentence saying you weren't quite sure what it was and I meant my comment as a natural reply to that. I certainly didn't mean to sound like I was thinking "silly cfr" ! – Au101 Nov 24 '16 at 3:43
• @Au101 Aha! that is helpful, albeit off-topic. KCharSelect I do have :-). – cfr Nov 24 '16 at 21:54