* Interlinear translations in Context @ 2018-12-03 9:29 Huseyin Özoguz 2018-12-03 10:17 ` Hans Hagen 0 siblings, 1 reply; 12+ messages in thread From: Huseyin Özoguz @ 2018-12-03 9:29 UTC (permalink / raw) To: mailing list for ConTeXt users 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? Thank you. Huseyin -- Huseyin Özoguz E-Mail: h.oezoguz@mmnetz.de ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 9:29 Interlinear translations in Context Huseyin Özoguz @ 2018-12-03 10:17 ` Hans Hagen 2018-12-03 11:51 ` Huseyin Özoguz 0 siblings, 1 reply; 12+ messages in thread From: Hans Hagen @ 2018-12-03 10:17 UTC (permalink / raw) To: mailing list for ConTeXt users, Huseyin Özoguz 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 ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 10:17 ` Hans Hagen @ 2018-12-03 11:51 ` Huseyin Özoguz 2018-12-03 12:24 ` Hans Hagen 2018-12-03 12:36 ` Wolfgang Schuster 0 siblings, 2 replies; 12+ messages in thread From: Huseyin Özoguz @ 2018-12-03 11:51 UTC (permalink / raw) To: Hans Hagen, mailing list for ConTeXt users Thank you, I will investigate it, seems to be a pretty powerful mechanism. First it failed to compile (with Context version from 2015, did not know \defineruby), but with the most recent beta it does well. So a small btw-question, I compile out of notepad++ (windows 7, 64 bit) with this code: cd $(CURRENT_DIRECTORY) context $(CURRENT_DIRECTORY)\main.tex --synctex=1 taskkill \im SumatraPDF.exe C:\Users\Huseyin\sumatra.bat "$(CURRENT_DIRECTORY)\main.pdf" This always uses the default context-version, which path' is saved the environment-variables of windows. How can I switch (and control) between different context-versions or pathes for compiling without changing the environment variables in Win (and after that I have to restart)? I tried to write the path directly into the command above, but did not work. Thanks and I may have questions to the actual question about interlinear typesetting later, will try to define some nice macros with arabic-german interlinear texts. Huseyin Huseyin Özoguz E-Mail: h.oezoguz@mmnetz.de Am 03.12.2018 um 11:17 schrieb Hans Hagen: > 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 > ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 11:51 ` Huseyin Özoguz @ 2018-12-03 12:24 ` Hans Hagen 2018-12-03 12:32 ` Huseyin Özoguz 2018-12-03 12:36 ` Wolfgang Schuster 1 sibling, 1 reply; 12+ messages in thread From: Hans Hagen @ 2018-12-03 12:24 UTC (permalink / raw) To: Huseyin Özoguz, mailing list for ConTeXt users On 12/3/2018 12:51 PM, Huseyin Özoguz wrote: > Thank you, I will investigate it, seems to be a pretty powerful > mechanism. First it failed to compile (with Context version from 2015, > did not know \defineruby), but with the most recent beta it does well. > > So a small btw-question, I compile out of notepad++ (windows 7, 64 bit) > with this code: > > cd $(CURRENT_DIRECTORY) > context $(CURRENT_DIRECTORY)\main.tex --synctex=1 > taskkill \im SumatraPDF.exe > C:\Users\Huseyin\sumatra.bat "$(CURRENT_DIRECTORY)\main.pdf" there is no need to kill sumatra, just add --autopdf to the context call also --synctex is replaced by \setupsynctex[state=start] > This always uses the default context-version, which path' is saved the > environment-variables of windows. How can I switch (and control) between > different context-versions or pathes for compiling without changing the > environment variables in Win (and after that I have to restart)? I tried > to write the path directly into the command above, but did not work. maybe this works out ok: mtxrun --tree=c:/data/mytex --script context --autopdf .. > Thanks and I may have questions to the actual question about interlinear > typesetting later, will try to define some nice macros with > arabic-german interlinear texts. ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 12:24 ` Hans Hagen @ 2018-12-03 12:32 ` Huseyin Özoguz 0 siblings, 0 replies; 12+ messages in thread From: Huseyin Özoguz @ 2018-12-03 12:32 UTC (permalink / raw) To: Hans Hagen, mailing list for ConTeXt users > there is no need to kill sumatra, just add --autopdf to the context call > > also --synctex is replaced by Thank you, perfect > maybe this works out ok: > > mtxrun --tree=c:/data/mytex --script context --autopdf .. I does indeed. Thanks. Huseyin Özoguz E-Mail: h.oezoguz@mmnetz.de Am 03.12.2018 um 13:24 schrieb Hans Hagen: > On 12/3/2018 12:51 PM, Huseyin Özoguz wrote: >> Thank you, I will investigate it, seems to be a pretty powerful >> mechanism. First it failed to compile (with Context version from >> 2015, did not know \defineruby), but with the most recent beta it >> does well. >> >> So a small btw-question, I compile out of notepad++ (windows 7, 64 >> bit) with this code: >> >> cd $(CURRENT_DIRECTORY) >> context $(CURRENT_DIRECTORY)\main.tex --synctex=1 >> taskkill \im SumatraPDF.exe >> C:\Users\Huseyin\sumatra.bat "$(CURRENT_DIRECTORY)\main.pdf" > > there is no need to kill sumatra, just add --autopdf to the context call > > also --synctex is replaced by > > \setupsynctex[state=start] > >> This always uses the default context-version, which path' is saved >> the environment-variables of windows. How can I switch (and control) >> between different context-versions or pathes for compiling without >> changing the environment variables in Win (and after that I have to >> restart)? I tried to write the path directly into the command above, >> but did not work. > > maybe this works out ok: > > mtxrun --tree=c:/data/mytex --script context --autopdf .. > >> Thanks and I may have questions to the actual question about >> interlinear typesetting later, will try to define some nice macros >> with arabic-german interlinear texts. > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 11:51 ` Huseyin Özoguz 2018-12-03 12:24 ` Hans Hagen @ 2018-12-03 12:36 ` Wolfgang Schuster 2018-12-03 13:59 ` Floris van Manen 2018-12-03 16:47 ` Huseyin Özoguz 1 sibling, 2 replies; 12+ messages in thread From: Wolfgang Schuster @ 2018-12-03 12:36 UTC (permalink / raw) To: mailing list for ConTeXt users, Huseyin Özoguz Huseyin Özoguz schrieb am 03.12.18 um 12:51: > Thanks and I may have questions to the actual question about interlinear > typesetting later, will try to define some nice macros with > arabic-german interlinear texts. Before you write your own commands try to use what is available. If there is something missing existing commands can be extended and Hans is in many cases open to add new function to ConTeXt. \usemodule [database] % Source for the sample text: % https://interlinearbooks.com/blog/german-interlinear-translation-of-franz-kafkas-the-metamorphosis-released/ \startbuffer[sample] "Als","As" "Gregor","Gregor" "Samsa","Samsa" "eines","one" "Morgens","morning" "aus","from" "unruhigen","uneasy" "Träumen","dreams" "erwachte,","woke up," "fand","found" "er","he" "sich","himself" "in","in" "seinem","his" "Bett","bed" "zu","in" "einem","an" "ungeheuren","enormous" "Ungeziefer","kind of monstrous vermin" "verwandelt.","transformed." \stopbuffer \define[2]\InterlinearText {\ruby{#1}{#2} } \definedatabase [interlineartext] [quotechar={"}, command=\InterlinearText] \setupinterlinespace[line=6ex] \setupruby[voffset=-2.5ex] \starttext \processdatabasebuffer[interlineartext][sample] \stoptext Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 12:36 ` Wolfgang Schuster @ 2018-12-03 13:59 ` Floris van Manen 2018-12-03 14:03 ` Wolfgang Schuster 2018-12-03 16:47 ` Huseyin Özoguz 1 sibling, 1 reply; 12+ messages in thread From: Floris van Manen @ 2018-12-03 13:59 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 2105 bytes --] where can i find the description and features of the \ruby and \defineruby commands? .F > On 3 Dec 2018, at 13:36, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote: > > > > Huseyin Özoguz schrieb am 03.12.18 um 12:51: >> Thanks and I may have questions to the actual question about interlinear typesetting later, will try to define some nice macros with arabic-german interlinear texts. > > Before you write your own commands try to use what is available. > > If there is something missing existing commands can be extended > and Hans is in many cases open to add new function to ConTeXt. > > \usemodule [database] > > % Source for the sample text: > % https://interlinearbooks.com/blog/german-interlinear-translation-of-franz-kafkas-the-metamorphosis-released/ > > \startbuffer[sample] > "Als","As" > "Gregor","Gregor" > "Samsa","Samsa" > "eines","one" > "Morgens","morning" > "aus","from" > "unruhigen","uneasy" > "Träumen","dreams" > "erwachte,","woke up," > "fand","found" > "er","he" > "sich","himself" > "in","in" > "seinem","his" > "Bett","bed" > "zu","in" > "einem","an" > "ungeheuren","enormous" > "Ungeziefer","kind of monstrous vermin" > "verwandelt.","transformed." > \stopbuffer > > \define[2]\InterlinearText > {\ruby{#1}{#2} } > > \definedatabase > [interlineartext] > [quotechar={"}, > command=\InterlinearText] > > \setupinterlinespace[line=6ex] > > \setupruby[voffset=-2.5ex] > > \starttext > \processdatabasebuffer[interlineartext][sample] > \stoptext > > Wolfgang > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ [-- Attachment #1.2: Message signed with OpenPGP using GPGMail --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 492 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 13:59 ` Floris van Manen @ 2018-12-03 14:03 ` Wolfgang Schuster 0 siblings, 0 replies; 12+ messages in thread From: Wolfgang Schuster @ 2018-12-03 14:03 UTC (permalink / raw) To: mailing list for ConTeXt users, Floris van Manen Floris van Manen schrieb am 03.12.18 um 14:59: > where can i find the description and features of the \ruby and \defineruby commands? For a list with all keys/values look into setup-en.pdf. Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 12:36 ` Wolfgang Schuster 2018-12-03 13:59 ` Floris van Manen @ 2018-12-03 16:47 ` Huseyin Özoguz 2018-12-03 17:34 ` Wolfgang Schuster 1 sibling, 1 reply; 12+ messages in thread From: Huseyin Özoguz @ 2018-12-03 16:47 UTC (permalink / raw) To: Wolfgang Schuster, mailing list for ConTeXt users [-- Attachment #1: Type: text/plain, Size: 2588 bytes --] > Before you write your own commands try to use what is available. Right, but in many cases I am just not aware of what is available, to be honest, though I quite often use the wikigarden. I tried to change your example into arabic-german, seems to work, except only the first translation-pair is shown (see attachment). Why? \usemodule [database] \startbuffer[sample] "قال","sagte (Es)" "رسول","Gesandte (der)" "الله","Gottes" \stopbuffer \define[2]\InterlinearText {\setupalign[r2l]\definedfont[file:arial*arabic at 16 pt] \ruby{{\setupalign[r2l]#1}}{\setupalign[l2r]\definedfont[name:arial at 10pt]#2}} \definedatabase [interlineartext] [quotechar={"}, command=\InterlinearText] \setupinterlinespace[line=8ex] \setupruby[voffset=-3ex] \starttext \definedfont[file:arial*arabic at 16 pt] \processdatabasebuffer[interlineartext][sample] \stoptext And second: Of course it would be best readable, if one could write instead \startbuffer[sample] "قال","(Es) sagte" \stopbuffer but with same output, s.t. the order of the words in the second database-element is inverted. Is that possible? Huseyin Özoguz E-Mail: h.oezoguz@mmnetz.de Am 03.12.2018 um 13:36 schrieb Wolfgang Schuster: > > > Huseyin Özoguz schrieb am 03.12.18 um 12:51: >> Thanks and I may have questions to the actual question about >> interlinear typesetting later, will try to define some nice macros >> with arabic-german interlinear texts. > > Before you write your own commands try to use what is available. > > If there is something missing existing commands can be extended > and Hans is in many cases open to add new function to ConTeXt. > > \usemodule [database] > > % Source for the sample text: > % > https://interlinearbooks.com/blog/german-interlinear-translation-of-franz-kafkas-the-metamorphosis-released/ > > \startbuffer[sample] > "Als","As" > "Gregor","Gregor" > "Samsa","Samsa" > "eines","one" > "Morgens","morning" > "aus","from" > "unruhigen","uneasy" > "Träumen","dreams" > "erwachte,","woke up," > "fand","found" > "er","he" > "sich","himself" > "in","in" > "seinem","his" > "Bett","bed" > "zu","in" > "einem","an" > "ungeheuren","enormous" > "Ungeziefer","kind of monstrous vermin" > "verwandelt.","transformed." > \stopbuffer > > \define[2]\InterlinearText > {\ruby{#1}{#2} } > > \definedatabase > [interlineartext] > [quotechar={"}, > command=\InterlinearText] > > \setupinterlinespace[line=6ex] > > \setupruby[voffset=-2.5ex] > > \starttext > \processdatabasebuffer[interlineartext][sample] > \stoptext > > Wolfgang > [-- Attachment #2: main.pdf --] [-- Type: application/pdf, Size: 32481 bytes --] [-- Attachment #3: Type: text/plain, Size: 492 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 16:47 ` Huseyin Özoguz @ 2018-12-03 17:34 ` Wolfgang Schuster 2018-12-03 19:45 ` Huseyin Özoguz 0 siblings, 1 reply; 12+ messages in thread From: Wolfgang Schuster @ 2018-12-03 17:34 UTC (permalink / raw) To: Huseyin Özoguz; +Cc: mailing list for ConTeXt users Huseyin Özoguz schrieb am 03.12.18 um 17:47: >> Before you write your own commands try to use what is available. > > Right, but in many cases I am just not aware of what is available, to be > honest, though I quite often use the wikigarden. > > I tried to change your example into arabic-german, seems to work, except > only the first translation-pair is shown (see attachment). Why? > > \usemodule [database] > \startbuffer[sample] > "قال","sagte (Es)" > "رسول","Gesandte (der)" > "الله","Gottes" > \stopbuffer > > \define[2]\InterlinearText > {\setupalign[r2l]\definedfont[file:arial*arabic at 16 pt] > \ruby{{\setupalign[r2l]#1}}{\setupalign[l2r]\definedfont[name:arial at > 10pt]#2}} > > \definedatabase > [interlineartext] > [quotechar={"}, > command=\InterlinearText] > > \setupinterlinespace[line=8ex] > > \setupruby[voffset=-3ex] > > \starttext > \definedfont[file:arial*arabic at 16 pt] > \processdatabasebuffer[interlineartext][sample] > \stoptext Probably something with your font/alignment switching. \usemodule [database] \startbuffer[sample] "قال","sagte (Es)" "رسول","Gesandte (der)" "الله","Gottes" \stopbuffer \define[2]\InterlinearText {\ruby{#1}{#2} } % \defineruby % [interlineartext] % [style=] % % \define[2]\InterlinearText % {\ruby[interlineartext]{#1}{#2} } \definedatabase [interlineartext] [quotechar={"}, command=\InterlinearText] \setupinterlinespace[line=8ex] \definefontfamily [arial] [ss] [Arial] [features=arabic] \setupbodyfont [arial,16pt] \starttext \processdatabasebuffer[interlineartext][sample] \stoptext > And second: Of course it would be best readable, if one could write instead > > \startbuffer[sample] > "قال","(Es) sagte" > \stopbuffer > > but with same output, s.t. the order of the words in the second > database-element is inverted. Is that possible? There is no command which changes the order of words in a sentence but this should be easy with a short Lua function. Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 17:34 ` Wolfgang Schuster @ 2018-12-03 19:45 ` Huseyin Özoguz 2018-12-03 19:55 ` Wolfgang Schuster 0 siblings, 1 reply; 12+ messages in thread From: Huseyin Özoguz @ 2018-12-03 19:45 UTC (permalink / raw) To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users > Probably something with your font/alignment switching. Yes, probably, but this switching is necessary, look at your example: It gives wrong aligning of the arabic letters (left to right instead of right to left), so at some point one has to inject a \setupalign[r2l], but all my tries only gave this one as a correct result: \define[2]\InterlinearText {\setupalign[r2l]\definedfont[file:arial*arabic at 16 pt] \ruby{{\setupalign[r2l]#1}}{\setupalign[l2r]\definedfont[name:arial at 10pt]#2}} But that as mentioned looses all other databse entries except the first. Some hints where to make the r2l-switch with getting the same result? > There is no command which changes the order of words in a sentence > but this should be easy with a short Lua function. Thank you, if some day one is available, I will use it. Or wil learn Lua, right, should be a very basic function to implement. Huseyin Özoguz E-Mail: h.oezoguz@mmnetz.de Am 03.12.2018 um 18:34 schrieb Wolfgang Schuster: > > > Huseyin Özoguz schrieb am 03.12.18 um 17:47: >>> Before you write your own commands try to use what is available. >> >> Right, but in many cases I am just not aware of what is available, to >> be honest, though I quite often use the wikigarden. >> >> I tried to change your example into arabic-german, seems to work, >> except only the first translation-pair is shown (see attachment). Why? >> >> \usemodule [database] >> \startbuffer[sample] >> "قال","sagte (Es)" >> "رسول","Gesandte (der)" >> "الله","Gottes" >> \stopbuffer >> >> \define[2]\InterlinearText >> {\setupalign[r2l]\definedfont[file:arial*arabic at 16 pt] >> \ruby{{\setupalign[r2l]#1}}{\setupalign[l2r]\definedfont[name:arial >> at 10pt]#2}} >> >> \definedatabase >> [interlineartext] >> [quotechar={"}, >> command=\InterlinearText] >> >> \setupinterlinespace[line=8ex] >> >> \setupruby[voffset=-3ex] >> >> \starttext >> \definedfont[file:arial*arabic at 16 pt] >> \processdatabasebuffer[interlineartext][sample] >> \stoptext > > Probably something with your font/alignment switching. > > \usemodule [database] > > \startbuffer[sample] > "قال","sagte (Es)" > "رسول","Gesandte (der)" > "الله","Gottes" > \stopbuffer > > \define[2]\InterlinearText > {\ruby{#1}{#2} } > > % \defineruby > % [interlineartext] > % [style=] > % > % \define[2]\InterlinearText > % {\ruby[interlineartext]{#1}{#2} } > > \definedatabase > [interlineartext] > [quotechar={"}, > command=\InterlinearText] > > \setupinterlinespace[line=8ex] > > \definefontfamily [arial] [ss] [Arial] [features=arabic] > > \setupbodyfont [arial,16pt] > > \starttext > \processdatabasebuffer[interlineartext][sample] > \stoptext > >> And second: Of course it would be best readable, if one could write >> instead >> >> \startbuffer[sample] >> "قال","(Es) sagte" >> \stopbuffer >> >> but with same output, s.t. the order of the words in the second >> database-element is inverted. Is that possible? > > There is no command which changes the order of words in a sentence > but this should be easy with a short Lua function. > > Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Interlinear translations in Context 2018-12-03 19:45 ` Huseyin Özoguz @ 2018-12-03 19:55 ` Wolfgang Schuster 0 siblings, 0 replies; 12+ messages in thread From: Wolfgang Schuster @ 2018-12-03 19:55 UTC (permalink / raw) To: Huseyin Özoguz; +Cc: mailing list for ConTeXt users Huseyin Özoguz schrieb am 03.12.18 um 20:45: >> Probably something with your font/alignment switching. > > Yes, probably, but this switching is necessary, look at your example: It > gives wrong aligning of the arabic letters (left to right instead of > right to left), so at some point one has to inject a \setupalign[r2l], > but all my tries only gave this one as a correct result: > > \define[2]\InterlinearText > {\setupalign[r2l]\definedfont[file:arial*arabic at 16 pt] > \ruby{{\setupalign[r2l]#1}}{\setupalign[l2r]\definedfont[name:arial at > 10pt]#2}} \defineruby [interlineartext] [style=\lefttoright\txx] \define[2]\InterlinearText {\ruby[interlineartext]{#1}{#2} } > But that as mentioned looses all other databse entries except the first. > Some hints where to make the r2l-switch with getting the same result? \starttext \setupalign[r2l] \processdatabasebuffer[interlineartext][sample] \stoptext or when you want to change the alignment only for a part of your document \starttext \startalignment[r2l] \processdatabasebuffer[interlineartext][sample] \stopalignment \stoptext >> There is no command which changes the order of words in a sentence >> but this should be easy with a short Lua function. > Thank you, if some day one is available, I will use it. Or wil learn > Lua, right, should be a very basic function to implement. You can find many Lua examples for this online. Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2018-12-03 19:55 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-12-03 9:29 Interlinear translations in Context Huseyin Özoguz 2018-12-03 10:17 ` Hans Hagen 2018-12-03 11:51 ` Huseyin Özoguz 2018-12-03 12:24 ` Hans Hagen 2018-12-03 12:32 ` Huseyin Özoguz 2018-12-03 12:36 ` Wolfgang Schuster 2018-12-03 13:59 ` Floris van Manen 2018-12-03 14:03 ` Wolfgang Schuster 2018-12-03 16:47 ` Huseyin Özoguz 2018-12-03 17:34 ` Wolfgang Schuster 2018-12-03 19:45 ` Huseyin Özoguz 2018-12-03 19:55 ` Wolfgang Schuster
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).