I am trying to disable marginpar when starting a new multi-tiered environment with this new environment that uses multicols and chngpage packages:
\newenvironment{multi}[1]{% \newlength{\newtextwidth}% \setlength{\newtextwidth}{\marginparwidth}% \addtolength{\newtextwidth}{-1cm}% \addtolength{\headheight}{.5cm}% \let\oldheadrule\headrule% \addtolength{\headwidth}{\newtextwidth}% \begin{adjustwidth}{}{-\newtextwidth}\begin{multicols}{
What works great: latex header http://img6.imageshack.us/img6/6757/screenshotewa.png
Uhm, almost, since on the last page of the current chapter of "Lorem ipsum" it behaves as if I did not instruct it: \ addtolength {\ headwidth} {\ newtextwidth}: latex heading at the end of the chapter http: //img11.imageshack .us / img11 / 6072 / screenshotwbd.png
How can i fix this?
Edit
I also use fancyhdr.
2nd Edit :
A PoC:
\documentclass[12pt,a4paper,oneside]{report} \usepackage[utf8]{inputenc} \usepackage[top=2cm,left=2cm,right=4.5cm]{geometry} \usepackage{chngpage} \usepackage{color} \usepackage{amsmath} \usepackage[pdftex,bookmarks,pdfpagemode=UseOutlines,bookmarksopen,backref ,colorlinks,urlcolor=blue,linktocpage]{hyperref} \usepackage{url} \usepackage{amssymb} \usepackage{lipsum} \usepackage{fancyhdr} \usepackage{multicol} \usepackage{indentfirst} \usepackage{listings} \usepackage{boxedminipage} \pagestyle{fancy} \setlength{\columnseprule}{1pt} \setlength{\marginparwidth}{4cm} \rhead{\large\leftmark} \renewcommand{\chaptermark}[1]{% \markboth{
It should be possible to continue the single-column page on the same page after "multi", but the headers should be stored as if the page was launched in the "multi" environment.
Why do I need one column after several columns on the same page with marginpar? Imagine the source code of an article, with a few tips in the margin. (This is what the listing package has)
source share