6

I have a simple question about LaTeX. What does it mean when you write

\usepackage[OT1,EU1]{fontenc}

and where can I find the description?


\documentclass{article}
\usepackage{fontspec}
\newfontfamily\xits{XITS}
\newfontfamily\cursor{TeX Gyre Cursor}
\usepackage[OT1]{fontenc}
\renewcommand\rmdefault{cmr}
\renewcommand\sfdefault{cmss}
\renewcommand\ttdefault{cmtt}
\begin{document}
This is Computer Modern Roman.

\textsf{This is Computer Modern Sans.}

\texttt{This is Computer Modern Typewriter.}

{\xits This is Times-like XITS font.}

{\cursor This is Courier-like TeX Gyre Cursor.}
\end{document}

Now I have one more question to find a description of shortcuts for each font, like here? I think it cmr, cmss, cmtt.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • fontenc is a general LaTeX package, not a XeTeX one. However, you should not be using it with XeTeX (other than the rather specific internal use by fontspec). – Joseph Wright Dec 22 '15 at 09:10
  • I'm interested in this OT1 and EU1. – Jakub Drábek Dec 22 '15 at 09:18
  • 1
    About LaTeX font encoding: http://mirrors.ctan.org/macros/latex/doc/encguide.pdf, also: http://www.tex.ac.uk/faq/FAQ-why-inp-font.html and http://www.tex.ac.uk/faq/FAQ-t1enc.html. – Stephen Dec 22 '15 at 09:19
  • @JakubDrábek Where've you seen this? Really, loading EU1 directly (in particular) is a bad plan. – Joseph Wright Dec 22 '15 at 09:28
  • That meant as two different options. I do not know what it is. I know that now. – Jakub Drábek Dec 22 '15 at 09:32
  • 1
    You shouldn't load OT1 as last encoding when using xelatex/lualatex - the last encoding is the one active at the begin of the document, and you really don't want OT1 with xelatex. Also don't renewcommand \rmdefault etc. – Ulrike Fischer Dec 22 '15 at 11:27

1 Answers1

4

OT1, EU1 are names of TeX font encoding schemes:

  • OT1 is the original text encoding scheme used by TeX, it stands for "Old (Original) Text 1", more information can be found here: encguide.
  • EU1 is an experimental encoding scheme for Unicode fonts used by XeTeX, it stands for, what else, "Experimental Unicode 1" (U in LaTeX framework refers to "Unknown" though), more information can be found here: EUenc.

cmr, cmss, cmtt are names of typefaces available in the Computer Modern family:

  • cmr stands for "Computer Modern Roman".
  • cmss stands for "Computer Modern Sans Serif".
  • cmtt stands for "Computer Modern Typewriter".

Information regarding these typefaces can be found in The TeXbook and The METAFONTbook.

There are also plenty of interest read available on TeX Users Group, like this: Surviving the TeX font encoding mess.

Francis
  • 6,183