Macros – Creating a Custom LaTeX Logo

fontsizemacros

I'm trying to get this "logo"

My Logo, using hspace and raisebox

At the moment I use the following command

\mbox{%
  M\hspace{-0.25ex}%
  \raisebox{0.18ex}{\tiny A}\hspace{-0.65ex}%
  T\hspace{-0.65ex}%
  \raisebox{0.18ex}{\tiny E}\hspace{-0.4ex}%
  X%
}

But does not fit when I change the font size as '\TeX' or '\LaTeX'. I tried to modify this code, but I can not find the necessary changes

\makeatletter
\DeclareRobustCommand{\MaTeX}{%
  M\kern-.09em %
  {%
    \setbox0\hbox{T}%
    \vbox to\ht0{%
      \hbox{%
        \csname S@\f@size\endcsname
        \fontsize\sf@size\z@
        \math@fontsfalse\selectfont
        A%
      }%
      \vss
    }%
  }
  \kern-.40em
  \hbox{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125ex X}}
\makeatother

and this (modification)
Fake version

Best Answer

Here is an attempt at creating something that stretches with the font size:

enter image description here

\documentclass[10pt]{article}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\makeatletter
\DeclareRobustCommand{\aMaTeX}{%
  M\kern-.09em {\setbox0\hbox{T}%
    \vbox to\ht0{\hbox{%
      \csname S@\f@size\endcsname\fontsize\sf@size\z@ \math@fontsfalse\selectfont A}%
      \vss}%
    }\kern-.40em \hbox{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125ex X}}
\newcommand{\bMaTeX}{\mbox{%
  M\hspace{-0.25ex}%
  \raisebox{0.18ex}{\tiny A}\hspace{-0.65ex}%
  T\hspace{-0.65ex}%
  \raisebox{0.18ex}{\tiny E}\hspace{-0.4ex}%
  X%
}}
\newsavebox{\MaTeXbox}
\savebox{\MaTeXbox}{\normalsize%
    M\hspace{-0.25ex}%
    \raisebox{0.18ex}{\tiny A}\hspace{-0.65ex}%
    T\hspace{-0.65ex}%
    \raisebox{0.18ex}{\tiny E}\hspace{-0.4ex}%
    X%
  }%
\newcommand{\cMaTeX}{%
  \settoheight{\@tempdima}{M}%
  \resizebox{!}{\@tempdima}{\usebox{\MaTeXbox}}%
}

\makeatother

\begin{document}

\begin{tabular}{lllll}
  Original 1 & Original 2 & New & \verb|\TeX| & \verb|\LaTeX| \\
  \hline
  \footnotesize\aMaTeX & \footnotesize\bMaTeX & \footnotesize\cMaTeX & \footnotesize\TeX & \footnotesize\LaTeX \\
  \small\aMaTeX & \small\bMaTeX & \small\cMaTeX & \small\TeX & \small\LaTeX \\
  \aMaTeX & \bMaTeX & \cMaTeX & \TeX & \LaTeX \\
  \large\aMaTeX & \large\bMaTeX & \large\cMaTeX & \large\TeX & \large\LaTeX \\
  \Large\aMaTeX & \Large\bMaTeX & \Large\cMaTeX & \Large\TeX & \Large\LaTeX \\
  \LARGE\aMaTeX & \LARGE\bMaTeX & \LARGE\cMaTeX & \LARGE\TeX & \LARGE\LaTeX \\
  \Huge\aMaTeX & \Huge\bMaTeX & \Huge\cMaTeX & \Huge\TeX & \Huge\LaTeX
\end{tabular}
\end{document}

In the above MWE, \cMaTeX stores a \normalsize version of MaTeX in a box, and resizes the box based on the height of M in the prevailing font. Resizing (while maintaining aspect ratio) is done using \resizebox{!}{<height>}{<stuff>} from the graphicx package.