I am automatically creating large documents that use fancytabs as thumb marks and that also use marginpar notes to convey information about the text. (I actually put them in a Tikz lozenge since fancytabs has loaded tikz anyway - see example). The problem is that often in a few hundred page document the marginpar will collide with the fancytab. It is going to be hugely time consuming if I have to shift them manually.
I can work out where on a page the fancy tab is going to appear and as per the example its easy to manually shift the marginpars. I can't work out how to determine where (vertically) the marginpar will appear. Marginpar also takes care to make sure the margin notes don't collide with each other, but I am struggling to work out how to stop the marginpars colliding with the tabs.
Any help or pointers much appreciated.
Here is a short working example
\documentclass[11pt, oneside]{article}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage{amssymb}
\usepackage{fancytabs}
\usepackage{lipsum}
\fancytabsWidth{3cm}
\let\oldmarginpar\marginpar
\renewcommand{\marginpar}[2][anchor=center]{%
\oldmarginpar{
~\\ % Need this, rather strangely, to get the tikz node to anchor properly.
\tikz \draw node (one) [] at (0,0) {} node (two) [anchor=north,text width=2.0cm,draw,align=left,text badly ragged,fill=black!05,rounded corners,#1] at (0,0) {\baselineskip=-2pt ~\\#2 \\ } ; }
}
\begin{document}
\lipsum[1]
\fancytab{fancy tab}{2}
\textbf{Some more text which will contain a little margin note, the problem being that the margin note collides with the fancy tab that we have created. Is there a way to get the margin note to shift down below the tab}
\marginpar{This note collides}
\marginpar[yshift=-2cm]{This one has been manually shifted out the way}
\lipsum
\end{document}
marginfix
is working on it. Look forphantom
orblockmargin
in the documentation. I have not tried it in a while.