Re: [NTG-context] Cover of ePub

2015-08-07 Thread Henning Hraban Ramm
I overlooked one thing:
With the minimal example ConTeXt’s export doesn’t create a cover.xhtml, but in 
my project it does.

Am 2015-08-08 um 09:59 schrieb Henning Hraban Ramm :

> Hi again,
> 
> I'm trying to define a cover image for my ePub using the documented 
> „firstpage“ setting of \setupexport.
> 
> While it works in my minimal example below, it fails in my project structure; 
> I tried to move \setupexport into project, product and component to no avail.
> 
> %
> \setupbackend[export=yes]
> \setupinteraction[
>   state=start,
>   color=,contrastcolor=,
>   title={ePub Test},
>   subtitle={ConTeXt},
>   author={Hraban},
> ]
> \setupexport[
>   bodyfont=12pt,width=470pt,
>   hyphen=yes,
>   firstpage={koe}, % works here, but not in environment
> ]
> 
> \starttext
> 
> \startchapter[title={Knuth}]
> 
> \startparagraph
> \input knuth
> \stopparagraph
> 
> \stopchapter
> 
> \stoptext
> 
> 
> 
> 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] Text around a figure in a framedtext

2015-08-07 Thread Otared Kavian
Hi,

You should use the same width if you want to obtain the same result (by the 
way, you have to say also \stopframedtext in your source file):

\startframedtext[width=\textwidth]{
\placefigure[right,none]{}{%
 \startMPcode
  draw unitsquare scaled 2cm ;
  \stopMPcode}
\input knuth.tex }
\stopframedtext

Best regards: OK

> On 08 Aug 2015, at 00:49, Fabrice Couvreur  
> wrote:
> 
> Hi,
> Why the text does not move in the first framedtext like the second framedtext 
> ?
> Thank you.
> Fabrice
> 
> \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
> \definecolor[MyColorA][.75(MyColorB,white)]  
> 
> \defineframedtext
>   [MyText]
>   [frame=off,
>background=MyFrame,
>width=\textwidth,
>location=right]
> 
> \defineoverlay
>   [MyFrame]
>   [\useMPgraphic{MyFrame}]
> 
> \definelabel
>   [Définition]
>   [headstyle=\bf\smallcaps]
> 
> \startuseMPgraphic{MyFrame}
> path b ;
> picture p ;
> p := textext.rt("\white\Définition") ; 
> p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight) ;
> b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
> fill OverlayBox withcolor \MPcolor{MyColorA} ;
> fill b withcolor \MPcolor{MyColorB} ;
> draw p ;
> \stopuseMPgraphic
> 
> \starttext
> \startMyText
> \placefigure[right,none]{}{%
>  \startMPcode
>   draw unitsquare scaled 2cm ;
>   \stopMPcode}
> \input knuth
> \stopMyText
> 
> \startframedtext{
> \placefigure[right,none]{}{%
>  \startMPcode
>   draw unitsquare scaled 2cm ;
>   \stopMPcode}
> \input knuth}
> 
> \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
> ___

___
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] Cover of ePub

2015-08-07 Thread Henning Hraban Ramm
Hi again,

I'm trying to define a cover image for my ePub using the documented „firstpage“ 
setting of \setupexport.

While it works in my minimal example below, it fails in my project structure; I 
tried to move \setupexport into project, product and component to no avail.

%
\setupbackend[export=yes]
\setupinteraction[
state=start,
color=,contrastcolor=,
title={ePub Test},
subtitle={ConTeXt},
author={Hraban},
]
\setupexport[
bodyfont=12pt,width=470pt,
hyphen=yes,
firstpage={koe}, % works here, but not in environment
]

\starttext

\startchapter[title={Knuth}]

\startparagraph
\input knuth
\stopparagraph

\stopchapter

\stoptext



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] Text around a figure in a framedtext

2015-08-07 Thread Fabrice Couvreur
Hi,
Why the text does not move in the first framedtext like the second
framedtext ?
Thank you.
Fabrice

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
\definecolor[MyColorA][.75(MyColorB,white)]

\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   width=\textwidth,
   location=right]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt("\white\Définition") ;
p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight)
;
b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorB} ;
draw p ;
\stopuseMPgraphic

\starttext
\startMyText
\placefigure[right,none]{}{%
 \startMPcode
  draw unitsquare scaled 2cm ;
  \stopMPcode}
\input knuth
\stopMyText

\startframedtext{
\placefigure[right,none]{}{%
 \startMPcode
  draw unitsquare scaled 2cm ;
  \stopMPcode}
\input knuth}

\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] issues with typeface selection

2015-08-07 Thread Pablo Rodriguez
On 08/07/2015 06:52 PM, Pablo Rodriguez wrote:
> Dear list,
> 
> I have the following sample:
> [...]
> Typeface selection doesn’t seem to work even with paragraphs:
> \defineparagraphs[timesdroid][each][n=2, before=\blank]
> \defineparagraphs[timesdroid][1][style=\newtimes]
> \defineparagraphs[timesdroid][2][style=\droidserif]

Partially replying to myself.

After defining a paragraphs environment, I have to set them up, not to
define them again.

So the code above should read:

\defineparagraphs[timesdroid][each][n=2, before=\blank]
\setupparagraphs[timesdroid][1][style=\newtimes]
\setupparagraphs[timesdroid][2][style=\droidserif]

But I don’t know what is wrong is foregroundstyle in xtables.

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] m-graph read data and plot

2015-08-07 Thread John Kitzmiller
Thank you Alan. setrange is the key I had not tried and I will be more careful 
with (2).

This may not be the proper way to ask, but it is related to the topic: how to 
get Hobby’s Figure 9 from the mpgraph manual to work using m-graph?

http://ctan.org/tex-archive/systems/doc/metapost/source-manual 


Thanks again,
John


On Aug 7, 2015, at 6:23 AM, Alan BRASLAU  wrote:
> 
> You have two problems:
> 
> 1) gdraw (4,1)--(7,1);
> has a unique ordinate, so graph will fail in this case if you do not
> explicitly set the range.
> 
> 2) You have to take care with your choice of loop variables in MP not
> to run into conflicts those eventually used in macros. Also, as Hans
> indicated, you do need to declare that a is an array, as in
>   numeric a[];
> 
> Here is a MWE
> 
> \enabletrackers[metapost.showlog]
> \usemodule[graph]
> \startMPpage[instance=graph,offset=3mm]
>  draw begingraph(5cm,5cm);
>numeric a[];
>gdata("data.d", v,
>  for j=1 upto 3:
>a[j]:=scantokens v[j];
>  endfor ;
>  );
> 
>setrange (whatever,0,whatever,2);
>gdraw (a2,a1)--(a3,a1);
>  endgraph;
> \stopMPpage
> 
> 
> Alan
> 
> 
> On Thu, 6 Aug 2015 16:48:51 -0400
> John Kitzmiller mailto:k...@inradius.net>> wrote:
> 
>> On Aug 6, 2015, at 12:59 PM, Hans Hagen mailto:pra...@wxs.nl>
>> >> wrote:
>>> 
>>> On 8/6/2015 5:30 PM, John Kitzmiller wrote:
 Given a file, data.d, containing 1 4 7
 
 I expected the following code to draw a line from (4,1) to (7,1)…
 
 
 \enabletrackers[metapost.showlog]
 \usemodule[m-graph]
 \startMPpage[instance=graph,offset=3mm]
  draw begingraph(5cm,5cm);
gdata("data.d", v,
  for n = 1 upto 3:
 a[n] = scantokens v[n];
  endfor;
 
  show a1; show a2; show a3; % numeric
  show v1; show v2; show v3; % string
  gdraw (a2,a1)—(a3,a1); % same problem in or out of data group
  );
  endgraph;
 \stopMPpage
 
 …the show lines return what I expected, but then come the
 complaints:
 
 ! Inconsistent equation (off by 0.90002)…
>> (0,0,1,0,0,yypart S)
 ! Transform components aren't all known…
 
>>> 
 a[n] = scantokens v[n];
>>> 
>>> is a defined?
>> 
>> Thank you Hans. Do you mean numeric a[n]? It was not explicitly
>> declared; I did not think it needed to be—the show commands write
>> what I expect to the log—anyway, declaring a did not help.
>> 
>>> 
>>> also, use
>>> 
>>> a[n] := scantokens v[n] ;
>> 
>> Done. Still the same error messages and no pdf.
>> 
>>> 
>>> 
>>> 
 My goal is to draw multiple box plots
 https://en.wikipedia.org/wiki/Box_plot 
 
 >, either vertical or
 horizontal, from data sets, but I am stuck at this early stage.
>> 
> 

___
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] issues with typeface selection

2015-08-07 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\definefontfamily[timesnew][serif][FreeSerif]
\definefontfamily[droidserif][serif][Droid Serif]
\setupbodyfont[palatino, 12pt]
\starttext
I want to have \type{\timesnew\ttfx} and \type{\droidserif\ttfx}
in each cell, but \type{foregroundstyle} doesn’t seem to work
(compilation crashes).
\startxtable
\blank
\startxrow
\startxcell \ConTeXt\ is awesome!\stopxcell
\startxcell \ConTeXt\ is awesome!\stopxcell
\stopxrow
\stopxtable
\blank
Typeface selection doesn’t seem to work even with paragraphs:
\defineparagraphs[timesdroid][each][n=2, before=\blank]
\defineparagraphs[timesdroid][1][style=\newtimes]
\defineparagraphs[timesdroid][2][style=\droidserif]
\starttimesdroid
\ConTeXt\ is awesome!
\timesdroid
\ConTeXt\ is awesome!
\stoptimesdroid
\stoptext

All I need is to be able to have a text with a given font family and a
smaller font size on the left and the same text with the same font size
but another font family on the right.

I have failed with both xtables and paragraphs.

Wnat am I missing in each case?

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] Some questions about an environment (Metafun)

2015-08-07 Thread Fabrice Couvreur
Hi Hans,
Thank you for responding to my request, it's really nice. By cons I do not
understand what you mean "
some day textext might handle it okay"
Fabrice

2015-08-07 14:26 GMT+02:00 Hans Hagen :

> On 8/6/2015 11:38 PM, Fabrice Couvreur wrote:
>
>> Hi,
>> The following code (Metafun documentation, thanks again Hans !) is fully
>> understood and works very well. Sorry if I insist, but can we create a
>> counter to avoid writing \FrameTitle{Définition 1},
>> \FrameTitle{Définition 2}... ?
>> Thus, the only invocation \startMyText ... \stopMyText, \startMyText ...
>> \stopMyText... this return Définition 1, Définition 2 ...
>>
>> Thank you,
>> Fabrice
>>
>>
>> \setupbodyfont [palatino,11pt]
>>
>> \setupcolors[state=start,cmyk=yes]
>>
>> \definecolor[MyColor][c=0.00, m=0.10, y=0.20, k=0.00]
>> \definecolor[myColor][c=0.00, m=0.62, y=1.00, k=0.00]
>>
>> \defineoverlay[MyFrame][\useMPgraphic{MyFrame}]
>>
>> \defineframedtext
>> [MyText]
>> [frame=off,
>>  background=MyFrame,
>>  width=\textwidth,
>>  location=right]
>>
>> \defineoverlay[MyFrame][\useMPgraphic{MyFrame}]
>>
>> \def\StartFrame{\startMyText}
>> \def\StopFrame{\startMyText}
>>
>> \def\FrameTitle#1{\setMPtext{MyFrame}{\hbox spread
>> 1em{\hss\strut{\bf\feature[+][f:smallcaps]}#1\hss}}}
>>
>> \setMPtext{MyFrame}{}
>>
>> \startuseMPgraphic{MyFrame}
>> path a ;
>> path b ;
>> picture p ;
>> o := BodyFontSize ;
>> p :=textext.rt(\MPstring{MyFrame}) ;
>> p := p shifted (2o,OverlayHeight-ypart center p) ;
>> a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
>> fill a withcolor \MPcolor{MyColor} ;
>> b := boundingbox p ;
>> fill b withcolor \MPcolor{myColor} ;
>> draw p withcolor white ;
>> \stopuseMPgraphic
>> \starttext
>> \FrameTitle{Définition 1}
>> \startMyText
>> \input knuth
>> \stopMyText
>> \FrameTitle{Définition 2}
>> \startMyText
>> \input knuth
>> \stopMyText
>> \stoptext
>>
>>
> \setupbodyfont [palatino,11pt]
>
> \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
> \definecolor[MyColorA][.75(MyColorB,white)]  %c=0.00, m=0.10, y=0.20,
> k=0.00]
>
> \defineframedtext
>   [MyText]
>   [frame=off,
>background=MyFrame,
>width=\textwidth,
>location=right]
>
> \defineoverlay
>   [MyFrame]
>   [\useMPgraphic{MyFrame}]
>
> \definelabel
>   [Définition]
>   [headstyle=\bf\smallcaps]
>
> \startuseMPgraphic{MyFrame}
> path b ;
> picture p ;
> p := textext.rt("\white\Définition") ; % some day textext might handle
> it okay
> p := p shifted (2BodyFontSize,OverlayHeight-ypart center
> p+.25ExHeight) ;
> b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
> fill OverlayBox withcolor \MPcolor{MyColorA} ;
> fill b withcolor \MPcolor{MyColorB} ;
> draw p ;
> \stopuseMPgraphic
>
> \starttext
>
> \startMyText
> \input knuth
> \stopMyText
>
> \startMyText
> \input knuth
> \stopMyText
>
> \stoptext
>
> 2015-08-04 21:30 GMT+02:00 Fabrice Couvreur > >:
>>
>> Hi Aditya,
>> Thank you, I have already thought of this solution, but I do not
>> know to use with the environment that I created.
>> Fabrice
>>
>> 2015-08-04 18:02 GMT+02:00 Aditya Mahajan > >:
>>
>> On Tue, 4 Aug 2015, Fabrice Couvreur wrote:
>>
>> How to have Definition 1, Definition 2, Definition 3 ... ?
>>
>>
>> \defineenumeration[definition][text=Definition]
>>
>> 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
>>
>> ___
>>
>>
>
> --
>
> -
>   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
> 

Re: [NTG-context] How not to print the chapter number

2015-08-07 Thread Eric Détrez

Le 07-08-2015 15:04, Eric Détrez a écrit :

I wish to print my texte as

I Foo

1 Bar one

1.1 barbar one

1.2 barbar two

2 Bar two

2.1 foofoo one

2.2 foofoo two

I don't want the Roman I printed in the numbering.

With contextmark II I just added
\setupsection[section-3][previousnumber=no]
but it doesn't seem to work in mark IV.

Is there a way to do it ?


An answer (in the mailing-list archives) and also in the wiki (I didn't 
read it well enough)


\setuphead[section][sectionsegments=section]
\setuphead[subsection][sectionsegments=section:subsection]
\setuphead[subsubsection][sectionsegments=section:subsubsection]


\starttext
\chapter{Eric}
\section{Foo 1}
\subsection{Bar one}
\subsubsection{Barbar one }
\subsubsection{Barbar two}
\subsection{Bar two}
\subsubsection{Barbar one}
\subsubsection{Barbar two}
\section{Foo 2}
\subsection{Bar one}
\subsubsection{Barbar one}
\subsubsection{Barbar two}
\stoptext


As once you changed one you have to change the lower ones ...




--
Eric Détrez
Informatique
Lycée Faidherbe, Lille
http://eric-detrez.fr
___
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] How not to print the chapter number

2015-08-07 Thread Tomas Hala
Hello Eric,

try the following:

\definehead[mysect][section]
\setuphead[mysect][number=no]

\starttext
\mysect{Foo}
\subsection{Bar one}
\subsubsection{Barbar one}
\subsubsection{Barbar two}
\stoptext

Best wishes,

Tomas


Fri, Aug 07, 2015 ve 03:04:04PM +0200 Eric Détrez napsal(a):
# I wish to print my texte as
# 
# I Foo
# 
# 1 Bar one
# 
# 1.1 barbar one
# 
# 1.2 barbar two
# 
# 2 Bar two
# 
# 2.1 foofoo one
# 
# 2.2 foofoo two
# 
# I don't want the Roman I printed in the numbering.
# 
# With contextmark II I just added
# \setupsection[section-3][previousnumber=no]
# but it doesn't seem to work in mark IV.
# 
# Is there a way to do it ?
# 
# 
# -- 
# Eric Détrez
# Informatique
# Lycée Faidherbe, Lille
# http://eric-detrez.fr
# 
___
# 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
# 
___

 Tomáš Hála

Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28

http://akela.mendelu.cz/~thala
___
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] How not to print the chapter number

2015-08-07 Thread Eric Détrez

I wish to print my texte as

I Foo

1 Bar one

1.1 barbar one

1.2 barbar two

2 Bar two

2.1 foofoo one

2.2 foofoo two

I don't want the Roman I printed in the numbering.

With contextmark II I just added
\setupsection[section-3][previousnumber=no]
but it doesn't seem to work in mark IV.

Is there a way to do it ?


--
Eric Détrez
Informatique
Lycée Faidherbe, Lille
http://eric-detrez.fr
___
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] Some questions about an environment (Metafun)

2015-08-07 Thread Hans Hagen

On 8/6/2015 11:38 PM, Fabrice Couvreur wrote:

Hi,
The following code (Metafun documentation, thanks again Hans !) is fully
understood and works very well. Sorry if I insist, but can we create a
counter to avoid writing \FrameTitle{Définition 1},
\FrameTitle{Définition 2}... ?
Thus, the only invocation \startMyText ... \stopMyText, \startMyText ...
\stopMyText... this return Définition 1, Définition 2 ...
Thank you,
Fabrice


\setupbodyfont [palatino,11pt]

\setupcolors[state=start,cmyk=yes]

\definecolor[MyColor][c=0.00, m=0.10, y=0.20, k=0.00]
\definecolor[myColor][c=0.00, m=0.62, y=1.00, k=0.00]

\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

\defineframedtext
[MyText]
[frame=off,
 background=MyFrame,
 width=\textwidth,
 location=right]

\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

\def\StartFrame{\startMyText}
\def\StopFrame{\startMyText}

\def\FrameTitle#1{\setMPtext{MyFrame}{\hbox spread
1em{\hss\strut{\bf\feature[+][f:smallcaps]}#1\hss}}}

\setMPtext{MyFrame}{}

\startuseMPgraphic{MyFrame}
path a ;
path b ;
picture p ;
o := BodyFontSize ;
p :=textext.rt(\MPstring{MyFrame}) ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
fill a withcolor \MPcolor{MyColor} ;
b := boundingbox p ;
fill b withcolor \MPcolor{myColor} ;
draw p withcolor white ;
\stopuseMPgraphic
\starttext
\FrameTitle{Définition 1}
\startMyText
\input knuth
\stopMyText
\FrameTitle{Définition 2}
\startMyText
\input knuth
\stopMyText
\stoptext



\setupbodyfont [palatino,11pt]

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
\definecolor[MyColorA][.75(MyColorB,white)]  %c=0.00, m=0.10, y=0.20, 
k=0.00]


\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   width=\textwidth,
   location=right]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt("\white\Définition") ; % some day textext might 
handle it okay
p := p shifted (2BodyFontSize,OverlayHeight-ypart center 
p+.25ExHeight) ;

b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorB} ;
draw p ;
\stopuseMPgraphic

\starttext

\startMyText
\input knuth
\stopMyText

\startMyText
\input knuth
\stopMyText

\stoptext


2015-08-04 21:30 GMT+02:00 Fabrice Couvreur mailto:fabrice1.couvr...@gmail.com>>:

Hi Aditya,
Thank you, I have already thought of this solution, but I do not
know to use with the environment that I created.
Fabrice

2015-08-04 18:02 GMT+02:00 Aditya Mahajan mailto:adit...@umich.edu>>:

On Tue, 4 Aug 2015, Fabrice Couvreur wrote:

How to have Definition 1, Definition 2, Definition 3 ... ?


\defineenumeration[definition][text=Definition]

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
___




--

-
  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] ebooks

2015-08-07 Thread Jan Tosovsky
On 2015-08-07 Hans Hagen wrote:
> 
> http://www.tomsguide.com/us/amazon-kindle-paperwhite,review-2967.html
> 
> I read under "Advanced Typesetting"
> 
> ... improved character placement and spacing, with advanced kerning and
> ligatures ...books with this enhanced typesetting are not easy to find
> 
> which makes me wonder: how can an html file (just a char stream)
> determine in an epub that kerning/ligaturing is disabled By default?
> 
> (I can imagine a css enabling something but still ...)
> 

There was lot of work in W3 recently dedicated in CSS for paged media. Even
further development of mature XSL-FO has been discontinued in favor of
HTML+CSS. 

http://www.smashingmagazine.com/2015/01/designing-for-print-with-css/

And many publishers believe this is the future. While many features are not
available in browsers yet, there are corresponding JavaScript
modules/polyfills which mimic the intended rendering so nothing stops the
publishing industry from migrating their workflows into the new standards.

One of such JavaScript framework is vivliostyle.js - http://vivliostyle.com/

Back to the original question, enabling/disabling font features can be done
using CSS font-feature:
http://www.w3.org/TR/css3-fonts/#font-rend-props

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] m-graph read data and plot

2015-08-07 Thread Alan BRASLAU
You have two problems:

1) gdraw (4,1)--(7,1);
has a unique ordinate, so graph will fail in this case if you do not
explicitly set the range.

2) You have to take care with your choice of loop variables in MP not
to run into conflicts those eventually used in macros. Also, as Hans
indicated, you do need to declare that a is an array, as in
numeric a[];

Here is a MWE

\enabletrackers[metapost.showlog]
\usemodule[graph]
\startMPpage[instance=graph,offset=3mm]
  draw begingraph(5cm,5cm);
numeric a[];
gdata("data.d", v,
  for j=1 upto 3:
a[j]:=scantokens v[j];
  endfor ;
  );

setrange (whatever,0,whatever,2);
gdraw (a2,a1)--(a3,a1);
  endgraph;
\stopMPpage


Alan


On Thu, 6 Aug 2015 16:48:51 -0400
John Kitzmiller  wrote:

> On Aug 6, 2015, at 12:59 PM, Hans Hagen  > wrote:
> > 
> > On 8/6/2015 5:30 PM, John Kitzmiller wrote:
> >> Given a file, data.d, containing 1 4 7
> >> 
> >> I expected the following code to draw a line from (4,1) to (7,1)…
> >> 
> >> 
> >> \enabletrackers[metapost.showlog]
> >> \usemodule[m-graph]
> >> \startMPpage[instance=graph,offset=3mm]
> >>   draw begingraph(5cm,5cm);
> >> gdata("data.d", v,
> >>   for n = 1 upto 3:
> >> a[n] = scantokens v[n];
> >>   endfor;
> >> 
> >>   show a1; show a2; show a3; % numeric
> >>   show v1; show v2; show v3; % string
> >>   gdraw (a2,a1)—(a3,a1); % same problem in or out of data group
> >>   );
> >>   endgraph;
> >> \stopMPpage
> >> 
> >> …the show lines return what I expected, but then come the
> >> complaints:
> >> 
> >> ! Inconsistent equation (off by 0.90002)…
>  (0,0,1,0,0,yypart S)
> >> ! Transform components aren't all known…
> >> 
> > 
> >> a[n] = scantokens v[n];
> > 
> > is a defined?
> 
> Thank you Hans. Do you mean numeric a[n]? It was not explicitly
> declared; I did not think it needed to be—the show commands write
> what I expect to the log—anyway, declaring a did not help.
> 
> > 
> > also, use
> > 
> > a[n] := scantokens v[n] ;
> 
> Done. Still the same error messages and no pdf.
> 
> > 
> > 
> > 
> >> My goal is to draw multiple box plots
> >> https://en.wikipedia.org/wiki/Box_plot
> >> , either vertical or
> >> horizontal, from data sets, but I am stuck at this early stage.
> 



-- 
Alan Braslau
CEA DSM-IRAMIS-SPEC
CNRS UMR 3680
Orme des Merisiers
91191 Gif-sur-Yvette cedex FRANCE
tel: +33 1 69 08 73 15
fax: +33 1 69 08 87 86
mailto:alan.bras...@cea.fr
___
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] ebooks

2015-08-07 Thread Hans Hagen

Hi,

In

http://www.tomsguide.com/us/amazon-kindle-paperwhite,review-2967.html

I read under "Advanced Typesetting"

... improved character placement and spacing, with advanced kerning and 
ligatures ...books with this enhanced typesetting are not easy to find


which makes me wonder: how can an html file (just a char stream) 
determine in an epub that kerning/ligaturing is disabled By default?


(I can imagine a css enabling something but still ...)

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
___