How do you change the font used for a \marginpar? I am using xltxtra, and am seeking to use an OpenType font.


\setmainfont[Ligatures=TeX]{Font A}


Hello world.\marginpar{A margin note in Font B}

  • Nowadays loading xltxtra is not recommended, if you don't really need its features (I bet you don't). Just load fontspec. – egreg May 24 '13 at 19:32

If you can use marginnote there is a marginfont command (link to the manual) that you can adapt. Otherwise, perhaps using fontspec would be good enough?





    \lipsum[1]\marginpar{\fontspec{Courier}A marginpar in Courier}
    \lipsum[1]\marginnote{A marginnote in Courier}
    \lipsum[1]\marginparNewFont{A marginparNewFont in Courier}

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.