%!TEX TS-program = XeLaTeX+xdvipdfmx \documentclass[12pt]{article} \makeatletter \def\@dotsep{999} \usepackage{fontspec,xltxtra,xunicode} \setromanfont[Mapping=tex-text, Scale=MatchLowercase]{TeX Gyre Bonum} \setsansfont[Mapping=tex-text, Scale=MatchLowercase]{TeX Gyre Heros} \setmonofont[Scale=MatchLowercase]{Monaco} \usepackage{calc,fancyvrb,hyperref,refstyle,varioref,xcolor} \usepackage{geometry} %\geometry{screen,margin=3cm} \hypersetup{colorlinks,linkcolor=black,urlcolor=black} \usepackage[it]{titlesec} \usepackage{enumitem} \setlist{nolistsep} \newenvironment{optdesc} {\begin{description}[font=\ttfamily,style=nextline,leftmargin=1.5cm]} {\end{description}} \newcommand\cmd{% \noindent \begin{trivlist}\item[] \SaveVerb[% aftersave={% \begin{minipage}{\linewidth} \UseVerb{CMD}}]{CMD}} \DefineShortVerb{\|} \newcommand\xarg[1]{‹\textit{#1}›} \newcommand\desc[1]{\par#1\par} \def\endcmd{% \end{minipage} \end{trivlist}} \def\cs#1{\texttt{\textbackslash#1}} \newsavebox\verbatimbox \edef\examplefilename{\jobname.example} \newlength\exampleindent \setlength\exampleindent{1em} \newenvironment{example} {\VerbatimEnvironment \begin{VerbatimOut}{\examplefilename}} {\end{VerbatimOut} \typesetexample} \newcommand\typesetexample{% \begin{trivlist}\item[] \vrule \hspace{\exampleindent} \begin{minipage}{\linewidth-\exampleindent} \textit{Example:}\par \vspace{0.4\baselineskip} \BVerbatimInput[fontsize=\small]{\examplefilename}\par \vspace{0.4\baselineskip} \color[rgb]{0.7,0,0}\input\examplefilename\relax \end{minipage}\par \end{trivlist}} \let\strong\textbf \providecommand\pdfTeX{pdf\/\TeX} \newcommand\hlink[2]{\href{#1}{#2}\footnote{\url{#1}}} \let\latin\textit \def\eg{\latin{e.g.}} \def\ie{\latin{i.e.}} \def\Eg{\latin{E.g.}} \def\Ie{\latin{I.e.}} \def\etc{\@ifnextchar.{\latin{etc}}{\latin{etc.}\@}} \def\opteq{\unskip\,\textcolor{gray}{[\textcolor{black}{=}]}\,} \setlength\parskip{0pt} \setlength\parindent{2em} \raggedbottom \begin{document} \title{The \texorpdfstring{\XeTeX}{XeTeX} reference guide} \author{Will Robertson} \maketitle \vfill \section*{Introduction} This document serves to summarise \XeTeX's additional features without being so much as a `users' guide'. Note that much of the functionality addressed here is provided in abstracted form in various \LaTeX\ packages and Con\TeX{}t modules. The descriptions here should be a fairly exhaustive list of the new primitives and features of \XeTeX. Descriptions are still a little aenemic, however. I don't have much time to maintain this document, so contributions are highly welcomed \verb|:)| \section*{License} Copyright 2007--2009 Will Robertson. This work, \verb|XeTeX-reference.ltx|, also known as `\verb|xetexref|', is distributed under the terms of the LaTeX Project Public License \textup(\,\url{http://www.latex-project.org/lppl.txt}\,\textup), version 1.3c or later (your choice), and maintained by Will Robertson. This basically means you are free to re-distribute this file as you wish; you may also make changes to this file or use its contents for another purpose, in which case you should make it clear, by way of a name-change or some other means, that your changed version is a modified version of the original. Please read the license text for more detailed information. \vfill\vfill\vfill\null \newpage \tableofcontents \part{\texorpdfstring{\XeTeX}{XeTeX}\ specifics} \section{The \cs{font} command} The |\font| command has seen significant addition in \XeTeX\ to facilitate rich font feature selection. Under \TeX, fonts were selected like so: |\font\1="|\xarg{font name}|"| with various options appended such as `|at 10pt|' or `|scaled 1.2|', with obvious meaning. This syntax has been extended in \XeTeX\ by passing additions options through the \xarg{font name}. This syntax looks something like\par {\centering|\font\1="|\xarg{font name}\xarg{font options}|:|\xarg{font features}|"| \xarg{\TeX\ font features}\par}\noindent The \xarg{font name} is the actual name of the font (e.g., `|Charis SIL|') and the only mandatory part of the above syntax. When using the |xdvipdfmx| driver (not yet the default in Mac~OS~X), it is possible to use fonts that aren't installed in the operating system by surrounding their name with square brackets. The current directory and the |texmf| trees are searched for files named in this way, or the path may be embedded in the font declaration. \Eg, \begin{quote}\small |\font\1="[fp9r8a]"| \hfill \emph{Selects `FPL Neu' in the current directory} |\font\1="[/myfonts/fp9r8a]"| \hfill \emph{Selects `FPL Neu' somewhere else} |\font\1="[lmroman10-regular]"| \hfill \emph{Selects a Latin Modern font in the \emph{TDS}} \end{quote} \subsection{Font options} \xarg{Font options} are only applicable when the font is selected through the operating system (\ie, without square brackets), and may be any concatenation of the following: \begin{optdesc} \item[/B] Use the bold version of the selected font. \item[/I] Use the italic version of the selected font. \item[/BI] Use the bold italic version of the selected font. \item[/IB] Same as \texttt{/BI}. \item[/S=$x$] Use the version of the selected font corresponding to the optical size $x$\,pt. \item[/AAT] Explicitly use the ATSUI renderer (Mac OS X only). \item[/ICU] Explicitly use the ICU OpenType renderer (only useful on Mac OS X). \end{optdesc} \subsection{Font features} The \xarg{font features} is a comma or semi-colon separated list activating or deactivating various AAT or OpenType font features, which will vary by font. The \XeTeX\ documentation files \path{aat-info.tex} and \path{opentype-info.tex} provide per-font lists of supported features. \subsubsection{Arbitrary AAT or OpenType features} OpenType font features are chosen with \hlink{http://www.microsoft.com/typography/otspec/featuretags.htm}{standard tags}. They may be either comma- or semicolon-separated, and prepended with a |+| to turn them on and a |-| to turn them off. \begin{example} \font\warnock="Warnock Pro/I/S=5:+smcp" at 12pt \warnock This is the OpenType font Warnock Pro in italic with small caps at a small optical size. \end{example} Varying depending on the language and script in use (see \secref[vref]{script}), a small number of OpenType features, if they exist, will be activated by default. AAT font features are specified by strings within each font. Therefore, even equivalent features between different fonts can have different names. \begin{example} \font\hoefler="Hoefler Text/B:Letter Case=Small Caps" at 12pt \hoefler This is the AAT font Hoefler Text in bold with small caps. \end{example} \subsubsection{Options for all fonts} Some font features may be applied for any font. These are \begin{optdesc} \item[mapping=\textsl{}] Uses the specified font mapping for this font. This uses the TECKit engine to transform unicode characters in the last-minute processing stage of the source. For example, |mapping=tex-text| will enable the classical mappings from ugly ascii |``---''| to proper typographical glyphs ``---'', and so on. \item[color={\slshape RRGGBB}{[{\slshape TT}]}] Triple pair of hex values to specify the colour in RGB space, with an optional value for the transparency. \item[letterspace=$x$] Adds $x/S$ space between letters in words, where $S$ is the font size. \end{optdesc} \subsubsection{OpenType script and language support}\seclabel{script} OpenType font features (and font behaviour) can vary by \hlink{http://www.microsoft.com/typography/otspec/scripttags.htm}{script} (`alphabet') and by \hlink{http://www.microsoft.com/typography/otspec/languagetags.htm}{language}. These are selected with four and three letter tags, respectively. \begin{optdesc} \item[script=\textsl{