Logos (\TeX, etc.)

The body of the LaTeX logo command \TeX is a single line: T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@. Set it beside the original Knuth wrote in plain.tex and the LaTeX version has exactly one extra token at the end, \@ — and that one token widens the space after “…set in TeX. The next sentence” by 1.11pt. Logo commands are not decoration; they are an accumulation of small decisions like this one. This page looks at how \TeX, \LaTeX and \LaTeXe are actually built, what it takes to get \XeTeX or \BibTeX on the page, and what to write in the three places where logos break: headings, PDF bookmarks and .bib files — with the real output from each test.

How the logos are built: kerns, a lowered E and a raised A

\TeX is a “T”, a lowered “E” and an “X” pulled together by negative kerns, and the actual numbers give away the intent. Between T and E sits −0.1667em — precisely one sixth of an em, the same amount as a thin space in maths — between E and X −0.125em (an eighth of an em), and the E drops by 0.5ex. The interesting part is that all this tightening does not make the result narrower. Measured at 10pt Computer Modern, a plainly typed “TeX” is 18.33334pt while \TeX comes out at 18.6108pt — very slightly wider. Lowering the E changes how the neighbouring shapes fit together, which tells you that \TeX is a command that makes a shape, not one that saves space. \LaTeX, by contrast, is genuinely tighter: 25.66368pt against 29.58337pt for a typed “LaTeX”, about 13% narrower.

latex.ltx
% The three logos LaTeX itself defines (latex.ltx, lines 7648-7661).
\DeclareRobustCommand\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@}
\DeclareRobustCommand{\LaTeX}{L\kern-.36em%
        {\sbox\z@ T%
         \vbox to\ht\z@{\hbox{...\fontsize\sf@size\z@ ... A}\vss}}%
        \kern-.15em\TeX}
\DeclareRobustCommand{\LaTeXe}{\mbox{\m@th
  \if b\expandafter\@car\f@series\@nil\boldmath\fi
  \LaTeX\kern.15em2$_{\textstyle\varepsilon}$}}

\LaTeX extends the same idea: before \TeX it places a small raised A to spell “La”, then joins the TeX logo. That A is not a separate character but a footnote-sized A (\sf@size) pushed to the top of a \vbox exactly as tall as a T — an instruction, in other words, to align the top of the A with the top of the T. The deep −0.36em kern between L and A produces the distinctive overlap. \LaTeXe then appends a 2 and a \varepsilon set as a mathematical subscript; look closely at $_{\textstyle\varepsilon}$ and you can see the epsilon comes from math mode, which is why its shape follows the maths font rather than the text font. And the reason the logo turns bold inside a bold heading is that \LaTeXe inspects the font series and switches to \boldmath.

Only three logos come with LaTeX: XeTeX and BibTeX are not among them

Plain LaTeX defines exactly three logo commands: \TeX, \LaTeX and \LaTeXe. \XeTeX, \LuaTeX, \pdfTeX, \BibTeX and \ConTeXt are not among them. Write any of those as they stand and you get ! Undefined control sequence., so a package has to be loaded. Two exceptions are worth knowing. Loading amsmath, which most mathematical documents load anyway, brings in \AmS, and \AmS-\LaTeX gives you the “AMS-LaTeX” wordmark. And for METAFONT and METAPOST the standard answer is \MF and \MP from the mflogo package — they are set from a dedicated logo font, so no other route produces the right shapes.

When in doubt, use hologo — and the deciding reason is not the size of its collection but that it does not break in PDF bookmarks, which a later section measures. hologo (v1.15, dated 2021-11-16, in TeX Live 2024) does not add a swarm of individual commands; it folds everything into a single command that takes the logo name as an argument, as in \hologo{XeTeX}. Its own package line describes it as a logo collection with bookmark support, which is exactly the point. It knows about fifty names, so \hologo{pdfTeX}, \hologo{LuaTeX}, \hologo{BibTeX}, \hologo{ConTeXt}, \hologo{KOMAScript}, \hologo{LaTeX3} and \hologo{biber} all work. To capitalise the first letter at the start of a sentence, use \Hologo{...}; \Hologo{pdfLaTeX} sets “PdfLaTeX”.

The catch is that an unknown name simply fails. \hologo{pTeX} and \hologo{pLaTeX}, familiar in the Japanese world, are not registered in the hologo shipped with TeX Live 2024, and produce the error ! Package hologo Error: Unknown logo. When pTeX, upTeX, pLaTeX or upLaTeX appear in your prose, the practical move is to stop hunting for a logo command and simply type the letters. metalogo (v0.12, from 2010) takes the opposite approach: it defines \XeTeX, \XeLaTeX, \LuaTeX and \LuaLaTeX as individual commands, and in exchange lets you tune kerns and drops pair by pair with \setlogokern{Te}{...} and \setlogodrop{...}. If you need to refit a logo to the font in use — you are on XeLaTeX with a system font, say, and the A in \LaTeX sits wrong — this is the only tool for the job. Note that hologo exposes only \hologo and \Hologo, so loading it alongside metalogo does not collide over command names (verified under both pdfLaTeX and XeLaTeX on TeX Live 2024). Even so, settle on one so that the styling stays uniform.

latex
\usepackage{hologo}    % \hologo{...} and \Hologo{...}
% \usepackage{metalogo} % \XeTeX, \LuaTeX + \setlogokern for fine tuning
% \usepackage{mflogo}   % \MF and \MP

\hologo{pdfTeX}, \hologo{XeTeX} and \hologo{LuaTeX} succeed \hologo{TeX}.
\hologo{BibTeX} builds the bibliography; \hologo{ConTeXt} is a rival format.
\Hologo{pdfLaTeX} starts a sentence with a capital.
% \hologo{pTeX} is NOT defined: "Unknown logo" error. Type pTeX instead.
CommandWhat it setsPackage needed
\TeXTeX, with the E lowered by 0.5exbase LaTeX (none)
\LaTeXLaTeX, the small A aligned to the top of the Tbase LaTeX (none)
\LaTeXeLaTeX2ε; the ε is a maths subscript and follows the maths fontbase LaTeX (none)
\AmSAMS; \AmS-\LaTeX gives AMS-LaTeXamsmath / amstex
\hologo{XeTeX}XeTeX with its reversed E; safe in bookmarks toohologo
\hologo{BibTeX}BibTeX; \hologo{biber} and \hologo{BibTeX8} exist toohologo
\hologo{ConTeXt}ConTeXt; \hologo{LuaTeX}, \hologo{pdfTeX} and \hologo{KOMAScript} work the same wayhologo
\XeTeXXeTeX, tunable with \setlogokern — but it breaks in bookmarksmetalogo
\LuaLaTeXLuaLaTeX; \XeLaTeX and \LuaTeX come from the same packagemetalogo
\MF / \MPMETAFONT / METAPOST, set from a dedicated logo fontmflogo

What the reversed E in the XeTeX logo is actually made of

The answer depends on the engine. Both hologo and metalogo first ask whether the current font has U+018E (LATIN CAPITAL LETTER REVERSED E, Ǝ); if it does, they use that character outright, and if it does not, they mirror an ordinary E with \reflectbox from graphicx. So the same source produces different substance. Typeset a document containing nothing but \hologo{XeTeX} on TeX Live 2024 and pull the text out of the resulting PDF with pdftotext: under XeLaTeX you get XƎTEX, under pdfLaTeX you get XETEX. In the first, a genuine Ǝ is present as a character and survives copy-and-paste; in the second there is only an E that happens to have been placed mirrored, so the text layer holds a plain E. Identical on the page, different when searched or copied.

And when \reflectbox is not available either? hologo does not give up: it looks for a substitute in the order graphicxpgfpstricks → its own driver-specific code. If none of those turns up, it emits a warning saying the logo needs driver specific macros, but driver ... is not supported and then sets an ordinary e and carries on. The page simply reads “XeTeX” and the document finishes — a failure that is easy to miss precisely because nothing stops. Normal pdfLaTeX and XeLaTeX never fall down this path, so there is nothing to worry about there; but if you are on an unusual driver and the logo looks oddly plain, look for that warning in the log.

Headings, PDF bookmarks and .bib: the three places logos break

Headings are fine, bookmarks depend on the package, and .bib needs care. Start with headings: \TeX and \LaTeX are defined with \DeclareRobustCommand, so they survive being written out to a table of contents or a running head. (The old horror stories about moving arguments date from before that protection existed.) Bookmarks are where it goes wrong. When hyperref builds a PDF bookmark string it has to throw away every typesetting command. On TeX Live 2024, \section{Using \XeTeX{} today} with metalogo fills the log with Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing \reflectbox on input line 5. and the finished bookmark reads “Using X0.5ex0.5exE0.5exTeX today” — the dimensions have leaked straight into the string. Write the same heading with \hologo{XeTeX} and there are no warnings at all; the bookmark reads “Using XeTeX today”. hologo carries a separate PDF-string form of every logo, and that is the reason for “when in doubt, hologo”.

A .bib file breaks differently. Many BibTeX styles reformat the capitalisation of titles, which means they mechanically lower-case anything not protected by braces — logo commands included. Write title = {Typesetting With \LaTeX and \TeX}, run it through plain.bst, and the generated .bbl contains Typesetting with \latex and \tex.; the next compilation stops with ! Undefined control sequence. The fix is trivial: wrap the logo command in braces. title = {Typesetting With {\LaTeX} and {\TeX}} comes through the .bbl untouched. It is the same habit as protecting an acronym like {DNA}. And remember the places where a logo is simply wrong: filenames, URLs, inside \verb, PDF metadata such as pdftitle, and anything describing a command line. There the plain unadorned word “LaTeX” is correct, and a logo command is either meaningless or actively harmful.

refs.bib
% Wrong: plain.bst lower-cases it to \latex, then LaTeX stops with
%   ! Undefined control sequence.
title = {Typesetting With \LaTeX and \TeX}

% Right: braces protect the command from BibTeX case changing
title = {Typesetting With {\LaTeX} and {\TeX}}

The eaten space: why “LaTeX is” prints as “LATEXis”

Write \LaTeX is great. and the output is LATEXis great. — the logo glued to the next word. (That is the actual string pulled with pdftotext from a PDF typeset on TeX Live 2024.) The cause has nothing to do with logos in particular: it is TeX’s tokenizing rule that a command spelled out of letters absorbs the space that marks the end of its name. Why that rule exists belongs to the page on basic syntax. There are two remedies: put empty braces {} immediately after the command, or insert a backslash-space \ (a control space). Either way the output becomes LATEX is great. When a comma or full stop follows, there is no space to eat in the first place, so \LaTeX, \TeX. needs nothing. Some people let the xspace package restore the space automatically, but it misjudges certain cases, so being explicit with {} or \ first is the dependable habit.

latex
% Bad: the space is eaten, giving "LATEXis great."
\LaTeX is great.
% Good: empty braces end the command name
\LaTeX{} is great.
% Good: a control space
\LaTeX\ is great.
% No space to eat before punctuation, so this needs nothing
\LaTeX, \TeX.
% In maths, step back into text mode first
$x = \text{\LaTeX}$

One last point: logo commands belong to text mode. \TeX is assembled out of \lower and \hbox, so dropping it straight into math mode ($...$) is asking for trouble; step back into text first with amsmath’s \text{}, as in $x = \text{\LaTeX}$. \LaTeXe goes further still: its definition is wrapped in an \mbox and it enters math mode internally to set the epsilon as a subscript. Behaviour that looks baffling while you think of a logo command as a string becomes predictable once you know it is a combination of raised and lowered boxes (\raisebox is the user-level equivalent), kerns and a mathematical subscript — you can then guess in advance where it will break.