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.
3 Answers
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.
-
8or simply
\makeatletter\g@addto@macro{\TeX}{\xspace}\makeatother
for both– user2478Dec 22, 2010 at 6:33 -
5Or
\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. Jan 29, 2014 at 2:36 -
5You 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. Aug 5, 2016 at 7:32
-
2@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 theempty
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. Feb 13, 2019 at 16:45
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.
Use the following
% !TEX encoding = UTF-8 Unicode
\documentclass[UTF8]{article}
\begin{document}
\LaTeX
\end{document}
you will get
Notice that there are three capital letters in the command.
-
2I 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.– zyyMar 9, 2016 at 17:02
-
2But 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– Au101Mar 9, 2016 at 17:06 -
2Sorry, I completely overlooked that. I thought he was talking about something else. Sorry for that.– zyyMar 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– Au101Mar 13, 2016 at 4:23
-
3This 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. :-)– PatrickTJun 27, 2020 at 6:41
\LaTeX
?