4

When typing documents containing derivations I frequently find myself in a situation where for brevity's sake, I feel the need to leave out some lengthy calculation or justification of an approximation even though the steps or assumptions made might very well not be apparent to the reader. Likewise when reading papers or books, there are almost always parts where authors advance a train of thought in huge leaps. It then usually takes me a really long time to figure out the nitty gritty details of what they did and in what order.

In such cases, I always wish there was some kind of responsive content in PDFs, something like slide-out or overlay text, that can appear when the user clicks some button or hovers over some text so that passages that might require a more in-depth albeit lengthy explanation have that immediately accessible to the reader without sacrificing on appearance, flow and brevity of the main document.

So my question is, is there a package that offers this functionality to LaTeX users? Or would one have to fall back on something like html together with MathJax for this work?

Note: In case it isn't clear from my question, footnotes are too restricted with regard to the amount of content they can hold and can really impair the reading flow. I also don't want to refer to some appendix that leaves the reader jumping back and forth all over my document. (I couldn't find any tags that fit this question.)

Janosh
  • 4,042

2 Answers2

3

There may be better solutions for your problem, but they may requiere the use of JavaScript, which is not supported by all PDF viewers.

Here is a way of improving the appendix solution for the readers.

With a few links placed in the main part and the appendix the reader can easily jump to an in-depth explanation and back.

\documentclass[a4paper]{article}
\usepackage{hyperref}
\usepackage{nameref}
\usepackage{lipsum}

\pagestyle{headings}

\begin{document}
\tableofcontents

\section{Something complicated explained in too few words}
\label{sec:too-short}
\lipsum[1]

\hypertarget{back:too-short}{\hyperref[sec:too-short:in-depth]{An in-depth explanation can be found here.}}

\lipsum[2]

\newpage
\appendix
\section{In-depth explaination}
\label{sec:too-short:in-depth}
\hyperlink{back:too-short}{This is an in-depth explanation of \textit{\nameref*{sec:too-short}}.}

\lipsum[3-5]

\noindent
\hyperlink{back:too-short}{back to main text}
\end{document}

Of course this needs much better formatting and probably a few macros for easier typing, but it shows the basic principle.

Mike
  • 8,664
3

The enotez package provides endnotes that are compatible with hyperref and support back links. Thus clicking on the endnote mark enables jumping to the endnote and clicking on the number in the endnote takes one back.

\documentclass{article}
\usepackage{hyperref}
\usepackage[backref]{enotez}

\begin{document}

Here's the short explanation.\endnote{And here is the long explanation.}

Here's another short.\endnote{And another long.}

\printendnotes
\end{document}

enter image description here

All of the numbers in the image are clickable.

TH.
  • 62,639
  • This is not bad for a start. Certainly better than an appendix as jumping back and forth is much easier and it's immediately clear which note expands on what content in the text. With lengthy appendices, it can take time to identify what paragraph further explains which part of the main text. – Janosh Jun 28 '17 at 09:14