这是我的 MWE:
\documentclass[a5paper]{book}
\usepackage[ngerman]{babel}
\usepackage{ucs}
\usepackage[utf8x,utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[garamond]{mathdesign}
\usepackage{geometry}
\geometry{a5paper, top=15mm, left=15mm, right=15mm, bottom=20mm, headsep=10mm, footskip=12mm}
\usepackage{adjustbox}
\usepackage{tabularx,ragged2e,booktabs}
\usepackage[vlines]{tabularht}
\makeatletter
\newcommand{\thickhline}{
\noalign {\ifnum 0=`}\fi \hrule height 1pt
\futurelet \reserved@a \@xhline
}
\makeatother
\newcolumntype{Y}{>{\centering\arraybackslash}X} % zentriert und gleichmäßig verteilt
\begin{document}
\setlength{\tabcolsep}{2pt}
\begin{adjustbox}{angle=90}
{\fontsize{8}{9}\selectfont
\begin{tabularhtx}{\linewidth}{\textheight}{|Y|X|X|X|X|X|X|X|X|X|X|X|X|}
\hline
\interrowfill
Wochen & Kaffee & Rizinusöl & Mahlzeit & Leinöl & Acidol & Saft & Kalium & Lugol & Schilddr. & Niacin & Pankreatin & Leberextr. \\
\interrowfill
\thickhline
\interrowfill
2 -- 3 & 4 Std. & 2 Tage & normal & 2 TL & 3 x 2 & 1 - 5 - 4 - 3 & 10 x 2 & 6 x 1 & 3 x 1/2 & 6 x 1 & 4 x 3 & täglich \\
\interrowfill
\hline
\interrowfill
3 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
5 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
4 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
5 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
4 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
6 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
6 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
6 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
9 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
9 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
7 & & & & & & & & & & & & \\
\interrowfill
\hline
\end{tabularhtx}}
\end{adjustbox}
\end{document}
表格单元格没有空间添加其他注释,因此我想将注释添加到边距,就像这样:
我试图添加一个tikzpicture
,但是当我将它添加到之前时,它adjustbox
被放在了adjustbox
下一页之前的一侧,之后的一侧。
有人有主意吗?
答案1
一种选择是使用 TikZ 的remember picture
,overlay
选项为tikzpicture
和 ,current page.east
用于放置包含评论的节点。根据您的特定需求调整设置(我没有mathdesign
,因此我从示例中隐藏了 ;我还删除了 ,utf8x
因为utf8
应该是更好的选择):
\documentclass[a5paper]{book}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\geometry{a5paper, top=15mm, left=15mm, right=15mm, bottom=20mm, headsep=10mm, footskip=12mm}
\usepackage{adjustbox}
\usepackage{tabularx,ragged2e,booktabs}
\usepackage[vlines]{tabularht}
\usepackage{tikz}
\makeatletter
\newcommand{\thickhline}{
\noalign {\ifnum 0=`}\fi \hrule height 1pt
\futurelet \reserved@a \@xhline
}
\makeatother
\newcolumntype{Y}{>{\centering\arraybackslash}X} % zentriert und gleichmäßig verteilt
\begin{document}
\setlength{\tabcolsep}{2pt}
\begin{tikzpicture}[remember picture,overlay]
\node[
rotate=90,
rounded corners,
draw=red,
ultra thick,
text width=2.5cm,
align=center,
minimum height=15pt
]
at ([xshift=-12pt]current page.east)
{comment};
\end{tikzpicture}%
\begin{adjustbox}{angle=90}
{\fontsize{8}{9}\selectfont
\begin{tabularhtx}{\linewidth}{\textheight}{|Y|X|X|X|X|X|X|X|X|X|X|X|X|}
\hline
\interrowfill
Wochen & Kaffee & Rizinusöl & Mahlzeit & Leinöl & Acidol & Saft & Kalium & Lugol & Schilddr. & Niacin & Pankreatin & Leberextr. \\
\interrowfill
\thickhline
\interrowfill
2 -- 3 & 4 Std. & 2 Tage & normal & 2 TL & 3 x 2 & 1 - 5 - 4 - 3 & 10 x 2 & 6 x 1 & 3 x 1/2 & 6 x 1 & 4 x 3 & täglich \\
\interrowfill
\hline
\interrowfill
3 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
5 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
4 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
5 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
4 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
6 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
6 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
6 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
9 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
9 & & & & & & & & & & & & \\
\interrowfill
\hline
\interrowfill
7 & & & & & & & & & & & & \\
\interrowfill
\hline
\end{tabularhtx}}%
\end{adjustbox}
\end{document}
答案2
只需结束表格即可
\interrowfill
\hline
\multicolumn{13}{c}{\rule{0pt}{4ex}* comment}
\end{tabularhtx}
不可见的规则提供了垂直分隔。如果您希望注释从特定列(例如第七列)开始,请键入
\interrowfill
\hline
\multicolumn{6}{c}{} &
\multicolumn{7}{l}{\rule{0pt}{4ex}* comment}
\end{tabularhtx}
这是居中的图片: