Addmargin on even and odd pages

I have large outer margins and I want some time more text, on the left for even pages and on the right for odd pages. I tried:

\begin{addmargin*}
...


But the result is good only on the first page. Can anyone help me?

Here is my MWE (after trying to implement solutions in Dennis's answer):

\documentclass{scrbook}
\usepackage[inner=1.5 cm,outer=5.5cm]{geometry}
\usepackage{lipsum}
%\usepackage{scrextend} % load it if you're not using a KOMA class
\usepackage{lipsum}
\begin{document}
\chapter{One}
\lipsum[1-6]
\section{One-one}
\lipsum[1-3]
\setlength{\oddsidemargin}{15.5pt}
\setlength{\evensidemargin}{15.5pt}
\lipsum[2-11]
\lipsum[1-12]
\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}
\section{One-two}
\lipsum[1-3]
\end{document}

• Did you try using the geometry package? Which document class you are using? Dec 26, 2013 at 7:00
• KOMA Script includes its own package for adjust the layout, it is typearea and I suggest to use it instead of geometry. Take a look at the documentation. Dec 26, 2013 at 18:55
• The addmargin* environment has one mandatory (and one optional) argument, what I miss in your example before the MWE. It is in my eyes thought for short margin changes. And note, what can be read in KOMA-Script documentation: “Whether a page is going to be on the left or right side of the book can not be determined for certain in the first LATEX run.” Dec 27, 2013 at 23:40

I think all problems are now solved (also with the header) with this code:

\documentclass[twoside]{scrbook}
\usepackage{xcolor,graphicx,lipsum,multicol}
\usepackage[paperwidth=17.5cm,paperheight=23cm, inner=1.5cm,outer=5.5cm,top=3cm,bottom=3cm]{geometry}
\makeindex

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhfoffset[LE]{4cm}%
\fancyhfoffset[RO]{4cm}%
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancypagestyle{plain}{%
}

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{One}

\lipsum[1]\marginpar{\includegraphics[width=3cm]{pseudosfera.png}}
\section{One-one}
\begin{OneCol}
\lipsum[1-15]
\end{OneCol}
\marginpar{\textcolor{cyan}{Mauris ut leo. Cras
viverra metus rhoncus sem. Nulla et lectus vestibulum urna
fringilla ultrices. Phasellus eu tellus sit amet tortor gravida
placerat. Integer sapien est, iaculis in, pretium quis, viverra
ac, nunc.}}\lipsum[1]
\lipsum[2]
\lipsum[1]\marginpar{\includegraphics[width=3cm]{pseudosfera.png}}
\section{One-two}
\lipsum[1]

\begin{TwoCol}
\lipsum[2-12]
\end{TwoCol}

\lipsum[3-4]
\end{document}


I show some page of output:

• Looks good! Glad you were able to find a fix. If you think that this answers your question, feel free to mark it as the accepted answer. Dec 31, 2013 at 21:33

To expand upon MMA's suggestion, you could probably fix the issue by using the geometry package with the option outermargin=n units for whatever value of n and unit you want. Although, you might want to check out this question on alternating margins in the book class if you're having problems implementing the geometry solution.

If for whatever reason you don't want to use geometry, then vmargin might be a barebones option for you.

You can find a whole host of options by consulting the LaTeX wikibook section on page layout, specifically the margin section of that article.

UPDATE:

I'm still not 100% sure what you're looking for, but here are two attempts using geometry.

2 inch outer margins (right for odd pages, left for even):

\documentclass{scrbook}
\usepackage{lipsum}
\usepackage[outermargin=2 in]{geometry}
\begin{document}
\chapter{One}
\lipsum[1-6]
\section{One-one}
\lipsum[1-3]
\lipsum[2-11]
\lipsum[1-12]
\section{One-two}
\lipsum[1-3]
\end{document}


A somewhat absurd example to show changing margins on specific pages:

\documentclass{scrbook}
\usepackage{lipsum}
\usepackage[outermargin=2 in]{geometry}
\begin{document}
\chapter{One}
\lipsum[1-6]
\section{One-one}
\newgeometry{outermargin= 5 in}
\lipsum[1-3]
\lipsum[2-11]
\restoregeometry
\lipsum[1-12]
\section{One-two}
\lipsum[1-3]
\end{document}


Here we use \newgeometry to override what was set in the preamble (in this case, 2 inch outer margins) and specify a new option (in this case, the somewhat absurd 5 inch margins). \restoregeometry allows you to revert back to what was set in the preamble.

Both of these solutions, however, do alter the placement of the header/footer as you noted in comments.

UPDATE 2:

Here is an option using the changepage package that doesn't change the placement of headers and footers:

\documentclass{scrbook}
\usepackage{lipsum}
\usepackage{changepage}
\begin{document}
\chapter{One}
Dummy text to test. \lipsum[1]
\pagebreak
\section{One-one}
Dummy text to test. \lipsum[1]
\end{document}


This option allow you to manually set the width of a block of text. Doing this allows you to adjust the width of the text included in the adjustwidth environment. So long as the environment stays on a single page, it gets the desired result (I think). But obviously a somewhat of a pain of a solution.

• Which one? Also, could you post a Minimum Working Example (MWE) so that I can test my proposed solutions rather than guess at how your .tex file is set. Dec 26, 2013 at 18:21
• \documentclass{scrbook} \usepackage[inner=1.5 cm,outer=5.5cm]{geometry} \usepackage{lipsum} %\usepackage{scrextend} % load it if you're not using a KOMA class \usepackage{lipsum} \begin{document} \chapter{One} \lipsum[1-6] \section{One-one} \lipsum[1-3] \setlength{\oddsidemargin}{15.5pt} \setlength{\evensidemargin}{15.5pt} \lipsum[2-11] \lipsum[1-12] \setlength{\oddsidemargin}{0pt} \setlength{\evensidemargin}{0pt} \section{One-two} \lipsum[1-3] \end{document} Dec 26, 2013 at 18:40
• @RaffaeleSantoro I edited my answer based on what you gave me. This seems to work for me, let me know if it isn't what you wanted. Dec 26, 2013 at 18:54
• In fact isn't what I want; the margin changes not when I want; your's instruction in the preambule for me means a change for the whole document; I dont undestand wy only at centain points, we have a change... Dec 26, 2013 at 19:59

I found incompatibility with the fancyhdr package. So I dont use it. Making inspiration from this post Problem with odd/even margins when environment crosses page boundaries answer, my solution is:

\documentclass[twoside]{scrbook}

\usepackage{lipsum,multicol}
\usepackage[paperwidth=17.5cm,
paperheight=23cm,
inner=1.5cm,
outer=5.5cm,
top=3cm,
bottom=3cm]{geometry}

\makeindex

\begin{document}

\frontmatter

\tableofcontents

\mainmatter

\chapter{One}

\lipsum[1]

\section{One-one}

\begin{OneCol}
\lipsum[1-15]
\end{OneCol}

\lipsum[1-5]

\section{One-two}

\lipsum[1-3]

\begin{TwoCol}
\lipsum[2-12]
\end{TwoCol}

\lipsum[3-4]

\end{document}


And here is a part of the result (picture and side note added):

• To override incopatibility with fancyhdr, the better could be to put running heads on the center and the page numbers in center footers. Dec 27, 2013 at 12:06