From ae29f8fd830ee6798b80ee088fdd0c92b1a215f4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 28 May 2010 15:53:06 +0000 Subject: xltxtra 0.5c (27may10) git-svn-id: svn://tug.org/texlive/trunk@18559 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty | 174 ++++++++++++---------- 1 file changed, 98 insertions(+), 76 deletions(-) (limited to 'Master/texmf-dist/tex/xelatex/xltxtra') diff --git a/Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty b/Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty index 8bdd228f41e..cb7d5fd3565 100644 --- a/Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty +++ b/Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty @@ -7,11 +7,25 @@ %% xltxtra.dtx (with options: `package') %% ____________________________ %% The XLTXTRA package -%% (C) 2006-2009 Will Robertson +%% (C) 2006-2010 Will Robertson %% License information appended %% \ProvidesPackage{xltxtra} - [2009/12/26 v0.5b Improvements for the "XeLaTeX" format] + [2010/05/27 v0.5c Improvements for the "XeLaTeX" format] +\RequirePackage{ifluatex} +\ifluatex + \PackageWarningNoLine {xltxtra} {^^J + XLTXTRA IS TO BE USED ONLY UNDER XETEX. + LOAD FONTSPEC DIRECTLY, INSTEAD.^^J + ABORTING LOADING% + } + \RequirePackage{fontspec}[2010/05/14 v2.0] + \expandafter \endinput +\fi +\RequirePackage{ifxetex} +\RequireXeTeX +\RequirePackage{fontspec}[2010/05/14 v2.0] +\RequirePackage{xunicode} \newif\if@xxt@nosscript@ \newif\if@xxt@nologos@ \newif\if@xxt@nohyphen@ @@ -23,10 +37,6 @@ \DeclareOption{no-emph}{\@xxt@noemph@true} \DeclareOption{no-verb}{\@xxt@noverb@true} \ProcessOptions* -\RequirePackage{ifxetex} -\RequireXeTeX -\RequirePackage{fontspec} -\RequirePackage{xunicode} \RequirePackage{metalogo} \if@xxt@nologos@ \let\TeX\original@TeX @@ -45,7 +55,6 @@ \setlogokern{La}{#4}% \setlogokern{aT}{#5}% \setlogokern{eL}{#6}} -\RequirePackage{etex} \RequirePackage{fixltx2e}[2006/03/24] \unless\if@xxt@noemph@ \DeclareRobustCommand\em @@ -86,77 +95,90 @@ \DeclareRobustCommand*\textsuperscript{% \@ifstar{\fakesuperscript}{\realsuperscript}} \fi -\DeclareRobustCommand*\realsubscript[1]{% - \begingroup - \ifcsname zf@family@fontdef\f@family\endcsname - \c@zf@script 1818326126\relax - \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt - \zf@set@font@type - \ifzf@icu - \zf@check@ot@feat{+subs}% - \if@tempswa - {\addfontfeature{VerticalPosition=Inferior}#1}% - \else - \zf@check@ot@feat{+sinf}% - \if@tempswa - {\addfontfeature{VerticalPosition=ScientificInferior}#1}% - \else - \fakesubscript{#1}% - \fi - \fi - \else\ifzf@atsui - \zf@make@aat@feature@string{10}{2}% - \unless\ifx\@tempa\@empty - {\addfontfeature{VerticalPosition=Inferior}#1}% - \else - \fakesubscript{#1}% - \fi - \fi\fi - \else - \fakesubscript{#1}% - \fi - \endgroup} -\DeclareRobustCommand*\realsuperscript[1]{% - \begingroup - \ifcsname zf@family@fontdef\f@family\endcsname - \c@zf@script 1818326126\relax - \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt - \zf@set@font@type - \ifzf@icu - \zf@check@ot@feat{+sups}% - \if@tempswa - {\addfontfeature{VerticalPosition=Superior}#1}% - \else - \fakesuperscript{#1}% - \fi - \else\ifzf@atsui - \zf@make@aat@feature@string{10}{1}% - \unless\ifx\@tempa\@empty - {\addfontfeature{VerticalPosition=Superior}#1}% - \else - \fakesuperscript{#1}% - \fi - \fi\fi - \else - \fakesuperscript{#1}% - \fi - \endgroup} +\ExplSyntaxOn +\DeclareRobustCommand*\realsubscript[1]{ + \fontspec_if_fontspec_font:TF + { + \fontspec_if_opentype:TF + { + \fontspec_if_feature:nTF {+subs} + { + {\addfontfeature{VerticalPosition=Inferior}#1} + } + { + \fontspec_if_feature:nTF {+sinf} + { + {\addfontfeature{VerticalPosition=ScientificInferior}#1} + } + { + \fakesubscript{#1} + } + } + } + { + \fontspec_if_aat_feature:nnTF {10} {2} + { + {\addfontfeature{VerticalPosition=Inferior}#1} + } + { + \fakesubscript{#1} + } + } + } + { + \fakesubscript{#1} + } +} +\DeclareRobustCommand*\realsuperscript[1]{ + \fontspec_if_fontspec_font:TF + { + \fontspec_if_opentype:TF + { + \fontspec_if_feature:nTF {+sups} + { + {\addfontfeature{VerticalPosition=Superior}#1} + } + { + \fakesuperscript{#1} + } + } + { + \fontspec_if_aat_feature:nnTF {10} {1} + { + {\addfontfeature{VerticalPosition=Superior}#1} + } + { + \fakesuperscript{#1} + } + } + } + { + \fakesuperscript{#1} + } +} \def\@makefnmark{\mbox{\normalfont\textsuperscript{\@thefnmark}}} -\newcommand*\vfrac[2]{% - \begingroup - \c@zf@script 1818326126\relax - \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt - \zf@set@font@type - \ifzf@icu - {\addfontfeature{VerticalPosition=Numerator}#1}% +\newcommand*\vfrac[2]{ + \fontspec_if_fontspec_font:TF + { + \fontspec_if_opentype:TF + { + {\addfontfeature{VerticalPosition=Numerator}#1} \textfractionsolidus - {\addfontfeature{VerticalPosition=Denominator}#2}% - \else\ifzf@atsui - {\addfontfeature{VerticalPosition=Superior}#1}% + {\addfontfeature{VerticalPosition=Denominator}#2} + } + { + {\addfontfeature{VerticalPosition=Superior}#1} \textfractionsolidus - {\addfontfeature{VerticalPosition=Inferior}#2}% - \fi\fi - \endgroup} + {\addfontfeature{VerticalPosition=Inferior}#2} + } + } + { + \PackageError {xltxtra} + { \string\vfrac\space~can~only~be~used~with~fontspec~fonts } + { Nothing~more~to~tell. } + } +} +\ExplSyntaxOff \newcommand\namedglyph[1]{% \@tempcnta=\XeTeXglyphindex "#1"\relax \ifnum\@tempcnta>0 @@ -239,7 +261,7 @@ }{}} \fi %% -%% Copyright (C) 2006-2009 by Will Robertson +%% Copyright (C) 2006-2010 by Will Robertson %% %% Distributable under the LaTeX Project Public License, %% version 1.3c or higher (your choice). The latest version of -- cgit v1.2.3