使用 paracol 时出现不需要的空白行(两列中!)

使用 paracol 时出现不需要的空白行(两列中!)

问题:毫无明显原因,我的文档中看似随机的位置出现了不需要的空白行。

背景:我正在使用文档类创建一本从各种语言翻译而来的短篇小说集book。我需要使用,xelatex这样我就可以直接输入外语字符。我想要面对面的翻译,所以我使用环境paracolpolyglossia确保外语的连字符正确。

我用\switchcolumn命令来同步所有段落,当一个段落比其翻译长或短时,这偶尔会导致一列或另一列中出现空行(正常行为!)。 但是,我偶尔会发现在同步段落分隔符处跨越两列的不需要的空白行。

这实际上很少发生(在 90 页的文档中可能只有 15 个例子),但对于看起来专业的文档来说,这是完全不可接受的。它似乎发生在随机位置;进行影响文本流的小更改(例如,列间分隔、边距、添加脚注等)会神秘地删除大多数不需要的空白行,但在文本的其他地方创建新的空白行!

我不确定罪魁祸首到底是什么paracol(虽然可能是?)或者可能是polyglossia和之间的某种相互作用paracol(我必须将外语文本括在标签中以确保连字符正确)。但是,这似乎不太可能,因为的整个目的paracol是针对翻译进行排版,所以我认为很多人都成功地将和一起使用了paracolpolyglossia我觉得一定有一些默认的胶水或一些不良标志需要调整以防止这种情况发生,但我不够专业,不知道它是什么……有没有paracol用户见过这种情况并知道如何修复它?

我在下面附上了一张(带注释的)图片,以及一个最小代码示例。我无法删除自定义字体或其他细节(如边距),因为这会改变文本的流向并删除我试图演示的伪像(更改字体大小等也会产生同样的效果)。但是,像这样处理小细节并不是真正的解决方案,因为它只会在我(目前)90 页的文档的其他地方产生其他空白行。

% !TEX TS-program = xelatex
% !TEX encoding = UTF-8
% this allows us to use real characters like æ instead of macros like \ae

%% PREAMBLE
\documentclass[letterpaper,titlepage,twoside,openany,12pt]{book}

%provide standard TeX shortcuts
\usepackage{xunicode}
%extra customizations for XeLateX
\usepackage{xltxtra}

%easier methods for loading fonts and specifying font features
\usepackage{fontspec}
%Use Junicode for access to runes and other nice medieval features
\setmainfont[Language=Icelandic, Fractions=On]{Junicode}

%replaces babel - extra language support 
%I use this primarily to get proper hyphenation in the other languages
\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\setotherlanguages{icelandic,danish,norsk}

%Customize some margions and other lengths
\usepackage{geometry}
%Although shifted even/odd margins look nice for two sided
%printing, it's distracting when viewing the PDF.
\geometry{outer=1.1in,inner=1.1in}
\geometry{bindingoffset=0cm,hratio=1:1}
%the default bottom margin is huge, make it a bit smaller
\addtolength{\textheight}{0.75in}

%setup the parallel columns
\usepackage{paracol} %this seems a little easier to use?
\footnotelayout{p} %full page footnotes
\setlength{\columnsep}{30 pt} %larger space between the columns

%try to prevent overfull hbox from sticking words out into the margin
%pretolerance relates to avoiding hyphenation and is used first 
%Note, -1 = ignore first step and use hyphenation
\pretolerance=100        %default=100
%after hyphenating, tolerance is used
%hbadness sets the threshold for seeing underfull errors
\tolerance=400        %default=200
\hbadness=399        %best set at tolerance-1
%if that still fails, emergency stretch is used
\setlength{\emergencystretch}{0.5em}    %default=0
%if all of this fails, we get words sticking out into the margin (overfull hbox)

\begin{document}
    \mainmatter

    \chapter[A Sleigh Ride]{A Sleigh Ride --- En Slædefart}
    \begin{paracol}{2}

    \switchcolumn[0]*
    \noindent
        Once upon a time, in a kingdom far far away (so far away that no one knows
        its name) there was a king who had an only child, a daughter.  She was so
        sullen and gloomy that no one had ever seen her laugh.  She was a grown
        woman, very pretty and kind, but always sad and never happy --- either she
        cried or she sulked.  It was impossible to make her smile.

    \switchcolumn
    \begin{danish}
    \noindent
        Der var engang en Konge i et Land langt langt borte, som der er ingen, der
        ved Navn paa; han havde kun en eneste Datter.  Hun var saa sum og saa sur,
        at der var aldrig nogen, der havde set hende le.  Hun var nu en voksen Pige
        og en køn Pige og en rar Pige, men altid var hun sorrigfuld og aldrig glad;
        enten græd hun eller ogsaa surmulede hun.  Det var ikke til at slaa et Smil
        af hende med en Vognkæp.
    \end{danish}

    \switchcolumn*
        The king was generally a cheerful man and very capable, but this problem
        with his daughter weighed on his heart until he became cross and
        ill-content.  She was his only child and she was supposed to inherit the
        kingdom after him.  But all she did was cry and sulk until he was afraid
        that she would die before him.

    \switchcolumn
    \begin{danish}
        Kongen var ellers en glad Mand og en meget dygtig Konge; men dette med
        Datteren gik ham svært til Hjærte, saa han blev helt gnaven og ilde
        tilfreds.  Han havde jo kun det samme Barn, og hun skulde arve Riget efter
        ham; men nu gik hun der og græd og mulede, saa han var bange for, hun
        skulde gaa hen og dø før ham.
    \end{danish}

    \switchcolumn*
        So the king sent out a proclamation, that whoever could make his daughter 
        laugh would receive her hand in marriage and become the king after he died.
        There were many who came and made the attempt, but not a single one of them
        could get so much as a smile out of her.  They simply made fools of
        themselves twice: first, when they tried to make the princess laugh, and
        then, when they rode home again in failure.

    \switchcolumn
    \begin{danish}
        Saa lod Kongen udgaa den Befaling, at hvem der kunde faa hans Datter til at
        le, han skulde faa hende til Kone og være Konge i Landet efter ham.  Og der
        var mange, som kom og prøvede paa det; men der var aldrig nogen, der kunde
        lokke saa meget som et Smil af hende.  De gjorde sig saa til Nar to Gange:
        først for at faa hende til at le, og siden, naar de maatte rejse hjem igen
        med en lang Næse.
    \end{danish}

    \end{paracol}
\end{document}

第二段下方多出一行空白

答案1

第一个空格是因为英语段落比对应的丹麦语段落短。第二个空格是因为在 TeX 看来,以“før ham.”结尾的丹麦语段落比对应的丹麦语段落长一行,因为 和 之间的空格før ham.没有\end{danish}被删除。

可以通过添加\looseness=1到第一个英文段落来删除第一个空白行(但这不能保证有效)。

不要danish使用 ,而要使用danishpar我建议的定义。

请注意,您既不应该加载xunicode(它已经在fontspec正确的时间加载)也不xltxtra应该添加任何有用的内容。我不确定 的值\tolerance,也不确定 的设置\textwidthgeometry用于与分页相关的所有内容。

% !TEX TS-program = xelatex
% !TEX encoding = UTF-8
% this allows us to use real characters like æ instead of macros like \ae

%% PREAMBLE
\documentclass[letterpaper,titlepage,twoside,openany,12pt]{book}

%easier methods for loading fonts and specifying font features
\usepackage{fontspec}
%Use Junicode for access to runes and other nice medieval features
\setmainfont[Language=Icelandic, Fractions=On]{Junicode}

%replaces babel - extra language support 
%I use this primarily to get proper hyphenation in the other languages
\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\setotherlanguages{icelandic,danish,norsk}

%Customize some margions and other lengths
\usepackage{geometry}
%Although shifted even/odd margins look nice for two sided
%printing, it's distracting when viewing the PDF.
\geometry{outer=1.1in,inner=1.1in}
\geometry{bindingoffset=0cm,hratio=1:1}
%the default bottom margin is huge, make it a bit smaller
\addtolength{\textheight}{0.75in}

%setup the parallel columns
\usepackage{paracol} %this seems a little easier to use?
\footnotelayout{p} %full page footnotes
\setlength{\columnsep}{30 pt} %larger space between the columns

%try to prevent overfull hbox from sticking words out into the margin
%pretolerance relates to avoiding hyphenation and is used first 
%Note, -1 = ignore first step and use hyphenation
\pretolerance=100        %default=100
%after hyphenating, tolerance is used
%hbadness sets the threshold for seeing underfull errors
\tolerance=400        %default=200
\hbadness=399        %best set at tolerance-1
%if that still fails, emergency stretch is used
\setlength{\emergencystretch}{0.5em}    %default=0
%if all of this fails, we get words sticking out into the margin (overfull hbox)

\newenvironment{danishpar}
 {\par\danish}
 {\par\enddanish}


\begin{document}

    \mainmatter

    \chapter[A Sleigh Ride]{A Sleigh Ride --- En Slædefart}
    \begin{paracol}{2}

    \switchcolumn[0]*
    \noindent\looseness=1
        Once upon a time, in a kingdom far far away (so far away that no one knows
        its name) there was a king who had an only child, a daughter.  She was so
        sullen and gloomy that no one had ever seen her laugh.  She was a grown
        woman, very pretty and kind, but always sad and never happy --- either she
        cried or she sulked.  It was impossible to make her smile.

    \switchcolumn
    \begin{danishpar}
    \noindent
        Der var engang en Konge i et Land langt langt borte, som der er ingen, der
        ved Navn paa; han havde kun en eneste Datter.  Hun var saa sum og saa sur,
        at der var aldrig nogen, der havde set hende le.  Hun var nu en voksen Pige
        og en køn Pige og en rar Pige, men altid var hun sorrigfuld og aldrig glad;
        enten græd hun eller ogsaa surmulede hun.  Det var ikke til at slaa et Smil
        af hende med en Vognkæp.
    \end{danishpar}

    \switchcolumn*
        The king was generally a cheerful man and very capable, but this problem
        with his daughter weighed on his heart until he became cross and
        ill-content.  She was his only child and she was supposed to inherit the
        kingdom after him.  But all she did was cry and sulk until he was afraid
        that she would die before him.

    \switchcolumn
    \begin{danishpar}
        Kongen var ellers en glad Mand og en meget dygtig Konge; men dette med
        Datteren gik ham svært til Hjærte, saa han blev helt gnaven og ilde
        tilfreds.  Han havde jo kun det samme Barn, og hun skulde arve Riget efter
        ham; men nu gik hun der og græd og mulede, saa han var bange for, hun
        skulde gaa hen og dø før ham.
    \end{danishpar}

    \switchcolumn*
        So the king sent out a proclamation, that whoever could make his daughter 
        laugh would receive her hand in marriage and become the king after he died.
        There were many who came and made the attempt, but not a single one of them
        could get so much as a smile out of her.  They simply made fools of
        themselves twice: first, when they tried to make the princess laugh, and
        then, when they rode home again in failure.

    \switchcolumn
    \begin{danishpar}
        Saa lod Kongen udgaa den Befaling, at hvem der kunde faa hans Datter til at
        le, han skulde faa hende til Kone og være Konge i Landet efter ham.  Og der
        var mange, som kom og prøvede paa det; men der var aldrig nogen, der kunde
        lokke saa meget som et Smil af hende.  De gjorde sig saa til Nar to Gange:
        først for at faa hende til at le, og siden, naar de maatte rejse hjem igen
        med en lang Næse.
    \end{danishpar}

    \end{paracol}
\end{document}

在此处输入图片描述

您可以看到,最后一个丹麦语段落比相应的英语段落短,您可能还想\looseness=1为其添加。然而,在这两种情况下,结果都是一行未满(badness 463)。

相关内容