summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/metalogo/metalogo.dtx
blob: 5516ca46cbfa3fa48d2752af544d991f3206dc37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
% \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