Editing big LaTeX documents and cross-referring to labels

In editing big documents, I find myself having to refer back to something I’ve written somewhere else. Typically I’m referring to the PDF rather than the raw LaTeX, and I can’t remember the section labels I’ve added. To help me with this, I’ve added this wodge of code into my preamble:

This defines a few extra commands for doing margin notes, and then redefines the \label command to also add a margin note with the name of the label, so it’s right next to where it’s used in the resulting PDF. It’s really handy.

You can also add “To-do” notes yourself, or any kind of comment in the margin, by just using the \marg command:

Note that this won’t work inside a figure – LaTeX doesn’t know where the margins are inside a figure! Some of the logic in the code above is to ensure that margin notes don’t appear for figure labels.

Copyright © Found
Jim Finnis' personal blog

Built on Notes Blog Core
Powered by WordPress