0

I am typesetting some fraction introduction and have the following as a cell within a longtable:

   $\vcenter{
       \begin{tikzpicture}[scale=0.5, .style={fontsize=\footnotesize}]
            \filldraw[fill=black!10!white, draw=black!70!white]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
            \filldraw[fill=white, draw=black!70!white, rotate=120]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
            \filldraw[fill=white, draw=black!70!white, rotate=240]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
        \end{tikzpicture}
        +
        \begin{tikzpicture}[scale=0.5, .style={fontsize=\footnotesize}]
            \filldraw[fill=white, draw=black!70!white]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
            \filldraw[fill=black!10!white, draw=black!70!white, rotate=120]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
            \filldraw[fill=black!10!white, draw=black!70!white, rotate=240]
               (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
        \end{tikzpicture}
        =
        \begin{tikzpicture}[scale=0.5, .style={fontsize=\footnotesize}]
            \filldraw[fill=black!10!white, draw=black!70!white]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
            \filldraw[fill=black!10!white, draw=black!70!white, rotate=120]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
            \filldraw[fill=black!10!white, draw=black!70!white, rotate=240]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
        \end{tikzpicture}
        }$

I hoped that the "+" and "=" would be vertically centered relative to (with) the TikZ-Pictures. They are not and I do not get why.

  • 1
    You're after the baseline key for the tikzpictures, try something like \begin{tikzpicture}[baseline=-1mm, .... See also https://tex.stackexchange.com/questions/75194/align-an-equation-and-a-tikz-picture-with-anchor-and-baseline/75199#75199 – Torbjørn T. Sep 10 '17 at 17:28
  • 1
    also don't you want the expression to be in math mode so + and = get math spacing and font? the content of \vcenter is not in math mode. – David Carlisle Sep 10 '17 at 17:44

1 Answers1

1

Since you're using TikZ, you can use a \matrix:

\documentclass{article}
\usepackage{longtable}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{longtable}{m{5cm}m{5cm}}
\begin{tikzpicture}
  \matrix { 
    \filldraw[fill=black!10!white, draw=black!70!white,scale=0.5]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
      \filldraw[fill=white, draw=black!70!white, rotate=120,scale=0.5]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
      \filldraw[fill=white, draw=black!70!white, rotate=240,scale=0.5]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle; &
    \node {$+$}; &
    \filldraw[fill=white, draw=black!70!white,scale=0.5]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
      \filldraw[fill=black!10!white, draw=black!70!white, rotate=120,scale=0.5]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
      \filldraw[fill=black!10!white, draw=black!70!white, rotate=240,scale=0.5]
               (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle; &
    \node {$=$}; &
    \filldraw[fill=black!10!white, draw=black!70!white,scale=0.5]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
      \filldraw[fill=black!10!white, draw=black!70!white, rotate=120,scale=0.5]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle;
      \filldraw[fill=black!10!white, draw=black!70!white, rotate=240,scale=0.5]
                (0,0) -- (7.5mm, 0) arc (0:120:7.5mm) -- cycle; \\
    };  
  \end{tikzpicture} & Another cell
\end{longtable}
\end{document}

enter image description here

CarLaTeX
  • 62,716