1

I want to have something like this but I can't figure out how I can achieve it.

\begin{sidenote}
    Text
\end{sidenote}

I want to create this environment using newenvironment. What I want to do is the text in the begin-end should be fed to the command \marginnote. So I need to get

\marginnote{Text}

whenever I put the text in a sidenote environment.

  • There is a package for sidenotes, as far as I know – user31729 Dec 30 '16 at 15:56
3
\documentclass{article}
\usepackage{environ,marginnote}
\NewEnviron{sidenote}{\marginnote{\BODY}}
\begin{document}
This is text
\begin{sidenote}
Here is my sidenote text
\end{sidenote}
More text
\end{document}

enter image description here

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.