Page LayoutMiddle Column Notes with Twocolumn

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
mikaellaine
Posts: 3
Joined: Sun May 23, 2010 3:04 pm

Middle Column Notes with Twocolumn

Post by mikaellaine »

Hi!
I've been looking for answers all around the place, but seem to be getting nowhere, so I decided to turn to you guys for help.

I'm looking to add middle column notes in between two columns of text, like found in many bibles. This is unlike what ledmac, parcolumns, or multicols can do, in that I want the text to continue from col #1 to col #3 (as in normal twocolumn), but just want a special middle column for margin notes (instead of the margins).

Like this:
3columns.jpg
3columns.jpg (120.62 KiB) Viewed 3552 times
I can think of two ways to approach this:
1. Somehow modifying marginpar, to put the text in between the two columns (having the two sides share the same area)
2. Having a third column, with text flowing from 1st to 3rd. Somehow you would have to manually set the vertical location of the notes to correspond with the correct locations in the text.

Any ideas? Thanks in advance!


Edit by localghost: No external links for attachments!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Middle Column Notes with Twocolumn

Post by localghost »

Attachments shall be uploaded to the forum server (see Board Rules). External links can get lost with time and make a problem incomprehensible.

I don't see problems in doing that with the parcolumns package. It allows a middle column at a certain width and also rules separating the columns. A close look at the manual can't do any harm.

As soon as the problem is solved, please act according to Section 3 of the Board Rules (last two paragraphs).


Best regards and welcome to the board
Thorsten
mikaellaine
Posts: 3
Joined: Sun May 23, 2010 3:04 pm

Re: Middle Column Notes with Twocolumn

Post by mikaellaine »

Thanks for moving the attachment, and sorry for not noticing that one.

I've tried parcolumns, and perused the manual (the one by Jonathan Sauer, 2004/11/25).

The problem with parcolumns is that the columns are parallel, i.e. the text does not automatically flow from one column to another (like in twopage, or multicols). When dealing with a long text, it is unthinkable to have to specify colchunks for each and every page separately.

I'll keep looking and learning :-)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Middle Column Notes with Twocolumn

Post by localghost »

Sorry my fault. Obviously I overlooked the essentials about the continuity of the text. So, for your consideration, here is a very basic idea of how to do that. For the moment I can only present the easy part. The next will follow.

The idea is to set up a document with a two column layout as usual and stretch the space between them to an appropriate value. Since there is only one rule possible between the columns with simple structures, we have to take the eso-pic package to put two separating rules on every page of the document. This idea is translated with the below code.

Code: Select all

\documentclass[11pt,a4paper,english,twocolumn]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage{babel}
\usepackage{calc}
\usepackage{eso-pic}
\usepackage[babel]{microtype}
\usepackage{blindtext}

\setlength{\columnsep}{80pt}

\AddToShipoutPicture{%
  \AtTextCenter{%
    \begin{picture}(0,0)
    	\put(\LenToUnit{0.4\columnsep},\LenToUnit{0.5\textheight}){\line(0,-1){\LenToUnit{\textheight}}}
    	\put(-\LenToUnit{0.4\columnsep},\LenToUnit{0.5\textheight}){\line(0,-1){\LenToUnit{\textheight}}}
    \end{picture}
  }
}

\begin{document}
  \blinddocument
\end{document}
This works fine so far. But now comes the tricky part. Since the notes will be different for every page, we have to make LaTeX put them right in the middle of the page where they belong. This can also be done by means of the eso-pic package. I'm thinking about a minipage environment that fits exactly the interspace between the columns. Please test the above code on your machine. This is all can present at the moment. More will follow not earlier than tomorrow.

Depending on your LaTeX skills you might be able to do the rest regarding the notes. But at first test the presented code for functionality.
mikaellaine
Posts: 3
Joined: Sun May 23, 2010 3:04 pm

Re: Middle Column Notes with Twocolumn

Post by mikaellaine »

Thanks!
This does indeed help, and works nicely. I'll look into the actual notes-adding part as I have time, and try to make it as sophisticated as possible.

Optimally, I'd have a command like \note{<text>} that would then place the note into the middle column of that page. Very tricky, as far as I can see. All help is appreciated still.

I hope this will be a useful case for others to read as well.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Middle Column Notes with Twocolumn

Post by localghost »

mikaellaine wrote:[...] Optimally, I'd have a command like \note{<text>} that would then place the note into the middle column of that page. Very tricky, as far as I can see. [...]
Of course, that would be the most sophisticated way. But at the moment I don't see a possible solution. Perhaps somebody else does. In the meantime I figured out the rest of my solution. The tricky part is to find out the right place in the source to put the notes on the according page. The code below contains a complete example.

Code: Select all

\documentclass[11pt,a4paper,english,twocolumn]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage{babel}
\usepackage{calc}
\usepackage{eso-pic}
\usepackage[babel]{microtype}
\usepackage{blindtext}

\setlength{\parindent}{0pt}
\setlength{\columnsep}{100pt}

% Stuff for all pages (eso-pic)
\AddToShipoutPicture{%
  \AtTextCenter{%
    \begin{picture}(0,0)
    	\put(\LenToUnit{0.45\columnsep},\LenToUnit{0.5\textheight}){\line(0,-1){\LenToUnit{\textheight}}}
    	\put(-\LenToUnit{0.45\columnsep},\LenToUnit{0.5\textheight}){\line(0,-1){\LenToUnit{\textheight}}}
    \end{picture}
  }
}

\begin{document}
  \blinddocument
  % Stuff for the current page (eso-pic)
  \AddToShipoutPicture*{%
    \AtTextCenter{%
      \begin{picture}(0,0)
        \put(-\LenToUnit{0.44\columnsep},\LenToUnit{-0.5\textheight}){
          \begin{minipage}[b][\textheight][t]{0.8\columnsep}
            \footnotesize
            A note on the second page
          \end{minipage}
        }
      \end{picture}
    }
  }
  \blinddocument
\end{document}
For adding notes that appear like footnotes, you could use the \textsuperscript{<number>} command. However, you have to find out the current page in the source by yourself to get the notes at the right place. Don't wonder at warnings regarding »underfull hboxes«. It's quite normal that there occur problems with hyphenation in very narrow columns.
Post Reply