Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am starting to write my chemistry lab reports out in LaTeX, but keep getting stuck on the "ICE" tables (see the LaTeX example below).

I can't figure out how to get the + and \rightleftharpoons in the heading to go in between the columns. They should be in the middle between the columns (almost over the &).

    \begin{tabular}[c|ccc]
    \hline
    X   &   $[H^+]$ $+$ & $[OH^-]$  $\leftrightharpoons$ & $[H_2O]$ \\
    \hline
    I   &       x.xx    &   x.xx                         &  x.xx    \\
    C   &       x.xx    &   x.xx                         &  x.xx    \\
    E   &       x.xx    &   x.xx                         &  x.xx    \\
    \hline
    \end{tabular}

I tried to find a photo example, but there didn't seem to be any on Google Images. Seems like I'm not the only one who hasn't figured out a good way to do this.

share|improve this question
2  
Welcome to TeX.sx!. You should always post minimal working example (MWE). –  hpesoj626 Mar 11 '13 at 3:05
add comment

1 Answer

up vote 3 down vote accepted

Firstly, the column specification of tabular requires to be supplied using {..}, not [..]. Secondly, this might be what you're after: inserting a @{}c@{} column to contain the operator. The @{} removes the tabular separation on either side of the c-column.

enter image description here

\documentclass{article}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\begin{document}
\begin{tabular}{c|c@{}c@{}c@{}c@{}c}
  \hline
  X   &   $[H^+]$ & ${}+{}$ & $[OH^-]$ & ${}\leftrightharpoons{}$ & $[H_2O]$ \\
  \hline
  I   &       x.xx    &&   x.xx                         &&  x.xx    \\
  C   &       x.xx    &&   x.xx                         &&  x.xx    \\
  E   &       x.xx    &&   x.xx                         &&  x.xx    \\
  \hline
\end{tabular}
\end{document}

Using additional braces (empty groups) around the operators allows for proper spacing.

Finally, consider using the booktabs package for a prettier layout of your tables. Here's a take on it:

enter image description here

\documentclass{article}
\usepackage{fixltx2e,booktabs,amssymb}% http://ctan.org/pkg/{booktabs,amssymb}
\begin{document}
\begin{tabular}{cc@{}c@{}c@{}c@{}c}
  \toprule
  X   &   [H\textsuperscript{+}] & ${}+{}$ & [OH$^-$] & ${}\leftrightharpoons{}$ & [H\textsubscript{2}O] \\
  \midrule
  I   &       x.xx    &&   x.xx                         &&  x.xx    \\
  C   &       x.xx    &&   x.xx                         &&  x.xx    \\
  E   &       x.xx    &&   x.xx                         &&  x.xx    \\
  \bottomrule
\end{tabular}
\end{document}
share|improve this answer
    
I would suggest the use of the mhchem package to typeset chemical compounds (using e.g. \ce{OH-}) –  Lionel MANSUY Mar 11 '13 at 8:18
    
Thank you, solves my problem. –  Michael Molter Mar 11 '13 at 21:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.