Use iftex instead of ifluatex, ifxetex. Simplified template.

This commit is contained in:
John MacFarlane 2012-06-05 11:35:17 -07:00
parent aa67d0c69f
commit b9d2a1595d

View file

@ -2,29 +2,24 @@
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\usepackage{lmodern} \usepackage{lmodern}
\usepackage{amssymb,amsmath} \usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex} \usepackage{iftex}
\usepackage{fixltx2e} % provides \textsubscript \usepackage{fixltx2e} % provides \textsubscript
\ifxetex \ifPDFTeX % use microtype with pdflatex if available
\usepackage{fontspec,xltxtra,xunicode} \IfFileExists{microtype.sty}{\usepackage{microtype}}{}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \fi
\newcommand{\euro}{€}
$if(mainfont)$ \ifPDFTeX
\setmainfont{$mainfont$} \usepackage[utf8]{inputenc}
$endif$ $if(euro)$
$if(sansfont)$ \usepackage{eurosym}
\setsansfont{$sansfont$}
$endif$
$if(monofont)$
\setmonofont{$monofont$}
$endif$
$if(mathfont)$
\setmathfont{$mathfont$}
$endif$ $endif$
\else \else
\ifluatex \usepackage{fontspec}
\usepackage{fontspec} \ifXeTeX
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \usepackage{xltxtra,xunicode}
\newcommand{\euro}{€} \fi
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\newcommand{\euro}{€}
$if(mainfont)$ $if(mainfont)$
\setmainfont{$mainfont$} \setmainfont{$mainfont$}
$endif$ $endif$
@ -37,12 +32,6 @@ $endif$
$if(mathfont)$ $if(mathfont)$
\setmathfont{$mathfont$} \setmathfont{$mathfont$}
$endif$ $endif$
\else
\usepackage[utf8]{inputenc}
$if(euro)$
\usepackage{eurosym}
$endif$
\fi
\fi \fi
$if(geometry)$ $if(geometry)$
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
@ -94,7 +83,7 @@ $if(graphics)$
\let\Oldincludegraphics\includegraphics \let\Oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}} \renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
$endif$ $endif$
\ifxetex \ifXeTeX
\usepackage[setpagesize=false, % page size defined by xetex \usepackage[setpagesize=false, % page size defined by xetex
unicode=false, % unicode breaks when used with xetex unicode=false, % unicode breaks when used with xetex
xetex]{hyperref} xetex]{hyperref}
@ -129,7 +118,7 @@ $if(verbatim-in-note)$
\VerbatimFootnotes % allows verbatim text in footnotes \VerbatimFootnotes % allows verbatim text in footnotes
$endif$ $endif$
$if(lang)$ $if(lang)$
\ifxetex \ifXeTeX
\usepackage{polyglossia} \usepackage{polyglossia}
\setmainlanguage{$mainlang$} \setmainlanguage{$mainlang$}
\else \else