Graphics, Figures & TablesText around a Circle

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
giulius777
Posts: 1
Joined: Thu May 30, 2013 6:46 am

Text around a Circle

Post by giulius777 »

Hi everybody, I need a little help from you on the following piece of code.

Code: Select all

\documentclass[a4paper]{article}
\usepackage[margin=1cm]{geometry}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{pstricks}
\usepackage{pst-all}

\begin{document}
  \begin{pspicture}(-3,-1)(3,5)
    \psset{linecolor=Blue}
    \pscircle{2}
    \psset{linestyle=none,xunit=1cm,yunit=1.07cm}
    \pstextpath[c]{\pscircle{2}}{\color{Red} 25\% OFP 12345678}
  \end{pspicture}
\end{document}
Basically what I want is a circle with the text around it, on top center and outside the circumference. I tried in different ways, but I am finally stuck! :cry:

Thanks,
G.
;)
Last edited by localghost on Thu May 30, 2013 9:55 am, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am

Text around a Circle

Post by tom »

Hi!

Here is some pgf code to draw a circle with text centred at the top.

HTH, Tom

Code: Select all

\documentclass[tikz, border=20pt]{standalone}
\usetikzlibrary{decorations, decorations.text,}

\begin{document}
\begin{tikzpicture}
\draw[color=blue, rotate=-90, postaction={decorate, decoration={text along path, raise=4pt, text align={align=center}, text={This is some random text}, reverse path}}] (0,0) circle (2cm);
\end{tikzpicture}

\end{document}
Post Reply