% \iffalse meta-comment
%
% © Andrew Gilbert Moschou 2009
% 
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
%    http://www.latex-project.org/lppl.txt
%
% and version 1.3c or later is part of all distributions of LaTeX,
% version 2005/12/01 or later.
% 
% This file has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work is Andrew Gilbert Moschou.
% 
% This work consists of the files metalogo.dtx and metalogo.ins,
% and the derived file metalogo.sty.
% 
% \fi
% \CheckSum{466}
%
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{metalogo}[2010/05/29 v0.12 Extended TeX logo macros]
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{metalogo}
\makeatletter
\setlogokern{Te}{-0.084em}
\setlogokern{eX}{-0.063em}
\setlogokern{eT}{-0.074em}
\setlogokern{Xe}{-0.063em}
\setlogokern{eL}{-0.068em}
\setlogokern{La}{-0.305em}
\setlogokern{aT}{-0.07313em}
\setlogokern{X2}{0.101em}
\setlogodrop{0.131em}
\setLaTeXa{%
  \ifdim\fontdimen\@ne\font=\z@
    \addfontfeature{FakeSlant=\the\fontdimen\@ne\font}%
  \fi
  \if b\expandafter\@car\f@series\@nil
    \check@mathfonts\fontsize\sf@size\z@
    \math@fontsfalse\selectfont A%
  \else
    \scshape a%
  \fi}
\setLaTeXee{\mbox{\stixgeneral\itshape ε}}
\usepackage{eukdate}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{multirow}
\def\meta#1{{\rmfamily{\stixgeneral\char"2329}{\itshape #1}{\stixgeneral\char"232A}}}
\setlength\abovecaptionskip{0\p@}
\setlength\belowcaptionskip{10\p@}
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{\textsc{\MakeLowercase{#1}}: #2}%
  \ifdim \wd\@tempboxa >\hsize
    \textsc{\MakeLowercase{#1}}: #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
\def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\hspace{\marginparsep}}}
\usepackage{fontspec}
\setmainfont[Numbers=OldStyle]{Sabon LT Std}
\DeclareSymbolFont{SabonMaths}{EU1}{\zf@family}{m}{n}
\AtBeginDocument{
  \expandafter\XeTeXmathcode`.\mathchar@type\mathord\symSabonMaths`.
  \expandafter\XeTeXmathcode`−\mathchar@type\mathbin\symSabonMaths`−
  \expandafter\XeTeXmathcode`×\mathchar@type\mathbin\symSabonMaths`×
  \expandafter\XeTeXmathcode`0\mathchar@type\mathord\symSabonMaths`0
  \expandafter\XeTeXmathcode`1\mathchar@type\mathord\symSabonMaths`1
  \expandafter\XeTeXmathcode`2\mathchar@type\mathord\symSabonMaths`2
  \expandafter\XeTeXmathcode`3\mathchar@type\mathord\symSabonMaths`3
  \expandafter\XeTeXmathcode`4\mathchar@type\mathord\symSabonMaths`4
  \expandafter\XeTeXmathcode`5\mathchar@type\mathord\symSabonMaths`5
  \expandafter\XeTeXmathcode`6\mathchar@type\mathord\symSabonMaths`6
  \expandafter\XeTeXmathcode`7\mathchar@type\mathord\symSabonMaths`7
  \expandafter\XeTeXmathcode`8\mathchar@type\mathord\symSabonMaths`8
  \expandafter\XeTeXmathcode`9\mathchar@type\mathord\symSabonMaths`9
  \expandafter\XeTeXmathcode`e\mathchar@type\mathord\symSabonMaths`e
  \expandafter\XeTeXmathcode`m\mathchar@type\mathord\symSabonMaths`m}
\makeatother
\setsansfont[Scale=MatchLowercase]{MgOpen Cosmetica}
\setmonofont[Numbers=OldStyle,Scale=MatchLowercase]{Consolas}
\newfontfamily\stixgeneral{STIXGeneral}
\newcommand\permitbreak{\linebreak[0]}
\frenchspacing
\EnableCrossrefs
\RecordChanges
\begin{document}
\DocInput{metalogo.dtx}
\end{document}
%</driver>
% \fi
%
% \GetFileInfo{metalogo.sty}
%
% \DoNotIndex{}
%
% \makeatletter
% \title{The \textsf{metalogo} package}
% \author{Andrew Gilbert Moschou\\\texttt{andmos@gmail.com}}
% \date{\today\linebreak v.~\expandafter\@gobble\fileversion}
% \makeatother
% 
% \maketitle
%
% \section{Introduction}\providecommand\XeTeX{Xe\TeX}\providecommand\XeLaTeX{Xe\LaTeX}
%
% This package exposes the spacing parameters for the various \TeX\ logos to the end user (and suitably redefines the logos in a generalised way). It is intended to help \XeLaTeX\ users, who use various typefaces, to easily optimise the logos for each typeface. Still, the package remains useful if any typeface is used, not necessarily loaded through \XeTeX. It is known that, in Plain \TeX’s definition of |\TeX|, the lower right serif on the ‘E’ protrudes through the ‘X’ in cmr10 and cmr12; this package can be used to fix this sort of unacceptable grotesque.
%
% \section{Parameters}\makeatletter
%
% \DescribeMacro{\TeX}\DescribeMacro{\LaTeX}\DescribeMacro{\LaTeXe}\DescribeMacro{\XeTeX}\DescribeMacro{\XeLaTeX}\DescribeMacro{\LuaTeX}\DescribeMacro{\LuaLaTeX}%
% The five logos \TeX, \LaTeX, \LaTeXe, \XeTeX\ and \XeLaTeX can be customised in terms of the kerns between consecutive characters and the lowerings of ‘E’ and ‘\reflectbox{E}’. These and their corresponding strings, which identify the parameters, are listed in table~\ref{table}. In addition, the characters for the raised ‘\textsc{a}’ and lowered ‘{\stixgeneral\itshape ε}’ can be customised. The package also defines the control sequences for \LuaTeX\ and \LuaLaTeX, but these two logos can not be customised beyond the definitions of \TeX\ and \LaTeX.
%
% \makeatletter
% \newcommand\TeXse{\lower.5ex\hbox{E}}
% \newcommand\Lasa{%
%   \sbox\z@ T%
%   \vbox to\ht\z@{\hbox{\xl@LaTeX@a}\vss}}%
% \newcommand\Xese{\lower.5ex\hbox{\reflectbox{E}}}\makeatother
%
% \begin{table}\centering
% \caption{Kern and drop parameters\label{table}}
% \begin{tabular}{@{}cccc@{}}
% \multicolumn{4}{@{}c@{}}{Kerns}\\\toprule
% Characters & String & Parent logo & Default value\\\midrule
% T\TeXse  & |Te| & \TeX & |-0.1667em|\\
% \TeXse X & |eX| & \TeX & |-0.125em|\\
% \setlogokern{La}{0pt}\def\TeX{}\LaTeX & |La| & \LaTeX & |-0.36em|\\
% \Lasa T  & |aT| & \LaTeX & |-0.15em|\\
% X\Xese   & |Xe| & \XeTeX & |-0.125em|\\
% \Xese T  & |eT| & \XeTeX & |-0.1667em|\\
% \Xese L  & |eL| & \XeLaTeX & |-0.125em|\\
% X2 & |X2| & \LaTeXe & |0.15em|\\\bottomrule\\
% \multicolumn{4}{@{}c@{}}{Drops}\\\toprule
% Character & String & Parent logo & Default value\\\midrule
% \TeXse & |TeX| & \TeX & |0.5ex|\\
% \Xese & |Xe| & \XeTeX & |0.5ex|\\\bottomrule
% \end{tabular}\end{table}
%
% \section{Commands}
%
% \subsection{Overview}
%
% \begin{description}
% \item[\ttfamily\string\setlogokern\marg{string}\marg{dimen}]\DescribeMacro{\setlogokern} sets the amount of kern between two consecutive characters in a logo. \meta{string} must be one of |Te|, |eX|, |La|, |aT|, |Xe|, |eT|, |eL| or |X2|, which correspond with the particular kerns as shown in table~\ref{table}, and \meta{dimen} must be a legitimate \TeX\ dimension.
%
% Negative \meta{dimen}s narrow the space between two letters, positive \meta{dimen}s widen the space.
%
% \item[\ttfamily\string\setlogodrop\oarg{string}\marg{dimen}]\DescribeMacro{\setlogodrop} sets the amount of drop for letters that sit below the baseline. \meta{string} must be one of |TeX|, |Xe| or |XeTeX| and \meta{dimen} must be a legitimate \TeX\ dimension.
%
% If \meta{string} is |TeX|, the command sets the drop for the ‘E’ of \TeX. If \meta{string} is |Xe|, the command sets the drop for the ‘\reflectbox{E}’ of \XeTeX. If \meta{string} is |XeTeX|, both are set. If \oarg{string} is omitted, |XeTeX| is assumed.
%
% Positive \meta{dimen}s lower the letter and negative \meta{dimen}s raise the letter.
%
% \item[\ttfamily\string\setLaTeXa\marg{arg}]\DescribeMacro{\setLaTeXa} defines the command that typesets the raised ‘\textsc{a}’ in the \LaTeX\ logo as \meta{arg}. Some useful values for \meta{arg} are:
% \begin{itemize}\def\labelitemi{\char"2022}
% \item |\scshape a|
% \item |\char"1D00|
%
% (Unicode character \textsc{u+1d00} Latin Letter Small Capital A)
% \item |\check@mathfonts|\permitbreak|\fontsize|\permitbreak|\sf@size|\permitbreak|\z@|\permitbreak|\math@fontsfalse|\linebreak[4]|\selectfont |\permitbreak|A|
%
% (from \LaTeXe’s definition)
% \end{itemize}
% The first two suggestions typeset the character using a small capital shape. The first can be used if the font contains small capital features or small capital shapes are available, as for many \TeX\ or OpenType fonts. The second can be used if the font does not contain small capital features but does contains phonetic extension characters in Unicode encoding. The third suggestion prints a shrunken capital letter ‘A’ and is useful as a last resort if the font does not contain a small capital ‘A’, as for many home and office computer fonts.
%
% The weights of the strokes in the character are guaranteed to harmonise with the surrounding characters for the first two suggestions, but not for the third because the third shrinks a regular sized character, making the strokes thinner. As the third suggestion is guaranteed to work for any font, it is the default; the other two might produce unexpected results if there is no small capital ‘A’.
%
% \item[\ttfamily\string\setLaTeXee\marg{arg}]\DescribeMacro{\setLaTeXee} defines the command that typesets the lowered ‘{\stixgeneral\itshape ε}’ in the \LaTeXe\ logo as \meta{arg}. Note that this command is used in maths mode (as a subscript) and there should be an |\mbox| or else if needed.
% \end{description}
%
% \noindent If an argument contains an ‘|@|’ as part of a control sequence, the command would usually have |\makeatletter| before and |\makeatother| after.
%
% It is not usually a good idea to use absolute dimensions like point (|pt|) and millimetre (|mm|) because these dimensions do not adapt to any font size. Relative dimensions like em (the current point size, |em|) and ex (the height of the lowercase letter ‘x’, |ex|) are preferred as these dimensions are proportional to the font size.
%
% \begin{description}
% \item[\ttfamily\string\seteverylogo\marg{toks}]\DescribeMacro{\seteverylogo} defines the hook that is called whenever a logo is typeset as \meta{toks}.
% \item[\ttfamily\string\everylogo\marg{toks}]\DescribeMacro{\everylogo} appends \meta{toks} to the hook.
% \end{description}
%
% \noindent These two commands are useful to set parameters that depend on the current font. |\ifdim|\permitbreak|\fontdimen1|\permitbreak|\font|\permitbreak|=|\permitbreak|0pt| is true if the current font is not slanted; |\if |\permitbreak|b|\permitbreak|\expandafter|\permitbreak|\@car|\permitbreak|\f@series|\permitbreak|\@nil| is true if the current font is bold. In a similar way, other font attributes can be tested using the internal macros that are documented in section~2.3 of ‘\LaTeXe\ font selection’ (|fntguide.pdf|). This technique is useful to set dynamic parameters for fonts with optical sizes.
%
% \subsection{Defaults}
%
% \sbox0{ and }
%
% \begin{description}\def\{{\char"7B}\def\}{\char"7D}
% \item[\ttfamily\string\setLaTeXa\{default\}] is equivalent to |\setLaTeXa|\permitbreak|{\check@mathfonts|\permitbreak|\fontsize|\linebreak[4]|\sf@size|\permitbreak|\z@|\permitbreak|\math@fontsfalse|\permitbreak|\selectfont A}| (the third suggestion in the previous section).
% \item[\ttfamily\string\setLaTeXee\{default\}] is equivalent to |\setLaTeXee|\permitbreak|{\textstyle|\permitbreak|\varepsilon}| (as in \LaTeXe’s definition).
% \item[\ttfamily\string\setlogokern\{\meta{\rmfamily string}\}\{default\}\box0\string\setlogodrop\{\meta{\rmfamily string}\}\{default\}] each apply the default value to the parameter that corresponds to \meta{string}, as indicated in table~\ref{table}.
% \end{description}
%
% \pagebreak
% \section{Examples}
%
% Clearly, the following example are not good for normal use, but they exaggerate the possibilities:
%\begin{center}\begin{tabular}{@{}cc@{}}\toprule
% \setlogokern{Te}{1.5em} \TeX, \LaTeX & |\setlogokern{Te}{1.5em}| \\\toprule
% \multirow{2}{*}{\newlength\len\setlength\len{-4pt}\setlogokern{eX}{\len}\setlogodrop{.8ex} \TeX, \XeLaTeX} & |\setlength\len{-4pt}\setlogokern{eX}{\len}|\\&|\setlogodrop{.8ex}|\\\toprule
% \setlogodrop[Xe]{1ex}\XeTeX & |\setlogodrop[Xe]{1ex}|\\\bottomrule
% \end{tabular}\end{center}
%
% \noindent It is a good idea to experiment to determine optimal values (Clever people might open the font in a font editor and directly measure the optimal values). This document is typeset in Sabon \textsc{lt} Std and contains the following settings:
% \begin{verbatim}\makeatletter
%\setlogokern{Te}{-0.084em}
%\setlogokern{eX}{-0.063em}
%\setlogokern{eT}{-0.074em}
%\setlogokern{Xe}{-0.063em}
%\setlogokern{eL}{-0.068em}
%\setlogokern{La}{-0.305em}
%\setlogokern{aT}{-0.07313em}
%\setlogokern{X2}{0.101em}
%\setlogodrop{0.131em}
%\setLaTeXa{%
%  \ifdim\fontdimen\@ne\font=\z@\else
%    \addfontfeature{FakeSlant=\the\fontdimen\@ne\font}%
%  \fi
%  \if b\expandafter\@car\f@series\@nil
%    \check@mathfonts\fontsize\sf@size\z@
%    \math@fontsfalse\selectfont A%
%  \else
%    \scshape a%
%  \fi}
%\setLaTeXee{\mbox{\stixgeneral\itshape ε}}
%\makeatother\end{verbatim}
% This example demonstrates how to set the ‘\textsc{a}’ to depend on the current font, without using |\seteverylogo| or |\everylogo|. The following example sets $−0.084\,em$ and $−0.063\,em$ kerns for regular and $−0.075\,em$ and $−0.068\,em$ kerns for bold text:
%
% \begin{verbatim}\seteverylogo{%
%  \if b\expandafter\@car\f@series\@nil
%    \setlogokern{Te}{-0.075em}%
%    \setlogokern{eX}{-0.068em}%
%  \else
%    \setlogokern{Te}{-0.084em}%
%    \setlogokern{eX}{-0.063em}%
%  \fi}\end{verbatim}
%
% \StopEventually{}    ^^A
%
% \section{Future directions}
%
% Default parameters for common fonts should be built into the package, so that users need not worry about setting them themselves. There should also be an easier way to set dynamic parameters for different font variations (bold, italic, optical sizes, etc.) and shorthands to set multiple kerns with one command. If you want another feature, or another logo supported, please let me know!
%
% \section{Æsthetics}
%
% What one person thinks is beautiful is not necessarily beautiful to another. This section describes my preferences in determining the optimal kern and drop values. Of course, you do not need to agree with me and are free to do something else.
%
% I like my adjacent characters to either be connected or have aligned serifs. If they are connected, they should be set as tight as possible, without any part that ‘sticks out’:
% \begin{center}
% \includegraphics{graphics/TeXoutline.pdf}\\
% \includegraphics{graphics/eLaToutline.pdf}
% \end{center}
%
% \pagebreak\section{The package}
%
% |graphicx| is used to transform ‘E’ into ‘\reflectbox{E}’, and if \XeTeX\ is used, |fontspec|’s |FakeSlant| feature is used to transform ‘\reflectbox{E}’ into \makeatletter \sbox\z@{E}‘{\itshape\xl@sh@ft{\ht\z@}\reflectbox{\addfontfeature{FakeSlant=-.212556561670022}\upshape E}\ltx@sh@ft{\ht\z@}}’, otherwise |\itshape\XeTeX| produces {\def\xl@Xe@e{\reflectbox{E}}\itshape\XeTeX}\makeatother.
%    \begin{macrocode}
\RequirePackage{graphicx}
\RequirePackage{ifxetex}
\ifxetex
  \RequirePackage{fontspec}[2008/08/09]
\fi
%    \end{macrocode}
% Preserve the original logo definitions.
%    \begin{macrocode}
\let\original@TeX\TeX
\let\original@LaTeX\LaTeX
\let\original@LaTeXe\LaTeXe
\@ifundefined{XeTeX}{}{\let\original@XeTeX\XeTeX}
\@ifundefined{XeLaTeX}{}{\let\original@XeLaTeX\XeLaTeX}
%    \end{macrocode}
% Default parameters.
%    \begin{macrocode}
\newif\if@xl@default
\AtEndOfPackage{
  \setlogokern{Te}{default}
  \setlogokern{eX}{default}
  \setlogokern{La}{default}
  \setlogokern{aT}{default}
  \setlogokern{Xe}{default}
  \setlogokern{eT}{default}
  \setlogokern{eL}{default}
  \setlogokern{X2}{default}
  \setlogodrop{default}
  \setLaTeXa{default}
  \setLaTeXee{default}
  \seteverylogo{}}
%    \end{macrocode}
% This macro kerns by $−\mbox{\ttfamily\char"23 1}×\mbox{\meta{current slant}}$. It is similar to \LaTeXe’s |\ltx@sh@ft|, but multiplies the dimension by $−1$. They are used as a kind of italic correction for raised and lowered characters, since a character should shear with respect to an origin on the baseline, not at the bottom of the glyph.
%    \begin{macrocode}
\newcommand\xl@sh@ft[1]{%
  \dimen@ #1%
  \multiply\dimen@\m@ne
  \kern\strip@pt\fontdimen\@ne\font\dimen@}
%    \end{macrocode}
% \begin{macro}{\setlogokern}
%    \begin{macrocode}
\newcommand\setlogokern[2]{%
  \edef\@tempa{#1}%
  \edef\@tempb{#2}%
  \def\@tempc{default}%
  \ifx\@tempb\@tempc
    \@xl@defaulttrue
  \fi
  \def\@tempb{aT}%
  \ifx\@tempa\@tempb
    \def\xl@kern@LaTeX@aT{#2}%
    \if@xl@default
      \def\xl@kern@LaTeX@aT{-.15em}%
    \fi
  \else
    \def\@tempb{eL}%
    \ifx\@tempa\@tempb
      \def\xl@kern@XeLaTeX@eL{#2}%
      \if@xl@default
        \def\xl@kern@XeLaTeX@eL{-.125em}%
      \fi
    \else
      \def\@tempb{eT}%
      \ifx\@tempa\@tempb
        \def\xl@kern@XeTeX@eT{#2}%
        \if@xl@default
          \def\xl@kern@XeTeX@eT{-.1667em}%
        \fi
      \else
        \def\@tempb{eX}%
        \ifx\@tempa\@tempb
          \def\xl@kern@TeX@eX{#2}%
          \if@xl@default
            \def\xl@kern@TeX@eX{-.125em}%
          \fi
        \else
          \def\@tempb{La}%
          \ifx\@tempa\@tempb
            \def\xl@kern@La@La{#2}%
            \if@xl@default
              \def\xl@kern@La@La{-.36em}%
            \fi
          \else
            \def\@tempb{Te}%
            \ifx\@tempa\@tempb
              \def\xl@kern@TeX@Te{#2}%
              \if@xl@default
                \def\xl@kern@TeX@Te{-.1667em}%
              \fi
            \else
              \def\@tempb{X2}%
              \ifx\@tempa\@tempb
                \def\xl@kern@LaTeXe@Xii{#2}%
                \if@xl@default
                  \def\xl@kern@LaTeXe@Xii{.15em}%
                \fi
              \else
                \def\@tempb{Xe}%
                \ifx\@tempa\@tempb
                  \def\xl@kern@Xe@Xe{#2}%
                  \if@xl@default
                    \def\xl@kern@Xe@Xe{-.125em}%
                  \fi
                \fi
              \fi
            \fi
          \fi
        \fi
      \fi
    \fi
  \fi
  \@xl@defaultfalse}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\setlogodrop}
%    \begin{macrocode}
\newcommand\setlogodrop[2][XeTeX]{%
  \edef\@tempa{#1}%
  \edef\@tempb{#2}%
  \def\@tempc{default}%
  \ifx\@tempb\@tempc
    \@xl@defaulttrue
  \fi
  \def\@tempb{XeTeX}%
  \ifx\@tempa\@tempb
    \def\xl@drop@TeX@e{#2}%
    \let\xl@drop@Xe@e\xl@drop@TeX@e
    \if@xl@default
      \def\xl@drop@TeX@e{0.5ex}%
      \let\xl@drop@Xe@e\xl@drop@TeX@e
    \fi
  \else
    \def\@tempb{TeX}%
    \ifx\@tempa\@tempb
      \def\xl@drop@TeX@e{#2}%
      \if@xl@default
        \def\xl@drop@TeX@e{.5ex}%
      \fi
    \else
      \def\@tempb{Xe}%
      \ifx\@tempa\@tempb
        \def\xl@drop@Xe@e{#2}%
        \if@xl@default
          \def\xl@drop@Xe@e{.5ex}%
        \fi
      \fi
    \fi
  \fi
  \@xl@defaultfalse}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\setLaTeXa}
%    \begin{macrocode}
\newcommand\setLaTeXa[1]{%
  \def\@tempa{#1}%
  \def\@tempb{default}%
  \ifx\@tempa\@tempb
    \def\xl@LaTeX@a{%
      \check@mathfonts\fontsize\sf@size\z@
      \math@fontsfalse\selectfont A}%
  \else
    \def\xl@LaTeX@a{#1}%
  \fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\setLaTeXee}
%    \begin{macrocode}
\newcommand\setLaTeXee[1]{%
  \def\@tempa{#1}%
  \def\@tempb{default}%
  \ifx\@tempa\@tempb
    \def\xl@LaTeXe@e{\textstyle\varepsilon}%
  \else
    \def\xl@LaTeXe@e{#1}%
  \fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\seteverylogo}
% \begin{macro}{\everylogo}
%    \begin{macrocode}
\newcommand\seteverylogo[1]{%
  \xl@everylogo{#1}%
  \xl@@everylogo{#1}}
\newcommand\everylogo[1]{%
  \addto@hook\xl@everylogo{#1}%
  \addto@hook\xl@@everylogo{#1}}
\newtoks\xl@everylogo
\newtoks\xl@@everylogo
\newcommand\@xl@everylogo{%
  \the\xl@everylogo
  \xl@everylogo{}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\TeX}
%    \begin{macrocode}
\DeclareRobustCommand\TeX{%
  \@xl@everylogo
  T\kern\xl@kern@TeX@Te
  \lower\xl@drop@TeX@e\hbox{%
    \xl@sh@ft\xl@drop@TeX@e
    E%
    \ltx@sh@ft\xl@drop@TeX@e}%
  \kern\xl@kern@TeX@eX X%
  \the\xl@@everylogo}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\LaTeX}
%    \begin{macrocode}
\DeclareRobustCommand\LaTeX{%
  \@xl@everylogo
  L\kern\xl@kern@La@La
   {\ifxetex
      \XeTeXuseglyphmetrics\@ne
    \fi
    \sbox\z@ T%
    \sbox\@ne{\xl@LaTeX@a}%
    \vbox to\ht\z@{%
      \hbox{%
        \ltx@sh@ft{\ht\z@}%
        \xl@sh@ft{\ht\@ne}%
        \xl@LaTeX@a
        \xl@sh@ft{\ht\z@}%
        \ltx@sh@ft{\ht\@ne}}%
      \vss}}%
  \kern\xl@kern@LaTeX@aT\TeX}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\LaTeXe}
%    \begin{macrocode}
\DeclareRobustCommand\LaTeXe{%
  \mbox{\m@th
    \if b\expandafter\@car\f@series\@nil
      \boldmath
    \fi
    \LaTeX
    \kern\xl@kern@LaTeXe@Xii 2$_{\xl@LaTeXe@e}$}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\LuaTeX}
%    \begin{macrocode}
\DeclareRobustCommand\LuaTeX{Lua\TeX}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\LuaLaTeX}
%    \begin{macrocode}
\DeclareRobustCommand\LuaLaTeX{Lua\LaTeX}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Xe}
%    \begin{macrocode}
\DeclareRobustCommand\Xe{%
  \@xl@everylogo%
  X\kern\xl@kern@Xe@Xe
  \lower\xl@drop@Xe@e
  \hbox{%
    \xl@sh@ft\xl@drop@Xe@e
    \xl@Xe@e
    \ltx@sh@ft\xl@drop@Xe@e}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\XeTeX}
%    \begin{macrocode}
\DeclareRobustCommand\XeTeX{\Xe\kern\xl@kern@XeTeX@eT\TeX}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\XeLaTeX}
%    \begin{macrocode}
\DeclareRobustCommand\XeLaTeX{\Xe\kern\xl@kern@XeLaTeX@eL\LaTeX}
%    \end{macrocode}
% \end{macro}
% This command typesets ‘\reflectbox{E}’. It contains some code from Will Robertson’s |xltxtra|.
%    \begin{macrocode}
\DeclareRobustCommand\xl@Xe@e{%
  \ifxetex
%    \end{macrocode}
% \XeTeX.
%    \begin{macrocode}
    \ifnum\XeTeXfonttype\font>\z@
%    \end{macrocode}
% Modern font.
%    \begin{macrocode}
      \ifnum\XeTeXcharglyph"018E>\z@
%    \end{macrocode}
% Use glyph directly.
%    \begin{macrocode}
        \char"018E%
      \else
%    \end{macrocode}
% Use transformed ‘E’.
%    \begin{macrocode}
        \ifdim\fontdimen\@ne\font=\z@
%    \end{macrocode}
% Unslanted. Use reflected ‘E’.
%    \begin{macrocode}
          \reflectbox{E}%
        \else
%    \end{macrocode}
% Slanted. Use |FakeSlant|ed upright ‘E’.
%    \begin{macrocode}
          \reflectbox{%
            \addfontfeature{FakeSlant=-\strip@pt\fontdimen\@ne\font}%
            \upshape E}%
        \fi
      \fi
    \else
%    \end{macrocode}
% Traditional \TeX\ font. Use transformed ‘E’.
%    \begin{macrocode}
      \ifdim\fontdimen1\font=\z@
%    \end{macrocode}
% Unslanted. Use reflected ‘E’.
%    \begin{macrocode}
        \reflectbox{E}%
      \else
%    \end{macrocode}
% Slanted. Use rotated ‘E’ because a shear transformation is unavailable.
%    \begin{macrocode}
        \XeTeXuseglyphmetrics\@ne
        \setbox\z@\hbox{E}%
        \dimen@\ht\z@
        \advance\dimen@\dp\z@
        \ltx@sh@ft\dimen@
        \raise\dimen@\hbox{\rotatebox{180}{\box\z@}}%
        \xl@sh@ft\dimen@
      \fi
    \fi
  \else
%    \end{macrocode}
% Not \XeTeX. Traditional \TeX\ font. Use transformed ‘E’.
%    \begin{macrocode}
    \ifdim\fontdimen1\font=\z@
%    \end{macrocode}
% Unslanted. Use reflected ‘E’.
%    \begin{macrocode}
      \reflectbox{E}%
    \else
%    \end{macrocode}
% Slanted. Use rotated ‘E’ because a shear transformation is unavailable.
%    \begin{macrocode}
      \setbox\z@\hbox{E}%
      \dimen@\ht\z@
      \advance\dimen@\dp\z@
      \ltx@sh@ft\dimen@
      \raise\dimen@\hbox{\rotatebox{180}{\box\z@}}%
      \xl@sh@ft\dimen@
    \fi
  \fi}
%    \end{macrocode}
%
% \Finale
%
\endinput

