创建带有轴的表格

创建带有轴的表格

我正在尝试制作下图所示表格的 LaTeX 版本。这主要是由于下方和右侧的轴而变得复杂。下面给出的代码是我设法取得的进展。首先,我对它的外观不太满意(我希望它更像图片),其次,我不知道如何完成这些轴。

我不知道你们需要多长时间才能帮助我,但是我的时间安排非常紧张,因此任何帮助都将不胜感激!

\usepackage{tabularx}

\begin{table}[h]
\tiny
\centering
\caption{Framework for health care planning and control \citep{hans2012framework}.}
\noindent\begin{tabularx}{0.8\textwidth}{ XXXXX } & \textbf{Medical Planning} & \textbf{Resource capacity planning} & \textbf{Materials planning} & \textbf{Financial planning}\\
\hline
\textbf{Strategic}  & Research, development of medical protocols & Case mix planning, capacity dimensioning, workforce planning & Supply chain and warehouse design & Investment plans, contracting with insurance companies \\
\hline
\textbf{Tactical}   & Treatment selection, protocol selection & Block planning, staffing, admission planning & Supplier selection, tendering & Budget and cost allocation\\
\hline
\textbf{Offline Operational}   & Diagnosis and planning of an individual treatment & Appointment scheduling, workforce scheduling & Materials purchasing, determining order sizes & DRG billing, cash flow analysis\\
\hline
\textbf{Online Operational}  & Triage, diagnosing emergencies and complications & Monitoring, emergency coordination & Rush ordering, inventory replenishing & Billing complications and changes\\
\hline
\end{tabularx}
\label{t:framework}
\end{table}

框架概述

答案1

使用 Tikz Matrix

您可以使用Matrix库来创建此表格,在下面的代码中我们使用三个矩阵

  • Matrix (T)位于中心,包含框架节点。
  • 的上方和左侧有两个矩阵(T)

使用以下方法在(T)的底部和右侧创建标签

\node[yshift=-2mm,font=\bfseries] at (T.south){$ \leftarrow $ managerial erea $ \rightarrow $};

\node[xshift=2mm,font=\large\bfseries,rotate=-90] at (T.east){$ \leftarrow $ \textbf{hierarchical decomposition} $ \rightarrow $};

代码

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}

\begin{table}

\caption{Framework for health care planning and control.}

\begin{tikzpicture}
\matrix (T) [matrix of nodes,column sep=4pt,row sep=4pt,nodes={draw,text width=3.3cm,align=center,rounded corners,minimum height=1.3cm,inner sep=1pt,font=\footnotesize,anchor=south}]
{
 Research, development of medical protocols & Case mix planning, capacity dimensioning, workforce planning & Supply chain and warehouse design & Investment plans, contracting with insurance companies \\
 Treatment selection, protocol selection    & Block planning, staffing, admission planning & Supplier selection, tendering & Budget and cost allocation\\
 Diagnosis and planning of an individual treatment & Appointment scheduling, workforce scheduling & Materials purchasing, determining order sizes & DRG billing, cash flow analysis\\
 Triage, diagnosing emergencies and complications & Monitoring, emergency coordination & Rush ordering, inventory replenishing & Billing complications and changes\\                          
};

\node[yshift=-2mm,font=\bfseries] at (T.south){$ \leftarrow $ managerial erea $ \rightarrow $};

\node[xshift=2mm,font=\large\bfseries,rotate=-90] at (T.east){$ \leftarrow $ \textbf{hierarchical decomposition} $ \rightarrow $};


\matrix at (T.north west) [matrix of nodes,anchor=south west,yshift=-4mm,column sep=4pt,nodes={text width=3.3cm,align=center,minimum height=1.3cm,inner sep=1pt,font=\bfseries}]
{
Medical \par Planning & Resource \par capacity planning & Materials \par planning & Financial \par planning\\                           
};


\matrix at (T.north west) [matrix of nodes,anchor=north east,row sep=4pt,nodes={text width=2.3cm,align=right,minimum height=1.3cm,font=\bfseries}]
{
Strategic\\
Tactical\\
Offline \par Operational\\
Online \par Operational\\                          
};
\end{tikzpicture}
\end{table}

\end{document}

输出

在此处输入图片描述

答案2

作为比比建议,matrixtikz可能更适合,但只是为了将轴添加到表中,我稍微调整了一下你的代码(基本上为每个轴添加一行和一列):

\documentclass{article}
\usepackage{tabularx}
\usepackage{multirow,graphicx}
\begin{document}
\begin{table}[h]
\tiny
\centering
\caption{Framework for health care planning and control}
\noindent\begin{tabularx}{0.8\textwidth}{ XXXXXX } & \textbf{Medical Planning} & \textbf{Resource capacity planning} & \textbf{Materials planning} & \textbf{Financial planning}&\\\cline{1-5}
\textbf{Strategic}  & Research, development of medical protocols & Case mix planning, capacity dimensioning, workforce planning & Supply chain and warehouse design & Investment plans, contracting with insurance companies &\parbox[t]{2mm}{\multirow{4}{*}{\rotatebox[origin=c]{270}{$ \leftarrow $ \textbf{hierarchical decomposition} $ \rightarrow $}}}\\\cline{1-5}
\textbf{Tactical}   & Treatment selection, protocol selection & Block planning, staffing, admission planning & Supplier selection, tendering & Budget and cost allocation&\\\cline{1-5}
\textbf{Offline Operational}   & Diagnosis and planning of an individual treatment & Appointment scheduling, workforce scheduling & Materials purchasing, determining order sizes & DRG billing, cash flow analysis&\\\cline{1-5}
\textbf{Online Operational}  & Triage, diagnosing emergencies and complications & Monitoring, emergency coordination & Rush ordering, inventory replenishing & Billing complications and changes&\\\cline{1-5}
& \multicolumn{4}{c}{$ \leftarrow $ \textbf{managerial areas} $ \rightarrow $} &\\
\end{tabularx}
\label{t:framework}
\end{table}
\end{document}

旋转垂直轴的技巧parbox来自回答哈里什·库马尔

相关内容