首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LaTeX中的双线双语段落

LaTeX中的双线双语段落
EN

Stack Overflow用户
提问于 2010-05-25 18:19:12
回答 3查看 3.2K关注 0票数 5

线间光泽度可以用来布置文档的翻译。

光泽

通常这是逐字逐句或语素逐字进行的.但是,我想以一种不同的方式这样做,一次翻译整个段落。下面的链接和图片是我想要做的事情的一个例子,尽管我想对一个更大的不同的文本这样做。

http://www.optimnem.co.uk/learning/spanish/three-little-pigs.php

现在,我不想考虑改变语言之间顺序的单词或短语的顺序。也就是说,我不介意段落中的单词是否不对齐,或者一个段落的长度是否比另一个段落长得多,从而造成一条悬垂线。

据我所知,下列软件包不符合我的需要:

代码语言:javascript
复制
covingtn.sty
cgloss4e.sty
gb4e.sty
lingmacros.sty - shortex

以下是英文本:

代码语言:javascript
复制
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.

这是西班牙文本:

代码语言:javascript
复制
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.

不希望像这样手动完成它:

代码语言:javascript
复制
\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中以更自动化的方式(无需手动添加换行)来布局这个简单的双行胆段?

EN

回答 3

Stack Overflow用户

发布于 2010-05-26 06:39:18

我不认为有一个包可以做您想做的事情,但是可以自己使用\vsplit来实现它,这在按主题分列的Tex中有很好的文档(可以免费下载,也可以在死树版本中通过Lulu实现)。基本思想是

  1. 您定义了两个vboxes,一个用于英语,一个用于西班牙语,您希望一次只取出一行内容。将这些vboxes称为\ENbox\ESbox
  2. 您需要确定要使用的正确的垂直维度:这可能是\lineheight,或者您可能需要一个不同的值,您必须进行实验。假设\lineheight是对的..。
  3. ..。然后你可以用\setbox\nextline=\vsplit\ENbox to \lineheight得到下一行英语,你可以用\unvbox\ENbox输出它,同样地,从\ESbox得到下一行,然后用垂直空间来表示交错间隙;
  4. 然后,您需要测试循环,这可以通过使用\ht查询\ENbox\ESbox的垂直高度来实现。这一点会很微妙的。

总之,这将是有点棘手的编码:祝你好运,如果你遇到困难,可以毫不犹豫地在这里提问。

Postscript这显然比Geoff的简单得多的解决方案要简单得多,由于某些原因,我在编写这篇文章时还没有看到,但是如果您想要修改它,它应该更灵活。

票数 2
EN

Stack Overflow用户

发布于 2010-06-30 14:04:57

如果你想插入西班牙语和英语段落,并让它们大致正确地排列起来,那么你想要的是逐字逐句地写你的译文(或几个单词),并使用一个可以包装长句的光泽包。在使用gloss.sty之前,我已经这样做了。使用它的一个例子(目的是用它的词性来修饰每个单词):

代码语言:javascript
复制
\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

这个包将第一语言中的单词和使用空格的第二种“语言”中的单词排列在一起。若要将一种语言中的多个单词与另一种语言中的单个单词(或多个单词)对齐,请使用括号对多个单词进行分组。虽然这里的线条是交错的,但这只是为了我的编辑召集人。如果你愿意的话,你可以写很长的行,而光泽算法会正确地包装它们。

我还使用了使用平行包的两列逐段方法。

票数 1
EN

Stack Overflow用户

发布于 2010-05-25 20:28:59

在每一组线之间插入一个额外的线:

代码语言:javascript
复制
%
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
%
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2907327

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档