2

I'm not an expert in LaTeX, and just want to ask. How can we build the following table in LaTeX?

enter image description here

Thanks.

Simplicity
  • 1,305

1 Answers1

8

Some pointers:

  • Since most the cells should be in math mode rather than text mode, use an array rather than a tabular environment.

  • Use text-mode bold italics, when needed, because the letters and numbers should be spaced tightly. Don't use math-mode bold italics in this setting even if that font combination is available.

  • For frequently occurring instructions (to set material in text-mode bold italics, say), create shortcut macros as needed.

  • Use \multirow (from the multirow package) to place a cell's contents halfway across two rows.

  • Use commands such as \midrule (from the booktabs package) to get well-spaced horizontal lines. (If for some reason you don't want to create well-spaced lines, use \hline instead...) Try hard not to use any vertical lines.

  • The example below loads the newtxtext and newtxmath font packages because the screen shot you provided appears to use the Times (New) Roman font family. If you're content using another font, don't load these two packages.

enter image description here

\documentclass{article}
\usepackage{booktabs} % for \midrule macro
\usepackage{multirow} % for \multirow macro
\usepackage{newtxtext,newtxmath} % Times Roman fonts
\newcommand\xx[1]{\textbf{\textit{#1}}}% shortcut macro
\begin{document}
$\begin{array}{*{4}{c}}
\xx{A} & \xx{I1} & \xx{I2} & \xx{I3} \\
\midrule
\multirow{2}{*}{$\xx{s}$} & -0.056 & -0.117 & 0.000  \\
                          & \pm0.09& \pm0.12& \pm0.00\\[1ex]
\multirow{2}{*}{$\xx{c}$} &    1066 &    1255 &    1099\\
                          & \pm1087 & \pm1189 & \pm1113\\
\midrule
\xx{o} & \xx{2} & \xx{2} & \xx{4}\\
\end{array}$
\end{document}
Mico
  • 506,678
  • 1
    .. and the vertical rule ;-) ? –  May 17 '14 at 20:25
  • 1
    @jfbu - I deliberately did not produce a vertical rule. :-) If the OP really wants it, he/she should use \hline instead of \midrule... – Mico May 17 '14 at 20:32