0

Following up to that question I would like to know how to elegantly change some pages into landscape mode to display a diagram or so. Especially it should support the design which I posted in my original question (marked Answer)! Basically when in landscape the height/width of the grey areas should depend on the page orientation. I'm just not sure how to do that. Any help is appreciated.

Optional: It would be awesome if I can create new pages that have no grey areas by a command or so.

4
  • I think you don't have to adapt the page design, just use sidecap package (or something similar) to insert rotated captions. – Ignasi Nov 22 '17 at 11:26
  • Do you have any reference to a wiki or a working example to my situation? – SaifDeen Nov 22 '17 at 12:44
  • As far as I see it has nothing to do with my question because I'm talking about a page layout and not about captions.. – SaifDeen Nov 22 '17 at 12:47
  • 1
    For me the question currently is somehow unclear. Please be more precise in the description of what you want. A MWE that illustrates your current problem would be very useful. – Schweinebacke Nov 22 '17 at 13:04
4

If you don't need rotated output in the preview but only rotation of, e.g., a figure even a simple \rotatebox could be enough:

\documentclass[
  a4paper,
  12pt,
  titlepage,
  ngerman,
  footheight=15pt,
  headheight=15pt,
  oneside% seems to be a onesided layout
]{scrbook}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[page]{totalcount}
\usepackage{amsmath}
\usepackage{geometry}
\geometry{total={170mm,257mm}}
\usepackage[dvipsnames,svgnames,x11names]{xcolor}

%% footer
\usepackage{scrlayer-scrpage}
\setlength\footheight{15pt}
\clearpairofpagestyles
\ifoot*{\pagemark}
\cfoot*{Center}
\ofoot*{Right}
\setkomafont{pageheadfoot}{\sffamily\small}
\addtokomafont{pagenumber}{\sffamily\small}

\renewcommand\pagemark{{%
    \textbf{\MakeUppercase{\pagename}}
    \usekomafont{pagenumber}%
    \thepage/\totalpages
}}

%% rules on every page
\DeclareNewLayer[
    background,
    bottommargin,
    addvoffset=-\footheight,
    addvoffset=-.5ex,
    mode=picture,
    contents=\putUL{\textcolor{Silver}{\rule[-\layerheight]{\layerwidth}{\layerheight}}}
]{bottomrule}
\DeclareNewLayer[
    clone=bottomrule,
    textarea,
    voffset=0pt,
    height=\paperheight,
    addhoffset=\textwidth,
    addhoffset=1ex
]{rightrule}
\AddLayersToPageStyle{@everystyle@}{bottomrule,rightrule}

%% logo on the title page
\usepackage{graphicx}
\DeclareNewLayer[
    clone=rightrule,
    contents=\putUL{\raisebox{-\height}{\makebox[5mm][r]{\includegraphics[scale=.7]{example-grid-100x100bp}}}}
]{titlepagelogo}
\DeclarePageStyleByLayers{titlepage}{titlepagelogo}
%%

\definecolor{rubgray}{gray}{0.7}
\definecolor{rubblue}{HTML}{003560}
\definecolor{rubgreen}{HTML}{8dae10}

\usepackage{blindtext}% for dummy text

\begin{document}
\begin{titlepage}
  \thispagestyle{titlepage}
  \begin{center}
    \vspace*{4cm}
    {\Huge \textbf{ \textcolor{rubgray}{ABSCHLUSSBERICHT}}}
    \\
    \vspace*{1cm}
    {\Large \textbf{ \textcolor{rubblue}{Funktionsweise und Datenschutzgefährdung der Smart Border Systeme}}}
    \\
    \vspace*{2cm}
    Abschlussbericht der Projektarbeit für das Fach\\
    \textbf{Datenschutz WS 16/17}\\
    Im Studienfach\\
    \textbf{    B.Sc. Angewandte Informatik}
  \end{center}
  \vfill
  \begin{flushright}
    \textbf{Saif Al-Dilaimi (xxx)} \\
    \textcolor{rubblue}{\textbf{RUHR-UNIVERSITÄT} BOCHUM} \\
    Institut für Neuroinformatik \\
    Ruhr-Universität Bochum \\
    Universitätsstraße 150 \\
    44801 Bochum
  \end{flushright}
\end{titlepage}

\blinddocument

\begin{figure}
  \rotatebox{90}{%
    \parbox[c][\textwidth][c]{\textheight}{%
      \centering
      \includegraphics[width=.8\linewidth,height=.5\textwidth]{example-image}
      \caption{What's the problem?}
  }}%
\end{figure}

\blindtext
\end{document}

figure with rotatebox


And if you want to have real landscape pages inside the portrait document, you can combine typearea's options paper=landscape and paper=portrait with geometry's \newgeometry command using typearea's option usegeometry:

\documentclass[
  a4paper,
  12pt,
  titlepage,
  ngerman,
  footheight=15pt,
  headheight=15pt,
  usegeometry,
  oneside% seems to be a onesided layout
]{scrbook}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[page]{totalcount}
\usepackage{amsmath}
\usepackage{geometry}
\AtBeginDocument{\newgeometry{total={170mm,257mm}}}
\usepackage[dvipsnames,svgnames,x11names]{xcolor}

%% footer
\usepackage{scrlayer-scrpage}
\setlength\footheight{15pt}
\clearpairofpagestyles
\ifoot*{\pagemark}
\cfoot*{Center}
\ofoot*{Right}
\setkomafont{pageheadfoot}{\sffamily\small}
\addtokomafont{pagenumber}{\sffamily\small}

\renewcommand\pagemark{{%
    \textbf{\MakeUppercase{\pagename}}
    \usekomafont{pagenumber}%
    \thepage/\totalpages
}}

%% rules on every page
\DeclareNewLayer[
    background,
    bottommargin,
    addvoffset=-\footheight,
    addvoffset=-.5ex,
    mode=picture,
    contents=\putUL{\textcolor{Silver}{\rule[-\layerheight]{\layerwidth}{\layerheight}}}
]{bottomrule}
\DeclareNewLayer[
    clone=bottomrule,
    textarea,
    voffset=0pt,
    height=\paperheight,
    addhoffset=\textwidth,
    addhoffset=1ex
]{rightrule}
\AddLayersToPageStyle{@everystyle@}{bottomrule,rightrule}

%% logo on the title page
\usepackage{graphicx}
\DeclareNewLayer[
    clone=rightrule,
    contents=\putUL{\raisebox{-\height}{\makebox[5mm][r]{\includegraphics[scale=.7]{example-grid-100x100bp}}}}
]{titlepagelogo}
\DeclarePageStyleByLayers{titlepage}{titlepagelogo}
%%

\definecolor{rubgray}{gray}{0.7}
\definecolor{rubblue}{HTML}{003560}
\definecolor{rubgreen}{HTML}{8dae10}

\usepackage{blindtext}% for dummy text

\begin{document}
\begin{titlepage}
  \thispagestyle{titlepage}
  \begin{center}
    \vspace*{4cm}
    {\Huge \textbf{ \textcolor{rubgray}{ABSCHLUSSBERICHT}}}
    \\
    \vspace*{1cm}
    {\Large \textbf{ \textcolor{rubblue}{Funktionsweise und Datenschutzgefährdung der Smart Border Systeme}}}
    \\
    \vspace*{2cm}
    Abschlussbericht der Projektarbeit für das Fach\\
    \textbf{Datenschutz WS 16/17}\\
    Im Studienfach\\
    \textbf{    B.Sc. Angewandte Informatik}
  \end{center}
  \vfill
  \begin{flushright}
    \textbf{Saif Al-Dilaimi (xxx)} \\
    \textcolor{rubblue}{\textbf{RUHR-UNIVERSITÄT} BOCHUM} \\
    Institut für Neuroinformatik \\
    Ruhr-Universität Bochum \\
    Universitätsstraße 150 \\
    44801 Bochum
  \end{flushright}
\end{titlepage}

\blinddocument

\cleardoubleoddpage
\KOMAoptions{paper=landscape,DIV=current}
\newgeometry{total={257mm,170mm}}
\blindtext[2]

\cleardoubleoddpage
\KOMAoptions{paper=portrait,DIV=current}
\newgeometry{total={170mm,257mm}}
\blindtext[2]

\end{document}

enter image description here

If you need to switch often, you can store the setting once, using typearea's \storeareas and use the stored settings often:

\storeareas\useportrait
\cleardoubleoddpage
\KOMAoptions{paper=landscape,DIV=current}
\newgeometry{total={257mm,170mm}}
\storeareas\uselandscape
\blindtext[2]

\cleardoubleoddpage\useportrait
\blindtext[2]

\cleardoubleoddpage\uselandscape
\blindtext[2]

\cleardoubleoddpage\useportrait
\blindtext[2]

\cleardoubleoddpage\uselandscape
\blindtext[2]

\cleardoubleoddpage\useportrait
\blindtext[2]

or you can define two commands in the document preamble:

\newcommand*{\useportrait}{%
  \cleardoubleoddpage
  \KOMAoptions{paper=portrait,DIV=current}%
  \newgeometry{total={170mm,257mm}}%
}

\newcommand*{\uselandscape}{%
  \cleardoubleoddpage
  \KOMAoptions{paper=landscape,DIV=current}%
  \newgeometry{total={257mm,170mm}}%
}

and use these commands to switch:

\documentclass[
  a4paper,
  12pt,
  titlepage,
  ngerman,
  footheight=15pt,
  headheight=15pt,
  usegeometry,
  oneside% seems to be a onesided layout
]{scrbook}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[page]{totalcount}
\usepackage{amsmath}
\usepackage{geometry}
\newcommand*{\useportrait}{%
  \cleardoublepage
  \KOMAoptions{paper=portrait,DIV=current}%
  \newgeometry{total={170mm,257mm}}%
}
\newcommand*{\uselandscape}{%
  \cleardoublepage
  \KOMAoptions{paper=landscape,DIV=current}%
  \newgeometry{total={257mm,170mm}}%
}
\AtBeginDocument{\useportrait}

\usepackage[dvipsnames,svgnames,x11names]{xcolor}

%% footer
\usepackage{scrlayer-scrpage}
\setlength\footheight{15pt}
\clearpairofpagestyles
\ifoot*{\pagemark}
\cfoot*{Center}
\ofoot*{Right}
\setkomafont{pageheadfoot}{\sffamily\small}
\addtokomafont{pagenumber}{\sffamily\small}

\renewcommand\pagemark{{%
    \textbf{\MakeUppercase{\pagename}}
    \usekomafont{pagenumber}%
    \thepage/\totalpages
}}

%% rules on every page
\DeclareNewLayer[
    background,
    bottommargin,
    addvoffset=-\footheight,
    addvoffset=-.5ex,
    mode=picture,
    contents=\putUL{\textcolor{Silver}{\rule[-\layerheight]{\layerwidth}{\layerheight}}}
]{bottomrule}
\DeclareNewLayer[
    clone=bottomrule,
    textarea,
    voffset=0pt,
    height=\paperheight,
    addhoffset=\textwidth,
    addhoffset=1ex
]{rightrule}
\AddLayersToPageStyle{@everystyle@}{bottomrule,rightrule}

%% logo on the title page
\usepackage{graphicx}
\DeclareNewLayer[
    clone=rightrule,
    contents=\putUL{\raisebox{-\height}{\makebox[5mm][r]{\includegraphics[scale=.7]{example-grid-100x100bp}}}}
]{titlepagelogo}
\DeclarePageStyleByLayers{titlepage}{titlepagelogo}
%%

\definecolor{rubgray}{gray}{0.7}
\definecolor{rubblue}{HTML}{003560}
\definecolor{rubgreen}{HTML}{8dae10}

\usepackage{blindtext}% for dummy text

\begin{document}
\begin{titlepage}
  \thispagestyle{titlepage}
  \begin{center}
    \vspace*{4cm}
    {\Huge \textbf{ \textcolor{rubgray}{ABSCHLUSSBERICHT}}}
    \\
    \vspace*{1cm}
    {\Large \textbf{ \textcolor{rubblue}{Funktionsweise und Datenschutzgefährdung der Smart Border Systeme}}}
    \\
    \vspace*{2cm}
    Abschlussbericht der Projektarbeit für das Fach\\
    \textbf{Datenschutz WS 16/17}\\
    Im Studienfach\\
    \textbf{    B.Sc. Angewandte Informatik}
  \end{center}
  \vfill
  \begin{flushright}
    \textbf{Saif Al-Dilaimi (xxx)} \\
    \textcolor{rubblue}{\textbf{RUHR-UNIVERSITÄT} BOCHUM} \\
    Institut für Neuroinformatik \\
    Ruhr-Universität Bochum \\
    Universitätsstraße 150 \\
    44801 Bochum
  \end{flushright}
\end{titlepage}

\blinddocument

\uselandscape
\blindtext[2]

\useportrait
\blindtext[2]
\end{document}
5
  • looks great! Is there a way to avoid changing the geometry each time ? – SaifDeen Nov 22 '17 at 13:16
  • @SaifDeen You can use \storeareas to store them once and use them often. Or you can define two commands in the document preamble. – Schweinebacke Nov 22 '17 at 13:25
  • awesome, I have to go with your answer altough both are excellent. But you have also solved it according my wishes. @esdd gave also an answer to my optional question. Too bad I cant set both as correct answer. – SaifDeen Nov 22 '17 at 13:43
  • I got an issue: when I'm using the commands texmaker says that \landscape and \potrait are already defined. If I change name to \uselandscape the geometry changes but it stays in potrait mode. See: imgur.com/a/Iv6yR – SaifDeen Nov 22 '17 at 14:08
  • \landscape is also defined by package pdflscape or package lscape. There was a little typo in the landscape switch: it should be paper=landscape. – esdd Nov 22 '17 at 14:33
3

There is no MWE in the question, so I do not know what you are meaning by landscape mode. Maybe you want to use the environment landscape provided by package pdflscape? I also do not understand what the desired layout is.

If you want to get

enter image description here

you can load package scrhack.

Code:

\documentclass[
  a4paper,
  12pt,
  titlepage,
  ngerman,
  footheight=15pt,
  headheight=15pt,
  oneside% seems to be a onesided layout
]{scrbook}
\usepackage{scrhack}% <- added
\usepackage{pdflscape}% <- added
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[page]{totalcount}
\usepackage{amsmath}
\usepackage{geometry}
 \geometry{
     total={170mm,257mm}
 }
\usepackage[dvipsnames,svgnames,x11names]{xcolor}

%% footer
\usepackage{scrlayer-scrpage}
\setlength\footheight{15pt}
\clearpairofpagestyles
\ifoot*{\pagemark}
\cfoot*{Center}
\ofoot*{Right}
\setkomafont{pageheadfoot}{\sffamily\small}
\addtokomafont{pagenumber}{\sffamily\small}

\renewcommand\pagemark{{%
    \textbf{\MakeUppercase{\pagename}}
    \usekomafont{pagenumber}%
    \thepage/\totalpages
}}

%% rules on every page
\DeclareNewLayer[
    background,
    bottommargin,
    addvoffset=-\footheight,
    addvoffset=-.5ex,
    mode=picture,
    contents=\putUL{\textcolor{Silver}{\rule[-\layerheight]{\layerwidth}{\layerheight}}}
]{bottomrule}
\DeclareNewLayer[
    clone=bottomrule,
    textarea,
    voffset=0pt,
    height=\paperheight,
    addhoffset=\textwidth,
    addhoffset=1ex
]{rightrule}
\AddLayersToPageStyle{@everystyle@}{bottomrule,rightrule}

%% logo on the title page
\usepackage{graphicx}
\DeclareNewLayer[
    clone=rightrule,
    contents=\putUL{\raisebox{-\height}{\makebox[5mm][r]{\includegraphics[scale=.7]{example-grid-100x100bp}}}}
]{titlepagelogo}
\DeclarePageStyleByLayers{titlepage}{titlepagelogo}
%%

\definecolor{rubgray}{gray}{0.7}
\definecolor{rubblue}{HTML}{003560}
\definecolor{rubgreen}{HTML}{8dae10}

\usepackage{blindtext}% for dummy text

\begin{document}
\begin{titlepage}
  \thispagestyle{titlepage}
  \begin{center}
    \vspace*{4cm}
    {\Huge \textbf{ \textcolor{rubgray}{ABSCHLUSSBERICHT}}}
    \\
    \vspace*{1cm}
    {\Large \textbf{ \textcolor{rubblue}{Funktionsweise und Datenschutzgefährdung der Smart Border Systeme}}}
    \\
    \vspace*{2cm}
    Abschlussbericht der Projektarbeit für das Fach\\
    \textbf{Datenschutz WS 16/17}\\
    Im Studienfach\\
    \textbf{    B.Sc. Angewandte Informatik}
  \end{center}
  \vfill
  \begin{flushright}
    \textbf{Saif Al-Dilaimi (xxx)} \\
    \textcolor{rubblue}{\textbf{RUHR-UNIVERSITÄT} BOCHUM} \\
    Institut für Neuroinformatik \\
    Ruhr-Universität Bochum \\
    Universitätsstraße 150 \\
    44801 Bochum
  \end{flushright}
\end{titlepage}

\blinddocument
\begin{landscape}
\Blindtext
\end{landscape}
\blinddocument
\end{document}

Regarding your second question: You can define commands which add or remove layers from a page style.

\newcommand*\AddRulesToPageStyles{%
  \IfLayerAtPageStyle{@everystyle@}{bottomrule}{}{%
    \AddLayersToPageStyle{@everystyle@}{bottomrule}}
  \IfLayerAtPageStyle{@everystyle@}{rightrule}{}{%
    \AddLayersToPageStyle{@everystyle@}{rightrule}}
}
\newcommand*\RemoveRulesFromPageStyles{%
  \RemoveLayersFromPageStyle{@everystyle@}{bottomrule,rightrule}%
}

Note that page style @everystyle@ is special: its layers are part of all layer page styles.

enter image description here

Code:

\documentclass[
  a4paper,
  12pt,
  titlepage,
  ngerman,
  footheight=15pt,
  headheight=15pt,
  oneside% seems to be a onesided layout
]{scrbook}
\usepackage{scrhack}% <- added
\usepackage{pdflscape}% <- added
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[page]{totalcount}
\usepackage{amsmath}
\usepackage{geometry}
 \geometry{
     total={170mm,257mm}
 }
\usepackage[dvipsnames,svgnames,x11names]{xcolor}

%% footer
\usepackage{scrlayer-scrpage}
\setlength\footheight{15pt}
\clearpairofpagestyles
\ifoot*{\pagemark}
\cfoot*{Center}
\ofoot*{Right}
\setkomafont{pageheadfoot}{\sffamily\small}
\addtokomafont{pagenumber}{\sffamily\small}

\renewcommand\pagemark{{%
    \textbf{\MakeUppercase{\pagename}}
    \usekomafont{pagenumber}%
    \thepage/\totalpages
}}

%% rules on every page
\DeclareNewLayer[
    background,
    bottommargin,
    addvoffset=-\footheight,
    addvoffset=-.5ex,
    mode=picture,
    contents=\putUL{\textcolor{Silver}{\rule[-\layerheight]{\layerwidth}{\layerheight}}}
]{bottomrule}
\DeclareNewLayer[
    clone=bottomrule,
    textarea,
    voffset=0pt,
    height=\paperheight,
    addhoffset=\textwidth,
    addhoffset=1ex
]{rightrule}
\newcommand*\AddRulesToPageStyles{%
  \IfLayerAtPageStyle{@everystyle@}{bottomrule}{}{%
    \AddLayersToPageStyle{@everystyle@}{bottomrule}}
  \IfLayerAtPageStyle{@everystyle@}{rightrule}{}{%
    \AddLayersToPageStyle{@everystyle@}{rightrule}}
}
\newcommand*\RemoveRulesFromPageStyles{%
  \RemoveLayersFromPageStyle{@everystyle@}{bottomrule,rightrule}%
}
\AddRulesToPageStyles

%% logo on the title page
\usepackage{graphicx}
\DeclareNewLayer[
    clone=rightrule,
    contents=\putUL{\raisebox{-\height}{\makebox[5mm][r]{\includegraphics[scale=.7]{example-grid-100x100bp}}}}
]{titlepagelogo}
\DeclarePageStyleByLayers{titlepage}{titlepagelogo}
%%

\definecolor{rubgray}{gray}{0.7}
\definecolor{rubblue}{HTML}{003560}
\definecolor{rubgreen}{HTML}{8dae10}

\usepackage{blindtext}% for dummy text

\begin{document}
\begin{titlepage}
  \thispagestyle{titlepage}
  \begin{center}
    \vspace*{4cm}
    {\Huge \textbf{ \textcolor{rubgray}{ABSCHLUSSBERICHT}}}
    \\
    \vspace*{1cm}
    {\Large \textbf{ \textcolor{rubblue}{Funktionsweise und Datenschutzgefährdung der Smart Border Systeme}}}
    \\
    \vspace*{2cm}
    Abschlussbericht der Projektarbeit für das Fach\\
    \textbf{Datenschutz WS 16/17}\\
    Im Studienfach\\
    \textbf{    B.Sc. Angewandte Informatik}
  \end{center}
  \vfill
  \begin{flushright}
    \textbf{Saif Al-Dilaimi (xxx)} \\
    \textcolor{rubblue}{\textbf{RUHR-UNIVERSITÄT} BOCHUM} \\
    Institut für Neuroinformatik \\
    Ruhr-Universität Bochum \\
    Universitätsstraße 150 \\
    44801 Bochum
  \end{flushright}
\end{titlepage}

\blinddocument
\begin{landscape}
\RemoveRulesFromPageStyles
\Blindtext
\end{landscape}
\AddRulesToPageStyles
\blinddocument
\end{document}
4
  • Sorry for not providing a MWE but you were right and thats exactly what I want. Ty so much! Is it maybe possible to move footer - and its text (page number etc.) - on landscape from left to the bottom gray area? Is it also possible to move the left gray area to the right on landscape? – SaifDeen Nov 22 '17 at 13:01
  • This will be possible by declaring new layer page styles. But I think the result would be really ugly if you print your document ... – esdd Nov 22 '17 at 13:09
  • Oh which part do you mean? Moving the left gray area or moving the footer text down? – SaifDeen Nov 22 '17 at 13:12
  • 1
    Both. If somebody reads/scrolls the printed book then the bottom rule jumps to the top and the footer entries to the right margin ... I do not recommend to change the normal layout in that way, especially if the document should be printed. – esdd Nov 22 '17 at 13:19

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.