# Environment for text to run into margins

After posting this closed question, I found a good solution for memoir on this page.

However, my margins settings are different then the ones he uses, and as a result, the widematter environment only works correctly on odd-numbered pages; on even-numbered pages, the widematter has the text run off to the wrong side, and it even goes off the page. Is there an easy way to debug this?

UPDATE:

Using @daleif's suggestion, I have the following MWE:

\documentclass[11pt,a4paper]{memoir}

\setstocksize{297mm}{210mm}
\settrimmedsize{\stockheight}{195mm}{*}
\settypeblocksize{671.6pt}{335.8pt}{*}
%\settypeblocksize{675pt}{337.5pt}{*}
%\settypeblocksize{*}{28pc}{2}
\setlrmargins{*}{*}{4}
\setulmargins{*}{*}{2}
\setmarginnotes{5mm}{45.23mm}{\onelineskip}
\setlength{\footskip}{3.0\baselineskip}
\checkandfixthelayout

\newlength{\extrawidth}
\setlength{\extrawidth}{\marginparsep}

\marginparmargin{outer}
\strictpagechecktrue
\newenvironment{widematter}{
\mpjustification}

\begin{document}
Here is some regular text that goes all the way to the margin and wraps around on the next line.
\begin{widematter}
Here is a test of the widematter environment, to see if the text is able to extend beyond the margin.
\end{widematter}
\end{document}

But this still doesn't work for even-numbered pages--the widematter text extends into the right margin, when it should be extending into the left margin...

(Also, is there any way to insert a page break into this MWE so that I can demonstrate the extra width on even-numbered pages?)

ANOTHER UPDATE:

Using Marco Daniel's fullwidth package, I have the following MWE:

\documentclass[11pt,a4paper]{memoir}

\setstocksize{297mm}{210mm}
\settrimmedsize{\stockheight}{195mm}{*}
\settypeblocksize{671.6pt}{335.8pt}{*}
%\settypeblocksize{675pt}{337.5pt}{*}
%\settypeblocksize{*}{28pc}{2}
\setlrmargins{*}{*}{4}
\setulmargins{*}{*}{2}
\setmarginnotes{5mm}{45.23mm}{\onelineskip}
\setlength{\footskip}{3.0\baselineskip}
\checkandfixthelayout

\usepackage[innermargin=-2.0cm,]{fullwidth}

\begin{document}

Testing some regular text that goes on past the first line, and then repeats.
Testing some regular text that goes on past the first line, and then repeats.
Testing some regular text that goes on past the first line, and then repeats.

\begin{fullwidth}[width=\linewidth+2cm]

Testing some regular text that goes on past the first line, and then repeats.
Testing some regular text that goes on past the first line, and then repeats.
Testing some regular text that goes on past the first line, and then repeats.

\end{fullwidth}

\end{document}

The first time it compiles, there are warnings about undefined references, but the fullwidth text extends past the margin on the right, which looks good. The second time it compiles, the warnings disappear, but now the text extends past the margin on the left (the wrong side)...

To clarify: for odd-numbered pages, the margin on the left represents necessary space for binding, whereas the margin on the right is just extra space (and visa-versa for even-numbered pages). With these settings, fullwidth is making the text extend into the binding margin, which is bad--I only want it to extend into the non-binding margin. I tried changing the code to have \usepackage[innermargin=0cm,]{fullwidth} and \begin{fullwidth}[width=\linewidth-2cm], but that only seems to work for odd-numbered pages--even-numbered pages still have fullwidth text go into the binding margin

-
The environment adjustwidth doesn't support pagebreaks. What's the problem with the linked package fullwidth –  Marco Daniel Dec 15 '11 at 1:31
While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that reproduces the problem. Difficult to debug or test any possible solution without it. –  Peter Grill Dec 15 '11 at 2:03
@jamaicanworm as Marco Daniel suggested, why don't you use the solution given in How to switch between two margin sizes?. It works out of the box! –  Gonzalo Medina Dec 15 '11 at 20:15
@jamaicanworm: The examples work as expected. The width is \linewith+2cm and the innermargin is -2cm. I can't see any problems and warnings? –  Marco Daniel Dec 15 '11 at 22:38

I would just use

\marginparmargin{outer}
\strictpagechecktrue
\newenvironment{widematter}{
\mpjustification
}

And yes, adjustwidth* is not intended for things that cross a two pages. It is a simple environment made via list, mostly indented to enable users to make a local area (on a page) larger or smaller.

And next time please post something that actually compile, we waste a lot of time trying to find our crystal balls and figure out that people actually mean and which packages they have forgotten to include.

-
Thank you for your suggestion--I updated my post with a MWE that uses your solution. However, I'm still getting the errors described below the code... –  jamaicanworm Dec 15 '11 at 16:01
@jamaicanworm: Since you replaced your code with @ daleif's snippet, you removed your definition of the length \extrawidth. If you re-insert that, does it work now? –  Werner Dec 15 '11 at 16:53
Good catch! I updated my original question--I'm still getting an error... Also, is there any way to insert a page break into this MWE so that I can also test the extra width on even-numbered pages? –  jamaicanworm Dec 15 '11 at 17:08
@jamaicanworm: Use the lipsum package and write \lipsum[1] to create one paragraph of dummy text, or \lipsum[1-15] to create 10 paragraphs of dummy text; however many you need to build a large enough paragraph (or document) padded with dummy text. –  Werner Dec 15 '11 at 20:15

If you only one to change the margin in a portion of the text (a paragraph for example) I found this solution very helpful: