From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/107702 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: r.ermers@hccnet.nl Newsgroups: gmane.comp.tex.context Subject: Re: using modeset Date: Fri, 12 Jun 2020 07:29:39 +0200 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Content-Type: multipart/mixed; boundary="===============5466529376598742221==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="89347"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Jun 12 07:56:54 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjcgQ-000N6Q-PB for gctc-ntg-context-518@m.gmane-mx.org; Fri, 12 Jun 2020 07:56:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A3E3C161619; Fri, 12 Jun 2020 07:56:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F5QhseaMwGJT; Fri, 12 Jun 2020 07:56:19 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B69A21631E4; Fri, 12 Jun 2020 07:56:19 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 38E4E1631E4 for ; Fri, 12 Jun 2020 07:56:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TDoZZ2z-Hp21 for ; Fri, 12 Jun 2020 07:56:18 +0200 (CEST) Received-SPF: Softfail (mailfrom) identity=mailfrom; client-ip=136.144.141.120; helo=mailhost-2.trined.nl; envelope-from=r.ermers@hccnet.nl; receiver= X-Greylist: delayed 1594 seconds by postgrey-1.36 at zapf.ntg.nl; Fri, 12 Jun 2020 07:56:18 CEST Original-Received: from mailhost-2.trined.nl (mailhost-2.trined.nl [136.144.141.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3AF85161619 for ; Fri, 12 Jun 2020 07:56:18 +0200 (CEST) Original-Received: from [62.212.142.196] (helo=imac-van-robert.fritz.box) by mailhost-2.trined.nl with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jjcG4-00027S-2A for ntg-context@ntg.nl; Fri, 12 Jun 2020 07:29:43 +0200 In-Reply-To: X-Mailer: Apple Mail (2.3445.5.20) X-Originating-IP: 62.212.142.196 X-SpamExperts-Domain: smtp.trined.nl X-SpamExperts-Username: 62.212.142.196 Authentication-Results: trined.nl; auth=pass smtp.auth=62.212.142.196@smtp.trined.nl X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.17) X-Recommended-Action: accept X-Filter-ID: Mvzo4OR0dZXEDF/gcnlw0f6LF1GdvkEexklpcFpSF5apSDasLI4SayDByyq9LIhVKMoXRyJeoZvP KjDkPFNmHkTNWdUk1Ol2OGx3IfrIJKywOmJyM1qr8uRnWBrbSAGDh1q8JufB4LHLD3SFaN00KJbR wRM/pkZhq7RBdFcw5O72XkFG0/hrGInyUt8pECt/UZq99/v+OWrp+SY7iSuea8EuNfnjQsRqWXYP fdewBkdPR9o014ICOs9pIWX8OtLJqCusUuUFJy+zJaiDoUWJdUWcjr/GL4msDw+0flcVtDEZmL0k TGIVN3DthM1B8FVxMEM4B92VJbZIHVTKWs4TQz48H2gdqxP0tgYUAZMJStGQVyADaS6UpCBADjTx teudrmOQu6qzIFFXr1QlKPkEFT5dWtmUIvhjaEA8G9RzRMgrTC2AuwB7SJcPYbx65uRf1NRsUdzW awx6dX0NJ8Bzt99fxN2oReTDHAyOynaY0Ckcz9qVW8jvTNhLgSdygoEbPfzGbGd3/nQjCjJGMyxm MrXTnONsqyI++u9UMf5U2lFyXMWcv2ZlvSNZcmGO3E8wIzvpj9IzyBpc10ZJwnPg5eQ3AUAJ8ruJ 817UA5G1KryY6JEght1Yyd5GWztuLSp8LjlV38DWI24rROzm4y3BYjKR6RgQ6scM/oDJnhhySxnA VV3cOYGYf1woE9wWD32BgM5yDzctcfgaSyAJ9MhDntZcYflIMbaTJGx1xg/L1K367TMvIuiCw/GB ZdeqzyEOfmOhq32bUdUl3T+wFo9yHws7g60AEruvHyr453Z9gq6CQXVFMjGtEtz5zCJo9qmpLZWI 5XoMmmjXsNGEJGmnfMOpyKA69LF1G X-Report-Abuse-To: spam@mailhost-1.trined.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:107702 Archived-At: --===============5466529376598742221== Content-Type: multipart/alternative; boundary="Apple-Mail=_F8335447-1C13-472F-8A6B-DDF80A5E0D2A" --Apple-Mail=_F8335447-1C13-472F-8A6B-DDF80A5E0D2A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I tried this too, a number of times. For lengthy texts it makes little = sense. One important thing is that, as BPJ says, you loose the flow = during writing. When the document is finished, it is difficult to get an = overview. If you consider it using for lengthy documents, I would consider to set = up an xml file. You can then have the overview via scripts. Yet for short texts it can be a solution. I have case material for my = trainings in both English and Dutch in the same file. Instead of modes, = I use blocks. Like this: \defineblock[ENblok] \defineblock[NLblok] \setupblock[NLblok][before=3D{\mainlanguage[nl]},after=3D] \setupblock[ENblok][before=3D{\mainlanguage[en]},after=3D] Then, determine which blocks you want to use in your file: \hideblocks[NLblok] %\hideblocks[ENblok] For the titles I use another method: %\def\NL#1{#1} \def\NL#1{{}} %\def\EN#1{} \def\EN#1{#1} You have to comment and uncomment, depending on the language, but I = think you can put them in the NLblok or ENbloks instead. \definecomplexenumeration[Casus] =E2=80=A6 definition \def\refno#1{{\em{(no. \small #1})}} My files look like this: \starttext \startCasus[casus-349][\NL{Een moeilijke zaak}\EN{A complicated case}] = \refno{casus-349}\crlf The casus-349 element is used as a label. After the text I have a list = of questions for this case in a separate block for questions, introduced = by \in[casus-349]). You can probably also use something like=20 \section[\NL{Een moeilijke zaak}\EN{A complicated case}]{xxxx} \begin[NLblok] \startlinenumbering text ... \stoplinenumbering \end[NLblok] \begin[Enblok] \startlinenumbering text... \stoplinenumbering \end[Enblok] \stoptext I hope this helps finding a solution. Robert > Op 11 jun. 2020, om 20:53 heeft BPJ het volgende = geschreven: >=20 > Den tors 11 juni 2020 10:45Jan Willem Flamma > skrev: > =20 >=20 > Dear list members, >=20 > =20 >=20 > I write training manuals and use the Modes mechanism a lot to create = documents at various competency levels using a single set of source = files. So far the manuals have been written in English but now a = separate Dutch translation has to be created. >=20 > =20 >=20 > It is important that the two manuals are setup similarly so the = section/subsection numbers and question numbers are the same in the = English manual and the Dutch manual. Note: I do not intend to create a = manual that has the English and Dutch text at opposite sides (as can be = done using streams) >=20 > =20 >=20 > I=E2=80=99m keen to continue using a single set of source files and = thought it would be best to simply type the translated sections and = subsections just below the original English sections and subsections = using modeset. This gives me the option of creating an English case and = a Dutch case. Within this two cases I would still apply all sorts of = other modes using \startmode and \doifmode. >=20 >=20 > I have done that with LaTeX and IMHO that way lies madness. It may = work for shorter text but for text(s) of any length it gets messy. You = lose the "flow" in both texts, and it shows when you read the typeset = text, and the source becomes hard to navigate. You are probably better = off using an editor which allows you to have the two versions open side = by side in their own viewports (I use what Vim calls "windows"). If = each section heading is on its own line you might try something like a = Perl script to loop over the lines in the English version and print only = the section headings to a new file, where you translate them and build = up the Dutch version around them. It's even better if the editor has the = capacity to show an outline pane for each version =E2=80=94 if there is = an outline mode which understands ConTeXt. >=20 > I'm sorry to discourage you but chances are that you end up with an = intractable mess which you will have to spend much time disentangling = later. > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_F8335447-1C13-472F-8A6B-DDF80A5E0D2A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
I tried this too, a number of times. For lengthy texts it = makes little sense. One important thing is that, as BPJ says, you loose = the flow during writing. When the document is finished, it is difficult = to get an overview.

If you consider it using for lengthy documents, I would = consider to set up an xml file. You can then have the overview via = scripts.

Yet = for short texts it can be a solution. I have case material for my = trainings in both English and Dutch in the same file. Instead of modes, = I use blocks. Like this:

\defineblock[ENblok]
\defineblock[NLblok]

\setupblock[NLblok][before=3D{\mainlanguage[nl]},after=3D]
\setupblock[ENblok][before=3D{\mainlanguage[en]},after=3D]

Then, determine = which blocks you want to use in your file:

\hideblocks[NLblok]
%\hideblocks[ENblok]

For the titles I use another = method:

%\def\NL#1{#1}
\def\NL#1{{}}
%\def\EN#1{}
\def\EN#1{#1}

You have to = comment and uncomment, depending on the language, but I think you can = put them in the NLblok or ENbloks instead.

\definecomplexenumeration[Casus]
=E2= =80=A6 definition

\def\refno#1{{\em{(no. \small #1})}}

My files look like this:

\starttext

\startCasus[casus-349][\NL{Een moeilijke zaak}\EN{A = complicated case}] \refno{casus-349}\crlf

The casus-349 element is used as a = label. After the text I have a list of questions for this case in a = separate block for questions, introduced by \in[casus-349]).

You can probably also = use something like 
\section[\NL{Een moeilijke = zaak}\EN{A complicated case}]{xxxx}

\begin[NLblok]
\startlinenumbering
text ...

\stoplinenumbering
\end[NLblok]

\begin[Enblok]
\startlinenumbering
text...

\stoplinenumbering
\end[Enblok]
\stoptext

I hope this helps finding a solution.

Robert



Op 11 jun. 2020, om 20:53 heeft = BPJ <bpj@melroch.se> het volgende geschreven:

Den tors 11 juni 2020 10:45Jan Willem Flamma <register12c@gmail.com> skrev:

 

Dear list members,

 

I write training = manuals and use the Modes mechanism a lot to create documents at various = competency levels using a single set of source files. So far the manuals = have been written in English but now a separate Dutch translation has to = be created.

 

It is important that = the two manuals are setup similarly so the section/subsection numbers = and question numbers are the same in the English manual and the Dutch = manual. Note: I do not intend to create a manual that has the English = and Dutch text at opposite sides (as can be done using streams)

 

I=E2=80=99m keen to continue using a single set of source = files and thought it would be best to simply type the translated = sections and subsections just below the original English sections and = subsections using modeset. This gives me the option of creating an = English case and a Dutch case. Within this two cases I would still apply = all sorts of other modes using \startmode and = \doifmode.


I have done = that with LaTeX and IMHO that way lies madness. It may work for shorter = text but for text(s) of any length it gets messy. You lose the = "flow"  in both texts, and it shows when you read the typeset text, = and the source becomes hard to navigate. You are probably better off = using an editor which allows you to have the two versions open side by = side in their own viewports (I use what Vim calls "windows").  If = each section heading is on its own line you might try something like a = Perl script to loop over the lines in the English version and print only = the section headings to a new file, where you translate them and build = up the Dutch version around them. It's even better if the editor has the = capacity to show an outline pane for each version =E2=80=94 if there is = an outline mode which understands ConTeXt.

I'm sorry = to discourage you but chances are that you end up with an intractable = mess which you will have to spend much time disentangling = later.
= __________________________________________________________________________= _________
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
_______________________________________________________________= ____________________

= --Apple-Mail=_F8335447-1C13-472F-8A6B-DDF80A5E0D2A-- --===============5466529376598742221== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============5466529376598742221==--