Re: [NTG-context] TOC: Chapters with and without page-numbers

2013-03-15 Thread H. Özoguz

Maybe I have not made it clear, what I mean?

My Minexample is:

\setuplist[chapter][pagenumber=no]
\starttext
\completecontent
\chapter{Chapter 1}
\section{Section 1}
\chapter{Chapter 2}
\stoptext

Now Chapter 1 is without pagenumber in the TOC, correct, because it has 
a section after the chapter-title! But Chapter 2 has no sections, so it 
need a page number, how to do that?


Regards,
Huseyin
___
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] no linebreaks after section command

2013-03-15 Thread Matthias Wende
after using the section command \\ doesn't work any longer. I'm using
context for appr. one week so i'm not sure if this is a feature or a
bug.

here is an example:

\starttext
 test\\test % works
 \section{Testing\\linebreaks}
 test\\test % doesnt work
\stoptext

btw: originally i tried to put line delimiters in the footer, is there a
way to do this?

___
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] TOC: Chapters with and without page-numbers

2013-03-15 Thread Keith J. Schultz
Hi,

I could find any options to do what you want.

I assume you would have to redefine completecontent command to get
the functionality you need.

I have not checked, but I assume that completecontent accesses a Lua-table
with the TOC information. It should be easy enough to use this table to create
the effect you want.

regards
Keith.

Am 15.03.2013 um 07:46 schrieb H. Özoguz h.oezo...@mmnetz.de:

 Maybe I have not made it clear, what I mean?
 
 My Minexample is:
 
 \setuplist[chapter][pagenumber=no]
 \starttext
 \completecontent
 \chapter{Chapter 1}
 \section{Section 1}
 \chapter{Chapter 2}
 \stoptext
 
 Now Chapter 1 is without pagenumber in the TOC, correct, because it has a 
 section after the chapter-title! But Chapter 2 has no sections, so it need a 
 page number, how to do that?

___
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] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 3:08 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

Hi Hans,

This is interesting, because I was thinking about this issue this past
weak, and was planning to send a test file:

On Thu, 14 Mar 2013 17:39:50 -0600, Hans Hagen pra...@wxs.nl wrote:


There is a new experimental feature and (at least for now) it's also
called \feature (maybe not the best name).


\stack might be better, for the following reason:


hm, one problem with such nice names is that they might be in use in 
user definitions



 Many fonts have language dependent features. There are also features
that one only wants to enable in small text snippets. For this we have
\addff etc but these don't accumulate.


We used to have \addfs{feature} and \subfs{feature}, meaning add
feature to the stack and subtract feature from the stack. But those
have been broken for a very long time.


afaik they're not broken but they don't stack up, only the last one 
counts (for a good technical reasons)



To round it off I guess we need a replacement for \subfs as well.


that can be done by defining the proper 'reset' features (see demo 
code), keep in mind that when feature switches are in macros one never 
really knows what is 'current' so it's already quite fuzzy; of course we 
can think of a negate option (i.e. use the negation of a feature set but 
that can be dangerous as when features inherit one doesn't want to 
disable kerning (for instance)



Thanks for this wonderful new feature (pun intended) and


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] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس   سماوي
حامد isha...@colostate.edu wrote:


To round it off I guess we need a replacement for \subfs as well.


Hmm, it seems that \subfs functionality is built in through the same
mechanism. Will study this some more...


yes, but there in successive calls the last one counts

\addff{x} \addff{y} \addff{z}  - z is used on top of the current font's 
set


\feature{x} \feature{y} \feature{y} - all are used on top

we might end up with replacing \addff etc by one mechanisms

\feature{+someset} : add
\feature{-someset} : subtract
\feature{=someset} : replace

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] no linebreaks after section command

2013-03-15 Thread Hans Hagen

On 3/14/2013 2:34 PM, Matthias Wende wrote:

after using the section command \\ doesn't work any longer. I'm using
context for appr. one week so i'm not sure if this is a feature or a
bug.

here is an example:

\starttext
  test\\test % works
  \section{Testing\\linebreaks}
  test\\test % doesnt work
\stoptext


will be fixed in next beta

-
  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] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس   سماوي
حامد isha...@colostate.edu wrote:


To round it off I guess we need a replacement for \subfs as well.


Hmm, it seems that \subfs functionality is built in through the same
mechanism. Will study this some more...


a new beta, this time with:

\setupbodyfont[pagella]

\starttext

\definefontfeature[f:smallcaps][smcp=yes]
\definefontfeature[f:nocaps]   [smcp=no]
\definefontfeature[f:oldstyle] [onum=yes]
\definefontfeature[f:newstyle] [onum=no]

% \enabletrackers[fonts.features]

\startTEXpage[offset=10pt]
\start
fijn fietsen 123
\type{[+os]}\feature{f:oldstyle}
fijn fietsen 123
\type{[+sc]}\feature{f:smallcaps}
fijn fietsen 123
\type{[+ns]}\feature{f:newstyle}
fijn fietsen 123
\type{[+nc]}\feature{f:nocaps}
fijn fietsen 123
\stop
\par
\start
fijn fietsen 123
\type{[+os]}\addfeature{f:oldstyle}
fijn fietsen 123
\type{[+sc]}\addfeature{f:smallcaps}
fijn fietsen 123
\type{[-os]}\subtractfeature{f:oldstyle}
fijn fietsen 123
\type{[-sc]}\subtractfeature{f:smallcaps}
fijn fietsen 123
\stop
\par
\start
fijn fietsen 123
\type{[+os]}\addfeature{f:oldstyle}
fijn fietsen 123
\type{[+sc]}\addfeature{f:smallcaps}
fijn fietsen 123
\type{[=os]}\replacefeature{f:oldstyle}
fijn fietsen 123
\type{[=sc]}\replacefeature{f:smallcaps}
fijn fietsen 123
\stop
\par
\start
fijn fietsen 123
\type{[+os]}\addfeature[f:oldstyle]
fijn fietsen 123
\type{[+sc]}\addfeature[f:smallcaps]
fijn fietsen 123
\type{[reset]}\resetfeature
fijn fietsen 123
\type{[+os]}\addfeature[f:oldstyle]
fijn fietsen 123
\type{[+sc]}\addfeature[f:smallcaps]
fijn fietsen 123
\stop
\stopTEXpage

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

Re: [NTG-context] TOC: Chapters with and without page-numbers

2013-03-15 Thread john Culleton
On Fri, 15 Mar 2013 09:07:33 +0100
Keith J. Schultz keithjschu...@web.de wrote:

 Hi,
 
 I could find any options to do what you want.
 
 I assume you would have to redefine completecontent command to get
 the functionality you need.
 
 I have not checked, but I assume that completecontent accesses a
 Lua-table with the TOC information. It should be easy enough to use
 this table to create the effect you want.
 
 regards
   Keith.
 
 Am 15.03.2013 um 07:46 schrieb H. Özoguz h.oezo...@mmnetz.de:
 
  Maybe I have not made it clear, what I mean?
  
  My Minexample is:
  
  \setuplist[chapter][pagenumber=no]
  \starttext
  \completecontent
  \chapter{Chapter 1}
  \section{Section 1}
  \chapter{Chapter 2}
  \stoptext
  
  Now Chapter 1 is without pagenumber in the TOC, correct, because it
  has a section after the chapter-title! But Chapter 2 has no
  sections, so it need a page number, how to do that?
 
 ___
 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
 ___


With other versions of TeX (eplain comes to mind) You can edit the
TOC file external to the tex program, and then take a second run
without recording page numbers. There is a command for this.
With Context this might be too complex. 

I see no problem with having a page number on chapter 1 however.
Most books look that way. The Chicago Manual of Style  has:

Proofs (a chapter)   91
Introduction (a section)  91


-- 
John Culleton
Wexford Press
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
PDF e-book: Create Book Covers with Scribus
available at http://www.booklocker.com/books/4055.html
___
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] new trickery

2013-03-15 Thread Jonathan Barchi
On Fri, Mar 15, 2013 at 4:35 AM, Hans Hagen pra...@wxs.nl wrote:
 On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

 On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس   سماوي
 حامد isha...@colostate.edu wrote:

 To round it off I guess we need a replacement for \subfs as well.


 Hmm, it seems that \subfs functionality is built in through the same
 mechanism. Will study this some more...


 yes, but there in successive calls the last one counts

 \addff{x} \addff{y} \addff{z}  - z is used on top of the current font's set

 \feature{x} \feature{y} \feature{y} - all are used on top

 we might end up with replacing \addff etc by one mechanisms

 \feature{+someset} : add
 \feature{-someset} : subtract
 \feature{=someset} : replace


I like this proposal for its use of only a single command with the
add/remove/reset in the args. If \feature ends up being too generic,
maybe \fontfeature or \fontfeatureset instead?

To keep things more in-line with current ConTeXt syntax, you could do
something like the following:

\feature{add=foo}
\feature{subtract=bar}(or sub, remove, etc.)
\feature{reset,add=baz}

Which would also allow, e.g.,

\feature{add=bar,remove=baz}

similar to how we're used to using key:value pairs in so many
arguments, and being able to combine them in one function call.

Jon


 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] TOC: Chapters with and without page-numbers

2013-03-15 Thread Jonathan Barchi
On Fri, Mar 15, 2013 at 11:53 AM, john Culleton j...@wexfordpress.com wrote:
 On Fri, 15 Mar 2013 09:07:33 +0100
 Keith J. Schultz keithjschu...@web.de wrote:

 Hi,

 I could find any options to do what you want.

 I assume you would have to redefine completecontent command to get
 the functionality you need.

 I have not checked, but I assume that completecontent accesses a
 Lua-table with the TOC information. It should be easy enough to use
 this table to create the effect you want.

 regards
   Keith.

 Am 15.03.2013 um 07:46 schrieb H. Özoguz h.oezo...@mmnetz.de:

  Maybe I have not made it clear, what I mean?
 
  My Minexample is:
 
  \setuplist[chapter][pagenumber=no]
  \starttext
  \completecontent
  \chapter{Chapter 1}
  \section{Section 1}
  \chapter{Chapter 2}
  \stoptext
 
  Now Chapter 1 is without pagenumber in the TOC, correct, because it
  has a section after the chapter-title! But Chapter 2 has no
  sections, so it need a page number, how to do that?

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


 With other versions of TeX (eplain comes to mind) You can edit the
 TOC file external to the tex program, and then take a second run
 without recording page numbers. There is a command for this.
 With Context this might be too complex.

 I see no problem with having a page number on chapter 1 however.
 Most books look that way. The Chicago Manual of Style  has:

 Proofs (a chapter)   91
 Introduction (a section)  91


 --
 John Culleton
 Wexford Press
 Free list of books for self-publishers:
 http://wexfordpress.net/shortlist.html
 PDF e-book: Create Book Covers with Scribus
 available at http://www.booklocker.com/books/4055.html
 ___
 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
 ___


I think you may be able to do this with a combination of \setupheads
and \setuphead commands, along with possibly defining a new head that
inherits from chapter (\definehead[name][chapter], then
\setuphead[name]).

I don't really have time to play much with this now, but see the
following links for a bunch more information on the commands above and
on section heads in general. There are several arguments to
setupheads/setuphead that modify how numbering is handled.

1. http://wiki.contextgarden.net/Category:Command/Sections
2. http://wiki.contextgarden.net/Titles

The second article, in particular, has been very helpful for me in
setting up some of the headers for my dissertation.

Jon
___
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] new trickery

2013-03-15 Thread Idris Samawi Hamid ادريس سماوي حامد

On Fri, 15 Mar 2013 05:07:02 -0600, Hans Hagen pra...@wxs.nl wrote:


\start
fijn fietsen 123
\type{[+os]}\addfeature{f:oldstyle}
fijn fietsen 123
\type{[+sc]}\addfeature{f:smallcaps}
fijn fietsen 123
\type{[=os]}\replacefeature{f:oldstyle}
fijn fietsen 123
\type{[=sc]}\replacefeature{f:smallcaps}
fijn fietsen 123
\stop


So I hope I have this right:

\addfeature adds a set of features {feature1,feature2,...featureN}  
to the currently defined/enabled stack of OT features


\subtractfeature subtracts a set of features from the currently  
defined/enabled stack


These two seem clear enough. I'm not so clear on the next one:

\replacefeature replaces all the _added_ features (not the default ones  
defined, e.g., in the typescripts I presume) with only those in the  
argument of \replacefeature. Is that right?


\resetfeature pops all features added to the stack (again, I'm assuming  
this does not include the default ones defined, e.g., in the typescripts).


Question: Does/Will this mechanism completely replace \addff et al, or  
will these mechanism ignore each other (e.g., \resetfeature does not pop  
those defined by \addff).


Best wishes
Idris
--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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] TOC: Chapters with and without page-numbers

2013-03-15 Thread Wolfgang Schuster

Am 15.03.2013 um 07:46 schrieb H. Özoguz h.oezo...@mmnetz.de:

 Maybe I have not made it clear, what I mean?
 
 My Minexample is:
 
 \setuplist[chapter][pagenumber=no]
 \starttext
 \completecontent
 \chapter{Chapter 1}
 \section{Section 1}
 \chapter{Chapter 2}
 \stoptext
 
 Now Chapter 1 is without pagenumber in the TOC, correct, because it has a 
 section after the chapter-title! But Chapter 2 has no sections, so it need a 
 page number, how to do that?


You can play with the following solution, it’s a bit dirty because you have to 
save the values of the chapter entry before you check for section entries.

\setuplist[chapter][alternative=mychapter]

\definelistalternative[mychapter][renderingsetup=list:mychapter]

\startsetups[list:mychapter]

  \par

  \setbox\scratchboxone\hbox{\currentlistentrynumber \quad 
\currentlistentrytitle \quad \currentlistentrypagenumber}
  \setbox\scratchboxtwo\hbox{\currentlistentrynumber \quad 
\currentlistentrytitle}

  \determinelistcharacteristics[section]

  \ifnum\listlength=0
\box\scratchboxone
  \else
\box\scratchboxtwo
  \fi

  \par

\stopsetups

\starttext
\completecontent
\chapter{Chapter 1}
\section{Section 1}
\chapter{Chapter 2}
\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] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 7:11 PM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

On Fri, 15 Mar 2013 05:07:02 -0600, Hans Hagen pra...@wxs.nl wrote:


\start
fijn fietsen 123
\type{[+os]}\addfeature{f:oldstyle}
fijn fietsen 123
\type{[+sc]}\addfeature{f:smallcaps}
fijn fietsen 123
\type{[=os]}\replacefeature{f:oldstyle}
fijn fietsen 123
\type{[=sc]}\replacefeature{f:smallcaps}
fijn fietsen 123
\stop


So I hope I have this right:

\addfeature adds a set of features {feature1,feature2,...featureN}
to the currently defined/enabled stack of OT features


no, it adds a *predefined* featureset to the set of the current font but 
forgets them when a group is left



\subtractfeature subtracts a set of features from the currently
defined/enabled stack


idem but subtraction


These two seem clear enough. I'm not so clear on the next one:

\replacefeature replaces all the _added_ features (not the default ones
defined, e.g., in the typescripts I presume) with only those in the
argument of \replacefeature. Is that right?


This reverts back to the features that are set when the font is defined 
and adds the given set. Resetting the stack in your speak.



\resetfeature pops all features added to the stack (again, I'm assuming
this does not include the default ones defined, e.g., in the typescripts).


This reverts back to the features that are set when the font is defined.


Question: Does/Will this mechanism completely replace \addff et al, or
will these mechanism ignore each other (e.g., \resetfeature does not pop
those defined by \addff).


I dont' know ... in fact, they share code deep down in the machinery but 
indeed it might make sense to remove them (or at least depricate them).


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] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 6:16 PM, Jonathan Barchi wrote:

On Fri, Mar 15, 2013 at 4:35 AM, Hans Hagen pra...@wxs.nl wrote:

On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:


On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس   سماوي
حامد isha...@colostate.edu wrote:


To round it off I guess we need a replacement for \subfs as well.



Hmm, it seems that \subfs functionality is built in through the same
mechanism. Will study this some more...



yes, but there in successive calls the last one counts

\addff{x} \addff{y} \addff{z}  - z is used on top of the current font's set

\feature{x} \feature{y} \feature{y} - all are used on top

we might end up with replacing \addff etc by one mechanisms

\feature{+someset} : add
\feature{-someset} : subtract
\feature{=someset} : replace



I like this proposal for its use of only a single command with the
add/remove/reset in the args. If \feature ends up being too generic,
maybe \fontfeature or \fontfeatureset instead?

To keep things more in-line with current ConTeXt syntax, you could do
something like the following:

\feature{add=foo}
\feature{subtract=bar}(or sub, remove, etc.)
\feature{reset,add=baz}

Which would also allow, e.g.,

\feature{add=bar,remove=baz}


I'd like to avoid parsing as much as possible here as these are state 
changers. So, I made:


\addfeature [f:mine] \feature[more][f:mine] \feature[+]  [f:mine]
\subtractfeature[f:mine] \feature[less][f:mine] \feature[-]  [f:mine]
\replacefeature [f:mine] \feature[new] [f:mine] \feature[=]  [f:mine]
\revivefeature  [f:mine] \feature[old] [f:mine] \feature[default][f:mine]
\resetfeature\feature[reset]

so there are several ways to achieve the same (and one can use {} 
instead of [])



similar to how we're used to using key:value pairs in so many
arguments, and being able to combine them in one function call.


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] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 7:11 PM, Idris Samawi Hamid ادريس   سماوي حامد wrote:


So I hope I have this right:

\addfeature adds a set of features {feature1,feature2,...featureN}
to the currently defined/enabled stack of OT features

\subtractfeature subtracts a set of features from the currently
defined/enabled stack

These two seem clear enough. I'm not so clear on the next one:

\replacefeature replaces all the _added_ features (not the default ones
defined, e.g., in the typescripts I presume) with only those in the
argument of \replacefeature. Is that right?

\resetfeature pops all features added to the stack (again, I'm assuming
this does not include the default ones defined, e.g., in the typescripts).

Question: Does/Will this mechanism completely replace \addff et al, or
will these mechanism ignore each other (e.g., \resetfeature does not pop
those defined by \addff).


A good exercise in understanding this is to add this to the wiki.

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
___