18

This question led to a new package:
fullwidth

This is a followup to a similar question. The idea is to switch between two different margin sizes. The answer provided by @godbyk work very well. However, it is difficult if you are using an asymmetric page layout (e.g. \documentclass[twoside]{article} and the fullwidth environment spans over two pages. Is it possible to make it work in these cases, too?

The memoir manual states:

Note that the adjustwidth environment applies to complete paragraphs; you can’t change the width of part of a paragraph except for hanging paragraphs or more esoterically via \parshape. Further, if the adjusted paragraph crosses a page boundary the margin changes are constant; a paragraph that is, say, wider at the right on the first page will also be wider at the right as it continues onto the following page.

So, how to do it esoterically ;)

MWE:

\documentclass[twoside]{article}

\usepackage{changepage}% provides the adjustwidth environment

% The following code should be used *after* any changes to the margins and
% page layout are made (e.g., after the geometry package has been loaded).
\newlength{\fullwidthlen}
\setlength{\fullwidthlen}{\marginparwidth}
\addtolength{\fullwidthlen}{\marginparsep}

\newenvironment{fullwidth}{%
  \begin{adjustwidth*}{}{-\fullwidthlen}%
}{%
  \end{adjustwidth*}%
}

\usepackage{lipsum}% provides dummy text

\begin{document}

\lipsum[1]

\begin{fullwidth}
    \lipsum[2-10]
\end{fullwidth}

\lipsum[3]

\end{document}
6
  • 2
    Would you be able to elaborate a little more on what you mean by "an asymmetric design breaks on a new page"?
    – Werner
    Nov 10, 2011 at 16:33
  • @Andy I am not sure if I understand the question also. Could you post a sketch of what you are trying to achieve. Memoir when referring to esoteric mean for paragraphs only, i.e., you can make a sort of a shaped hole in a paragraph. Nov 10, 2011 at 16:55
  • 1
    The OP is trying to adjust the left and right margins of a specific block using adjustwidth. The block of text should accommodate page breaking and be able to switch between adjusting for the left (\marginparwidth+\marginparsep) on even pages, but for the same amount on the right for odd pages. So, the adjustwidth environment should switch accordingly from one margin adjustment to another, depending on the current page. Am I correct @Andy?
    – Werner
    Nov 10, 2011 at 17:02
  • The problem is particularly highlighted if you add \begin{fullwidth} \lipsum[2-10] \end{fullwidth} after \lipsum[3]; perhaps the OP could do so.
    – cmhughes
    Nov 10, 2011 at 17:07
  • @werner, yes, you are correct.
    – Andy
    Nov 10, 2011 at 18:34

1 Answer 1

26

The new package fullwidth is uploaded to CTAN. The development status is available on github.

\setcounter{errorcontextlines}{999}
\documentclass[twoside]{article}
\usepackage{showframe,lipsum}
\usepackage[innermargin=-2.0cm,]{fullwidth}
\begin{document}
\lipsum

%\clearpage
\begin{fullwidth}[width=\linewidth+2cm]
Start\par
\lipsum[1] \lipsum \lipsum
ENDE
\end{fullwidth}
\end{document}

Are you looking for somethink like the following example?

\documentclass[twoside]{article}
%\usepackage{showframe}
\usepackage{mdframed}
\usepackage{lipsum}
\begin{document}

\lipsum[1]

\begin{mdframed}[outermargin=\dimexpr-\marginparwidth-\marginparsep\relax,innermargin=0pt]
    \lipsum[2-10]
\end{mdframed}

\lipsum[3]
\end{document}
3
  • 2
    Yes, this looks very good. I guess, it would be easy to not show the frame, [hidealllines=true] shifts the box a little. Could you estimate how much of the 1000 lines in the package would be needed to achieve the behavior, without the options and other goodies you have in mdframes.
    – Andy
    Nov 11, 2011 at 6:20
  • 1
    @Andy: Based on my package I can create a new one which only sets the left/right or inner/outer margin. But not in the next five minutes ;-) Nov 11, 2011 at 8:33
  • 2
    @MarcoDaniel This works really nicely, but I tried using it for the bibliography ( since those are long, and don't need a large margin, since there won't be any sidenotes there). Well it doesn't work, and the compilation never finishes due to some endless loop. Using [nobreak=true]{mdframed} recommended here does not work either (first page of bibliography that still runs of the page is typeset).
    – Bernhard
    Feb 24, 2015 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.