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'm trying to draw a clockwise circle arrow with a symbol inside. My current solution requires manual alignment of the content, and as such doesn't look very good.

\makebox[0pt][l]{\huge$\circlearrowright$}\ $i_3$ }

circle arrow with content

Is there a solution which doesn't require manual correction? If not, is there a method to have more fine-grained control over the horizontal alignment, and any control at all over the vertical?

share|improve this question

3 Answers 3

up vote 6 down vote accepted

Here is slightly automated solution using tikz. I measure the height and width of the text and place an arc whose size is based on the maximum of that. Am sure this can be improved, but this should get you started:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{calc}

\makeatletter
\newlength\@SizeOfCirc%
\newcommand{\CricArrowRight}[1]{%
    \setlength{\@SizeOfCirc}{\maxof{\widthof{#1}}{\heightof{#1}}}%
    \tikz [x=1.0ex,y=1.0ex,line width=.15ex, draw=blue]%
        \draw [->,anchor=center]%
            node (0,0) {#1}%
            (0,1.2\@SizeOfCirc) arc (85:-240:1.2\@SizeOfCirc);%
}%
\makeatother

\begin{document}
\CricArrowRight{$i$}
\CricArrowRight{$i_3$}
\CricArrowRight{$\frac{a}{b}$}
\CricArrowRight{$\dfrac{a}{b}$}
\end{document}

I created a temporary length \@SizeOfCirc so as to minimize potential name conflicts, and need to use \maktatother. See What do \makeatletter and \makeatother do? for more info if you are not familiar with that.

share|improve this answer
    
Very flexible, and I learnt some TiKZ. Thanks! –  Tim N Sep 29 '11 at 3:15

This may be satisfying, if the symbol to put inside is not too big

\usepackage{relsize}
\newcommand\cca[1]{{%
  \ooalign{\raisebox{-.4ex}{\larger[4]$\circlearrowright$}\cr
    \hidewidth$\,#1$\hidewidth}}}

Then \cca{i_{3}} should do what you need.

Look at Subseteq+circ as a single symbol "open subset" for details about \ooalign.

share|improve this answer

Here is manual way of doing it that allows some freedom in terms of fine-tuning the vertical movement:

\documentclass{article}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\begin{document}
\setbox1=\hbox{\huge$\circlearrowright$}%
\setbox2=\hbox{$i_3$}%
\makebox[0pt][c]{\usebox1}% Place \circlearrowright
\makebox[0pt][c]{\raisebox{2.5pt}{$i_3$}}% Overlay label
\hspace{0.5\wd1} Here is some more text.
\end{document}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

Overlayed symbols

The zero-width \makeboxes have their contents centered [c]. Both elements are placed stored in a box (box1 and box2 respectively) so that you can use their widths (\wd1 and \wd2) or heights (\ht1 and \ht2) if needed.

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.