I need to have a line on the INNER margin in a double-sided tufte-document. There was a close question and it has this answer. That answer is perfect. Their output is: enter image description here (You see the line on the INNER part of the page)

The difference is that I use tufte-book class, but that example is for an article class. As soon as I use \marginnote{Hello} in this code snippet LaTex gives a mistake ! LaTeX Error: Not in outer par mode.


(for the full code shamelessly stolen from the link, see below)

I wonder how to use \marginnote in mdframed environment, if possible. My search led to this question, that also doesn't have any answer.

I also have quite a number of \marginnote, marginfigure and figure* floats (with some tikz stuffing). I assume they all work the same, so I hope they will work as soon as the problem will be solved for at least one of them.

Any code modifications are welcome, as I still don't understand how that solution works anyway (I am freaking out as I see @ and code around it).



    innertopmargin=4pt, %\baselineskip

\noindent Some normal text.

  • 1
    Generally you cannot, \marginnote is a float and it cannot escape the mdframed boxes. I don;t quite understand what you are mentioning about a line, please update your question to something that are clearer to understand. Also don't put your questions into the bounty. – daleif Jan 29 '18 at 13:25
  • @dalief, sorry, I was not sure. Then the hint -box asked me for the clarification for the answerer, I did my best. Should I update my question by adding possible ways to resolve it (or at least the ways that would work or me)? – Sergey Belyaev Jan 29 '18 at 13:48
  • You should at least update your question so it is clearer what you are asking. Note that the site favours clear explicit questions, not "please do this for me" questions. – daleif Jan 29 '18 at 14:37

The \marginnote definition of the tufte-book class is based on \marginpar. This is a float and it won't work inside a mdframed environment.

You can switch to the \marginnote definition of the marginnote package, which is not a float. Be aware that this completly overwrite the tufte-definition. So none of the tufte settings or options will apply:





\noindent Some normal text.


enter image description here

  • 1
    Thank you. I accept it as the answer. Unfortunately, this solution does not allow to place figures and TikZ pictures in the '\marginpar' environment redefined like that. I have a lot of stuff like that. It looks like I have to find another way to emphasize several paragraphs. This solution brings me more problems than this particular one resolved. – Sergey Belyaev Jan 30 '18 at 14:05
  • It should be no problem to add a tikz picture inside a \marginnote. And you can add figures, if you don't use the figure environment. – Ulrike Fischer Jan 30 '18 at 14:07

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.