TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i'm having a hard time to figure out how to control the exact appearance of margin text (such as is output by the \marginpar command). i'm using XeLaTeX with packages such as geometry, fontspec, leading and have managed to gain fine control over issues such as font faces, font sizes, paragraph indentation and line spacing, including how to set margin width and the distance of the margins from the main text.

how can i control the font and paragraph formatting of margins?

share|improve this question

The LaTeX kernel uses \@marginparreset to set a fresh state in margin paragraphs. The usual definition is


and you can modify it setting the font you prefer. I'd suggest something like

\def\@marginparfont{\normalfont\itshape} % or whatever

With \normalfont you go in the default state and then you can add whatever specification you wish.

share|improve this answer
your answer implies using \makeatletter / \makeatother to allow for command names containing @, right? – flow Mar 29 '13 at 23:08
@flow Yes; the two commands are not necessary only in .sty or .cls files. – egreg Mar 29 '13 at 23:21

@egreg wow that was real fast, many thanks for your suggestion. i've had an idea in the meantime and came up with this:


(i'm using \leading here coz \fontsize on its own would not appear to set the line height right).

so far the above seems works to my satisfaction—is anyone aware of possible ungood side effects?

share|improve this answer
\leading probably corrects it but \fontsize{2mm}{2mm} sets a 2mm font on the same baseline, it's unusual to use mm for font sizes but no harm in it, but normally the baselineskip should be around 20% bigger than the font size. You then need \selectfont (which \leading also does) before \fontsize has any effect. – David Carlisle Mar 30 '13 at 1:02
the thing is that the second argument to \fontsize would not appear to have any effect at all (pending more experiments), which is why i'm using \leading at all. – flow Mar 30 '13 at 20:59
If you follow it by \selectfont and the paragraph ends within the scope of the change then it will have an effect, the whole of LaTeX's font machinery relies on that working... – David Carlisle Mar 30 '13 at 21:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.