Really liking the clean and neat layout of this class but have encountered a problem I can not fathom or find reference to others encountering and would appreciate any assistance or pointers in resolving it.
I've tried narrowing down what is causing the error by commenting out sections and have this as an example....
\documentclass[fullpage]{tufte-book}\usepackage[]{graphicx}\usepackage[]{color}
\makeatletter
\def\maxwidth{ %
\ifdim\Gin@nat@width>\linewidth
\linewidth
\else
\Gin@nat@width
\fi
}
\makeatother
\definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}
\newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}%
\newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}%
\newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}%
\newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}%
\newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}%
\newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}%
\newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}%
\newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}%
\newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}%
\usepackage{framed}
\makeatletter
\newenvironment{kframe}{%
\def\at@end@of@kframe{}%
\ifinner\ifhmode%
\def\at@end@of@kframe{\end{minipage}}%
\begin{minipage}{\columnwidth}%
\fi\fi%
\def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
\colorbox{shadecolor}{##1}\hskip-\fboxsep
% There is no \\@totalrightmargin, so:
\hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
\MakeFramed {\advance\hsize-\width
\@totalleftmargin\z@ \linewidth\hsize
\@setminipage}}%
{\par\unskip\endMakeFramed%
\at@end@of@kframe}
\makeatother
\definecolor{shadecolor}{rgb}{.97, .97, .97}
\definecolor{messagecolor}{rgb}{0, 0, 0}
\definecolor{warningcolor}{rgb}{1, 0, 1}
\definecolor{errorcolor}{rgb}{1, 0, 0}
\newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX
\usepackage{alltt}
%% Load packages
\usepackage{alltt}
\usepackage{amsfonts}
\usepackage{appendix}
\usepackage{color}
\usepackage{fancybox}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{multirow}
\usepackage{pdflscape}
\usepackage{rotating}
\usepackage{tipx}
\usepackage{todonotes}
\usepackage{underscore}
%% Define new commands (from Tufte Class sample-book.tex)...
%%
%% Prints argument within hanging parentheses (i.e., parentheses that take
%% up no horizontal space). Useful in tabular environments.
\newcommand{\hangp}[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}}
%% Prints an asterisk that takes up no horizontal space.
%% Useful in tabular environments.
\newcommand{\hangstar}{\makebox[0pt][l]{*}}
% Prints the month name (e.g., January) and the year (e.g., 2008)
\newcommand{\monthyear}{%
\ifcase\month\or January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or
December\fi\space\number\year
}
%% Prints an epigraph and speaker in sans serif, all-caps type.
\newcommand{\openepigraph}[2]{%
%%\sffamily\fontsize{14}{16}\selectfont
\begin{fullwidth}
\sffamily\large
\begin{doublespace}
\noindent\allcaps{#1}\\% epigraph
\noindent\allcaps{#2}% author
\end{doublespace}
\end{fullwidth}
}
%% Define \shortcite{} command (see
https://groups.google.com/forum/#!topic/tufte-latex/4fKzsy-VRmI )
\newcommand{\shortcite}[1]{%
\sidenote{\citealt{#1}}%
}
%%------------------META INFORMATION------------------%%
\hypersetup{colorlinks}
\title{}
\author[]{}
\publisher{}
%%------------------META INFORMATION------------------%%
\makeindex
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\begin{document}
\maketitle
\chapter{Introduction}
Many clinical trials assess the effects of an intervention on some measurement of interest over time. An often used strategy for analysing data is to calculate the change, or percentage change, from baseline in the measurement of interest. Whilst this may be common practice it is widely acknowledged that there are a number of problems with such an approach~\sidenote{Many of these are summarised at \href{
http://biostat.mc.vanderbilt.edu/wiki/Main/ManuscriptChecklist}{Statistical Problems to Document and to Avoid} (Deparment of Biostatistics, Vanderbilt University).}\ldots
\begin{itemize}
\item Analysing percentage change is less powerful than analysing the raw data~\shortcite{bland2011}~\shortcite{vickers2001b}~\shortcite{vickers2001}.
\item The change (absolute or percentage) can not be interpreted without reference to the baseline.
\item Interpretation is further complicated by the baseline measurement being on both sides of the regression model equation as heterogeneity at baseline must be accounted for.
\item Simple change scores are confounded by regression to the mean~\shortcite{bland1994a}~\shortcite{bland1994b}.
\item No meaningful summary statistics exist for percentage change beyond a minimum and maximum (without converting to log-ratios)~\sidenote{See \href{
https://groups.google.com/d/msg/medstats/RtgXzWuVtMk/qYjY\_iDBlBIJ}{comment from Frank Harrell} on MedStats mailing list.}.
\end{itemize}
\begin{figure}[p]
{\centering \includegraphics[width=\maxwidth]{knitr/figures/litsearch}}
\caption{Trends in the use of search terms over time.\label{litsearch}}
\end{figure}
\end{document}
<----- End master.tex ------>
When I try to compile this using pdflatex (from texlive-latex-2013 under GNU/Linux) I get the following error message....
Sure enough within master.aux there is on line 29 the above...
Playing around trying to work out what is causing this I narrowed it down to the image that is being included, so this section of code...
Commenting out the caption and the line that includes the graphic didn't get rid of the error, but removing the \begin{figure}[p] and \end{figure} (and the \caption{} which must be within a float environment!) did, suggesting to me that its a problem with including the float environment (my actual document so far has another table, and if I include that I have two of the above errors.
Searching around suggested that \newpmemlabel{}{} might be related to the memoir functions (?not sure if thats correct term) which is part of the 'mempatch' package, but including that in the list of packages used didn't help.
Any thoughts or ideas on how to troubleshoot this would be very gratefully received.