线性光泽可用于布局文档的翻译。
http://en.wikipedia.org/wiki/Interlinear_gloss
通常这是逐字逐句或按语素进行的。但是,我想以不同的方式做到这一点,一次翻译整个段落。以下链接和图像是我想要完成的示例,但我想为更大的不同文本执行此操作。
http://www.optimnem.co.uk/learning/spanish/three-little-pigs.php
目前,我并不想考虑改变语言之间顺序的单词或短语的顺序。也就是说,我不介意段落中的单词是否不对齐,或者一段的长度是否比另一段长得多,导致一条悬垂的线。
据我所知,以下套餐无法满足我的需求:
covingtn.sty
cgloss4e.sty
gb4e.sty
lingmacros.sty - shortex
这是英文版:
In the heart of the forest lived three little pigs who were brothers. The wolf always was chasing them in order to eat them. In order to escape the wolf, the pigs decided to make a house each. The smallest made his from straw, to finish first and go out to play. The middle one constructed a cottage from wood. Seeing that his little brother had finished already, he hurried to go and play with him. The oldest worked on his house of brick. 'You'll soon see what the wolf does with your houses,' he scolded his brothers but they were having a great time.
这是西班牙语版本:
En el corazón del bosque vivían tres cerditos que eran hermanos. El lobo siempre andaba persiguiéndoles para comérselos. Para escapar del lobo, los cerditos decidieron hacerse una casa. El pequeño la hizo de paja, para acabar antes y poder irse a jugar. El mediano construyó una casita de madera. Al ver que su hermano perqueño había terminado ya, se dio prisa para irse a jugar con él. El mayor trabajaba en su casa de ladrillo. - Ya veréis lo que hace el lobo con vuestras casas - riñó a sus hermanos mientras éstos se lo pasaban en grande.
我不想要手动执行此操作:
\documentclass{article}
\usepackage[margin=1in, paperwidth=8.5in, paperheight=11in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{url}
\begin{document}
\noindent
\url{http://www.optimnem.co.uk/learning/spanish/three-little-pigs.php}\\
\\
\indent
En el corazón del bosque vivían tres cerditos que eran hermanos. El lobo siempre\\
\indent
In the heart of the forest lived three little pigs who were brothers. The wolf always\\
\\
%
andaba persiguiéndoles para comérselos. Para escapar del lobo, los cerditos decidieron\\
was chasing them in order to eat them. In order to escape the wolf, the pigs decided to\\
\\
%
hacerse una casa. El pequeño la hizo de paja, para acabar antes y poder irse a jugar.\\
make a house each. The smallest made his from straw, to finish first and go out to play.\\
\\
%
El mediano construyó una casita de madera. Al ver que su hermano perqueño había\\
The middle one constructed a cottage from wood. Seeing that his little brother had\\
\\
%
terminado ya, se dio prisa para irse a jugar con él. El mayor trabajaba en su casa de\\
finished already, he hurried to go and play with him. The oldest worked on his house of\\
\\
%
ladrillo. - Ya veréis lo que hace el lobo con vuestras casas - riñó a sus hermanos\\
brick. 'You'll soon see what the wolf does with your houses,' he scolded his brothers\\
\\
%
mientras éstos se lo pasaban en grande.\\
but they were having a great time.\\
\\
\end{document}\\
我想使用一个包或一个宏来自动地将英文和西班牙文本穿插在换行符中,每行都有一行。如何以更自动化的方式在Latex中布置这个简单的双线双线段落(不需要手动添加换行符)?
答案 0 :(得分:4)
以下黑客攻击可以帮助您实现目标。它基于零高度小型化的想法,重叠两个三个空间小型设备。
我将使用英语和西班牙语文本的占位符(分别为\english
和\spanish
)。另外,请务必添加setspace
包:
\usepackage{setspace}
\def\english{In the heart of the forest lived three little pigs who were brothers. The wolf always was chasing them in order to eat them. In order to escape the wolf, the pigs decided to make a house each. The smallest made his from straw, to finish first and go out to play. The middle one constructed a cottage from wood. Seeing that his little brother had finished already, he hurried to go and play with him. The oldest worked on his house of brick. 'You'll soon see what the wolf does with your houses,' he scolded his brothers but they were having a great time.}
\def\spanish{En el corazón del bosque vivían tres cerditos que eran hermanos. El lobo siempre andaba persiguiéndoles para comérselos. Para escapar del lobo, los cerditos decidieron hacerse una casa. El pequeño la hizo de paja, para acabar antes y poder irse a jugar. El mediano construyó una casita de madera. Al ver que su hermano perqueño había terminado ya, se dio prisa para irse a jugar con él. El mayor trabajaba en su casa de ladrillo. - Ya veréis lo que hace el lobo con vuestras casas - riñó a sus hermanos mientras éstos se lo pasaban en grande.}
通过为顶部块提供0pt
的高度,我们允许下一个minipage
重叠。
\begin{minipage}[t][0pt]{\linewidth}
\setstretch{3}
\english
\end{minipage}
\begin{minipage}[t]{\linewidth}
\setstretch{3}
\spanish
\end{minipage}
主要这个想法的一个问题是,如果零高度部分比常规部分长,那么你将有一些挥之不去的重叠文本来处理。 (编辑:此问题在下面的评论中得到解决,请注意,换行符也是这个想法的严重缺陷。)
答案 1 :(得分:2)
我不认为有一个软件包可以做你想要的,但是可以使用\vsplit
自己实现这个,Tex by Topic中有详细记录(可以免费下载,或者在Lulu的死树版本中)。基本理念是
\ENbox
和\ESbox
; \lineheight
,或者您可能需要不同的值,您必须进行试验。假设\lineheight
是对的...... \setbox\nextline=\vsplit\ENbox to \lineheight
获取下一行英语,您可以使用\unvbox\ENbox
输出,然后使用\ESbox
输出下一行,然后输入一些垂直空格intergloss gap; \ht
\ENbox
和\ESbox
查询垂直高度。这一点将是繁琐的。总而言之,这将是一个有点棘手的编码:祝你好运,如果你遇到困难,不要犹豫在这里提问。
后记这显然比Geoff更简单的解决方案要多得多,由于某些原因我在写这篇文章时没有看到,但如果你想摆弄它,它应该更灵活
答案 2 :(得分:1)
如果你想交错西班牙语和英语段落,并让它们大致正确排列,那么你想要的是逐字逐句地写出你的翻译(或者用几个单词写几个单词),并使用光泽包可以包装长句。我在使用gloss.sty之前已经完成了这项工作。它的一个使用示例(目标是用词性来掩盖每个单词):
\gloss Both knowledge and wisdom extend man's reach. Knowledge led to
cjc nn0 cjc nn0 vvb {nn0 pos} {nn0 pun} nn0 vvd prp
\gloss computers, wisdom to chopsticks. Unfortunately our association is
{nn2 pun} nn0 prp {nn2 pun} av0 dps nn1 vbz
\gloss overinvolved with the former. The latter will have to wait for a
ad0 prp at0 {nn0 pun} at0 nn0 vm0 vhb to0 vvb avp at0
\gloss more sublime day.
av0 aj0 {nn1 pun}
\unhbox\gline
该软件包使用空格排列第一语言中的单词和第二种“语言”中的单词。要将一种语言中的多个单词与另一种语言中的单个单词(或多个单词)对齐,请使用大括号对多个单词进行分组。虽然这里的线条是交错的,但这只是为了我的编辑召唤。如果你愿意,你可以编写很长的行,而光泽算法会正确地包装它们。
我还使用了parallel包的两列逐段方法。
答案 3 :(得分:0)
在每组行之间添加额外的换行符:
%
andaba persiguiéndoles para comérselos. Para escapar del lobo, los cerditos decidieron
was chasing them in order to eat them. In order to escape the wolf, the pigs decided to
%