[XeTeX] latin modern questions

Gareth Hughes garzohugo at gmail.com
Sat Apr 25 01:03:35 CEST 2009


Here below is a reworking that works for me. There are smallcaps and
slanted versions of Latin Modern Roman, make sure you use the correct
names of the fonts installed locally. Try this:

\documentclass{article}
\usepackage[english]{polyglossia}
\usepackage{xltxtra}
\usepackage{fancyhdr}
\pagestyle{fancy}

\defaultfontfeatures{Mapping=tex-text, Numbers=OldStyle}
\setmainfont[SmallCapsFont={Latin Modern Roman Caps}]{Latin Modern Roman}
\newfontface\Slant{Latin Modern Roman Slanted}
\renewcommand{\textsl}[1]{{\Slant #1}}
\begin{document}
\tableofcontents
\setcounter{page}{1234}
\section{One -- 1234}
\input{tufte}

1234

\textsc{smallcaps: 1234}

\textsl{slanted: 1234}

\textbf{bold: 1234}

\textit{italic: 1234}

\input{tufte}
\subsection{One -- one}
\input{tufte}
\subsection{One -- two}
\input{tufte}
\subsection{One -- three}
\input{tufte}
\section{Two -- 1234}
\input{tufte}
\end{document}

Wybo Dekker wrote:
> I'm trying to use xelatex for the first time, but I can't get the fonts
> right.
> The following example:
> 
> ___________________________________________
> \documentclass{article}
> \usepackage[english]{babel}
> \usepackage{fontspec}
> \usepackage{xltxtra}
> \usepackage{xunicode}
> \usepackage{fancyhdr}
> \pagestyle{fancy}
> 
> \defaultfontfeatures{Mapping=tex-text,Numbers=OldStyle}
> 
> \begin{document}
> \fontspec{Latin Modern Roman}
> \tableofcontents
> \setcounter{page}{1234}
> \section{One -- 1234}
> \input{tufte}
> 
> 1234
> 
> \textsc{smallcaps: 1234}
> 
> \textsl{slanted: 1234}
> 
> \textbf{bold: 1234}
> 
> \textit{italic: 1234}
> 
> \input{tufte}
> \subsection{One -- one}
> \input{tufte}
> \subsection{One -- two}
> \input{tufte}
> \subsection{One -- three}
> \input{tufte}
> \section{Two -- 1234}
> \input{tufte}
> \end{document}
> ___________________________________________
> 
> shows some of my problems:
> 
> - numbers are oldstyle, except in:
>   headings,
>   (sub)section titles,
>   page numbers
>   subsection page numbers in the toc
> - The latter stick out in the margin
> - slanted is not slanted but italic
> - smallcaps is not smallcaps but roman
> 
> How can I fix this?
> 

-- 
Gareth Hughes

Department of Eastern Christianity
Oriental Institute
Pusey Lane
Oxford
OX1 2LE

+44 (0)1865 610227


More information about the XeTeX mailing list