# create latex symbol from vector graphics

I have a logo in vector format (Adobe Illustrator) that I would like to use in my LaTeX documents. How do I create a latex symbol such that I can include this logo inline with the text, similarly to the symbol \LaTeX for example:

UPDATE

My logo contains a 'y' character and the solution outlined works but the baselines do not match (as the logo baseline is the bottom of 'y'). So I fixed it this way:

\usepackage{scalerel}
\def\mylogo{\kern0em\raise-.1667em\hbox{\scalerel*{\includegraphics{mylogo.pdf}}{X}}}


UPDATE 2

An update on the answer seems to be a better way of accomplishing this.

• Metapost? Or include the symbol as a graphic. – user31729 Jan 22 '15 at 12:01

See UPDATE below, for graphics with descenders.

Here, \scalerel* scales the image to take the same vertical footprint as a capital letter "X". That also means the logo will automatically scale with font size. EDITED to make the process a macro (thanks to Maarten).

\documentclass{article}
\usepackage{scalerel}
\def\mylogo{\scalerel*{\includegraphics{ARL_Logo_March2012_BlackGold}}{X}}
\begin{document}
Can I insert my \mylogo{} inline?

\tiny Can I insert my \mylogo{} inline?
\end{document}


Because the original was a vector image stored in PDF, it zooms without loss of resolution:

UPDATE:

If the original graphic has descenders, one has two options.

One can vertically shift (with a \raisebox) the \includegraphics to match the natural baseline of the graphic with the LaTeX baseline and then "fool" \scalerel* but turning off the depth of shifted graphic:

\documentclass{article}
\fboxsep=-\fboxrule
\usepackage{scalerel}
\def\theirlogo{\scalerel*{%
\begin{document}
Can I insert my \theirlogo{} inline?

\tiny Can I insert my \theirlogo{} inline?
\end{document}


Alternately (and perhaps more efficiently), one could leave the \includegraphics unaltered and add a appropriately sized negative rule (in scalable units) to the second argument of the \scalerel*.

\documentclass{article}
\fboxsep=-\fboxrule
\usepackage{scalerel}
\begin{document}
Can I insert my \theirlogo{} inline?

\tiny Can I insert my \theirlogo{} inline?
\end{document}

• Using this solution you could easily create your Latex symbol (command) by putting \newcommand{\mylogo}{\scalerel*{\includegraphics{ARL_Logo_March2012_BlackGold}}{X}\ } in the preamble. Now you can use the command \mylogo wherever you want inside your document. – Maarten Dhondt Jan 22 '15 at 12:13
• @MaartenDhondt Yes, that would be recommended. I shall revise my MWE to reflect that. – Steven B. Segletes Jan 22 '15 at 12:14
• Yes @StevenB.Segletes, do it so that your answer is complete. – aaragon Jan 22 '15 at 15:01
• @aaragon See tex.stackexchange.com/questions/31091/…, for example, for more discussion of this issue. And lest you think xspace is an alternative, see this: tex.stackexchange.com/questions/86565/drawbacks-of-xspace. – Steven B. Segletes Jan 22 '15 at 15:09
• My logo has a 'y' letter in it, so the baseline of the characters do not align (it's as if the bottom of the 'character' is the baseline for the logo). Is there a way to get around this? – aaragon Feb 6 '15 at 10:16

Why do not use

\def\mylogo{{\includegraphics[height=1.4ex]{ARL_Logo_March2012_BlackGold}}}
\begin{document}
Can I insert my \mylogo{} inline?


ex is the height of the "x" character, and changes with the font size.