答案1
只是graphicx
旋转“Source2”标签:
代码:
\documentclass{article}
\usepackage{graphicx}
\newcommand\MyBox[1]{%
\fbox{\parbox[c][1.7cm][c]{1.7cm}{\centering #1}}%
}
\newcommand\MyVBox[1]{%
\parbox[c][1.7cm][c]{1cm}{\centering\bfseries #1}%
}
\newcommand\MyHBox[2][\dimexpr1.7cm+2\fboxsep\relax]{%
\parbox[c][1cm][c]{#1}{\centering\bfseries #2}%
}
\newcommand\MyTBox[4]{%
\MyVBox{#1}\MyBox{#2}\hspace*{-\fboxrule}%
\MyBox{#3}\hspace*{-\fboxrule}%
\MyBox{#4}\par\vspace{-\fboxrule}
}
\begin{document}
{
\offinterlineskip
\raisebox{-5cm}[0pt][0pt]{\rotatebox[origin=c]{90}{\parbox[c][0pt][c]{1cm}{\textbf{Source2}\\[20pt]}}}\par
\hspace*{1cm}\MyHBox[\dimexpr5.1cm+6\fboxsep\relax]{Source1}\par
\hspace*{1cm}\MyHBox{A}\MyHBox{B}\MyHBox{C}\par
\MyTBox{A}{0.1}{0.3}{0.5}
\MyTBox{B}{0.5}{0.2}{0.1}
\MyTBox{C}{0.4}{0.7}{0.2}
}
\end{document}
答案2
picture
我不会声称这是一个很好的解决方案,但是可以使用内置功能来实现这一点。不过我确实graphicx
用过\rotatebox
。
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\setlength\unitlength{1cm}
\begin{picture}(4,4)
\multiput(0.1,0.1)(0,1){4}{\line(1,0){3}}
\multiput(0.1,0.1)(1,0){4}{\line(0,1){3}}
\put(0.5,0.5){1}
\put(1.5,0.5){2}
\put(2.5,0.5){3}
\put(0.5,1.5){4}
\put(1.5,1.5){5}
\put(2.5,1.5){6}
\put(0.5,2.5){7}
\put(1.5,2.5){8}
\put(2.5,2.5){9}
\put(-0.5,2.5){A}
\put(-0.5,1.5){B}
\put(-0.5,0.5){C}
\put(0.5,3.5){A}
\put(1.5,3.5){B}
\put(2.5,3.5){C}
\put (-1.2,1.5){\rotatebox{90}{Text}}
\put(1.2,4.2){Text}
\end{picture}
\end{document}