% !TEX TS-program = xelatex 
% !TEX encoding = UTF-8 Unicode samples, and choose one of the font names 


\documentclass[12pt, oneside]{article}
\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, 
            citecolor=blue, urlcolor=blue]{hyperref}
            
\usepackage{fontspec,xltxtra,xunicode} 
\defaultfontfeatures{Mapping=tex-text} 
\setromanfont{Hoefler Text} 
\setromanfont{Optima}
\setromanfont{Baskerville}
\setsansfont[Scale=MatchLowercase] {Gill Sans} 
\setmonofont[Scale=MatchLowercase] {Andale Mono} 

            
\title{
LuaTeX and XeTeX}
%\author{The Author}
%\date{}                                           % Activate to display a given date or no date

\begin{document}
\maketitle
\

\section{History}

\TeX\ was written long before the invention of Unicode, and introduced outline fonts
before the invention of Type I fonts by Adobe and the adoption of Type I, Truetype and OpenType 
fonts by the computing industry. Because   it was written too early, ordinary \TeX\ cannot use the standard system fonts available on your computer.

Over the last several years, several
research programs in the \TeX\ world have been devoted to modifying \TeX\ so it could accept Unicode
input and use your system fonts directly. These developments are particularly
important for users writing in non Western scripts like Arabic, Chinese, and others, because the fonts for
these scripts are already available on most platforms. Unicode makes it possible to type non Western symbols directly
into the editor, including typing from right to left when the language requires it. System fonts then provide the correct
Unicode glyphs in the typeset output.


The first of these research projects to mature was \XeTeX, written by Jonathan Kew. Many users have switched to it for commercial
use. Ordinary \TeX\ documents typeset as usual in \XeTeX, but additional commands are available to
switch fonts. 

The other significant project is Lua\TeX, by Hans Hagen, Hartmut Henkel, and Taco Hoekwater.
It is just now reaching the point where it can be used for serious work. 

\LaTeX\ is an extensive set of macros living on top of \TeX\ and pdf\TeX.
Will Robertson wrote an important package, {\em fontspec}, which makes the \XeTeX\ font changes
extremely easy to use in \LaTeX; the emergence of this package marked the beginning of acceptance of \XeLaTeX\ in the
larger \TeX\ world. Will Robertson, Khaled Hosny, and Elie Roux have recently extended
the {\em fontspec} package to \LuaTeX, making it easy for \LaTeX\ users to experiment with \LuaTeX.

This folder contains brief documents explaining how to get started with \XeLaTeX\ and with \LuaLaTeX. 
%Serious users will want to
% consult more extension documentation, available on the internet and elsewhere.

\section{ConTeXt}

Another quite different package is ConTeXt by Hans Hagen, which also
works on top of all these engines. The authors of \LuaTeX\ come from the ConTeXt community. 

\begin{figure}[htbp] %  figure placement: here, top, bottom, or page
   \centering
   \includegraphics[width=5.9 in]{sample_context_document.png} 
   \caption{ConTeXt running on TeXworks}
   \label{fig:example}
\end{figure} 


Both TeXShop and TeXworks contain engine files to run ConTeXt. These engines are named ``ConTeXt (LuaTeX)'', ``ConTeXt (XeTeX)'',
and ``ConTeXt (pdfTeX)'', and typeset ConTeXt on the indicated base. New users should run on top of LuaTeX. TeXShop users may need to
move these engine files from $\sim$/Library/TeXShop/Engines/Inactive to $\sim$/Library/TeXShop/Engines before using them. In TeXShop, 
the engine files may have the older names indicated below. Change to the new
names when activating the engines:
\begin{itemize}
	\item ConTeXt-MKIV $\rightarrow$ ConTeXt (LuaTeX)
	\item ConTeXt-xetex $\rightarrow$ ConTeXt (XeTeX)
	\item ConTeXt $\rightarrow$ ConTeXt (pdfTeX)
\end{itemize}

We recommend that ConTeXt source files begin with the magic lines:
\begin{verbatim}
     % !TEX encoding = UTF-8 Unicode
     % !TEX TS-program = ConTeXt (LuaTeX)
\end{verbatim}
These lines tell the editor to save the source with unicode encoding, and to use the ConTeXt (LuaTeX) engine to typeset.


This folder contains a brief ConTeXt document which typesets in \LuaTeX.

If you later add new system fonts which you want the program to use,  open Terminal in /Applications/Utilities and
run the command
\begin{verbatim}
     mtxrun --generate
\end{verbatim}
You need only do this once.


Users interested in using ConTeXt with \LuaTeX\ should consult: 
\center{
 \url{http://wiki.contextgarden.net/Main_Page} }
 \center{
 \url{http://www.pragma-ade.com} }
 \center{
 \url{http://www.luatex.org} }



\end{document}
  