7

I have defined two commands for todonotes:

\documentclass[12pt,a4paper]{article}
\usepackage[colorinlistoftodos,textsize=scriptsize]{todonotes}

\newcommand{\mytodo}[2][]{\renewcommand{\baselinestretch}{0.8}\todo[#1]{#2}}
\newcommand{\note}[2][]{\renewcommand{\baselinestretch}{0.8}\todo[#1]{#2}}

\begin{document}
    \note{test} blah\mytodo{test}
\end{document}

Now \mytodo should be on the left margin of the page, \note on the right.

I tried something like this:

\newcommand{\mytodo}[2][]{\reversemarginpar\marginpar{\renewcommand{\baselinestretch}{0.8}\todo[color=sideboxtodo_bg, #1]{#2}}}

But that didn't work.

Help would be appreciated.

1 Answer 1

5

You could use marginnote for at least one the notes:

\documentclass[12pt,a4paper]{article}
\usepackage[colorinlistoftodos,textsize=scriptsize]{todonotes}
\usepackage{marginnote}

\newcommand{\mytodo}[2][]{{%
 \let\marginpar\marginnote
 \reversemarginpar
 \renewcommand{\baselinestretch}{0.8}%
 \todo[#1]{#2}}}
\newcommand{\note}[2][]{\renewcommand{\baselinestretch}{0.8}\todo[#1]{#2}}

\begin{document}
    \note{test} blah\mytodo{my test}

    blub\note{test 2}
\end{document}

enter image description here

2
  • Thanks, that is almost what I had in mind. It doesn't work quite well in the following case: if you paste \mytodo{bla} one below the other you get overlapping notes, while if you remove \let\marginpar\marginnote and \reversemarginpar it is shown on the right side but it doesn't overlap.
    – doc
    Commented Mar 7, 2016 at 16:19
  • Yes, marginnote doesn't float. While it is possible to test for the vertical position and push the notes around it is a lot work to do it properly. In general it is easier if you simply avoid too many notes. Commented Mar 7, 2016 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .