diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty | 146 |
1 files changed, 103 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty b/Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty index c8527e2fd5c..d5641f00dba 100644 --- a/Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty +++ b/Master/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty @@ -12,52 +12,104 @@ %% License information appended %% %% -\unless\ifdefined\XeTeXversion - \@latex@error{^^J - *************************************************^^J - *** The xltxtra package only works with XeTeX ***^^J - *************************************************} -\fi \ProvidesPackage{xltxtra} - [2006/06/08 v0.1 Improvements for the XeTeX/LaTeX format] -\newcommand*\TeXlogospacing[5]{% - \DeclareRobustCommand\TeX{% - \leavevmode - \smash{% - T\kern#1 - \lower#3\hbox{E}\kern#2 X}% - \spacefactor1000\relax} - \DeclareRobustCommand{\LaTeX}{% - \leavevmode - \smash{ - L\kern#4% - {\sbox\z@ T% - \vbox to\ht\z@{\hbox{\check@mathfonts - \fontsize\sf@size\z@ - \math@fontsfalse\selectfont - A}% - \vss}% - }% - \kern#5% - \TeX}} - \DeclareRobustCommand\XeTeX{% - \leavevmode - \smash{% - X\lower #3 - \hbox{\kern #2 - \ifnum\XeTeXcharglyph"018E > 0 + [2006/06/13 v0.2 Improvements for the XeTeX/LaTeX format] +\RequirePackage{ifxetex} +\RequireXeTeX +\RequirePackage{graphicx} +\RequirePackage{fontspec} +\RequirePackage{xunicode} +\newlength\xxt@kern@Te +\newlength\xxt@kern@eX +\newlength\xxt@lower@e +\newlength\xxt@kern@La +\newlength\xxt@kern@aT +\newlength\xxt@kern@eL +\newcommand*\TeX@logo@spacing[6]{% + \setlength\xxt@kern@Te{#1}% + \setlength\xxt@kern@eX{#2}% + \setlength\xxt@lower@e{#3}% + \setlength\xxt@kern@La{#4}% + \setlength\xxt@kern@aT{#5}% + \setlength\xxt@kern@eL{#6}% +} +\DeclareRobustCommand\TeX{% + \leavevmode + \smash{% + T\kern\xxt@kern@Te + \lower\xxt@lower@e\hbox{E}\kern\xxt@kern@eX X}% + \spacefactor1000\relax} +\DeclareRobustCommand{\LaTeX}{% + \leavevmode + \smash{% + L\kern\xxt@kern@La + {\sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }% + \kern\xxt@kern@aT + \TeX}} +\DeclareRobustCommand\XeTeX{% + \leavevmode + \smash{% + X\lower\xxt@lower@e + \hbox{\kern\xxt@kern@eX + \ifnum\XeTeXfonttype\font>0 + \ifnum\XeTeXcharglyph"018E>0 \char"018E\relax - \else\ifdim\fontdimen1\font=0pt - \reflectbox{E}% - \else % rotation is about the origin, so we need to adjust positioning - \XeTeXuseglyphmetrics=1% - \setbox0=\hbox{E}\dimen0=\ht0\advance\dimen0by\dp0% - \raise\dimen0\hbox{\rotatebox{180}{\box0}}% - \fi\fi - }\kern#1\TeX}}} -\TeXlogospacing{-0.15em}{-0.15em}{0.5ex}{-0.36em}{-0.15em} + \else + \ifdim\fontdimen1\font=0pt + \reflectbox{E}% + \else + \XeTeXuseglyphmetrics=1% + \setbox0=\hbox{E}\dimen0=\ht0\advance\dimen0by\dp0% + \raise\dimen0\hbox{\rotatebox{180}{\box0}}% + \fi + \fi + \else + \setbox0=\hbox{E}\dimen0=\ht0\advance\dimen0by\dp0% + \raise\dimen0\hbox{\rotatebox{180}{\box0}}% + \fi + }\kern\xxt@kern@Te\TeX}}% +\DeclareRobustCommand\XeLaTeX{% + \leavevmode + \smash{% + X\lower\xxt@lower@e + \hbox{\kern\xxt@kern@eX + \ifnum\XeTeXfonttype\font>0\relax + \ifnum\XeTeXcharglyph"018E>0\relax + \char"018E\relax + \else + \ifdim\fontdimen1\font=0pt\relax + \reflectbox{E}% + \else + \XeTeXuseglyphmetrics=1\relax + \setbox0=\hbox{E}\dimen0=\ht0\advance\dimen0by\dp0\relax + \raise\dimen0\hbox{\rotatebox{180}{\box0}}% + \fi + \fi + \else + \setbox0=\hbox{E}\dimen0=\ht0\advance\dimen0by\dp0\relax + \raise\dimen0\hbox{\rotatebox{180}{\box0}}% + \fi}\kern\xxt@kern@eL\LaTeX}} +\TeX@logo@spacing{-0.15em}{-0.15em}{0.5ex}{-0.36em}{-0.15em}{-0.1em} \RequirePackage{etex} \RequirePackage{fixltx2e}[2006/03/24] +\DeclareRobustCommand\em + {\@nomath\em + \edef\@tempa{\f@shape}% + \edef\@tempb{\itdefault}% + \ifx\@tempa\@tempb + \eminnershape + \else + \emshape + \fi} +\DeclareTextFontCommand{\emph}{\em} +\let\emshape\itshape +\let\eminnershape\upshape \newcommand*\robust@let@nc[2]{% \expandafter\let\expandafter#1\csname #2 \endcsname} \DeclareRobustCommand{\-}{% @@ -139,11 +191,19 @@ {\addfontfeature{VerticalPosition=Denominator}#2}% \fi \endgroup} +\newcommand\namedglyph[1]{% + \@tempcnta=\XeTeXglyphindex "#1"\relax + \ifnum\@tempcnta>0 + \XeTeXglyph\@tempcnta + \else + \xxt@namedglyph@fallback{#1}% + \fi} +\newcommand\xxt@namedglyph@fallback[1]{[#1]} %% %% Copyright (C) 2006 by Will Robertson <wspr81@gmail.com> %% %% Distributable under the LaTeX Project Public License, -%% version 1.3b or higher (your choice). The latest version of +%% version 1.3c or higher (your choice). The latest version of %% this license is at: http://www.latex-project.org/lppl.txt %% %% This work is "maintained" (as per LPPL maintenance status) |