[NTG-context] Interlinear translations in Context

Hans Hagen j.hagen at xs4all.nl
Mon Dec 3 11:17:13 CET 2018


On 12/3/2018 10:29 AM, Huseyin Özoguz wrote:
> Hello,
> 
> I have now the challenge in a book to set an interlinear translation. 
> That is two languages word-by-word (original above translation), so the 
> sentence structure follows the originals language, like its common in 
> many scientific bible translations.
> 
> My problem: The TABLES are not suitable, because
> 
> 1. I have to determine in advance, how many words are in the row, which 
> depens obviously on the page-width and widths of the words.
> 
> 2. Its not readable and well editable, because in Context (and most 
> other languages) one has to write the table in rows and not in columns, 
> as I need it for interlinear translations.
> 
> Example:
> 
> \bTABLE
> \bTR \bTD word 1, language 1\eTD \bTD word 2, language 1\eTD \bTD word 
> 3, language 1\eTD \eTR
> \bTR \bTD word 1, language 2\eTD \bTD word 2, language 2\eTD \bTD word 
> 3, language 2\eTD \eTR
> \eTABLE
> 
> So I can not make this into and simple macro \interlinear{#1}{#2}, which 
> I could use this way:
> 
> \interlinear{word 1, language 1}{word 1, language 2}
> \interlinear{word 2, language 1}{word 2, language 2}
> \interlinear{word 3, language 1}{word 3, language 2}
> 
> (all three blocks in the same horizontal line, if no linebreak is needed)
> 
> On top of this, the language 1 (arabic) is right-to-left (so language 2 
> (german) must follow), it should be compatible with right-to-left 
> reading someway. I tried with \framed, but failed, because the framed 
> blocks are set one under the other, not side by side. How can I achieve 
> a nice way with this simple readable macros?
Processing this might give you some ideas:

\usemodule[art-01]\setupbodyfont[dejavu,12pt]

\defineruby[auto]  [align=auto,color=darkred]
\defineruby[left]  [align=flushleft,color=darkred]
\defineruby[right] [align=flushright,color=darkred]
\defineruby[spread][stretch=yes]

\showframe \showglyphs \showfontkerns \setupinterlinespace[22pt]

\starttext

\startbuffer
     \dorecurse{20}{\ruby{XYZ}{a|bc|d} }\par
     \dorecurse{20}{\ruby{PQR}{p|q|r} }\par
     \dorecurse{20}{\ruby{XYZ}{1|22|333} }\par
     \dorecurse{20}{\ruby{XYZ}{111|222|333} }\par
     \dorecurse{20}{\ruby{XYZ}{foobar} }\par
     \dorecurse{20}{\ruby{XYZ}{fooledbar} }\par
     \dorecurse{20}{\ruby[spread]{XYZ}{fooledbar} }\par
     \dorecurse{20}{\ruby{extremely}{wide} }\par
     \dorecurse{20}{\ruby{wide}{extremely} }\par
  stopbuffer

\testfeatureonce{1}{\start \setupinterlinespace[16pt] 
\setupruby[location=none]                   \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[16pt] 
\setupruby[location=right]                  \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=auto,color=darkred]        \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=flushleft,color=darkgreen] \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=flushright,color=darkblue] \getbuffer \stop \page}
\testfeatureonce{1}{\start \setupinterlinespace[28pt] 
\setupruby[align=middle,color=darkyellow]   \getbuffer \stop \page}

\stoptext

-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list