As others have said, you can use the tufte-book
document class. It offers captions in the sidenotes area and a fullwidth
environment that stretches across the main text block and the sidenotes area.
\documentclass{tufte-book}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{figure}[!ht]
\centering
\rule{4cm}{2cm}
\caption{A black rectangle with lots of text so it fills up some space.}
\end{figure}
\lipsum[1]
\begin{table}[!ht]
\centering
\rule{4cm}{2cm}
\caption{A black rectangle with lots of text so it fills up some space.}
\end{table}
\begin{fullwidth}
\lipsum[1]
\end{fullwidth}
\end{document}
If you don't want to use the tufte-book
class, then you can use one of the standard ones (book
, report
) together with the geometry
package to change the page layout, the floatrow
package to have captions in the margins, and the changepage
package to change the margins for a part of a document:
\documentclass{book}
\usepackage[margin=4cm,marginparwidth=3cm]{geometry}
\usepackage{floatrow}
\usepackage{changepage}
\usepackage{lipsum}
\floatsetup{margins=hangleft,capposition=beside,
capbesideposition={top,left},floatwidth=\textwidth}
\begin{document}
\lipsum[1]
\begin{figure}[!ht]
\centering
\rule{4cm}{2cm}
\caption{A black rectangle with lots of text so it fills up some space.}
\end{figure}
\lipsum[1]
\begin{table}[!ht]
\centering
\rule{4cm}{2cm}
\caption{A black rectangle with lots of text so it fills up some space.}
\end{table}
\begin{adjustwidth}{-3cm}{}
\lipsum[1]
\end{adjustwidth}
\end{document}
You could also consider using one of the classes from the KOMA-Script bundle (scrbook
, scrreprt
) or the memoir
document class and adapting them to your needs.
One option is to use Metapost backgrounds and use the trick described in Conditional page backgrounds in ConTeXt.
\startMPinclusions
numeric ChapterPageDone[];
\stopMPinclusions
\startuseMPgraphic{chapterbackground}
StartPage;
n := \somenamedheadnumber{chapter}{current};
x0 := PaperWidth - BackSpace;
x1 := x0 + RightMarginWidth;
if n > 0 : % ignore pages before the first chapter
if unknown ChapterPageDone[n] : % This is the first page a new chapter
fill (x0,0) -- (x1,0) -- (x1, PaperHeight) -- (x0, PaperHeight) -- cycle
withcolor \MPcolor{blue};
ChapterPageDone[n] := 1 ;
fi;
fi;
StopPage;
\stopuseMPgraphic
\defineoverlay[chapterbackground][\useMPgraphic{chapterbackground}]
\setupbackgrounds[page][background=chapterbackground]
\setuppapersize[A6]
\starttext
Non chapter page
\chapter{First}
Chapter page
\page
Non chapter page
\chapter{Second}
Chapter page
\stoptext
which gives
EDIT Based on the comment below, the above method will not work for unnumbered section heads. In that case, one option is to check if there has been a change in the title of chapter. Such an approach will work as long as you do not have two chapters with identical titles.
\startMPinclusions
string prevChapterTitle, currentChapterTitle;
prevChapterTitle := "";
currentChapterTitle := "";
\stopMPinclusions
\startuseMPgraphic{chapterbackground}
StartPage;
currentChapterTitle := "\namedstructurevariable{chapter}{title}";
x0 := PaperWidth - BackSpace;
x1 := x0 + RightMarginWidth;
if currentChapterTitle <> prevChapterTitle :
fill (x0,0) -- (x1,0) -- (x1, PaperHeight) -- (x0, PaperHeight) -- cycle
withcolor \MPcolor{blue};
prevChapterTitle := currentChapterTitle ;
fi;
StopPage;
\stopuseMPgraphic
\defineoverlay[chapterbackground][\useMPgraphic{chapterbackground}]
\setupbackgrounds[page][background=chapterbackground]
To exclude the table of contents page, make the following minor change:
if prevChapterText <> "":
fill (x0,0) -- (x1,0) -- (x1, PaperHeight) -- (x0, PaperHeight) -- cycle
withcolor \MPcolor{blue};
fi;
Best Answer
First of all you should load "mparhack", that fixes some problems with marginal notes. Then you should define your command for inserting marginal notes:
or maybe
if you want to experiment with color. It will be easier for you to change the formatting of all marginal notes without going into the details of the implementation of \marginpar.
For XeLaTeX, if the main font has the
Color
feature activated, a different trick should be used:In other words, we duplicate the main font family with a different color. If other families are used in marginal notes, they should be duplicated as well. If there is a small number of marginal notes, also
can be used, without duplicating the font families; note, however, that this causes a big overhead, since a new font families will be defined on the fly for each marginal note.