大花括号和表格周围的旋转文本

大花括号和表格周围的旋转文本

我这里有一个看起来相当拥挤的表格,显示了护士在进行某种类型的护理时接触表面类型的概率。我想在行的左侧做一个大括号,并带有垂直标签(护理类型),还有一条在柱子上方,写着(表面类别)。有什么想法吗?此外,我非常乐意听取任何有关如何最好地显示此表的建议。

\documentclass{article}
\usepackage{amsmath} % provides \text command
\begin{document}
    $$\begin{array}{*{6}{c}}
    &\text{Equipment}&\text{Patient}&\text{Hygiene products}&\text{Near-bed objects}&\text{Far-bed objects}\\
    \text{Direct Care}&\frac{49}{192}&\frac{170}{913}&\frac{18}{173}&\frac{79}{392}&\frac{21}{83}\\
    \text{Housekeeping}&\frac{22}{89}&\frac{7}{89}&\frac{6}{89}&\frac{35}{89}&\frac{19}{89}\\
    \text{Mealtimes}&0&\frac{6}{55}&\frac{2}{11}&\frac{31}{55}&\frac{8}{55}\\
    \text{Medication round}&\frac{23}{429}&\frac{23}{143}&\frac{7}{39}&\frac{50}{143}&\frac{10}{39}\\
    \text{Misc.}&\frac{4}{165}&\frac{19}{165}&\frac{8}{33}&\frac{10}{33}&\frac{52}{165}\\
    \text{Personal Care}&\frac{3}{89}&\frac{15}{89}&\frac{19}{89}&\frac{36}{89}&\frac{16}{89}\\
    \text{Overall}&\frac{7}{233}&\frac{34}{233}&\frac{54}{233}&\frac{80}{233}&\frac{58}{233}\\
    \end{array}$$
\end{document}

在此处输入图片描述

答案1

下面这个样子怎么样?它省去了让读者伸长脖子 90 度的麻烦,而且看起来也不那么拥挤。:-)

在此处输入图片描述

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,booktabs}
\begin{document}
\[
\begin{array}{@{} l *{5}{c} @{}}
\toprule
\textbf{Care type} & \multicolumn{5}{c@{}}{\textbf{Surface category}}\\
\cmidrule(l){2-6}
&\text{Equipment} &\text{Patient}
&\text{Hygiene} &\text{Near-bed} &\text{Far-bed}\\
& & & \text{products} & \text{objects} & \text{objects}\\
\midrule
\text{Direct Care}&\frac{49}{192}&\frac{170}{913}&\frac{18}{173}&\frac{79}{392}&\frac{21}{83}\\[0.7ex]
\text{Housekeeping}&\frac{22}{89}&\frac{7}{89}&\frac{6}{89}&\frac{35}{89}&\frac{19}{89}\\[0.7ex]
\text{Mealtimes}&0&\frac{6}{55}&\frac{2}{11}&\frac{31}{55}&\frac{8}{55}\\[0.7ex]
\text{Medication round}&\frac{23}{429}&\frac{23}{143}&\frac{7}{39}&\frac{50}{143}&\frac{10}{39}\\[0.7ex]
\text{Misc.}&\frac{4}{165}&\frac{19}{165}&\frac{8}{33}&\frac{10}{33}&\frac{52}{165}\\[0.7ex]
\text{Personal Care}&\frac{3}{89}&\frac{15}{89}&\frac{19}{89}&\frac{36}{89}&\frac{16}{89}\\[0.7ex]
\text{Overall}&\frac{7}{233}&\frac{34}{233}&\frac{54}{233}&\frac{80}{233}&\frac{58}{233}\\
\bottomrule
\end{array}
\]
\end{document}

顺便说一句,我不禁想知道将数字表示为精确分数而不是四舍五入的小数(例如,精度为 3 位或 4 位)的目的是什么。我怀疑许多潜在读者可能更喜欢使用近似数字,而0.186不是使用精确值170/913

答案2

在此处输入图片描述

p是 parbox,因此它会让您退出数学模式。编辑后的问题将其更改为,c但语法不*正确。

我添加了一些括号(这需要对空格进行一些手动调整)并用 打开了显示\arraystretch

\documentclass{article}
\usepackage{graphicx}
\begin{document}

\renewcommand\arraystretch{1.5}

xxxxxxxx

\vspace{40pt}
\[
\rotatebox[origin=c]{90}{\textbf{Care Type}}\left\{
\begin{array}{*{6}{c}}
\noalign{\vspace{-40pt}}
    &\multicolumn{5}{c}{\textbf{Surface Category}}\\[-10pt]
    &\multicolumn{5}{c}{$\downbracefill$}\\
    &\mbox{Equipment}&\mbox{Patient}&\mbox{Hygiene products}&\mbox{Near-bed objects}&\mbox{Far-bed objects}\\
    \mbox{Direct Care}&\frac{49}{192}&\frac{170}{913}&\frac{18}{173}&\frac{79}{392}&\frac{21}{83}\\
    \mbox{Housekeeping}&\frac{22}{89}&\frac{7}{89}&\frac{6}{89}&\frac{35}{89}&\frac{19}{89}\\
    \mbox{Mealtimes}&0&\frac{6}{55}&\frac{2}{11}&\frac{31}{55}&\frac{8}{55}\\
    \mbox{Medication round}&\frac{23}{429}&\frac{23}{143}&\frac{7}{39}&\frac{50}{143}&\frac{10}{39}\\
    \mbox{Misc.}&\frac{4}{165}&\frac{19}{165}&\frac{8}{33}&\frac{10}{33}&\frac{52}{165}\\
    \mbox{Personal Care}&\frac{3}{89}&\frac{15}{89}&\frac{19}{89}&\frac{36}{89}&\frac{16}{89}\\
    \mbox{Overall}&\frac{7}{233}&\frac{34}{233}&\frac{54}{233}&\frac{80}{233}&\frac{58}{233}
    \end{array}
\right.
\]
\end{document}

答案3

我觉得这个更令人愉快(我并不特别喜欢表格中的居中对齐)。不过,外观和代码可能仍需要一些改进。我同意 Mico 的建议:改用0.186etc。这样读者和排版员都更容易理解。

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{booktabs,leading,xfrac}

\DeclareInstance{xfrac}{lmss}{text}
{
numerator-font = lmss,
denominator-font = lmss,
scale-factor = 1.333,
h-scale = 1
}


\begin{document}
\begin{table}
\footnotesize% = 10pt
\leading{15pt}%
\sffamily%
    \begin{tabular}{l p{.12\textwidth} p{.12\textwidth} p{.12\textwidth} p{.12\textwidth} p{.12\textwidth}}
    & \mbox{\emph{surface category}}\\    
    \cmidrule(){2-6}

    \raisebox{-15pt}{\emph{care type}}&\raisebox{-15pt}{\textbf{equipment}}&\raisebox{-15pt}{\textbf{patient}}&\textbf{hygiene products}&\textbf{near-bed objects}&\textbf{far-bed objects}\\    
    \cmidrule(r){1-1}\cmidrule(){2-6}

    {direct care}&\sfrac{49}{192}&\sfrac{170}{913}&\sfrac{18}{173}&\sfrac{79}{392}&\sfrac{21}{83}\\
    {housekeeping}&\sfrac{22}{89}&\sfrac{7}{89}&\sfrac{6}{89}&\sfrac{35}{89}&\sfrac{19}{89}\\
    {mealtimes}&0&\sfrac{6}{55}&\sfrac{2}{11}&\sfrac{31}{55}&\sfrac{8}{55}\\
    {medication round}&\sfrac{23}{429}&\sfrac{23}{143}&\sfrac{7}{39}&\sfrac{50}{143}&\sfrac{10}{39}\\
    {misc.}&\sfrac{4}{165}&\sfrac{19}{165}&\sfrac{8}{33}&\sfrac{10 }{33}&\sfrac{52}{165}\\
    {personal care}&\sfrac{3}{89}&\sfrac{15}{89}&\sfrac{19}{89}&\sfrac{36}{89}&\sfrac{16}{89}\\
    {overall}&\sfrac{7}{233}&\sfrac{34}{233}&\sfrac{54}{233}&\sfrac{80}{233}&\sfrac{58}{233}\\        
    \cmidrule(r){1-1}\cmidrule(){2-6}
    \end{tabular}
\end{table}
\end{document}

答案4

就你问的,我有个建议:不要使用花括号。真的,没有必要,只需使用直线和列标题即可。此外,一堆分数看起来难以阅读,看起来/ 很像视觉噪音。看看这个ctable例子:

\documentclass{article}
\usepackage{amsmath} % provides  command
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{caption}
\usepackage{ctable}
\begin{document}
\listoftables

\global\def\f#1/#2 {\ensuremath{^{#1}}&\ensuremath{_{#2}}}    
\global\def\row #1|#2|#3|#4|#5|#6 { #1&\f #2&\f #3&\f #4&\f #5&\f #6 }

\global\def\subhdr #1|#2|#3|#4|#5 {%
\multicolumn{2}{X}{#1}
&\multicolumn{2}{X}{#2}
&\multicolumn{2}{X}{#3}
&\multicolumn{2}{X}{#4}
&\multicolumn{2}{X}{#5}}

\ctable[% 
caption ={The chances of a nurse 
touching a surface type given (s)he is doing a certain type of care},
label = tab:1,
pos = ht,
left,
width = 130mm,
mincapwidth = 160mm,
footerwidth = 130mm,
%doinside = \scriptsize
]{l*{5}{r@{\extracolsep{0pt}}l}}{
\tnote[a]{Comment: }
%\tnote[b]{}
}{  \FL
%
&\multicolumn{10}{c}{Surface category}\NN
\cmidrule(r){2-11}
{Care type}    & \subhdr          {Equipment} |{Patient}|{Hygiene products}|{Near-bed objects}|{Far-bed objects} \ML
    \row Direct Care              |49/192     |170/913 |18/173          |79/392          |21/83 \\
    \row Housekeeping             |22/89      |7/89    |6/89            |35/89           |19/89 \\
    \row Mealtimes{\tmark[a]}     |0/{}       |6/55    |2/11            |31/55           |8/55 \\
    \row Medication round         |23/429     |23/143  |7/39            |50/143          |10/39 \\
    \row Misc.                    |4/165      |19/165  |8/33            |10/33           |52/165 \\
    \row Personal Care            |3/89       |15/89   |19/89           |36/89           |16/89 \\
    \row Overall                  |7/233      |34/233  |54/233          |80/233          |58/233   
\LL
}
\end{document}

在此处输入图片描述

编辑:建议的方法Daniel建议的是否可以使用管道字符 | 来分隔表格中的单元格?在定义中使用\row

相关内容