0

The \ref command usually points to the figure/table/etc that is referenced by \label. However in the tufte-book document class this does not seem to work:

\documentclass[]{tufte-book}
\begin{document}
\section{Newsection}
Some text here.
\clearpage
\begin{figure*}
\rule{1in}{1in}
    \caption{Figure 1}
    \label{fig:f1}
\end{figure*}
Please see Fig.~\ref{fig:f1} for more information.
\end{document}

Instead, the reference simply points quietly to the section header above without giving an error. I tried putting the \label command in different places or using different figure environments (figure*, figure, marginfigure). I am using the pdflatex command to compile the above example, I have the pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016) distribution.

Is there a way to solve this?

  • i can't reproduce your problem. referencing works correctly. welcome to tex.se! – Zarko Sep 2 '18 at 11:38
  • well, then there is hope that I will figure out my problem. Which operating system are you using? Which tex distribution? – Quasilattice Sep 2 '18 at 17:00
  • I just found a similar question: link but the solution seems to be a fudge (just using a different reference package) – Quasilattice Sep 3 '18 at 8:30
0

this is extended comment ...

with your mwe i can reproduce problem which you reported in question. for better see, that referencing in your document working well, i slightly extend your code to:

\documentclass[justified]{tufte-book}
\usepackage{microtype}
\usepackage{graphicx}

\hypersetup{colorlinks=true,
            linkcolor={blue},
            breaklinks=true}
\usepackage{lipsum}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\section{First section}
\lipsum[11]

\section{Second section}
\lipsum[12]
    \begin{figure}
\centering
\includegraphics[width=0.5\linewidth]{example-image-duck}
\caption{Caption of the figure 1}
\label{fig:f1}
\setfloatalignment{b}
    \end{figure}

\section{Third section}
The basic idea is illustrated on the Fig.~\ref{fig:f2}.
\lipsum[13-14]
    \begin{figure*}
\includegraphics[width=\linewidth]{example-image-duck}
\caption{Caption of the figure 2}
\label{fig:f2}
    \end{figure*}
Please see Fig.~\ref{fig:f1} and Fig.~\ref{fig:f2} for more information.

\end{document}

all extension doesn't influence anyhow to working of hyper links. all works as it is expected. i test this code with recent MikTeX using pdfLaTeX engine. however i'm pretty sure that this should works with other not so recent latex installation too. please test my mwe and let me know, if it is working as expected.

  • Hi Zarko! Thanks for trying this out. I can compile your mwe but it shows the same symptoms as mine: the Fig. 1 reference points to 'Second section' header and Fig. 2 points to 'Third section' header. Maybe my TeX distribution is the problem since you're using MikTeX and I am using TeX Live. – Quasilattice Sep 3 '18 at 8:26
0

My issue turned out to be tufte-unrelated, so sorry for asking it here.

I opened the pdf of a windows machine using the adobe reader and all the links worked fine. Only on my mac (Preview) the links are broken.

I could start a new thread somewhere but for now I am more-or-less happy.

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.