0

I know that there's a bunch of posts about vertical and horizontal centering in tables. I have a related issue which I can't figure out how to solve.

I'm trying to center the fourth column, but putting a fourth ">{\centering}" breaks the whole table. Unsure what's going on. Using sharelatex, mostly sure I'm loading the correct package (just 'array' right?).

Ideally, I wish that the pictures in the first column would also be vertically centered, which they aren't, also defeating the purpose of using column type 'm' in the first column.

Also ideally, I'd like to be able to have columns 2, 3, and 4 exist within a single aligned block, so that I could use & to align them to the greater than/less than signs.

Given:

\begin{table}[h]
\centering
\begin{tabular}{| >{\centering}m{75pt} | >{\centering $} m{65pt} <{$} |  >{\centering} m{20pt} |  m{65pt} |}
\hline
    \begin{tikzpicture} 
        \draw [gray] (0,0) circle (15pt);
        \filldraw [gray] (0,0) circle (1pt);
        \draw [gray] (37.5pt,0) circle (15pt);
        \filldraw [gray] (37.5pt,0) circle (1pt);
    \end{tikzpicture} & \underline{2r_c \text{sin} \left( ^{\pi} \!/ _{n_k} \right)} & $\geq$ & $2r_f + R_1 r_f$ \\ 
\hline
    \begin{tikzpicture} 
        \draw [gray] (0,0) circle (15pt);
        \filldraw [gray] (0,0) circle (1pt);
        \draw [gray] (30pt,0) circle (15pt);
        \filldraw [gray] (30pt,0) circle (1pt);
    \end{tikzpicture} & 2r_c \text{sin} \left( ^{\pi} \!/ _{n_k} \right) & $\leq$  & $2r_f+\underline{R_1 r_f}$ \\ 
\hline
    \begin{tikzpicture} 
        \draw [gray] (0,0) circle (15pt);
        \filldraw [gray] (0,0) circle (1pt);
        \draw [gray] (22.5pt,0) circle (15pt);
        \filldraw [gray] (22.5pt,0) circle (1pt);
    \end{tikzpicture} & 2r_c \text{sin} \left( ^{\pi} \!/ _{n_k} \right) & $<$  & $\underline{2r_f}+R_1 r_f$ \\
\hline
    \begin{tikzpicture} 
        \draw [gray] (0,0) circle (15pt);
        \filldraw [gray] (0,0) circle (1pt);
        \draw [gray] (11.25pt,0) circle (15pt);
        \filldraw [gray] (11.25pt,0) circle (1pt);
    \end{tikzpicture} & 2r_c \text{sin} \left( ^{\pi} \!/ _{n_k} \right) & $<$  & $\underline{2r_f}+R_1 r_f$ \\
\hline
\end{tabular}
\end{table}
Ronen
  • 37
  • 1
    Welcome to TeX.SE!. Please help us reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Cragfelt Dec 05 '17 at 02:40
  • Change the baseline of the tikzpictures e.g. (I think) baseline=(current bounding box.center). See the manual for details. I would test, but I'd have to complete your code first :(. – cfr Dec 05 '17 at 04:12
  • You need >{\centering\arraybackslash} for the last column. – egreg Dec 05 '17 at 06:58
  • Unrelated: it's \sin, not \text{sin}. – egreg Dec 05 '17 at 07:18
  • @cfr It does work (see first two cells on firts column https://i.stack.imgur.com/EmT4x.png) but vertical space is very stretched. I also used recent egreg's duplicate mark https://tex.stackexchange.com/questions/12703/how-to-create-fixed-width-table-columns-with-text-raggedright-centered-raggedlef – Cragfelt Dec 05 '17 at 09:09

0 Answers0