This is a follow-up question to Making marginnote to appear either side of twocolumn, twoside document, taking into account Marginnote right after \section: how to prevent page break? (the main difference being the use of \strut
instead of \needspace
).
In this MWE, the note appears on the wrong column:
\documentclass[twocolumn,twoside]{article}
\usepackage{lipsum}
\usepackage{marginnote}
\makeatletter
\let\oldmarginnote\marginnote
\renewcommand*{\marginnote}[1]{%
\strut%
\begingroup%
\ifodd\value{page}
\if@firstcolumn\reversemarginpar\fi
\else
\if@firstcolumn\else\reversemarginpar\fi
\fi
\oldmarginnote{#1}%
\endgroup%
}
\makeatother
\begin{document}
\lipsum[4-6]
\lipsum[6]
\marginnote{Note on wrong column}
Text with note
\end{document}
This seems to be an issue with \if@firstcolumn
. How can this be fixed?