1

as image

\newlength{\abc}
\settoheight{\abc}{$\infty$}
\raisebox{.5\abc}{\infty}8

doesn't get desired thing.

2 Answers 2

4

can be used as \Infty{123} or \Infty8

\documentclass{article}
\newsavebox\MBoxA
\newsavebox\MBoxB
\def\Infty#1{%
  \sbox\MBoxA{$\infty$}\sbox\MBoxB{$#1$}%
  \raisebox{\dimexpr(\ht\MBoxB-\ht\MBoxA)/2\relax}{$\infty$}#1}
\begin{document}

\Huge$\Rightarrow\infty8$

     $\Rightarrow\Infty8$
\end{document}

enter image description here

5
  • @Herbert: Thanks. However, when the \infty symbol is replaced by \centerdot, the dot doesn't align with digit eight yet.
    – dearmath
    May 16, 2011 at 10:22
  • @dearmath: sure, it does!
    – user2478
    May 16, 2011 at 10:41
  • @Herbert: \documentclass{article} \usepackage{amssymb} \newsavebox\MBoxA \newsavebox\MBoxB \def\CDot#1{\sbox\MBoxA{$\centerdot$}\sbox\MBoxB{$#1$} \raisebox{\dimexpr(\ht\MBoxB-\ht\MBoxA)/2\relax}{$\centerdot$}#1} \begin{document} \Huge$\CDot8$ \end{document} image could see link
    – dearmath
    May 16, 2011 at 10:59
  • @dearmath: the bounding box is wrong. Use package MnSymbol instead of amssymb, or redefine \centerdot with the definition of MnSymbol
    – user2478
    May 16, 2011 at 11:03
  • \raisebox already provides the height of its content as \height, so the use of \MBoxA isn't needed. May 16, 2011 at 12:32
5

You can measure the height of a figure eight:

\newcommand{\hinfty}{%
  {\sbox0{$8$}\raisebox{\dimexpr(\ht0-\height)/2\relax}{$\infty$}}}

I get the same result, by trial and error, with

\newcommand{\hinfty}{\raisebox{.2484\height}{$\infty$}}

This assumes, as usual, that \mathsurround is zero; a safer definition would be

\makeatletter
\newcommand{\hinfty}{\raisebox{.2484\height}{$\m@th\infty$}}
\makeatother

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .