0

I would like to add side notes to my document as in the example below, but I do not know how. I will be grateful for any suggestions.

enter image description here

3

A default \todo from the todonotes package does something similar to what you're asking, so if you're not using todonotes already, the following might be useful.

\todo does draw a coloured box around the margin note, but changing the bordercolor and backgroundcolor as below removes that.

output of code

\documentclass{article}
\usepackage[
 bordercolor=none,
 backgroundcolor=none,
 linecolor=gray
]{todonotes}
\begin{document}
Bla bla etc., uzw., osb., Lorem ipsum dolor \todo{Foo bar}{} and so on and so forth.
\end{document}

It's possible to redefine some macros to get output more like your image.

output of code

\documentclass{article}
\usepackage[
 bordercolor=none,
 backgroundcolor=none,
 linecolor=gray
]{todonotes}
\usetikzlibrary{arrows.meta}
\tikzset{
  smallcirc/.tip={Circle[width=2pt,length=2pt]},
  % connectstyle is used for the line drawing to the marginnote,
  % add the arrow tip on each end, and make it thin
  connectstyle/.append style={smallcirc-smallcirc,thin}
}
\makeatletter
\renewcommand{\@todonotes@drawLineToRightMargin}{%
\begin{tikzpicture}[remember picture, overlay]%
\draw[connectstyle]%
(inText) -- ([yshift=-0.2cm] inText)% %% <--- added "(intext) --"
-| (inNote.west);% %% <--- removed "-| ([xshift=-0.2cm] inNote.west)"
\end{tikzpicture}%
}%
\renewcommand{\@todonotes@drawLineToLeftMargin}{%
\begin{tikzpicture}[remember picture, overlay]%
\draw[connectstyle]%
(inText) -- ([yshift=-0.2cm] inText)% %% <--- added "(intext) --"
-| (inNote.west);% %% <--- removed "-| ([xshift=-0.2cm] inNote.west)"
\end{tikzpicture}%
}%
\makeatother

\begin{document}
Bla bla etc., uzw., osb., Lorem ipsum dolor \todo{Foo bar}{} and so on and so forth.
\end{document}

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.