2

How can I put a a \marginnote on top of a multicols environment?

enter image description here

BTW: I think, it is better to set the \marginnote not inside the multicols environment.

BTW: I used a "picture" to show, that the first line of the multicols environment is not always containg text.

\documentclass[paper=a5]{scrreprt}
\usepackage{multicol}
  \newenvironment{Figure}
    {\medskip\noindent\minipage{\linewidth}\centering}
    {\endminipage\par\medskip}

\usepackage{marginnote}

\usepackage{mwe}
\begin{document}
\marginnote{test}
\begin{multicols}{2}[]
\begin{Figure}
\rule{4cm}{2cm}
\end{Figure}
\lipsum[66-68]
\end{multicols}
\end{document}

1 Answer 1

3

Hm, I think here is a missunderstanding. Let us use in the following mwe package showframe to visualize the typing area and margins.

Then please see the added code

text.
\marginnote{test1} % <==================================================

to your given code. Now you see (comment for example the both added lines for a second compiler chain and compare the result with the first one!) that command \marginnote{test1} is the reason you got a blank space before your typed figure ...

If you do not want balanced columns you can use command \raggedcolumns or use environment multicols* instead multicols. Please have a look into documentation with typing texdoc multicol in your terminal/console!

Please have a look to the following code:

\documentclass[paper=a5]{scrreprt}

\usepackage{multicol}
\newenvironment{Figure}
  {\medskip\noindent\minipage{\linewidth}\centering}
  {\endminipage\par\medskip}

\usepackage{marginnote}
\usepackage{lipsum}
\usepackage{showframe}

%\usepackage{mwe} % not needed to be called, must only be installed ...


\begin{document}
text.
\marginnote{test1} % <==================================================
\begin{multicols}{2}[]
%\raggedcolumns % <=====================================================
\marginnote{test2}
\begin{Figure}
\rule{4cm}{2cm}
\end{Figure}
\marginnote{test3}
\lipsum[66-68]
%\marginnote{test4}
%\lipsum[1-10]
%\marginnote{test5}
\end{multicols}

\clearpage

%text.
%\marginnote{test1}
\begin{multicols*}{2}[]
%\raggedcolumns % <======================================================
\marginnote{test2}
\begin{Figure}
\rule{4cm}{2cm}
\end{Figure}
\marginnote{test3}
\lipsum[66-68]
%\marginnote{test4}
%\lipsum[1-10]
%\marginnote{test5}
\end{multicols*}
\end{document}

and the two resulting pages:

first page

and

second page

I hope you can see that the margin note is placed at the place you adviced to place it. because you added in your code a blank first line your margin note seems to be placed on the wrong place. That is the missunderstanding I suppose ...

You must log in to answer this question.

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