views:

336

answers:

1

I would like to make a translation of entire paragraphs at a time for a large document, with the start of the new sentences aligning. The following is almost what I want done, though it doesn't yet do the alignment for new sentences.

\documentclass{article}
\usepackage[margin=1in, paperwidth=8.5in, paperheight=11in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{url}
\usepackage{setspace}
\begin{document}

\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.}

\begin{minipage}[t][0pt]{\linewidth}
    \setstretch{3}
    \english
\end{minipage}

\begin{minipage}[t]{\linewidth}
    \setstretch{3}
    \spanish
\end{minipage}

\end{document}

Sample of dual line translation

How can I automatically align new sentences? For bonus points, how can I modify this method to manually indicate when one sentence in english aligns to two in spanish?

A: 

A possible solution has been found over on tex.stackoverflow.com

froeschli
The comment you previously made was the best way to say this. This is not actually an answer in it's own right. I had reposted the question on tex.stackoverflow.com and got an answer there.
D W
I know, but my comment didn't get listed. So I figured, I would add an answer... Should I change the answer to the one on tex.stackoverflow.com?
froeschli
You comment worked. This answer is redundant. I'm fairly new to stack overflow as well but I don't think you should get any points for reposting someone else's answer. Especially since the original questioner on Stack Overflow, me, was the one who reposted the question on the other site. I think things would be different if you found a solution I wasn't aware of. I think a link to the solution is good enough, which is what you and I did in the comments. I am open to corrections to this assessment by any moderators or experienced SO users.
D W
If you or someone else was to improve on the solution found at the other site and post it here by fixing the following issue then that would be worth some points:"A cleaner solution might be to measure the lengths of the two sentences in the \sentence{} macro and then pad the whitespace later based on their difference."
D W
Accepted as per @Jefromi's suggestion. Edit this answer and I will be able to remove the downvote
D W