Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

memoir, adjustwidth* and multiple pages

51 views
Skip to first unread message

William F. Adams

unread,
May 30, 2004, 7:48:54 PM5/30/04
to
I need to turn off the marginpar area for a run of pages.

I tried something like the following minimal example, but it only works on
right hand pages---on versos the left margin is unchanged, and the right
extended into the binding.

I found some similar discussion in the past, but it trails off w/o an
indication of a definite fix. I'm using the latest memoir and mempatch.sty.

William


\documentclass{memoir}
\usepackage{multicol}
\strictpagechecktrue
\newcommand{\anotsolongparagraph}{This is a test of multiple columns and
floats. Now is the time for all good men to come to the aid of their party.
Sphinx of black quartz, judge my vow.\par}
\newcommand{\alongparagraph}{This is a test of multiple columns and floats. Now
is the time for all good men to come to the aid of their party. Sphinx of black
quartz, judge my vow. This is a test of multiple columns and floats. Now is the
time for all good men to come to the aid of their party. Sphinx of black
quartz, judge my vow. This is a test of multiple columns and floats. Now is the
time for all good men to come to the aid of their party. Sphinx of black
quartz, judge my vow.\par}

\begin{document}

%$\hat$

Testing, 1, 2, 3. \marginpar{Testing the width of a marginal paragraph.
Testing, I repeat testing.} \anotsolongparagraph


\newlength{\threecolwidthadjustment}
\addtolength{\threecolwidthadjustment}{\marginparwidth}
\addtolength{\threecolwidthadjustment}{\marginparsep}
\begin{adjustwidth*}{0em}{-\threecolwidthadjustment}%
\begin{multicols}{3}
\anotsolongparagraph
\alongparagraph
\anotsolongparagraph
\alongparagraph
\alongparagraph
\anotsolongparagraph
\alongparagraph
\alongparagraph
\anotsolongparagraph
\alongparagraph
\alongparagraph
\anotsolongparagraph
\alongparagraph
\alongparagraph
\anotsolongparagraph
\alongparagraph
\alongparagraph
\anotsolongparagraph
\alongparagraph
\alongparagraph
\anotsolongparagraph
\alongparagraph
\alongparagraph
\anotsolongparagraph
\alongparagraph
\alongparagraph
\anotsolongparagraph
\alongparagraph
\end{multicols}
\end{adjustwidth*}
\end{document}

--
William Adams
http://members.aol.com/willadams
Sphinx of black quartz, judge my vow.

Lars Madsen

unread,
May 31, 2004, 5:28:39 AM5/31/04
to
The answer is found on page 99 in the memoir manual

``..is 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.''

Internally adjustwidth is implemented as a list, and as far as I know one
cannot change the horizontal dimensions of a list dynamically at a page
boundary.

So basically adjustwidth should only be used for material that doesn't
cross a page boundary.

If anyone has a solution to this problem, I'd also like to know.

--
/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ: http://www.tex.ac.uk/faq
AMSMATH Intro: http://www.ams.org/tex/short-math-guide.html
LaTeX Intro: http://people.ee.ethz.ch/~oetiker/lshort/lshort.pdf
Graphics Intro: http://www.ctan.org/tex-archive/info/epslatex.pdf
Superb Class:
http://www.ctan.org/tex-archive/help/Catalogue/entries/memoir.html
Remember to post minimal working examples.

William F. Adams

unread,
May 30, 2004, 9:53:27 PM5/30/04
to
daleif said:
> The answer is found on page 99 in the memoir manual

>``..is 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.''

>Internally adjustwidth is implemented as a list, and as far as I know one
>cannot change the horizontal dimensions of a list dynamically at a page
>boundary.

>So basically adjustwidth should only be used for material that doesn't
>cross a page boundary.

Got it. Drat that uncertain organic memory (and my shortsightedness at stopping
reading when I hit ``\strictpagechecktrue'' since I already had that on).

>If anyone has a solution to this problem, I'd also like to know.

Hmm, is there any other way to approach this?

I think I can get this to work if I can just manage to adjust the left margin
for verso pages only....

William

guido

unread,
Jun 10, 2004, 7:48:45 PM6/10/04
to

"Lars Madsen" <dal...@rtfsignatureimf.au.dk> wrote in message
news:opr8uxx1...@daleif.stofanet.dk...

> The answer is found on page 99 in the memoir manual
>
> ``..is 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.''
>
> Internally adjustwidth is implemented as a list, and as far as I know one
> cannot change the horizontal dimensions of a list dynamically at a page
> boundary.
>
> So basically adjustwidth should only be used for material that doesn't
> cross a page boundary.
>
> If anyone has a solution to this problem, I'd also like to know.
>

Here is a rough hack to this problem with many hard coded values.

\documentclass{article}
\usepackage{calc}

%
% just to test it
%
\setlength{\textwidth}{5cm}
\setlength{\textheight}{5cm}

\newbox\tempa
\newbox\tempb
%
% we create two auxiliary environment that extend to the outer margin
% the value of the extension in the outermargin should be a parameter
%
\newenvironment{leftm}{%
\begin{list}%
{}
{\setlength{\leftmargin}{-1cm}
\setlength{\rightmargin}{0cm}}\item}{\end{list}}
\newenvironment{rightm}{%
\begin{list}%
{}
{\setlength{\leftmargin}{0cm}
\setlength{\rightmargin}{-1cm}}\item}{\end{list}}
%
%
%
\newlength{\FreeSpace}
\newlength{\TakenSpace}

\newenvironment{outermargin}{
\par
\setbox\tempa=\vbox\bgroup\hsize 6cm%
% obviously 6cm is a measure for this example
% it should be a parameter calculated
}{%
\egroup
\setlength{\TakenSpace}{\textheight-\pagetotal}
\setlength{\FreeSpace}{\ht\tempa}
% more computations are needed here to determine the proper values
\ifdim\TakenSpace<\FreeSpace
\sbox{\tempb}{\vsplit\tempa to .85\TakenSpace}%
% well the .85 is just a rough hack to make it work in this example
% the proper value of \TakenSpace shold be computed in the previous
steps
\ifodd\thepage
\begin{rightm}
\usebox{\tempb}
\end{rightm}\newpage
\begin{leftm}
\usebox{\tempa}
\end{leftm}
\else
\begin{leftm}
\usebox{\tempb}
\end{leftm}\newpage
\begin{rightm}
\usebox{\tempa}
\end{rightm}
\fi
\else
% here we should use same test as before but without splitting \tempa
\usebox{\tempa}
\fi}

\begin{document}
bla bla bla bla bla bla bla
bla bla bla bla bla bla bla
bla bla bla bla bla bla bla
bla bla bla bla bla bla bla
\begin{outermargin}
more text more text more text
more text more text more text
more text more text more text
more text more text more text
\[\alpha+\beta\]
more text more text more text

more text more text more text
more text more text more text
more text more text more text
\end{outermargin}
bla bla bla bla bla bla bla
bla bla bla bla bla bla bla
bla bla bla bla bla bla bla
\end{document}

Hope this helps

Guido

--
Dr Guido Governatori
SChool of ITEE
The University of Queensland
guido at itee dot uq dot edu dot au


"Žarko F. Čučej"

unread,
Jun 11, 2004, 5:28:36 PM6/11/04
to
guido wrote:
> "Lars Madsen" <dal...@rtfsignatureimf.au.dk> wrote in message
> news:opr8uxx1...@daleif.stofanet.dk...
>
[snip]

>
> Here is a rough hack to this problem with many hard coded values.
>
[snip]
Dear Guido,
this very interesting solution. I adopt it to adjustwith mechanism of
memoir and it work almost excellent. The problem arise, if in text
before environment "outermargin" is some footnote. Using above code the
whole content of "outermargin" is moved on the next page, and footnote
is positioned immediately after text and not at bottom of page.

In my adopting above code to adjustwith mechanisms in memoir one
footnote is tolerated, in case of two of them, the footnotes are moved
under bottom of page and outermargin is moved on the next page. Above
happened in both code (yours and mine adoption) only in a case, when
tempa box should be split.

I expect, that in the worse case footnotes will be overwritten due to
wrong calculation of vertical space left to the bottom of a page. Is
there a way to manage this problem?

Regards, Zarko

my addoption of your code follows:

%---------------------------------------------------------------%
% note : note with numbering %
% addopted from Guido's solution %
% c.t.t: memoir, adjustwidth* and multiple pages %
%---------------------------------------------------------------%
% format: width = \textwidth %
% position = adjusted by \adjustwidth* %
%--------------------------------------------------- note counter
\newcounter{note}
\renewcommand{\thenote}{\thechapter.\arabic{note}}
%------------------------------------------ new lenghts and boxes
\newlength{\FreeSpace}
\newlength{\TakenSpace}
\newbox\tempa
\newbox\tempb
%---------------------------------------------------- positioning
\strictpagechecktrue
%----------------------------------------------------- definition
\newenvironment{note}{%outermargin ...
\vskip 1ex plus .5ex minus .5 ex%
\par\footnotesize\sffamily\slshape
\setbox\tempa=\vbox\bgroup\noindent%
\textbf{NOTE~\thenote\qquad}%
\hsize\textwidth%
% obviously the \textwidth is a measure of the note width
}{%
\hfill\QED
\egroup
%------------------------------------------- vertical measurement


\setlength{\TakenSpace}{\textheight-\pagetotal}
\setlength{\FreeSpace}{\ht\tempa}
% more computations are needed here to determine the proper values
\ifdim\TakenSpace<\FreeSpace
\sbox{\tempb}{\vsplit\tempa to .85\TakenSpace}%
% well the .85 is just a rough hack to make it work in this example

% the proper value of \TakenSpace should be computed in the previous steps
%------------------------------------- writing a text: first part
\begin{adjustwidth*}{\marginparwidth}{-\marginparwidth}
\noindent
\usebox{\tempb}
\end{adjustwidth*}\newpage
%------------------------------------ writing a text: second part
\begin{adjustwidth*}{\marginparwidth}{-\marginparwidth}
\usebox{\tempa}
\end{adjustwidth*}
\else
%------------------------------------- writing a text in one part
% here the same test as before is used but without splitting \tempa
\begin{adjustwidth*}{\marginparwidth}{-\marginparwidth}
\noindent
\usebox{\tempa}
\end{adjustwidth*}
\fi
\vskip 1ex plus .5ex minus .5 ex
\fussy
}


0 new messages