167

I want to get that fancy LaTeX symbol to put in one of my documents but I cannot find it anywhere. All searching for things like latex symbol have not resulted in the symbol but other symbols.

5
  • 47
    You mean \LaTeX ?
    – yannisl
    Dec 22, 2010 at 4:18
  • 3
    @Yiannis, thanks, that is exactly what I was looking for. Add that as an answer and I will accept. I tried that but with the wrong capitalization. Dec 22, 2010 at 4:34
  • LyX does this automatically when you type in either LyX or LaTeX. Dec 22, 2010 at 14:12
  • @DaveJarvis This doesn't seem to work, at least for LyX 2.2.3.
    – Sparhawk
    Nov 30, 2017 at 0:33
  • See What do the commands inside the \LaTeX logo do? Summary: {L} + {lower A} + \TeX Apr 2, 2021 at 20:29

3 Answers 3

171

You simply type \LaTeX. One problem with this is that if you type it a lot of times in your text you will need to type \LaTeX\␣¹ (i.e., followed by \ and an actual space) to force a space after it.

Also personally I find the capitalization of L and T leads to typing errors, so I redefine the command as follows:

\newcommand{\latex}{\LaTeX\xspace}
\newcommand{\tex}{\TeX\xspace}

\xspace is from the xspace package. Additionaly, writing \LaTeX{} adds the space after.


¹ is used here to represent a normal space "", which wouldn’t show up at the end of Markdown code markup.

8
  • 8
    or simply \makeatletter\g@addto@macro{\TeX}{\xspace}\makeatother for both
    – user2478
    Dec 22, 2010 at 6:33
  • 5
    Or \expandafter\def\expandafter\TeX\expandafter{\TeX\xspace} or \edef\TeX{\TeX\noexpand\xspace} or ...
    – TH.
    Dec 22, 2010 at 10:29
  • 2
    @fluteflute It is the way TeX is designed. Imagine if you needed to type \LaTeX. then the space would be a problem.
    – yannisl
    Jan 29, 2014 at 2:36
  • 5
    You could use \LaTeX{} instead of the "\ ". The curly brackets indicate the empty arguments list. LaTeX does know that the command ends and does not eat up the following space.
    – usr1234567
    Aug 5, 2016 at 7:32
  • 3
    @Tvde1 Thanks for the downvote. You care to explain why in an answer? It is perfectly acceptable to do either. In the first case, \ was terminated by \ , the command that produces an interword space. It can also be terminated by the empty group { }. Note the empty group not the empty argument as mentioned by @usr1234567. The solution I propose going lowercase and xparse, saves a lot of typing if you typing notes for LaTeX.
    – yannisl
    Feb 13, 2019 at 16:45
25

There is also the hologo package for typesetting TeX-related logos:

\hologo{LaTeX}
\Hologo{LaTeX}  % to be used at the beginning of a sentence (no difference in this case)

While the syntax is a bit more verbose, it has the advantages that you don't have to think about trailing spaces and that it works correctly inside PDF bookmarks.

19

Use the following

% !TEX encoding = UTF-8 Unicode
\documentclass[UTF8]{article}
\begin{document}

\LaTeX

\end{document}

you will get

latex logo

Notice that there are three capital letters in the command.

5
  • 2
    I am afraid I can not agree. This way is simpler than others, no packages required, no special commands. I am here just to help. Also, every time I have a problem, I will come to Stack Exchange for help, if I did not find what I want, I will search other resources. This is why I posted this, I would like to share the idea that works for me from other places to the community.
    – zyy
    Mar 9, 2016 at 17:02
  • 2
    But it's exactly the same answer as is given in the first one except that the first one then goes on to show you how to correct the problems you will have if you write \LaTeX is good. Have you tried that? You will find that there will be no space between the LaTeX logo and is
    – Au101
    Mar 9, 2016 at 17:06
  • 2
    Sorry, I completely overlooked that. I thought he was talking about something else. Sorry for that.
    – zyy
    Mar 13, 2016 at 4:11
  • That's alright, don't worry, you're more than welcome to participate and, yeah, sharing something that works that isn't covered by other solutions is exactly what we're for. Okay, you overlooked something this time, it's alright, it happens. Don't beat yourself up. But, absolutely, it's important to try not to duplicate answers and this is all the more true on a really old finished question. Stackexchange allows us to always go back to old questions when we need to because things may change. Adding a new answer to an old question is fine. But adding nothing to an old Q is a problem
    – Au101
    Mar 13, 2016 at 4:23
  • 3
    This answer has a nice illustration that helps viewers understand the kind of symbol they'll be getting. I often search by keyword + image and thus this answer gets picked up where others do not. Worth a vote from me. :-)
    – PatrickT
    Jun 27, 2020 at 6:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .