我正在尝试获取这个“标志”
目前我使用以下命令
\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%
}
但当我将字体大小更改为“\TeX”或“\LaTeX”时,它就不合适了。我试图修改此代码,但找不到必要的更改
\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
和这个(修改)
答案1
以下是创建可随字体大小拉伸的内容的尝试:
\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}
在上面的 MWE 中,将 MaTeX 的\cMaTeX
一个\normalsize
版本存储在一个框中,并根据当前字体的高度调整框的大小。调整大小M
(同时保持纵横比)是使用\resizebox{!}{<height>}{<stuff>}
graphicx
包裹。
答案2
这似乎在所有尺寸上都相当有效
\documentclass{article}
\usepackage{relsize}
\makeatletter
\def\matex@ssize{\larger[-2]\scshape}
\DeclareRobustCommand{\MaTeX}{%
\mbox{%
M\kern-0.1em
\raisebox{0.18ex}{\matex@ssize a}\kern-0.27em
T\kern-0.27em
\raisebox{0.18ex}{\matex@ssize e}\kern-0.1em
X%
}%
}
\makeatother
\begin{document}
\MaTeX
\large\MaTeX
\Large\MaTeX
\LARGE\MaTeX
\huge\MaTeX
\Huge\MaTeX
\end{document}
不要使用ex
进行水平测量,而要使用em
。我使用\kern
代替\hspace
,只是出于个人喜好。
答案3
\documentclass{article}
\usepackage{graphicx}
\DeclareRobustCommand\MaTeX{%
M\kern-.09em%
\makebox[0pt][l]{\raisebox{0.075em}{\scalebox{0.5}{A}}\kern-.25em T%
\kern-.25em%
\makebox[0pt][l]{\raisebox{0.075em}{\scalebox{0.5}{E}}\kern-.08em X}}}
\begin{document}
\MaTeX
\huge\MaTeX
\tiny\MaTeX
\end{document}