89

I want to create a table like the picture below, and i wish to itemize the lamba_1 > lamba_2 > 0 using 'item style', which is the cell of each categories. Can someone help me?

enter image description here

Werner
  • 603,163
  • 7
    Here's a hint: Use a p{<len>}-style column, and then you can use \begin{itemize}...\end{itemize}. – Werner Dec 18 '13 at 07:25
  • Hi @Werner, u mean the \begin{tabular}[pos]{p{}} smth like this? – superhuman1314 Dec 19 '13 at 04:43
  • Yes. The proposed solution uses tabularx which calculates the width of the X-column itself, but is very similar to a p{<len>} (fixed-width, paragraph) column. – Werner Dec 19 '13 at 07:09
  • Ypur diagram would be so much easier to understand with some small and simple drawings like these: http://twt.mpei.ac.ru/TTHB/New-Chem-Kin/ChemKin/3-19.PNG – Benjamin McKay Jul 31 '17 at 12:15

4 Answers4

89

For simplicity, I don't think you need to itemize the list. The MWE below uses \tabitem to set a fake item, letting you create the table in the regular way (also making the code more readable):

enter image description here

\documentclass{article}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\newcommand{\tabitem}{~~\llap{\textbullet}~~}
\begin{document}

\begin{table}
  \centering
  \begin{tabular}{lll}
    \toprule
    \multicolumn{3}{c}{Classification of the criticel point $(0,0)$ of $x' = Ax, |\mathbf{A}| \not= 0$.} \\[.5\normalbaselineskip]
    Types & Type of Critical Point & Stability \\
    \midrule
    1.~Real unequal eigenvalues of same sign \\
    \tabitem $\lambda_1 > \lambda_2 > 0$ & Improper node/node & Unstable \\
    \tabitem $\lambda_1 < \lambda_2 < 0$ & Improper node/node & Asym.~stable \\[.5\normalbaselineskip]
    2.~Real unequal eigenvalues of opposite sign \\
    \tabitem $\lambda_2 < 0 > \lambda_1$ & Saddle point & Unstable \\[.5\normalbaselineskip]
    3.~Equal eigenvalues \\ Subtype 1: Two Independent vectors \\
    \tabitem $\lambda_1 = \lambda_2 > 0$ & Proper node & Unstable \\
    \tabitem $\lambda_1 = \lambda_2 < 0$ & Proper node & Asym.~stable \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document}

booktabs provides the supplemental tabular eye-candy.

Werner
  • 603,163
22

When I had the same problem I solved it with tabularx. Here's the code for your example (I'm assuming the number in the 4th row should be 2):

\documentclass{article}
\usepackage[textwidth = 155mm]{geometry}
\usepackage{tabularx}
\begin{document}

\begin{table}
\begin{tabularx}{\textwidth}{|>{\setlength\hsize{1.4\hsize}\setlength\linewidth{\hsize}}X|>{\setlength\hsize{.9\hsize}\setlength\linewidth{\hsize}}X|>{\setlength\hsize{.7\hsize}\setlength\linewidth{\hsize}}X|}
\hline
\multicolumn{3}{|c|}{Classification of the criticel point $(0,0)$ of $x'=Ax,|\mathbf{A}|\not=0$.}\\
\hline
Types & Type of Critical Point & Stability \\
\hline
1. Real unequal eigenvalues of same sign
\begin{itemize}
\item $\lambda_1 > \lambda_2 > 0$
\item $\lambda_1 < \lambda_2 < 0$
\end{itemize} &
\vphantom{1. Real unequal eigenvalues of same sign}
\begin{itemize}
\item Improper Node/Node
\item Improper Node/Node
\end{itemize} &
\vphantom{1. Real unequal eigenvalues of same sign}
\begin{itemize}
\item Unstable
\item Asym. Stable
\end{itemize}\\
\hline
2. Real unequal eigenvalues of opposite sign
\begin{itemize}
\item $\lambda_2 < 0 >\lambda_1$
\end{itemize} &
\vphantom{2. Real unequal eigenvalues of opposite sign}
\begin{itemize}
\item Saddle Point
\end{itemize} &
\vphantom{2. Real unequal eigenvalues of opposite sign}
\begin{itemize}
\item Unstable
\end{itemize}\\
\hline
3. Equal eigenvalues \newline Subtype 1: Two Independent vectors
\begin{itemize}
\item $\lambda_1 = \lambda_2 > 0$
\item $\lambda_1 = \lambda_2 < 0$
\end{itemize} &
\vphantom{3. Equal eigenvalues} \vphantom{ Subtype 1: Two Independent vectors}
\begin{itemize}
\item Proper Node
\item Proper Node
\end{itemize} &
\vphantom{3. Equal eigenvalues} \vphantom{ Subtype 1: Two Independent vectors}
\begin{itemize}
\item Unstable
\item Asym. Stable
\end{itemize}\\
\hline
\end{tabularx}
\end{table}

\end{document}

Table

If you don't like the item symbols in the 2nd and 3rd columns, use \item[].

Werner
  • 603,163
nbg
  • 271
  • 3
    two points: (1) the baselines of the items in the first column aren't even with (they're higher than) those in the other two columns; (2) the indentation caused by the itemize in the last two columns causes the text to be shifted unpleasantly far right. – barbara beeton Dec 18 '13 at 16:35
  • 1
    This code doesn't work as-is for me – crypdick Feb 23 '17 at 19:34
  • 3
    "criticel" should be "critical" (but don't worry; its not critical). – Benjamin McKay Jul 31 '17 at 12:14
  • @BenjaminMcKay, why do you have to be so cretical?? – Paul Wintz Aug 25 '20 at 21:50
  • 3
    Trying to put an itemize in an X cell of tabularx results for me in 4 equal errors: Something's wrong--perhaps a missing \item. \end{tabularx}. – Andyc Nov 24 '20 at 14:41
10

Using itemization with minipage might be an option if the newline (backslash) is overlapping to another cell. For example:

     \multicolumn{2}{c}{\textbf{Classification 1}} \\ [2pt]  \hline
      \textit{Classification 1} & 
      \begin{minipage} [t] {0.4\textwidth} 
      \begin{itemize}
      \item item 1
        \subitem subitem 2
        \subitem subitem 3
     \end{itemize} 
    \end{minipage} \\ [2pt]  \hline
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Martin Schröder Jul 31 '17 at 12:24
  • +1. I actually wanted a bulleted list in a table, and this is the best solution for me. Even better that the minipage environment is the varwidth environment, which takes maximum width as an argument, and adjusts to its content. – GPWR May 10 '23 at 21:50
2
\begin{tabularx}{\textwidth}{p{50mm}|X}
   1. item 1 \par %
   2. item 2     & this works \\\hline
   1. item 3 \par
   2. item 4 \par
   3. item 5 & second line too
\end{tabularx}

A simple solution is using a p paragraph column, you can combine with \par to separate paragraphs within a cell. I used text labels here for each paragraph, but you could use bullets or some other style.