Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Why doesn't my XeLaTeX document turn this word into italics? I simply can't figure it out.

\documentclass[12pt,letterpaper]{article}
\usepackage{ifpdf}
\usepackage{mla}
\usepackage[T2A]{fontenc}
\usepackage{setspace}
\usepackage[utf8]{inputenc}
\singlespacing
\usepackage{endnotes}
\usepackage{hyperref}
\begin{document}
\emph{hi}
\end{document}
share|improve this question
1  
Using \usepackage{fontspec} works for me. –  Harish Kumar Dec 14 '12 at 2:20
9  
You should never load the inputenc package with XeTeX or LuaTeX. You should also not likely be loading the fontenc package unless you know what you're doing. Use fontspec instead. See Using XeLaTeX instead of pdfLaTeX. –  Alan Munn Dec 14 '12 at 2:20
1  
@AlanMunn Looks like the basis of an answer to me :-) –  Joseph Wright Dec 14 '12 at 8:53
add comment

2 Answers

Let's see why it doesn't work.

The mla package says \usepackage{times} (which is not recommended), so that the default font family is, in LaTeX jargon, ptm, which corresponds to Times.

However, the Times font family that's chosen in this way has no cyrillic version, so when you typeset your document you get

LaTeX Font Warning: Font shape `T2A/ptm/m/n' undefined
(Font)              using `T2A/cmr/m/n' instead on input line 10.

Since no font in the T2A (cyrillic) encoding is defined for the ptm family, LaTeX switches to the default. This happens at \begin{document}. When\emph` is found, the following message is issued

LaTeX Font Warning: Font shape `T2A/ptm/m/it' undefined
(Font)              using `T2A/ptm/m/n' instead on input line 11.

and the reason is just the same: no T2A encoded italic font exists in the T2A family.

If you want to use the standard Computer Modern fonts for your document, just say, after \usepackage{mla},

\renewcommand{\sfdefault}{cmss}
\renewcommand{\rmdefault}{cmr}
\renewcommand{\ttdefault}{cmtt}

and don't use XeLaTeX. With pdflatex you must remember to add

\usepackage[utf8]{inputenc}

if you want to input cyrillic characters directly (or use another input encoding for cyrillic).

With XeLaTeX you don't load fontenc and inputenc. And you have to use fontspec to choose a system font with cyrillic glyphs coverage.

share|improve this answer
add comment

You should never load the inputenc package with XeTeX or LuaTeX. You should also not likely be loading the fontenc package unless you know what you're doing. Use the fontspec package instead. See Using XeLaTeX instead of pdfLaTeX for more details.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.