0

I'm using KOMA script and have a long table that I put sideways. I want to increase the margins for the single page that contains the table. I can do this with \KOMAoptions or \areaset both have the same disadvantages:

  1. lots of warnings about use of typeare outside of the header
  2. still the footer is larger then the header. I think that looks odd, and I would like just to set a fixed maring (e.g. 2cm) on both sides and use the remaining space for the table.

Here an example:

    \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}

Is there any way to solve this?

  • You are thinking too complicated. Make a new document with your font settings, change the margins with geometry, include the pdf in your document using pdfpages. Don't forget to set the counter to an appropriate value. – Johannes_B Oct 19 '15 at 9:36
  • That sounds feasible, but then I can't use glossary entries, cross-references, citations in the table caption, .... So I think it would be better to put everything in one document – Jonas Oct 20 '15 at 9:54
  • A similar question popped up on TeXwelt, it might help you: texwelt.de/wissen/fragen/14903/… – Johannes_B Oct 20 '15 at 9:57
1

You can do something like the following, which is stolen from saputello on TeXwelt.

\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}

The warning about doing this stuff in the preamble remains tough.


If you want to get completely rid of the warning, you have your own idea how the page is supposed to look like anyway, use geometry for the large page. Keyword now: 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}
  • Thanks! I didn't know that I can use both, koma-script and geometry. But why do you need usegeometry? – Jonas Oct 23 '15 at 16:23
  • Because otherwise, you cannot use them together. – Johannes_B Oct 23 '15 at 16:30
  • @Jonas I should add, that this is undocumented yet and can change everytime. – Johannes_B Oct 23 '15 at 17:04
  • Sth else about this solution: \newgeometry requires a \clearpage. This prevents the table from floating. Is there any way to let the table float despite changing the geometry? – Jonas Feb 6 '17 at 15:39
  • @Jonas A sidewaystable cannot float. It just can't. Nothing to do with geometry. – Johannes_B Feb 6 '17 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.