I use the class exam and I want to use the marginnote package to put notes in the margin of some questions. When I use the last optional argument to change the vertical offset, it adds some indent at the beginning of the question. In the following MWE, the space is quite small, but in my real config, it is for some reason much bigger.

Where does this indent come from? How to prevent it (manual negative hspace for each note is not an option for me)?

NB: I don't care about the mess with vertical spaces in the margin. This is just to show that only the combination question + marginnote with voffset causes this effect.

    \marginnote{Very first note} \lipsum[123][2]
    \marginnote{Try}[0pt] \lipsum[1][3]
    \marginpar{\vspace{1em}Other try} \lipsum[34][1]
    \question \lipsum[1][5]
    \question \marginnote{First note} \lipsum[86][3]
    \question \marginnote{Some note}[0pt] \lipsum[2][1]% <--Causes unwanted indent
    \question \marginpar{\vspace{1em}Last note} \lipsum[34][1]
  • Thanks John, but I'm using points. Oct 10, 2020 at 16:12
  • Sorry, I don't get your point. I change neither \textwidth nor \marginparwidth in my MWE. And the only reason I wrote the \setlength{\parindent}{0pt} line is to make more evident the fact that there is no indent problem outside of the questions environment : commenting it out doesn't solve the problem. But maybe there is something I don't understand in your comment. Oct 10, 2020 at 19:55
  • I don't know, I feel we are not talking about the same issue. I compiled my MWE with pdflatex / xelatex and lualatex and got the same result every time. What I call indentation is the space between the question number and the first letter of the question. Are you talking about the same thing ? Oct 11, 2020 at 19:07
  • 1
    Ah, that indentation. You can get rid of it by deleting the space after \marginnote{Some note}[0pt]. Probably a bug in \marginnote (missing \ignorespaces). Oct 11, 2020 at 19:27
  • Thanks a lot. Do you want to make an answer out of your comment? Oct 12, 2020 at 19:08


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.