3

I've followed

Chapterstyle Memoir: Picture on page left, chapter opening on page right

to get a picture opposite the part page in a two-sided document prepared with memoir. My document has outer margins that are larger than the inner margins. To use the full width and to get a centered picture opposite the part page, I use the changepage package's adjustwidth command. However, the picture is not centered although some dummy text I used for testing purposes is. The following MWE illustrates the problem:

\documentclass[a4paper]{memoir}
\setstocksize{29.7cm}{21.0cm} % A4 stock
\settrimmedsize{27.94cm}{21.0cm}{*} % 27.94cm = 11in
\setlength{\trimtop}{0.0cm}
\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
\settypeblocksize{23.94cm}{12.3cm}{*}
\setlrmargins{1.13cm}{*}{*}
\setulmargins{2.0cm}{*}{*}
\setmarginnotes{\onelineskip}{6.15cm}{\onelineskip}
\sidecapmargin{outer}
\setsidecaps{\onelineskip}{6.15cm} 
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{changepage}
\checkandfixthelayout
\usepackage[pdftex]{hyperref}
\begin{document}
\part{First part}
\cleartoverso 
\begin{adjustwidth}{-6.15cm}{} % temporarily use full page width
\lipsum[1] % dummy text for testing, uses full page width
\begin{figure}
  \centering     
  \begin{tikzpicture}
    \draw (0,0) rectangle (12,12);
  \end{tikzpicture}
\end{figure}
\end{adjustwidth} % switch back
\part{Second part}
\lipsum[1-6]
\end{document}

What am I doing wrong or overlooking?

user1362373
  • 2,859
  • By "opposite to the part page" do you mean on the left where you have the part title on the right? As of now, it seems like you're trying to place the image on the left after (and therefore behind or on the back of) the part page. – Werner Nov 22 '15 at 21:12
  • 1
    Switch the order of figure and adjustwidth (and fix the typo in \end{adjust width}). Also: memoir already has the adjustwidth environment, so no need to load changepage. – jon Nov 22 '15 at 21:43
  • You don't really want this to float, do you? – cfr Nov 22 '15 at 22:13
  • @Werner: Yes, I want it on the left page. It may look like it's placed after because I put the figure to the left of the second part page. In that sense, my MWE was not quite minimal... – user1362373 Nov 23 '15 at 07:31
  • @jon: Sorry about the typo, that was due to autocorrect and is now fixed. – user1362373 Nov 23 '15 at 07:31

1 Answers1

3

You really don't want the picture to float, but figure tells LaTeX to float the contents. This introduces complications it seems best to do without. Moreover, eliminating the figure environment solves the centring problem:

centred image

\documentclass[a4paper]{memoir}
\setstocksize{29.7cm}{21.0cm} % A4 stock
\settrimmedsize{27.94cm}{21.0cm}{*} % 27.94cm = 11in
\setlength{\trimtop}{0.0cm}
\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
\settypeblocksize{23.94cm}{12.3cm}{*}
\setlrmargins{1.13cm}{*}{*}
\setulmargins{2.0cm}{*}{*}
\setmarginnotes{\onelineskip}{6.15cm}{\onelineskip}
\sidecapmargin{outer}
\setsidecaps{\onelineskip}{6.15cm}
\usepackage{tikz}
\usepackage{lipsum}
\checkandfixthelayout
\usepackage{hyperref}
\begin{document}
\part{First part}
\cleartoverso
\begin{adjustwidth}{-6.15cm}{}% temporarily use full page width
  \centering
  \begin{tikzpicture}
    \draw (0,0) rectangle (12,12);
  \end{tikzpicture}
\end{adjustwidth}% switch back
\part{Second part}
\lipsum[1-6]
\end{document}

If you need a caption, you can use \captionof{}{} from the caption or capt-of packages. (Unless this is another cherry memoir has already picked ;).

cfr
  • 198,882
  • I think, myself, that this will look rather odd and it would be better not to change the page layout for this. That is, the double-page spread is now 'off' to my eye. – cfr Nov 22 '15 at 22:22
  • 1
    Please, remove the pdftex option from hyperref. – egreg Nov 22 '15 at 22:22
  • @egreg Thanks. I meant to do that and then forgot. – cfr Nov 22 '15 at 22:23
  • And if(!) you do want it to float, just put adjustwidth inside figure (which may be useful to know in other circumstances).... – jon Nov 22 '15 at 22:32
  • @jon But then it might not end up opposite the page it is meant to be opposite. I guess usually it'll work. But it seems to introduce complications for nothing! – cfr Nov 22 '15 at 22:46
  • A reasonable concern, indeed. (Hence the 'in other circumstances' ... and, partly, the reason I didn't answer.) – jon Nov 23 '15 at 02:28
  • @cfr: Thanks for your answer. You are right that it looks odd, this is because I have not changed the style of the part page to use the whole page width (which I do in my real document). – user1362373 Nov 23 '15 at 07:32
  • @egreg: Are you suggesting the pdftex option should be removed in general or because it's not relevant to the MWE? If it's the latter, my apologies, but if it's the former, can you please explain why? – user1362373 Nov 23 '15 at 07:38
  • @user1362373 In general; hyperref is able to distinguish whether latex, pdflatex, xelatex or lualatex is being used and to load the appropriate driver. Thus the explicit option limits portability and, since it's not necessary, it's better not to add it. The same is true for graphicx. Only special drivers, such as dvipdfmx in case you do latex+dvipdfmx, are to be explicitly mentioned. – egreg Nov 23 '15 at 10:30
  • 1
    @cfr: Another of memoir's cherries is its \legend command for an unnumbered caption. – Peter Wilson Nov 23 '15 at 14:22