29

I need help for typesetting a complex typographic layout comparable to the Talmud, yet not necessarily in Hebrew. I found the parcolumns package, but it does not support footnotes and it also does not provide a way for columns overflowing into one single column at the end of a page.

I am trying to create a layout that looks similar to that of the Talmud:

Talmud

Having a main chunk of text in the middle and commentary surronding it, footnotes at the bottom and margin notes on one side...

I couldn't find anything helpful so any help would be very much appreciated.

  • 6
    XeLaTeX is your friend. Check out the work of user ℝaphink. Especially this answer the code of which is on GitHub. – Alan Munn Nov 2 '13 at 16:14
  • wow! there are some really great works there... yet, the work of Raphink, looking at the code, shows manual linebreaks for every line of text in the margin area. I would need something that allows me to write the text in text boxes as I work on it not reproducing a historical book... I will look into this more closely. Maybe I find some help nevertheless. – moritzklenk Nov 2 '13 at 17:37
  • I would love to see someone implement this, as it is was a common format for all sorts of commentaries. This question, and some of the answers there are promising, but do not deal with the issue of 'wrapping' the secondary text around the main text, which is the key to it all. And of course adding side notes and footnotes probably makes the job that much tricker. Also the memoir class has lots of side note and footnote functionality build-in, but it does not 'wrap' the secondary text either.... – jon Nov 2 '13 at 19:14
  • One could do all the above using lots of parboxes, except for getting the text to flow from one box to the next. Except for multicolumn, text flow between boxes is not something which has been addressed (yet). – John Kormylo Nov 6 '13 at 18:32
  • 1
    Flowfram combined with shapepar can do it. The left frame fills the page but is restrained on the right by \parshape. The Right frame fills most of half the page but is restrained on the left by \parshape. The middle frame fills the gap. \parshape can also be used to insert large letters into the middle of text while the text flows around it. – John Kormylo Nov 8 '13 at 15:35
19

flowfram does not appear to be particularly robust. Since this is the first time I've used this package, I suspect improvements are possible.

\documentclass{article}

\usepackage{graphicx}
\usepackage{color}
\usepackage{flowfram}
\usepackage[margin=0.5in,noheadfoot]{geometry}
\usepackage{xparse}

\newcounter{tempcount}

%\newcommand{\ditto}[2]{% #1 = number of repetitions, #2=rext to repeat
\ExplSyntaxOn
\DeclareExpandableDocumentCommand{\ditto}{mm}
 {\prg_replicate:nn{#1}{#2} }
\ExplSyntaxOff

%put 0.25in header and footer, plus .3in notes on the sides.

\newlength\mainH
\newlength\mainW

\setlength{\mainW}{\textwidth}
\addtolength{\mainW}{-1in}
\setlength{\mainH}{\textheight}
\addtolength{\mainH}{-1in}

\newflowframe[1]{\mainW}{\mainH}{0.5in}{0.5in}[unused]

%create header, footer and notes

\newlength{\headY}
\setlength{\headY}{\textheight}
\addtolength{\headY}{-0.25in}

\newstaticframe[1]{\mainW}{0.25}{0.5in}{\headY}[top]
\newstaticframe[1]{\mainW}{0.25in}{0.5in}{0pt}[bottom]

\newlength{\noteX}
\setlength{\noteX}{\textwidth}
\addtolength{\noteX}{-0.3in}

\newstaticframe[1]{0.3in}{\mainH}{0pt}{0.5in}[left]
\newstaticframe[1]{0.3in}{\mainH}{\noteX}{0.5in}[right]

%create variable width frames

\newlength{\halfW}% compute width of top section
\setlength{\halfW}{\mainW}
\addtolength{\halfW}{-0.25in}% gutter
\setlength{\halfW}{0.5\halfW}

\newlength{\parW}% compute width if middle section
\setlength{\parW}{\mainW}
\addtolength{\parW}{-0.5in}% gutters
\setlength{\parW}{0.333\parW}

\newstaticframe[1]{\mainW}{\mainH}{0.5in}{0.5in}[first]
\setstaticframe*{first}{shape={\parshape=56
\ditto{8}{0pt \halfW }
\ditto{40}{0pt \parW }
\ditto{8}{0pt \mainW }
}}

\newlength{\parI}% indentation for second frame
\setlength{\parI}{\parW}
\addtolength{\parI}{0.25in}
\newlength{\newW}% compute width at bottom
\setlength{\newW}{\mainW}
\addtolength{\newW}{-\parI}

\newstaticframe[1]{\mainW}{\mainH}{0.5in}{0.5in}[second]
\setstaticframe*{second}{shape={\parshape=34
\ditto{30}{\parI \parW }
\ditto{4}{\parI \newW }
}}

\newlength{\halfI}%compute indentation at top
\setlength{\halfI}{\mainW}
\addtolength{\halfI}{-\halfW}
\newlength{\newI}%compute indentation at bottom
\setlength{\newI}{\mainW}
\addtolength{\newI}{-\parW}

\newstaticframe[1]{\mainW}{\mainH}{0.5in}{0.5in}[third]
\setstaticframe*{third}{shape={\parshape=28
\ditto{8}{\halfI \halfW }
\ditto{20}{\newI \parW }
}}

\begin{document}
\pagestyle{empty}

\begin{staticcontents*}{top}
Header \hfill with \hfill multiple \hfill fields
\end{staticcontents*}

\begin{staticcontents*}{bottom}
\hfil Footer
\end{staticcontents*}

\begin{staticcontents*}{left}
\raggedright
Hi there
\vfill\rule{0pt}{0pt}
\end{staticcontents*}

\begin{staticcontents*}{right}
\raggedright
Default is to center vertically.
\end{staticcontents*}

\begin{staticcontents*}{first}
\ditto{12}{This is a test.  If this had been a real emergency, I would be gone from here and you would not be hearing me.
Oh, you would be in so much trouble and I would be laughing my ass off! \\}
\end{staticcontents*}

\begin{staticcontents*}{second}
\vspace*{0.2in}
\resizebox{\parW}{!}{\includegraphics{rowboat.png}}
\ditto{5}{This is a test.  If this had been a real emergency, I would be gone from here and you would not be hearing me.
Oh, you would be in so much trouble and I would be laughing my ass off! \\}
\end{staticcontents*}

\begin{staticcontents*}{third}
\ditto{8}{This is a test.  If this had been a real emergency, I would be gone from here and you would not be hearing me.
Oh, you would be in so much trouble and I would be laughing my ass off! \\}
\vspace*{1.8in}
\end{staticcontents*}

\rule{\linewidth}{0pt}%some text is required
\end{document}

enter image description here

  • While the default for static is to vertically center the text, the default for dynamic is to start at the top (which is somewhat easier to use). \vfil and \rule have inconsistent results. – John Kormylo Nov 10 '13 at 0:32
  • Around line 33, you have \addtolength{\headY}{-0.25}, but you need to specify a unit of measurement, I think. – jon Nov 10 '13 at 4:36
  • @jon - thanks. If anything, using flow frames instead of dynamic frames is even flakier. It should be noted that \parshape is only good for one paragraph, so a blank line ruins all the indentation. – John Kormylo Nov 10 '13 at 14:59
  • @John Kormylo, can you send this me the doc that you made in its original format? – Chiddushei Torah Nov 24 '14 at 22:56
  • @Chiddushei Torah - I didn't save it, but you can just run the answer. Or do you want the document posted by r33nty? – John Kormylo Nov 25 '14 at 16:38
12

Here is an alternative based on TikZ nodes rather than flowfram columns. The advantage is that you don't have to deal with parshape. The disadvantage is that you have to manually break paragraphs between nodes.

\documentclass[letter]{article}
\usepackage[margin=0.5in,noheadfoot]{geometry}
\usepackage{tikz}
\usepackage{mwe}% for image and \lipsum
\usetikzlibrary{calc}

\pagestyle{empty}
\parindent=0pt

\newcommand{\nopar}{\strut\parfillskip 0pt}
% manually inserted at end of minipage

\begin{document}
\begin{tikzpicture}[every node/.style={inner sep=0pt}]
\node[minimum width=\textwidth, minimum height=\textheight] (Page) at (0.5\textwidth,0.5\textheight) {};
% define 0.25in header and footer, plus .5in notes on the sides.
\node[minimum width=\textwidth-1in, minimum height=\textheight-.5in] (Text) at (Page.center) {};
\node[minimum width=\textwidth-1in, minimum height=.25in,below] (Top) at (Page.north) {};
\node[minimum width=\textwidth-1in, minimum height=.25in,above] (Bottom) at (Page.south) {};
\node[minimum width=.5in, minimum height=\textheight,right] (Left) at (Page.west) {};
\node[minimum width=.5in, minimum height=\textheight,left] (Right) at (Page.east) {};
% example headers
\node[below right] at (Top.north west) {\huge left};
\node[below] at (Top.north) {\huge center};
\node[below left] at (Top.north east) {\huge right};
% example footers
\node[above] at ($(Bottom.south west)!.333!(Bottom.south east)$) {\huge 1/3};
\node[above] at ($(Bottom.south west)!.667!(Bottom.south east)$) {\huge 2/3};
% example left margin
\node[below right,text width=.4in,align=left] at (Left.north west) 
  {Notice that the margin notes go all the way to the top};
\node[above right,text width=.4in,align=left] at (Left.south west) 
  {and bottom};
% example columns
\node[below right] (A) at (Text.north west) {\begin{minipage}{3.2in}
\parindent=.25in
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. 
Nam arcu libero, nonummy eget, consectetuer id,
vulputate a, magna. Donec vehicula augue eu neque.\nopar
\end{minipage}};
\node[below right] (B) at (A.south west) {\begin{minipage}{2in}
\parindent=.25in
\noindent
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 
Mauris ut leo. Cras viverra metus rhoncus sem. 
Nulla et lectus vestibulum urna fringilla ultrices. 
Phasellus eu tellus sit amet tortor gravida placerat. 
Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. 
Praesent eget sem vel leo ultrices bibendum. Aenean faucibus.
Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. 
Curabitur auctor semper nulla. Donec varius orci eget risus. 
Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. 
Duis eget orci sit amet orci dignissim rutrum.

\lipsum[2]

Nulla malesuada porttitor diam. 
Donec felis erat, congue non, volutpat at, tincidunt tristique, libero. 
Vivamus viverra\nopar
\end{minipage}};
\node[below right] (C) at (B.south west) {\begin{minipage}{6.5in}
\parindent=.25in
\noindent
fermentum felis. 
Donec nonummy pellentesque ante. 
Phasellus adipiscing semper elit. 
Proin fermentum massa ac quam. 
Sed diam turpis, molestie vitae, placerat a, molestie nec, leo. 
Maecenas lacinia. Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. 
Morbi blandit ligula feugiat magna. 
Nunc eleifend consequat lorem. 
Sed lacinia nulla vitae enim. 
Pellentesque tincidunt purus vel magna. Integer non enim. 
Praesent euismod nunc eu purus.

\lipsum[4]
\end{minipage}};
\node[below left] (D) at (Text.north east) {\begin{minipage}{3.2in}
\parindent=.25in
Fusce mauris. 
Vestibulum luctus nibh at lectus. 
Sed bibendum, nulla a faucibus semper, leo velit ultricies tellus, ac venenatis arcu wisi vel nisl. 
Vestibulum diam. 
Aliquam pellentesque, augue quis sagittis posuere, turpis lacus congue quam, in hendrerit risus\nopar
\end{minipage}};
\node[below left] (E) at (D.south east) {\begin{minipage}{2in}
\parindent=.25in
\noindent
eros eget felis. 
Maecenas eget erat in sapien mattis porttitor. 
Vestibulum porttitor. 
Nulla facilisi. 
Sed a turpis eu lacus commodo facilisis. 
Morbi fringilla, wisi in dignissim interdum, justo lectus sagittis dui, et
vehicula libero dui cursus dui. 
Mauris tempor ligula sed lacus. Duis cursus enim ut augue. 
Cras ac magna.
Cras nulla. Nulla egestas. 
Curabitur a leo. 
Quisque egestas wisi eget nunc. 
Nam feugiat lacus vel est.
Curabitur consectetuer.

\lipsum[6]
\end{minipage}};
\node[below] (F) at ($(Text.north)+(0,-1in)$) {\begin{minipage}{2in}
\parindent=.25in
\begin{center}
\includegraphics[width=.9\textwidth]{example-image}
\end{center}

\lipsum[7]

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Donec odio elit, dictum\nopar
\end{minipage}};
\node[below right] (G) at (F.south west) {\begin{minipage}{4.25in}
\parindent=.25in
\noindent
in, hendrerit sit amet, egestas sed, leo.
Praesent feugiat sapien aliquet odio. 
Integer vitae justo. 
Aliquam vestibulum fringilla lorem.
Sed neque lectus, consectetuer at, consectetuer sed, eleifend ac, lectus. 
Nulla facilisi. 
Pellentesque eget lectus. 
Proin eu metus. 
Sed porttitor. 
In hac habitasse platea dictumst. 
Suspendisse eu lectus.
Ut mi mi, lacinia sit amet, placerat et, mollis vitae, dui. 
\end{minipage}};
% example right margin
\node[below left,text width=.4in,align=left] at (Right.east |- F.north)
  {You can align margin notes to column locations};
\node[left,text width=.4in,align=left] at (Right.east)
  {\resizebox{.4in}{!}{You can}
   \resizebox{.4in}{!}{adjust}
  \resizebox{.4in}{!}{the font}
  \resizebox{.4in}{!}{to fit the}
  \resizebox{.4in}{!}{space}};
\end{tikzpicture}
\end{document}

new version

Since a lot of this will be repeated, one should create macros and/or environments to cut down the clutter.

  • Is there a way to have a single box in the middle? – Nero 2 days ago
  • 1
    @Nero - Lot's of ways, but they all involve manually breaking paragraphs. – John Kormylo 2 days ago

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.