I am using the following tikz-based command to create a circle around a letter.

        \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] (char)

It works fine, but whenever I use multiple letters in the same line, they are not aligned.

circle not aligned

I guess it has something to do with the baseline, like the circle is created in reference to the center of mass. Notice that b and d are a bit higher than a and c. How could I fix that?


Following the advice I got from the comments (thank you all), I got the circles aligned to each other (which is what I wanted), but unfortunately not to the text:


I saw the other post proposing this propnode (the pink a), and I tried to shift it all over the place using the first argument, but it had no effect.

\pgfmathsetmacro{\nodebasesize}{1} % A node with a value of one will have this diameter
\newcommand{\propnode}[5]{% position, name, options, value, label
    \node[#3,minimum width=\minimalwidth*1cm,inner sep=\nodeinnersep*1cm,circle,draw] (#2) at (#1) {#5};

In fact, propnode is a bit too high and circled is a bit too low. This is the code which calls everything:

  • Related: tex.stackexchange.com/q/7032/2552 – Jake May 3 '15 at 16:52
  • 1
    Change char.base to char.center. However note that in this case, the circles will be aligned but not the letters. Both is impossible (unless you make the circle bigger), because letters have different shapes unlike numbers (see the link Jake suggested). – Alenanno May 3 '15 at 17:02
  • 1
    They're aligned. But you need a strut to set the height and depth for each circle. That'll mean that the circles for a and c will be a bit bigger, which might not be desirable. – A.Ellett May 3 '15 at 17:40

Here's an example using a strut:

        \node[shape=circle,draw,minimum size=4mm, inner sep=0pt] (char)


\foreach \myn [count=\myc] in {a,b,c,d,e,p,q}


enter image description here

| improve this answer | |

This is using an averaging algorithm:

        \node[shape=circle,draw,minimum size=\myheight*\myheight*.4,inner sep=1pt](char){#1};}}}

One can make it smoother depending how many squaring calculations one wants to do.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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