0

I need to write a technical translation with 2 columns (one for each language), complete with figures, references and footnotes. I tried paracol, but I keep running into all kinds of problems, e.g. figures which span both colums appear at end of text etc.. Any proposal or - even better - maybe a template I can use as a starting point? Below please find an example (made with Word), which highlights (in red) what I need to do:

  1. reference to footnote from other column
  2. figure on page, not at end of text
  3. footnotes and references in figure and table captions
  4. consecutive numbering of footnotes over several pages
  5. footnotes and references to footnotes in table
  6. footnotes at bottom of (same) page span both columns

As said, I am despairing by now, because when I solve one of the above points I often find it collides with another one. For example, I can place a figure where I want it (2.) by \end{paracol}, but then the footnotes appear in the middle of the page, and so on... I simply can't get everything to work at once :-(

Any help is highly appreciated! Thanks a lot in advance :-)

PS: I am not a LaTeX wizard, so please bear with me asking questions.

Update: with John's below proposal and some additional tweaking I can now create what I want :-) Thanks again to all of you!

Specifically I added a custom command to end paracols and save the footnote indices (\globalcounter didn't work for unknown reason). That allows custom headers which span 2 columns.

Here is the working copy:

    \documentclass[a4paper,11pt]{scrartcl}
    \usepackage{graphicx}
    \usepackage{paracol}
    \usepackage[german,english]{babel}
    \usepackage[utf8]{inputenc}                 % for umlaut support (üöäß)
    \usepackage[pdfborder={0 0 0}]{hyperref}    % references & TOC with links
    \usepackage{tabularx}
    \usepackage{caption}
    \usepackage{longtable}
    %\usepackage{nonfloat}                      % allows captions without float environment
    \usepackage{lipsum}


    % footnotes span both text columns
    \footnotelayout{m}  


    % save footnote index after \end{paracols}
    \newcounter{foo}
    \globalcounter{foo}
    \newcommand{\startcolumns}{\begin{paracol}{2}}
        \newcommand{\stopcolumns}{%
            \setcounter{foo}{\value{footnote}}%
        \end{paracol}%
        \setcounter{footnote}{\value{foo}}%
    }


    % define environment for floating figures accross columns
    % see https://tex.stackexchange.com/questions/545214/2-column-text-with-floating-figures/545286#545286
    \globalcounter{figure}
    \makeatletter
    \newenvironment{Figure}{\switchcolumn[0]*% synchronize columns
      \vskip\intextsep
      \noindent\minipage{\textwidth}
        \def\@captype{figure}}% body goes here
    {\endminipage\hskip-\textwidth
      \newline\vskip\intextsep
      \switchcolumn[0]*}% synchronize columns
    \makeatother


    % define environment for floating tables accross columns
    % see https://tex.stackexchange.com/questions/545214/2-column-text-with-floating-figures/545286#545286
    \globalcounter{table}
    \makeatletter
    \newenvironment{Table}{\switchcolumn[0]*% synchronize columns
      \vskip\intextsep
      \noindent\minipage{\textwidth}
        \def\@captype{table}}% body goes here
    {\endminipage\hskip-\textwidth
      \newline\vskip\intextsep
      \switchcolumn[0]*}% synchronize columns
    \makeatother


    % define footnote with label which can be referenced by \footref. Required for captions and paracols
    % see https://tex.stackexchange.com/questions/10102/multiple-references-to-the-same-footnote-with-hyperref-support-is-there-a-bett
    \newcommand{\footnotelabel}[2]{%
        \addtocounter{footnote}{1}%
        \footnotetext[\thefootnote]{%
            \addtocounter{footnote}{-1}%
            \refstepcounter{footnote}\label{#1}%
            #2%
        }%
        $^{\ref{#1}}$%
    }

    % define footnote text with label. Required for footnotes in tables
    \newcommand{\footnotetextlabel}[2]{%
        \addtocounter{footnote}{1}%
        \footnotetext[\thefootnote]{%
            \addtocounter{footnote}{-1}%
            \refstepcounter{footnote}\label{#1}%
            #2%
        }%
    }

    % refer to a footnote defined by \footnotelabel or \footnotetextlabel
    \renewcommand{\footref}[1]{%
        \textsuperscript{{\ref{#1}}}%
    }


    \begin{document}
        \small\sloppy

        \section{this is a heading which is too long for 2 columns}

        \startcolumns       

            \switchcolumn[0]
                Lorem ipsum dolor sit amet, consectetuer\footnotelabel{note1}{First footnote (accross both columns)} adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. 

            \switchcolumn[1]
                Nulla malesuada porttitor diam. Donec felis\footref{note1} erat, congue non, volutpat at, tincidunt tristique, libero. Vivamus viverra fermentum felis. 

            \begin{Figure}
                \centering
                %\includegraphics[width=0.5\textwidth]{panda.jpg}
                \includegraphics[width=0.5\textwidth]{example-image}
                \label{figure: panda}
                \captionof{figure}{caption of figure\footref{note2}}
            \end{Figure}% now in left column
            \footnotetextlabel{note2}{Second footnote, reference to figure \ref{figure: panda}}

            \switchcolumn[0]*
                See figure \ref{figure: panda}. Nam dui ligula, fringilla a, euismod sodales\footnotelabel{note3}{Third footnote}, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. 

            \switchcolumn[1]
                Integer non enim. Praesent euismod nunc\footref{note3} eu purus. Donec bibendum quam in tellus. Nullam cursus pulvinar lectus. 

            \begin{Table}
                \centering
                \begin{tabularx}{\textwidth}{| X | X | X |}
                    \hline
                        Parameter & Value & Unit \\ 
                    \hline
                        humidity\footref{note4} & 80 & \%  \\
                    \hline
                        temperature\footref{note4} & 27 & $^\circ$C \\ 
                    \hline
                \end{tabularx}
                \captionof{table}{caption of table\footref{note2}}
                \label{table: table1}
            \end{Table}
            \footnotetextlabel{note4}{Fourth footnote} 

            \switchcolumn[0]*
                See table \ref{table: table1}. Nam dui ligula, fringilla a, euismod sodales\footnotelabel{note5}{Fifth footnote} sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. 

            \switchcolumn[1]
                Integer non enim. Praesent euismod nunc\footref{note5} eu purus. Donec bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec et mi. Nam vulputate metus eu enim. Vestibulum pellentesque felis eu massa.

        \stopcolumns

    \end{document}

and here the corresponding output: enter image description here

gicking
  • 3
  • 3
  • 1
    Hi and welcome to TeX.SX. It would be much easier for us to answer your question if you give us a Minimal Working Example (MWE) showing the problem. You stated you tried to use paracol, could you give us the code to work with? – Elad Den May 20 '20 at 07:12
  • Also, check this out https://tex.stackexchange.com/questions/167708/tcolorbox-spanning-two-columns-in-paracol-environment – Elad Den May 20 '20 at 07:34
  • With paracol it can be done by synchronizing then overlapping the columns. But it only works between paragraphs. – John Kormylo May 20 '20 at 13:08
  • see above update of my question. In short: solved almost all issues, 2 still open – gicking May 25 '20 at 06:32

1 Answers1

1

This creates environments Figure and Table to insert a two column figure or table between paragraphs.

\documentclass[12pt]{article}
\usepackage{paracol}
\usepackage{graphicx}
\usepackage{caption}% for \captionof
\usepackage{lipsum}

\globalcounter{figure}
\globalcounter{table}

\makeatletter
\newenvironment{Figure}{\switchcolumn[0]*% synchronize columns
  \vskip\intextsep
  \noindent\minipage{\textwidth}
    \def\@captype{figure}}% body goes here
{\endminipage\hskip-\textwidth
  \newline\vskip\intextsep
  \switchcolumn[0]*}% synchronize columns

\newenvironment{Table}{\switchcolumn[0]*% synchronize columns
  \vskip\intextsep
  \noindent\minipage{\textwidth}
    \def\@captype{table}}% body goes here
{\endminipage\hskip-\textwidth
  \newline\vskip\intextsep
  \switchcolumn[0]*}% synchronize columns
\makeatother

\begin{document}
\small\sloppy
\begin{paracol}{2}
\lipsum[1]
\switchcolumn
\lipsum[2]

\begin{Figure}
  \centering
  \includegraphics[height=2cm]{example-image}
  \caption{Test}
\end{Figure}% now in left column

  \lipsum[3]
\switchcolumn
  \lipsum[4]

\begin{Table}
  \centering
  \begin{tabular}{|c|c|}
    \hline
    some & table \\
    \hline
  \end{tabular}
  \caption{Test}
\end{Table}

  \lipsum[5]
\switchcolumn
  \lipsum[6]

\end{paracol}
\end{document}
John Kormylo
  • 79,712
  • 3
  • 50
  • 120