[texhax] Has anyone created bilingual translations with a tex package.

Radhakrishnan CV cvr at river-valley.org
Sun Sep 7 06:24:35 CEST 2003


>>>>> "Craig" == W Craig Carter <ccarter at mit.edu> writes:

    Craig> I am about to start a translation project and am wondering
    Craig> if someone else has done something similar.

    Craig> You might have seen bilingual translations where, say,
    Craig> english appears on the odd (left-hand-leaf) and , say, the
    Craig> translated french appears on the even (right-hand-leaf).
    Craig> The pages match up so that a reader can check their
    Craig> abilities to translate.

    Craig> I'd like to do a similar project, with the addition of
    Craig> extra material such as figures and equations and
    Craig> references, of having an original and my translation show
    Craig> up side-by-side.

One way of doing this might be as follows:

1. Create a pdf of your English version.

2. Create another pdf of your French version with same classes and
   packges. 

3. Now create a document, say 'print.tex':
 
   \documentclass{article}
   \usepackage[final]{pdfpages}

   \def\totalpages{<n>} % number of pages of any one of your version + 1

   \newcounter{xpage}

   \def\Include#1#2{%
   \loop\stepcounter{xpage}
   \ifnum\thexpage<\totalpages  
   \includepdf[pages=\thexpage,pagecommand={\thispagestyle{plain}}]{#1}
   \includepdf[pages=\thexpage,pagecommand={\thispagestyle{plain}}]{#2}
   \repeat}

  \begin{document}

  \Include{english.pdf}{french.pdf}

  \end{document}

4. Run pdflatex over this print.tex, you will get print.pdf which
   should have English pages and corresponding French pages repeating
   alternatively. 

This has worked for me very well. It might be better, if your
language versions of document do not have any page numbers, because
you can have continuous page numbers inserted by \pagecommand in the
composite one.

Best.

Radhakrishnan


More information about the texhax mailing list