[Tex/LaTex] todonotes get cut off in margin of twoside document

todonotes

I am using the following twoside document layout and the todonotes package. My problem is the \todo{...} notes get cut off in the margin. How can I fix this?

enter image description here

MWE

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[top=30mm,bottom=40mm,inner=30mm,outer=20mm]{geometry} 
\usepackage{blindtext}
\usepackage{todonotes}

\begin{document}

\blindtext\todo{Why don't I fit on the page?}

\end{document}

Edited

Interestingly, when I remove twoside the notes do fit?

enter image description here

In response to some proposed solutions

  • I can't change my page margins.
  • If I use textwidth=14mm, I get a weird output on the second page of my twoside document. See for example this MWE:

enter image description here

enter image description here

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[top=30mm,bottom=40mm,inner=30mm,outer=20mm]{geometry} 
\usepackage{blindtext}
\usepackage[textwidth=14mm]{todonotes}
\begin{document}
\blindtext\todo{I fit on the page}
\newpage
\blindtext\todo{Why don't I fit on the page?}
\end{document}

Best Answer

Your todonotes are currently too wide to fit into a margin of 2 cm width. To resolve this, you have several options:

1: Increase the margin size:

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[top=30mm,bottom=40mm,inner=30mm,outer=35mm]{geometry} 
\usepackage{blindtext}
\usepackage{todonotes}
\begin{document}
\blindtext\todo{Why don't I fit on the page?}
\end{document}

2: Use the textwidth package option to globally decrease the width of the todonotes to a value that fits into the margin:

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[top=30mm,bottom=40mm,inner=30mm,outer=20mm]{geometry} 
\usepackage{blindtext}
\usepackage[textwidth=20mm]{todonotes}
\begin{document}
\blindtext\todo{Why don't I fit on the page?}
\end{document}

3: Reset the \marginparwidth as described in section '1.6.6 Todonotes wrongly placed in the margin' of the todonotes manual:

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[top=30mm,bottom=40mm,inner=30mm,outer=20mm]{geometry} 
\usepackage{blindtext}
\usepackage{todonotes}
\setlength{\marginparwidth}{2cm}
\begin{document}
\blindtext\todo{Why don't I fit on the page?}
\end{document}

4: Add the marginparwidth as an option to geometry:

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[top=30mm,bottom=40mm,inner=30mm,outer=20mm,marginparwidth=35pt]{geometry} 
\usepackage{blindtext}
\usepackage{todonotes}
\begin{document}
\the\marginparwidth
\blindtext\todo{Why don't I fit on the page?}
\end{document}

You can of course adjust the values in version 2,3 and 4 according to your needs. To achieve a result that is as similar as possible to the output without the twoside option, you could use version 3 as follows: \setlength{\marginparwidth}{35pt} 35pt is the marginparwidth that is used in an article document without the twoside option. You can find this out with the following MWE, that will just print the value of the current marginparwidth into the pdf.

\documentclass[12pt,a4paper]{report}
\usepackage[top=30mm,bottom=40mm,inner=30mm,outer=20mm]{geometry} 
\usepackage{todonotes}
\begin{document}
\the\marginparwidth
\end{document}