Text Formattingtikzpicture alignment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Adrien
Posts: 5
Joined: Wed Jun 23, 2010 8:59 pm

tikzpicture alignment

Post by Adrien »

Hi,

I have a pb of alignement for tikzpicture figure.
I draw two orange fill circles, one empty and one with "1".
But the second one is miss-aligned to the text.
Below, a minimum example.

Code: Select all

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
word
\begin{tikzpicture}%
   \fill[orange] (0,0) circle (1ex);%
\end{tikzpicture}
word
\begin{tikzpicture}%
   \fill[orange] (0,0) circle (1ex);%
   \node at (0,0) {1};%
\end{tikzpicture}
word
\end{document}
Thanks for your advices,
Adrien

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

torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

tikzpicture alignment

Post by torbjorn t. »

A possible solution is to make the circle part of the node.

Code: Select all

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
word
\begin{tikzpicture}%
   \fill[orange] (0,0) circle (1ex);%
\end{tikzpicture}
word
\begin{tikzpicture}%
   \node[baseline,draw=none,circle,fill=orange,inner sep=0pt] at (0,0) {1};%
\end{tikzpicture}
word
\end{document}
Post Reply