Re: [NTG-context] using modeset

2020-06-11 Thread r . ermers
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={\mainlanguage[nl]},after=]
\setupblock[ENblok][before={\mainlanguage[en]},after=]

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]
… 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}]{}

\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:
> 
> Den tors 11 juni 2020 10:45Jan Willem Flamma  > 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’m 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 — 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
> ___

___
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
___


[NTG-context] More funny numbers

2020-06-11 Thread Jairo A. del Rio
Hi everyone! The following example shows that numerators of fractions
inside math alignment environments appear with a funny size:

\startTEXpage
\startformula
\startmathalignment[n=1,align=middle]
\NC \frac{1351}{780}>\sqrt{3}>\frac{265}{153},  3013
\frac{3}{4}>\sqrt{9082321}, \quad 1838 \frac{9}{17}>\sqrt{3380929} \NR
\NC 1009 \frac{1}{6}>\sqrt{1018405}, \quad 2017 \frac{1}{4}>\sqrt{4069284}
 \frac{1}{38}, \quad 591 \frac{1}{8}<\sqrt{349450} \NR
\NC 1172 \frac{1}{8}<\sqrt{1373943\frac{84}{33}},  2339
\frac{1}{4}<\sqrt{5472132 \frac{1}{16}} \NR
\stopmathalignment
\stopformula
\stopTEXpage

It's actually nice to find those bugs when one makes heavy use of math
environments. For comparison, LuaTeX prints the correct output.

Jairo :)
___
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
___


Re: [NTG-context] Draft Watermark of Garden gives unexpected results

2020-06-11 Thread Wolfgang Schuster

Floris van Manen schrieb am 11.06.2020 um 23:03:


On 11/06/2020 22:31, Jairo A. del Rio wrote:

The watermark is partially outside the page, whereas the Wiki result is
more "centered". Is that an intended behaviour?


A slightly better version.

\defineoverlay
  [WatermarkOverlay]
  [{\framed
  [frame=off,
   orientation=20,
   foregroundcolor=gray]
  {\scale[width=\textwidth]{Draft}}}]


Also, if you set \rotate[rotation=0.0]{Draft} it will disappear...


I see, there are still problems with decimal values for rotation.

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
___


Re: [NTG-context] Draft Watermark of Garden gives unexpected results

2020-06-11 Thread Floris van Manen


On 11/06/2020 22:31, Jairo A. del Rio wrote:
> The watermark is partially outside the page, whereas the Wiki result is
> more "centered". Is that an intended behaviour?
> 

Also, if you set \rotate[rotation=0.0]{Draft} it will disappear...



pEpkey.asc
Description: application/pgp-keys
___
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
___


Re: [NTG-context] Changed behavior of ^^ in csname

2020-06-11 Thread Marcel Fabian Krüger
On Thu, Jun 11, 2020 at 07:51:56PM +0200, Hans Hagen wrote:
> On 6/11/2020 12:24 PM, Marcel Fabian Krüger wrote:
> 
> > shows exactly the same behavior.
> Looks like i don't catch the case where a cs is constructed, so i'll add
> some checking there too (it is tempting to remove all that ^^ stuff).

Thanks. I think "the ^^ stuff" is actually quite useful, especially when
debugging international documents. Especially when the glyphs come from
a language you are not used to, it is quite nice to just have a hex
representation without needing pecial editors and ^^ is the only way to get
that without introducing actual changes to behavior.

I had another issue with the latest luametatex:

The following document:

\starttext
\def\mymacro#1 bc{}
{\mymacro a b bc}
\stoptext

used to work and lead to no output. But in the new luametatex version,
it complains about "! Argument of \mymacro has an extra }" as if it
doesn't see the " bc" argument delimiter.

Marcel

> 
> Hans
___
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
___


[NTG-context] Draft Watermark of Garden gives unexpected results

2020-06-11 Thread Jairo A. del Rio
The following example of using layers doesn't works as expected in ConTeXt

https://wiki.contextgarden.net/Draft_Watermark

The watermark is partially outside the page, whereas the Wiki result is
more "centered". Is that an intended behaviour?

Additionally, how to center an element in a layer with respect to the
current page?

Cordially,

Jairo :)
___
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
___


Re: [NTG-context] using modeset

2020-06-11 Thread BPJ
Den tors 11 juni 2020 10:45Jan Willem Flamma  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’m 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 — 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
___


Re: [NTG-context] RE : RE : Re: RE : Re: Issue with latest LMTX version 2020-05-25

2020-06-11 Thread Wolfgang Schuster

Joseph schrieb am 11.06.2020 um 19:08:
Thanks, sure I’ll document that. Just struggling to understand how to 
use it.


I used \ifindentation as follows

\def\ParIndent{\ifindentation\parindent\else 0pt\fi}

But if I replace with

\def\ParIndent{\doifelseindented{\parindent}{0pt}}

It does not work.


You have to switch to horizontal mode to get the correct result.

\setupindenting[yes,medium]

\starttext

\doifelseindented{Yes}{No}

\dontleavehmode\doifelseindented{Yes}{No}

\the\ifzeropt\parindent
\zeropoint
\else
\parindent
\fi

\setupindenting[no]

\the\ifzeropt\parindent
\zeropoint
\else
\parindent
\fi

\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
___


Re: [NTG-context] Installing on arm64

2020-06-11 Thread Lutz Haseloff
Hi Hans, hi all

thank you for including the rule for aarch64 into install.sh.

Now the setup routine works for me out of the box.

Thanks again 

Greetings Lutz

Am 10. Juni 2020 13:39:51 MESZ schrieb Hans Hagen :
>On 6/10/2020 12:17 PM, Lutz Haseloff wrote:
>> Hi all,
>> 
>> I got my system working by quick and dirty patching install.sh
>> 
>> I have now
>> 
>> PLATFORM="linux-aarch64"
>> 
>> after the last esac and all works like expected.
>> 
>> I would like to have a check for aarch64 in the install.sh too.
>you can prototype that and tell what to adapt
>
>
>-
>   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
___


Re: [NTG-context] Changed behavior of ^^ in csname

2020-06-11 Thread Hans Hagen

On 6/11/2020 12:24 PM, Marcel Fabian Krüger wrote:


shows exactly the same behavior.
Looks like i don't catch the case where a cs is constructed, so i'll add 
some checking there too (it is tempting to remove all that ^^ stuff).


Hans

-
  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
___


Re: [NTG-context] Funny radicals in LMTX

2020-06-11 Thread Hans Hagen

On 6/11/2020 2:50 PM, Mikael Sundqvist wrote:

Hi,

I can confirm. The same problem goes with $\sqrt{\frac{2}{3}}$.


put this in cont-new.mkiv:

\unexpanded\def\styledrootradical#1#2%
  {\normalexpanded{\rootradical
 {\normalunexpanded{#1}}%
 {\noexpand\triggermathstyle{\number\normalmathstyle}%
  \normalunexpanded{#2

but next upload test again (as i'm experimenting with it a bit just for 
the sake of cleaner code).


Hans


/Mikael

On Thu, Jun 11, 2020 at 1:53 PM Jairo A. del Rio 
mailto:jairoadelr...@gmail.com>> wrote:


Hi list! Nesting radicals in LMTX give a funny font size compared
with LuaTeX, which gives the correct output. I cleaned the cache,
just in case. I attach code and outputs. Thank you in advance.

\startTEXpage
\startformula
a_{2n} = \sqrt{2-\sqrt{4-a_{2n}}}
\stopformula
\stopTEXpage

Jairo :D

___
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

___


___
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
___




--

-
  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
___


[NTG-context] RE : RE : Re: RE : Re: Issue with latest LMTX version 2020-05-25

2020-06-11 Thread Joseph
Thanks, sure I’ll document that. Just struggling to understand how to use it.I used \ifindentation as follows \def\ParIndent{\ifindentation\parindent\else 0pt\fi} But if I replace with  \def\ParIndent{\doifelseindented{\parindent}{0pt}} It does not work.Thanks Joseph De : Hans HagenEnvoyé le :mardi 26 mai 2020 18:33À : Joseph; mailing list for ConTeXt usersObjet :Re: RE : Re: RE : Re: [NTG-context] Issue with latest LMTX version 2020-05-25 On 5/26/2020 2:28 PM, Joseph wrote:> I want to check if current paragraph is being indented.I'll add \doifelseindented to lmtx ... which you will then document on the wiki. Hans -   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
___


Re: [NTG-context] Funny radicals in LMTX

2020-06-11 Thread Mikael Sundqvist
Hi,

I can confirm. The same problem goes with $\sqrt{\frac{2}{3}}$.

/Mikael

On Thu, Jun 11, 2020 at 1:53 PM Jairo A. del Rio 
wrote:

> Hi list! Nesting radicals in LMTX give a funny font size compared with
> LuaTeX, which gives the correct output. I cleaned the cache, just in case.
> I attach code and outputs. Thank you in advance.
>
> \startTEXpage
> \startformula
> a_{2n} = \sqrt{2-\sqrt{4-a_{2n}}}
> \stopformula
> \stopTEXpage
>
> Jairo :D
>
> ___
> 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
>
> ___
>
___
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
___


[NTG-context] Funny radicals in LMTX

2020-06-11 Thread Jairo A. del Rio
Hi list! Nesting radicals in LMTX give a funny font size compared with
LuaTeX, which gives the correct output. I cleaned the cache, just in case.
I attach code and outputs. Thank you in advance.

\startTEXpage
\startformula
a_{2n} = \sqrt{2-\sqrt{4-a_{2n}}}
\stopformula
\stopTEXpage

Jairo :D


luametatextest.pdf
Description: Adobe PDF document


luatextest.pdf
Description: Adobe PDF document
___
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
___


Re: [NTG-context] Bar within math (amended)

2020-06-11 Thread Axel Kielhorn


> Am 09.06.2020 um 20:41 schrieb Wolfgang Schuster 
> :
> 
> Use a textbackground to highlight parts of your text.
> 
> \definetextbackground
>  [Highlight]
>  [frame=off,
>   background=color,
>   backgroundcolor=yellow]
> 
> \starttext
> 
> \m{1 + 2 = \unit{3 kilo newton}}
> 
> \m{1 + 2 = \Highlight{\unit{3 kilo newton}}}
> 
> \stoptext
> 
> Wolfgang
> 

Is there a way to highlight just the words and leave the space white?
Something like \overstrikes?

Greetings
Axel
___
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
___


Re: [NTG-context] Changed behavior of ^^ in csname

2020-06-11 Thread Marcel Fabian Krüger
On Thu, Jun 11, 2020 at 10:07:34AM +0200, Hans Hagen wrote:
> On 6/11/2020 4:06 AM, Marcel Fabian Krüger wrote:
> > Hi,
> > 
> > I noticed that in the latest LMTX version, ^^ (with ^ of catcode 7)
> > is no longer interpreted inside csnames. Is this intentional?
> > 
> > (Example:
> > 
> > \starttext
> > \catcode\circumflexasciicode=\superscriptcatcode% Ensure correct catcodes
> > 
> > \show ^^41 % This still works and shows "> the letter A"
> > 
> > \show^^41 % This used to be an error "Undefined control sequence \showA",
> >% now show "> The letter A"
> > 
> > \show\^^41 % Used to show "> \A=undefined", now shows "> 
> > \^=macro:->\enco_handle_accent {^}"
> > % and "! Missing $ inserted"
> > \stoptext
> > 
> > )
> Indeed that is intentional because in lmtx we disable them (partially). You
> have to say:
> 
> \normalsupmarkmode\zerocount % we use 1 as default in lmtx

Hi,

shouldn't \supmarkmode=1 only disable these in math mode?
In any case, \normalsupmarkmode\zerocount doesn't make a difference
here:

\starttext
\normalsupmarkmode\zerocount
\catcode\circumflexasciicode=\superscriptcatcode% Ensure correct catcodes

\show ^^41 % This still works and shows "> the letter A"

\show^^41 % This used to be an error "Undefined control sequence \showA",
   % now show "> The letter A"

\show\^^41 % Used to show "> \A=undefined", now shows "> 
\^=macro:->\enco_handle_accent {^}"
% and "! Missing $ inserted"
\stoptext

shows exactly the same behavior.


Best regards,
Marcel

> 
> This is because in lmtx we have native prescript support, as in:
> 
>   $ x^{rt}_{rb}^^{lt}__{lb} $
> 
> so, double _ ^ can have a different meaning there.
> 
> Hans
> 
> 
> -
>   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
___


Re: [NTG-context] using modeset

2020-06-11 Thread Wolfgang Schuster

Jan Willem Flamma schrieb am 11.06.2020 um 10:41:

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’m 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.


Duplication is unavoidable but it would make sense to try and re-use the 
existing structural elements such as \startsection \startsubsection 
\placefigure etc as much as possible. After all, only the title and 
caption text needs to be translated.


I tried doing this but in the case of \startchapter using a \doifmode 
but the PDF bookmarks text is not correctly generated.


You need

\enabledirectives[references.bookmarks.preroll]

in your setup files to get the correct text in the bookmarks.

I also tried placing a figure in between 2 modeset cases but this does 
not work.


See attached .tex file.


A alternative to modes is the selector mechanism to choose between 
different arguments.


\setupinteraction[state=start]

\placebookmarks

\enabledirectives[references.bookmarks.preroll]

\defineselector [language] [max=2,n=1]

\startmode[en]
\setupselector[language][n=1]
\stopmode

\startmode[nl]
\setupselector[language][n=2]
\stopmode

\starttext

\placecontent

\section{\select{language}{English section title}{Dutch section title}}

\startplacefigure[title=\select{language}{English float title}{Dutch 
float title}]

\externalfigure[dummy]
\stopplacefigure

\stoptext

Finally in the attached PDF below, I noticed that a double space appears 
depending on the position of the text and curly bracket. Is this intended?


Yes because you add spaces between the braces and the text which appear 
in the output.


\startmodeset
[...] {
...
}
[...] {
...
}
\stopmodeset


Questions:

  * Is the modeset mechanism indeed the best way forward or are there
better ways to achieve the desired outcome?
  * How can I re-use the existing ConTeXt code as much as possible and
still have the correct English and Dutch title and caption text for
all the structural elements and floats.


There are different ways with pros and contras:

  - But the english and dutch texts for each section in separate files
  - Use buffers for each paragraph and load the one you need
  - Store the texts in variables and flush the ones you need
  - Use XML as input and tags your texts which you can filter
  - ...

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
___


[NTG-context] using modeset

2020-06-11 Thread Jan Willem Flamma
 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’m 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. Duplication is unavoidable but it would make sense to try and re-use the existing structural elements such as \startsection \startsubsection \placefigure etc as much as possible. After all, only the title and caption text needs to be translated.I tried doing this but in the case of \startchapter using a \doifmode but the PDF bookmarks text is not correctly generated. I also tried placing a figure in between 2 modeset cases but this does not work.See attached .tex file. Finally in the attached PDF below, I noticed that a double space appears depending on the position of the text and curly bracket. Is this intended? Questions:Is the modeset mechanism indeed the best way forward or are there better ways to achieve the desired outcome?How can I re-use the existing ConTeXt code as much as possible and still have the correct English and Dutch title and caption text for all the structural elements and floats. Kind regards,Jan Willem Flamma

test_modeset.pdf
Description: Adobe PDF document


test_modeset.tex
Description: Binary data
___
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
___


Re: [NTG-context] Changed behavior of ^^ in csname

2020-06-11 Thread Hans Hagen

On 6/11/2020 4:06 AM, Marcel Fabian Krüger wrote:

Hi,

I noticed that in the latest LMTX version, ^^ (with ^ of catcode 7)
is no longer interpreted inside csnames. Is this intentional?

(Example:

\starttext
\catcode\circumflexasciicode=\superscriptcatcode% Ensure correct catcodes

\show ^^41 % This still works and shows "> the letter A"

\show^^41 % This used to be an error "Undefined control sequence \showA",
   % now show "> The letter A"

\show\^^41 % Used to show "> \A=undefined", now shows "> 
\^=macro:->\enco_handle_accent {^}"
% and "! Missing $ inserted"
\stoptext

)
Indeed that is intentional because in lmtx we disable them (partially). 
You have to say:


\normalsupmarkmode\zerocount % we use 1 as default in lmtx

This is because in lmtx we have native prescript support, as in:

  $ x^{rt}_{rb}^^{lt}__{lb} $

so, double _ ^ can have a different meaning there.

Hans


-
  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
___