我已经编写了下面的 latex 脚本来制作表格,但框的大小取决于其中的文本量,这会让一切都变得混乱。我的问题是:1- 有没有办法让大小相等(例如使用最大框的大小)?感谢您的帮助。2- 有没有办法移动位于表格底部第二列正下方的箭头?
\documentclass[
12pt, % font size
a4paper, % paper format
oneside, % one-sided pages
]{report}
\usepackage{tikz} % draw figures
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\usepackage{pgfplots} % discret signals
\usepackage{tikz}
\usetikzlibrary{matrix}
\def\etal{\emph{et al. }}
\usepackage[colorlinks=true,citecolor=blue]{hyperref}
% math
\usepackage{amsmath}
\begin{document}
\begin{table}
\caption{Density and evolution of the virus}
\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}]
{
Wash all the surfaces and handles. Put extra washing powder on desks, tables and close to the entrance. It is necessary to be able to open the doors without touching them. & Clean the kitchen, all the bathrooms and area close to the entrance. Make sure you don not touch anything directly when you clean surfaces. &Investment plans, contracting with insurance companies & Investment plans, contracting with insurance companies \\
Every day, every month, every year. Even every hour. It should always be there regardless of time and date. Be ready to answer calls and open the door. & Wash all the surfaces and handles. Put extra washing powder on desks, tables and close to the entrance. tables and close to the entrance. & on desks, tables and close to the entrance. tables and close to the entrance.& 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 west){$\xrightarrow{\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:}$};
\node[yshift=-6mm,font=\bfseries] at (T.south west){Changing room};
%\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}]
{
Mondays & Wednesday \par month & every \par week & Completely \par clean\\
};
\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}]
{
\\ \\ Time and space\\
\\ \\ \\ \\ \\ \\
Only time\\
%Offline \par Operational\\
%Online \par Operational\\
};
\draw [densely dashed] (3.51,-2.5) -- (3.51,2.5);
\end{tikzpicture}
\end{table}
\end{document}
编辑:
我使用了第一个答案中的解决方案,但现在整个表格已移至页面的右侧!有人可以帮忙吗?
\documentclass[
12pt, % font size
a4paper, % paper format
oneside, % one-sided pages
]{report}
\usepackage{geometry}
\usepackage{tikz} % draw figures
\usetikzlibrary{shapes,arrows,calc}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\usepackage{pgfplots} % discret signals
\usepackage{tikz}
\usetikzlibrary{matrix}
\def\etal{\emph{et al. }}
\usepackage[colorlinks=true,citecolor=blue]{hyperref}
% math
\usepackage{amsmath}
\begin{document}
\begin{table}
\caption{Wash all the surfaces.}
\begin{tikzpicture}
\matrix (T) [matrix of nodes,
column sep=4pt,
row sep=4pt,
nodes={draw,
text width=2.5cm,
align=center,
rounded corners,
minimum height=6cm,
inner sep=1pt,
font=\footnotesize,
anchor=south
},
row 1/.style={nodes={draw=none, minimum height=1cm, font=\bfseries}},
column 1/.style={nodes={draw=none, text width=4.5cm, font=\bfseries}},
row 3/.style={nodes={minimum height=5.5cm}},
]
{& monday & Intermediate \par week & Large \par wek & Completely \par month \\
time \par phase
& Wash all the surfaces and handles. Put extra washing powder on desks, Wash all the surfaces and handles. & Wash all the surfaces and handles. Put extra washing powder on desks, Wash all the surfaces and handles. Put extra washing powder on desks. & Wash all the surfaces and handles. Put extra washing powder on desks, Wash all the surfaces and handles. Put extra washing powder on desks, & Wash all the surfaces and handles. Put extra washing powder on desks, Wash all the surfaces and handles. Put extra. \\
data \par phase
&Wash all the surfaces and handles. Put extra washing powder on desks, Wash all the surfaces and handles. Put extra washing powder on desks, . &Wash all the surfaces and handles. Put extra washing powder on desks, Wash all the surfaces and handles. & Wash all the surfaces and handles. Put extra washing powder on desks, Wash all the surfaces and handles. Put extra washing powder on desks, & Wash all the surfaces and handles. Put extra washing powder on desks, Wash all the surfaces and handles. Put extra washing powder on desks, \\
};
\end{tikzpicture}
\end{table}
\end{document}
答案1
以下可以作为起点。我添加了内容geometry
以获得更宽的文本宽度,并改变了框的宽度,以使图表适合文本宽度。
\documentclass[
12pt, % font size
a4paper, % paper format
oneside, % one-sided pages
]{report}
\usepackage{geometry}
\usepackage{tikz} % draw figures
\usetikzlibrary{shapes,arrows,calc}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\usepackage{pgfplots} % discret signals
\usepackage{tikz}
\usetikzlibrary{matrix}
\def\etal{\emph{et al. }}
\usepackage[colorlinks=true,citecolor=blue]{hyperref}
% math
\usepackage{amsmath}
\begin{document}
\begin{table}
\caption{Density and evolution of the virus}
\begin{tikzpicture}
\matrix (T) [matrix of nodes,
column sep=4pt,
row sep=4pt,
nodes={draw,
text width=2.5cm,
align=center,
rounded corners,
minimum height=6cm,
inner sep=1pt,
font=\footnotesize,
anchor=south
},
row 1/.style={nodes={draw=none, minimum height=1cm, font=\bfseries}},
column 1/.style={nodes={draw=none, text width=2.5cm, font=\bfseries}},
row 3/.style={nodes={minimum height=5.5cm}},
row 4/.style={nodes={minimum height=2cm}},
row 5/.style={nodes={minimum height=2cm}},
]
{& Mondays
& Wednesday month
& every week
& completely clean \\
Time and Space
& Wash all the surfaces and handles. Put extra washing powder on desks, tables and close to the entrance. It is necessary to be able to open the doors without touching them.
& Clean the kitchen, all the bathrooms and area close to the entrance. Make sure you don not touch anything directly when you clean surfaces.
&Investment plans, contracting with insurance companies
& Investment plans, contracting with insurance companies \\
Only time
&Every day, every month, every year. Even every hour. It should always be there regardless of time and date. Be ready to answer calls and open the door.
& Wash all the surfaces and handles. Put extra washing powder on desks, tables and close to the entrance. tables and close to the entrance.
& on desks, tables and close to the entrance. tables and close to the entrance.
& Budget and cost allocation\\
Offline \par Operational &
Diagnosis and planning of an individual treatment
& Appointment scheduling, workforce scheduling
& Materials purchasing, determining order sizes
& DRG billing, cash flow analysis\\
Online \par Operational
& Triage, diagnosing emergencies and complications
& Monitoring, emergency coordination
& Rush ordering, inventory replenishing
& Billing complications and changes\\
};
\draw[->] ($(T-5-2.south)-(0,0.25)$) -- node [below, font=\bfseries] {Changing room} ($(T-5-3.south)-(0,0.25)$);
% \draw [densely dashed] (3.51,-2.5) -- (3.51,2.5);
\end{tikzpicture}
\end{table}
\end{document}