Как разделить рисунок между двумя столбцами с помощью paracol

Как разделить рисунок между двумя столбцами с помощью paracol

Я пишу отчет на двух языках. Поэтому я использую пакет paracolдля синхронизации текста в столбцах. Я также использую a \columnsepruleдля разделения двух столбцов.

Моя проблема в том, что в этот отчет мне нужно включить некоторую графику. Поэтому эти изображения не должны повторяться в обоих столбцах, но заголовок должен быть разным для каждого столбца.

Я придумал громоздкое решение: я создал singleColсреду с одним столбцом, которую я использую в левом столбце, и я использую phantomв правом столбце, чтобы иметь тот же интервал. Это работа: интервал все еще не идеален, и счетчики фигур неверны... Но у меня все еще есть одна проблема. Разделитель правил столбцов накладывается на мою фигуру, несмотря на то, что я изменил размер правила на 0 в этой среде.

введите описание изображения здесь

Итак, более общий вопрос: как я могу поделиться одной графикой для 2 столбцов с их собственным заголовком в среде float с помощью paracol? Или как конкретный вопрос (если мое решение сохранено), как удалить локально \columnsepruleв среде paracol?

Вот MWE:

\documentclass{article} 
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}

  \usepackage{graphicx,float}
  \usepackage{paracol}
     \setlength{\columnseprule}{0.4pt}
     \setlength{\columnsep}{2em}

     \makeatletter
     \newenvironment{singleCol}{% at begining of the env
        \setlength{\columnseprule}{0.0pt}
        \vskip\intextsep
        \noindent\minipage{\textwidth}
     }% body goes here
     {% at the end of the env
        \endminipage\hskip-\textwidth
     }% 
     \makeatother
  
\begin{document} 

\begin{paracol}{2}
  \begin{leftcolumn}
     For several days in succession fragments of a defeated army had passed through the town. 
     
     They were mere disorganized bands, not disciplined forces. 
     The men wore long, dirty beards and tattered uniforms; they advanced in listless fashion, without a flag, without a leader.
     All seemed exhausted, worn out, incapable of thought or resolve, marching onward merely by force of habit, and dropping to the ground with fatigue the moment they halted.
  \end{leftcolumn}
  \begin{rightcolumn}
     Pendant plusieurs jours de suite des lambeaux d'armée en déroute avaient traversé la ville. 

     Ce n'était point de la troupe, mais des hordes débandées. 
     Les hommes avaient la barbe longue et sale, des uniformes en guenilles, et ils avançaient d'une allure molle, 
     sans drapeau, sans régiment. Tous semblaient accablés, éreintés, incapables d'une pensée ou d'une résolution,   marchant seulement par habitude, et tombant de fatigue sitôt qu'ils s'arrêtaient. 
  \end{rightcolumn}

  \begin{figure*}
     \centering
     \includegraphics[width=0.5\textwidth]{example-image}
     \caption{caption of figure1}
  \end{figure*}

  \begin{leftcolumn}
     One saw, in particular, many enlisted men, pea\-ceful citizens, men who lived quietly on their income, bending beneath the weight of their rifles; and little active volunteers,   easily frightened but full of enthusiasm, as eager to attack as they were ready to take to flight; and amid these, a sprinkling of red-breeched soldiers,       the pitiful remnant of a division cut down in a great battle; somber artillerymen, side by side with nondescript foot-soldiers; and, here and there, the gleaming helmet of a heavy-footed dragoon who had difficulty in keeping up with the quicker pace of the soldiers of the line.
  \end{leftcolumn}
  \begin{rightcolumn}
     On voyait surtout des mobilisés, gens pacifiques, rentiers tranquilles, pliant sous le poids du fusil; des petits moblots alertes, faciles à l'épouvante et prom\-pts à l'enthousiasme, prêts à l'attaque comme à la fuite; puis, au milieu d'eux, quelques culottes rouges, débris d'une division moulue dans une gran\-de bataille; des artilleurs sombres alignés avec des fantassins divers; et, parfois, le casque brillant d'un dragon au pied pesant qui suivait avec peine la marche plus légère des lignards.
  \end{rightcolumn}

  \begin{leftcolumn*}
     Legions of irregulars with high---sounding na\-mes ``Avengers of Defeat'', ``Citizens of the Tomb'', ``Breth\-ren in Death''---passed in their turn, looking like banditti. 
  \end{leftcolumn*}
  \begin{rightcolumn}
     Des légions de francs---tireurs aux appellations héroïques : « les Vengeurs de la Défaite, les Citoyens de la Tombe,
     les Partageurs de la Mort » --- passaient à leur tour, avec des airs de bandits.
  \end{rightcolumn}


  \begin{leftcolumn}
     \begin{figure}[b]
        \begin{singleCol}
           \centering
           \includegraphics[width=0.5\textwidth]{example-image}
        \end{singleCol}
        \caption{caption of figure3}
     \end{figure}%
  \end{leftcolumn}
  \begin{rightcolumn}
     \begin{figure}[b]
        \phantom{\includegraphics[width=0.5\textwidth]{example-image}}
        \caption{caption de la figure3}
     \end{figure}%
  \end{rightcolumn}


  \begin{leftcolumn*}
     Their leaders, former drapers or grain merchants, or tallow or soap chandlers---warriors by force of circumstances, officers by reason of their mustachios or their money---covered with weapons, flannel and gold lace, spoke in an impressive manner,
     discussed plans of campaign,and behaved as though they alone bore the fortunes of dying France on their braggart shoulders; 
     though, in truth, they frequently were afraid of their own men---scoundrels often brave beyond measure, but pillagers and debauchees.
  \end{leftcolumn*}
  \begin{rightcolumn}
     Leurs chefs, anciens commerçants en draps ou en graines, ex--marchands de suif ou de savon, guerriers de circonstance, 
     nommés officiers pour leurs écus ou la longueur de leurs moustaches, couverts d'armes, de flanelle et de galons, 
     parlaient d'une voix retentissante, discutaient plans de campagne, et prétendaient soutenir seuls la France agonisante sur leurs épaules de fanfarons;
     mais ils redoutaient parfois leurs propres soldats, gens de sac et de corde, souvent braves à outrance, pillards et débauchés.
  \end{rightcolumn}
  
  \begin{table*}
     \centering
     table1
     \caption{à table}
  \end{table*}

\end{paracol}
\end{document}
%EoF

решение1

Я предполагаю, что вы хотите разместить подпись на английском языке слева и на французском языке справа, обе с одинаковым номером рисунка.

Здесь была определена новая команда, имитирующая поведение \caption, что позволяет вам иметь обе подписи под одним рисунком и создавать соответствующий список рисунков.

\DoubleCaptionFig{<left caption>}{<right caption>}{<figure name>}{<label>}

а б с

% !TeX TS-program = pdflatex

\documentclass{article} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{graphicx}
\usepackage{paracol}
\setlength{\columnseprule}{0.4pt}
\setlength{\columnsep}{2em}

\newcommand{\DoubleCaptionFig}[4]{% added <<<<<<<<<<<<<<<<<<<<< https://tex.stackexchange.com/a/211767/161015
\end{paracol}
    \begin{figure*}
        \refstepcounter{figure}\label{#4}%
        \noindent%
        \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces (eng) #1}}%
        \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces (fr) #2}}%
        \centering%
        \includegraphics{#3}% 
                
        \medskip%
        Fig.\ \thefigure{\enspace  #1}\hfil \hspace*{0.5\columnsep} Fig.\ \thefigure{\enspace  #2}%
    \end{figure*}
    \begin{paracol}{2}\sloppy%
    }

\begin{document} 
    
        \listoffigures
        \newpage
    
    \begin{paracol}{2}
        \sloppy
        \begin{leftcolumn}
            For several days in succession fragments of a defeated army had passed through the town (see figure \ref{fig:a}). 
            
            They were mere disorganized bands, not disciplined forces. 
            The men wore long, dirty beards and tattered uniforms; they advanced in listless fashion, without a flag, without a leader.
            All seemed exhausted, worn out, incapable of thought or resolve, marching onward merely by force of habit, and dropping to the ground with fatigue the moment they halted.
        \end{leftcolumn}
        \begin{rightcolumn}
            Pendant plusieurs jours de suite des lambeaux d'armée en déroute avaient traversé la ville (voir figure \ref{fig:a}).
            
            Ce n'était point de la troupe, mais des hordes débandées. 
            Les hommes avaient la barbe longue et sale, des uniformes en guenilles, et ils avançaient d'une allure molle, 
            sans drapeau, sans régiment. Tous semblaient accablés, éreintés, incapables d'une pensée ou d'une résolution,   marchant seulement par habitude, et tombant de fatigue sitôt qu'ils s'arrêtaient. 
        \end{rightcolumn}
    
    \DoubleCaptionFig{A defeated army}{Une armée vaincue}{example-image-a}{fig:a}

        \begin{leftcolumn}
            One saw, in particular, many enlisted men, pea\-ceful citizens, men who lived quietly on their income, bending beneath the weight of their rifles; and little active volunteers,   easily frightened but full of enthusiasm, as eager to attack as they were ready to take to flight; and amid these, a sprinkling of red-breeched soldiers,       the pitiful remnant of a division cut down in a great battle; somber artillerymen, side by side with nondescript foot-soldiers; and, here and there, the gleaming helmet of a heavy-footed dragoon who had difficulty in keeping up with the quicker pace of the soldiers of the line.
        \end{leftcolumn}
        \begin{rightcolumn}
            On voyait surtout des mobilisés, gens pacifiques, rentiers tranquilles, pliant sous le poids du fusil; des petits moblots alertes, faciles à l'épouvante et prom\-pts à l'enthousiasme, prêts à l'attaque comme à la fuite; puis, au milieu d'eux, quelques culottes rouges, débris d'une division moulue dans une gran\-de bataille; des artilleurs sombres alignés avec des fantassins divers; et, parfois, le casque brillant d'un dragon au pied pesant qui suivait avec peine la marche plus légère des lignards.
        \end{rightcolumn}
        
        \begin{leftcolumn*}
            Legions of irregulars (see figure \ref{fig:b}) with high---sounding na\-mes ``Avengers of Defeat'', ``Citizens of the Tomb'', ``Bre\-thren in Death''---passed in their turn, looking like banditti. 
        \end{leftcolumn*}
        \begin{rightcolumn}
            Des légions de francs---tireurs aux appellations héroïques : « les Vengeurs de la Défaite, les Citoyens de la Tombe,    les Partageurs de la Mort » --- passaient à leur tour, avec des airs de bandits (voir figure \ref{fig:b}).
        \end{rightcolumn}

        \DoubleCaptionFig{Legions of irregulars}{Des légions d'irréguliers}{example-image-b}{fig:b}

        \begin{leftcolumn}
            Their leaders, former drapers or grain merchants, or tallow or soap chan\-dlers---warriors by force of circumstan\-ces, officers by reason of their mustachios or their money---covered with weapons, flannel and gold lace, spoke in an impressive manner,
            discussed plans of campaign,and behaved as though they alone bore the fortunes of dying France on their braggart shoulders; 
            though, in truth, they frequently were afraid of their own men---scoundrels often brave beyond measure, but pillagers and debauchees.
        \end{leftcolumn}
        \begin{rightcolumn}
            Leurs chefs, anciens commerçants en draps ou en graines, ex--marchands de suif ou de savon, guerriers de circonstance, 
            nommés officiers pour leurs écus ou la longueur de leurs moustaches, couverts d'armes, de flanelle et de galons, 
            parlaient d'une voix retentissante, discutaient plans de campagne, et prétendaient soutenir seuls la France agonisante sur leurs épaules de fanfarons;
            mais ils redoutaient parfois leurs propres soldats, gens de sac et de corde, souvent braves à outrance, pillards et débauchés.
        \end{rightcolumn}
        
        \begin{table*}
            \centering
            table1
            \caption{à table}
        \end{table*}
        
    \end{paracol}
\end{document}

Если вы хотите иметь плавающие цифры, удалите \end{paracol}и \begin{paracol}{2}\sloppyиз \DoubleCaptionFigопределения.

решение2

Paracol поддерживает добавление вставок полной ширины между изменениями столбцов с использованием необязательных аргументов для leftcolumn* и rightcolumn*. Однако float ведут себя там странно. Кроме того, вы не можете вкладывать необязательные аргументы (см.] внутри необязательного аргумента).

Здесь используется опция [H] из пакета float. Обратите внимание на использование [{ ... }]для разрешения необязательных аргументов внутри. Преимущество этого подхода в том, что все находится на одном рисунке и не может быть разделено. Между левой и правой подписями нет разделительной линии, хотя ее всегда можно добавить.

\documentclass{article} 
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}

  \usepackage{graphicx,float}
  \usepackage{paracol}
     \setlength{\columnseprule}{0.4pt}
     \setlength{\columnsep}{2em}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\globalcounter{figure}
\globalcounter{table}
\usepackage{float}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
\begin{document} 

\begin{paracol}{2}
  \sloppy
  \begin{leftcolumn}
     For several days in succession fragments of a defeated army had passed through the town. 
     
     They were mere disorganized bands, not disciplined forces. 
     The men wore long, dirty beards and tattered uniforms; they advanced in listless fashion, without a flag, without a leader.
     All seemed exhausted, worn out, incapable of thought or resolve, marching onward merely by force of habit, and dropping to the ground with fatigue the moment they halted.
  \end{leftcolumn}
  \begin{rightcolumn}
     Pendant plusieurs jours de suite des lambeaux d'armée en déroute avaient traversé la ville. 

     Ce n'était point de la troupe, mais des hordes débandées. 
     Les hommes avaient la barbe longue et sale, des uniformes en guenilles, et ils avançaient d'une allure molle, 
     sans drapeau, sans régiment. Tous semblaient accablés, éreintés, incapables d'une pensée ou d'une résolution,   marchant seulement par habitude, et tombant de fatigue sitôt qu'ils s'arrêtaient. 
  \end{rightcolumn}
 
\begin{leftcolumn*}[{
  \begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{example-image}
    \setlength{\columnwidth}{\dimexpr 0.5\textwidth-0.5\columnsep}%
    \begin{minipage}[t]{\columnwidth}
      \caption{left caption}
      \addtocounter{figure}{-1}% repeat
    \end{minipage}\hfill%\rule[-2ex]{0.4pt}{\baselineskip}\hfill
    \begin{minipage}[t]{\columnwidth}
      \caption{right caption}
    \end{minipage}
  \end{figure}
}]
     One saw, in particular, many enlisted men, pea\-ceful citizens, men who lived quietly on their income, bending beneath the weight of their rifles; and little active volunteers,   easily frightened but full of enthusiasm, as eager to attack as they were ready to take to flight; and amid these, a sprinkling of red-breeched soldiers,       the pitiful remnant of a division cut down in a great battle; somber artillerymen, side by side with nondescript foot-soldiers; and, here and there, the gleaming helmet of a heavy-footed dragoon who had difficulty in keeping up with the quicker pace of the soldiers of the line.
  \end{leftcolumn*}
  \begin{rightcolumn}
     On voyait surtout des mobilisés, gens pacifiques, rentiers tranquilles, pliant sous le poids du fusil; des petits moblots alertes, faciles à l'épouvante et prom\-pts à l'enthousiasme, prêts à l'attaque comme à la fuite; puis, au milieu d'eux, quelques culottes rouges, débris d'une division moulue dans une gran\-de bataille; des artilleurs sombres alignés avec des fantassins divers; et, parfois, le casque brillant d'un dragon au pied pesant qui suivait avec peine la marche plus légère des lignards.
  \end{rightcolumn}

\end{paracol}
\end{document}

Здесь используются обычные левый и правый столбцы \caption(без глобальных счетчиков).

\documentclass{article} 
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}

  \usepackage{graphicx,float}
  \usepackage{paracol}
     \setlength{\columnseprule}{0.4pt}
     \setlength{\columnsep}{2em}
 
\begin{document} 

\begin{paracol}{2}
  \sloppy
  \begin{leftcolumn}
     For several days in succession fragments of a defeated army had passed through the town. 
     
     They were mere disorganized bands, not disciplined forces. 
     The men wore long, dirty beards and tattered uniforms; they advanced in listless fashion, without a flag, without a leader.
     All seemed exhausted, worn out, incapable of thought or resolve, marching onward merely by force of habit, and dropping to the ground with fatigue the moment they halted.
  \end{leftcolumn}
  \begin{rightcolumn}
     Pendant plusieurs jours de suite des lambeaux d'armée en déroute avaient traversé la ville. 

     Ce n'était point de la troupe, mais des hordes débandées. 
     Les hommes avaient la barbe longue et sale, des uniformes en guenilles, et ils avançaient d'une allure molle, 
     sans drapeau, sans régiment. Tous semblaient accablés, éreintés, incapables d'une pensée ou d'une résolution,   marchant seulement par habitude, et tombant de fatigue sitôt qu'ils s'arrêtaient. 
  \end{rightcolumn}
 
\begin{leftcolumn*}[{\centering% or \noindent
    \vskip\intextsep
    \includegraphics[width=\linewidth]{example-image}
    \vskip\intextsep% put a gap before the \colseprule starts
}]
  \begin{figure}[h]
    \vskip-2\intextsep% remove excess space
    \caption{left caption}
  \end{figure}
\end{leftcolumn*}
\begin{rightcolumn}
  \begin{figure}[h]
    \vskip-2\intextsep
    \caption{right caption}
  \end{figure}
\end{rightcolumn}

\begin{leftcolumn*}
     One saw, in particular, many enlisted men, pea\-ceful citizens, men who lived quietly on their income, bending beneath the weight of their rifles; and little active volunteers,   easily frightened but full of enthusiasm, as eager to attack as they were ready to take to flight; and amid these, a sprinkling of red-breeched soldiers,       the pitiful remnant of a division cut down in a great battle; somber artillerymen, side by side with nondescript foot-soldiers; and, here and there, the gleaming helmet of a heavy-footed dragoon who had difficulty in keeping up with the quicker pace of the soldiers of the line.
  \end{leftcolumn*}
  \begin{rightcolumn}
     On voyait surtout des mobilisés, gens pacifiques, rentiers tranquilles, pliant sous le poids du fusil; des petits moblots alertes, faciles à l'épouvante et prom\-pts à l'enthousiasme, prêts à l'attaque comme à la fuite; puis, au milieu d'eux, quelques culottes rouges, débris d'une division moulue dans une gran\-de bataille; des artilleurs sombres alignés avec des fantassins divers; et, parfois, le casque brillant d'un dragon au pied pesant qui suivait avec peine la marche plus légère des lignards.
  \end{rightcolumn}

\end{paracol}
\end{document}

Связанный контент