3

I download to my laptop CMU Serif font for greek letters, but when I insert charter package (because i want to write english bold text with it) the regular greek letters doesn't show. This is my code

\usepackage{lmodern}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\usepackage[T1]{fontenc}
\usepackage{charter}
\setmainfont{CMU Serif} 
\usepackage{lipsum}

\begin{document} 
\chapter{Chapter 1}
This is a Greek text "Ελλάδα" and this is a {\fontfamily{bch}\bfseries\selectfont bold} text
\end{document}

This is my first question. The second is does anyone know if there are charter characters for greek letters?

  • 1
    charter probably doesn't have Greek glyphs. If you are using fontspec, you should probably load polyglossia and set a font for Greek. – jon Mar 9 '16 at 2:34
  • I set fonts for greek in the \setmainfont{CMU Serif}, but for some reason \usepackage[T1]{fontenc} make the problem. If I set \usepackage{fontspec} after \usepackage[T1]{fontenc}, I have the greek leters, but not the bold style from charter. – Jon Snow Mar 9 '16 at 3:08
  • 2
    Oh, right! If you use fontspec you should not load fontenc (except in certain circumstances and when you know what you are doing). – jon Mar 9 '16 at 3:35
  • Do you know how to use fontenc's bold font without insert fonttenc? – Jon Snow Mar 9 '16 at 3:45
  • 1
    fontenc doesn't 'have' bold. A font has it or it doesn't. I'd do a\newfontfamily\charter{XCharter} and then, say, {\charter\bfseries bold} – jon Mar 9 '16 at 3:57
1

If I insert after \begin{document} the magic code

\expandafter\show\the\font

XeTeX answers by

\T1/CMUSerif(0)/m/n/10=select font ecrm1000

What does this mean?

  • T1 is the current output encoding
  • CMUSerif(0) is the current font family
  • ecrm1000 is the name of the corresponding font file

Before this, you also get

LaTeX Font Warning: Font shape `T1/CMUSerif(0)/m/n' undefined
(Font)              using `T1/cmr/m/n' instead on input line 7.

which warns you that \setmainfont{CMU Serif} basically had no effect. Well it has some effects: it undoes any setting made by lmodern and charter.

Note that neither lmodern nor charter are compatible with (Xe|Lua)LaTeX/fontspec. If you want CMU Serif as your main font, just declare it:

\documentclass{book}
\usepackage{fontspec}
\setmainfont{CMU Serif}

\begin{document}

\chapter{Chapter 1}
This is a Greek text ``Ελλάδα''

\end{document}

enter image description here

If you want Charter as the main font, you should have a version of it that supports Greek. The XCharter font distributed with TeX Live doesn't.

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.