7

How can I draw the following table in LaTeX?

enter image description here

I tried looking here but from the examples I can't figure out how I can draw this.

Edit: After browsing a few more times I found this with the help of which I could draw the table without the diagonal. Here is my MWE,

\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline
\multicolumn{1}{|c|}{CONCEPT} & \multicolumn{6}{c|}{COMPREHENSIVE NOTES}                                \\ \hline
Man                            & Substance & Material & Living           &     Sentient & Rational & Man \\ \hline
Animal                         & Substance & Material & Living           &     Sentient & Brutes   & Man \\ \hline
Organism                       & Substance & Material & Inanimate Bodies &     Plants   & Brutes   & Man \\ \hline
Body                           & Substance & Material & Inanimate Bodies &     Plants   & Brutes   & Man \\ \hline
Substance                      & Substance & Spirit   & Inanimate Bodies &     Plants   & Brutes   & Man \\ \hline
\multicolumn{1}{|c|}{}         & \multicolumn{6}{c|}{EXTENSIVE SUBJECTS}                                 \\ \hline
\end{tabular}
\end{table}
  • Should the diagonal be reproduced too? – Mico May 25 '16 at 04:38
  • @Mico: Yes. It should be. –  May 25 '16 at 04:39
  • Do these links help ? http://tex.stackexchange.com/questions/17745/diagonal-lines-in-table-cell

    http://tex.stackexchange.com/questions/7262/diagonally-divided-table-cell

    – Elad Den May 25 '16 at 05:30
  • or you could use something like this to draw over your table ? http://tex.stackexchange.com/questions/9442/how-to-draw-lines-around-multiple-table-cells – Elad Den May 25 '16 at 05:32
  • @EladDen: I can't figure out how to use them to fulfill my requirement. –  May 25 '16 at 06:26

3 Answers3

5

Here is one way of doing it, using the graphicx package:

\documentclass[10pt,letterpaper]{article}
 \usepackage{graphicx}
\begin{document}
\begin{table}[]
    \centering
    \caption{My caption}
    \label{my-label}
    \begin{tabular}{|l|l|l|l|l|l|l|}
        \hline
        \multicolumn{1}{|c|}{CONCEPT} & \multicolumn{6}{c|}%
{COMPREHENSIVE NOTES\Large\strut}                                \\ \hline
        Man                            & Substance & Material & Living           &     Sentient & Rational & Man \\ \hline
        Animal                         & Substance & Material & Living           &     Sentient & Brutes   & Man \\ \hline
        Organism                       & Substance & Material & Inanimate Bodies &     Plants   & Brutes   & Man \\ \hline
        Body                           & Substance & Material & Inanimate Bodies &     Plants   & Brutes   & Man \\ \hline
        Substance                      & Substance & Spirit   & Inanimate Bodies &     Plants   & Brutes   & Man \\ \hline
        \multicolumn{1}{|c|}{}         & \multicolumn{6}{c|}%
{EXTENSIVE SUBJECTS\Large\strut}                                 \\ \hline
    \end{tabular}


\vskip-1.17in\rotatebox{14}{\hskip1.5in\vtop{\hsize=3.75in\rule{3.28in}{1pt}}}



\end{table} 

and adjust the dimensions to fit your needs. I added a \Large\strut to adjust the cell padding for the top and bottom cells.

enter image description here

A Feldman
  • 3,930
3

With tikz

\documentclass[a4paper]{article}
\usepackage{tikz}

\newcommand{\tikzmark}[2][]{\tikz[remember picture, overlay]\node[#1,inner sep=0pt,xshift=-\tabcolsep](#2){};\ignorespaces}
\newcommand{\tm}[2][]{\tikzmark[yshift=#1]{#2}}

\begin{document}
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline
\multicolumn{1}{|c|}{CONCEPT}& \multicolumn{6}{c|}{COMPREHENSIVE NOTES}                                                       \\ \hline
Man                          & Substance & Material               & Living           & Sentient & Rational &\tm[1.8ex]{A} Man \\ \hline
Animal                       & Substance & Material               & Living           & Sentient & Brutes   & Man              \\ \hline
Organism                     & Substance & Material               & Inanimate Bodies & Plants   & Brutes   & Man              \\ \hline
Body                         & Substance & Material               & Inanimate Bodies & Plants   & Brutes   & Man              \\ \hline
Substance                    & Substance & \tm[-0.9ex]{B} Spirits & Inanimate Bodies & Plants   & Brutes   & Man              \\ \hline
\multicolumn{1}{|c|}{}       & \multicolumn{6}{c|}{EXTENSIVE SUBJECTS}                                                        \\ \hline
\end{tabular}
\tikz[remember picture, overlay]\draw[thick] (A)--(B);
\end{table}
\end{document}
Salim Bou
  • 17,021
  • 2
  • 31
  • 76
  • Better answer than mine because you are able to just set your \tm in any cell in the table and the line gets drawn programatically. – A Feldman May 26 '16 at 02:53
1

With {NiceTabular} of nicematrix. That environment is similar to {tabular} (of array) but creates PGF/Tikz nodes under the cells. Then it's possible to use those nodes with Tikz to draw whatever rule you want (in the \CodeAfter or in the \CodeBefore of the array).

\documentclass{article}
\usepackage{nicematrix,tikz}

\begin{document}

\begin{table}[] \centering \caption{My caption} \label{my-label} \begin{NiceTabular}{lllllll}[hvlines] \multicolumn{1}{c}{CONCEPT} & \multicolumn{6}{c}{COMPREHENSIVE NOTES} \ Man & Substance & Material & Living & Sentient & Rational & Man \ Animal & Substance & Material & Living & Sentient & Brutes & Man \ Organism & Substance & Material & Inanimate Bodies & Plants & Brutes & Man \ Body & Substance & Material & Inanimate Bodies & Plants & Brutes & Man \ Substance & Substance & Spirit & Inanimate Bodies & Plants & Brutes & Man \ & \multicolumn{6}{c}{EXTENSIVE SUBJECTS} \ \CodeAfter \tikz \draw (2-|7) -- (7-|3) ; \end{NiceTabular} \end{table}

\end{document}

Output of the above code

F. Pantigny
  • 40,250