Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

as image

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

doesn't get desired thing.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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

share|improve this answer
    
@Herbert: Thanks. However, when the \infty symbol is replaced by \centerdot, the dot doesn't align with digit eight yet. –  dearmath May 16 '11 at 10:22
    
@dearmath: sure, it does! –  Herbert May 16 '11 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 '11 at 10:59
    
@dearmath: the bounding box is wrong. Use package MnSymbol instead of amssymb, or redefine \centerdot with the definition of MnSymbol –  Herbert May 16 '11 at 11:03
    
@Herbert: Thanks a lot. –  dearmath May 16 '11 at 11:10

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.