Fwd: center the content (text!) of a box

View: New views
3 Messages — Rating Filter:   Alert me  

Fwd: center the content (text!) of a box

by Christoph Bartoschek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Maybe you can draw the box around the picture:

\begin{tikzpicture}[remember picture,overlay]
  \node (text) at (0, 0) {$\left(\tikz[remember picture] \node[inner sep=0]
(c) {$\cdot$};\right)^2$};
  \draw (c.center) ++(-0.5, -0.5) rectangle ++(1, 1);
  \draw [red](c.center)  circle (1pt);
\end{tikzpicture}

center the content (text!) of a box

Hi,

I'd like to center (horizontally and vertically) the content of the box
in the following example with respect to the parentheses.  This means
that the exponent should be ignored.  I tried to achieve this with some
\vphantom-commands (as I usually do outside of pgf/tikz) but irritatingly
with no effect.  What do I have to do?

\documentclass[12pt]{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
 \draw (-0.5,-0.5) rectangle (0.5,0.5);
 \path (0,0) node {$\vphantom{_2}\left(\cdot\right)^2\vphantom{_2}$};
\end{tikzpicture}
\end{document}

Regards,

Juergen


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Fwd: center the content (text!) of a box

by Christoph Bartoschek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Dienstag, 1. Juli 2008 schrieb Christoph Bartoschek:
> Maybe you can draw the box around the picture:
>
> \begin{tikzpicture}[remember picture,overlay]
>   \node (text) at (0, 0) {$\left(\tikz[remember picture] \node[inner sep=0]
> (c) {$\cdot$};\right)^2$};
>   \draw (c.center) ++(-0.5, -0.5) rectangle ++(1, 1);
>   \draw [red](c.center)  circle (1pt);
> \end{tikzpicture}

\begin{tikzpicture}[remember picture,overlay]
  \node (text) at (0, 0) {$\tikz[remember picture] \node[inner sep=0] (c)
{$\left(\cdot\right)$};^2$};
  \draw (c.center) ++(-0.5, -0.5) rectangle ++(1, 1);
  \draw [red](c.center)  circle (1pt);
\end{tikzpicture}

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Fwd: center the content (text!) of a box

by Goebel, Juergen, OPES27 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Christoph Bartoschek wrote:

> Maybe you can draw the box around the picture:
>
> \begin{tikzpicture}[remember picture,overlay]
>   \node (text) at (0, 0) {$\left(\tikz[remember picture]
> \node[inner sep=0]
> (c) {$\cdot$};\right)^2$};
>   \draw (c.center) ++(-0.5, -0.5) rectangle ++(1, 1);
>   \draw [red](c.center)  circle (1pt);
> \end{tikzpicture}

Interesting, but I will prefer Marks approach.
Thanks for your suggestion.

Best,

Juergen

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users