3

When I am using this code to compile:

\documentclass{article}

\begin{document}
τεχνική
\end{document}

when I am using this command to compile the document:

xelatex demo.tex

the pdf did not output anything. what should i do to output these symbol in pdf?

4
  • Did the compiler give you an error instead of outputting something? What was that error? This will probably be easier with XeLaTeX or LuaLaTeX than pdfLaTeX. Which of those are you using?
    – Teepeemm
    Nov 2, 2023 at 14:37
  • no error, the pdf just have no content.
    – Dolphin
    Nov 2, 2023 at 14:40
  • 1
    @Dolphin with pdflatex your example gives the error ! LaTeX Error: Unicode character τ (U+03C4) not set up for use with LaTeX. Nov 2, 2023 at 14:42
  • 1
    @Dolphin with lualatex or xelatex it does not stop with an error but you get the warning Missing character: There is no ε (U+03B5) in font [lmroman10-regular]:+tlig;! Nov 2, 2023 at 14:43

2 Answers 2

9

You do get output! But in the log file and the console:

Missing character: There is no τ (U+03C4) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no ε (U+03B5) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no χ (U+03C7) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no ν (U+03BD) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no ι (U+03B9) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no κ (U+03BA) in font [lmroman10-regular]:mapping=tex-text;!
Missing character: There is no ή (U+03AE) in font [lmroman10-regular]:mapping=tex-text;!

The default font used when running XeLaTeX is Latin Modern, which doesn't support other character sets than Latin.

Add \usepackage{fontsetup} to enable the NewComputerModern fonts (actively maintained), if you want to support Greek and other alphabets.

\documentclass{article}
\usepackage{fontsetup}

\begin{document}

τεχνική

\end{document}

enter image description here

You can also select among many other fonts: load fontspec and select the font you prefer which supports Greek.

6

enter image description here

For full Greek support use babel but just for a one-off word it is enough to select the LGR (Greek) font encoding.

\documentclass{article}
\usepackage[LGR,T1]{fontenc}
\begin{document}
{\fontencoding{LGR}\selectfont τεχνική}
\end{document}

This is assuming pdftex. LGR and T1 are 8 bit encodings not suitable for luatex or xetex


With a Unicode TeX you just need to select a suitable font, Latin Modern does not have Greek

enter image description here

\documentclass{article}
\usepackage{fontspec}
\setmainfont{NewCM10-Regular.otf}
\begin{document}
τεχνική
\end{document}
4
  • how about the xelatex?
    – Dolphin
    Nov 2, 2023 at 14:42
  • 1
    @Dolphin I added a luatex/xetex example Nov 2, 2023 at 14:49
  • Does CM10 assume I'm using 10pt ? OTF files are supposed to scale
    – einpoklum
    Nov 21, 2023 at 11:42
  • 1
    @einpoklum it's a 10pt design font (you can scale it to any size, with \Large etc) the font family includes other design sizes so you could use NewCM08-Regular in subscripts rather than scaling the 10pt font, there are packages that do that but this is the simple direct use of a single font Nov 21, 2023 at 11:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .