0

I have a sample of doc in latex and would like you to explain why this is not working as expected.

This is the code:

\documentclass{memoir}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{background}

\begin{document}
\SetBgContents{plain}
\pagestyle{plain}
\makeoddhead{plain}{}{}{header test}
\blinddocument
\clearpage
\blinddocument
\clearpage
\blinddocument
\clearpage
\end{document}

After compilation:

  1. Indentation of the page changes from page to page

  2. "header test" some time appears, sometime not

  3. There are blank pages when I explicitly put "clearpage"

Can you please explain how to solve and make something stable ? Thanks

theCode
  • 1,287
  • 2
  • 13
  • 27

1 Answers1

1
  1. Unless specified otherwise, the default option passed to memoir is to set the document in twoside mode. See p 5 of the memoir documentation under REMARKS:

    Calling the class with no options is equivalent to:

    \documentclass[letterpaper,10pt,twoside,onecolumn,openright,final]{memoir}
    

    Under twoside, the odd and even pages are offset from the inner margin, or the gutter. This results in the differing "indentations" of the page.

  2. \makeoddhead only sets the header for odd pages. Odd pages only occur every other page, leaving even page headers empty (the default for the plain page style).

  3. \clearpage flushes all pending floats and starts a new page. There should be no blank page issued. However, with a call to \chapter, memoir actually issues \clearforchapter, which is similar to \cleartorecto or \cleardoublepage. This necessarily clears pages until an odd page is reached, ensuring that a chapter starts on a right.

Werner
  • 11,788
  • 6
  • 39
  • 60