TransWikia.com

Mix of latin and greek script in source

TeX - LaTeX Asked by Vittorio on July 24, 2021

I need to have a mix of latin and greek in the source, like "The angle is 2θ".
I tried to use LuaLatex with usepackage[utf8]{luainputenc} but the greek characters are not rendered.

Modifying the text is not an option, for several reasons.
Thank you.

3 Answers

You can use the alphabeta package:

documentclass{article}
usepackage{alphabeta}

begin{document}

The angle is 2θ

end{document}

enter image description here

Answered by Ivan on July 24, 2021

You can use any characters that your font supports, if you switch to the modern toolchain. Compile in LuaTeX or XeTeX, take out the inputenc and fontenc packages, and load a font that supports Greek, such as usepackage{newcomputermodern} or usepackage{libertinus}.

Answered by Davislor on July 24, 2021

Another approach, using unicode-math and the TeX Gyre fonts.

documentclass{article}
usepackage{unicode-math}
setmainfont{TeX Gyre Pagella}
setmathfont{TeX Gyre Pagella Math}
begin{document}

The angle is 2θ in text.  The angle is $2θ$ in maths.  

end{document}

Compile with xelatex or lualatex, and (provided you have the TeX Gyre fonts available) you will get:

enter image description here

Answered by Thruston on July 24, 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