Debian Codegraph @

texmf-dist/source/latex/metalogo/metalogo.dtx

raw
1 % \iffalse meta-comment
2 %
3 % © Andrew Gilbert Moschou 2009
4 %
5 % This file may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.3c
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in:
9 %
10 % http://www.latex-project.org/lppl.txt
11 %
12 % and version 1.3c or later is part of all distributions of LaTeX,
13 % version 2005/12/01 or later.
14 %
15 % This file has the LPPL maintenance status "maintained".
16 %
17 % The Current Maintainer of this work is Andrew Gilbert Moschou.
18 %
19 % This work consists of the files metalogo.dtx and metalogo.ins,
20 % and the derived file metalogo.sty.
21 %
22 % \fi
23 % \CheckSum{466}
24 %
25 % \iffalse
26 %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
27 %<package>\ProvidesPackage{metalogo}[2010/05/29 v0.12 Extended TeX logo macros]
28 %
29 %<*driver>
30 \documentclass{ltxdoc}
31 \usepackage{metalogo}
32 \makeatletter
33 \setlogokern{Te}{-0.084em}
34 \setlogokern{eX}{-0.063em}
35 \setlogokern{eT}{-0.074em}
36 \setlogokern{Xe}{-0.063em}
37 \setlogokern{eL}{-0.068em}
38 \setlogokern{La}{-0.305em}
39 \setlogokern{aT}{-0.07313em}
40 \setlogokern{X2}{0.101em}
41 \setlogodrop{0.131em}
42 \setLaTeXa{%
43 \ifdim\fontdimen\@ne\font=\z@
44 \addfontfeature{FakeSlant=\the\fontdimen\@ne\font}%
45 \fi
46 \if b\expandafter\@car\f@series\@nil
47 \check@mathfonts\fontsize\sf@size\z@
48 \math@fontsfalse\selectfont A%
49 \else
50 \scshape a%
51 \fi}
52 \setLaTeXee{\mbox{\stixgeneral\itshape ε}}
53 \usepackage{eukdate}
54 \usepackage{graphicx}
55 \usepackage{booktabs}
56 \usepackage{multirow}
57 \def\meta#1{{\rmfamily{\stixgeneral\char"2329}{\itshape #1}{\stixgeneral\char"232A}}}
58 \setlength\abovecaptionskip{0\p@}
59 \setlength\belowcaptionskip{10\p@}
60 \long\def\@makecaption#1#2{%
61 \vskip\abovecaptionskip
62 \sbox\@tempboxa{\textsc{\MakeLowercase{#1}}: #2}%
63 \ifdim \wd\@tempboxa >\hsize
64 \textsc{\MakeLowercase{#1}}: #2\par
65 \else
66 \global \@minipagefalse
67 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
68 \fi
69 \vskip\belowcaptionskip}
70 \def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\hspace{\marginparsep}}}
71 \usepackage{fontspec}
72 \setmainfont[Numbers=OldStyle]{Sabon LT Std}
73 \DeclareSymbolFont{SabonMaths}{EU1}{\zf@family}{m}{n}
74 \AtBeginDocument{
75 \expandafter\XeTeXmathcode`.\mathchar@type\mathord\symSabonMaths`.
76 \expandafter\XeTeXmathcode`−\mathchar@type\mathbin\symSabonMaths`−
77 \expandafter\XeTeXmathcode`×\mathchar@type\mathbin\symSabonMaths`×
78 \expandafter\XeTeXmathcode`0\mathchar@type\mathord\symSabonMaths`0
79 \expandafter\XeTeXmathcode`1\mathchar@type\mathord\symSabonMaths`1
80 \expandafter\XeTeXmathcode`2\mathchar@type\mathord\symSabonMaths`2
81 \expandafter\XeTeXmathcode`3\mathchar@type\mathord\symSabonMaths`3
82 \expandafter\XeTeXmathcode`4\mathchar@type\mathord\symSabonMaths`4
83 \expandafter\XeTeXmathcode`5\mathchar@type\mathord\symSabonMaths`5
84 \expandafter\XeTeXmathcode`6\mathchar@type\mathord\symSabonMaths`6
85 \expandafter\XeTeXmathcode`7\mathchar@type\mathord\symSabonMaths`7
86 \expandafter\XeTeXmathcode`8\mathchar@type\mathord\symSabonMaths`8
87 \expandafter\XeTeXmathcode`9\mathchar@type\mathord\symSabonMaths`9
88 \expandafter\XeTeXmathcode`e\mathchar@type\mathord\symSabonMaths`e
89 \expandafter\XeTeXmathcode`m\mathchar@type\mathord\symSabonMaths`m}
90 \makeatother
91 \setsansfont[Scale=MatchLowercase]{MgOpen Cosmetica}
92 \setmonofont[Numbers=OldStyle,Scale=MatchLowercase]{Consolas}
93 \newfontfamily\stixgeneral{STIXGeneral}
94 \newcommand\permitbreak{\linebreak[0]}
95 \frenchspacing
96 \EnableCrossrefs
97 \RecordChanges
98 \begin{document}
99 \DocInput{metalogo.dtx}
100 \end{document}
101 %</driver>
102 % \fi
103 %
104 % \GetFileInfo{metalogo.sty}
105 %
106 % \DoNotIndex{}
107 %
108 % \makeatletter
109 % \title{The \textsf{metalogo} package}
110 % \author{Andrew Gilbert Moschou\\\texttt{[email protected]}}
111 % \date{\today\linebreak v.~\expandafter\@gobble\fileversion}
112 % \makeatother
113 %
114 % \maketitle
115 %
116 % \section{Introduction}\providecommand\XeTeX{Xe\TeX}\providecommand\XeLaTeX{Xe\LaTeX}
117 %
118 % 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.
119 %
120 % \section{Parameters}\makeatletter
121 %
122 % \DescribeMacro{\TeX}\DescribeMacro{\LaTeX}\DescribeMacro{\LaTeXe}\DescribeMacro{\XeTeX}\DescribeMacro{\XeLaTeX}\DescribeMacro{\LuaTeX}\DescribeMacro{\LuaLaTeX}%
123 % 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.
124 %
125 % \makeatletter
126 % \newcommand\TeXse{\lower.5ex\hbox{E}}
127 % \newcommand\Lasa{%
128 % \sbox\z@ T%
129 % \vbox to\ht\z@{\hbox{\xl@LaTeX@a}\vss}}%
130 % \newcommand\Xese{\lower.5ex\hbox{\reflectbox{E}}}\makeatother
131 %
132 % \begin{table}\centering
133 % \caption{Kern and drop parameters\label{table}}
134 % \begin{tabular}{@{}cccc@{}}
135 % \multicolumn{4}{@{}c@{}}{Kerns}\\\toprule
136 % Characters & String & Parent logo & Default value\\\midrule
137 % T\TeXse & |Te| & \TeX & |-0.1667em|\\
138 % \TeXse X & |eX| & \TeX & |-0.125em|\\
139 % \setlogokern{La}{0pt}\def\TeX{}\LaTeX & |La| & \LaTeX & |-0.36em|\\
140 % \Lasa T & |aT| & \LaTeX & |-0.15em|\\
141 % X\Xese & |Xe| & \XeTeX & |-0.125em|\\
142 % \Xese T & |eT| & \XeTeX & |-0.1667em|\\
143 % \Xese L & |eL| & \XeLaTeX & |-0.125em|\\
144 % X2 & |X2| & \LaTeXe & |0.15em|\\\bottomrule\\
145 % \multicolumn{4}{@{}c@{}}{Drops}\\\toprule
146 % Character & String & Parent logo & Default value\\\midrule
147 % \TeXse & |TeX| & \TeX & |0.5ex|\\
148 % \Xese & |Xe| & \XeTeX & |0.5ex|\\\bottomrule
149 % \end{tabular}\end{table}
150 %
151 % \section{Commands}
152 %
153 % \subsection{Overview}
154 %
155 % \begin{description}
156 % \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.
157 %
158 % Negative \meta{dimen}s narrow the space between two letters, positive \meta{dimen}s widen the space.
159 %
160 % \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.
161 %
162 % 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.
163 %
164 % Positive \meta{dimen}s lower the letter and negative \meta{dimen}s raise the letter.
165 %
166 % \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:
167 % \begin{itemize}\def\labelitemi{\char"2022}
168 % \item |\scshape a|
169 % \item |\char"1D00|
170 %
171 % (Unicode character \textsc{u+1d00} Latin Letter Small Capital A)
172 % \item |\check@mathfonts|\permitbreak|\fontsize|\permitbreak|\sf@size|\permitbreak|\z@|\permitbreak|\math@fontsfalse|\linebreak[4]|\selectfont |\permitbreak|A|
173 %
174 % (from \LaTeXe’s definition)
175 % \end{itemize}
176 % 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.
177 %
178 % 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’.
179 %
180 % \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.
181 % \end{description}
182 %
183 % \noindent If an argument contains an ‘|@|’ as part of a control sequence, the command would usually have |\makeatletter| before and |\makeatother| after.
184 %
185 % 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.
186 %
187 % \begin{description}
188 % \item[\ttfamily\string\seteverylogo\marg{toks}]\DescribeMacro{\seteverylogo} defines the hook that is called whenever a logo is typeset as \meta{toks}.
189 % \item[\ttfamily\string\everylogo\marg{toks}]\DescribeMacro{\everylogo} appends \meta{toks} to the hook.
190 % \end{description}
191 %
192 % \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.
193 %
194 % \subsection{Defaults}
195 %
196 % \sbox0{ and }
197 %
198 % \begin{description}\def\{{\char"7B}\def\}{\char"7D}
199 % \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).
200 % \item[\ttfamily\string\setLaTeXee\{default\}] is equivalent to |\setLaTeXee|\permitbreak|{\textstyle|\permitbreak|\varepsilon}| (as in \LaTeXe’s definition).
201 % \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}.
202 % \end{description}
203 %
204 % \pagebreak
205 % \section{Examples}
206 %
207 % Clearly, the following example are not good for normal use, but they exaggerate the possibilities:
208 %\begin{center}\begin{tabular}{@{}cc@{}}\toprule
209 % \setlogokern{Te}{1.5em} \TeX, \LaTeX & |\setlogokern{Te}{1.5em}| \\\toprule
210 % \multirow{2}{*}{\newlength\len\setlength\len{-4pt}\setlogokern{eX}{\len}\setlogodrop{.8ex} \TeX, \XeLaTeX} & |\setlength\len{-4pt}\setlogokern{eX}{\len}|\\&|\setlogodrop{.8ex}|\\\toprule
211 % \setlogodrop[Xe]{1ex}\XeTeX & |\setlogodrop[Xe]{1ex}|\\\bottomrule
212 % \end{tabular}\end{center}
213 %
214 % \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:
215 % \begin{verbatim}\makeatletter
216 %\setlogokern{Te}{-0.084em}
217 %\setlogokern{eX}{-0.063em}
218 %\setlogokern{eT}{-0.074em}
219 %\setlogokern{Xe}{-0.063em}
220 %\setlogokern{eL}{-0.068em}
221 %\setlogokern{La}{-0.305em}
222 %\setlogokern{aT}{-0.07313em}
223 %\setlogokern{X2}{0.101em}
224 %\setlogodrop{0.131em}
225 %\setLaTeXa{%
226 % \ifdim\fontdimen\@ne\font=\z@\else
227 % \addfontfeature{FakeSlant=\the\fontdimen\@ne\font}%
228 % \fi
229 % \if b\expandafter\@car\f@series\@nil
230 % \check@mathfonts\fontsize\sf@size\z@
231 % \math@fontsfalse\selectfont A%
232 % \else
233 % \scshape a%
234 % \fi}
235 %\setLaTeXee{\mbox{\stixgeneral\itshape ε}}
236 %\makeatother\end{verbatim}
237 % 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:
238 %
239 % \begin{verbatim}\seteverylogo{%
240 % \if b\expandafter\@car\f@series\@nil
241 % \setlogokern{Te}{-0.075em}%
242 % \setlogokern{eX}{-0.068em}%
243 % \else
244 % \setlogokern{Te}{-0.084em}%
245 % \setlogokern{eX}{-0.063em}%
246 % \fi}\end{verbatim}
247 %
248 % \StopEventually{} ^^A
249 %
250 % \section{Future directions}
251 %
252 % 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!
253 %
254 % \section{Æsthetics}
255 %
256 % 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.
257 %
258 % 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’:
259 % \begin{center}
260 % \includegraphics{graphics/TeXoutline.pdf}\\
261 % \includegraphics{graphics/eLaToutline.pdf}
262 % \end{center}
263 %
264 % \pagebreak\section{The package}
265 %
266 % |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.
267 % \begin{macrocode}
268 \RequirePackage{graphicx}
269 \RequirePackage{ifxetex}
270 \ifxetex
271 \RequirePackage{fontspec}[2008/08/09]
272 \fi
273 % \end{macrocode}
274 % Preserve the original logo definitions.
275 % \begin{macrocode}
276 \let\original@TeX\TeX
277 \let\original@LaTeX\LaTeX
278 \let\original@LaTeXe\LaTeXe
279 \@ifundefined{XeTeX}{}{\let\original@XeTeX\XeTeX}
280 \@ifundefined{XeLaTeX}{}{\let\original@XeLaTeX\XeLaTeX}
281 % \end{macrocode}
282 % Default parameters.
283 % \begin{macrocode}
284 \newif\if@xl@default
285 \AtEndOfPackage{
286 \setlogokern{Te}{default}
287 \setlogokern{eX}{default}
288 \setlogokern{La}{default}
289 \setlogokern{aT}{default}
290 \setlogokern{Xe}{default}
291 \setlogokern{eT}{default}
292 \setlogokern{eL}{default}
293 \setlogokern{X2}{default}
294 \setlogodrop{default}
295 \setLaTeXa{default}
296 \setLaTeXee{default}
297 \seteverylogo{}}
298 % \end{macrocode}
299 % 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.
300 % \begin{macrocode}
301 \newcommand\xl@sh@ft[1]{%
302 \dimen@ #1%
303 \multiply\dimen@\m@ne
304 \kern\strip@pt\fontdimen\@ne\font\dimen@}
305 % \end{macrocode}
306 % \begin{macro}{\setlogokern}
307 % \begin{macrocode}
308 \newcommand\setlogokern[2]{%
309 \edef\@tempa{#1}%
310 \edef\@tempb{#2}%
311 \def\@tempc{default}%
312 \ifx\@tempb\@tempc
313 \@xl@defaulttrue
314 \fi
315 \def\@tempb{aT}%
316 \ifx\@tempa\@tempb
317 \def\xl@kern@LaTeX@aT{#2}%
318 \if@xl@default
319 \def\xl@kern@LaTeX@aT{-.15em}%
320 \fi
321 \else
322 \def\@tempb{eL}%
323 \ifx\@tempa\@tempb
324 \def\xl@kern@XeLaTeX@eL{#2}%
325 \if@xl@default
326 \def\xl@kern@XeLaTeX@eL{-.125em}%
327 \fi
328 \else
329 \def\@tempb{eT}%
330 \ifx\@tempa\@tempb
331 \def\xl@kern@XeTeX@eT{#2}%
332 \if@xl@default
333 \def\xl@kern@XeTeX@eT{-.1667em}%
334 \fi
335 \else
336 \def\@tempb{eX}%
337 \ifx\@tempa\@tempb
338 \def\xl@kern@TeX@eX{#2}%
339 \if@xl@default
340 \def\xl@kern@TeX@eX{-.125em}%
341 \fi
342 \else
343 \def\@tempb{La}%
344 \ifx\@tempa\@tempb
345 \def\xl@kern@La@La{#2}%
346 \if@xl@default
347 \def\xl@kern@La@La{-.36em}%
348 \fi
349 \else
350 \def\@tempb{Te}%
351 \ifx\@tempa\@tempb
352 \def\xl@kern@TeX@Te{#2}%
353 \if@xl@default
354 \def\xl@kern@TeX@Te{-.1667em}%
355 \fi
356 \else
357 \def\@tempb{X2}%
358 \ifx\@tempa\@tempb
359 \def\xl@kern@LaTeXe@Xii{#2}%
360 \if@xl@default
361 \def\xl@kern@LaTeXe@Xii{.15em}%
362 \fi
363 \else
364 \def\@tempb{Xe}%
365 \ifx\@tempa\@tempb
366 \def\xl@kern@Xe@Xe{#2}%
367 \if@xl@default
368 \def\xl@kern@Xe@Xe{-.125em}%
369 \fi
370 \fi
371 \fi
372 \fi
373 \fi
374 \fi
375 \fi
376 \fi
377 \fi
378 \@xl@defaultfalse}
379 % \end{macrocode}
380 % \end{macro}
381 % \begin{macro}{\setlogodrop}
382 % \begin{macrocode}
383 \newcommand\setlogodrop[2][XeTeX]{%
384 \edef\@tempa{#1}%
385 \edef\@tempb{#2}%
386 \def\@tempc{default}%
387 \ifx\@tempb\@tempc
388 \@xl@defaulttrue
389 \fi
390 \def\@tempb{XeTeX}%
391 \ifx\@tempa\@tempb
392 \def\xl@drop@TeX@e{#2}%
393 \let\xl@drop@Xe@e\xl@drop@TeX@e
394 \if@xl@default
395 \def\xl@drop@TeX@e{0.5ex}%
396 \let\xl@drop@Xe@e\xl@drop@TeX@e
397 \fi
398 \else
399 \def\@tempb{TeX}%
400 \ifx\@tempa\@tempb
401 \def\xl@drop@TeX@e{#2}%
402 \if@xl@default
403 \def\xl@drop@TeX@e{.5ex}%
404 \fi
405 \else
406 \def\@tempb{Xe}%
407 \ifx\@tempa\@tempb
408 \def\xl@drop@Xe@e{#2}%
409 \if@xl@default
410 \def\xl@drop@Xe@e{.5ex}%
411 \fi
412 \fi
413 \fi
414 \fi
415 \@xl@defaultfalse}
416 % \end{macrocode}
417 % \end{macro}
418 % \begin{macro}{\setLaTeXa}
419 % \begin{macrocode}
420 \newcommand\setLaTeXa[1]{%
421 \def\@tempa{#1}%
422 \def\@tempb{default}%
423 \ifx\@tempa\@tempb
424 \def\xl@LaTeX@a{%
425 \check@mathfonts\fontsize\sf@size\z@
426 \math@fontsfalse\selectfont A}%
427 \else
428 \def\xl@LaTeX@a{#1}%
429 \fi}
430 % \end{macrocode}
431 % \end{macro}
432 % \begin{macro}{\setLaTeXee}
433 % \begin{macrocode}
434 \newcommand\setLaTeXee[1]{%
435 \def\@tempa{#1}%
436 \def\@tempb{default}%
437 \ifx\@tempa\@tempb
438 \def\xl@LaTeXe@e{\textstyle\varepsilon}%
439 \else
440 \def\xl@LaTeXe@e{#1}%
441 \fi}
442 % \end{macrocode}
443 % \end{macro}
444 % \begin{macro}{\seteverylogo}
445 % \begin{macro}{\everylogo}
446 % \begin{macrocode}
447 \newcommand\seteverylogo[1]{%
448 \xl@everylogo{#1}%
449 \xl@@everylogo{#1}}
450 \newcommand\everylogo[1]{%
451 \addto@hook\xl@everylogo{#1}%
452 \addto@hook\xl@@everylogo{#1}}
453 \newtoks\xl@everylogo
454 \newtoks\xl@@everylogo
455 \newcommand\@xl@everylogo{%
456 \the\xl@everylogo
457 \xl@everylogo{}}
458 % \end{macrocode}
459 % \end{macro}
460 % \end{macro}
461 % \begin{macro}{\TeX}
462 % \begin{macrocode}
463 \DeclareRobustCommand\TeX{%
464 \@xl@everylogo
465 T\kern\xl@kern@TeX@Te
466 \lower\xl@drop@TeX@e\hbox{%
467 \xl@sh@ft\xl@drop@TeX@e
468 E%
469 \ltx@sh@ft\xl@drop@TeX@e}%
470 \kern\xl@kern@TeX@eX X%
471 \the\xl@@everylogo}
472 % \end{macrocode}
473 % \end{macro}
474 % \begin{macro}{\LaTeX}
475 % \begin{macrocode}
476 \DeclareRobustCommand\LaTeX{%
477 \@xl@everylogo
478 L\kern\xl@kern@La@La
479 {\ifxetex
480 \XeTeXuseglyphmetrics\@ne
481 \fi
482 \sbox\z@ T%
483 \sbox\@ne{\xl@LaTeX@a}%
484 \vbox to\ht\z@{%
485 \hbox{%
486 \ltx@sh@ft{\ht\z@}%
487 \xl@sh@ft{\ht\@ne}%
488 \xl@LaTeX@a
489 \xl@sh@ft{\ht\z@}%
490 \ltx@sh@ft{\ht\@ne}}%
491 \vss}}%
492 \kern\xl@kern@LaTeX@aT\TeX}
493 % \end{macrocode}
494 % \end{macro}
495 % \begin{macro}{\LaTeXe}
496 % \begin{macrocode}
497 \DeclareRobustCommand\LaTeXe{%
498 \mbox{\m@th
499 \if b\expandafter\@car\f@series\@nil
500 \boldmath
501 \fi
502 \LaTeX
503 \kern\xl@kern@LaTeXe@Xii 2$_{\xl@LaTeXe@e}$}}
504 % \end{macrocode}
505 % \end{macro}
506 % \begin{macro}{\LuaTeX}
507 % \begin{macrocode}
508 \DeclareRobustCommand\LuaTeX{Lua\TeX}
509 % \end{macrocode}
510 % \end{macro}
511 % \begin{macro}{\LuaLaTeX}
512 % \begin{macrocode}
513 \DeclareRobustCommand\LuaLaTeX{Lua\LaTeX}
514 % \end{macrocode}
515 % \end{macro}
516 % \begin{macro}{\Xe}
517 % \begin{macrocode}
518 \DeclareRobustCommand\Xe{%
519 \@xl@everylogo%
520 X\kern\xl@kern@Xe@Xe
521 \lower\xl@drop@Xe@e
522 \hbox{%
523 \xl@sh@ft\xl@drop@Xe@e
524 \xl@Xe@e
525 \ltx@sh@ft\xl@drop@Xe@e}}
526 % \end{macrocode}
527 % \end{macro}
528 % \begin{macro}{\XeTeX}
529 % \begin{macrocode}
530 \DeclareRobustCommand\XeTeX{\Xe\kern\xl@kern@XeTeX@eT\TeX}
531 % \end{macrocode}
532 % \end{macro}
533 % \begin{macro}{\XeLaTeX}
534 % \begin{macrocode}
535 \DeclareRobustCommand\XeLaTeX{\Xe\kern\xl@kern@XeLaTeX@eL\LaTeX}
536 % \end{macrocode}
537 % \end{macro}
538 % This command typesets ‘\reflectbox{E}’. It contains some code from Will Robertson’s |xltxtra|.
539 % \begin{macrocode}
540 \DeclareRobustCommand\xl@Xe@e{%
541 \ifxetex
542 % \end{macrocode}
543 % \XeTeX.
544 % \begin{macrocode}
545 \ifnum\XeTeXfonttype\font>\z@
546 % \end{macrocode}
547 % Modern font.
548 % \begin{macrocode}
549 \ifnum\XeTeXcharglyph"018E>\z@
550 % \end{macrocode}
551 % Use glyph directly.
552 % \begin{macrocode}
553 \char"018E%
554 \else
555 % \end{macrocode}
556 % Use transformed ‘E’.
557 % \begin{macrocode}
558 \ifdim\fontdimen\@ne\font=\z@
559 % \end{macrocode}
560 % Unslanted. Use reflected ‘E’.
561 % \begin{macrocode}
562 \reflectbox{E}%
563 \else
564 % \end{macrocode}
565 % Slanted. Use |FakeSlant|ed upright ‘E’.
566 % \begin{macrocode}
567 \reflectbox{%
568 \addfontfeature{FakeSlant=-\strip@pt\fontdimen\@ne\font}%
569 \upshape E}%
570 \fi
571 \fi
572 \else
573 % \end{macrocode}
574 % Traditional \TeX\ font. Use transformed ‘E’.
575 % \begin{macrocode}
576 \ifdim\fontdimen1\font=\z@
577 % \end{macrocode}
578 % Unslanted. Use reflected ‘E’.
579 % \begin{macrocode}
580 \reflectbox{E}%
581 \else
582 % \end{macrocode}
583 % Slanted. Use rotated ‘E’ because a shear transformation is unavailable.
584 % \begin{macrocode}
585 \XeTeXuseglyphmetrics\@ne
586 \setbox\z@\hbox{E}%
587 \dimen@\ht\z@
588 \advance\dimen@\dp\z@
589 \ltx@sh@ft\dimen@
590 \raise\dimen@\hbox{\rotatebox{180}{\box\z@}}%
591 \xl@sh@ft\dimen@
592 \fi
593 \fi
594 \else
595 % \end{macrocode}
596 % Not \XeTeX. Traditional \TeX\ font. Use transformed ‘E’.
597 % \begin{macrocode}
598 \ifdim\fontdimen1\font=\z@
599 % \end{macrocode}
600 % Unslanted. Use reflected ‘E’.
601 % \begin{macrocode}
602 \reflectbox{E}%
603 \else
604 % \end{macrocode}
605 % Slanted. Use rotated ‘E’ because a shear transformation is unavailable.
606 % \begin{macrocode}
607 \setbox\z@\hbox{E}%
608 \dimen@\ht\z@
609 \advance\dimen@\dp\z@
610 \ltx@sh@ft\dimen@
611 \raise\dimen@\hbox{\rotatebox{180}{\box\z@}}%
612 \xl@sh@ft\dimen@
613 \fi
614 \fi}
615 % \end{macrocode}
616 %
617 % \Finale
618 %
619 \endinput
620