4

I am creating a document using the memoir class and pedersen style. In my document which is mainly portrait, I have to display some diagrams in a landscape orientation. Unfortunatley, one of the pages turned out to be a chapter title too. Now usually this would not be a problem, but my document has a header and footer. As a result, this happened:

\documentclass[12pt,a4paper,oneside]{memoir}
\usepackage[left=3.00cm, right=3.00cm, top=3.00cm, bottom=3.00cm, a4paper]{geometry}
\usepackage{pdflscape,blindtext,graphicx,xcolor}

%Defining a colour %
\definecolor{ared}{HTML}{BF0000}
\renewcommand\colorchapnum{\color{ared}}
\renewcommand\colorchaptitle{\color{ared}}

\chapterstyle{pedersen}

%The header of the document %
\makeevenhead{plain}{MyName}{Document Title}{Date}
\makeheadrule{plain}{\textwidth}{1pt}
\makeoddhead{plain}{MyName}{Document Title}{Date}


\begin{document}
    \Blindtext
    \pagebreak
    \begin{landscape}
        \chapter{Chapter Name}
            \Blindtext
     \end{landscape}    
\end{document}

Is there a way to temporarily reposition the chapter number, so that it will only affect this page or the pages I set to landscape?

Thanks in advance

2 Answers2

3

Rather than changing the styling of the chapter title itself, I would keep the page style the same --- it seems odd to me to switch the chapter style.

Instead, I would either have the diagram float to another page or simply rotate the diagram on the title page, without rotating the page itself.

For example, allowing the diagram to float to the next page:

floating figure

I assume this isn't an option or you would have avoided having the diagram on the title page in the first place. In that case, I would rotate the diagram alone in place:

rotate diagram in place

The rotating package can manage the rotation. caption can provide a caption for the non-floating case. (But if memoir provides either of these facilities, it would be better to use those than additional packages. I'm just not very familiar with the class.)

\documentclass[12pt,a4paper,oneside]{memoir}
\usepackage[left=3.00cm, right=3.00cm, top=3.00cm, bottom=3.00cm]{geometry}
\usepackage{blindtext,rotating,xcolor,caption}
\usepackage{graphicx}
%Defining a colour %
\definecolor{ared}{HTML}{BF0000}
\renewcommand\colorchapnum{\color{ared}}
\renewcommand\colorchaptitle{\color{ared}}

\chapterstyle{pedersen}

%The header of the document %
\makeevenhead{plain}{MyName}{Document Title}{Date}
\makeheadrule{plain}{\textwidth}{1pt}
\makeoddhead{plain}{MyName}{Document Title}{Date}

\begin{document}
  \Blindtext
  \chapter{Chapter Name}
  \begin{sidewaysfigure}
    \includegraphics[width=\textheight, keepaspectratio=false]{example-image-a}
    \caption{Image}
  \end{sidewaysfigure}
  \Blindtext
  \chapter{Chapter Name}
  \begin{center}
    \begin{sideways}
      \includegraphics[width=.825\textheight, keepaspectratio=false]{example-image-b}
    \end{sideways}
    \captionof{figure}{Another}
  \end{center}
  \Blindtext
\end{document}
cfr
  • 198,882
  • 1
    @mark I would go witht hat solution. I would have suggested something similar. Imagine the reader holding your work. and all of the sudden, the whole thing is distorted. This will look like something messed up rather than consciously having changed the page layout. – Johannes_B Jan 25 '15 at 14:46
  • We wanna see a screenshot in chat with the 33333. Some cake would also be nice ;-) – Johannes_B Jan 25 '15 at 14:47
  • I was thinking of moving the diagram to another page. They are a series of UML diagrams, and since one of them is small, it fits on a portrait page, however it's also the last diagram I wished to display. Regarding your other method, to me it looks a little bit weird, but I see what you mean, even though my page only has a caption and the chapter title as text (due to the large size). – Mark Said Camilleri Jan 25 '15 at 14:54
  • @Johannes_B ??? – cfr Jan 25 '15 at 15:42
  • @markscamilleri I would prefer the first option. However, I would use the second rather than changing the layout of the chapter title for a single case. – cfr Jan 25 '15 at 15:44
1

I'd make a 'special' pedersen style and just use that.

\documentclass[12pt,a4paper,oneside]{memoir}
\usepackage[left=3.00cm, right=3.00cm, top=3.00cm, bottom=3.00cm, a4paper]{geometry}
\usepackage{pdflscape,blindtext,graphicx,xcolor}

%Defining a colour %
\definecolor{ared}{HTML}{BF0000}
\renewcommand\colorchapnum{\color{ared}}
\renewcommand\colorchaptitle{\color{ared}}

\makechapterstyle{mypedersen}{% <-- definition of `pedersen` from memoir.cls
  \chapterstyle{default}
  \setlength{\beforechapskip}{-20pt}
  \setlength{\afterchapskip}{10pt}
  \renewcommand*{\chapnamefont}{\normalfont\LARGE\itshape}
  \renewcommand*{\chapnumfont}{\normalfont\HUGE\itshape\colorchapnum}
  \renewcommand*{\chaptitlefont}{\normalfont\huge\itshape\colorchaptitle}
  \renewcommand*{\afterchapternum}{}
  \renewcommand*{\printchaptername}{}
  \setlength{\midchapskip}{20mm}% was \numberheight
  \renewcommand*{\chapternamenum}{}
  \renewcommand*{\printchapternum}{%
    \sidebar{%
      \hspace*{-48pt}%  <-- added
      \raisebox{0pt}[0pt][0pt]{\makebox[0pt][l]{%
      \resizebox{!}{\midchapskip}{\chapnumfont\thechapter}}}}}%
  \renewcommand*{\printchaptertitle}[1]{\chaptitlefont ##1}}

\chapterstyle{pedersen}

%The header of the document %
\makeevenhead{plain}{MyName}{Document Title}{Date}
\makeheadrule{plain}{\textwidth}{1pt}
\makeoddhead{plain}{MyName}{Document Title}{Date}


\begin{document}
\Blindtext
\pagebreak
\begin{landscape}
  \chapterstyle{mypedersen}% <-- switch to the modified style
  \chapter{Chapter Name}
  \Blindtext
\end{landscape}
% strictly speaking, the next line isn't needed because the previous \chaptersytle command is in a group; but it is sometimes helpful to be reminded of what you are doing!
\chapterstyle{pedersen}% <-- switch back to normal; 
\chapter{Chapter Name}
\Blindtext
\end{document}
jon
  • 22,325