Re: [NTG-context] Flushleft formula

2016-06-16 Thread Aditya Mahajan

On Thu, 16 Jun 2016, Alan BRASLAU wrote:


On Thu, 16 Jun 2016 18:18:58 -0400
Aditya Mahajan  wrote:


And some stage, it will be nice to discuss the possiblility of adding
background to formulas, especially aligned formulas.


something like a

\setupformula
 [before={\startframedtext[background=color,backgroundcolor=lightblue]},
  after={\stopframedtext}]


One typically wants to have a bounding box around the displayed math, but 
not the white space or the equation number. For example, see the attached 
image.


Aditya___
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] Flushleft formula

2016-06-16 Thread Alan BRASLAU
On Thu, 16 Jun 2016 18:18:58 -0400
Aditya Mahajan  wrote:

> And some stage, it will be nice to discuss the possiblility of adding 
> background to formulas, especially aligned formulas.

something like a

\setupformula
  [before={\startframedtext[background=color,backgroundcolor=lightblue]},
   after={\stopframedtext}]

?

("untested")

Alan
___
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] Latin setupmathematics

2016-06-16 Thread Alan BRASLAU
On Fri, 17 Jun 2016 01:02:48 +0200
Hans Åberg  wrote:

> The idea is avoiding clashes between variables and constants, like
> this:
> 
> \starttext
> 
> \setupmathematics[default=normal]
> 
> $푒 = ∑_{푖=1}^∞ e^{i-푖}$
> 
> \setupmathematics[default=italic]
> 
> $푒 = ∑_{푖=1}^∞ e^{i-푖}$

Very, very poor mathematical style...

If you really want to use a variable "e", this would call for the use
of the function \exp() to be readable.

Alan
___
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] Latin setupmathematics

2016-06-16 Thread Hans Åberg

> On 16 Jun 2016, at 23:48, Hans Hagen  wrote:
> 
> On 6/16/2016 9:15 PM, Hans Åberg wrote:

>> There were no responses from the consortium here, so it means that if one 
>> should stick to the Unicode model, where the upright styles are unified with 
>> the Basic Latin and Greek groups, \setupmathematics should have options 
>> added like:
>>  lcletters=[normal|italic], ucletters=[normal|italic]

> (i see no reason for different treatment for lc and uc)

No, there is no reason - I just got it from math-inl.mkiv.

> what is wrong with
> 
> \starttext
> 
> \setupmathematics[default=normal]
> 
> $a = b$
> 
> \setupmathematics[default=italic]
> 
> $a = \tf b$
> 
> \stoptext

That is fine - it is not mentioned on the page
  http://wiki.contextgarden.net/Command/setupmathematics

The idea is avoiding clashes between variables and constants, like this:

\starttext

\setupmathematics[default=normal]

$푒 = ∑_{푖=1}^∞ e^{i-푖}$

\setupmathematics[default=italic]

$푒 = ∑_{푖=1}^∞ e^{i-푖}$

\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] Flushleft formula

2016-06-16 Thread Aditya Mahajan

On Thu, 16 Jun 2016, Hans Hagen wrote:


On 6/16/2016 6:58 PM, Aditya Mahajan wrote:

 Hi,

 Something has changed with respect to the align=flushleft option for
 formulas. Earlier (tested with 2016.05.08), align=flushleft did not
 remove the leftskip, but now it does.


it doesn't but somehow it's not effective

(indeed spacing was updated, some more - future - possibilities and bester 
handling in boxes and such)


And some stage, it will be nice to discuss the possiblility of adding 
background to formulas, especially aligned formulas. Similar to some of 
the examples in 
http://texdoc.net/texmf-dist/doc/latex/mathtools/empheq.pdf



 Consider the following example:

 \showframe
 \setupitemize[margin=6em]
 \setupformula[align=flushleft]

 \starttext
 \startitemize
   \item An equation inside an itemize
 \startformula
   E = mc^2
 \stopformula
 \stopitemize
 \stoptext

 The output of 2016.05.06 is attached as test-old.pdf; that of 2016.06.16
 is attached as test-new.pdf

 Is it possible to revert to the old behavior?


can you test with

  \hskip\d_strc_formulas_display_margin_left % was kern but that doesn't 
indent


line 1153 in math-ali.mkiv


I guess you already added it to the new beta. It works correctly.

Thanks,
Aditya
___
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] Latin setupmathematics

2016-06-16 Thread Hans Hagen

On 6/16/2016 9:15 PM, Hans Åberg wrote:



On 15 May 2016, at 22:06, Hans Åberg  wrote:


On 15 May 2016, at 20:42, Hans Hagen  wrote:

On 5/15/2016 8:31 PM, Hans Åberg wrote:



also, the lack of an upright alphabet in unicode will always make some 'x' in 
the input either math of text so one also needs to indicate where math starts 
and ends


As far as Unicode is concerned, the ASCII and Greeks ranges are the upright 
ones. But those ranges will be used for math italic as long as there are no 
efficient input methods. Designing ones own keyboard map is a chore with so 
many math styles.


well, law, week i heard about emoticons in different colors as well as gender 
so maybe some day we will have a math upright alphabet to distinguish it from 
regular latin


Doubt it, but I am checking it out:
http://unicode.org/pipermail/unicode/2016-May/003632.html


There were no responses from the consortium here, so it means that if one 
should stick to the Unicode model, where the upright styles are unified with 
the Basic Latin and Greek groups, \setupmathematics should have options added 
like:
  lcletters=[normal|italic], ucletters=[normal|italic]


what is wrong with

\starttext

\setupmathematics[default=normal]

$a = b$

\setupmathematics[default=italic]

$a = \tf b$

\stoptext

(i see no reason for different treatment for lc and uc)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Flushleft formula

2016-06-16 Thread Hans Hagen

On 6/16/2016 6:58 PM, Aditya Mahajan wrote:

Hi,

Something has changed with respect to the align=flushleft option for
formulas. Earlier (tested with 2016.05.08), align=flushleft did not
remove the leftskip, but now it does.


it doesn't but somehow it's not effective

(indeed spacing was updated, some more - future - possibilities and 
bester handling in boxes and such)



Consider the following example:

\showframe
\setupitemize[margin=6em]
\setupformula[align=flushleft]

\starttext
\startitemize
  \item An equation inside an itemize
\startformula
  E = mc^2
\stopformula
\stopitemize
\stoptext

The output of 2016.05.06 is attached as test-old.pdf; that of 2016.06.16
is attached as test-new.pdf

Is it possible to revert to the old behavior?


can you test with

   \hskip\d_strc_formulas_display_margin_left % was kern but that 
doesn't indent


line 1153 in math-ali.mkiv

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Latin setupmathematics

2016-06-16 Thread Hans Åberg

> On 15 May 2016, at 22:06, Hans Åberg  wrote:
> 
>> On 15 May 2016, at 20:42, Hans Hagen  wrote:
>> 
>> On 5/15/2016 8:31 PM, Hans Åberg wrote:

 also, the lack of an upright alphabet in unicode will always make some 'x' 
 in the input either math of text so one also needs to indicate where math 
 starts and ends
>>> 
>>> As far as Unicode is concerned, the ASCII and Greeks ranges are the upright 
>>> ones. But those ranges will be used for math italic as long as there are no 
>>> efficient input methods. Designing ones own keyboard map is a chore with so 
>>> many math styles.
>> 
>> well, law, week i heard about emoticons in different colors as well as 
>> gender so maybe some day we will have a math upright alphabet to distinguish 
>> it from regular latin
> 
> Doubt it, but I am checking it out:
> http://unicode.org/pipermail/unicode/2016-May/003632.html

There were no responses from the consortium here, so it means that if one 
should stick to the Unicode model, where the upright styles are unified with 
the Basic Latin and Greek groups, \setupmathematics should have options added 
like:
  lcletters=[normal|italic], ucletters=[normal|italic]


___
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] Flushleft formula

2016-06-16 Thread Aditya Mahajan

Hi,

Something has changed with respect to the align=flushleft option for 
formulas. Earlier (tested with 2016.05.08), align=flushleft did not remove 
the leftskip, but now it does.


Consider the following example:

\showframe
\setupitemize[margin=6em]
\setupformula[align=flushleft]

\starttext
\startitemize
  \item An equation inside an itemize
\startformula
  E = mc^2
\stopformula
\stopitemize
\stoptext

The output of 2016.05.06 is attached as test-old.pdf; that of 2016.06.16 
is attached as test-new.pdf


Is it possible to revert to the old behavior?

Thanks,
Aditya

test-new.pdf
Description: Adobe PDF document


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

Re: [NTG-context] ntg-context Digest, Vol 144, Issue 16

2016-06-16 Thread Christoph Reller
On Thu, 9 Jun 2016 10:43:50, Christoph Reller
 wrote:
> ...
>
> Hence, the check mark cannot be copy pasted from the PDF.
>
> I fear this may be a bug. Or am I missing something? Any feedback is
> welcome.

Thank you very much for having fixed this issue, Hans!

Cheers, Christoph
___
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] placetable with location=split produces error

2016-06-16 Thread Christoph Reller
On Fri, 10 Jun 2016 14:00:01, Christoph Reller
 wrote:
> On Thu, 09 Jun 2016 10:08:24, Christoph Reller
>  wrote:
>> \starttext
>>   \dorecurse{9}{\input ward}
>>   \startplacetable[location=split]
>> \bTABLE
>>   \bTR \bTD \input tufte \eTD \eTR
>> \eTABLE
>>   \stopplacetable
>> \stoptext
>>
>> The error message is:
>>
>> ! Undefined control sequence
>>  ...ixednumber {\currentfloat }\currentfloatnumber
>>   \relax
>> \thecurrentfloatnum...
>> \flushbothlabelclass #1#2#3->#1#3
>>  #2
>> \namedtaggedlabeltexts ...\dostarttagged {#1}{#2}}
>>   \dostoptagged \endgroup
>> \thecurrentfloatnumber ...rentfloatnumbersuffix }}
>>   \fi \fi \fi
>> \strc_floats_make_complete_caption ...floatnumber
>>   }\ifnofloatcaption \else
>> \...
>> \strc_floats_check_caption_content ...ete_caption
>>   }\ifdim \wd
>> \b_strc_floats...
>> ...
>
> I have some additional information:
>

This must have something to do with page breaking in conjunction with
table splitting. The following MWE produces no error:

\starttext
  \dorecurse{9}{\input ward}
  \testpage[10]
  \startplacetable[location=split]
\bTABLE
  \bTR \bTD \input tufte \eTD \eTR
\eTABLE
  \stopplacetable
\stoptext

On the other hand the following MWE produces the error, and of course
here, a testpage will not help:

\starttext
  \dorecurse{11}{\input ward}
  \pagebreak[disable]
  \placetable[split]{}{
\bTABLE
\bTR \bTD Ups \eTD \eTR
\eTABLE
  }
\stoptext

This is a long standing issue and I would very much appreciate any
comment on this.
Thank you in advance for any contribution,
Christoph
___
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] passing the \starttabulate format in XML typesetting

2016-06-16 Thread massifr
Hello list,
I'm trying to map HTML with tabs to \starttabulate in ConTeXt.
A div of class "tabulate" is mapped to a \starttabulate ... \stoptabulate 
section,
p elements are rows and span elements of class "tab" produce \NCs in ConTeXt.
That div element has a "format" attribute that must be passed to 
\starttabulate[...]
to format the columns.

I managed to pass that attribute using lua, but I failed using only ConTeXt:

\startbuffer[test]

  
a b c
  

\stopbuffer

\startxmlsetups xml:somesetups
  \xmlsetsetup{#1}{text}{xml:text}
  \xmlsetsetup{#1}{div[@class='tabulate']}{xml:div:tabulate}
  \xmlsetsetup{#1}{div[@class='tabulate']/p}{xml:div:tabulate:p}
  
\xmlsetsetup{#1}{div[@class='tabulate']/p/span[@class='tab']}{xml:div:tabulate:p:tab}
\stopxmlsetups

\xmlregistersetup{xml:somesetups}

\startxmlsetups xml:text
  \indenting[{yes,first,12pt}]
  \xmlflush{#1}
\stopxmlsetups

\setuptabulation[rulethickness=1pt,unit=2pt]

\ctxlua{
function xml.functions.divTabulate(t)
  local format = xml.attribute(t, "", "format")
  context.starttabulate( { format } )
  lxml.flush(t)
  context.stoptabulate()
end
}

\startxmlsetups xml:div:tabulate
%  \xmlfunction{#1}{divTabulate}  % this works!
% the following line can't pass the format correctly to ConTeXt
  \starttabulate[{\xmlatt{#1}{format}}]
\xmlflush{#1}
  \stoptabulate
\stopxmlsetups

\startxmlsetups xml:div:tabulate:p
  \NC{}\xmlflush{#1}\NC\NR
\stopxmlsetups

\startxmlsetups xml:div:tabulate:p:tab
  \NC{}
\stopxmlsetups

\starttext
  \xmlprocessbuffer{main}{test}{}
\stoptext

I suspect it's a simple mistake of mine.
Thanks in advance,
Massi
___
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
___