Intereting Posts

Spaces in files names in \input or \includegraphics
How to make a figure with moving arrows?
bracket with doubled delimiters
Typesetting a long exact sequence
What's the best way to do overshadow?
How can I change the font family in pgfplots?
Missing number, treated as zero
What is the best way to scan over a list of somethings?
FancyVerb Error when using minted in a \ifthenelse
Equation-Environment creates unequally large white space
Two independent TOCs
column header for multicols
How can I access the numbers of pages on which input material begins and ends?
Unnumbered linguistic examples with glosses
Paths and Linux/Windows slash conventions

I’ve recently started using `tufte-book`

for typesetting solutions to math problems. I like it very much that you’re encouraged to use the margin, which is very nice for giving hints, pointers and references concerning the steps of finding a solution.

Unfortunately, the `sidenote`

and `marginnote`

commands don’t work in math environments *(not in outer par mode)*. Most of the time, I’m able to work around it by putting the commands after the environment, using the optional offset with a decimal value via `\marginnote[-length]{content}`

. But this breaks when a math environment is pushed to the end of a page: the notes are then pushed to the next page, no longer appearing on the same page. This also happens if you first put the commands and then the environment.

- Producing quality figure and graphics - which Edward Tufte book is the most influential/interesting for TeX users?
- Positioning of the chapter number in the margin note space
- How to use showexpl with tufte-handout
- Customize length of y major grids in pgfplots
- Tufte layout in “Painless Memoir?”
- \autoref doesn't work correctly when used in tufte-book

So, is there any way to enable `sidenote`

and `marginnote`

in math environments?

(I thought of using the `samepage`

environment, but this adds a lot of ugly whitespace, as the whole math environment is pushed to the next page without necessity)

```
\documentclass{tufte-book}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{tikz}
\newcommand{\filler}[1][10]%
{ \foreach \x in {1,...,#1}
{ test
}
}
\begin{document}
\lipsum[1]
\begin{align*}
&\int\int\int t\ dt^3\\
=&\int\int \frac{t^2}{2}\ dt^2\\
=&\int \frac{t^3}{6}\ dt\\
=&\frac{t^4}{24}
\end{align*}\marginnote[-3.7cm]{first note}\marginnote[-1.7cm]{second note}
\lipsum[2]
\filler[50]
\begin{align*}
&\int\int\int t\ dt^3\\
=&\int\int \frac{t^2}{2}\ dt^2\\
=&\int \frac{t^3}{6}\ dt\\
=&\frac{t^4}{24}
\end{align*}\marginnote[-3.7cm]{first note}\marginnote[-1.7cm]{second note}
\end{document}
```

As you can see, the second `align*`

is still on the first page, but the `marginnote`

s are pushed to the second page.

- Problems compiling Tufte title page in XeLaTex
- Tree like items list
- Undefined control sequence: \pgfplots@data@xmin
- Printing bibliography with biblatex in Tufte-handout fullwidth environment
- What does “you have forgotten to use \caption” mean?
- Why does \today crash in Tufte-LaTeX using 'isodate' when passed as an argument?
- tufte-latex: \newthought after \section
- Can I automatically generate abbreviated citations in Tufte documents after the first occurrence?

The AMS environments conveniently give you a hook to place text at a known position relative to the margin so I’d do

```
\documentclass{tufte-book}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{tikz}
\newcommand{\filler}[1][10]%
{ \foreach \x in {1,...,#1}
{ test
}
}
\def\mathnote#1{%
\tag*{\rlap{\hspace\marginparsep\smash{\parbox[t]{\marginparwidth}{%
\footnotesize#1}}}}
}
\begin{document}
\lipsum[1]
\begin{align*}
&\int\int\int t\ dt^3\\
=&\int\int \frac{t^2}{2}\ dt^2\\
=&\int \frac{t^3}{6}\ dt\\
=&\frac{t^4}{24}
\end{align*}\marginnote[-3.7cm]{first note}\marginnote[-1.7cm]{second note}
\lipsum[2]
\filler[50]
\begin{align*}
&\int\int\int t\ dt^3\mathnote{first note}\\
=&\int\int \frac{t^2}{2}\ dt^2\\
=&\int \frac{t^3}{6}\ dt\\
=&\frac{t^4}{24}\mathnote{second note}
\end{align*}
\end{document}
```

- Add matrix name inside tikzpicture
- What are the situations where you have to compile a document more than once?
- Create arbitrary sorting of index entries
- TikZ/pgf: Why does `\newline` and `\\` not split text in node?
- Including parts of a LaTeX document in another document WITHOUT splitting up original document
- Include floated figure in two column environment
- Counting of selected words
- Automatically generate multiplication table and colour specific rown, columns, and diagonals
- Adding color to a table column as a beamer overlay
- How to format title and abstract?
- Conditional code on page size
- How can I number a few equations together
- How to divide with tikz calc (to find center of mass)
- Beamer: change size of figure caption
- Shading a Region Between Two Dashed Lines