[Tex/LaTex] create latex symbol from vector graphics

graphicssymbols

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:

enter image description here

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.

Best Answer

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}

enter image description here

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

enter image description here

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*{%
  \setbox0=\hbox{\raisebox{-52pt}{\includegraphics{GoogleLogo}}}\dp0=0pt\box0}{X}}
\begin{document}
Can I insert my \theirlogo{} inline?

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

enter image description here

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}
\def\theirlogo{\scalerel*{\includegraphics{GoogleLogo}}{X\rule[-.6ex]{0pt}{1pt}}}
\begin{document}
Can I insert my \theirlogo{} inline?

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