Re: [NTG-context] Command that does not give the expected result (Metafun)

2015-08-11 Thread Fabrice Couvreur
Hi Wolfgang,
I will follow your advice but I will try to understand, when I have the time
, the difference between
\unexpanded\def\ChapterCommand#1#2% et \def\ChapterCommand#1#2%.
Fabrice

2015-08-10 22:38 GMT+02:00 Wolfgang Schuster :

> Fabrice Couvreur 
> 10. August 2015 09:13
> Dear Hans,
> I tested without understanding what \unexpanded, and of course it works !
>
> You can use ConTeXt’s \define command where you don’t have to think about
> \unexpanded etc., e.g.
>
> \define[2]\ChapterCommand
>   {\setbox\scratchbox\hbox to \leftmarginwidth{#1\hss}%
>\hskip-\dimexpr\leftmarginwidth+\leftmargindistance\relax
>\framed
>  [background=titled,frame=off,offset=0pt]
>  {\box\scratchbox
>   \hskip\leftmargindistance
>   #2}}
>
> 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
>
> ___
>
___
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] Selectively supressing ligatures

2015-08-11 Thread Hans Hagen

On 8/11/2015 8:25 AM, Jan U. Hasecke wrote:

Hi,

I want to follow up on my own message below.

I got the hint offlist that it should not be too difficult to convert a
LaTeX package into a ConTeXt module.


I don't know but it would probably be a bit alien approach in the 
context code base



So I guess that there is no built-in functionality of semantical
switching between ligatures and normal characters.


The official way to do this is:

\starttext
shel\noligature{ff}ul
\stoptext

which also preserves hyphenation and kerning as well as other tricky 
features that a font provides.


The best place to incorporate such a feature is in the hyphenator but I 
have no time now to do that. So, instead I added a few lines to an 
existing (probably unknown) mechanism:


\replaceword[more][shelfful] [shel{ff}ul]
\replaceword[more][shifffahrt][shi{ff}fahrt]

\starttext
shel\noligature{ff}ul

\setreplacements[more]

shelfful
\stoptext

The downside of the 10 line extension is that it's not the most 
efficient implementation but probably still fast enough.



I am not a typographer – maybe I am wrong – but I don't like ligatures
in the wrong places. Inserting ligature stoppers by hand is a tedious work.


I don't like ligatures in most places (why only the few famous ones ... 
a bit imposed tradition limited to old constraints)



The latex package selnoligs was beneficial to me when I made a book with
more than 1000 pages, where I would never managed to stop ligatures by
hand.

So what is your opinion about such a feature?


You can probably make a list of special words and adding that to a 
module is no big deal. I have no time to look into what is around and do 
that myself.


I uploaded a 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
___

Re: [NTG-context] cross-references between documents in a project (using \useexternaldocument)

2015-08-11 Thread tala...@fastmail.fm
Hans, it would be great to have the numbers appearing again sometime in the 
future (if it is a bug or a not-yet implemented feature indeed). I couldn’t 
find anything in the documentation suggesting not to structure things this way.

Best wishes,
Talal

> On 10 Aug 2015, at 21:33, Wolfgang Schuster  
> wrote:
> 
>> tala...@fastmail.fm  6. August 2015 19:00
>> Perhaps I might ask a more preliminary question: when using project 
>> structure, is cross-document referencing possible between two product files, 
>> or only between two component files within a single product file?
> You can create hyperlinks between different products and your example (I 
> slightly modified it) works as expected with MkII where I get the chapter 
> number in the links.
> 
> The missing numbers with MkIV can be a bug or not yet implemented.
> 
> 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
> ___

___
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] Selectively supressing ligatures

2015-08-11 Thread Jan U. Hasecke
Hello Hans,

thank you very much for this quick fix.

I'll have to switch to the beta branch to try it out. At least I can now
suppress ligatures with a replacement list, which is enough for now.

As far as I understood selnoligs works with regular expressions (black
magic!). It is very time consuming, but CPU time is cheap. ;-)

Thanks a lot and a nice sunny day.
juh

Am 11.08.15 um 10:19 schrieb Hans Hagen:
> On 8/11/2015 8:25 AM, Jan U. Hasecke wrote:
>> Hi,
>>
>> I want to follow up on my own message below.
>>
>> I got the hint offlist that it should not be too difficult to convert a
>> LaTeX package into a ConTeXt module.
> 
> I don't know but it would probably be a bit alien approach in the
> context code base
> 
>> So I guess that there is no built-in functionality of semantical
>> switching between ligatures and normal characters.
> 
> The official way to do this is:
> 
> \starttext
> shel\noligature{ff}ul
> \stoptext
> 
> which also preserves hyphenation and kerning as well as other tricky
> features that a font provides.
> 
> The best place to incorporate such a feature is in the hyphenator but I
> have no time now to do that. So, instead I added a few lines to an
> existing (probably unknown) mechanism:
> 
> \replaceword[more][shelfful] [shel{ff}ul]
> \replaceword[more][shifffahrt][shi{ff}fahrt]
> 
> \starttext
> shel\noligature{ff}ul
> 
> \setreplacements[more]
> 
> shelfful
> \stoptext
> 
> The downside of the 10 line extension is that it's not the most
> efficient implementation but probably still fast enough.
> 
>> I am not a typographer – maybe I am wrong – but I don't like ligatures
>> in the wrong places. Inserting ligature stoppers by hand is a tedious
>> work.
> 
> I don't like ligatures in most places (why only the few famous ones ...
> a bit imposed tradition limited to old constraints)
> 
>> The latex package selnoligs was beneficial to me when I made a book with
>> more than 1000 pages, where I would never managed to stop ligatures by
>> hand.
>>
>> So what is your opinion about such a feature?
> 
> You can probably make a list of special words and adding that to a
> module is no big deal. I have no time to look into what is around and do
> that myself.
> 
> I uploaded a 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
> ___
___
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] Selectively supressing ligatures

2015-08-11 Thread Hans Hagen

On 8/11/2015 11:12 AM, Jan U. Hasecke wrote:


As far as I understood selnoligs works with regular expressions (black
magic!). It is very time consuming, but CPU time is cheap. ;-)


sure but life is still short so i prefer less runtime over cheap runtime

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] cross-references between documents in a project (using \useexternaldocument)

2015-08-11 Thread Hans Hagen

On 8/11/2015 11:00 AM, tala...@fastmail.fm wrote:

Hans, it would be great to have the numbers appearing again sometime in
the future (if it is a bug or a not-yet implemented feature indeed). I
couldn’t find anything in the documentation suggesting not to structure
things this way.


i have no clue what you're talking about


-
  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] margindata does not work in latest beta

2015-08-11 Thread Schmitz Thomas A.

> On 08 Aug 2015, at 15:32, Otared Kavian  wrote:
> 
> Hi Thomas,
> 
> Your file gives the expected result here, with
>   ConTeXt  ver: 2015.08.05 16:35 MKIV beta  fmt: 2015.8.7  int: 
> english/english
> 
> Please see the attached output.
> Best regards: OK

Hi Otared,

and right you are! Must have been a temporary problem with the one beta I was 
using, thanks for testing!

Which, however, brings me to a similar question: in the following example, 
which also has columns, the linenumbering doesn’t stop where I would expect. Is 
this a bug or a limitation of context? 

\setuplayout [leftmargin=2cm]

\setupbodyfont [times,10pt]

\setuplinenumbering [step=1,location=inmargin]

\setupcolumns [n=2]

\starttext

\startcolumns
\startlinenumbering
Had we but world enough, and time,

This coyness, Lady, were no crime.

We would sit down and think which way

To walk and pass our long love’s day.

Thou by the Indian Ganges’ side

Shouldst rubies find: I by the tide

Of Humber would complain. I would

Love you ten years before the Flood,

And you should, if you please, refuse
\stoplinenumbering
\column

Till the conversion of the Jews.

My vegetable love should grow

Vaster than empires, and more slow;

An hundred years should go to praise

Thine eyes and on thy forehead gaze;

Two hundred to adore each breast;

But thirty thousand to the rest;

An age at least to every part,

And the last age should show your heart;

For, Lady, you deserve this state,

Nor would I love at lower rate.
\stopcolumns

\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] cross-references between documents in a project (using \useexternaldocument)

2015-08-11 Thread tala...@fastmail.fm
Sorry for not being clear. The original question was whether cross-referencing 
in a project can only be done between components, or if they can also be done 
between products. I could never get the latter to work.

Wolfgang confirmed that in MkII, intra-product cross-referencing works (even 
with the examples I had posted),but not in MkIV. He speculated that the numbers 
in the references were not appearing in MkIV due to a bug, or because the 
feature was not implemented.

Best wishes,
Talal

> On 11 Aug 2015, at 10:48, Hans Hagen  wrote:
> 
> On 8/11/2015 11:00 AM, tala...@fastmail.fm wrote:
>> Hans, it would be great to have the numbers appearing again sometime in
>> the future (if it is a bug or a not-yet implemented feature indeed). I
>> couldn’t find anything in the documentation suggesting not to structure
>> things this way.
> 
> i have no clue what you're talking about
> 
> 
> -
>  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
> ___

___
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] Bibliographies in MkIV

2015-08-11 Thread Martin Moncrieffe
Hi all,

I'm unable to get the "andtext" option to \setupsite working. According to the 
old bib module manual, it should control the separation between two authors. 
Thus the following:

\setupbibtex[database=sample,sort=author]
\setuppublications[alternative=num]
\setupcite[left=(,right=),inbetween={,},andsep={,}]

\starttext

This is a test of the context citation module in 
MkIV\cite[hh2010a,Eijkhout1991]. 

\placepublications[criterium=text]
\stoptext

using  the following sample.bib 

@ARTICLE{hh2010a,
  author = hh,
  title = {The Font Name Mess},
  journal = {MAPS},
  year = {2010},
  volume = {40},
  pages = {2-8},
  keywords = {context},
}

@BOOK{Eijkhout1991,
  title = {\TeX\ by Topic. A \TeX nician's Reference},
  publisher = {Addison-Wesley},
  year = {1991},
  author = {Victor Eijkhout},
  address = {London},
  keywords = {general},
}

Should produce in the output (1,2) but instead produces (1 and 2).

Is there a quick fix?

Regards.

__martin

___
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] margindata does not work in latest beta

2015-08-11 Thread Otared Kavian
Hi Thomas,

I tested your example file and looked into my archive tests: it seems that a 
bug has appeared recently, maybe when Hans changed something in order to have 
linenumbering working in floats.
Indeed now the linenumbering does not work in mkiv, neither when using 
\startsimplecolumns (it works in mkii) or \startmixedcolumns.
Line numbering used to work fine in columns, and the line numbers were printed 
to the left of the left column, and to the right of the right column.
It is better to open a new thread on the subject in order for Hans to be 
informed of the issue.

By the way, why don’t you use \startlines …. \stoplines for your poetry? Is 
there a particular reason regarding line spacing and so forth?

Best regards: OK


> On 11 Aug 2015, at 11:55, Schmitz Thomas A.  
> wrote:
> 
> […]  in the following example, which also has columns, the linenumbering 
> doesn’t stop where I would expect. Is this a bug or a limitation of context? 
> 
> \setuplayout [leftmargin=2cm]
> 
> \setupbodyfont [times,10pt]
> 
> \setuplinenumbering [step=1,location=inmargin]
> 
> \setupcolumns [n=2]
> 
> \starttext
> 
> \startcolumns
> \startlinenumbering
> Had we but world enough, and time,
> 
> This coyness, Lady, were no crime.
> 
> We would sit down and think which way
> 
> To walk and pass our long love’s day.
> 
> Thou by the Indian Ganges’ side
> 
> Shouldst rubies find: I by the tide
> 
> Of Humber would complain. I would
> 
> Love you ten years before the Flood,
> 
> And you should, if you please, refuse
> \stoplinenumbering
> \column
> 
> Till the conversion of the Jews.
> 
> My vegetable love should grow
> 
> Vaster than empires, and more slow;
> 
> An hundred years should go to praise
> 
> Thine eyes and on thy forehead gaze;
> 
> Two hundred to adore each breast;
> 
> But thirty thousand to the rest;
> 
> An age at least to every part,
> 
> And the last age should show your heart;
> 
> For, Lady, you deserve this state,
> 
> Nor would I love at lower rate.
> \stopcolumns
> 
> \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
___

Re: [NTG-context] Selectively supressing ligatures

2015-08-11 Thread Jan U. Hasecke
Am 11.08.2015 um 11:46 schrieb Hans Hagen:
> On 8/11/2015 11:12 AM, Jan U. Hasecke wrote:
> 
>> As far as I understood selnoligs works with regular expressions (black
>> magic!). It is very time consuming, but CPU time is cheap. ;-)
> 
> sure but life is still short so i prefer less runtime over cheap runtime

Absolutely right:

LuaLaTeX run with selnoligs:

real18m39.101s
user18m40.335s
sys   0m1.624s


LuaLaTeX run without selnoligs:

real11m50.577s
user11m51.438s
sys   0m1.783s

But as I used pandoc in this project I had no chance to correct the
ligatures by hand. And if I had I would have needed seven days instead
of seven minutes more runtime.

But I am offtopic.

Thanks again for the solution.

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

Re: [NTG-context] Selectively supressing ligatures

2015-08-11 Thread Hans Hagen

On 8/11/2015 12:41 PM, Jan U. Hasecke wrote:

Am 11.08.2015 um 11:46 schrieb Hans Hagen:

On 8/11/2015 11:12 AM, Jan U. Hasecke wrote:


As far as I understood selnoligs works with regular expressions (black
magic!). It is very time consuming, but CPU time is cheap. ;-)


sure but life is still short so i prefer less runtime over cheap runtime


Absolutely right:

LuaLaTeX run with selnoligs:

real18m39.101s
user18m40.335s
sys   0m1.624s


LuaLaTeX run without selnoligs:

real11m50.577s
user11m51.438s
sys   0m1.783s

But as I used pandoc in this project I had no chance to correct the
ligatures by hand. And if I had I would have needed seven days instead
of seven minutes more runtime.


a couple of times 7 minutes i guess -)


But I am offtopic.


Whatever. In Context it's not that slow. In a worst case your 1000 pages 
are text only which takes 17.91 sec without and 18.95 sec with 
suppression enabled (0.14 s loop overhead), so some 5% extra runtime.


\replaceword[more][slffl][sl{ff}l]
\replaceword[more][slfful][sl{ff}ul]
\replaceword[more][shlfful][shl{ff}ul]
\replaceword[more][shelfful][shel{ff}ul]

\startbuffer
\testfeatureonce{100}{
\dorecurse{10} {
test 1 test 2 test 3 test 4 test 5
shelfful
test 6 test 7 test 8 test 9 test 0
}
\par
}
\stopbuffer

\starttext
\getbuffer \page
\setreplacements[more]
\getbuffer
\stoptext

Btw, a 11 minutes baseline sounds like a lot to me.


Thanks again for the solution.

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://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] Selectively supressing ligatures

2015-08-11 Thread Jan U. Hasecke
Hans,

it works for me, thank you!

Am 11.08.2015 um 13:22 schrieb Hans Hagen:
> Btw, a 11 minutes baseline sounds like a lot to me.

Yes indeed, xelatex and pdflatex from the same distribution are faster.
I only use lualatex because it is needed for selnoligs. Generally I used
pdflatex or xelatex.

But it looks like I am going to skip to ConTeXt anyway. ;-)

juh


-- 
Das ZEN von Pandoc
Bücher und E-Books einfach und professionell produzieren
http://www.amazon.de/Das-ZEN-von-Pandoc-professionell/dp/1505218799/
Paperback (232 Seiten) und E-Book
___
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 (TikZ)

2015-08-11 Thread Fabrice Couvreur
Hi,
Strange behavior: why is the colored text ?
Thanks,
Fabrice

\usemodule[tikz]

\startuniqueMPgraphic{titled}
path p ;
p := unitsquare xscaled OverlayWidth yscaled OverlayHeight ;
pickup pencircle scaled 1mm ;
drawoptions(withcolor .625yellow) ;
draw llcorner p--lrcorner p ;
setbounds currentpicture to p ;
\stopuniqueMPgraphic

\defineoverlay[titled][\uniqueMPgraphic{titled}]

\define[2]\ChapterCommand
  {\setbox\scratchbox\hbox to \leftmarginwidth{#1\hss}%
   \hskip-\dimexpr\leftmarginwidth+\leftmargindistance\relax
   \framed
 [background=titled,frame=off,offset=0pt]
 {\box\scratchbox
  \hskip\leftmargindistance
  #2}}

\setuphead
  [chapter]
  [command=\ChapterCommand,
   textstyle=\ss,
   color=darkred,
   conversion=Characters]

\setuphead
  [section]
  [command=\ChapterCommand,
   textstyle=\ss,
   color=darkred,
   sectionsegments=section:section]

\starttext

\startchapter
  [title={Activités d'approche}]

\startsection
  [title={Sans carreaux}]

\placefigure[right,none]{}
{
\hbox{
\starttikzpicture[>=stealth,scale=0.8]
\draw [->,color=blue,ultra thick] (0,0)--(5,2);
\draw [->,color=green,ultra thick] (6,1.5)--(5,0);
\draw [->,color=red,ultra thick] (4,-0.8)--(2,-0.1);
\draw [color=blue](2.5,1) node[above] {$\vec{u}$};
\draw [color=green](5.5,0.75) node[right] {$\vec{v}$};
\draw [,color=red](3,-0.45)   node[above] {$\vec{w}$};
\node (A) at (0.5,-0.5) {A};
\node [above right] at (A) {$\times$};
\stoptikzpicture}}
\startitemize[n][stopper={)},style=bold]
On a tracé trois vecteurs et placé un point A sur la figure ci-contre.
\startitemize[a][stopper={)},style=bold]
\item Construire le point C tel que $\vec{\rm{AC}}=\vec{u} + \vec{v}$.
\item Construire le point B tel que  $\vec{\rm{AB}}=\vec{u} + \vec{v} +
\vec{w} $.
\stopitemize
\stopitemize

\stopsection

\stopchapter
\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] margindata does not work in latest beta

2015-08-11 Thread Hans Hagen

On 8/11/2015 12:23 PM, Otared Kavian wrote:


It is better to open a new thread on the subject in order for Hans to be 
informed of the issue.


it's not recent, this issue, just some duplicate number application side 
effect already there for a while


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] Formatting of page number in table of contents

2015-08-11 Thread Aditya Mahajan

Hi,

I am using a document structure "part-section-subsection" (i.e., no 
chapters). The page numbers have to be formatted as 
"partnumber-pagenumber". So, I am using the following setup:


\setupuserpagenumber[way=bypart, prefix=yes, prefixset=part]

The page numbers are formatted correctly on each page, but not in the 
table of contents. For example,


\setupuserpagenumber[way=bypart, prefix=yes, prefixset=part]

\starttext
\placelist[part,section][alternative=c, criterium=all]

\part{Part 1}
\section{one} \input knuth \page
\section{two} \input knuth \page
\section{three} \input knuth \page

\part{Part Two}
\section{one} \input knuth \page
\section{two} \input knuth \page
\section{three} \input knuth \page
\stoptext

The numbers of the table of content are:

1 Part 1  1-1
1.1 one   1-1
1.2 two   2-2
1.3 three ... 3-3

Note that the prefix of page number is the section number rather than the 
part number. Any idea what I am doing wrong and how to fix it?


Thanks,
Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Formatting of page number in table of contents

2015-08-11 Thread Wolfgang Schuster

Aditya Mahajan 
11. August 2015 18:53
Hi,

I am using a document structure "part-section-subsection" (i.e., no 
chapters). The page numbers have to be formatted as 
"partnumber-pagenumber". So, I am using the following setup:


\setupuserpagenumber[way=bypart, prefix=yes, prefixset=part]

The page numbers are formatted correctly on each page, but not in the 
table of contents. For example,


\setupuserpagenumber[way=bypart, prefix=yes, prefixset=part]

\starttext
\placelist[part,section][alternative=c, criterium=all]

Change this to


\placelist[part,section][alternative=c,criterium=all,pageprefixsegments=part]


or


\placelist[part,section][alternative=c,criterium=all,pageprefixset=part]


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] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-03 18:18, Rik Kabel wrote:
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register entries, 
but not for references.)


\defineprocessor[xx][style=slanted,after=n]
\starttext
\section[xxx]{Processor testing}
Why cannot a processor be applied to a reference? \at[xx->xxx]
\stoptext



Anyone?

--
Rik
___
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] Label problems with \definelabel and \defineenumeration, in and out of footnotes

2015-08-11 Thread Rik Kabel
The example below documents the problems. In short, \definelabel 
suppresses paragraph indent when the label is at the beginning of a 
paragraph and fails to print the label or generate references with 
alternative=inmargin (or inright, or inleft) when in a footnote.


\defineenumeration fails to work in a footnote.


   \setupindenting[yes,small]
   \definelabel   [ID][
   %\defineenumeration[ID][
   text=,
   after=,
   before=,
   headcolor=red,
   alternative=inright,
  ]
   \starttext
   \starttitle[title={Label testing}]
   \startsubject[title={Problems with \tex{definelabel}}]

  This is a test. It is only a test.

  \ID[id1]This paragraph should be indented, with an ID number
in the margin. When \tex{ID} is placed at the beginning of the
paragraph, as it is here, the paragraph is not indented.

  This paragraph has a footnote.\footnote{%
  \ID[id2]The ID number is not printed in the margin with
{\tt alternative=inright}, {\tt alternative=inmargin},
or {\tt alternative=inleft}. Without any {\tt
alternative} the ID number is printed where the macro
appears. The positioning is unsatisfactory using {\tt
alternative=right}.%
} The footnote has an ID number which should be printed in the
right margin.

  This \ID[id3]paragraph has an ID, but it is not at the beginning
of the paragraph and the paragraph is properly indented. The
value of the ID number indicates that \tex{ID} in the footnote
of the previous paragraph incremented the associated counter,
but the failure of the references (\tex{in} and \tex{at}) to id2
suggests that there are other problems.

  \dorecurse{3}{
ID id#1 is \in[id#1] and is on page \at[id#1].\par}

  References for footnotes are generated without \tt{alternative=}.

   \stopsubject
   \startsubject[title={Problems with \tex{defineenumeration}}]

  When \tex{definelabel} is changed to \tex{defineenumeration},
the example fails to compile. It does not properly handle
the \tex{ID} in the footnote, complaining of an extra \} or
forgotten \tex{endgroup}.

   \stopsubject
   \stoptitle
   \stoptext

--
Rik
___
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] \defineprocessor and \at

2015-08-11 Thread Wolfgang Schuster

Rik Kabel 
4. August 2015 00:18
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register entries, 
but not for references.)

\defineprocessor [bodypart] [style=bold]
\defineprocessor [backpart] [style=italic]

\defineconversionset[bodypart:pagenumber][][bodypart->n]
\defineconversionset[backpart:pagenumber][][backpart->n]

\setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]

\starttext

\startbodymatter

\chapter[sec:knuth]{Knuth}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbodymatter

\startbackmatter

\chapter[sec:zapf]{Zapf}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbackmatter

\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] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-11 14:49, Wolfgang Schuster wrote:

Rik Kabel 
4. August 2015 00:18
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register 
entries, but not for references.)

\defineprocessor [bodypart] [style=bold]
\defineprocessor [backpart] [style=italic]

\defineconversionset[bodypart:pagenumber][][bodypart->n]
\defineconversionset[backpart:pagenumber][][backpart->n]

\setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]

\starttext

\startbodymatter

\chapter[sec:knuth]{Knuth}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbodymatter

\startbackmatter

\chapter[sec:zapf]{Zapf}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbackmatter

\stoptext

Wolfgang

Thank you, Wolfgang, for that. But it still does not handle the after 
key, as I had in my example, and which works in a processor for index 
entries. Is there no way to do this?


--
Rik


___
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] \defineprocessor and \at

2015-08-11 Thread Wolfgang Schuster

Rik Kabel 
11. August 2015 21:41
On 2015-08-11 14:49, Wolfgang Schuster wrote:
Thank you, Wolfgang, for that. But it still does not handle the after 
key, as I had in my example, and which works in a processor for index 
entries. Is there no way to do this?
The processor mechanism has no after key and I have no idea what it is 
shoudl do.


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] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-11 15:48, Wolfgang Schuster wrote:

Rik Kabel 
11. August 2015 21:41
On 2015-08-11 14:49, Wolfgang Schuster wrote:
Thank you, Wolfgang, for that. But it still does not handle the after 
key, as I had in my example, and which works in a processor for index 
entries. Is there no way to do this?
The processor mechanism has no after key and I have no idea what it is 
shoudl do.


My apologies, Wolfgang and list. The key I use is right, as in the 
following snippet from my environment. I should have checked my files 
instead of relying on memory when I replied.


When I add it to your solution it does work.

   \defineprocessor[Back][
   style=slanted,
   right=n,
  ]
   \defineprocessor[notBack][
  style=normal,
 ]

   \defineregister[Index]
   \setupregister [Index][n=2,
   command=\Word,
   balance=no,
   compress=yes,
  ]

   \starttexdefinition unexpanded index
  \dosingleempty\dostartindex
   \stoptexdefinition
   \starttexdefinition dostartindex [#sortkey]
  \doifmodeelse{*backpart}
 {\Index[Back->#sortkey]}
 {\Index[notBack->#sortkey]}
   \stoptexdefinition
   \starttexdefinition unexpanded seeindex
  \seeIndex
   \stoptexdefinition


   \starttexdefinition doIndex #INDEXTERM
  \expanded{\index{#INDEXTERM}}
   \stoptexdefinition

With this, I can use \index[Macintyre]{McIntyre, John} in the main text 
or an endnote and the indexing will identify the section. My simple use 
of the processor did not work, however, for references.


--
Rik
___
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] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-11 14:49, Wolfgang Schuster wrote:

Rik Kabel 
4. August 2015 00:18
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register 
entries, but not for references.)

\defineprocessor [bodypart] [style=bold]
\defineprocessor [backpart] [style=italic]

\defineconversionset[bodypart:pagenumber][][bodypart->n]
\defineconversionset[backpart:pagenumber][][backpart->n]

\setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]

\starttext

\startbodymatter

\chapter[sec:knuth]{Knuth}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbodymatter

\startbackmatter

\chapter[sec:zapf]{Zapf}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbackmatter

\stoptext

Wolfgang


Wolfgang,

This is clearly a superior solution to my index-only attempt, handling 
all references to backmatter pages without regard to their being in the 
index or in text references.


However, the page number adjustment via \setupheadertexts is handled 
only at the top center (default location) of each page. Can you suggest 
how to modify this to support an un-processed page number in the right 
margin of the footer of backmatter pages? I currently use:


   \setupheadertexts[][chapter][part][]
   \setuppagenumbering [alternative=doublesided,location={footer,margin}]

and I do not see where 
{\convertedcounter[userpage][numberconversionset=number]} or something 
else to restore un-processed numbers might work, despite trying with 
\setupfootertexts, \setuppagenumbering, \setuppagenumbering, and related 
commands.


--
Rik

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