Re: [NTG-context] Math alignment

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 21:49, Wolfgang Schuster  
> wrote:

> You should google for mathalign.pdf which explains and shows examples for the 
> matrix, cases etc. environments.

It looks rather basic, except for last formula of section 9. 

The document amshelp.pdf, ch. 7, has some nice pure math style examples.


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 21:49, Wolfgang Schuster  
> wrote:

> You should google for mathalign.pdf which explains and shows examples for the 
> matrix, cases etc. environments.
> 
> To get the same result as your LaTeX example you can use the m key for 
> \startalign.
> 
> \starttext
> 
> \startformula
> \startalign[m=3,distance=3em]
> \NC K \NC \approx G * H\NC  i   \NC = j+k 
> \NC B \NC \subset C  \NR
> \NC H \NC \approx A_{0}*B_{0}  \NC  i'  \NC = j'+k'   
> \NC C \NC = D\cap E  \NR
> \NC G \NC \approx \coprod_{\alpha\in A} L_{\alpha} \NC  i'' \NC  =j''+k'' 
> \NC A \NC = D \cup E \NR
> \stopalign
> \stopformula
> 
> \stoptext

That is where I started - it does not work with \left\{ … \right. :-)


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Wolfgang Schuster



Hans Aberg 
7. Juli 2015 21:11

On 7 Jul 2015, at 20:17, Wolfgang Schuster  wrote:



You can set the alignment for each column in a matrix with the align key.


FYI, the document amshelp.pdf says that AMS-LaTeX environments align, align*, 
and aligned, can have multiple alignments, and gives this example:
\begin{align*}
   K&\approx G * H&i&= j+k&   B&\subset C\\
   H&\approx A_{0}*B_{0}&   i’&= j’+k’&   C&= D\cap E\\
   G&\approx \coprod_{\alpha\in A} L_{\alpha}&   i’’&=j’’+k’’&  A&= D \cup E
\end{align*}
which is typeset so that 'K&\approx G * H’ is one equation aligned on the ‘&’ with 
the others below, followed by 'i&= j+k’ in the next column.

So the ampersands have multiple functions here, it seems: alignment and 
separating columns.

Translating into ConTeXt, one might have (pseudocode):
\startformula
   \startalign
 \NC K \NA \approx G * H \NC  i\NA= j+k \NC B \NA \subset C \NR
 \NC H \NA \approx A_{0}*B_{0} \NC   i’\NA= j’+k’ \NC   C \NA = D\cap E\NR
 \NC G \NA \approx \coprod_{\alpha\in A} L_{\alpha}
   \NC   i’’\NA =j’’+k’’ \NC  A \NA = D \cup E \NR
   \stopalign
\stopformula
where I have introduce a symbol \NA for alignment.

You should google for mathalign.pdf which explains and shows examples 
for the matrix, cases etc. environments.


To get the same result as your LaTeX example you can use the m key for 
\startalign.


\starttext

\startformula
\startalign[m=3,distance=3em]
\NC K \NC \approx G * H\NC  i   \NC = 
j+k \NC B \NC \subset C  \NR
\NC H \NC \approx A_{0}*B_{0}  \NC  i'  \NC = 
j'+k'   \NC C \NC = D\cap E  \NR
\NC G \NC \approx \coprod_{\alpha\in A} L_{\alpha} \NC  i'' \NC  
=j''+k'' \NC A \NC = D \cup E \NR

\stopalign
\stopformula

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 21:18, Wolfgang Schuster  
> wrote:

>> I have also put in an extra alignment to see what happens, monospace code 
>> alignment style. Changing ‘left’ to ‘right did not seem to have any effect 
>> here.
>> 
> Can you see the effect of the alignment?
> 
> \starttext
> 
> \startformula
> \startmatrix[align={left,middle,right}]
> \NC a   \NC b   \NC c   \NR
> \NC aa  \NC bb  \NC cc  \NR
> \NC aaa \NC bbb \NC ccc \NR
> \stopmatrix
> \stopformula
> 
> \stoptext

Thanks. I know that example. I just noticed it seemed to have no effect in the 
other example, for some reason.


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Wolfgang Schuster




Hans Aberg 
7. Juli 2015 20:53

On 7 Jul 2015, at 20:17, Wolfgang Schuster  wrote:



You can set the alignment for each column in a matrix with the align key.

\definemathmatrix
   [aligned]
   [n=2,
align={right,left},
distance=\spaceamount]

\starttext

\startformula
 J^j:
 \startaligned[left=\left\{,right=\right.]
 \NC ω^0 \NC ↦ 0 \NR
 \NC ω^j \NC ↦ 0 \NR
 \stopaligned
 \quad
 \startaligned[n=3,align={right,middle,left},left=\left\{,right=\right.]
 \NC ω^k \NC ↦ \NC  ω^l \NR
 \NC ω^l \NC ↦ \NC -ω^k \NR
 \stopaligned
\stopformula

\stoptext


That looks like the right thing. Thanks.

Your example is quite close to TeX, cf. example below.

I have also put in an extra alignment to see what happens, monospace code 
alignment style. Changing ‘left’ to ‘right did not seem to have any effect here.


Can you see the effect of the alignment?

\starttext

\startformula
\startmatrix[align={left,middle,right}]
\NC a   \NC b   \NC c   \NR
\NC aa  \NC bb  \NC cc  \NR
\NC aaa \NC bbb \NC ccc \NR
\stopmatrix
\stopformula

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 20:17, Wolfgang Schuster  
> wrote:

> You can set the alignment for each column in a matrix with the align key.

FYI, the document amshelp.pdf says that AMS-LaTeX environments align, align*, 
and aligned, can have multiple alignments, and gives this example:
\begin{align*}
  K &\approx G * H&   i&= j+k&  B &\subset C\\
  H &\approx A_{0}*B_{0}&  i’&= j’+k’&  C &= D\cap E\\
  G &\approx \coprod_{\alpha\in A} L_{\alpha}&  i’’&=j’’+k’’& A &= D \cup E
\end{align*}
which is typeset so that 'K &\approx G * H’ is one equation aligned on the ‘&’ 
with the others below, followed by 'i&= j+k’ in the next column.

So the ampersands have multiple functions here, it seems: alignment and 
separating columns.

Translating into ConTeXt, one might have (pseudocode):
\startformula
  \startalign
\NC K \NA \approx G * H \NC  i\NA= j+k \NC B \NA \subset C \NR
\NC H \NA \approx A_{0}*B_{0} \NC   i’\NA= j’+k’ \NC   C \NA = D\cap E\NR
\NC G \NA \approx \coprod_{\alpha\in A} L_{\alpha}
  \NC   i’’\NA =j’’+k’’ \NC  A \NA = D \cup E \NR
  \stopalign
\stopformula
where I have introduce a symbol \NA for alignment.


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 20:17, Wolfgang Schuster  
> wrote:

> You can set the alignment for each column in a matrix with the align key.
> 
> \definemathmatrix
>   [aligned]
>   [n=2,
>align={right,left},
>distance=\spaceamount]
> 
> \starttext
> 
> \startformula
> J^j:
> \startaligned[left=\left\{,right=\right.]
> \NC ω^0 \NC ↦ 0 \NR
> \NC ω^j \NC ↦ 0 \NR
> \stopaligned
> \quad
> \startaligned[n=3,align={right,middle,left},left=\left\{,right=\right.]
> \NC ω^k \NC ↦ \NC  ω^l \NR
> \NC ω^l \NC ↦ \NC -ω^k \NR
> \stopaligned
> \stopformula
> 
> \stoptext

That looks like the right thing. Thanks.

Your example is quite close to TeX, cf. example below.

I have also put in an extra alignment to see what happens, monospace code 
alignment style. Changing ‘left’ to ‘right did not seem to have any effect here.


\definemathmatrix
  [aligned]
  [n=2,
   align={right,left},
   distance=\spaceamount]

\starttext

\startformula
  J^j:
  \startaligned[left=\left\{,right=\right.]
\NC ω^0 \NC ↦ 0 \NR
\NC ω^j \NC ↦ 0 \NR
  \stopaligned
  \quad
  \startaligned[n=3,align={right,middle,left},left=\left\{,right=\right.]
\NC ω^k \NC ↦ \NC  \NC ω^l \NR
\NC ω^l \NC ↦ \NC -\NC ω^k \NR
  \stopaligned
\stopformula


\def\equlb#1{\left\{\eqalign{#1}\right.} %equation left braced

\startformula
 J^j:\equlb{ω^0 &↦ 0 \cr ω^j &↦ 0} \quad
 \equlb{ω^k &↦ ω^l \cr ω^l &↦ -ω^k} \stopformula

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Wolfgang Schuster




Hans Aberg 
7. Juli 2015 18:23

On 7 Jul 2015, at 16:47, Wolfgang Schuster  wrote:



I get errors when using \MC - see example below.


The \NR before \stopmathcases is missing in all your examples.


OK. Though I know it, it is hard to get used to, coming from LaTeX.


But the spacing is wrong: too much between the two components. These are not 
cases, but aligned formulas: one might have a number of alignments, not just 
one. And I just happen to use left braces on them.


Take a look at my previous example where I changed the distance between both 
columns with the distance key.


I missed that. It fixes the spaces within the formula, but adds space between 
the two sets relative both TeX and AMS-LaTeX (which has about the same as TeX), 
cf. example below.

In AMS-LaTeX one can have more than one alignment, though when trying it 
between the “-“ and the “ω” in the second (right-most) set, it adds a lot of 
space, rather than just trying to align a compactly as possible. In ConTeXt, 
nothing happens with extra alignments; in TeX, there is an error.

So using \startmathcases is a workaround: trying to force it to do something it 
wasn’t intended for.

You can set the alignment for each column in a matrix with the align key.

\definemathmatrix
  [aligned]
  [n=2,
   align={right,left},
   distance=\spaceamount]

\starttext

\startformula
J^j:
\startaligned[left=\left\{,right=\right.]
\NC ω^0 \NC ↦ 0 \NR
\NC ω^j \NC ↦ 0 \NR
\stopaligned
\quad
\startaligned[n=3,align={right,middle,left},left=\left\{,right=\right.]
\NC ω^k \NC ↦ \NC  ω^l \NR
\NC ω^l \NC ↦ \NC -ω^k \NR
\stopaligned
\stopformula

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 16:47, Wolfgang Schuster  
> wrote:

>> I get errors when using \MC - see example below.
>> 
> The \NR before \stopmathcases is missing in all your examples.

OK. Though I know it, it is hard to get used to, coming from LaTeX.

>> But the spacing is wrong: too much between the two components. These are not 
>> cases, but aligned formulas: one might have a number of alignments, not just 
>> one. And I just happen to use left braces on them.
>> 
> Take a look at my previous example where I changed the distance between both 
> columns with the distance key.

I missed that. It fixes the spaces within the formula, but adds space between 
the two sets relative both TeX and AMS-LaTeX (which has about the same as TeX), 
cf. example below.

In AMS-LaTeX one can have more than one alignment, though when trying it 
between the “-“ and the “ω” in the second (right-most) set, it adds a lot of 
space, rather than just trying to align a compactly as possible. In ConTeXt, 
nothing happens with extra alignments; in TeX, there is an error.

So using \startmathcases is a workaround: trying to force it to do something it 
wasn’t intended for.


\starttext

\def\equlb#1{\left\{\eqalign{#1}\right.} %equation left braced

\startformula
 J^j:\startmathcases[distance=\spaceamount]\NC ω^0 \MC ↦ 0 \NR \NC ω^j \MC ↦ 0 
\NR \stopmathcases \quad
  \startmathcases[distance=\spaceamount] \NC ω^k \MC ↦ \MC ω^l \NR \NC ω^l \MC 
↦ -\MC ω^k \NR \stopmathcases
\stopformula

\startformula
 J^j:\equlb{ω^0 &↦ 0 \cr ω^j &↦ 0} \quad
 \equlb{ω^k &↦ ω^l \cr ω^l &↦ -ω^k} \stopformula

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] hyphenation exceptions?

2015-07-07 Thread Meer, H. van der
Indeed, the combination Amsterdam-Buitenveldert is the culprit.
The solution therefore is to use (it is ConTeXt afterall) 
Amsterdam|-|Buitenveldert, then the word Amsterdam doesn't even needs an 
exception.
Thanks for the help.

Hans van der Meer


On 07 Jul 2015, at 18:00, Pablo Rodriguez mailto:oi...@gmx.es>> 
wrote:

On 07/07/2015 05:41 PM, Arthur Reutenauer wrote:
[...]
 That's because the word you're trying to hyphenate is
"Amsterdam-Buitenveldert", not "Amsterdam".  Compound words are by
default hyphenated only at the hyphen in TeX.

\setbreakpoints[compound] works in the following sample:

   \language[nl]
   \setbreakpoints[compound]
   \starttext
   \hyphenatedword{Amsterdam--Buitenveldert}
   \stoptext

I don’t know whether it would make sense to use an en-dash for compound
words in Dutch.

I hope it helps now,


Pablo

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] hyphenation exceptions?

2015-07-07 Thread Pablo Rodriguez
On 07/07/2015 05:41 PM, Arthur Reutenauer wrote:
> [...]
>   That's because the word you're trying to hyphenate is
> "Amsterdam-Buitenveldert", not "Amsterdam".  Compound words are by
> default hyphenated only at the hyphen in TeX.

\setbreakpoints[compound] works in the following sample:

\language[nl]
\setbreakpoints[compound]
\starttext
\hyphenatedword{Amsterdam--Buitenveldert}
\stoptext

I don’t know whether it would make sense to use an en-dash for compound
words in Dutch.

I hope it helps now,


Pablo
-- 
http://www.ousia.tk
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] hyphenation exceptions?

2015-07-07 Thread Arthur Reutenauer
On Tue, Jul 07, 2015 at 03:29:11PM +, Meer, H. van der wrote:
> The \hyphenatedword works here too. But it does not work out when the word 
> Amsterdam occurs in the text. See tthe two examples. In the first Amsterdam 
> is not broken according to the \hyphenation{Am-ster-dam}-rule. In the second 
> example the linebreak is forced by the explicit use of Am\-ster\-dam in the 
> source text.

  That's because the word you're trying to hyphenate is
"Amsterdam-Buitenveldert", not "Amsterdam".  Compound words are by
default hyphenated only at the hyphen in TeX.

Arthur
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] hyphenation exceptions?

2015-07-07 Thread Meer, H. van der
The \hyphenatedword works here too. But it does not work out when the word 
Amsterdam occurs in the text. See tthe two examples. In the first Amsterdam is 
not broken according to the \hyphenation{Am-ster-dam}-rule. In the second 
example the linebreak is forced by the explicit use of Am\-ster\-dam in the 
source text.

So it doesn't work when occurring in the text.

[cid:3FCD961E-655E-4A3A-B889-D6CDB564D4F8@dynamic.ziggo.nl]

[cid:2F0C9076-27B7-4CD4-9965-23FC2141A1E6@dynamic.ziggo.nl]

met vriendelijke groet
Hans van der Meer


On 07 Jul 2015, at 16:37, Pablo Rodriguez mailto:oi...@gmx.es>> 
wrote:

On 07/07/2015 03:33 PM, dr. Hans van der Meer wrote:
Has something happened to hyphenation?

The following does not work
\language[nl]
\startexceptions[nl]
Am-ster-dam
\stopexceptions

Neither does\hyphenation{Am-ster-dam}

Hi Hans,

using latest beta from 2015.07.01 21:40, both options work for me:

   \language[nl]
   %~ \startexceptions[nl]
   %~ Ams-terd-am
   %~ \stopexceptions
   \hyphenation{Ams-terd-am}
   \starttext
   \hyphenatedword{Amsterdam}
   \stoptext

BTW, I have to change the hyphenation points, since the proposed
exception is the default hyphenation in Dutch.

Or how did you know that the exceptions weren’t working?

I hope it helps,


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Wolfgang Schuster




Hans Aberg 
7. Juli 2015 10:30

On 7 Jul 2015, at 04:46, Wolfgang Schuster  wrote:


The spacing is different in cases - TeX also has such a variation. 
Specifically, there is extra space before the conditionals.

In addition, it seems \startmathcases ... \stopmathcases is not working with 
UTF-8: in the example below, the ω’s on the second line, after the arrows, 
disappear in my PDF.

This is explained in section 8 of the document:


FYI, the TeX Live 2015 version from 2007 called context-latex-math.pdf does not 
have ch. 8.


 There are two ways of specifying the second column — \MC (Math Column)
 and \NC (New Column). If \MC is used, the second column is in \math mode,
 with \NC it is in ‘text mode’.


I get errors when using \MC - see example below.

The \NR before \stopmathcases is missing in all your examples.

But the spacing is wrong: too much between the two components. These are not 
cases, but aligned formulas: one might have a number of alignments, not just 
one. And I just happen to use left braces on them.

Take a look at my previous example where I changed the distance between 
both columns with the distance key.


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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] hyphenation exceptions?

2015-07-07 Thread Pablo Rodriguez
On 07/07/2015 03:33 PM, dr. Hans van der Meer wrote:
> Has something happened to hyphenation?
> 
> The following does not work
> \language[nl]
> \startexceptions[nl]
> Am-ster-dam
> \stopexceptions
> 
> Neither does\hyphenation{Am-ster-dam}

Hi Hans,

using latest beta from 2015.07.01 21:40, both options work for me:

\language[nl]
%~ \startexceptions[nl]
%~ Ams-terd-am
%~ \stopexceptions
\hyphenation{Ams-terd-am}
\starttext
\hyphenatedword{Amsterdam}
\stoptext

BTW, I have to change the hyphenation points, since the proposed
exception is the default hyphenation in Dutch.

Or how did you know that the exceptions weren’t working?

I hope it helps,


Pablo
-- 
http://www.ousia.tk
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Environments

2015-07-07 Thread Manuel Blanco
Your code in the .sty is a little bit unconventional. In any case, the
most common in LaTeX is to use etoolbox package.

\usepackage{etoolbox}
\newenvironment{env}{whatever goes here}{whatever goes here}
\AtBeginEnvironment{env}{}
\AtEndEnvironment{env}{}
\BeforeBeginEnvironment{}
\AfterEndEnvironment{}
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] hyphenation exceptions?

2015-07-07 Thread dr. Hans van der Meer
Has something happened to hyphenation?

The following does not work
\language[nl]
\startexceptions[nl]
Am-ster-dam
\stopexceptions

Neither does \hyphenation{Am-ster-dam}

Only in the context-source Am\-ster\-dam is working.

How to load a series of hyphenation exceptions instead of explicitely spelling 
out the breakpoints in the source?

Hans van der Meer


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Environments

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 11:05, luigi scarso  wrote:

> For  "LaTeX style environments" do you mean
> e.g.
> https://it.sharelatex.com/learn/Environments
> ?  (just to be sure )

Yes, the \begin{foo} … \end{foo} syntax. Technically, an environment means that 
variables are stacked in a syntactically local group, as in \begingroup … 
\endgroup.

The syntax in the example file is «foo· … ·» or «foo· … ·foo», so one does not 
have to write the ‘start' and ‘stop’ all the time, and does not have to write 
the name of the environment again at the end.

> In this case  context has the \define commands as for example
> http://wiki.contextgarden.net/Command/definetyping

I think this corresponds (in pseudocode) to my
\new{Environment}{typing}%
  {}{}%
  {}{}

In LaTeX, if I remember correctly, it would expand to \begingroup 
… \endgroup.

I added so one can have 
\new{Environment}{typing}%
  {}{}%
  {}{}
expanding to
  \begingroup … \endgroup

So one has more control over designing the environment. One can then also 
define a new environment
\new{Environment}{typingmore}%
  {}{«typing·}%
  {·typing»}{}
I think, to make specializations.

> Context has also 
> http://wiki.contextgarden.net/Command/startenvironment
> but I suppose it's not what you mean.

It looks like just adding a series of command names, rather than a stacked 
environment, or a namespace (module). If one wants to avoid name clashes, one 
can have names like in directory names, living without any local group.


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Environments

2015-07-07 Thread luigi scarso
On Tue, Jul 7, 2015 at 10:49 AM, Hans Aberg  wrote:

> ConTeXt does not seem to have LaTeX style environments. FYI, for the
> latter, I developed [1] a long time ago more advanced ones:
>
> The environments admit hooks, i.e., code executed before and after the
> local group. The name can be omitted in the closing, which works also when
> using one environment to define a new. And a more compact syntax.
>
>
> 1.
> https://secure2.storegate.com/Shares/Home.aspx?ShareID=db8465b3-112f-4194-8909-1d42ff149e32
>
> Compile 'lualatex test0.tex’.
>
>
>
> ___
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___




For  "LaTeX style environments" do you mean
e.g.
https://it.sharelatex.com/learn/Environments
?  (just to be sure )

In this case  context has the \define commands as for example
http://wiki.contextgarden.net/Command/definetyping

Context has also
http://wiki.contextgarden.net/Command/startenvironment
but I suppose it's not what you mean.

-- 
luigi
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Environments

2015-07-07 Thread Hans Aberg
ConTeXt does not seem to have LaTeX style environments. FYI, for the latter, I 
developed [1] a long time ago more advanced ones:

The environments admit hooks, i.e., code executed before and after the local 
group. The name can be omitted in the closing, which works also when using one 
environment to define a new. And a more compact syntax.


1. 
https://secure2.storegate.com/Shares/Home.aspx?ShareID=db8465b3-112f-4194-8909-1d42ff149e32

Compile 'lualatex test0.tex’.


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math alignment

2015-07-07 Thread Hans Aberg

> On 7 Jul 2015, at 04:46, Wolfgang Schuster  
> wrote:
> 
>> The spacing is different in cases - TeX also has such a variation. 
>> Specifically, there is extra space before the conditionals.
>> 
>> In addition, it seems \startmathcases ... \stopmathcases is not working with 
>> UTF-8: in the example below, the ω’s on the second line, after the arrows, 
>> disappear in my PDF. 
> This is explained in section 8 of the document:

FYI, the TeX Live 2015 version from 2007 called context-latex-math.pdf does not 
have ch. 8.

> There are two ways of specifying the second column — \MC (Math Column)
> and \NC (New Column). If \MC is used, the second column is in \math mode,
> with \NC it is in ‘text mode’.

I get errors when using \MC - see example below.

But the spacing is wrong: too much between the two components. These are not 
cases, but aligned formulas: one might have a number of alignments, not just 
one. And I just happen to use left braces on them.


\starttext

\startformula
 J^j:\startmathcases\NC ω^0 \MC → 0 \NR \NC ω^j \MC → 0 \stopmathcases \quad
  \startmathcases \NC ω^k \MC → ω^l \NR \NC ω^l \MC → -ω^k \stopmathcases
\stopformula

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___