如何在表格中進行縮進,然後在不同層級上對齊?

如何在表格中進行縮進,然後在不同層級上對齊?

我如何建立這個表?正是這些微妙的凹痕讓我感到困惑。我知道我錯過了一些簡單的事情。

表格範例

答案1

您可以使用tabbing環境。例如:

\documentclass{article}
\begin{document}
\begin{tabbing}
\quad\=\quad\=One $= 0$ the other $\neq 0$\quad
  \=Whole line of equilibrium points\kill
\rule{.8\linewidth}{1pt}\\
Eigenvalues\>\>\>Stability\\[-1.2ex]
\rule{.8\linewidth}{1pt}\\
REAL\\
\>Unequal\\
\>\>Both $>0$\>Unstable node (source, repeller)\\
\>\>Both $<0$\>Stable node (sink, attractor)\\
\>\>Different signs\>Saddle point\\
\>\>One $= 0$ the other $\neq 0$\>Whole line of equilibrium points\\
\>Equal\\
\>\>Both $>0$\>Unstable node (source, repeller)\\
\>\>Both $<0$\>Stable node (sink, attractor)\\
\>\>Both $=0$\>Algebraic unstable\\
COMPLEX\\
\end{tabbing}
\end{document}

選項卡範例

  • \=標記製表位
  • \>轉到下一個製表位
  • \\結束一行
  • \kill結束一行但不列印它,對於製表位模型行很有用

答案2

您可以使用一些定義的空間在表內縮排。考慮下面的例子:

\documentclass{article}

\usepackage{booktabs}

\begin{document}

\begin{tabular}{@{} l l @{}}
  \toprule
  Eigenvalues & Stability\\
  \midrule
  REAL\\
  \hspace{0.25cm} Unequal\\
  \hspace{0.5cm} Both $>0$ & Unstable node (source, repeller)\\
  \hspace{0.5cm} Both $<0$ & Stable node (sink, attractor)\\
  \hspace{0.5cm} Different signs & Saddle point\\
  \hspace{0.5cm} $= 0$ the other $\neq 0$ & Whole line of equilibrium points\\
  ...\\
  \bottomrule
\end{tabular}

\end{document}

此程式碼呈現以下內容:

實施OP建議的表格。

編輯:為了清晰起見,編輯了程式碼和輸出影像。

相關內容