我使用的是 KOMA 脚本,并且有一个横向放置的长表。我想增加包含该表的单页的边距。我可以这样做,\KOMAoptions
或者\areaset
两者都有相同的缺点:
- 标题之外有很多关于使用 typeare 的警告
- 页脚仍然比页眉大。我认为这看起来很奇怪,我只想在两侧设置一个固定标记(例如 2cm),并将剩余空间用于表格。
下面是一个例子:
\documentclass[DIV=10,headsepline,footsepline]{scrbook}
\usepackage{rotating}
\usepackage{tabu}
\usepackage{blindtext}
\begin{document}
\chapter{Test}
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\clearpage
\thispagestyle{empty}
\KOMAoptions{DIV=20}
\begin{sidewaystable}
\caption{A Table}
\begin{tabu} to \linewidth {|X|c|c|c|}
\blindtext & sample & sample & sample \\
\blindtext & sample & sample & sample \\
\blindtext & sample & sample & sample
\end{tabu}
\end{sidewaystable}
\end{document}
有什么办法可以解决这个问题吗?
答案1
\documentclass[DIV=10,headsepline,footsepline,captions=tableabove]{scrbook}
\usepackage{rotating}
\usepackage{tabu}
\usepackage{showframe}
\usepackage{blindtext}
\AtBeginDocument{
\storeareas\NormalArea
%\KOMAoptions{headinclude=false,footinclude=false,DIV=20,}
\KOMAoptions{headinclude=false}
\areaset{180mm}{280mm}
\storeareas\LargeArea
\NormalArea
\newcommand*{\switchtoNormal}{\clearpage\NormalArea}%
\newcommand*{\switchtoLarge}{\clearpage\LargeArea}%
}
\begin{document}
\chapter{Test}
\blindtext[9]
\switchtoLarge
\begin{sidewaystable}
\thispagestyle{empty}
\caption{A Table}
\begin{tabu} to \linewidth {|X|c|c|c|}
\blindtext & sample & sample & sample \\
\blindtext & sample & sample & sample \\
\blindtext & sample & sample & sample \\
\blindtext & sample & sample & sample \\
\end{tabu}
\end{sidewaystable}
\switchtoNormal
\chapter{Test}
\blindtext[9]
\end{document}
序言中关于做这些事情的警告仍然很严厉。
如果您想完全消除警告,您对页面的外观有自己的想法,请使用几何图形来显示大页面。关键字现在:usegeometry
\documentclass[usegeometry,DIV=10,headsepline,footsepline,captions=tableabove]{scrbook}
\usepackage{rotating}
\usepackage{tabu}
\usepackage{geometry}
\geometry{showframe}
\usepackage{blindtext}
\begin{document}
\chapter{Test}
\blindtext[9]
\newgeometry{margin=.9cm}
\begin{sidewaystable}
\thispagestyle{empty}
\caption{A Table}
\begin{tabu} to \linewidth {|X|c|c|c|}
\blindtext & sample & sample & sample \\
\blindtext & sample & sample & sample \\
\blindtext & sample & sample & sample \\
\blindtext & sample & sample & sample \\
\end{tabu}
\end{sidewaystable}
\restoregeometry
\chapter{Test}
\blindtext[9]
\end{document}