1

I'm trying to get my text "HubsSpokes" to center at the top of a circular path.

\path [postaction={decorate,decoration={text along path,text align=center,text={|\huge|HubsSpokes}}}] ($(current page text area.west)+(0,.25in)$,0) circle (1.4cm);

However, my text is not appearing at the top of the circle, it is appearing on the left side of the circle and extending off the page. Ideally, I'd like it to be centered on my page. I am not wanting the circle itself to be drawn. Should I be using an arc instead?

What can I do to position my text at the top of the circular path?

2
  • why not try current page.west
    – js bibra
    Commented Feb 17, 2020 at 6:37
  • 2
    Please give a fully compilable code.
    – AndréC
    Commented Feb 17, 2020 at 8:07

1 Answer 1

4

I think you want this. It's made with arc command because this way you can control path starting and ending points and it's center. With a circle the path's center could be any position.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc, decorations.text}
\usepackage{tikzpagenodes}
\begin{document}
\begin{tikzpicture}
\path [postaction={decorate,decoration={text along path,text align=center,text={|\huge|HubsSpokes}}}] ($(current page text area.west)+(0,.25in)$,0) arc(180:0:1.4cm);
\end{tikzpicture}
\end{document}

enter image description here

2
  • Works great! But, how would I center this on the page (i.e. between text area.west and text area.east)? I have tried setting current page text area.center but that sets the starting point of the arc, not the middle point of the arc.
    – kojow7
    Commented Feb 18, 2020 at 3:36
  • 1
    @kojow7 In my example ($(current page text area.west)+(0,.25in)$,0) places the pencil and from this point the arc is drawn. arc(180:0:1.4cm) means that on this point will start an arc with 1.4cm radius with angle 180 to 0. Therefore the center is 1.4cm to the right of ($(current page text area.west)+(0,.25in)$,0). In your case start from current page text area.center+(-radius,0). As an alternative to calc you could say ([xshift=-radius]current page text area.center) where radius is your desired value.
    – Ignasi
    Commented Feb 18, 2020 at 9:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .