From fca3e155aee93302249d6bfbcf6208f3ed68dd89 Mon Sep 17 00:00:00 2001 From: "Kevin M. Godby" Date: Thu, 11 Aug 2011 21:35:41 +0000 Subject: [PATCH] * Added initial support for LuaTeX. Patch supplied by Andy Thomas. Thanks, Andy! git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@170 516e2f36-ce3a-0410-bea4-1d4a03f5df72 --- tufte-common.def | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tufte-common.def b/tufte-common.def index e0b3ffe..f2ac14e 100644 --- a/tufte-common.def +++ b/tufte-common.def @@ -284,6 +284,26 @@ \RequirePackage{xltxtra}% xltxtra loads xunicode and fontspec; must be loaded before bidi }{} +%% +% Detect if we're using LuaTeX + +\newboolean{@tufte@luatex} +\IfFileExists{ifluatex.sty}{% + \RequirePackage{ifluatex} + \ifthenelse{\boolean{luatex}} + {\setboolean{@tufte@luatex}{true}} + {\setboolean{@tufte@luatex}{false}} +}{% not using luatex + \setboolean{@tufte@luatex}{false} +} + +\ifthenelse{\boolean{@tufte@luatex}}{% + \RequirePackage{fontspec} + \RequirePackage[osf,sc]{mathpazo} + \setmainfont[Renderer=Basic, Numbers=OldStyle, Scale = 1.0]{TeX Gyre Pagella} + \setsansfont[Renderer=Basic, Scale=0.90]{TeX Gyre Heros} + \setmonofont[Renderer=Basic]{TeX Gyre Cursor} +}{} %% % Globally sets the length @@ -1368,7 +1388,7 @@ % we should load the Palatino, Helvetica, and Bera Mono fonts (if they are % installed.) -\ifthenelse{\boolean{@tufte@loadfonts}\AND\NOT\boolean{@tufte@xetex}}{% +\ifthenelse{\boolean{@tufte@loadfonts}\AND\NOT\boolean{@tufte@xetex}\AND\NOT\boolean{@tufte@luatex}}{% \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{} \IfFileExists{helvet.sty}{\RequirePackage[scaled=0.90]{helvet}}{} \IfFileExists{beramono.sty}{\RequirePackage[scaled=0.85]{beramono}}{}