5

How can I create a dcoument (e.g. a book) with two columns and some annotation, such as references BETWEEN them? See example picture: The references and some comments are in the gap between the columns. I would like to replicate this. I am using memoir and I have tried multicols with \marginnote but to no avail. Also paracol does not realy work since it forces the text to remain in one column.

Any hint or help is much appreciated! Thanks in advance!

Two-column book with annotation between columns.

Two-column book with refernces between columns-sometimes referring to left or right column.

  • Welcome to TeX.SX! What kind of annotations are that? It seems like content which should stay near to the content, but please add some details. – TeXnician Oct 8 '17 at 20:31
  • Thanks for the response. These annotations could be anything referring to the left or right column, e.g.: a reference, a link, or a small comment. Basically, as can be seen in the picture above, the centre column includes content that is normally part of \marginpar, \marginnote or \sidenote. So, is there any way in twocolumn or multicols to have the marginnotes in between columns? – user145210 Oct 8 '17 at 20:47
  • from the example pictures I would expect the annotations not beling like marginpars (ie aligned with the sourcel line) but more like footnotes (one group from the top and one from the bottom, perhaps for left right column?) if so the design/code would be somewhat different. – Frank Mittelbach Oct 9 '17 at 16:19
6

This might be a start but it would require a lot of careful hand tweaking, it sets the text with a wide column separation and patches marginpar to put the notes on the inside. However the system will not try to avoid the margin notes from different columns colliding you would have to adjust their vertical offset by hand.

enter image description here

\documentclass[twocolumn,twoside]{article}
\usepackage{etoolbox}
\def\a{One two three four filve six seven eight nine ten eleven twelve.}
\def\b{\a\ \a\ Red yellow blue. \a\ \a\ \a\ \a\ \a\ \a}

\newcounter{zzz}
\def\zz#1{{%
\refstepcounter{zzz}\textsuperscript{\thezzz}%
\marginpar{\textsuperscript{\thezzz}#1}%
}}
\makeatletter
\patchcmd\@addmarginpar{\if@firstcolumn}{\unless\if@firstcolumn}{}{}
\makeatother
\setlength\columnsep{3cm}

\begin{document}

\subsection{Zzzz}
\b aa bb\zz{this} \a\zz{zzzz}\b

\subsection{ZzZzzzz}
Zzzz\zz{that}. Apples\zz{fruit} oranges pears. \b\b\b\b

Something\zz{The other}
\a\zz{another note} \b\b\b



\end{document}
  • Wow, that was quick. Many thanks. I'll try it instantly. It looks cool. – user145210 Oct 8 '17 at 20:52
  • Works perefectly! Many thanks. Only restriction seems to be that one cannot used it within the multicols environment. But this is not an issue. It's pretty much what I was looking for. I'll be experimenting further with. Thanks also for implementing it with counters. I wasn't actually thinking about them. Many thanks!!! – user145210 Oct 8 '17 at 21:43
2

Many thanks once again to David Carlisle for providing the answer! Based on it I have made some improvements. Text does not collide quite so easily anymore. (though not perfect yet). And formatting is nicer.

In case anyone else is interested, here's the code:

\documentclass[10pt, a4paper, twocolumn, twoside, openright]{memoir}
\usepackage{etoolbox}
\usepackage{ragged2e}
\usepackage{qrcode} % for qr code example
\usepackage{lipsum} % for blindtext
\usepackage{fontawesome} % for symbols

\newcounter{mySideNoteCounter}
\makeatletter
\def\mySideNote#1{{%
\refstepcounter{mySideNoteCounter}\textsuperscript{\themySideNoteCounter}
   \if@firstcolumn
     \marginpar{\RaggedRight\fussy\footnotesize\textit{\textcolor{red}{\faCaretLeft~}\textsuperscript{\themySideNoteCounter}\\ #1}}
   \else
     \marginpar{\textsuperscript{\themySideNoteCounter}\RaggedLeft\fussy\footnotesize\textit{\textcolor{red}{~\faCaretRight}\\ #1}}
   \fi
}}
\makeatother

\makeatletter
  \patchcmd\@addmarginpar{\if@firstcolumn}{\unless\if@firstcolumn}{}{}
\makeatother


\setlength\columnsep{3.5cm}
\setlength\marginparsep{0.2cm}
\setlength\marginparwidth{3cm}

%\makeatletter
%\newcommand{\LorR}{%
%   \if@firstcolumn
%   LEFT%
%   \else
%   RIGHT%
%   \fi
%}
%\makeatother


\begin{document}
   \section{Section}
   \subsection{Subsection}
   TEXT\mySideNote{Information.\faBarChart} 
   \lipsum[1] Text text TEXT\mySideNote{Info}

   \subsection{Subsection}
   %\LorR
   TEXT\mySideNote{A little note!}
   Some text is written here. It is  not very interesting. Just for testing. Simply ignore it.
   TEXTTEXT\mySideNote{Here is a side note! Some interesting information here}
   \lipsum[1]
   \mySideNote{Look:\\\qrcode{https://www.ctan.org/tex-archive/macros/latex/contrib/qrcode?lang=en}} \lipsum[2]
   HELLO\mySideNote{Some more information here!}
   \lipsum[1]
   TEXT\mySideNote{Look? There's another marginnote!}
   \lipsum[5-8]
   MORE TEXT \mySideNote{And again a margin note! Extraordinary, even some qr code!\\\qrcode{https://www.ctan.org/tex-archive/macros/latex/contrib/qrcode?lang=en}}
   \lipsum[1]

\end{document}

This then gives the following result:

Annotations between columns

Any ideas on how to implement the separating lines are welcome! I couldn't find an answer to that one.

Also, it would be interesting to know how to arrange it as Frank Mittelbach says. That is, to use the middle margin for footnotes. The top ones for the left column, the bottom ones for the right column.

P.S. I was user145210 who originally posted the question. When I finished registration it did not update the account. Don't know what happened there.

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.