Re: [NTG-context] Issues with RGB to CMYK conversion with color profiles (was: Colormanagement)

2018-11-14 Thread Peter Rolf
Hi Jan,

I donno if things have changed (ConTeXt is a fast moving target), so
take my answers with a grain of salt.

(1)
AFAIK there is no ACTIVE color management in ConTeXt in the sense that
there is an automatic color conversion from one profiled(!) colorspace
into another profiled color space. This means that all given colors
(objects) have to be in the correct (profiled) color space already!

Objects with embedded color profiles (e.g. a PDF bitmap graphic with icc
profile) will use those. Objects without a profile will use the
corresponding "default" color space profiles. These default color space
profiles can be defined via "profile" in \setupbackend.
This way every color in the PDF is defined properly.


(2)

I think so. Can't test, because my Windows 10 is beyond repair after
three "upgrades" and Acrobat is not working properly anymore.

(3)

Judging from the size of the final PDF, the icc profile is not embedded.
The profiles have to be installed in "the right place" (this includes
ConTeXt but also the PDF viewer software).

See "ICC profiles" section at

https://wiki.contextgarden.net/PDFX


(5) see (1) and (3)



Hope this helps,


Peter


Am 2018-11-14 um 11:39 schrieb Jan U. Hasecke:
> Hi all,
> 
> attached you find my colormanagement tests and I need your help to
> understand and debug the situation.
> 
> I am testing together with a friend of mine, a professional
> colormanager, who does not know ConTeXt.
> 
> 
> There are several files in the archive:
> 
> The differences in the files are the color definition and the color
> profile used.
> 
> - rgb-xxx.tex – colors are defined with RGB values only.
> 
> - rgb-cmyk-xxx.tex – colors are defined with RGB and CMYK values.
> 
>   The cmyk colors are derived from the rgb values using gimp and the
>   color profiles sRGB/ISOCoated
> 
> - cmyk-xxx.tex – colors are defined with CMYK values only.
> 
> The xxx stand for two color profiles: iso-coated and swop.
> 
> What I see is this:
> 
> Colors in pdfs are the same no matter what color profile I choose.
> 
> With rgb values and rgb/cmyk values I get the same colors in pdf (the
> wrong ones).
> 
> With cmyk values only I get other colors in pdf. Next week my friend
> will test if these are the right ones.
> 
> I have many questions:
> 
> 1. Is colormanagement working in ConTeXt at all?
> 2. Is my code correct?
> 3. Why do pdfs with different color profiles show the same colors?
> 4. Why does ConTeXt not take the cmyk colors from \definecolor when
> there are rgb values as well?
> 5. Where can I define a coresponding rgb profile? In Scribus you have to
> define two profiles (eg. sRGB and ISOCoated) to make colormanagement work.
> 
> TIA
> juh
> ___
> 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
___

Re: [NTG-context] Issues with RGB to CMYK conversion with color profiles (was: Colormanagement)

2018-11-14 Thread Jan U. Hasecke
I forgot the archive. :-(

Am 14.11.18 um 11:39 schrieb Jan U. Hasecke:
> Hi all,
> 
> attached you find my colormanagement tests and I need your help to
> understand and debug the situation.
> 
> I am testing together with a friend of mine, a professional
> colormanager, who does not know ConTeXt.
> 
> 
> There are several files in the archive:
> 
> The differences in the files are the color definition and the color
> profile used.
> 
> - rgb-xxx.tex – colors are defined with RGB values only.
> 
> - rgb-cmyk-xxx.tex – colors are defined with RGB and CMYK values.
> 
>   The cmyk colors are derived from the rgb values using gimp and the
>   color profiles sRGB/ISOCoated
> 
> - cmyk-xxx.tex – colors are defined with CMYK values only.
> 
> The xxx stand for two color profiles: iso-coated and swop.
> 
> What I see is this:
> 
> Colors in pdfs are the same no matter what color profile I choose.
> 
> With rgb values and rgb/cmyk values I get the same colors in pdf (the
> wrong ones).
> 
> With cmyk values only I get other colors in pdf. Next week my friend
> will test if these are the right ones.
> 
> I have many questions:
> 
> 1. Is colormanagement working in ConTeXt at all?
> 2. Is my code correct?
> 3. Why do pdfs with different color profiles show the same colors?
> 4. Why does ConTeXt not take the cmyk colors from \definecolor when
> there are rgb values as well?
> 5. Where can I define a coresponding rgb profile? In Scribus you have to
> define two profiles (eg. sRGB and ISOCoated) to make colormanagement work.
> 
> TIA
> juh
> ___
> 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
___

Re: [NTG-context] Issues with RGB to CMYK conversion with color profiles (was: Colormanagement)

2018-11-14 Thread Jan U. Hasecke
Hi all,

attached you find my colormanagement tests and I need your help to
understand and debug the situation.

I am testing together with a friend of mine, a professional
colormanager, who does not know ConTeXt.


There are several files in the archive:

The differences in the files are the color definition and the color
profile used.

- rgb-xxx.tex – colors are defined with RGB values only.

- rgb-cmyk-xxx.tex – colors are defined with RGB and CMYK values.

  The cmyk colors are derived from the rgb values using gimp and the
  color profiles sRGB/ISOCoated

- cmyk-xxx.tex – colors are defined with CMYK values only.

The xxx stand for two color profiles: iso-coated and swop.

What I see is this:

Colors in pdfs are the same no matter what color profile I choose.

With rgb values and rgb/cmyk values I get the same colors in pdf (the
wrong ones).

With cmyk values only I get other colors in pdf. Next week my friend
will test if these are the right ones.

I have many questions:

1. Is colormanagement working in ConTeXt at all?
2. Is my code correct?
3. Why do pdfs with different color profiles show the same colors?
4. Why does ConTeXt not take the cmyk colors from \definecolor when
there are rgb values as well?
5. Where can I define a coresponding rgb profile? In Scribus you have to
define two profiles (eg. sRGB and ISOCoated) to make colormanagement work.

TIA
juh
___
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] Issues with RGB to CMYK conversion with color profiles

2018-11-12 Thread Hans Hagen

On 11/12/2018 9:02 AM, Jan U. Hasecke wrote:

Hi all,

with the following file I tested the color conversion of context.

I get the same CMYK-values in the output pdf file using different color
profiles. A friend of mine can test the color values of PDF with a
special software.

My guess: the profiles are not used during pdf generation.
You can test this by commenting/uncommenting the other profile.

I created the files with

context --mode=print example.tex

My context version is
mtx-context | ConTeXt Process Management 1.02
mtx-context | current version: 2018.08.30 18:41


Is this the correct way of producing cmyk-pdfs?

I am missing the declaration of the RGB color profile. When doing color
management in Scribus I define two profiles: one for RGB and one for
CMYK. AFAIK you need both to convert rgb to cmyk.

Any hints?


it's probably better to define hs-dunkelblau etc in cmyk color space then


juh

--- example.tex ---

\definecolor  [hs-logoblau]   [r=0.000, g=0.314, b=0.580]
\definecolor  [hs-dunkelblau] [r=0.258, g=0.474, b=0.737]
\definecolor  [hs-hellblau]   [r=0.6, g=0.737, b=0.858]
\definecolor  [hs-orange] [r=0.866, g=0.286, b=0.003]

\startnotmode[print]
\setupcolors[cmyk=no,rgb=yes]
\stopnotmode

\startmode[print]
\setupcolors[cmyk=yes,rgb=no]
\setupbackend[
format=PDF/X-1a:2003,
%   intent={ISO Coated v2 300\letterpercent\space (ECI)},
intent={SWOP2006_Coated3v2.icc},
]
\stopmode

\setuppapersize [A4] [A4]

\starttext



\blackrule[width=3cm,height=1cm,depth=0pt,color=hs-orange] HS Orange
r=0.866, g=0.286, b=0.003
\blank

\blackrule[width=3cm,height=1cm,depth=0pt,color=hs-logoblau] HS Logoblau
r=0.000, g=0.314, b=0.580
\blank

\blackrule[width=3cm,height=1cm,depth=0pt,color=hs-dunkelblau] HS
Dunkelblau r=0.258, g=0.474, b=0.737
\blank

\blackrule[width=3cm,height=1cm,depth=0pt,color=hs-hellblau] HS Hellblau
r=0.6, g=0.737, b=0.858


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




--

-
  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] Issues with RGB to CMYK conversion with color profiles (was: Colormanagement)

2018-11-12 Thread Jan U. Hasecke
Hi all,

with the following file I tested the color conversion of context.

I get the same CMYK-values in the output pdf file using different color
profiles. A friend of mine can test the color values of PDF with a
special software.

My guess: the profiles are not used during pdf generation.
You can test this by commenting/uncommenting the other profile.

I created the files with

context --mode=print example.tex

My context version is
mtx-context | ConTeXt Process Management 1.02
mtx-context | current version: 2018.08.30 18:41


Is this the correct way of producing cmyk-pdfs?

I am missing the declaration of the RGB color profile. When doing color
management in Scribus I define two profiles: one for RGB and one for
CMYK. AFAIK you need both to convert rgb to cmyk.

Any hints?
juh

--- example.tex ---

\definecolor  [hs-logoblau]   [r=0.000, g=0.314, b=0.580]
\definecolor  [hs-dunkelblau] [r=0.258, g=0.474, b=0.737]
\definecolor  [hs-hellblau]   [r=0.6, g=0.737, b=0.858]
\definecolor  [hs-orange] [r=0.866, g=0.286, b=0.003]

\startnotmode[print]
\setupcolors[cmyk=no,rgb=yes]
\stopnotmode

\startmode[print]
\setupcolors[cmyk=yes,rgb=no]
\setupbackend[
format=PDF/X-1a:2003,
%   intent={ISO Coated v2 300\letterpercent\space (ECI)},
   intent={SWOP2006_Coated3v2.icc},
   ]
\stopmode

\setuppapersize [A4] [A4]

\starttext



\blackrule[width=3cm,height=1cm,depth=0pt,color=hs-orange] HS Orange
r=0.866, g=0.286, b=0.003
\blank

\blackrule[width=3cm,height=1cm,depth=0pt,color=hs-logoblau] HS Logoblau
r=0.000, g=0.314, b=0.580
\blank

\blackrule[width=3cm,height=1cm,depth=0pt,color=hs-dunkelblau] HS
Dunkelblau r=0.258, g=0.474, b=0.737
\blank

\blackrule[width=3cm,height=1cm,depth=0pt,color=hs-hellblau] HS Hellblau
r=0.6, g=0.737, b=0.858


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

Re: [NTG-context] Which color model shall I use

2018-10-01 Thread Jan U. Hasecke
On 01.10.18 10:11, Henning Hraban Ramm wrote:
> If you can ensure all RGB colors are tagged with the same profiles then it 
> should work, as long as you only care about *same* colors and not 
> (CMYK-defined) *specific* colors...
> 
> Do your SVGs declare their RGB color space?

They start with:



http://www.w3.org/2000/svg;
xmlns:xlink="http://www.w3.org/1999/xlink; x="0px" y="0px"
 viewBox="0 0 170.1 170.1" style="enable-background:new 0 0 170.1
170.1;" xml:space="preserve">

.st0{fill:#99BCDB;}
.st1{fill:#FF;}
.st2{fill:#DD4901;}
.st3{fill:#327AB8;}
.st4{fill:none;}
.st5{clip-path:url(#SVGID_2_);}
.st6{clip-path:url(#SVGID_4_);}
.st7{clip-path:url(#SVGID_6_);}
.st8{clip-path:url(#SVGID_8_);}


When I pick the screen colors with GPick I see that the SVG always stay
the same.

Only my colors I define with \definecolor change in the screen
representation of the PDF file (as I expect).

> Color management *is* complicated.

FullACK

Thanks for your help.
juh

___
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] Which color model shall I use

2018-10-01 Thread Henning Hraban Ramm
Am 2018-10-01 um 09:23 schrieb Jan U. Hasecke :

> On 30.09.18 17:16, Henning Hraban Ramm wrote:
> 
>> 
>> Hi juh,
>> 
>> you can define colors in several color models at once; CMYK makes most sense 
>> for professional printing.
>> 
>> e.g. \definecolor[CompanyBlue][r=0,g=0,b=1,c=1,m=1,y=0,k=0]
>> 
>> and see https://wiki.contextgarden.net/Command/setupcolors
>> (I would activate rgb or cmyk colors via modes, if you produce different 
>> media)
> 
> I don't know how to enable this via modes.

\startnotmode[print]
\setupcolors[cmyk=no,rgb=yes]
\stopnotmode

\startmode[print]
\setupcolors[cmyk=yes,rgb=no]
\stopmode

>> CMYK colors in SVG are difficult (I needed them in 2005, nowadays there’s a 
>> hardly supported standard for icc profile based colors).
>> e.g. 
>> https://stackoverflow.com/questions/3405689/svg-image-with-cmyk-colours-is-it-possible
>> https://www.w3.org/TR/SVGColor12/#icc-colors
>> 
>> Something about color profile handling in ConTeXt:
>> https://wiki.contextgarden.net/PDFX
>> 
>> Now you must decide if you want to go the PDF/X-1a route (device dependent 
>> CYMK values) or PDF/X-3 (profiled colors).
> 
> How can I test, what colors are used in the resulting PDF? Currently I
> pick the colors with a tool in Gimp to see what colors come up.

Can Gimp check the colors in the PDF? (I don’t think so.)

I know no other tool for that than Acrobat Pro, but there probably are one or 
two others; don’t know if there are *free and usable* tools to check on 
colors/profiles in PDFs...

> If I look at the colors this way the RGB values of the included svg are
> always the original values defined by the file. All other values are not
> the values I defined in the ConTeXt files.
> 
> I think this is due to the cmyk conversion of my screen.
> 
> \setupbackend[
> format=PDF/X-3,
> intent=ISO Coated v2 (ECI),
> ]
> 
> I tried with this for example.
> 
> Anyway. Wouldn't it be better to produce a RGB-PDF and let the ripper of
> the print shop do the conversion? At least I can produce a RGB-PDF where
> all colors are defined in the same manner.

If you can ensure all RGB colors are tagged with the same profiles then it 
should work, as long as you only care about *same* colors and not 
(CMYK-defined) *specific* colors...

Do your SVGs declare their RGB color space?

Color management *is* complicated.

Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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] Which color model shall I use

2018-10-01 Thread Hans Hagen

On 10/1/2018 9:23 AM, Jan U. Hasecke wrote:

On 30.09.18 17:16, Henning Hraban Ramm wrote:



Hi juh,

you can define colors in several color models at once; CMYK makes most sense 
for professional printing.

e.g. \definecolor[CompanyBlue][r=0,g=0,b=1,c=1,m=1,y=0,k=0]

and see https://wiki.contextgarden.net/Command/setupcolors
(I would activate rgb or cmyk colors via modes, if you produce different media)


I don't know how to enable this via modes.


\setupcolors[cmyk=yes,rgb=no] etc


CMYK colors in SVG are difficult (I needed them in 2005, nowadays there’s a 
hardly supported standard for icc profile based colors).
e.g. 
https://stackoverflow.com/questions/3405689/svg-image-with-cmyk-colours-is-it-possible
https://www.w3.org/TR/SVGColor12/#icc-colors

Something about color profile handling in ConTeXt:
https://wiki.contextgarden.net/PDFX

Now you must decide if you want to go the PDF/X-1a route (device dependent CYMK 
values) or PDF/X-3 (profiled colors).


How can I test, what colors are used in the resulting PDF? Currently I
pick the colors with a tool in Gimp to see what colors come up.

If I look at the colors this way the RGB values of the included svg are
always the original values defined by the file. All other values are not
the values I defined in the ConTeXt files.

I think this is due to the cmyk conversion of my screen.

\setupbackend[
  format=PDF/X-3,
  intent=ISO Coated v2 (ECI),
]

I tried with this for example.

Anyway. Wouldn't it be better to produce a RGB-PDF and let the ripper of
the print shop do the conversion? At least I can produce a RGB-PDF where
all colors are defined in the same manner.
it depends ... 4 channel cmyk doesn't map entirely on 3 channel rgb and 
vise versa


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] Which color model shall I use

2018-10-01 Thread Jan U. Hasecke
On 30.09.18 17:16, Henning Hraban Ramm wrote:

> 
> Hi juh,
> 
> you can define colors in several color models at once; CMYK makes most sense 
> for professional printing.
> 
> e.g. \definecolor[CompanyBlue][r=0,g=0,b=1,c=1,m=1,y=0,k=0]
> 
> and see https://wiki.contextgarden.net/Command/setupcolors
> (I would activate rgb or cmyk colors via modes, if you produce different 
> media)

I don't know how to enable this via modes.

> CMYK colors in SVG are difficult (I needed them in 2005, nowadays there’s a 
> hardly supported standard for icc profile based colors).
> e.g. 
> https://stackoverflow.com/questions/3405689/svg-image-with-cmyk-colours-is-it-possible
> https://www.w3.org/TR/SVGColor12/#icc-colors
> 
> Something about color profile handling in ConTeXt:
> https://wiki.contextgarden.net/PDFX
> 
> Now you must decide if you want to go the PDF/X-1a route (device dependent 
> CYMK values) or PDF/X-3 (profiled colors).

How can I test, what colors are used in the resulting PDF? Currently I
pick the colors with a tool in Gimp to see what colors come up.

If I look at the colors this way the RGB values of the included svg are
always the original values defined by the file. All other values are not
the values I defined in the ConTeXt files.

I think this is due to the cmyk conversion of my screen.

\setupbackend[
 format=PDF/X-3,
 intent=ISO Coated v2 (ECI),
]

I tried with this for example.

Anyway. Wouldn't it be better to produce a RGB-PDF and let the ripper of
the print shop do the conversion? At least I can produce a RGB-PDF where
all colors are defined in the same manner.

juh
___
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] Which color model shall I use

2018-09-30 Thread Hans Hagen

On 9/30/2018 7:22 PM, Alan Braslau wrote:

On Sun, 30 Sep 2018 19:07:24 +0200
Hans Hagen  wrote:


Luckily I never had to match corporate colors of different models in ConTeXt...

the worst are colors specs with 4 decimals based on some design made in
indesign where one has at most 256 values per channel and then some
designer looking at his display claiming to see a difference in the 3rd
decimal betweenm his sample and the one generated by tex


I have 16bit grayscale images where the full dynamic range contains very useful 
information. Of course, no display really shows this and I doubt that any 
printer would faithfully reproduce it, yet the eye can discern the difference 
using the proper media. This is now called high dynamic range imaging in 
photography... but has been used in X-ray imaging for quite some time now.


given that the average male can only see 16 shades of gray ...


For reasons of quality or transparency, rather free dissemination of 
information, it would be useful to be able to distribute a PDF including these 
images with their whole 16bit dynamic range. Of course, any or most all PDF 
readers would only display 8bits, but one could in principal extract the 
underlying image for examination and analysis.

c m y k in 16 bit would mean 4 * 8 bytes per pixel

(ok, one day we migh twant to store raw images made by these multi-ccd 
(in high end) phone camera and do all these sharp and zoom corrections 
outside that device .. interesting techniques btw)


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] Which color model shall I use

2018-09-30 Thread Alan Braslau
On Sun, 30 Sep 2018 19:07:24 +0200
Hans Hagen  wrote:

> > Luckily I never had to match corporate colors of different models in 
> > ConTeXt...  
> the worst are colors specs with 4 decimals based on some design made in 
> indesign where one has at most 256 values per channel and then some 
> designer looking at his display claiming to see a difference in the 3rd 
> decimal betweenm his sample and the one generated by tex

I have 16bit grayscale images where the full dynamic range contains very useful 
information. Of course, no display really shows this and I doubt that any 
printer would faithfully reproduce it, yet the eye can discern the difference 
using the proper media. This is now called high dynamic range imaging in 
photography... but has been used in X-ray imaging for quite some time now.

For reasons of quality or transparency, rather free dissemination of 
information, it would be useful to be able to distribute a PDF including these 
images with their whole 16bit dynamic range. Of course, any or most all PDF 
readers would only display 8bits, but one could in principal extract the 
underlying image for examination and analysis.

Just an idea.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Which color model shall I use

2018-09-30 Thread Hans Hagen

On 9/30/2018 5:16 PM, Henning Hraban Ramm wrote:


Luckily I never had to match corporate colors of different models in ConTeXt...
the worst are colors specs with 4 decimals based on some design made in 
indesign where one has at most 256 values per channel and then some 
designer looking at his display claiming to see a difference in the 3rd 
decimal betweenm his sample and the one generated by tex


-
  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] Which color model shall I use

2018-09-30 Thread Hans Hagen

On 9/30/2018 3:46 PM, Jan U. Hasecke wrote:

Hi,

I would like to know, how to define colors to have a good printing quality.

I am currently producing print materials for a company where all colors
were defined for online usage first, so we started with defining RGB
colors and then derived CMYK colors.

What is the best approach for defining colors in print materials? What
color model shall I use? RGB or CMYK?

For the background. We have some SVG graphics we use on the website.
They are defined in RGB color model. And we use them in the print
materials as well.

I tend to define RGB colors in my print documents so that the colors of
the included SVG files match the defined colors I use elsewhere in the
document. Eg. the Corporate-Blue of the Logo (SVG) will match the Blue
of the headlines.

I could as well define CMYK colors in the document but then I have two
different color models in one document and I fear that the colors are
printed in different hues.

What would you do?

rgb for screen and cmyk for print

You can use rgb and in the print version enable cmyk and disable rgb in 
which case context will convert for you.


For most color setups the result is ok (the end users often don't know 
what colors were meant anyway) as long as relative coloring is ok (the 
wierder the colors, the more sensitive for colro spaces).


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] Which color model shall I use

2018-09-30 Thread Henning Hraban Ramm
Am 2018-09-30 um 15:46 schrieb Jan U. Hasecke :

> Hi,
> 
> I would like to know, how to define colors to have a good printing quality.
> 
> I am currently producing print materials for a company where all colors
> were defined for online usage first, so we started with defining RGB
> colors and then derived CMYK colors.
> 
> What is the best approach for defining colors in print materials? What
> color model shall I use? RGB or CMYK?
> 
> For the background. We have some SVG graphics we use on the website.
> They are defined in RGB color model. And we use them in the print
> materials as well.
> 
> I tend to define RGB colors in my print documents so that the colors of
> the included SVG files match the defined colors I use elsewhere in the
> document. Eg. the Corporate-Blue of the Logo (SVG) will match the Blue
> of the headlines.
> 
> I could as well define CMYK colors in the document but then I have two
> different color models in one document and I fear that the colors are
> printed in different hues.
> 
> What would you do?

Hi juh,

you can define colors in several color models at once; CMYK makes most sense 
for professional printing.

e.g. \definecolor[CompanyBlue][r=0,g=0,b=1,c=1,m=1,y=0,k=0]

and see https://wiki.contextgarden.net/Command/setupcolors
(I would activate rgb or cmyk colors via modes, if you produce different media)

CMYK colors in SVG are difficult (I needed them in 2005, nowadays there’s a 
hardly supported standard for icc profile based colors).
e.g. 
https://stackoverflow.com/questions/3405689/svg-image-with-cmyk-colours-is-it-possible
https://www.w3.org/TR/SVGColor12/#icc-colors

Something about color profile handling in ConTeXt:
https://wiki.contextgarden.net/PDFX

Now you must decide if you want to go the PDF/X-1a route (device dependent CYMK 
values) or PDF/X-3 (profiled colors).

Luckily I never had to match corporate colors of different models in ConTeXt...


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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] Which color model shall I use

2018-09-30 Thread Jan U. Hasecke
Hi,

I would like to know, how to define colors to have a good printing quality.

I am currently producing print materials for a company where all colors
were defined for online usage first, so we started with defining RGB
colors and then derived CMYK colors.

What is the best approach for defining colors in print materials? What
color model shall I use? RGB or CMYK?

For the background. We have some SVG graphics we use on the website.
They are defined in RGB color model. And we use them in the print
materials as well.

I tend to define RGB colors in my print documents so that the colors of
the included SVG files match the defined colors I use elsewhere in the
document. Eg. the Corporate-Blue of the Logo (SVG) will match the Blue
of the headlines.

I could as well define CMYK colors in the document but then I have two
different color models in one document and I fear that the colors are
printed in different hues.

What would you do?

TIA
juh
___
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] \basegrid ignores color

2018-03-23 Thread Hans Hagen

On 3/22/2018 11:22 PM, Henri Menke wrote:

Bump!

I attached the updated core file to make it easier for you.


juct check the beta when i upload a new one (you might learn a few extra 
tricks)




On Wed, 2018-03-21 at 09:51 +1300, Henri Menke wrote:

Dear devs,

The \basegrid macro ignores its color option.  That's kind of obvious because
as
I look at the code I don't see the color being communicated to Metapost at any
point.  When you're at it, could you please also add a rulethickness
parameters?
  Thanks!

Reproducible in TL2018 pertest and latest beta.  MWE is below (as always).

Cheers, Henri

---

\starttext

\basegrid[color=red]

\color[red]{\basegrid}

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



--

-
  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] \basegrid ignores color

2018-03-22 Thread Henri Menke
Bump!

I attached the updated core file to make it easier for you.

On Wed, 2018-03-21 at 09:51 +1300, Henri Menke wrote:
> Dear devs,
> 
> The \basegrid macro ignores its color option.  That's kind of obvious because
> as
> I look at the code I don't see the color being communicated to Metapost at any
> point.  When you're at it, could you please also add a rulethickness
> parameters?
>  Thanks!
> 
> Reproducible in TL2018 pertest and latest beta.  MWE is below (as always).
> 
> Cheers, Henri
> 
> ---
> 
> \starttext
> 
> \basegrid[color=red]
> 
> \color[red]{\basegrid}
> 
> \stoptext
> %D \module
%D   [   file=meta-grd,
%Dversion=2012.06.28,
%D  title=\METAPOST\ Graphics,
%D   subtitle=grids,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{MetaPost Graphics / Grids}

%D This used to be a \TEX\ method, and a rather old one too. We keep it around but
%D in a more modern way.
%D
%D \startbuffer
%D \basegrid
%D   [nx=8,ny=5,
%Ddx=.5,dy=.25,
%Dunit=cm,scale=2,factor=1,
%Doffset=1ex,xstep=2,ystep=1,
%Dalign=middle,style=\tt\tx]
%D \stopbuffer
%D
%D \typebuffer
%D
%D \placefigure
%D   {An example of a grid.}
%D   {\getbuffer}

\startuseMPgraphic{grid}{nx,ny,dx,dy,factor,scale,xstep,ystep,xoffset,yoffset,align,rulecolor,rulethickness}
begingroup ;

save nx, ny, dx, dy, wd, ht, xstep, ystep, xoffset, yoffset, align, xalign, yalign, rulecolor, rulethickness ;

numeric nx  ; nx  := \MPvar{nx} ;
numeric ny  ; ny  := \MPvar{ny} ;
numeric dx  ; dx  := \MPvar{factor} * \MPvar{scale} * \MPvar{dx} ;
numeric dy  ; dy  := \MPvar{factor} * \MPvar{scale} * \MPvar{dy} ;
numeric wd  ; wd  := nx * dx ;
numeric ht  ; ht  := ny * dy ;
numeric xstep   ; xstep   := \MPvar{xstep} ;
numeric ystep   ; ystep   := \MPvar{ystep} ;
numeric xoffset ; xoffset := \MPvar{xoffset} ;
numeric yoffset ; yoffset := \MPvar{yoffset} ;
numeric align   ; align   := \MPvar{align} ;
color rulecolor ; rulecolor := \MPvar{rulecolor} ;
numeric rulethickness ; rulethickness := \MPvar{rulethickness} ;
numeric xalign  ; xalign  := 0 ;
numeric yalign  ; yalign  := 0 ;

if align = 1 :
xalign := dx/2 ;
yalign := dy/2 ;
fi ;

for i=0 step dx until wd :
draw (i,0) -- (i,ht)
withpen pencircle scaled rulethickness
withcolor rulecolor ;
endfor ;
for i=0 step dy until ht :
draw (0,i) -- (wd,i)
withpen pencircle scaled rulethickness
withcolor rulecolor ;
endfor ;

if xstep > 0 :
for i=1 step xstep until nx :
draw thetextext.bot(decimal i,(i*dx-xalign,-xoffset));
endfor ;
fi ;
if ystep > 0 :
for i=1 step ystep until ny :
draw thetextext.lft(decimal i,(-yoffset,i*dy-yalign)) ;
endfor ;
fi ;

endgroup ;
\stopuseMPgraphic

\unprotect

\unexpanded\def\basegrid
  {\dosingleempty\typo_grid_base}

\def\typo_grid_base[#1]%
  {\hbox\bgroup
   \getdummyparameters
 [\c!nx=10,\c!ny=10,\c!dx=.5,\c!dy=.5,\c!xstep=0,\c!ystep=0,
  \c!unit=\s!cm,\c!scale=1,\c!factor=1,
  \c!offset=.25ex,\c!xoffset=\directdummyparameter\c!offset,\c!yoffset=\directdummyparameter\c!offset,
  \c!align=,
  \c!rulecolor=\s!black,
      \c!rulethickness=\linewidth,
  #1]%
   \usedummystyleandcolor\c!style\c!color
   \edef\p_align{\directdummyparameter\c!align}%
   \ifx\p_align\v!middle
  \let\p_align\!!plusone
   \else
  \let\p_align\!!zerocount
   \fi
   \useMPgraphic
{grid}%
{nx=\directdummyparameter\c!nx,%
 ny=\directdummyparameter\c!ny,%
 dx=\directdummyparameter\c!dx\directdummyparameter\c!unit,%
 dy=\directdummyparameter\c!dy\directdummyparameter\c!unit,%
 factor=\directdummyparameter\c!factor,%
 scale=\directdummyparameter\c!scale,%
 xstep=\directdummyparameter\c!xstep,%
 ystep=\directdummyparameter\c!ystep,%
 xoffset=\directdummyparameter\c!xoffset,%
 yoffset=\directdummyparameter\c!yoffset,%
 align=\p_align,%
 rulecolor=\directdummyparameter\c!rulecolor,%
 rulethickness=\directdummyparameter\c!rulethickness,%
}%
  \egroup}

\let\grid\basegrid

\protect \endinput
\loadmarkfile{meta-grd}
\starttext
\basegrid[rulecolor=gray,rulethickness=.1pt]
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

[NTG-context] \basegrid ignores color

2018-03-20 Thread Henri Menke
Dear devs,

The \basegrid macro ignores its color option.  That's kind of obvious because as
I look at the code I don't see the color being communicated to Metapost at any
point.  When you're at it, could you please also add a rulethickness parameters?
 Thanks!

Reproducible in TL2018 pertest and latest beta.  MWE is below (as always).

Cheers, Henri

---

\starttext

\basegrid[color=red]

\color[red]{\basegrid}

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

Re: [NTG-context] Presentation sections identified by color and mark

2018-02-04 Thread Hans Hagen

On 2/3/2018 10:02 PM, jmm...@us.es wrote:

Hi, I'm starting a presentation with ConTeXt.

I'd like to visually differentiate each section, so I've come up with 
two complementary approaches to do that:


* Use a different color palette for each section, and
* Mark the progress bar to indicate the start of each section.

I've done an small example (at the end) but:

* Last Subject of a Topic take color from next Topic. (e.g. "Some greenB")
* I don't like interactionBar styles provided.

I'd like something like:

|-|-|-|--|--
(horizontal line and a vertical line at the begin of each section and a 
vertical line of different color for current position)


other option I like:

##%%@@HHH&&&&&&&
(each letter represents a color. It's a bar with colors marking size of 
text. So it's a series of color rectangles with colors for each section 
and a vertical line for current position)


The main problems are:

* How can I pass the first page of each section to MetaPost?


you need to get the logic ok yourself, something like:

\startuseMPgraphic{PageShape}
StartPage ;
numeric n ; n := \number\nofsubpages ;
numeric m ; m := \number\subpageno ;
if (n > 0) and (m > 0) :
pair pa ;
path p ; p := (100pt,100pt) -- (500pt,100pt) ;
draw p
withpen pencircle scaled 5pt
withcolor "BackgroundColor" ;
for i=0,n-1 :
pa := point(1/n) of p ;
draw (pa + (0,10pt)) -- (pa + (0,-10pt))
withpen pencircle scaled 5pt
withcolor "BackgroundColor" ;
endfor ;
draw point (1/m) of p
withpen pencircle scaled 10pt
withcolor "PositionColor" ;
   fi ;
StopPage ;
\stopuseMPgraphic


* How can I protect background color of SomeGreenB to be green and not 
blue?


just look at the definitions you load ...

\definecolor [MyBackgroundColor] [s=.85]
\setupbackgrounds
  [page]
  [background=color,
   backgroundcolor=MyBackgroundColor]




Thanks.

---8< - Start example


\usemodule[present-original]
\usemodule[present-common]

\definecolor [PageColor]   [black]
\definecolor [BackgroundColor] [s=.85]
\definecolor [OrnamentColor]   [r=.75]
\definecolor [PositionColor]   [s=.55]

\defineoverlay
   [PageShape][\useMPgraphic{PageShape}]

\startuseMPgraphic{PageShape}
     StartPage ;
     path p ; pair pa, pb ; numeric len ; color contrastcolor ;
     numeric i;
     numeric sections[];
     % simulated load of sections
     sections[0] := 1;
     sections[1] := 4;
     sections[2] := 6;

     pickup pencircle scaled 5pt ;
     p := (100pt,100pt)--(500pt,100pt);
     draw p withcolor \MPcolor{OrnamentColor} ;
     contrastcolor = \MPcolor{PositionColor} ;
     if (RealPageNumber > 0) and (NOfPages > 0):
     len := 1/NOfPages ;
     i := 0;
     forever :
   exitunless known sections[i];

   pa := point(0+len*sections[i]) of p ;
   draw (pa+(0,10pt))--(pa+(0,-10pt)) withcolor 
\MPcolor{OrnamentColor} ;

   i := i + 1;
     endfor ;
     pa := point (0+len*RealPageNumber) of p ;
     %draw (pa+(0,10pt))--(pa+(0,-10pt)) withcolor contrastcolor ;
     draw pa withpen pencircle scaled 10pt withcolor 
contrastcolor ;

    fi ;
     StopPage ;
\stopuseMPgraphic

\setupbackgrounds
   [text]
   [background={PageShape}]

\starttext

\setupdocument[title={Title},location={Place}]

\startdocument
   \definecolor[BackgroundColor][r=0,g=.7,b=0]
   \startTopic[title={Topic Green}]
     Some text A
     \startSubject[title={Some green 1}]
   more text B
     \stopSubject
     \startSubject[title={Some green 2}]
   more text B
     \stopSubject
   \stopTopic

   \definecolor[BackgroundColor][r=0,g=0,b=0.7]
   \startTopic[title={Topic Blue}]
     Some text C
     \startSubject[title={Some blue}]
   more text D
     \stopSubject
   \stopTopic

   \definecolor[BackgroundColor][r=.7,g=0,b=0]
   \startTopic[title={Topic Red}]
     Some text E
     \startSubject[title={Some Red}]
   more text F
     \stopSubject
   \stopTopic
\stopdocument

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



--

-
  Hans H

[NTG-context] Presentation sections identified by color and mark

2018-02-03 Thread jmmora

Hi, I'm starting a presentation with ConTeXt.

I'd like to visually differentiate each section, so I've come up with 
two complementary approaches to do that:


* Use a different color palette for each section, and
* Mark the progress bar to indicate the start of each section.

I've done an small example (at the end) but:

* Last Subject of a Topic take color from next Topic. (e.g. "Some 
greenB")

* I don't like interactionBar styles provided.

I'd like something like:

|-|-|-|--|--
(horizontal line and a vertical line at the begin of each section and a 
vertical line of different color for current position)


other option I like:

##%%@@HHH&&&&&&&
(each letter represents a color. It's a bar with colors marking size of 
text. So it's a series of color rectangles with colors for each section 
and a vertical line for current position)


The main problems are:

* How can I pass the first page of each section to MetaPost?
* How can I protect background color of SomeGreenB to be green and not 
blue?


Thanks.

---8< - Start example


\usemodule[present-original]
\usemodule[present-common]

\definecolor [PageColor]   [black]
\definecolor [BackgroundColor] [s=.85]
\definecolor [OrnamentColor]   [r=.75]
\definecolor [PositionColor]   [s=.55]

\defineoverlay
  [PageShape][\useMPgraphic{PageShape}]

\startuseMPgraphic{PageShape}
StartPage ;
path p ; pair pa, pb ; numeric len ; color contrastcolor ;
numeric i;
numeric sections[];
% simulated load of sections
sections[0] := 1;
sections[1] := 4;
sections[2] := 6;

pickup pencircle scaled 5pt ;
p := (100pt,100pt)--(500pt,100pt);
draw p withcolor \MPcolor{OrnamentColor} ;
contrastcolor = \MPcolor{PositionColor} ;
if (RealPageNumber > 0) and (NOfPages > 0):
len := 1/NOfPages ;
i := 0;
forever :
  exitunless known sections[i];

  pa := point(0+len*sections[i]) of p ;
  draw (pa+(0,10pt))--(pa+(0,-10pt)) withcolor 
\MPcolor{OrnamentColor} ;

  i := i + 1;
endfor ;
pa := point (0+len*RealPageNumber) of p ;
%draw (pa+(0,10pt))--(pa+(0,-10pt)) withcolor contrastcolor 
;
draw pa withpen pencircle scaled 10pt withcolor 
contrastcolor ;

   fi ;
StopPage ;
\stopuseMPgraphic

\setupbackgrounds
  [text]
  [background={PageShape}]

\starttext

\setupdocument[title={Title},location={Place}]

\startdocument
  \definecolor[BackgroundColor][r=0,g=.7,b=0]
  \startTopic[title={Topic Green}]
Some text A
\startSubject[title={Some green 1}]
  more text B
\stopSubject
\startSubject[title={Some green 2}]
  more text B
\stopSubject
  \stopTopic

  \definecolor[BackgroundColor][r=0,g=0,b=0.7]
  \startTopic[title={Topic Blue}]
Some text C
\startSubject[title={Some blue}]
  more text D
\stopSubject
  \stopTopic

  \definecolor[BackgroundColor][r=.7,g=0,b=0]
  \startTopic[title={Topic Red}]
Some text E
\startSubject[title={Some Red}]
  more text F
\stopSubject
  \stopTopic
\stopdocument

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

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-19 Thread Aditya Mahajan

On Wed, 19 Jul 2017, Gerion Entrup wrote:


Am Mittwoch, 19. Juli 2017, 21:07:09 CEST schrieb Aditya Mahajan:

On Wed, 19 Jul 2017, Gerion Entrup wrote:

> Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:
>> On Mon, 17 Jul 2017, Gerion Entrup wrote:
>>
>>> Hi,
>>>
>>> I have two questions with the vim module.
>>>
>>> 1. I want to use the math mode inside the code. I've seen the escape option,
>>> e.g. here [1], but this seems to work only with comments. Is there a
>>> possibility to use it directly in the code, too?
>>
>> Short answer. No.
>>
>> Long answer. t-vim relies on vim to syntax highlight the code. Since the
>> code is not valid python, the default python syntax highlighting will not
>> work. In principle, it is possible to write a vim syntax highlighting
>> script for a derivative of python where math terms are allowed, but that
>> requires a lot of work for each language. The whole point of t-vim module
>> was that I am lazy and don't want to write the parser for each language
>> :-)
>
> I've invested some time and rewrote parts of the vimscript file of t-vim.
> Now one or more escapechars can be defined, that helps vim to not interpret
> the text:

I'll look at this later

> Another point I saw is, that highlight together with TeX-code is not really 
usable:
> ```
> \usemodule[vim]
> \definevimtyping[python][syntax=python, escape=on]
>
> \starttext
> \startpython[highlight=1]
> # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> \stoppython
> \stoptext
> ```

By default, the highlighting is done using the bars mechanism. It works 
for simple cases but fails with math mode (the spaces are not covered). 
One option is to highlight using the textbackground mechanism:


\definetextbackground[texthighlight]
 [
   background=color,
   backgroundcolor=gray,
   frame=off,
 ]

\define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}

\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on, 
highlightcommand=\texthighlight]

\starttext

\startpython[highlight=3]
for x in 1:n
   print(x)
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
for x in 1:n
   print(x)
\stoppython
\stoptext

Thank you, this works much better (critic on high level: the sum symbol is
higher than the highlight box, relevant on fractions).


Another option (slightly better visually, but increases the interline 
distance)


\defineframed[texthighlight]
[
  background=color,
  backgroundcolor=gray,
  frame=off,
  location=middle,
]

\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on,
highlightcommand=\dontleavehmode\texthighlight]

\starttext

\startpython[highlight=3]
for x in 1:n
  print(x)
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
for x in 1:n
  print(x)
\stoppython
\stoptext

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-19 Thread Aditya Mahajan

On Thu, 20 Jul 2017, Henri Menke wrote:


On Wed, 2017-07-19 at 15:07 -0400, Aditya Mahajan wrote:

On Wed, 19 Jul 2017, Gerion Entrup wrote:

> 
> Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:
> > 
> > On Mon, 17 Jul 2017, Gerion Entrup wrote:
> > 
> > > 
> > > Hi,
> > > 
> > > I have two questions with the vim module.
> > > 
> > > 1. I want to use the math mode inside the code. I've seen the escape option,

> > > e.g. here [1], but this seems to work only with comments. Is there a
> > > possibility to use it directly in the code, too?
> > Short answer. No.
> > 
> > Long answer. t-vim relies on vim to syntax highlight the code. Since the

> > code is not valid python, the default python syntax highlighting will not
> > work. In principle, it is possible to write a vim syntax highlighting
> > script for a derivative of python where math terms are allowed, but that
> > requires a lot of work for each language. The whole point of t-vim module
> > was that I am lazy and don't want to write the parser for each language
> > :-)
> I've invested some time and rewrote parts of the vimscript file of t-vim.
> Now one or more escapechars can be defined, that helps vim to not interpret
> the text:
I'll look at this later

> 
> Another point I saw is, that highlight together with TeX-code is not really usable:

> ```
> \usemodule[vim]
> \definevimtyping[python][syntax=python, escape=on]
> 
> \starttext

> \startpython[highlight=1]
> # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> \stoppython
> \stoptext
> ```
By default, the highlighting is done using the bars mechanism. It works 
for simple cases but fails with math mode (the spaces are not covered). 
One option is to highlight using the textbackground mechanism:

\definetextbackground[texthighlight]
 [
   background=color,
   backgroundcolor=gray,
   frame=off,
 ]

\define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}

\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on, 
highlightcommand=\texthighlight]

\starttext

\startpython[highlight=3]
for x in 1:n
   print(x)
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
for x in 1:n
   print(x)
\stoppython
\stoptext

The spacing in math mode is bad. What is happening is the following. To 
make sure that spaces are obeyed in the code listing, I set (a modified 
version of) \activatespacehandler{on}, so the output that you get is the 
following:

{\obeyspaces
  \def\obeyedspace{\hskip\interwordspace\relax}
\m{\sum_{i=1}^{n}i \in F \int_i f}}

The simplest way to fix this is to define a new command:

\define[1]\MATH{\bgroup\activatespacehandler{off}\m{\rescan{#1}}\egroup}


Why not just this?

\def\obeyedspace{\ifmmode\else\hskip\interwordspace\relax\fi}


That's a good suggestion and will be easier to incorporate in t-vim.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-19 Thread Henri Menke
On Wed, 2017-07-19 at 15:07 -0400, Aditya Mahajan wrote:
> On Wed, 19 Jul 2017, Gerion Entrup wrote:
> 
> > 
> > Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:
> > > 
> > > On Mon, 17 Jul 2017, Gerion Entrup wrote:
> > > 
> > > > 
> > > > Hi,
> > > > 
> > > > I have two questions with the vim module.
> > > > 
> > > > 1. I want to use the math mode inside the code. I've seen the escape 
> > > > option,
> > > > e.g. here [1], but this seems to work only with comments. Is there a
> > > > possibility to use it directly in the code, too?
> > > Short answer. No.
> > > 
> > > Long answer. t-vim relies on vim to syntax highlight the code. Since the
> > > code is not valid python, the default python syntax highlighting will not
> > > work. In principle, it is possible to write a vim syntax highlighting
> > > script for a derivative of python where math terms are allowed, but that
> > > requires a lot of work for each language. The whole point of t-vim module
> > > was that I am lazy and don't want to write the parser for each language
> > > :-)
> > I've invested some time and rewrote parts of the vimscript file of t-vim.
> > Now one or more escapechars can be defined, that helps vim to not interpret
> > the text:
> I'll look at this later
> 
> > 
> > Another point I saw is, that highlight together with TeX-code is not really 
> > usable:
> > ```
> > \usemodule[vim]
> > \definevimtyping[python][syntax=python, escape=on]
> > 
> > \starttext
> > \startpython[highlight=1]
> > # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> > \stoppython
> > \stoptext
> > ```
> By default, the highlighting is done using the bars mechanism. It works 
> for simple cases but fails with math mode (the spaces are not covered). 
> One option is to highlight using the textbackground mechanism:
> 
> \definetextbackground[texthighlight]
>  [
>    background=color,
>    backgroundcolor=gray,
>    frame=off,
>  ]
> 
> \define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}
> 
> \usemodule[vim]
> \definevimtyping[python][syntax=python, escape=on, 
> highlightcommand=\texthighlight]
> 
> \starttext
> 
> \startpython[highlight=3]
> for x in 1:n
>    print(x)
> # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> for x in 1:n
>    print(x)
> \stoppython
> \stoptext
> 
> The spacing in math mode is bad. What is happening is the following. To 
> make sure that spaces are obeyed in the code listing, I set (a modified 
> version of) \activatespacehandler{on}, so the output that you get is the 
> following:
> 
> {\obeyspaces
>   \def\obeyedspace{\hskip\interwordspace\relax}
> \m{\sum_{i=1}^{n}i \in F \int_i f}}
> 
> The simplest way to fix this is to define a new command:
> 
> \define[1]\MATH{\bgroup\activatespacehandler{off}\m{\rescan{#1}}\egroup}

Why not just this?

\def\obeyedspace{\ifmmode\else\hskip\interwordspace\relax\fi}

> 
> and use \MATH{} instead of \m{}.
> 
> I'll test this is a bit, and if the solution is robust, then I will map 
> \m{...} to something equivalent to the above in the t-vim environments.
> 
> 
> 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://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
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-19 Thread Gerion Entrup
Am Mittwoch, 19. Juli 2017, 21:07:09 CEST schrieb Aditya Mahajan:
> On Wed, 19 Jul 2017, Gerion Entrup wrote:
> 
> > Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:
> >> On Mon, 17 Jul 2017, Gerion Entrup wrote:
> >>
> >>> Hi,
> >>>
> >>> I have two questions with the vim module.
> >>>
> >>> 1. I want to use the math mode inside the code. I've seen the escape 
> >>> option,
> >>> e.g. here [1], but this seems to work only with comments. Is there a
> >>> possibility to use it directly in the code, too?
> >>
> >> Short answer. No.
> >>
> >> Long answer. t-vim relies on vim to syntax highlight the code. Since the
> >> code is not valid python, the default python syntax highlighting will not
> >> work. In principle, it is possible to write a vim syntax highlighting
> >> script for a derivative of python where math terms are allowed, but that
> >> requires a lot of work for each language. The whole point of t-vim module
> >> was that I am lazy and don't want to write the parser for each language
> >> :-)
> >
> > I've invested some time and rewrote parts of the vimscript file of t-vim.
> > Now one or more escapechars can be defined, that helps vim to not interpret
> > the text:
> 
> I'll look at this later
> 
> > Another point I saw is, that highlight together with TeX-code is not really 
> > usable:
> > ```
> > \usemodule[vim]
> > \definevimtyping[python][syntax=python, escape=on]
> >
> > \starttext
> > \startpython[highlight=1]
> > # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> > \stoppython
> > \stoptext
> > ```
> 
> By default, the highlighting is done using the bars mechanism. It works 
> for simple cases but fails with math mode (the spaces are not covered). 
> One option is to highlight using the textbackground mechanism:
> 
> \definetextbackground[texthighlight]
>  [
>background=color,
>backgroundcolor=gray,
>frame=off,
>  ]
> 
> \define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}
> 
> \usemodule[vim]
> \definevimtyping[python][syntax=python, escape=on, 
> highlightcommand=\texthighlight]
> 
> \starttext
> 
> \startpython[highlight=3]
> for x in 1:n
>print(x)
> # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> for x in 1:n
>print(x)
> \stoppython
> \stoptext
Thank you, this works much better (critic on high level: the sum symbol is
higher than the highlight box, relevant on fractions).

 
> The spacing in math mode is bad. What is happening is the following. To 
> make sure that spaces are obeyed in the code listing, I set (a modified 
> version of) \activatespacehandler{on}, so the output that you get is the 
> following:
> 
> {\obeyspaces
>   \def\obeyedspace{\hskip\interwordspace\relax}
> \m{\sum_{i=1}^{n}i \in F \int_i f}}
> 
> The simplest way to fix this is to define a new command:
> 
> \define[1]\MATH{\bgroup\activatespacehandler{off}\m{\rescan{#1}}\egroup}
> 
> and use \MATH{} instead of \m{}.
> 
> I'll test this is a bit, and if the solution is robust, then I will map 
> \m{...} to something equivalent to the above in the t-vim environments.
I saw the strange spacing. Thank you very much to provide a solution.

Gerion

___
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] t-vim module: math in "normal" code and background color

2017-07-19 Thread Aditya Mahajan

On Wed, 19 Jul 2017, Gerion Entrup wrote:


Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:

On Mon, 17 Jul 2017, Gerion Entrup wrote:


Hi,

I have two questions with the vim module.

1. I want to use the math mode inside the code. I've seen the escape option,
e.g. here [1], but this seems to work only with comments. Is there a
possibility to use it directly in the code, too?


Short answer. No.

Long answer. t-vim relies on vim to syntax highlight the code. Since the
code is not valid python, the default python syntax highlighting will not
work. In principle, it is possible to write a vim syntax highlighting
script for a derivative of python where math terms are allowed, but that
requires a lot of work for each language. The whole point of t-vim module
was that I am lazy and don't want to write the parser for each language
:-)


I've invested some time and rewrote parts of the vimscript file of t-vim.
Now one or more escapechars can be defined, that helps vim to not interpret
the text:


I'll look at this later


Another point I saw is, that highlight together with TeX-code is not really 
usable:
```
\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on]

\starttext
\startpython[highlight=1]
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
\stoppython
\stoptext
```


By default, the highlighting is done using the bars mechanism. It works 
for simple cases but fails with math mode (the spaces are not covered). 
One option is to highlight using the textbackground mechanism:


\definetextbackground[texthighlight]
[
  background=color,
  backgroundcolor=gray,
  frame=off,
]

\define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}

\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on, 
highlightcommand=\texthighlight]

\starttext

\startpython[highlight=3]
for x in 1:n
  print(x)
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
for x in 1:n
  print(x)
\stoppython
\stoptext

The spacing in math mode is bad. What is happening is the following. To 
make sure that spaces are obeyed in the code listing, I set (a modified 
version of) \activatespacehandler{on}, so the output that you get is the 
following:


{\obeyspaces
 \def\obeyedspace{\hskip\interwordspace\relax}
\m{\sum_{i=1}^{n}i \in F \int_i f}}

The simplest way to fix this is to define a new command:

\define[1]\MATH{\bgroup\activatespacehandler{off}\m{\rescan{#1}}\egroup}

and use \MATH{} instead of \m{}.

I'll test this is a bit, and if the solution is robust, then I will map 
\m{...} to something equivalent to the above in the t-vim environments.



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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-18 Thread Gerion Entrup
Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:
> On Mon, 17 Jul 2017, Gerion Entrup wrote:
> 
> > Hi,
> >
> > I have two questions with the vim module.
> >
> > 1. I want to use the math mode inside the code. I've seen the escape 
> > option, 
> > e.g. here [1], but this seems to work only with comments. Is there a 
> > possibility to use it directly in the code, too?
> 
> Short answer. No.
> 
> Long answer. t-vim relies on vim to syntax highlight the code. Since the 
> code is not valid python, the default python syntax highlighting will not 
> work. In principle, it is possible to write a vim syntax highlighting 
> script for a derivative of python where math terms are allowed, but that 
> requires a lot of work for each language. The whole point of t-vim module 
> was that I am lazy and don't want to write the parser for each language 
> :-)

I've invested some time and rewrote parts of the vimscript file of t-vim.
Now one or more escapechars can be defined, that helps vim to not interpret
the text:
```
\usemodule[vim]
\definevimtyping[python][syntax=python]
\definevimtyping[cpp][syntax=cpp]

\starttext
\startpython
# Returns range(°\m{\sum_{i=1}^{n}i \in F \int_i f}°
def sum_upto(°\m{n \in \mathbb{N} \sum_{i=1}}°)
r = range(1, °\m{n}° + °\m{\sum_{i=1} 1}°)
return sum(r)
\stoppython
\startcpp
  foobar(°\m{q_0}°);
\stopcpp
\stoptext
```

I'm not familiar enough with TeX or ConTeXt to get the TeX part to work, so
the escapechar '°' is hardcoded at the moment. If you like the patch, this
has to be fixed.

Another problem, as you see in the above example, is, that vim interprets
the second ')' in the startcpp section as color code "Error", so the whole
part is colorized. This can be circumventented with the escapechars '°"', but
I have no idea how to teach tex/lua to not interpret the '"'. Simply writing
 -c "let escapechar='°\"'" %
etc. in the t-vim.tex does not work.


Another point I saw is, that highlight together with TeX-code is not really 
usable:
```
\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on]

\starttext
\startpython[highlight=1]
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
\stoppython
\stoptext
```
 
> > Minimal example:
> > ```
> > \usemodule[vim]
> > \definevimtyping[python][syntax=python, escape=on]
> >
> > \starttext
> > \startpython
> > # Returns \m{\sum_{i=1}^{n}i}
> > def sum_upto(\m{n \in \mathbb{N}})
> >r = range(1, \m{n} + 1)
> >return sum(r)
> > \stoppython
> > \stoptext
> > ```
> 
> Another option will be to use the algorithmic module: 
> https://bitbucket.org/wolfs/algorithmic/src/
> 
> > 2. It would be cool, if I can define some background color for the code. 
> > Unfortunately I'm very new to context and haven't seen a direct option. I 
> > assume this is possible with some kind of extra environment around the code?
> 
> You can add
> 
> \setupbackground[background=color, backgroundcolor=gray]
> 
> \setupvimtyping[python]
>  [
>before={\startbackground},
>after={\stopbackground},
>  ]
> 
> or, instead of modifying the default background, define a new background 
> and use that.
OK, thank you.

Gerion

From 994de513a23210f1f4d50d24270f8f988abdd21c Mon Sep 17 00:00:00 2001
From: Gerion Entrup <gerion.ent...@flump.de>
Date: Wed, 19 Jul 2017 00:13:52 +0200
Subject: [PATCH] t-vim: extended escape mode

With this change it is possible to define one or more escapechars, that
are used by vim to recognize parts that should not be interpreted.
---
 2context.vim | 50 +-
 t-vim.tex| 12 ++--
 2 files changed, 35 insertions(+), 27 deletions(-)

diff --git a/2context.vim b/2context.vim
index 9c72ba1..b208e65 100644
--- a/2context.vim
+++ b/2context.vim
@@ -8,6 +8,11 @@
 " output buffer. The script parses content line-by-line from the first buffer
 " and pastes the modified result on the second buffer.
 
+" Compare a char of  at  with some Unicode 
+function UnicodeCompare(string, bytepos, ochar)
+return strpart(a:string, a:bytepos, max([strlen(a:ochar), 1])) ==# a:ochar
+endfunction
+
 " Split screen and go to the second buffer, ensure modifiable is set, and the
 " buffer is empty.
 sblast 
@@ -38,9 +43,9 @@ if !exists("highlight")
   let highlight=[]
 endif
 
-" Set escapecomments
-if !exists("escapecomments")
-  let escapecomments=0
+" Set escapechar
+if !exists("escapechar")
+  let escapechar=''
 endif
 
 let s:strip = strlen( matchstr( getline(s:lstart), '^\s*' ) )
@@ -71,37 +76,48 @@ let s:lines = []
 let s:buffer_lnum = 1
 let s:lnum = s:lstart
 
+let s:lenesc = strlen(escapechar)
+
 while s:lnum <= s:lstop

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-17 Thread Aditya Mahajan

On Mon, 17 Jul 2017, Gerion Entrup wrote:


Hi,

I have two questions with the vim module.

1. I want to use the math mode inside the code. I've seen the escape option, 
e.g. here [1], but this seems to work only with comments. Is there a 
possibility to use it directly in the code, too?


Short answer. No.

Long answer. t-vim relies on vim to syntax highlight the code. Since the 
code is not valid python, the default python syntax highlighting will not 
work. In principle, it is possible to write a vim syntax highlighting 
script for a derivative of python where math terms are allowed, but that 
requires a lot of work for each language. The whole point of t-vim module 
was that I am lazy and don't want to write the parser for each language 
:-)



Minimal example:
```
\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on]

\starttext
\startpython
# Returns \m{\sum_{i=1}^{n}i}
def sum_upto(\m{n \in \mathbb{N}})
   r = range(1, \m{n} + 1)
   return sum(r)
\stoppython
\stoptext
```


Another option will be to use the algorithmic module: 
https://bitbucket.org/wolfs/algorithmic/src/

2. It would be cool, if I can define some background color for the code. 
Unfortunately I'm very new to context and haven't seen a direct option. I 
assume this is possible with some kind of extra environment around the code?


You can add

\setupbackground[background=color, backgroundcolor=gray]

\setupvimtyping[python]
[
  before={\startbackground},
  after={\stopbackground},
]

or, instead of modifying the default background, define a new background 
and use that.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-17 Thread Henri Menke
On Mon, 2017-07-17 at 21:13 +0200, Gerion Entrup wrote:
> Hi,
> 
> I have two questions with the vim module.
> 
> 1. I want to use the math mode inside the code. I've seen the escape option, 
> e.g. here [1], but this seems to work only with comments. Is there a 
> possibility to use it directly in the code, too?
> 
> Minimal example:
> ```
> \usemodule[vim]
> \definevimtyping[python][syntax=python, escape=on]
> 
> \starttext
> \startpython
> # Returns \m{\sum_{i=1}^{n}i}
> def sum_upto(\m{n \in \mathbb{N}})
> r = range(1, \m{n} + 1)
> return sum(r)
> \stoppython
> \stoptext
> ```
> 
> 2. It would be cool, if I can define some background color for the code. 
> Unfortunately I'm very new to context and haven't seen a direct option. I 
> assume this is possible with some kind of extra environment around the code?

Background is no problem, escape in code is not implemented in t-vim.  I filed 
a feature request for
/BTEX ... /ETEX escaping as in regular typing on Aditya's GitHub: 
https://github.com/adityam/filter/
issues/23


\definetextbackground
  [verbatim]
  [location=paragraph]

\usemodule[vim]

\definevimtyping
  [python]
  [syntax=python,
   escape=on,
   before={\starttextbackground[verbatim]},
   after={\stoptextbackground}]

\setuptyping
  [before={\starttextbackground[verbatim]},
   after={\stoptextbackground}]

\starttext

\starttyping[escape=yes]
# Returns /BTEX\m{\sum_{i=1}^{n}i}/ETEX
def sum_upto(/BTEX\m{n \in \mathbb{N}}/ETEX)
r = range(1, \m{n} + 1)
return sum(r)
\stoptyping

\startpython
# Returns \m{\sum_{i=1}^{n}i}
def sum_upto(\m{n \in \mathbb{N}}w)
r = range(1, \m{n} + 1)
return sum(r)
\stoppython

\stoptext


> (I've subscribed the list, so you don't have to CC me.)
> 
> Thank you in advance,
> Gerion
> 
> ___
> 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] t-vim module: math in "normal" code and background color

2017-07-17 Thread Gerion Entrup
Hi,

I have two questions with the vim module.

1. I want to use the math mode inside the code. I've seen the escape option, 
e.g. here [1], but this seems to work only with comments. Is there a 
possibility to use it directly in the code, too?

Minimal example:
```
\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on]

\starttext
\startpython
# Returns \m{\sum_{i=1}^{n}i}
def sum_upto(\m{n \in \mathbb{N}})
r = range(1, \m{n} + 1)
return sum(r)
\stoppython
\stoptext
```

2. It would be cool, if I can define some background color for the code. 
Unfortunately I'm very new to context and haven't seen a direct option. I 
assume this is possible with some kind of extra environment around the code?

(I've subscribed the list, so you don't have to CC me.)

Thank you in advance,
Gerion

___
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] \setupfooter[color=red]: red color spills with float over next page

2016-12-19 Thread Benjamin Buchmuller
Hi Hans,

the patch solves the issue. Thank you for the fast reply.

With regard to Pablo’s question: When I would not use crop in the MWE, 
apparently I would get the desired output indeed. However, in the situation I 
was using the command to produce a document, I would need to crop some parts of 
a figure. I should have been a little bit more clear on this, I guess.

Thanks again,


Benjamin
___
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] \setupfooter[color=red]: red color spills with float over next page

2016-12-19 Thread Hans Hagen

On 12/18/2016 11:00 PM, Benjamin Buchmuller wrote:

Hi Hans,

I finally managed to make a MWE. The issue is related to me using \clip{…} onto 
external figures I would like to crop in conjunction with a colored footer 
set-up:

\starttext

\setupfooter[color=red]

\setupfootertexts
[]
[]
[any text] % issue related to put something in footer ...
[]

\input knuth

\input knuth

\input knuth

% … and moving to the top of the next page

\startplacefigure
[
width=fit,
title={
\input bryson
},
]
\clip[height=7.0cm]{ % issue related to clip
\externalfigure[fig_4.jpg][height=7.0cm, width=\textwidth]
}
\stopplacefigure

\stoptext


in back-pdf.mkiv you can patch this:

\unexpanded\def\dostartclipping#1#2#3%
  {\forcecolorhack % add this
   \PointsToBigPoints{#2}\width
   \PointsToBigPoints{#3}\height

and run

context --make


Thank you for your help.


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

Re: [NTG-context] \setupfooter[color=red]: red color spills with float over next page

2016-12-18 Thread Pablo Rodriguez
On 12/18/2016 11:00 PM, Benjamin Buchmuller wrote:
> Hi Hans,
> 
> I finally managed to make a MWE. The issue is related to me using
> \clip{…} onto external figures I would like to crop in conjunction with
> a colored footer set-up:

Hallo Benjamin,

my question may be stupid, but what happens if you don’t use \clip?

Pablo

> \starttext
> 
> \setupfooter[color=red]
>   
> \setupfootertexts
>   []
>   []
>   [any text] % issue related to put something in footer ...
>   []
> 
> \input knuth
> 
> \input knuth
> 
> \input knuth
> 
> % … and moving to the top of the next page
> 
> \startplacefigure
>   [
>   width=fit,
>   title={
> \input bryson
>   },
>   ]
>   \clip[height=7.0cm]{ % issue related to clip
>   \externalfigure[fig_4.jpg][height=7.0cm, width=\textwidth]
>   }
> \stopplacefigure
> 
> \stoptext
> 
> Thank you for your help.
> 
> 
> Benjamin
> ___
> 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
> ___
> 


-- 
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] \setupfooter[color=red]: red color spills with float over next page

2016-12-18 Thread Benjamin Buchmuller
Hi Hans,

I finally managed to make a MWE. The issue is related to me using \clip{…} onto 
external figures I would like to crop in conjunction with a colored footer 
set-up:

\starttext

\setupfooter[color=red]

\setupfootertexts
[]
[]
[any text] % issue related to put something in footer ...
[]

\input knuth

\input knuth

\input knuth

% … and moving to the top of the next page

\startplacefigure
[
width=fit,
title={
\input bryson
},
]
\clip[height=7.0cm]{ % issue related to clip
\externalfigure[fig_4.jpg][height=7.0cm, width=\textwidth]
}
\stopplacefigure

\stoptext

Thank you for your help.


Benjamin
___
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] \setupfooter[color=red]: red color spills with float over next page

2016-12-04 Thread Benjamin Buchmuller
Hi Hans,

thank you for your help. I tried exactly as you suggested, which worked fine, 
but adopting for the case being with 
\setupfootertexts[\strut{\color[MyColor]{footers}}\strut][][][…same…] (further, 
footer texts change in the course of the document and call markings, page 
numbers etc.), I ended up with the same result as before. 

I will provide a minimal example as soon as possible next week. 

Cheers, Benjamin 

> On 4 Dec 2016, at 12:00, ntg-context-requ...@ntg.nl wrote:
> 
> Send ntg-context mailing list submissions to
>   ntg-context@ntg.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   https://mailman.ntg.nl/mailman/listinfo/ntg-context
> or, via email, send a message with subject or body 'help' to
>   ntg-context-requ...@ntg.nl
> 
> You can reach the person managing the list at
>   ntg-context-ow...@ntg.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ntg-context digest..."
> Today's Topics:
> 
>   1. \setupfooter[color=red]: red color spills with float over
>  next page (Benjamin Buchmuller)
>   2. Re: \setupfooter[color=red]: red color spills with float over
>  next page (Hans Hagen)
> 
> From: Benjamin Buchmuller <benjamin.buchmul...@gmail.com>
> Subject: [NTG-context] \setupfooter[color=red]: red color spills with float 
> over next page
> Date: 4 December 2016 at 04:05:49 CET
> To: ntg-context@ntg.nl
> Reply-To: mailing list for ConTeXt users <ntg-context@ntg.nl>
> 
> 
> When I have
> 
> \setupfooter[color=red, style=bold] (same goes with \setupfooter[style=red])
> 
> and a
> 
> tex text text
> 
> % <<<< page breaks here after typesetting >>>>
> 
> \startplacefigure[
>   %location=force, % no matter what I do here
>   title={Caption.}
> ]
> … something …
> \stopplacefigure
> 
> other text
> 
> that is moved to the following page as first object, the entire page 
> including the figure’s rulers, caption, and the regular text prints in red 
> (but not bold!?) when I incorporate the file via \component … into my 
> project, but not when I typeset from within \startcomponent … \stopcomponent.
> 
> Since “bold” does not seem to float the same way, I guess it is related to 
> color handling at page breaks somehow.
> 
> I already tried to \setupfloats[before=\strut] to “force” black bodyfont 
> right before the figure (at least this is what I intended to do), but did not 
> work.
> 
> I’m sorry not to be able to provide a more elaborate minimal example 
> asserting the exact conditionals of this behaviour at the moment as I need to 
> hand in a report next week. Probably the footers have to go black this time.
> 
> Any suggestions?
> 
> Thank you for your help.
> 
> 
> Benjamin
> 
> 
> 
> From: Hans Hagen <pra...@wxs.nl>
> Subject: Re: [NTG-context] \setupfooter[color=red]: red color spills with 
> float over next page
> Date: 4 December 2016 at 11:42:19 CET
> To: ntg-context@ntg.nl
> Reply-To: mailing list for ConTeXt users <ntg-context@ntg.nl>
> 
> 
>> On 12/4/2016 4:05 AM, Benjamin Buchmuller wrote:
>> When I have
>> 
>> \setupfooter[color=red, style=bold] (same goes with \setupfooter[style=red])
>> 
>> and a
>> 
>> tex text text
>> 
>> % <<<< page breaks here after typesetting >>>>
>> 
>> \startplacefigure[
>>  %location=force, % no matter what I do here
>>  title={Caption.}
>> ]
>> … something …
>> \stopplacefigure
>> 
>> other text
>> 
>> that is moved to the following page as first object, the entire page 
>> including the figure’s rulers, caption, and the regular text prints in red 
>> (but not bold!?) when I incorporate the file via \component … into my 
>> project, but not when I typeset from within \startcomponent … \stopcomponent.
>> 
>> Since “bold” does not seem to float the same way, I guess it is related to 
>> color handling at page breaks somehow.
>> 
>> I already tried to \setupfloats[before=\strut] to “force” black bodyfont 
>> right before the figure (at least this is what I intended to do), but did 
>> not work.
>> 
>> I’m sorry not to be able to provide a more elaborate minimal example 
>> asserting the exact conditionals of this behaviour at the moment as I need 
>> to hand in a report next week. Probably the footers have to go black this 
>> time.
>> 
>> Any suggestions?
> 
> not many as i really need an example
> 
> you can try
> 
> \setupfootertexts[\strut{\red foo}\strut}
> 
> ins

Re: [NTG-context] \setupfooter[color=red]: red color spills with float over next page

2016-12-04 Thread Hans Hagen

On 12/4/2016 4:05 AM, Benjamin Buchmuller wrote:

When I have

\setupfooter[color=red, style=bold] (same goes with \setupfooter[style=red])

and a

tex text text

% <<<< page breaks here after typesetting >>>>

\startplacefigure[
%location=force, % no matter what I do here
title={Caption.}
]
… something …
\stopplacefigure

other text

that is moved to the following page as first object, the entire page including 
the figure’s rulers, caption, and the regular text prints in red (but not 
bold!?) when I incorporate the file via \component … into my project, but not 
when I typeset from within \startcomponent … \stopcomponent.

Since “bold” does not seem to float the same way, I guess it is related to 
color handling at page breaks somehow.

I already tried to \setupfloats[before=\strut] to “force” black bodyfont right 
before the figure (at least this is what I intended to do), but did not work.

I’m sorry not to be able to provide a more elaborate minimal example asserting 
the exact conditionals of this behaviour at the moment as I need to hand in a 
report next week. Probably the footers have to go black this time.

Any suggestions?


not many as i really need an example

you can try

\setupfootertexts[\strut{\red foo}\strut}

instead

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
___

[NTG-context] \setupfooter[color=red]: red color spills with float over next page

2016-12-03 Thread Benjamin Buchmuller
When I have

\setupfooter[color=red, style=bold] (same goes with \setupfooter[style=red])

and a

tex text text

% <<<< page breaks here after typesetting >>>>

\startplacefigure[
%location=force, % no matter what I do here
title={Caption.}
]
… something …
\stopplacefigure

other text

that is moved to the following page as first object, the entire page including 
the figure’s rulers, caption, and the regular text prints in red (but not 
bold!?) when I incorporate the file via \component … into my project, but not 
when I typeset from within \startcomponent … \stopcomponent.

Since “bold” does not seem to float the same way, I guess it is related to 
color handling at page breaks somehow.

I already tried to \setupfloats[before=\strut] to “force” black bodyfont right 
before the figure (at least this is what I intended to do), but did not work.

I’m sorry not to be able to provide a more elaborate minimal example asserting 
the exact conditionals of this behaviour at the moment as I need to hand in a 
report next week. Probably the footers have to go black this time.

Any suggestions?

Thank you for your help.


Benjamin
___
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] Change the color of the number of subsection

2016-07-27 Thread Wolfgang Schuster

Fabrice Couvreur 
27. Juli 2016 um 12:32
Hi Henri,
Thank you, it works. What's weird is that I used \setuphead 
[subsection][...] once unsuccessfully probably a mistake on my part.
When you’re unsure which keys and values are available for a command 
take a look into the command reference which is included in each context 
release as i-context.pdf and also available on Hans server with variants 
for each interface: http://pragma-ade.nl/show-man-5.htm


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] Change the color of the number of subsection

2016-07-27 Thread Fabrice Couvreur
Hi Henri,
Thank you, it works. What's weird is that I used \setuphead [subsection][...
] once unsuccessfully probably a mistake on my part.
Fabrice

2016-07-27 12:23 GMT+02:00 Henri Menke <henrime...@gmail.com>:

> Hi Fabrice,
>
> use \setuphead (see below).
>
> Cheers, Henri
>
> ---
>
> \starttext
>
> \setuphead
>   [subsection]
>   [
>     sectionsegments=subsection:subsection,
> color=darkred,
>   ]
>
> \startsubsection[title={Recherche d'une fonction sous contraintes}]
> \stopsubsection
>
> \stoptext
>
> On 07/27/2016 11:24 AM, Fabrice Couvreur wrote:
> > Hello,
> > With this
> >
> > \startsubsection
> >[title={\darkred Recherche d'une fonction sous contraintes},
> > sectionsegments=subsection:subsection,
> > numbercommand={\darkred}]
> >
> > it does not work.
> > Thanks
> > Fabrice
> >
> >
> >
> ___
> > 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
> >
> ___
> >
>
>
> ___
> 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
>
> ___
___
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] Change the color of the number of subsection

2016-07-27 Thread Henri Menke
Hi Fabrice,

use \setuphead (see below).

Cheers, Henri

---

\starttext

\setuphead
  [subsection]
  [
sectionsegments=subsection:subsection,
color=darkred,
  ]

\startsubsection[title={Recherche d'une fonction sous contraintes}]
\stopsubsection

\stoptext

On 07/27/2016 11:24 AM, Fabrice Couvreur wrote:
> Hello,
> With this
> 
> \startsubsection
>[title={\darkred Recherche d'une fonction sous contraintes},
> sectionsegments=subsection:subsection,
> numbercommand={\darkred}]
> 
> it does not work.
> Thanks
> Fabrice
> 
> 
> ___
> 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
> ___
> 

___
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] Change the color of the number of subsection

2016-07-27 Thread Fabrice Couvreur
Hello,
With this

\startsubsection
   [title={\darkred Recherche d'une fonction sous contraintes},
sectionsegments=subsection:subsection,
numbercommand={\darkred}]

it does not work.
Thanks
Fabrice
___
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] TikZ node and color

2016-07-06 Thread Christoph Reller
On Tue, 5 Jul 2016 10:21:48 +0200, Hans Hagen <pra...@wxs.nl> wrote:
> On 7/5/2016 9:25 AM, Christoph Reller wrote:
>> Dear List,
>>
>> I use the latest version of ConTeXt and I have the following MWE:
>>
>> \usemodule[tikz]
>> \starttext
>>   \starttikzpicture
>> \node {\color[red]{red}};
>> \node[xshift=30] {\color[red]{not red}};
>>   \stoptikzpicture
>> \stoptext
>>
>> Can anybody tell me why the second node is not colored red?
>>
>> Aside: In LaTeX when using \color{red}{...} this tikzpicture renders
>> correctly. For LaTeX I use TikZ version 3.0.1a, in ConTeXt it seems to
>> be version 3.0.1.
>>
>> Any feedback is welcome.
>
> tikz has its own color mechanisms and they don't mix well with context
> color support so context probbably thinks it's still in red (so you need
> to force something non red in front)
>
> \starttikzpicture
>  \node {\color[red]{red}};
>  \node[xshift=30] {\zwnj\color[red]{not red}};
> \stoptikzpicture

Thank you Hans! This workaround does the job.

For those interested: The \zwnj can be prepended automatically to
every node by setting "every node/.add code=\zwnj". The updated MWE
now is:

\usemodule[tikz]
\tikzset{every node/.add code=\zwnj}
\starttext
  \starttikzpicture
\node {\color[red]{red}};
\node[xshift=30] {\color[red]{not red}};
  \stoptikzpicture
\stoptext

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
___

Re: [NTG-context] TikZ node and color

2016-07-05 Thread Hans Hagen

On 7/5/2016 9:25 AM, Christoph Reller wrote:

Dear List,

I use the latest version of ConTeXt and I have the following MWE:

\usemodule[tikz]
\starttext
  \starttikzpicture
\node {\color[red]{red}};
\node[xshift=30] {\color[red]{not red}};
  \stoptikzpicture
\stoptext

Can anybody tell me why the second node is not colored red?

Aside: In LaTeX when using \color{red}{...} this tikzpicture renders
correctly. For LaTeX I use TikZ version 3.0.1a, in ConTeXt it seems to
be version 3.0.1.

Any feedback is welcome.


tikz has its own color mechanisms and they don't mix well with context 
color support so context probbably thinks it's still in red (so you need 
to force something non red in front)


\starttikzpicture
\node {\color[red]{red}};
\node[xshift=30] {\zwnj\color[red]{not red}};
\stoptikzpicture


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

[NTG-context] TikZ node and color

2016-07-05 Thread Christoph Reller
Dear List,

I use the latest version of ConTeXt and I have the following MWE:

\usemodule[tikz]
\starttext
  \starttikzpicture
\node {\color[red]{red}};
\node[xshift=30] {\color[red]{not red}};
  \stoptikzpicture
\stoptext

Can anybody tell me why the second node is not colored red?

Aside: In LaTeX when using \color{red}{...} this tikzpicture renders
correctly. For LaTeX I use TikZ version 3.0.1a, in ConTeXt it seems to
be version 3.0.1.

Any feedback is welcome.

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

Re: [NTG-context] Set default background color or pattern for tables

2016-05-30 Thread Nicola

On 2016-05-30 16:45:37 +, Wolfgang Schuster said:


Nicola 30. Mai 2016 um 17:45
I'd like to set a default background color for all the tables in my document.
This is what I have tried (using the latest beta):

\setuptables[background=color,backgroundcolor=red]
\starttext
\starttable[|cm|]
   \HL
   \NC \bf R \NC \AR
   \NC A \NC \AR
   \HL
   \NC \bot  \NC \AR
   \NC 1 \NC \AR
 \stoptable
\stoptext

No red background, though. What am I missing?

The next step would be how to use a hatched pattern, but for now I'd
be happy with a flat color.
The table environment does not support backgrounds but you can use the 
tabulate environment.


\starttext

\defineframedcontent[nicola][frame=off,background=color,backgroundcolor=yellow]

\setuptabulate[frame=nicola]


Thanks, it works! And it does with tables, too. From there, I think I 
know how to use a

MetaPost pattern instead.

Nicola


___
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] Set default background color or pattern for tables

2016-05-30 Thread Wolfgang Schuster

Nicola <mailto:nvitacolo...@gmail.com>
30. Mai 2016 um 17:45
I'd like to set a default background color for all the tables in my 
document.

This is what I have tried (using the latest beta):

\setuptables[background=color,backgroundcolor=red]
\starttext
\starttable[|cm|]
   \HL
   \NC \bf R \NC \AR
   \NC A \NC \AR
   \HL
   \NC \bot  \NC \AR
   \NC 1 \NC \AR
 \stoptable
\stoptext

No red background, though. What am I missing?

The next step would be how to use a hatched pattern, but for now I'd
be happy with a flat color.
The table environment does not support backgrounds but you can use the 
tabulate environment.


\starttext

\defineframedcontent[nicola][frame=off,background=color,backgroundcolor=yellow]

\setuptabulate[frame=nicola]

\starttabulate[|k{0.25}cm|]
\HL
\NC \bf R \NC\NR
\NC A \NC\NR
\HL
\NC \bot  \NC\NR
\NC 1 \NC\NR
\stoptabulate

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

[NTG-context] Set default background color or pattern for tables

2016-05-30 Thread Nicola

I'd like to set a default background color for all the tables in my document.
This is what I have tried (using the latest beta):

\setuptables[background=color,backgroundcolor=red]
\starttext
\starttable[|cm|]
   \HL
   \NC \bf R \NC \AR
   \NC A \NC \AR
   \HL
   \NC \bot  \NC \AR
   \NC 1 \NC \AR
 \stoptable
\stoptext

No red background, though. What am I missing?

The next step would be how to use a hatched pattern, but for now I'd
be happy with a flat color.

Nicola



___
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] Ligature color is not reliable

2016-04-11 Thread Jan Tosovsky
On 2016-04-11 Hans Hagen wrote:
> On 4/11/2016 9:06 PM, Jan Tosovsky wrote:
> > On 2016-04-09 Jan Tosovsky wrote:
> >>
> >> for an illustration I wanted to colorize all ligatures, but the
> >> following method is not reliable for three character ligatures
> >> - which ends up black.
> >>
> >> While tested with Palatino, it can be simulated even with
> >> a default font (however there are missing ffi and ffl ligatures).
> >>
> >> \definefontfamily[palatino][rm][Palatino Linotype]
> >> [features={default, quality}]
> >> \setupbodyfont[palatino]
> >>
> >> \starttext
> >> Je{\red ff}, the o{\red ffi}ce on the {\red fi}rst {\red fl}oor
> >> is o{\red ffl}ine.
> >> \stoptext
> >>
> >> What is happening here?
> >>
> >
> > Any idea how to properly colorize those ligatures?
> 
> update

Wow! It works now, thanks a lot!

Jan

___
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] Ligature color is not reliable

2016-04-11 Thread Hans Hagen

On 4/11/2016 9:06 PM, Jan Tosovsky wrote:

On 2016-04-09 Jan Tosovsky wrote:


for an illustration I wanted to colorize all ligatures, but the
following method is not reliable for three character ligatures
- which ends up black.

While tested with Palatino, it can be simulated even with
a default font (however there are missing ffi and ffl ligatures).

\definefontfamily[palatino][rm][Palatino Linotype]
[features={default, quality}]
\setupbodyfont[palatino]

\starttext
Je{\red ff}, the o{\red ffi}ce on the {\red fi}rst {\red fl}oor
is o{\red ffl}ine.
\stoptext

What is happening here?



Any idea how to properly colorize those ligatures?


update

-
  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] Ligature color is not reliable

2016-04-11 Thread Jan Tosovsky
On 2016-04-09 Jan Tosovsky wrote:
> 
> for an illustration I wanted to colorize all ligatures, but the
> following method is not reliable for three character ligatures 
> - which ends up black.
> 
> While tested with Palatino, it can be simulated even with 
> a default font (however there are missing ffi and ffl ligatures).
> 
> \definefontfamily[palatino][rm][Palatino Linotype]
> [features={default, quality}]
> \setupbodyfont[palatino]
> 
> \starttext
> Je{\red ff}, the o{\red ffi}ce on the {\red fi}rst {\red fl}oor 
> is o{\red ffl}ine.
> \stoptext
> 
> What is happening here?
> 

Any idea how to properly colorize those ligatures?

Thanks, Jan

___
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] Ligature color is not reliable

2016-04-09 Thread Jan Tosovsky
Dear All,

for an illustration I wanted to colorize all ligatures, but the following
method is not reliable for three character ligatures - which ends up black.

While tested with Palatino, it can be simulated even with a default font
(however there are missing ffi and ffl ligatures).

\definefontfamily[palatino][rm][Palatino Linotype][features={default,
quality}]
\setupbodyfont[palatino]

\starttext
Je{\red ff}, the o{\red ffi}ce on the {\red fi}rst {\red fl}oor is o{\red
ffl}ine.
\stoptext

What is happening here? 

Thanks, Jan

___
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] color (rendering) intent

2015-08-10 Thread Hans Hagen

On 8/10/2015 5:23 PM, Henning Hraban Ramm wrote:


Am 2015-08-10 um 17:52 schrieb Hans Hagen pra...@wxs.nl:


On 8/10/2015 10:28 AM, Henning Hraban Ramm wrote:

Hi,
in http://wiki.contextgarden.net/Context_2009.10.27#Data_files
there’s:
• new parameter for \setupcolors: intent=none|overprint|knockout

I had \setupcolors[intent=overprint] in my environments, but since a few betas, 
I get „overprint“ printed on all pages, messing with the layout.


fixed in beta


Thank you! So I can document that key for \setupcolors? (Does it do anything? 
Different from \setupbackend?)


it should add some group info in the pdf


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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] color (rendering) intent

2015-08-10 Thread Henning Hraban Ramm

Am 2015-08-10 um 17:52 schrieb Hans Hagen pra...@wxs.nl:

 On 8/10/2015 10:28 AM, Henning Hraban Ramm wrote:
 Hi,
 in http://wiki.contextgarden.net/Context_2009.10.27#Data_files
 there’s:
  • new parameter for \setupcolors: intent=none|overprint|knockout
 
 I had \setupcolors[intent=overprint] in my environments, but since a few 
 betas, I get „overprint“ printed on all pages, messing with the layout.
 
 fixed in beta

Thank you! So I can document that key for \setupcolors? (Does it do anything? 
Different from \setupbackend?)


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] color (rendering) intent

2015-08-10 Thread Peter Rolf
Am 10.08.2015 um 18:58 schrieb Hans Hagen:
 On 8/10/2015 5:23 PM, Henning Hraban Ramm wrote:

 Am 2015-08-10 um 17:52 schrieb Hans Hagen pra...@wxs.nl:

 On 8/10/2015 10:28 AM, Henning Hraban Ramm wrote:
 Hi,
 in http://wiki.contextgarden.net/Context_2009.10.27#Data_files
 there’s:
 • new parameter for \setupcolors: intent=none|overprint|knockout

 I had \setupcolors[intent=overprint] in my environments, but since a
 few betas, I get „overprint“ printed on all pages, messing with the
 layout.

 fixed in beta

 Thank you! So I can document that key for \setupcolors? (Does it do
 anything? Different from \setupbackend?)
 
 it should add some group info in the pdf
 


If I remember correctly this sets the complete document (global) to
'overprint' (or 'knockout'). Only useful for grayscale only documents.
Don't set this parameter, if you want to use local overprinting (or
knockout)! There should be a warning about this in the documentation.

The \setupcolors setting is also far older than the PDF/A|X related
output 'intent' parameter in \setupbackend. No direct relation other
than that both parameters are prepress options.


Greetings,  Peter
___
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] color (rendering) intent

2015-08-10 Thread Henning Hraban Ramm
Am 2015-08-11 um 01:12 schrieb Peter Rolf indi...@gmx.net:

 Thank you! So I can document that key for \setupcolors? (Does it do
 anything? Different from \setupbackend?)
 
 it should add some group info in the pdf
 
 If I remember correctly this sets the complete document (global) to
 'overprint' (or 'knockout'). Only useful for grayscale only documents.
 Don't set this parameter, if you want to use local overprinting (or
 knockout)! There should be a warning about this in the documentation.
 
 The \setupcolors setting is also far older than the PDF/A|X related
 output 'intent' parameter in \setupbackend. No direct relation other
 than that both parameters are prepress options.

Thank you, I documented that in  
http://wiki.contextgarden.net/Command/setupcolors

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] color (rendering) intent

2015-08-10 Thread Henning Hraban Ramm
Hi,
in http://wiki.contextgarden.net/Context_2009.10.27#Data_files
there’s:
• new parameter for \setupcolors: intent=none|overprint|knockout

I had \setupcolors[intent=overprint] in my environments, but since a few betas, 
I get „overprint“ printed on all pages, messing with the layout.
Now I changed this to \setupcolors[intent={Uncoated FOGRA29 (ISO 
12647-2:2004)}], and it works again. As far as I can see, it doesn’t change 
anything, I find no color intent mentioned in the PDF.

The color profiles are listed in http://wiki.contextgarden.net/PDFX for 
\setupbackend; intent in \setupcolors is not documented.

Can you shed any light on that?


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] color (rendering) intent

2015-08-10 Thread Hans Hagen

On 8/10/2015 10:28 AM, Henning Hraban Ramm wrote:

Hi,
in http://wiki.contextgarden.net/Context_2009.10.27#Data_files
there’s:
• new parameter for \setupcolors: intent=none|overprint|knockout

I had \setupcolors[intent=overprint] in my environments, but since a few betas, 
I get „overprint“ printed on all pages, messing with the layout.


fixed in beta

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___

[NTG-context] Wiki page on color

2015-06-10 Thread Aditya Mahajan

Hi,

I am doing a major overhaul of the wiki page on colors. The current 
page[1] had become tangled up with time and I think that it is better to 
reorganize the information.


Since this is a major change, rather than simply editing the wiki page, I 
have created a new page[2].


Please take a look at both pages:

[1]: http://wiki.contextgarden.net/Color
[2]: http://wiki.contextgarden.net/Color/sandbox

If you think that there is information on the original page that needs 
to go to the new page, move it there. After a few days, I'll move page [2] 
to page [1].


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] URLs in color including underbar

2015-05-18 Thread Alexander Shukaev

 ​​
 \definebar[urlbar][underbar]

 \setupurl[style=\mono\urlbar,color=blue]


​Interesting, thank you, Hans, it indeed works as expected.  Could you
supplement this with some explanations, i.e. why this one works compared to
using plain `underbar'?​  I assume that the `color' key is overridden
by `setupurl' in the case of `urlbar' but not in the case of `underbar',
why?

Regards,
Alexander
___
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] URLs in color including underbar

2015-05-18 Thread Alexander Shukaev
Hello,

So far I came up with the following solution:

\setupurl[
  style={\mono\underbar},
  color={blue},
]

\def
\url{%
  \dosingleargument
  \dourl
}

\def
\dourl[#1]{%
  \begingroup
\setupbar[%
  style={\urlparameter{style}},
  color={\urlparameter{color}},
]%
\from[#1]%
  \endgroup
}

Is there a more natural way to make URLs appear in blue color including
underbar?  Thanks.

Kind regards,
Alexander
___
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] URLs in color including underbar

2015-05-18 Thread Hans Hagen

On 5/17/2015 8:07 PM, Alexander Shukaev wrote:

Hello,

So far I came up with the following solution:

\setupurl[
   style={\mono\underbar},
   color={blue},
]

\def
\url{%
   \dosingleargument
   \dourl
}

\def
\dourl[#1]{%
   \begingroup
 \setupbar[%
   style={\urlparameter{style}},
   color={\urlparameter{color}},
 ]%
 \from[#1]%
   \endgroup
}

Is there a more natural way to make URLs appear in blue color including


maybe just:

\definebar[urlbar][underbar]

\setupurl[style=\mono\urlbar,color=blue]



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___

[NTG-context] \starttyping font changes when option=color

2015-04-09 Thread Robin.Kirkham
Folks,

Switching the option to “color” in \setuptyping has the effect of resetting the 
font from typewriter (constant width) to paragraph font (if you uncomment it in 
the following MWE).

I don’t see why that should be. Is it a bug or can someone explain?

My intent was to use syntax colourisation for code snippets.

Thanks, Robin


\setupcolors[state=start]

%\setuptyping[typing][option=color]

\starttext
Normal text
\starttyping
Typing text
\stoptyping
\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] \starttyping font changes when option=color

2015-04-09 Thread Wolfgang Schuster

 Am 09.04.2015 um 14:02 schrieb robin.kirk...@csiro.au:
 
 Folks,
 
 Switching the option to “color” in \setuptyping has the effect of resetting 
 the font from typewriter (constant width) to paragraph font (if you uncomment 
 it in the following MWE).
 
 I don’t see why that should be. Is it a bug or can someone explain?

You select syntax highlighting for a language which doesn’t exist.

 My intent was to use syntax colourisation for code snippets.

When you want to highlight TeX code use “option=TEX” and for Lua code use 
“option=LUA”.

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] Color in an environment

2015-03-30 Thread Fabrice

Hi Wolfgang,
I would first like to express once again my admiration for your 
knowledge and attention that you have to explain clearly.
The code is cleaner, but I want the title (DÉFINITION :Expérience 
aléatoire) is not in the colored frame, that is to say, as my original 
code.

Best regards,
Fabrice
___
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] Color in an environment

2015-03-29 Thread Fabrice Couvreur
Hi,

1. In the following code, the color is not included in the \startframedtext
\stopframedtext environment

2. How can the height of the red square adapts to the height of the text ?

3. Can we improve the code ?


Best regards,
Fabrice

\setupcolors[state=start]
\definecolor[mycolor][c=0.00, m=0.10, y=0.20, k=0.00]

\defineenumeration
  [definition]
  [text={\blue DÉFINITION : },
   headstyle={\bf\feature[+][f:smallcaps]},
   headcommand={
   \startMPcode
   u:=0.3cm;
   filldraw (0,0)--(1u,0)--(1u,1u)--(0,1u)--cycle withcolor red ;
   \stopMPcode},
   width=fit,
   alternative=top,
   title=yes,
   titleright=,
   titleleft=,

before={\startframedtext[width=\textwidth,frame=off,background=color,backgroundcolor=\MPcolor{mycolor}]},
   after={\stopframedtext}]

\starttext
\startdefinition{\red Expérience aléatoire}
Une {\bf expérience aléatoire} est une expérience renouvelable dont les
résultats possibles sont connus sans qu'on puisse déterminer lequel sera
réalisé.
\stopdefinition
\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] Color in an environment

2015-03-29 Thread Wolfgang Schuster

 Am 29.03.2015 um 22:05 schrieb Fabrice Couvreur fabrice1.couvr...@gmail.com:
 
 Hi,
 
 1. In the following code, the color is not included in the \startframedtext  
 \stopframedtext environment

Remove the \MPcolor command, it is only needed for meatiest graphics.

You can also remove \setupcolors[state=start] because MkIV enables colors by 
default.

 2. How can the height of the red square adapts to the height of the text ?

You can use the \htofstring command to get the height of a character but the 
command
accepts only text and you can’t use color or font settings in the argument.

 3. Can we improve the code ?


Use keys to set the colors for all elements, you can also remove the \feature 
command
because settings small caps for uppercase text is useless. You should also 
create
a real command for the headcommand key because there can be problems when
context checks for the value of the key.


\definecolor[mycolor][c=0.00, m=0.10, y=0.20, k=0.00]

\define\DefinitionHeadcommand
  {\blackrule
 [ color=red,
   width=\htofstring{D},% width=\htofstring{\enumerationparameter{text}},
  height=\htofstring{D}]%
   \thinspace}

\defineenumeration
  [definition]
  [text={DÉFINITION : },
   headstyle=bold,
   headcommand=\DefinitionHeadcommand,
   headcolor=blue,
   titlecolor=red,
   width=fit,
   alternative=top,
   title=yes,
   titleright=,
   titleleft=,
   
before={\startframedtext[width=\textwidth,frame=off,background=color,backgroundcolor=mycolor]},
   after={\stopframedtext}]

\starttext
\startdefinition{Expérience aléatoire}
Une {\bf expérience aléatoire} est une expérience renouvelable dont les 
résultats possibles sont connus sans qu'on puisse déterminer lequel sera 
réalisé.
\stopdefinition
\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] Strange behavior with the command \color[]{}

2014-11-07 Thread luigi scarso
On Thu, Nov 6, 2014 at 10:28 PM, Herbert Voss herbert.v...@fu-berlin.de
wrote:

 Am 06.11.2014 um 21:16 schrieb luigi scarso:
 
  \definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
 [...]
 
 \setupTABLE[column][1][width=4cm,align={right,lohi},frame=on]%,framecolor=H1prime]



  The problem seems to be
  %,framecolor=H1prime]


 I have no problem with framecolor=H1prime setting.
 I am using ConTeXt minimal copied into my up-to-date TL 2014.

hm the I have just update the TL 2014, and there is still the error. The
latest t-tikz.tex form Hans solves the problems
both in TL 2014 and standalone.




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

Re: [NTG-context] Strange behavior with the command \color[]{}

2014-11-07 Thread Fabrice

Hi,

The
latest t-tikz.tex form Hans solves the problems
both in TL 2014 and standalone.

The same for me,
Fabrice
___
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] Strange behavior with the command \color[]{}

2014-11-06 Thread Hans Hagen

On 11/5/2014 7:41 PM, Fabrice wrote:

Hi Hans,
For spaces parasites, it is my fault because I copy and paste my code.
However, I do not understand why this code does not work :


You need to make real small example as I have no clue what to look at or 
expect (btw, you use \color[geen] which I suppose has to be green).



\usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[cd]
\usetikzlibrary[3d]
\usetikzlibrary[arrows.meta]
\usetikzlibrary[positioning]



\definecolor[H1][c=0.50, m=0.00, y=1.00, k=0.00]
\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]




\tikzset{%
  cube join/.style={
thick, -{Stealth},
  },
  cube face/.style={
minimum size=1cm, outer sep=0pt,
draw=white, thick, line join=round,
shading=ball,
text=white,
  },
  face color/.style={cube face/.append style={ball color=#1}},
  pics/cube/.style args={#1 with #2}{
  code={
\node [cube face, label={[name=-label]below:#2}] (-front) {#1};
\node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
\node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1, xscale=1/3] {};
   }}
}



\starttext

\startsetups[table:initialize]
  \setupTABLE[height=2.5cm,align={middle,lohi}]
\setupTABLE[column][2][[width=3cm,align={right,lohi},frame=off]
\setupTABLE[column][3][[width=8cm,align={right,lohi},frame=off]
  \setupTABLE[1][1][[width=5cm,align={right,lohi},frame=off]
  \setupTABLE[1][2,3][bottomframe=off]
  \setupTABLE[1][3,4][topframe=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[11pt]
\bTR \bTD \color[orange]{\tfa Suite d'instructions
correspondant au
programme de calcul :} \eTD \bTD \eTD \bTD \color[orange]{\tfa Valeur
de la
variable $X$ après l'exécution de chaque instruction :} \eTD \eTR
\bTR
\bTD $X$ prend la valeur $7$ \eTD \bTD \dontleavehmode
\startMPcode
input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor blue ;\stopMPcode \eTD
\bTD On affecte à $X$ la valeur $7$ : la valeur de $X$ est
\color[green]{$7$}. \eTD
\eTR
\bTR
\bTD $X$ prend la valeur $2X$ \eTD \bTD \dontleavehmode
\startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor red ;\stopMPcode\eTD
\bTD On affecte à $X$ la valeur $2X$.\\Comme la valeur de $X$ est
\color[green]{$7$}, la nouvelle valeur de $X$ est :
$2\times\color[green]{7}$.\\La valeur de $X$ est maintenant
\color[green]{$14$}.
 \eTD
\eTR
\bTR
\bTD $X$ prend la valeur $X+3$ \eTD \bTD \dontleavehmode
\startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor green ;\stopMPcode\eTD
\eTR
\bTD On affecte à $X$ la valeur $X+3$.\\Comme la valeur de $X$ est
\color[green]{$14$}, la nouvelle valeur de $X$ est :
$\color[green]{14}+3$.\\La valeur de $X$ est maintenant
\color[green]{$17$}.
 \eTD
\eTABLE{}

\startsetups[table:initialize]
  \setupTABLE[height=2cm,align={middle,lohi}]
\setupTABLE[column][1][[width=4cm,align={right,lohi},frame=on,framecolor=H1]

\setupTABLE[column][2][[width=5cm,align={middle,lohi},frame=off]
\setupTABLE[column][3][[width=1cm,align={middle,lohi},frame=off]
\setupTABLE[column][4][[width=9cm,align={right,lohi},frame=off]
  \setupTABLE[1][1][frame=off]
  \setupTABLE[1][2,3][bottomframe=off]
  \setupTABLE[1][3,4][topframe=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[10pt]
\bTR
\bTD \color[red]{ Suite d'instructions :} \eTD
\bTD \eTD
\bTD \eTD
 \bTD \color[orange]{ Valeur de la variable $A$  et valeur de la variable
$B$ après l'exécution de chaque instruction :}\eTD
\eTR
\bTR
\bTD $A$ prend la valeur $3$ \eTD
\bTD
\starttikzpicture
\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3
with
$A$};\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube={}
with $B$};

\stoptikzpicture
 \eTD
\bTD
\dontleavehmode \startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (1cm,0cm)--(0cm,0cm)  ;\stopMPcode
\eTD
\bTD La valeur de $A$ est \color[green]{3} et $B$  n'a pas encore de
valeur
\eTD
\eTR
\bTR
\bTD $B$ prend la valeur $A+1$ \eTD
\bTD
\starttikzpicture
\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3
with
$A$};
\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube=4 with
$B$};
\stoptikzpicture
\eTD
\bTD
\dontleavehmode \startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (1cm,0cm)--(0cm,0cm)  ;\stopMPcode
\eTD
\bTD Comme la valeur de $A$ est \color[green]{$3$}, la valeur

Re: [NTG-context] Strange behavior with the command \color[]{}

2014-11-06 Thread Fabrice

Hi Hans,
It's true, I'm a little confused. In fact, the problem is the \ 
starttikzpicture \ endtikzpicture.



\usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[3d]
\usetikzlibrary[arrows.meta]
\usetikzlibrary[positioning]
\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]

\tikzset{%
  cube join/.style={
thick, -{Stealth},
  },
  cube face/.style={
minimum size=1cm, outer sep=0pt,
draw=white, thick, line join=round,
shading=ball,
text=white,
  },
  face color/.style={cube face/.append style={ball color=#1}},
  pics/cube/.style args={#1 with #2}{
  code={
\node [cube face, label={[name=-label]below:#2}] (-front) {#1};
\node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
\node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1, xscale=1/3] {};
   }}
}
\starttext
\startsetups[table:initialize]
\setupTABLE[height=2cm,align={middle,lohi}]
\setupTABLE[column][1][[width=4cm,align={right,lohi},frame=on,framecolor=H1prime]
\setupTABLE[column][2][[width=5cm,align={middle,lohi},frame=off]
\setupTABLE[column][3][[width=9cm,align={right,lohi},frame=off]
\setupTABLE[1][1][frame=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[10pt]
\bTR
\bTD \eTD
\eTR
\bTR
\bTD $A$ prend la valeur $3$ \eTD
\bTD
\starttikzpicture
\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3  with
$A$};\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube={}
with $B$};
\stoptikzpicture
\eTD
\bTD La valeur de $A$ est \color[green]{3} et $B$  n'a pas encore de 
valeur

\eTD
\eTR
\eTABLE{}
\stoptext

Best regards,
Fabrice
___
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] Strange behavior with the command \color[]{}

2014-11-06 Thread Aditya Mahajan

On Thu, 6 Nov 2014, Fabrice wrote:


Hi Hans,
It's true, I'm a little confused. In fact, the problem is the \ 
starttikzpicture \ endtikzpicture.


As Hans said, you need to create a smaller example, and explain what you 
mean by the problem.


A blind guess is that \starttikzpicture ... \stoptikzpicture creates a 
\vbox rather than an \hbox. You can try:


\dontleavehode\starttikzpicture ... \stoptikzpicture

or

\hbox{\starttikzpicture ... \stoptikzpicture}

and see if you get the desired output.

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] Strange behavior with the command \color[]{}

2014-11-06 Thread luigi scarso
On Thu, Nov 6, 2014 at 7:50 PM, Fabrice couvreur.fabr...@wanadoo.fr wrote:

 Hi Hans,
 It's true, I'm a little confused. In fact, the problem is the \
 starttikzpicture \ endtikzpicture.

\usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[3d]
\usetikzlibrary[arrows.meta]
\usetikzlibrary[positioning]
\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]

\tikzset{%
  cube join/.style={
thick, -{Stealth},
  },
  cube face/.style={
minimum size=1cm, outer sep=0pt,
draw=white, thick, line join=round,
shading=ball,
text=white,
  },
  face color/.style={cube face/.append style={ball color=#1}},
  pics/cube/.style args={#1 with #2}{
  code={
\node [cube face, label={[name=-label]below:#2}] (-front) {#1};
\node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
\node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1, xscale=1/3] {};
   }}
}
\starttext
\startsetups[table:initialize]
\setupTABLE[height=2cm,align={middle,lohi}]
\setupTABLE[column][1][[width=4cm,align={right,lohi},frame=on,framecolor=H1prime]
\setupTABLE[column][2][[width=5cm,align={middle,lohi},frame=off]
\setupTABLE[column][3][[width=9cm,align={right,lohi},frame=off]
\setupTABLE[1][1][frame=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[10pt]
\bTR
\bTD \eTD
\eTR
\bTR
\bTD $A$ prend la valeur $3$ \eTD
\bTD
%\starttikzpicture
%\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3  with
%$A$};\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube={}
%with $B$};
%\stoptikzpicture
\eTD
\bTD La valeur de $A$ est \color[green]{3} et $B$  n'a pas encore de valeur
\eTD
\eTR
\eTABLE{}


\bTABLE[setups=table:initialize]
\switchtobodyfont[10pt]
\bTR
\bTD \eTD
\eTR
\bTR
\bTD $A$ prend la valeur $3$ \eTD
\bTD
\starttikzpicture
\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3  with
$A$};\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube={}
with $B$};
\stoptikzpicture
\eTD
\bTD La valeur de $A$ est \color[green]{3} et $B$  n'a pas encore de valeur
\eTD
\eTR
\eTABLE{}



\stoptext


The second time
La valeur de $A$ est \color[green]{3}
is green .

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

Re: [NTG-context] Strange behavior with the command \color[]{}

2014-11-06 Thread luigi scarso
On Thu, Nov 6, 2014 at 8:57 PM, luigi scarso luigi.sca...@gmail.com wrote:



 \usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[3d]
\usetikzlibrary[arrows.meta]
\usetikzlibrary[positioning]
\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]

\tikzset{%
  cube join/.style={
thick, -{Stealth},
  },
  cube face/.style={
minimum size=1cm, outer sep=0pt,
draw=white, thick, line join=round,
shading=ball,
text=white,
  },
  face color/.style={cube face/.append style={ball color=#1}},
  pics/cube/.style args={#1 with #2}{
  code={
\node [cube face, label={[name=-label]below:#2}] (-front) {#1};
\node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
\node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1, xscale=1/3] {};
   }}
}
\starttext

\startsetups[table:initialize]
\setupTABLE[height=2cm,align={middle,lohi}]
\setupTABLE[column][1][width=4cm,align={right,lohi},frame=on]%,framecolor=H1prime]
\setupTABLE[column][2][width=5cm,align={middle,lohi},frame=off]
\setupTABLE[column][3][width=9cm,align={right,lohi},frame=off]
\setupTABLE[1][1][frame=off]
\stopsetups


\bTABLE[setups=table:initialize]
\switchtobodyfont[10pt]
\bTR \bTD[n=3] \eTD \eTR
\bTR \bTD $A$ prend la valeur $3$ \eTD
 \bTD
\starttikzpicture
\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3  with
$A$};\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube={}
with $B$};
\stoptikzpicture
\eTD
\bTD \tracingall La valeur de $A$ est\color[green]{3} et $B$  n'a pas
encore de valeur \tracingnone
\eTD
\eTR
\eTABLE{}



\stoptext

The problem seems to be
%,framecolor=H1prime]


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

Re: [NTG-context] Strange behavior with the command \color[]{}

2014-11-06 Thread Hans Hagen

On 11/6/2014 8:57 PM, luigi scarso wrote:



On Thu, Nov 6, 2014 at 7:50 PM, Fabrice couvreur.fabr...@wanadoo.fr
mailto:couvreur.fabr...@wanadoo.fr wrote:

Hi Hans,
It's true, I'm a little confused. In fact, the problem is the \
starttikzpicture \ endtikzpicture.

\usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[3d]
\usetikzlibrary[arrows.meta]
\usetikzlibrary[positioning]
\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]

\tikzset{%
   cube join/.style={
 thick, -{Stealth},
   },
   cube face/.style={
 minimum size=1cm, outer sep=0pt,
 draw=white, thick, line join=round,
 shading=ball,
 text=white,
   },
   face color/.style={cube face/.append style={ball color=#1}},
   pics/cube/.style args={#1 with #2}{
   code={
 \node [cube face, label={[name=-label]below:#2}] (-front) {#1};
 \node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
 \node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1, xscale=1/3] {};
}}
}
\starttext
\startsetups[table:initialize]
\setupTABLE[height=2cm,align={middle,lohi}]
\setupTABLE[column][1][[width=4cm,align={right,lohi},frame=on,framecolor=H1prime]
\setupTABLE[column][2][[width=5cm,align={middle,lohi},frame=off]
\setupTABLE[column][3][[width=9cm,align={right,lohi},frame=off]
\setupTABLE[1][1][frame=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[10pt]
\bTR
\bTD \eTD
\eTR
\bTR
\bTD $A$ prend la valeur $3$ \eTD
\bTD
%\starttikzpicture
%\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3  with
%$A$};\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube={}
%with $B$};
%\stoptikzpicture
\eTD
\bTD La valeur de $A$ est \color[green]{3} et $B$  n'a pas encore de valeur
\eTD
\eTR
\eTABLE{}


the color mechanisms probably interfere ... attached is a t-tikz.tex 
that behaves a bit better ... if it works out ok: feel free to make sure 
that it ends up someplace distributable


Hans



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-


t-tikz.tex
Description: TeX 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] Strange behavior with the command \color[]{}

2014-11-06 Thread Herbert Voss
Am 06.11.2014 um 21:16 schrieb luigi scarso:
 
 \definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
[...]
 \setupTABLE[column][1][width=4cm,align={right,lohi},frame=on]%,framecolor=H1prime]



 The problem seems to be 
 %,framecolor=H1prime]


I have no problem with framecolor=H1prime setting.
I am using ConTeXt minimal copied into my up-to-date TL 2014.

Herbert

___
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] Strange behavior with the command \color[]{}

2014-11-05 Thread Hans Hagen

On 11/4/2014 8:28 PM, Fabrice wrote:

Hi,
The problem is the \setupTABLE [column] [1] [[width = 4cm, align =
{right, lohi}, frame = on,
FrameColor = H1prime].
We must not put FrameColor = H1prime.


indeed, no spaces ...

width = 4cm

will not set width but width 

and it will set it to  4cm which is a valid dimension as when tex 
scans it it gobbles spaces


 H1prime as color could work in some cases when a color with a space 
in the name is defined


spaces after commas are ignores

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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] Strange behavior with the command \color[]{}

2014-11-05 Thread Fabrice

Hi Hans,
For spaces parasites, it is my fault because I copy and paste my code.
However, I do not understand why this code does not work :


\usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[cd]
\usetikzlibrary[3d]
\usetikzlibrary[arrows.meta]
\usetikzlibrary[positioning]



\definecolor[H1][c=0.50, m=0.00, y=1.00, k=0.00]
\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]




\tikzset{%
  cube join/.style={
thick, -{Stealth},
  },
  cube face/.style={
minimum size=1cm, outer sep=0pt,
draw=white, thick, line join=round,
shading=ball,
text=white,
  },
  face color/.style={cube face/.append style={ball color=#1}},
  pics/cube/.style args={#1 with #2}{
  code={
\node [cube face, label={[name=-label]below:#2}] (-front) {#1};
\node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
\node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1, xscale=1/3] {};
   }}
}



\starttext

\startsetups[table:initialize]
  \setupTABLE[height=2.5cm,align={middle,lohi}]
\setupTABLE[column][2][[width=3cm,align={right,lohi},frame=off]
\setupTABLE[column][3][[width=8cm,align={right,lohi},frame=off]
  \setupTABLE[1][1][[width=5cm,align={right,lohi},frame=off]
  \setupTABLE[1][2,3][bottomframe=off]
  \setupTABLE[1][3,4][topframe=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[11pt]
\bTR \bTD \color[orange]{\tfa Suite d'instructions 
correspondant au
programme de calcul :} \eTD \bTD \eTD \bTD \color[orange]{\tfa Valeur 
de la

variable $X$ après l'exécution de chaque instruction :} \eTD \eTR
\bTR
\bTD $X$ prend la valeur $7$ \eTD \bTD \dontleavehmode 
\startMPcode

input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor blue ;\stopMPcode \eTD
\bTD On affecte à $X$ la valeur $7$ : la valeur de $X$ est
\color[green]{$7$}. \eTD
\eTR
\bTR
\bTD $X$ prend la valeur $2X$ \eTD \bTD \dontleavehmode
\startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor red ;\stopMPcode\eTD
\bTD On affecte à $X$ la valeur $2X$.\\Comme la valeur de $X$ est
\color[green]{$7$}, la nouvelle valeur de $X$ est :
$2\times\color[green]{7}$.\\La valeur de $X$ est maintenant
\color[green]{$14$}.
 \eTD
\eTR
\bTR
\bTD $X$ prend la valeur $X+3$ \eTD \bTD \dontleavehmode
\startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor green ;\stopMPcode\eTD
\eTR
\bTD On affecte à $X$ la valeur $X+3$.\\Comme la valeur de $X$ est
\color[green]{$14$}, la nouvelle valeur de $X$ est :
$\color[green]{14}+3$.\\La valeur de $X$ est maintenant 
\color[green]{$17$}.

 \eTD
\eTABLE{}

\startsetups[table:initialize]
  \setupTABLE[height=2cm,align={middle,lohi}]
\setupTABLE[column][1][[width=4cm,align={right,lohi},frame=on,framecolor=H1]
\setupTABLE[column][2][[width=5cm,align={middle,lohi},frame=off]
\setupTABLE[column][3][[width=1cm,align={middle,lohi},frame=off]
\setupTABLE[column][4][[width=9cm,align={right,lohi},frame=off]
  \setupTABLE[1][1][frame=off]
  \setupTABLE[1][2,3][bottomframe=off]
  \setupTABLE[1][3,4][topframe=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[10pt]
\bTR
\bTD \color[red]{ Suite d'instructions :} \eTD
\bTD \eTD
\bTD \eTD
 \bTD \color[orange]{ Valeur de la variable $A$  et valeur de la variable
$B$ après l'exécution de chaque instruction :}\eTD
\eTR
\bTR
\bTD $A$ prend la valeur $3$ \eTD
\bTD
\starttikzpicture
\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3  with
$A$};\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube={}
with $B$};

\stoptikzpicture
 \eTD
\bTD
\dontleavehmode \startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (1cm,0cm)--(0cm,0cm)  ;\stopMPcode
\eTD
\bTD La valeur de $A$ est \color[green]{3} et $B$  n'a pas encore de 
valeur

\eTD
\eTR
\bTR
\bTD $B$ prend la valeur $A+1$ \eTD
\bTD
\starttikzpicture
\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3  with
$A$};
\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube=4 with
$B$};
\stoptikzpicture
\eTD
\bTD
\dontleavehmode \startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (1cm,0cm)--(0cm,0cm)  ;\stopMPcode
\eTD
\bTD Comme la valeur de $A$ est \color[green]{$3$}, la valeur de $B$ est :
$\color[geen]{3}+1$, soit \color[red]{$4$}.\\La valeur de $A$ ne 
change pas

: elle reste égale à \color[green]{$3$}.\eTD
\bTR
\bTD $A$ prend la valeur $A+B

Re: [NTG-context] Strange behavior with the command \color[]{}

2014-11-04 Thread Fabrice

Hi,
The problem is the \setupTABLE [column] [1] [[width = 4cm, align = 
{right, lohi}, frame = on,

FrameColor = H1prime].
We must not put FrameColor = H1prime.
Fabrice
___
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] Strange behavior with the command \color[]{}

2014-11-02 Thread Fabrice Couvreur
Hi,
In the code below, if I comment the two lines, it's okay, but if I
uncomment those
two lines, the number of faces of the cubes is not white but black, and there
are pieces of text green.
Best regards,
Fabrice

\usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[cd]
\usetikzlibrary[3d]
\usetikzlibrary[arrows.meta]
\usetikzlibrary[positioning]
%\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
%\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]
\starttext

\startsetups[table:initialize]
  \setupTABLE[height=2.5cm,align={middle,lohi}]
  \setupTABLE[column][2][[width=3cm,align={right,lohi},frame=off]
  \setupTABLE[column][3][[width=8cm,align={right,lohi},frame=off]
  \setupTABLE[1][1][[width=5cm,align={right,lohi},frame=off]
  \setupTABLE[1][2,3][bottomframe=off]
  \setupTABLE[1][3,4][topframe=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[11pt]
\bTR \bTD \color[orange]{\tfa Suite d'instructions correspondant au
programme de calcul :} \eTD \bTD \eTD \bTD \color[orange]{\tfa Valeur de la
variable $X$ après l'exécution de chaque instruction :} \eTD \eTR
\bTR
\bTD $X$ prend la valeur $7$ \eTD \bTD \dontleavehmode \startMPcode
input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor blue  ;\stopMPcode \eTD
\bTD On affecte à $X$ la valeur $7$ : la valeur de $X$ est
\color[green]{$7$}. \eTD
\eTR
\bTR
\bTD $X$ prend la valeur $2X$ \eTD \bTD \dontleavehmode
\startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor red  ;\stopMPcode\eTD
\bTD On affecte à $X$ la valeur $2X$.\\Comme la valeur de $X$ est
\color[green]{$7$}, la nouvelle valeur de $X$ est :
$2\times\color[green]{7}$.\\La valeur de $X$ est maintenant
\color[green]{$14$}.
 \eTD
\eTR
\bTR
\bTD $X$ prend la valeur $X+3$ \eTD \bTD \dontleavehmode
\startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor green  ;\stopMPcode\eTD
\eTR
\bTD On affecte à $X$ la valeur $X+3$.\\Comme la valeur de $X$ est
\color[green]{$14$}, la nouvelle valeur de $X$ est :
$\color[green]{14}+3$.\\La valeur de $X$ est maintenant \color[green]{$17$}.
 \eTD
\eTABLE{}

\startsetups[table:initialize]
  \setupTABLE[height=2cm,align={middle,lohi}]
  \setupTABLE[column][1][[width=4cm,align={right,lohi},frame=on,
framecolor=H1prime]
  \setupTABLE[column][2][[width=5cm,align={middle,lohi},frame=off]
  \setupTABLE[column][3][[width=1cm,align={middle,lohi},frame=off]
  \setupTABLE[column][4][[width=9cm,align={right,lohi},frame=off]
  \setupTABLE[1][1][frame=off]
  \setupTABLE[1][2,3][bottomframe=off]
  \setupTABLE[1][3,4][topframe=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[10pt]
\bTR
\bTD \color[red]{ Suite d'instructions :} \eTD
\bTD \eTD
\bTD \eTD
 \bTD \color[orange]{ Valeur de la variable $A$  et valeur de la variable
$B$ après l'exécution de chaque instruction :}\eTD
\eTR
\bTR
\bTD $A$ prend la valeur $3$ \eTD
\bTD
\tikzset{%
  cube join/.style={
thick, -{Stealth},
  },
  cube face/.style={
minimum size=1cm, outer sep=0pt,
draw=white, thick, line join=round,
shading=ball,
text=white,
  },
  face color/.style={cube face/.append style={ball color=#1}},
  pics/cube/.style args={#1 with #2}{
  code={
\node [cube face, label={[name=-label]below:#2}] (-front) {#1};
\node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
\node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1, xscale=1/3] {};
   }}
}
\starttikzpicture
\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3  with
$A$};\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube={}
with $B$};

\stoptikzpicture
 \eTD
\bTD
\dontleavehmode \startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (1cm,0cm)--(0cm,0cm)  ;\stopMPcode
\eTD
\bTD La valeur de $A$ est \color[green]{3} et $B$  n'a pas encore de valeur
\eTD
\eTR
\bTR
\bTD $B$ prend la valeur $A+1$ \eTD
\bTD
\tikzset{%
  cube join/.style={
thick, -{Stealth},
  },
  cube face/.style={
minimum size=1cm, outer sep=0pt,
draw=white, thick, line join=round,
shading=ball,
text=white, font=\bfseries
  },
 face color/.style={cube face/.append style={ball color=#1}},
  pics/cube/.style args={#1 with #2}{
  code={
\node [cube face, label={[name=-label]below:#2}] (-front) {#1};
\node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
\node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1

[NTG-context] \in, \at but without font/color change in the PDF

2014-08-26 Thread Gerben Wierda
Suppose I want to make a fully classical flat text without interaction (no 
clickable links in the PDF). How do I get this? If I use \in or \at, ConTeXt 
turns them into clickable links. That is not my problem so much, but it also 
changes font to bold and colour to green, and I do not want that.

What do I need to do to make the text classic, that is without font and colour 
change?

G
___
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] \in, \at but without font/color change in the PDF

2014-08-26 Thread Wolfgang Schuster

Am 26.08.2014 um 21:06 schrieb Gerben Wierda gerben.wie...@rna.nl:

 Suppose I want to make a fully classical flat text without interaction (no 
 clickable links in the PDF). How do I get this? If I use \in or \at, ConTeXt 
 turns them into clickable links. That is not my problem so much, but it also 
 changes font to bold and colour to green, and I do not want that.
 
 What do I need to do to make the text classic, that is without font and 
 colour change?

\setupinteraction
  [style=,
   color=,
   contrastcolor=]

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
___


[NTG-context] A bug color in tikz

2014-07-30 Thread Xan
Hi,

It's an annoying bug of TikZ with ConTexT: in some circumstances, the content 
after a tikzpicture is coloured. I refered it 
[here](http://www.ntg.nl/pipermail/ntg-context/2014/077374.html), and it's also 
present in the latest version of the minimals. Anyone could check it if he/she 
finds a bug.

Thanks,
Xan.
___
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] Color of the headers of one enumeration

2014-03-25 Thread Xan
 Am 24.03.2014 um 14:39 schrieb Xan dxpublica at telefonica.net:
 
  Hi,
  
  I have this
  \defineenumeration
   [punt]
   
  [alternative=serried,text={\startcolor[darkblue]Punt\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit]
  
  So I get Punt 1. bla,... How can I achieve that Punt 1. were in 
  darkblue? Now I just have Punt“.
 
 
 Use the headcolor key:
 
 \defineenumeration
   [punt]
   [alternative=serried,
text={Punt},
stopper={.},
width=fit,
distance=0.25em,
headstyle=\ss,
headcolor=darkblue]
 
 Wolfgang


Thank you very much,
Xan.
___
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] Color of the headers of one enumeration

2014-03-24 Thread Xan
Hi,

I have this
\defineenumeration
  [punt]
  
[alternative=serried,text={\startcolor[darkblue]Punt\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit]

So I get Punt 1. bla,... How can I achieve that Punt 1. were in darkblue? 
Now I just have Punt.

Thanks in advance,
Xan
___
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] Color of the headers of one enumeration

2014-03-24 Thread Wolfgang Schuster

Am 24.03.2014 um 14:39 schrieb Xan dxpubl...@telefonica.net:

 Hi,
 
 I have this
 \defineenumeration
  [punt]
  
 [alternative=serried,text={\startcolor[darkblue]Punt\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit]
 
 So I get Punt 1. bla,... How can I achieve that Punt 1. were in darkblue? 
 Now I just have Punt“.


Use the headcolor key:

\defineenumeration
  [punt]
  [alternative=serried,
   text={Punt},
   stopper={.},
   width=fit,
   distance=0.25em,
   headstyle=\ss,
   headcolor=darkblue]

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] Obscure math/color bug (namespace clash)

2014-02-22 Thread Hans Hagen

On 2/19/2014 9:53 AM, Alan BRASLAU wrote:

Hello,

I came across the following obscure math/color namespace clash:



\definecolor [tan] [h=d2b48c] % Taken from \setupcolor [x11]

\starttext
$\tan θ$
\stoptext



One solution would be to give precedence in math mode to the standard 
mathematical tokens (here \tan).

Another solution would be simply to avoid the use of tan (as a color). In colo-imp-x11.mkiv it 
could be renamed tan0 (there is already tan1, tan2, tan3). This is somewhat unfortunate as 
tan is a standard X11 color name. On the other hand, one would like to be able to use colors in 
math mode as well...

So I propose the following patch:

121c121
 \definecolor [tan0] [h=d2b48c] % ! namespace clash with $\tan$
---

\definecolor [tan]  [h=d2b48c]


\definecolor [tan] [h=d2b48c] % Taken from \setupcolor [x11]

\starttext
$\mathcommand{tan} θ$

\let\tan\relax

\color[tan]{Alan}
\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___

[NTG-context] Obscure math/color bug (namespace clash)

2014-02-19 Thread Alan BRASLAU
Hello,

I came across the following obscure math/color namespace clash:



\definecolor [tan] [h=d2b48c] % Taken from \setupcolor [x11]

\starttext
$\tan θ$
\stoptext



One solution would be to give precedence in math mode to the standard 
mathematical tokens (here \tan).

Another solution would be simply to avoid the use of tan (as a color). In 
colo-imp-x11.mkiv it could be renamed tan0 (there is already tan1, tan2, 
tan3). This is somewhat unfortunate as tan is a standard X11 color name. On 
the other hand, one would like to be able to use colors in math mode as well...

So I propose the following patch:

121c121
 \definecolor [tan0] [h=d2b48c] % ! namespace clash with $\tan$
---
 \definecolor [tan]  [h=d2b48c]

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] Metafun: numeric=color

2014-01-30 Thread Hans Hagen

On 1/29/2014 9:41 PM, Otared Kavian wrote:

Hi,

With the latest beta,

ConTeXt  ver: 2013.06.07 17:34 MKII  fmt: 2014.1.29

in a file typeset with mkii I have a bunch of metapost macros (drawing a logo…) 
which used to typeset correctly until last week, I get an error message saying:

Preloading the plain mem file, version 1.004 for metafun ii  cyan  
(0,1,1) ! Equation cannot be performed (numeric=color).

Unfortunately I cannot reproduce this error message in a minimal example, but 
can anyone tell me whether something has changed in MetaPost?


fixed

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___


[NTG-context] Metafun: numeric=color

2014-01-29 Thread Otared Kavian
Hi,

With the latest beta,

ConTeXt  ver: 2013.06.07 17:34 MKII  fmt: 2014.1.29

in a file typeset with mkii I have a bunch of metapost macros (drawing a logo…) 
which used to typeset correctly until last week, I get an error message saying:

Preloading the plain mem file, version 1.004 for metafun ii  cyan  
(0,1,1) ! Equation cannot be performed (numeric=color). 

Unfortunately I cannot reproduce this error message in a minimal example, but 
can anyone tell me whether something has changed in MetaPost?

Best regards: OK
___
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] Something weird with white color

2013-08-01 Thread Bertrand Masson

Le 01/08/2013 01:37, Hans Hagen a écrit :
tricky nesting at the pdf level .. seems like i need to use bit more 
magic there ... fixed in beta


Hans

Thank you for your work on ConText.

I already love working with ConTeXt, and if you adds magic, it will be 
fantastic.


Bertrand
___
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] Something weird with white color

2013-07-31 Thread Bertrand Masson

Hello,
The following code does not work, the second white ConTeXt  is  black !!!

\setupbackgrounds[page][background=color,backgroundcolor=blue]
\starttext
{\rotate[rotation=90]{\definedfont[SansBold at 24pt]\white  \ConTeXt}}
{\definedfont[SansBold at 16pt] \white ConTeXt}
\stoptext

No problem if we replace white with red (or other color) in

\definedfont[SansBold at 16pt] \red ConTeXt

and no problem if we write

\white\rotate[rotation=90]{\definedfont[SansBold at 24pt]\ConTeXt}


I compile with TeXlive2013.

Why is the white color different ?

Thanks,

Bertrand
___
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] Something weird with white color

2013-07-31 Thread Hans Hagen

On 7/31/2013 11:09 PM, Bertrand Masson wrote:

Hello,
The following code does not work, the second white ConTeXt  is  black !!!

\setupbackgrounds[page][background=color,backgroundcolor=blue]
\starttext
{\rotate[rotation=90]{\definedfont[SansBold at 24pt]\white  \ConTeXt}}
{\definedfont[SansBold at 16pt] \white ConTeXt}
\stoptext

No problem if we replace white with red (or other color) in

\definedfont[SansBold at 16pt] \red ConTeXt

and no problem if we write

\white\rotate[rotation=90]{\definedfont[SansBold at 24pt]\ConTeXt}


I compile with TeXlive2013.

Why is the white color different ?


tricky nesting at the pdf level .. seems like i need to use bit more 
magic there ... fixed in beta


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___


[NTG-context] Change URL color to match layer

2013-07-30 Thread Michael Ash
I would like to change the color of URL's in parts of a document.

In particular I am using the letter module and would like to have the color
of URL's match the color of text in the letterhead and then change to match
the color in the main body of the letter.

I can set the URL color once with \setupinteraction but I do not see how to
change it thereafter.

Thank you very much for your guidance.

Best,
Michael



\usemodule[letter]

\setupinteraction[state=start,color=black]
%% \setupinteraction[state=start,color=red]

%% Would like this URL to match the color of the return address (location)
\useURL[author-email][mailto:m...@econs.umass.edu][][m...@econs.umass.edu]
%% Would like this URL to match the color of the recipient's address
(address)
\useURL[recipient-email][mailto:addres...@gmail.com][][addres...@gmail.com]
%% Would like this URL to match the color of the main body
\useURL[knuthbio][
http://en.wikipedia.org/wiki/Donald_Knuth][][http://en.wikipedia.org/wiki/Donald_Knuth
]

\setupletter[
  name={Michael Ash},
  email={\from[author-email]}
  ]

\setupletter[signature={Michael Ash}]

\defineletterelement[layer][location][example]{\correspondenceparameter{name}
\correspondenceparameter{email}\par}
\setupletterlayer[location][alternative=example,color=red]

\defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par}
\setupletterlayer[address][alternative=example,color=blue]

\starttext
\startletter[
  toname={The Addressee\\\from[recipient-email]},
  opening={Dear Addressee:},
  closing={Best regards,}]

  Enjoy \from[knuthbio]

\stopletter
\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] Change URL color to match layer

2013-07-30 Thread Wolfgang Schuster

Am 30.07.2013 um 23:57 schrieb Michael Ash m...@econs.umass.edu:

 I would like to change the color of URL's in parts of a document.
 
 In particular I am using the letter module and would like to have the color 
 of URL's match the color of text in the letterhead and then change to match 
 the color in the main body of the letter.
 
 I can set the URL color once with \setupinteraction but I do not see how to 
 change it thereafter.

You can disable the default style and color with 
\setupinteraction[color=,style=], the links will now use the attributes of the 
surrounding text.

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] Change URL color to match layer

2013-07-30 Thread Michael Ash
I think that I have found an answer:  in the \setupinteraction command that
manages URL's, hyperlinks, PDF properties, etc. include
color=,contrastcolor=,


\usemodule[letter]

%% Would like this URL to match the color of the return address (location)
\useURL[author-email][mailto:aut...@myhome.com][][aut...@myhome.com]
%% Would like this URL to match the color of the recipient's address
(address)
\useURL[recipient-email][mailto:addres...@gmail.com][][addres...@gmail.com]
%% Would like this URL to match the color of the main body
\useURL[knuthbio][
http://en.wikipedia.org/wiki/Donald_Knuth][][http://en.wikipedia.org/wiki/Donald_Knuth
]

\setupinteraction[state=start,color=,contrastcolor=,style=normal]

\setupletter[
  name={Michael Ash},
  email={\from[author-email]}
  ]

\setupletter[signature={Michael Ash}]

\defineletterelement[layer][location][example]{\correspondenceparameter{name}
\correspondenceparameter{email}\par}
\setupletterlayer[location][alternative=example,color=red]

\defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par}
\setupletterlayer[address][alternative=example,color=blue]

\starttext
\startletter[
  toname={The Addressee\\\from[recipient-email]},
  opening={Dear Addressee:},
  closing={Best regards,}]

  Enjoy \from[knuthbio]

\stopletter
\stoptext



On Tue, Jul 30, 2013 at 5:57 PM, Michael Ash m...@econs.umass.edu wrote:

 I would like to change the color of URL's in parts of a document.

 In particular I am using the letter module and would like to have the
 color of URL's match the color of text in the letterhead and then change to
 match the color in the main body of the letter.

 I can set the URL color once with \setupinteraction but I do not see how
 to change it thereafter.

 Thank you very much for your guidance.

 Best,
 Michael



 \usemodule[letter]

 \setupinteraction[state=start,color=black]
 %% \setupinteraction[state=start,color=red]

 %% Would like this URL to match the color of the return address
 (location)
 \useURL[author-email][mailto:m...@econs.umass.edu][][m...@econs.umass.edu]
 %% Would like this URL to match the color of the recipient's address
 (address)
 \useURL[recipient-email][mailto:addres...@gmail.com][][addres...@gmail.com
 ]
 %% Would like this URL to match the color of the main body
 \useURL[knuthbio][
 http://en.wikipedia.org/wiki/Donald_Knuth][][http://en.wikipedia.org/wiki/Donald_Knuth
 ]

 \setupletter[
   name={Michael Ash},
   email={\from[author-email]}
   ]

 \setupletter[signature={Michael Ash}]

 \defineletterelement[layer][location][example]{\correspondenceparameter{name}
 \correspondenceparameter{email}\par}
 \setupletterlayer[location][alternative=example,color=red]


 \defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par}
 \setupletterlayer[address][alternative=example,color=blue]

 \starttext
 \startletter[
   toname={The Addressee\\\from[recipient-email]},
   opening={Dear Addressee:},
   closing={Best regards,}]

   Enjoy \from[knuthbio]

 \stopletter
 \stoptext




-- 
Michael Ash, Chair, Department of Economics
Professor of Economics and Public Policy
University of Massachusetts Amherst
Amherst, MA 01003
Email m...@econs.umass.edu
Tel +1-413-545-2590 Twitter https://twitter.com/michaelaoash
___
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] background color for makeups

2013-06-19 Thread Pablo Rodríguez
On 18/06/13 23:38, Hans Hagen wrote:
 On 6/18/2013 10:58 PM, Pablo Rodríguez wrote:
 \startstandardmakeup[align=middle]
  content to be centered
  \stopstandardmakeup

 I need to be able to change the background on some given pages. Which is
 the way to do this?
 
 why not just
 
 \startstandardmakeup[align=middle]
  content to be centered
 \stopstandardmakeup
 
 \setupbackgrounds[page][background=color,backgroundcolor=red]
 
 \startstandardmakeup[align=middle]
  content
 \stopstandardmakeup

Well, so stupid it sounds, I had no idea this was possible (I thought it
was forbidden to setup anything after \starttext).

Many thank for your help,


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
___


[NTG-context] background color for makeups

2013-06-18 Thread Pablo Rodríguez
Dear list,

the only way I found to center content horizontally and vertically on a
page is a makeup, such as:

\startstandardmakeup[align=middle]
content to be centered
\stopstandardmakeup

I need to be able to change the background on some given pages. Which is
the way to do this?

I have tried with (what I understand from) setups:

\startsetups[setups:redcolor]
\setupbackgrounds[page][background=color,backgroundcolor=red]
\stopsetups

\startstandardmakeup[setups=setups:redcolor]
content
\stopstandardmakeup

But it didn't work.

Could you help me with this?

Many thanks for your help,


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] background color for makeups

2013-06-18 Thread Hans Hagen

On 6/18/2013 10:58 PM, Pablo Rodríguez wrote:

\startstandardmakeup[align=middle]
 content to be centered
 \stopstandardmakeup

I need to be able to change the background on some given pages. Which is
the way to do this?

I have tried with (what I understand from) setups:

 \startsetups[setups:redcolor]
 \setupbackgrounds[page][background=color,backgroundcolor=red]
 \stopsetups

 \startstandardmakeup[setups=setups:redcolor]
 content
 \stopstandardmakeup


why not just

\startstandardmakeup[align=middle]
content to be centered
\stopstandardmakeup

\setupbackgrounds[page][background=color,backgroundcolor=red]

\startstandardmakeup[align=middle]
content
\stopstandardmakeup

--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___


[NTG-context] Set background color for a single page

2013-04-23 Thread Tim Li
Sometimes, I only want a single page, say, the titlepage or page 32, with 
colored background rather that the whole document. Here are some codes: 
\starttext% titlepage (yellow)
\startmakeup[standard]
\midaligned{How to make document}
\stopmakeup
% page1 (gray)
Many \CONTEXT\ users $\ldots$
\page
% page2 (darkyellow)
Many \TEX\ users $\ldots$ 
\stoptext
Of course, it is awful that if I set the titlepage yellow, page1 gray and page2 
darkyellow. How can I achieve this? regrads, Tim
  ___
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] Set background color for a single page

2013-04-23 Thread Aditya Mahajan

On Tue, 23 Apr 2013, Tim Li wrote:


Sometimes, I only want a single page, say, the titlepage or page 32, with 
colored background rather that the whole document. Here are some codes: 
\starttext% titlepage (yellow)
\startmakeup[standard]
\midaligned{How to make document}
\stopmakeup
% page1 (gray)
Many \CONTEXT\ users $\ldots$
\page
% page2 (darkyellow)
Many \TEX\ users $\ldots$
\stoptext
Of course, it is awful that if I set the titlepage yellow, page1 gray and page2 
darkyellow. How can I achieve this? regrads, Tim


See: http://thread.gmane.org/gmane.comp.tex.context/75726/focus=75743

Another alternative is to pick the color from a list using 
\convertnumber{colors}{userpage}, similar to the solution at

http://tex.stackexchange.com/a/54062/323

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] Set background color for a single page

2013-04-23 Thread Tim Li
Aditya, Thanks. Defining a color conversion is a good idea, and we can apply 
this conversion easily to somethings like chapter, section, etc. which has a 
`color' filed to assign, but not pages. Is there a way to set the color of a 
page like that done for chapters and sections? Tim
  Date: Tue, 23 Apr 2013 07:28:09 -0400
 From: adit...@umich.edu
 To: ntg-context@ntg.nl
 Subject: Re: [NTG-context] Set background color for a single page
 
 On Tue, 23 Apr 2013, Tim Li wrote:
 
  Sometimes, I only want a single page, say, the titlepage or page 32, with 
  colored background rather that the whole document. Here are some codes: 
  \starttext% titlepage (yellow)
  \startmakeup[standard]
  \midaligned{How to make document}
  \stopmakeup
  % page1 (gray)
  Many \CONTEXT\ users $\ldots$
  \page
  % page2 (darkyellow)
  Many \TEX\ users $\ldots$
  \stoptext
  Of course, it is awful that if I set the titlepage yellow, page1 gray and 
  page2 darkyellow. How can I achieve this? regrads, Tim
 
 See: http://thread.gmane.org/gmane.comp.tex.context/75726/focus=75743
 
 Another alternative is to pick the color from a list using 
 \convertnumber{colors}{userpage}, similar to the solution at
 http://tex.stackexchange.com/a/54062/323
 
 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
 ___
  ___
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
___

<    1   2   3   4   5   6   7   >