4

I'm making a report and I've been asked to do something which I have no idea is even possible or not. I have this table:

\begin{table}
\begin{center}
\caption{Cryostat-In Pin Outs and Resistances}
\label{cryoin}
\begin{tabular}{ccc}
\hline
\aline
~ Pin & Device & Resistance \\
\hline
\hline
A & Thermometer & NA\\
B & Thermometer & NA\\
C & Detector & 24.3$\Omega$\\
D & Detector & 25.3$\Omega$\\
E & Detector & 24.4$\Omega$\\
F & Detector & 25.3$\Omega$\\
G & Resistor & 25.6$\Omega$\\
H & Resistor & 25.6$\Omega$\\
J & Resistor & 25.6$\Omega$\\
K & Resistor & 25.6$\Omega$\\
\hline
\end{tabular}
\end{center}
\end{table}

However, I am attempting to show which pins are connected together by a pair of wires, via putting a "[" symbol or something similar between two rows (e.g. between C and D) to the left of the table/letters themselves, such that the ends of the symbol are pointing to both the letters (and the symbol isn't simply suspended between them).

In case my description is unclear, I basically wanted to do this (sorry for the blur):

enter image description here

David Carlisle
  • 757,742

2 Answers2

7

enter image description here

You can just use a [ but hide its width and depth.

PS Please always post complete documents (then you'd have noticed the undefined command in the question)

\documentclass{article}
\usepackage{color}
\begin{document}
\begin{table}
\centering
\caption{Cryostat-In Pin Outs and Resistances}
\label{cryoin}
\begin{tabular}{ccc}
\hline
\hline
~ Pin & Device & Resistance \\
\hline
\hline
A & Thermometer & NA\\
B & Thermometer & NA\\
\raisebox{-.7em}[0pt][0pt]{\llap{\textcolor{red}{\Large[}}}%
C & Detector & 24.3$\Omega$\\
D & Detector & 25.3$\Omega$\\
\raisebox{-.7em}[0pt][0pt]{\llap{\textcolor{red}{\Large[}}}%
E & Detector & 24.4$\Omega$\\
F & Detector & 25.3$\Omega$\\
G & Resistor & 25.6$\Omega$\\
H & Resistor & 25.6$\Omega$\\
J & Resistor & 25.6$\Omega$\\
K & Resistor & 25.6$\Omega$\\
\hline
\end{tabular}

\end{table}

\end{document}
David Carlisle
  • 757,742
  • Oh wow, thanks to you as well. This does precisely what I need it to do, but I'll also have a look at/attempt to learn the other method. Cheers! :) – samanthapants Jul 04 '13 at 14:56
  • @MarcoDaniel What's TikZ? – David Carlisle Jul 04 '13 at 14:57
  • http://texample.net/tikz/examples/ - the most complex and powerful drawing tool in the TeXer's toolbox. But complete overkill for the situation described here. –  Jul 04 '13 at 15:31
4

Actually I'll post a solution using booktabs as I said in my comment above.

\documentclass{article}
\usepackage{booktabs}
\usepackage{multirow}
\begin{document}
\begin{table}
\centering
\caption{Cryostat-In Pin Outs and Resistances}
\label{cryoin}
\begin{tabular}{r@{\hspace{0.5ex}}lcc}
\toprule
& Pin & Device & Resistance \\
\midrule
& A & Thermometer & NA\\
& B & Thermometer & NA\\
\multirow{2}{*}{\big [} & C & Detector & 24.3$\Omega$\\
& D & Detector & 25.3$\Omega$\\
\multirow{2}{*}{\big [} & E & Detector & 24.4$\Omega$\\
& F & Detector & 25.3$\Omega$\\
& G & Resistor & 25.6$\Omega$\\
& H & Resistor & 25.6$\Omega$\\
& J & Resistor & 25.6$\Omega$\\
& K & Resistor & 25.6$\Omega$\\
\bottomrule
\end{tabular}

\end{table}

\end{document}

The @{\hspace{0.5ex}} overrides the default space between the new first column and the pins: if you really want the pins column centered, you can make this space zero or even negative to get the braces closer to the pin names. The extra space before and after the headings (and the lack of double rules) improves the table IMHO though you can also use the multirow part of my solution without making that change.

ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149