I've noticed that when a \marginnote
is added (edit: using the marginnote package), the horizontal alignment of that note is inherited from wherever the note is placed. In my case, I wish to have a margin note defined inside a section heading, which makes the margin note centred.
If I try to add \raggedleft
or \raggedright
to the instruction, then it is either ignored, or overwrites the formatting of the section header (depending on whether it is in the left or right margin).
Is there some way to change the horizontal alignment of the marginal text independently of the text in which it is defined?
Edit: My apologies, in constructing the minimum working example, I realise I've embarrassingly omitted the important detail of how I (almost certainly incorrectly) set the centering of the section header. Below is a minimum working example of what I want.
\documentclass{article}
\RequirePackage{sectsty}
\allsectionsfont{\centering\sc} % <-- this is probably wrong!
\usepackage[fulladjust]{marginnote}
\begin{document}
\section*{This is a section header\marginnote{I really really want this
margin note to be raggedright, and not centred like it is here.}}
\end{document}
Another point to note is that I actually want the text flushed left or right depending on whether the note is in the left or the right margin. This means is think I do need to change the alignment of the marginal text.