91

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

4
  • 7
    Here's a hint: Use a p{<len>}-style column, and then you can use \begin{itemize}...\end{itemize}.
    – Werner
    Commented Dec 18, 2013 at 7:25
  • Hi @Werner, u mean the \begin{tabular}[pos]{p{<len>}} smth like this? Commented Dec 19, 2013 at 4: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
    Commented Dec 19, 2013 at 7:09
  • Ypur diagram would be so much easier to understand with some small and simple drawings like these: twt.mpei.ac.ru/TTHB/New-Chem-Kin/ChemKin/3-19.PNG Commented Jul 31, 2017 at 12:15

4 Answers 4

90

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.

7
  • 2
    +1: This looks great and is minimalistic at the same time. Good job! Commented Dec 19, 2013 at 8:10
  • 1
    But there's a problem which is the table will extend the margin of the paper if I type a longer word in the stability column, such as I change Asym.~stable to Asymptotically stable. Commented Dec 24, 2013 at 4:57
  • 2
    @AndrewOoi: That's because all the columns are set as left-aligned. If you have such long items, use tabularx with its X-column in the one you want to break.
    – Werner
    Commented Dec 24, 2013 at 5:29
  • 1
    Could you suggest a solution for multiline lists? The auto-justification seems to cause problems with the intending here.
    – Ébe Isaac
    Commented Mar 30, 2016 at 11:18
  • 1
    @crypdick: Double backslashes \\ underwent an arbitrary removal for posts prior to 2015. We're in the process of converting that. See Double backslashes disappear from code
    – Werner
    Commented Feb 23, 2017 at 19:36
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[].

5
  • 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. Commented Dec 18, 2013 at 16:35
  • 1
    This code doesn't work as-is for me
    – crypdick
    Commented Feb 23, 2017 at 19:34
  • 3
    "criticel" should be "critical" (but don't worry; its not critical). Commented Jul 31, 2017 at 12:14
  • @BenjaminMcKay, why do you have to be so cretical?? 😄
    – Paul Wintz
    Commented Aug 25, 2020 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
    Commented Nov 24, 2020 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
2
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Commented Jul 31, 2017 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
    Commented May 10, 2023 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .