我尝试了很多方法,但都无法使旋转的单元格很好地居中。例如病人稍微靠左一点。
origin=tl
没有origin=tc
起作用\centering
不工作\begin{center}Patient\end{center}
也不起作用......
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{tabularray}
\begin{document}
\begin{figure}
\begin{tblr}
{
width = {\textwidth},
colspec = { Q[c]Q[c]Q[c]Q[c] },
rowsep = 1ex,
rowspec = { Q[m] },
% hlines,
% vlines,
row{1} = {font=\bfseries, bg=brown9, font=\sffamily},
cell{1}{1} = {bg=white},
cell{2-3}{1} = {cmd=\rotatebox[{origin=tl}]{90}},
% cell{3}{1} = {cmd=\rotatebox[{origin=tl}]{90}},
}
&
echo-Doppler
&
CT-MRA
&
CTA
\\
\parbox{1.5cm}{Healthy subject}
&
\includegraphics[width=3.0cm,height=2cm]{example-image}
&
\includegraphics[width=3.0cm,height=2cm]{example-image}
&
\includegraphics[width=3.0cm,height=2cm]{example-image}
\\
Patient\ \ \ \ \
&
\includegraphics[width=3.0cm,height=2cm]{example-image}
&
\includegraphics[width=3.0cm,height=2cm]{example-image}
&
\includegraphics[width=3.0cm,height=2cm]{example-image}
\end{tblr}
\end{figure}
\end{document}```
答案1
看看以下解决方案是否可以接受:
\documentclass{article}
\usepackage[export]{adjustbox}
\usepackage{rotating}
\usepackage{makecell}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}
\begin{figure}
\settowidth\rotheadsize{Healthy}
\adjustboxset{width=3cm, height=2cm, valign=m}
\renewcommand\cellalign{cc}
\begin{tblr}{colsep=2pt,
colspec = {Q[c, m]
Q[m, leftsep=0pt] *{2}{Q[m]} @{} },
cell{2-Z}{1} = {cmd=\rotcell},
cell{1}{2-Z} = {bg=brown},
row{1} = {c, font=\sffamily},
}
& echo-Doppler & CT-MRA & CTA \\
{Healthy\\ subject}
& \adjincludegraphics{example-image-a}
& \adjincludegraphics{example-image-b}
& \adjincludegraphics{example-image-c} \\
Patient
& \adjincludegraphics{example-image-a}
& \adjincludegraphics{example-image-b}
& \adjincludegraphics{example-image-c} \\
\end{tblr}
\end{figure}
\end{document}
但是,您可以使用以下figure
表格设置使图像稍微大一些:
\begin{figure}
\settowidth\rotheadsize{Healthy}
\adjustboxset{width=\linewidth, valign=m}
\renewcommand\cellalign{cc}
\begin{tblr}{colsep=2pt,
colspec = {Q[c, m]
Q[m, leftsep=0pt] *{2}{Q[m]} @{} },
cell{2-Z}{1} = {cmd=\rotcell},
cell{1}{2-Z} = {bg=brown},
row{1} = {c, font=\sffamily},
}
...
\end{tblr}
\end{figure}