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.

1
  • There is a package for sidenotes, as far as I know
    – user31729
    Dec 30, 2016 at 15:56

1 Answer 1

4
\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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .