4

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*}
...
\end{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}
lockstep
  • 250,273
  • Did you try using the geometry package? Which document class you are using? – Masroor Dec 26 '13 at 07:00
  • 2
    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. – Aradnix Dec 26 '13 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.” – Speravir Dec 27 '13 at 23:40

3 Answers3

3

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

\documentclass[twoside]{scrbook}
\usepackage{adjmulticol}
\usepackage{xcolor,graphicx,lipsum,multicol}
\usepackage[paperwidth=17.5cm,paperheight=23cm, inner=1.5cm,outer=5.5cm,top=3cm,bottom=3cm]{geometry}
\newenvironment{TwoCol}{\small\begin{adjmulticols}{2}{0cm}{-4cm}}{\end{adjmulticols}}
\newenvironment{OneCol}{\small\begin{adjmulticols}{1}{0cm}{-4cm}}{\end{adjmulticols}}
\makeindex

\usepackage{fancyhdr}
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{2pt}
\fancyhf{}
\fancyhfoffset[LE]{4cm}%
    \fancyhfoffset[RO]{4cm}%
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\fancypagestyle{plain}{%
\fancyhead{} % get rid of headers
\renewcommand{\headrulewidth}{0pt} % and the line
}

\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: enter image description here enter image description here

  • 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. – Dennis Dec 31 '13 at 21:33
2

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} 
\begin{adjustwidth}{}{1in}  % <----                  
Dummy text to test. \lipsum[1]
\end{adjustwidth} 
\pagebreak 
\section{One-one}
\begin{adjustwidth}{1in}{}                  
Dummy text to test. \lipsum[1]
\end{adjustwidth} 
\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.

Dennis
  • 3,855
  • Your answer alter also the setting of header and/or fouter. – Raffaele Santoro Dec 26 '13 at 08:08
  • 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. – Dennis Dec 26 '13 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}

    – Raffaele Santoro Dec 26 '13 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. – Dennis Dec 26 '13 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... – Raffaele Santoro Dec 26 '13 at 19:59
  • @RaffaeleSantoro Wow, yea, I completely misunderstood your request. I've removed my suggestion since it was completely off-base. If I understand correctly, you want to add to the outer margins so that there is more room for text. I'll take another crack at it. – Dennis Dec 26 '13 at 20:10
  • @RaffaeleSantoro Do you want larger outer margins on every page? Or only some pages? – Dennis Dec 26 '13 at 20:20
  • @RaffaeleSantoro Ok, added two more attempts using geometry. Let me know whether these are what you're after. Still looking for a way to hold header/footer fixed. Once we have a solution we should go through and delete our comments in this thread--- it's getting rather long. – Dennis Dec 26 '13 at 20:34
  • Sorry for my English! I want for normal text pages with 1.5 cm of inner margin, 5.5 cm of outer margin. Normally in outer margin I put figure, comments,... But, for example for historical notes or proposed problems, I want more space for text for half page, one page or more continuous pages. For this I need to work on outer margins and leave always the inner margin to 1.5 cm. The proposed solutions only works on one page! – Raffaele Santoro Dec 26 '13 at 23:13
  • @RaffaeleSantoro Yes, the most recently proposed solution will only work if the text within the environment stays on a single page. You could add this to every page, but that would obviously be very annoying and wouldn't allow you to do much editing after the fact. I'm not sure at this time how to fix that. I asked a question here along these lines. If I can get an answer to that question, then I think we'll have a decent solution. – Dennis Dec 26 '13 at 23:30
2

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{adjmulticol}
\usepackage{lipsum,multicol}
\usepackage[paperwidth=17.5cm,
            paperheight=23cm,
            inner=1.5cm,
            outer=5.5cm,
            top=3cm,
            bottom=3cm]{geometry}

\newenvironment{TwoCol}{\small\begin{adjmulticols}{2}{0cm}{-4cm}}{\end{adjmulticols}}

\newenvironment{OneCol}{\small\begin{adjmulticols}{1}{0cm}{-4cm}}{\end{adjmulticols}}

\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): enter image description here

enter image description here

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