summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gmutils/gmlogos.sty
blob: 107ccfd78558fb919e041ec5239b9d28c1ad4141 (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
%% 
%% \iffalse ^^A we skip the debug setting
\IfFileExists{\string~/bin/gen_and_xela}{\errorcontextlines=1000 }{}
%% \fi
%% ^^A $Id: TheUltimateMaster.gmd,v 0.352 2011/10/12 15:19:42 natror Exp natror $
%% This is file “gmlogos.sty” generated with the DocStrip utility.
%% 
%%
%% The original source files were:
%%
%% gmutils/gmutils.gmd  (with options: `logos')
%%
%% 
%% Copyright ©  
%% by Grzegorz ‘Natror’ Murzynowski
%% natror (at) gmail (dot) com
%% 
%% This program is subject to the LaTeX Project Public License.
%% See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
%% for the details of that license.
%%
%% LPPL status: "author-maintained".
%%
%% 
%% 
%% For documentation please refer to the file(s)
%% gmutils.{gmd,pdf}.
%% 
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{gmlogos}
    [2011/05/05 v0.996 TeX-related logos (GM)]


%%
%%
%%     ^^A\typeout{\unexpanded{#4}}%%

\RequirePackage{gmbase}


\let\oldLaTeX\LaTeX
\let\oldLaTeXe\LaTeXe

\pdef\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@}
\Store@Macro\TeX
\AtBeginDocument{\Restore@Macro\TeX}

\lpdef\EofTeX
#1#2% whether put kerns before and after »E« respectively.
#3% we do nothing with it (maybe unbrace) but we want to gobble
  % possible space.
{\if1#1\relax \kern-.1667em \fi
  \lower.5ex\hbox{E}%
  \if1#2\relax \kern-.125em \fi
  #3
}

\newcommand*\DeclareLogo[3][\relax]{% \begin{enumargs*}
  % \opt  is for non-\LaTeX\ spelling and will be used in the
  % \acro{PD1} encoding (to make pdf bookmarks);
  % \item is the command, its name will be the PD1 spelling by
  % default,
  % \item is the definition for all the font encodings except PD1.
  % \end{enumargs*}
  %
  \ifx\relax#1\def\gmu@DeclareLogo@resa{\@xa\@gobble\string#2}%
  \else
    \def\gmu@DeclareLogo@resa{#1}%
  \fi
  \edef\gmu@DeclareLogo@resa{%
    \@nx\DeclareTextCommand\@nx#2{PD1}{\gmu@DeclareLogo@resa}}
  \gmu@DeclareLogo@resa
  \DeclareTextCommandDefault#2{#3}%
  \pdef#2{#3}% added for \XeTeX.
}

\DeclareLogo\LaTeX{%
  {%
    L%
    \setbox\z@\hbox{\check@mathfonts
      \fontsize\sf@size\z@
      \math@fontsfalse\selectfont
      A}%
    \kern-.57\wd\z@
    \sbox\tw@ T%
    \vbox to\ht\tw@{\copy\z@ \vss}%
    \kern-.2\wd\z@% originally $-,15$\,em for T.
  }%
  {%
    \ifdim\fontdimen1\font=\z@
    \else
      \count\z@=\fontdimen5\font
      \multiply\count\z@ by 64\relax
      \divide\count\z@ by\p@
      \count\tw@=\fontdimen1\font
      \multiply\count\tw@ by\count\z@
      \divide\count\tw@ by 64\relax
      \divide\count\tw@ by\tw@
      \kern-\the\count\tw@ sp\relax
    \fi}%
  \gmlogos@hyphen
  \TeX
}

\DeclareLogo\LaTeXe{\mbox{\m@th \if
    b\expandafter\@car\f@series\@nil\boldmath\fi
    \LaTeX\kern.15em2$_{\textstyle\varepsilon}$}}

\Store@Macro\LaTeX
\Store@MacroSt{LaTeX }

\DeclareLogo[(La)TeX]{\LaTeXpar}{%
  {%
    \setbox\z@\hbox{(}%)
    \leavevmode % \chgs{2010/04/09 v0.993 added \cmd\leavevmode\ (a
    % bug fix)}
    \copy\z@
    \kern-.2\wd\z@ L%
    \setbox\z@\hbox{\check@mathfonts
      \fontsize\sf@size\z@
      \math@fontsfalse\selectfont
      A}%
    \kern-.57\wd\z@
    \sbox\tw@ T%
    \vbox to\ht\tw@{\box\z@%
      \vss}%
  }%
  \kern-.07em% originally $-,15$\,em for T.
  {%(
    \sbox\z@)%
    \kern-.2\wd\z@\copy\z@
    \kern-.2\wd\z@}\gmlogos@hyphen\TeX
}

\gmu@ifundefined{AmSTeX}
  {\def\AmSTeX{\leavevmode\hbox{$\mathcal A\kern-.2em\lower.376ex%
        \hbox{$\mathcal M$}\kern-.2em\mathcal S$-\TeX}}}{}

\DeclareLogo\BibTeX{{\rmfamily B\kern-.05em%
    \textsc{i{\kern-.025em}b}\kern-.08em% the kern is wrapped in
                                % braces for my |\fakescaps|' sake.
    \TeX}}

\DeclareLogo\SliTeX{{\rmfamily S\kern-.06emL\kern-.18em\raise.32ex\hbox
        {\scshape i}\kern -.03em\TeX}}

\DeclareLogo\PlainTeX{\textsc{Plain}\kern2pt\TeX}

\DeclareLogo\Web{\textsc{Web}}
\DeclareLogo[The TeX book]\TeXbook{\textsl{The \TeX\space book}}
\let\TB\TeXbook% \textit{TUG Boat} uses this.

\DeclareLogo[e-TeX]\eTeX{%
  \iffontchar\font"03B5{\itshape ε}\else
  \ensuremath{\varepsilon}\fi-\kern-.125em\TeX}% definition sent by Karl

\Store@Macro\eTeX

\DeclareLogo[pdfe-TeX]\pdfeTeX{pdf\gmlogos@hyphen\eTeX}

\DeclareLogo\pdfTeX{pdf\gmlogos@hyphen\TeX}
\DeclareLogo\pdfLaTeX{pdf\gmlogos@hyphen\LaTeX}


\gmu@ifundefined{XeTeX}{%
  \DeclareLogo\XeTeX{X\kern-.125em\relax
    \gmu@ifundefined{reflectbox}{%
      \lower.5ex\hbox{E}\kern-.1667em\relax}{%
      \lower.5ex\hbox{\reflectbox{E}}\kern-.1667em\relax}%
    \TeX
  }%
}{}

\gmu@ifundefined{XeLaTeX}{%
  \DeclareLogo\XeLaTeX{X\kern-.125em\relax
    \gmu@ifundefined{reflectbox}{%
      \lower.5ex\hbox{E}\kern-.1667em\relax}{%
      \lower.5ex\hbox{\reflectbox{E}}\kern-.1667em\relax}%
    \LaTeX}}{}

\DeclareLogo\XeTeXpar{% \chgs{2010/04/09 v0.993 added}
  \setbox\z@\hbox{(}%)
  \leavevmode
  \copy\z@
  \kern-.2\wd\z@
  \smash{% the “Xe” part is copied from \pk{xltxtra}
    X\lower0.5ex
   \hbox{\kern-0.15em
     \gmu@ifundefined{XeTeXversion}%
     {\setbox0=\hbox{E}\dimen0=\ht0\advance\dimen0by\dp0%
       \raise\dimen0\hbox{\rotatebox{180}{\box0}}%
     }% of if not in \XeTeX, then in \XeTeX:
     {\ifnum\XeTeXfonttype\font>0
       \ifnum\XeTeXcharglyph"018E>0
         \char"018E\relax
       \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}% of reversed E when in \XeTeX
   }% of hbox
 }% of smash ^^A(
 \setbox\z@\hbox{)}%
 \kern-.2\wd\z@
 \copy\z@
 \kern-0.15em
 \TeX}%

\DeclareLogo[LuaTeX]\LuaTeX{\textsc{Lua}\gmlogos@hyphen\TeX}

\DeclareLogo [ConTeXt]\ConTeXt{Con\gmlogos@hyphen\TeX t}

\emptify\gmlogos@hyphen

\def\HyphenateLogo#1{%
  {\let\gmlogos@hyphen\-%
    #1}%
}


\endinput
%%
%% End of file `gmlogos.sty'.