[Tex/LaTex] Vertical spacing between sidenotes (and, between sidenotes and captions) in tufte-book

lyxmarginparspacingtufte

Within from LyX, using various sidenotes in a tufte-latex-book environment, along with float figures, results sometimes in an overlapping of sidenotes and caption(s).

For example, two sidenotes followed by a figure caption (may) look like in the following screenshot:

screenshot of an overlapping sidenote and a figure caption

As requested in the comments, a minimal working example:

My guess is that this issue is rather generic and not LyX-specific. How can one adjust the vertical spacing between sidenotes, as well as between sidenotes and figure captions?

% Preview source code

%% LyX 2.0.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\RequirePackage{fix-cm}
\documentclass[11pt,twoside,english,nohyper,notitlepage]{tufte-book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setlength{\parskip}{\bigskipamount}
\setlength{\parindent}{0pt}
\usepackage{color}
\usepackage{babel}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{setspace}
\onehalfspacing
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=true]
 {hyperref}
\hypersetup{
 pdfauthor={Nikos Alexandris}}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.

\title{Some title}
\author{by Nikos Alexandris}
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% inline item enumeration
\usepackage{paralist}

\makeatother

\begin{document}
\maketitle

\subsection{Trim fringes\label{sub:Trim fringes}, in case they exist}

The Level 1 product generation system (LPGS\sidenote{Differences between the two main Landsat production systems are summarised
in USGS' webpage about \href{http://landsat.usgs.gov/products_IP_LPGSvsNLAPS.php}{LPGS and NLAPS Processing Systems Comparison}}) does not trim band offsets (fringes)\sidenote{Source: \href{http://landsathandbook.gsfc.nasa.gov/pdfs/Landsat7_Handbook.pdf}{Landsat 7 Science Data Users Handbook})}\sidenote{Detailed information upon this can be researched at \href{http://landsat.usgs.gov/tools_project_documents.php}{Landsat Missions, Project Documentation}}
\begin{figure}
\includegraphics[width=1\columnwidth,height=8cm,keepaspectratio]{/geo/grassdb/exported/arcfuel/LT51840322011266MOR00_B7_no_Nulls\lyxdot png}

\caption{Fringes are visible in the borders of an Landsat acquisition due to }
\end{figure}

\end{document}

This results in a very similar overlapping effect, as the screenshot given above which was taken after compiling a large document.

another screenshot of an overlapping sidenote and a figure caption

Update (13. 01. 2013)

For completeness, exporting the LyX file as LaTeX (pdflatex) and compiling it — without any modifications — from within Kile, results, again, in the same overlapping effect.

%% LyX 2.0.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\RequirePackage{fix-cm}
\documentclass[11pt,twoside,english,nohyper,notitlepage]{tufte-book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setlength{\parskip}{\bigskipamount}
\setlength{\parindent}{0pt}
\usepackage{color}
\usepackage{babel}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{setspace}
\onehalfspacing
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=true]
 {hyperref}
\hypersetup{
 pdfauthor={Nikos Alexandris}}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.

\title{Some title}
\author{by Nikos Alexandris}
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% inline item enumeration
\usepackage{paralist}

% The default minimum amount of space between \marginnotes is 10 pt.
\setlength\marginparpush{20pt}

\makeatother

\begin{document}
\maketitle

\subsection{Trim fringes\label{sub:Trim fringes}, in case they exist}

The Level 1 product generation system (LPGS\sidenote{Differences between the two main Landsat production systems are summarised
in USGS' webpage about \href{http://landsat.usgs.gov/products_IP_LPGSvsNLAPS.php}{LPGS and NLAPS Processing Systems Comparison}}) does not trim band offsets (fringes)\sidenote{Source: \href{http://landsathandbook.gsfc.nasa.gov/pdfs/Landsat7_Handbook.pdf}{Landsat 7 Science Data Users Handbook})}\sidenote{Detailed information upon this can be researched at \href{http://landsat.usgs.gov/tools_project_documents.php}{Landsat Missions, Project Documentation}}

\begin{figure}
\includegraphics[width=1\columnwidth,height=8cm,keepaspectratio]{/geo/grassdb/exported/arcfuel/LT51840322011266MOR00_B7_no_Nulls\lyxdot png}

\caption{Fringes are visible in the borders of an Landsat acquisition due to }
\end{figure}

\end{document}

This time, a full-witdh screenshot of an overlapping sidenote and a figure caption.

Best Answer

I'm not sure if LyX exposes them, but the Tufte-LaTeX document classes provide a few options for adjusting the positions of captions and margin notes.

Adjusting margin notes and sidenotes positions

First, if you want to adjust the minimum distance between all margin notes (and not just one or two), then you can set the \marginparpush length:

% The default minimum amount of space between \marginnotes is 10 pt.
\setlength\marginparpush{10pt}

Next, you can adjust the position of \marginnotes and \sidenotes using an optional parameter. To adjust the position of a \marginnote or \sidenote, use the following syntax:

\marginnote[<offset>]{Margin note text}
\sidenote[][<offset>]{Sidenote text}

where a positive <offset> length moves the note down and a negative length moves the note down. Some examples of valid lengths are:

1.0in    2.54cm    254mm    6\baselineskip

You can view more information about the \marginnote and \sidenote commands on pages 21–22 of the Tufte-LaTeX documentation (PDF).

Adjusting caption positions

Captions can be positioned vertically in one of a four positions: either above or below the figure or top- or bottom-aligned with the figure.

The vertical alignment of the caption can be affected in two ways: (1) using the \setfloatalignment macro or (2) using the optional offset argument.

Unless the figure position specifier is only [b], the Tufte-LaTeX document classes assume the figure will be positioned at the top of the page, in the middle of the page, or on its own page. The caption will be top-aligned with text-width figures and placed below full-width figure*s.

If the figure position specifier is [b], then the caption will be bottom-aligned with text-width figures and placed above full-width figure*s.

You can change this position of the caption using the \setfloatalignment macro. Using \setfloatalignment{b} will bottom-align the caption and \setfloatalignment{t} will top-align the caption. This is convenient for moving a caption that would otherwise interfere with a sidenote or margin note and still keeps the caption neatly aligned with the top or bottom edge of the figure.

Another option for moving the caption is to use the optional offset argument similar to that of the \sidenote and \marginnote macros:

\caption[][<offset>]{Caption text}

The syntax of the \caption command (and a few examples) is provided on pp. 23–24 of the manual, and more information about the \setfloatalignment macro is available on pp. 25–26 of the manual.

Related Question