分頁時兩欄面對面

分頁時兩欄面對面

我想為翻譯後的文字發出命令。我的願望是有兩欄面對面:原文在左邊,譯文在右邊,後面是有關文本的訊息。

我製作了兩種命令,它們運行得很好,除非文字太長,或者文字中有分頁符號:

  • \kt正在使用多列包,帶有分頁符號我在第一頁的兩列上都有原文,翻譯從第二頁開始,所以它們不在彼此前面。

  • \ktt使用表格環境,但為了避免表中分頁,它將進一步移動翻譯後的文本,並且不尊重我想要寫入的順序(即使使用 [h!])。例如,在我的 MWE 中:我寫過

    1. 一個普通的段落,
    2. 翻譯後的文本,
    3. 一個粗體的段落,

但文件顯示順序 1,3,2(正常,粗體,翻譯)有一個大空白。

\documentclass[12pt,a4paper,final]{report}

\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[babel=true]{csquotes}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{relsize}

\newcommand{\kt}[5]{\begin{quote} \begin{singlespace} \begin{multicols}{2}
\smaller \og {\itshape  #4} \fg \vfill \columnbreak #5
\begin{flushright} #2, p. #1, trad. #3 \end{flushright} % normally I have \cite[#1]{#2}
\end{multicols} \end{singlespace} \end{quote}}

\newcommand{\ktt}[5]{%
\begin{table}[h!]
\centering
\begin{singlespace}
\begin{tabular}{p{0.43\textwidth}p{0.43\textwidth}}
\smaller \enquote{{\itshape #4}} (#2, p. #1) & \smaller #5 (#3)\\  % normally I have \cite[#1]{#2}
\end{tabular}
\end{singlespace}
\end{table}}

\begin{document}
\lipsum[1-3]
\kt{PAGE}{BOOK}{TRANSLATOR}{\lipsum[1-2]}{\lipsum[1-2]}

\pagebreak
\lipsum[1]
\ktt{PAGE}{BOOK}{TRANSLATOR}{\lipsum[1-2]}{\lipsum[1-2]}
\textbf{\lipsum[2]}

\end{document}

我認為有兩種可能的解決方案:

  • 使用多列命令,強制第二列在第一列前面開始,即使有分頁符
  • 對於表格環境,允許分頁並強制其遵循順序的東西。

我嘗試過使用長桌包,其中代碼為\ktt,但它並沒有改變任何東西,也許我沒有很好地使用它:

\newcommand{\ktt}[5]{%
\begin{table}[h!]
\centering
\begin{singlespace}
\begin{longtable}{p{0.43\textwidth}p{0.43\textwidth}}
\smaller \enquote{{\itshape #4}} (#2, p. #1) & \smaller #5 (#3)\\  % normally I have \cite[#1]{#2}
\end{longtable}
\end{singlespace}
\end{table}}

如果有人可以提供幫助,謝謝。

兩個小字:

  • \lipsum給了我一個括號問題,但我沒有用普通文字代替它,所以它與這裡無關。

  • 我修改了命令以避免\引用對於 #1 和 #2,這樣我就不必在 MWE 中添加一些參考書目。

編輯 :

謝謝阿拉什和圖哈米。我嘗試了不同的軟體包,最後使用了帕拉科爾。由於兩列被插入“引用”環境中,我需要使用負值\setlength{\columnsep}{...},嘗試根據我的需要進行調整。

但我現在有新問題:印了兩列在下面腳註。

註腳下各欄的 MWE

\documentclass[12pt,a4paper,final]{report}

\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[babel=true]{csquotes}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{relsize}
\usepackage{paracol}

\newcommand{\kt}[5]{
\begin{quote}
\setlength{\columnsep}{-.12\textwidth}
\begin{paracol}{2}
\begin{singlespace}
\sloppy \smaller \og {\itshape  #4} \fg (#2, p. #1) \switchcolumn #5 (#3) % normally I have \cite[#1]{#2}
\end{singlespace}
\end{paracol}
\end{quote}
}

\begin{document}
\lipsum[1-3]\footnote{foo}
\kt{PAGE}{BOOK}{TRANSLATOR}{\lipsum[1]}{\lipsum[1]}
\end{document}

我在那裡看到了問題:使用 paracol 套件的腳註問題。我已經在他的答案中貼上了大衛-卡萊爾給出的代碼,即使我真的不理解它,現在腳註已經消失了在相關頁面上。

消失腳註的 MWE :

\documentclass[12pt,a4paper,titlepage,final]{report}

\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[babel=true]{csquotes}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{relsize}
\usepackage{paracol}

\makeatletter
\newbox\mybox
\def\pcol@makenormalcol{%
  \ifvoid\footins 
  \else
\global\setbox\mybox\box\footins
   \fi
\setbox\@outputbox\box\@holdpg
  \let\@elt\relax
  \xdef\@freelist{\@freelist\@midlist}%
  \global\let\@midlist\@empty
  \@combinefloats}

\makeatother

\newcommand{\kt}[5]{
\begin{quote}
%\setcolumnwidth{.1\textwidth,.1\textwidth}[1,2]
\setlength{\columnsep}{-.12\textwidth}
\begin{paracol}{2}
\begin{singlespace}
\sloppy \smaller \og {\itshape  #4} \fg (#2, p. #1) \switchcolumn #5 (#3)
%\begin{flushright}trad. #3 \end{flushright} % normally I have \cite[#1]{#2}
\end{singlespace}
\end{paracol}
\end{quote}
}

\begin{document}
\lipsum[1-3]\footnote{foo}
\kt{PAGE}{BOOK}{TRANSLATOR}{\lipsum[1]}{\lipsum[1]}
\end{document}

第二次編輯:

它似乎與 touhami 的建議一起使用:

\footnotelayout{m}

我不太明白這個命令是如何運作的,我認為它只適用於腳註裡面翻譯後的文本,但事實上,它解決了我的問題,即使腳註是外部我的\kt 環境。

謝謝 !

答案1

multicol並且longtable不是為此類用途而設計的,並且table環境不允許分頁。

paracol這是一個帶有包的解決方案

\documentclass[12pt,a4paper,final]{report}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{relsize}

\usepackage{paracol,lipsum}

\usepackage[frenchb]{babel}



%\columnratio{.5}
%\columnsep =10pt
\newcommand{\kt}[5]{%
\sloppy
\begin{paracol}{2}
\smaller \og {\itshape  #4} \fg    %  becarful here as \lipsum end with \par
\switchcolumn
#5
\end{paracol}
\begin{flushright} #2, p. #1, trad. #3 \end{flushright}}

\begin{document}
\lipsum[1-3]
\kt{PAGE}{BOOK}{TRANSLATOR}{\lipsum[1-2]}{\lipsum[1-2]}


\end{document}

相關內容