TransWikia.com

Displaying IPA symbols in Beamer

TeX - LaTeX Asked by user181940 on August 2, 2021

I’m trying to use IPA symbols as well as letters described here in a beamer presentation, but it doesn’t seem to work.

For the alphabet described in the link I have

tracinglostchars2
usepackage{fontspec}
setmainfont{Arial}

For IPA, I tried to use the following as described here:

usepackage{fontspec}
setmainfont{Doulos SIL}

But not all IPA symbols are showing up. Here are some that don’t:

ɕʰ sʰ ʑ  ɾ  k̚  t̚  p̚  ʔ pʰ tʰ kʰ

How to make them display?

documentclass{beamer}

tracinglostchars2
usepackage{fontspec}
setmainfont{Arial}

usepackage{fontspec}
setmainfont{Doulos SIL}

begin{document}

title{Title}   
author{} 
date{} 

frame{frametitle{lí-hó} 

ɕʰ sʰ ʑ  ɾ  k̚  t̚  p̚  ʔ pʰ tʰ kʰ

lí kám ē-hiáu khòaⁿ chiah ê jī
}

end{document}

One Answer

You’ve run into a gotcha with beamer and fontspec The setmainfont command in fontspec sets the serif family, but beamer changes the default font to the sans-serif family. So, your document is not using the font you selected with setmainfont.

If you check the warning messages tracinglostchars2 gives you on the console, you’ll see it telling you that the current font is Latin Modern Sans 10 and it does not have those characters. That’s the default sans-serif font fontspec loads, and the MWE never changed it.

You have a few options. One is to load a font family that has these symbols, such as DejaVu or Libertinus.

documentclass{beamer}

tracinglostchars=2
usepackage{fontspec}
setmainfont{Arial}

usepackage{fontspec}
setmainfont{DejaVu Serif}
setsansfont{DejaVu Sans}
setmonofont{DejaVu Sans Mono}

begin{document}

title{Title}   
author{} 
date{} 

frame{frametitle{lí-hó} 

ɕʰ sʰ ʑ  ɾ  k̚  t̚  p̚  ʔ pʰ tʰ kʰ

lí kám ē-hiáu khòaⁿ chiah ê jī
}

end{document}

This will use DejaVu Sans by default, but let you use rmfamily, ttfamily or textrm to switch to serif or monospaced fonts that also have those symbols. Remember to check for warnings about missing characters!

Another solution, which Alan Xiang brought up in the comments, is to add the line usefonttheme{serif} to your preamble. This will make setmainfont work the way you expect.

Finally, you can set the missing Unicode characters active and supply them from another font. This example uses the free version of URW Charter as the main font, but takes all the linguistic symbols it’s missing from Charis SIL (which is based on Charter).

documentclass{beamer}

tracinglostchars=2
usepackage{fontspec}
setmainfont{Arial}

usepackage{fontspec}
usepackage{newunicodechar}

usefonttheme{serif}

setmainfont{XCharter}
newfontfamilyipafont{Charis SIL}[
  Ligatures=Common,
  Scale=MatchLowercase ]

newunicodechar{^^^^0255}{{ipafontsymbol{"0255}}}
newunicodechar{^^^^027e}{{ipafontsymbol{"027E}}}
newunicodechar{^^^^0291}{{ipafontsymbol{"0291}}}
newunicodechar{^^^^0294}{{ipafontsymbol{"0294}}}
newunicodechar{^^^^02b0}{{ipafontsymbol{"02B0}}}
newunicodechar{^^^^031a}{{ipafontsymbol{"031A}}}
newunicodechar{^^^^207f}{{ipafontsymbol{"207F}}}

begin{document}

title{Title}   
author{} 
date{} 

frame{frametitle{lí-hó} 

ɕʰ sʰ ʑ  ɾ  k̚  t̚  p̚  ʔ pʰ tʰ kʰ

lí kám ē-hiáu khòaⁿ chiah ê jī
}

end{document}

Answered by Davislor on August 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP