# Margin notes on the wrong page when using landscape in memoir

I have tried several similar to the following code, but the best that I can get is the marginpar on one side and the figure in the following.

The first \marginpar{\lipsum[11]}\lipsum[1] is positioned as expected while the second \marginpar{\lipsum[11]}, inside afterpage, does not.

\documentclass[a4paper,11pt]{memoir}
\usepackage{afterpage}
\usepackage{amsfonts,amsmath,amssymb,amsthm}
%\usepackage[utf8]{inputenc}%\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage{emptypage}
\usepackage{eucal}\usepackage[showframe]{geometry}
\usepackage{latexsym}\usepackage{lmodern}
\usepackage{mathrsfs}\usepackage{newlfont}
\usepackage{lscape}%\usepackage{pdflscape}
\usepackage{lipsum}\usepackage{tikz}
\usepackage{hyperref}

\setstocksize{297mm}{210mm}
\settrimmedsize{297mm}{210mm}{*}
\settypeblocksize{252mm}{150mm}{*}
\setlrmarginsandblock{20mm}{40mm}{*}
\setulmarginsandblock{20mm}{25mm}{*}
\setmarginnotes{5mm}{30mm}{2\onelineskip}
\checkandfixthelayout

\begin{document}

\frontmatter

\tableofcontents

\listoffigures

\mainmatter

\chapter{Chapter}

\marginpar{\lipsum[11]}\lipsum[1]%% works correctly

\afterpage{%%
\marginpar{Again: \lipsum[11]}%% goes one page before the figure
\begin{landscape}
\begin{figure}
\centering\includegraphics[width=1.55\textwidth]{image.pdf}
\caption{Caption}\label{img01}
\end{figure}
\end{landscape}
}%%

\end{document}

What I would like to achieve is just a "simple" landscape page with one picture and a brief text comment in the fore margin. And then to write more such pages.

I have tried to manage the marginpar (or marginnote) in relation to afterpage/landscape in several ways now, is there a way to fix this syntax? Or a completely different approach would be better?

PS: sorry, since you need any image.pdf to make mine a MWE.

Is this problem related to afterpage or landscape? Substituting \afterpage{...} with the following, I get always the same: note on the recto page and figure on the corresponding verso page.

\newpage%%\clearpage

%\afterpage{%%
%\begin{landscape}
\marginpar{Ancora: \lipsum[11]}
\begin{figure}
\centering\includegraphics[angle=90,width=\textwidth]{image.pdf}
\caption{Caption}\label{img01}
\end{figure}
%\end{landscape}
%}%%

\newpage%%\clearpage

What I obtain is always very similar to page 2 and 3 in the following image, while I would like contents of pages 2 and 3 to be on the same page.

This misbehaviour happens also with - e.g. - width=.15\textwidth: so I'm thinking it's not even a matter of "top of the marginnote aligned to the top of the figure". Thank you.

• You are aware that landscape starts a new page? Have you tried adding it inside the landscape env? – daleif Aug 10 '14 at 6:17
• Yes, of course, thanks....this was included in "I have tried several similar to the following".... – MattAllegro Aug 10 '14 at 10:53

This compiles just fine

\begin{landscape}
\marginpar{Again: \lipsum[11]}%% goes one page before the figure
\begin{figure}

But of course

\begin{landscape}
\begin{figure}
\marginpar{Again: \lipsum[11]}%% goes one page before the figure

will not work as both figure and \marginpar are floats and they do not mix.

In the last example, \sidebar (similar to \marginnote from the package of the same name) will work.

From the comment below, by daleif:

If the margin comment has to be in the portrait margin, then you cannot use the landscape env. You need the sideways env (not the sidewaysfigure).

• MMhh...No sidebar package in my package manager (MikTeX 2.9).Your first code compiles (no errors), but the positioning of the contents of \marginpar{} is not acceptable: part of it gets out of the page – MattAllegro Aug 10 '14 at 13:33
• Sidebar is a feature in memoir – daleif Aug 10 '14 at 14:05
• No way, not even with sidebar. And the output is still very similar using appropriate packages and environment sidewaysfigure instead... – MattAllegro Aug 10 '14 at 14:33
• Then explain what exactly it is you need. If the margin comment has to be in the portrait margin, then you cannot use the landscape env. You need the sideways env (not the sidewaysfigure`) – daleif Aug 10 '14 at 14:40
• Man, you did it. This use of env sideways behaves as I expected. Thank you twice cause it's sunday. – MattAllegro Aug 10 '14 at 14:47