Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
\setlength{\headwidth}{\dimexpr\textwidth+\marginparsep+1.0\marginparwidth\relax}
\checkandfixthelayout

\newlength{\extrawidth}
\setlength{\extrawidth}{\marginparsep}
\addtolength{\extrawidth}{\marginparwidth}

\marginparmargin{outer}
\strictpagechecktrue
\newenvironment{widematter}{
\begin{adjustwidth*}{0mm}{-\extrawidth}
\mpjustification}
{\end{adjustwidth*}}

\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}
\setlength{\headwidth}{\dimexpr\textwidth+\marginparsep+1.0\marginparwidth\relax}
\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

share|improve this question
5  
The environment adjustwidth doesn't support pagebreaks. What's the problem with the linked package fullwidth –  Marco Daniel Dec 15 '11 at 1:31
1  
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
1  
In your updated code, change \setlength{\headwidth}{\textwidth+\marginparsep+1.0\marginparwidth} to \setlength{\headwidth}{\dimexpr\textwidth+\marginparsep+1.0\marginparwidth\rela‌​x} –  Gonzalo Medina Dec 15 '11 at 17:15
1  
@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
1  
@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
show 6 more comments

2 Answers

up vote 3 down vote accepted

I would just use

\marginparmargin{outer}
\strictpagechecktrue
\newenvironment{widematter}{
  \begin{adjustwidth*}{0mm}{-\extrawidth}
    \mpjustification
  }
  {\end{adjustwidth*}}

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.

share|improve this answer
    
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
1  
@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
1  
@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
add comment

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

\addtolength{length_variable}{length}
....your text...
share|improve this answer
    
Welcome to TeX.SX! –  Papiro Jul 1 '13 at 21:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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