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.

I am trying to write a number in quaternary form and would ideally like to show this by having a four underneath the decimal point. I've searched around, but can't figure out how to do this so any help would be appreciated. What I'm looking for:

image

Update: Thank you very much, excellent solutions. I'm very grateful.

share|improve this question

2 Answers 2

up vote 13 down vote accepted

Here's a possibility:

\documentclass{article}
\newcommand{\basex}[3]{#2\separator{#1}#3}
\newcommand{\separator}[1]{%
  {\,\oalign{$\cdot$\cr\noalign{\kern-.3ex}%
    \hidewidth$\scriptscriptstyle#1$\hidewidth\cr}\,}}
\newcommand{\quaternary}[2]{\basex{4}{#1}{#2}}

\begin{document}
$\quaternary{0}{t_1}$

$\basex{12}{0}{t_1}$
\end{document}

The \basex command is generic, so you can use different bases; saying \quaternary{a}{b} is equivalent to saying \basex{4}{a}{b}.

enter image description here

Using "official" LaTeX commands would be possible, but in cases like this one lower level commands are more flexible.

share|improve this answer
    
nice! what if the base has more digits? might that not tend to spread the arguments farther apart than desirable? –  barbara beeton Apr 8 '13 at 12:23
    
\oalign and \noalign together must be worth +1 –  David Carlisle Apr 8 '13 at 12:26
    
@barbarabeeton I've added the needed \hidewidth commands; up to two digits show well, it seems. –  egreg Apr 8 '13 at 12:30

I would do it as

\documentclass{article}
\begin{document}
\( 0_{\dot 4}t_1 \)

\( 0_{\dot{12}}t_1 \)

\( 0_{\dot{123}}t_1 \)
\end{document}

One can also shift the dot to left or right, if needed (which I have not done here).

enter image description here

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.