4

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} 

example collision render

  • There is a related question here. I would expect, that there is no solution, yet, as well. The author of marginfix is working on it. Look for phantom or blockmargin in the documentation. I have not tried it in a while. – Andy May 30 '14 at 4:56
  • Thanks, I did have a go with marginfix, but the latest version causes the colliding tab to disappear. Still the fact that its doing something may give me the "in" I need. – user2466401 Jun 2 '14 at 3:48
1

The simplest answer: adjust the value of \fancytabsWidth as a fraction of the parameter \oddsidemargin:

\fancytabsWidth{0.75\oddsidemargin}

This will place the tab apart and let a white of 0.25\oddsidemarginbetween the marginpar and the tab. Eventually you may need to adjust the size of the font used inside the tab.

Exemplo sem colisão

This is not the vertical solution you wanted, but I think it is the most elegant and disrupting. It does not work however, when you set a layout where the oddsidemargin is too thin.

  • 1
    there's a serious problem with this when a book is printed and bound -- the final step is physically trimming the bound pages to the final size, and if the thumb tabs are too narrow there's a real danger that they will be cut off. – barbara beeton May 30 '14 at 13:25
  • Unfortunately its not going to work for a lot of the documents. The thumb tabs need to carry some information with the current design (upto about 6 words), which will make them too long. Also with the 800 page+ documents, I will need to fit in about 24 tabs and if they are too "long" they will cycle round an awful lot of times. – user2466401 Jun 2 '14 at 3:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.