I do not have an example since I want to know if it is possible, here is the one from the wiki slightly modified.



\usepackage[top=1.5cm, bottom=1.5cm, outer=5cm, inner=2cm, heightrounded, marginparwidth=2.5cm, marginparsep=2cm]{geometry}



\section{Margin notes}

This is just random text, but random text that is not randomly typed since that would not make sense. This location\marginnote{is where I would like to have a line leading to from this margin note}. Random text.

My objective is to have a line connecting the location word or the space after it to the margin note, so that there is a quick way to relate it to the margin note, a footnote does not solve my issue since it would reduce the vertical space of the template that I need to use.

I believe that if it is not possible to have a line doing the linking, a valid possibility would be to just have a numbered reference similar to the pair \label and \ref.

Thanks in advance! Best, Carlos

Edit Thanks to @samcarter I was able to use:


To solve my question, however, this implementation breaks while inside a float (specifically a figure), I tried in the caption and got a "not in par mode" error, anyone got an idea for that?

Thanks again!

  • Maybe the todonotes package could help – samcarter_is_at_topanswers.xyz Oct 29 '18 at 16:22
  • @samcarter Thanks a lot! I was able to get what I wanted using \usepackage[backgroundcolor=white,linecolor=red,bordercolor=none]{todonotes} – CMichael Oct 29 '18 at 16:36
  • 1
    unrelated but it's best not to use \special{papersize=\the\paperwidth,\the\paperheight} (makes the document non portable, doesn't work with pdflatex for example) – David Carlisle Oct 29 '18 at 16:38
  • @CMichael Good to hear you were able to solve your problem! It would be nice if you could add a short answer below so that future users with the same question can benefit from your solution. – samcarter_is_at_topanswers.xyz Oct 29 '18 at 16:39
  • 1
    todonotes uses internally \marginpar which doesn't work in a figure. If you don't need \marginpar you could do \let\marginpar\marginnote. Then it should work. – Ulrike Fischer Oct 29 '18 at 17:10

Credits to the ones who gave the answers:

@samcarter for the todonotes package information. I implemented in my document as:


Across the document I call it as:


@Ulrike Fischer for the "\let\marginpar\marginnote". I'm using it inside the figure environment and it worked perfectly.

    \todo[size=\scriptsize]{This is my todo note}

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.