3

I would like to align horizontally the two resized circles in the superscript in the following example:

\documentclass{article}
\usepackage{relsize}

\begin{document}
$A^{  \mathlarger{\circ}\mathsmaller{\circ} } $  
\end{document}

A related question has been asked here, but it does not seem to give the solution for this specific issue.

James
  • 183
  • 3

2 Answers2

3

Like this?

\documentclass{article}
\usepackage{relsize}
\usepackage{amsmath}

\begin{document}

$A^{\substack{ \mathlarger{\circ}\\[-0.75ex]\mathsmaller{\circ}}} $

\end{document} 

enter image description here

Edit:

For an alignment of the symbols on the same axis, you can use this code:

$A^{\raisebox{\height}{\raisebox{-0.5\height}{$ \mathlarger{\circ} $}\raisebox{-0.5\height}{$ \mathsmaller{\circ} $}}} $

enter image description here

Edit: On the suggestion of @Campa, the \vcenter TeX primitive results is a simpler code for the horizontal alignment:

$ A^{\vcenter{\hbox{$\mathlarger{\circ}$}}\vcenter{\hbox{$\mathsmaller{\circ}$}}} $
Bernard
  • 271,350
2

I'd define a special \xcirc command:

\documentclass{article}
\usepackage{relsize}

\makeatletter
\newcommand{\xcirc}[1][]{%
  % ensure it's used in math and consider it as an Ord atom
  % \mathpalette will remember the current math style
  \mathord{\mathpalette{\james@xcirc}{#1}}%
}
\newcommand{\james@xcirc}[2]{%
  % center vertically with respect to the math axis
  \vcenter{\hbox{$\m@th#1\@nameuse{james@#2@size}{\circ}$}}%
}
\let\james@@size\@firstofone
\let\james@l@size\mathlarger
\let\james@s@size\mathsmaller
\makeatother

\begin{document}

$A^{\xcirc[l]\xcirc[s]}$

$\scriptstyle A^{\xcirc[l]\xcirc[s]}$

{\Large $A^{\xcirc[l]\xcirc[s]}$\par}

\end{document}

enter image description here

In order to ease input, the optional argument to \xcirc is just a letter (l for “larger”, s for “smaller”) and I define \james@<arg>@size for translating it into the correct call of \mathlarger or \mathsmaller (no optional argument will use the standard size, like {\circ}).

You might want to allow \xcirc[ll] by adding

\newcommand{\james@ll@size}[1]{%
  \mathlarger{\mathlarger{#1}}%
}

so you apply \mathlarger twice. Similarly for \xcirc[ss].

egreg
  • 1,121,712
  • @Bernard, I could not get the ll size to work, see this minimal working example https://ufile.io/ilk24 . May you please help me with this? Thank you. – James Apr 11 '18 at 16:08