I would like to include following margin notes into my document:

enter image description here

How can I include such grey lines shown in this image above and below my notes? Also, my margin notes are entirely cut off:

enter image description here

I am using document class book, and the following command:


\graphicspath{ {figures/} }



\title{Draft }



Test test

\marginpar{{\color{brown}BOLD} This is a margin note 
using the geometry package, set at 
3cm vertical offset to the line it is typeseted.}

  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – samcarter_is_at_topanswers.xyz Apr 1 '18 at 18:11
  • 1
    your image suggests that you have set \marginparwidth wider than the margin, but as you have shown no example code it is not possible to say where your code is wrong. please post a small but complete document that shows the problem – David Carlisle Apr 1 '18 at 18:11
  • Ok will do!......... – Pugl Apr 1 '18 at 18:15
  • @Pegah your code is not minimal. I doubt that e.g. mathtools is necessary to reproduce your issue. Also, if this is the preamble of your actual document, don't include blindtext. That package is just for dummy creation and I don't think you need dummy text in your work. – Skillmon likes topanswers.xyz Apr 1 '18 at 18:21
  • Also there is no need to load graphics if you load graphicx, same for color and xcolor. – Skillmon likes topanswers.xyz Apr 1 '18 at 18:30

Include \rules in your \marginpar:




\mymarginpar{Ducks are awesome, but rabbits are better}%


Alternative version using \toprule and \bottomrule of the booktabs package instead of custom rules:




\mymarginpar{Ducks are awesome, but rabbits are better}%


Setup to include geometry:

\marginparwidth=4cm % change this to your liking

It calculates the outer margin based on your \marginparwidth. Consider that a line width of more than about 80 characters (no fixed value here, depends on baseline skip and font size) makes a document considerably harder to read. (the above results in something around 88.6 characters per line).

| improve this answer | |
  • works! which command helps my keeping the notes inside the page's border? – Pugl Apr 1 '18 at 18:22
  • @Pegah I just didn't fiddle with the page layout in this code. I'll take a look at the code you provided in your question. – Skillmon likes topanswers.xyz Apr 1 '18 at 18:24
  • @Pegah the problem is caused by the way you load the geometry package. I'll work something out, give me a minute. – Skillmon likes topanswers.xyz Apr 1 '18 at 18:31
  • 1
    @Pegah if you are not forced to include geometry to match a page layout, consider not using it at all. The default page layout of the standard classes are considered good typography and make a document easier to read (though it might seem like a waste of space to unexperienced typographers). – Skillmon likes topanswers.xyz Apr 1 '18 at 18:45
  • Thank you so much for your time & help!! This was btw also the reason I did not remove the extra packages from the "minimal example"...I thought that something not directly relevant might interfere...- when I remove geometry, the pages are extremly narrow (huge margin left and right), why is that? – Pugl Apr 1 '18 at 20:25

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.