# \marginpar start at top of page

I am trying to build a minitoc in a marginpar. It can span several pages. Everything is fine while there is no figures on the top of the page. I need the contents to start from the top of typing area in second page.

MWE:

\documentclass{article}
\usepackage{marginfix}
\usepackage{geometry}
\textwidth=2in
\geometry{paperwidth=4in, paperheight=3in, lmargin=1cm, rmargin=4cm, bottom=1.5em, nohead}
\marginparsep=20pt
\usepackage[frame]{crop}

\usepackage{filecontents}

\begin{filecontents}{mytoc.tex}
\marginpar{This text gets written}
\marginpar{This text gets written}
\marginpar{This text gets written}
\marginpar{This text gets written}
\marginpar{This text gets written}
\marginpar{This text gets written}
\marginpar{This text gets written}
\marginpar{This text gets written}
\end{filecontents}

\begin{document}
\input mytoc.tex
some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text

some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text

some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text

some text some text some text some text some text

\begin{figure}
\fbox{\vbox to 2cm{\hsize=2cm \null\hfill}}
\end{figure}
\end{document}


output:

Or maybe there is a special package for margin contents?

• The figure is a separate block that doesn't participate to margin note positioning. Jul 19, 2016 at 15:03

This solution uses paracol instead of \marginpar.

\documentclass{book}
\usepackage{geometry}
\geometry{paperwidth=4in, paperheight=3in, lmargin=1cm, rmargin=1cm, bottom=1.5em}

\usepackage{paracol}
\columnsep=20pt
\setcolumnwidth{2in,\dimexpr 2in-2cm-\columnsep\relax}
\twosided[pc]% swap margins and columns

\usepackage{filecontents}

\begin{filecontents}{mytoc.tex}
This text gets written\\
This text gets written\\
This text gets written\\
This text gets written\\
This text gets written\\
This text gets written\\
This text gets written\\
This text gets written\\
This text gets written\\
\end{filecontents}

\begin{document}
\begin{paracol}{2}
\switchcolumn
\bgroup\parindent=0pt\raggedright% normal \marginpar parameters
\input mytoc.tex
\egroup% keep local
\switchcolumn

some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text

some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text

some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text some text

some text some text some text some text some text

\begin{figure}
\fbox{\vbox to 2cm{\hsize=2cm \null\hfill}}
\end{figure}
\end{paracol}
\end{document}

• I forgot to mention that it's a two side book. This means that chapter contents breaking the page needs to jump to different side of next page (that's how \marginpar does). Jul 20, 2016 at 7:19
• Not a problem. Paracol can handle that too. Jul 20, 2016 at 15:49