3

Here's a small example of what I have to use. I have to reset the length everytime I use \marginnote because it restarts indenting and reformats the skip to 0.

\marginnote{\normalsize Some text goes here}
\setlength{\parindent}{0in}
\setlength{\parskip}{0.15in}

What I would like to be able to do is redefine this behaviour so I don't have to type so much junk (and keep my tex/Sweave document cleaner)

\somecommand Some text goes here 

Is there a way to get it to do so?

3
  • 1
    Why does \marginnote reset the lengths in the first place?
    – Werner
    Commented Mar 5, 2012 at 18:23
  • No idea, and I don't understand latex enough to figure it out* Commented Mar 5, 2012 at 18:24
  • 1
    The grouping I suggest in my answer should work to keep the length modification to "within" \somecommand.
    – Werner
    Commented Mar 5, 2012 at 18:25

1 Answer 1

5

You could use a grouping structure to localise any changes made by \marginnote:

\newcommand{\somecommand}[1]{% \somecommand{<text>}
  \begingroup
  \marginnote{\normalsize #1}%
  \endgroup
}

You would then use

\somecommand{Some text goes here.}
1
  • Perfect, I just added my \setlength's after \marginnote and it works as expected. Commented Mar 5, 2012 at 18:29

You must log in to answer this question.

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