[NTG-context] Counter[way=bypage] bug in latest beta?

2015-06-29 Thread mf
Hello list,
consider this example, involving a number (counter) to be reset at each
page:

\starttext
\definenumber[MyNumber][way=bypage] % MyNumber=0
\incrementnumber[MyNumber] % MyNumber=1
\incrementnumber[MyNumber] % MyNumber=2
mynumber is \rawcountervalue[MyNumber]. % prints 2
\page % MyNumber=0
\incrementnumber[MyNumber] % MyNumber=1
At the new page, mynumber is \rawcountervalue[MyNumber].
\stoptext

In ConTeXt 2014.05.21 22:04 (the one I get as Debian package) it works
as expected, giving MyNumber=1 at page 2, because MyNumber gets reset
at page break.
In the latest beta (and also in 2014.04.01) the counter does not reset
and it's equal to 3 at the end of page 2.

Another question: when you comment out the increment at page 2, the
counter does not reset, and you get 2 even in version 2014.05.21.

\starttext
\definenumber[MyNumber][way=bypage] % MyNumber=0
\incrementnumber[MyNumber] % MyNumber=1
\incrementnumber[MyNumber] % MyNumber=2
mynumber is \rawcountervalue[MyNumber]. % prints 2
\page % MyNumber=0
% \incrementnumber[MyNumber] COMMENTED OUT
At the new page, mynumber is \rawcountervalue[MyNumber]. % prints 2
\stoptext

Is this a bug or is it the way it should work when you don't increment
it?
___
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] \setuphead[part] - special look

2015-06-29 Thread Wolfgang Schuster



Procházka Lukáš Ing. - Pontex s. r. o. mailto:l...@pontex.cz
29. Juni 2015 14:05
Hello,

one more question.

When I place \part into \...bodymatter and \...appendices, the \part 
in body matter yields Díl  + number, which is OK, but in appendices 
it gives nothing + Roman number (I, II, ...).

You have to change the default conversion for the appendix.
What is the most systemic to \setuphead[part] to give Díl... in body 
matter and Dodatek... in appendices, and also to get letter 
numbering (A, B...) in appendices (so Dodatek A, Doadatek B, 
...)?

You have to set a label for the appendix with the appendixlabel key.

A sample source code with body matter and appendices is attached...

% Method 1: change the values of the predefined default conversion set,
% you can use name of the sectionblock as prefix (separated by a :) to set
% the values only for a certain part (e.g. the appendix) of your document

\defineconversionset[appendix:default][A,R][n]

% Method 2: Create your own conversion set and apply it to all sections
%
% \defineconversionset[bodypart:myconversion][n,n][n]
% \defineconversionset[appendix:myconversion][A,R][n]
% \setuphead[part,chapter,section][sectionconversionset=myconversion]

\setuphead
  [part]
  [placehead=yes,
   bodypartlabel=bodypart-mypart,
   appendixlabel=appendix-mypart]

\setuplabeltext[en][bodypart-mypart=Díl ,appendix-mypart=Dodatek ]

\starttext
\startbodymatter
\part{My First Part}
\input knuth
\stopbodymatter
\startappendices
\part{My First Appendix}
\input tufte
\stopappendices
\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] \setuphead[part] - special look

2015-06-29 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello Wolfgang,

thanks again, it works perfectly.

Best regards,

Lukas


On Mon, 29 Jun 2015 14:33:41 +0200, Wolfgang Schuster 
schuster.wolfg...@gmail.com wrote:




Procházka Lukáš Ing. - Pontex s. r. o. mailto:l...@pontex.cz
29. Juni 2015 14:05
Hello,

one more question.

When I place \part into \...bodymatter and \...appendices, the \part
in body matter yields Díl  + number, which is OK, but in appendices
it gives nothing + Roman number (I, II, ...).

You have to change the default conversion for the appendix.

What is the most systemic to \setuphead[part] to give Díl... in body
matter and Dodatek... in appendices, and also to get letter
numbering (A, B...) in appendices (so Dodatek A, Doadatek B,
...)?

You have to set a label for the appendix with the appendixlabel key.

A sample source code with body matter and appendices is attached...

% Method 1: change the values of the predefined default conversion set,
% you can use name of the sectionblock as prefix (separated by a :) to set
% the values only for a certain part (e.g. the appendix) of your document

\defineconversionset[appendix:default][A,R][n]

% Method 2: Create your own conversion set and apply it to all sections
%
% \defineconversionset[bodypart:myconversion][n,n][n]
% \defineconversionset[appendix:myconversion][A,R][n]
% \setuphead[part,chapter,section][sectionconversionset=myconversion]

\setuphead
   [part]
   [placehead=yes,
bodypartlabel=bodypart-mypart,
appendixlabel=appendix-mypart]

\setuplabeltext[en][bodypart-mypart=Díl ,appendix-mypart=Dodatek ]

\starttext
 \startbodymatter
 \part{My First Part}
 \input knuth
 \stopbodymatter
 \startappendices
 \part{My First Appendix}
 \input tufte
 \stopappendices
\stoptext

Wolfgang




--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

___
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] \setuphead[part] - special look

2015-06-29 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

one more question.

When I place \part into \...bodymatter and \...appendices, the \part in body matter yields Díl  + number, which 
is OK, but in appendices it gives nothing + Roman number (I, II, ...).

What is the most systemic to \setuphead[part] to give Díl... in body matter and Dodatek... in appendices, and also 
to get letter numbering (A, B...) in appendices (so Dodatek A, Doadatek B, ...)?

A sample source code with body matter and appendices is attached...

Best regards,

Lukas


On Tue, 23 Jun 2015 16:28:46 +0200, Wolfgang Schuster 
schuster.wolfg...@gmail.com wrote:




Procházka Lukáš Ing. - Pontex s. r. o. mailto:l...@pontex.cz
23. Juni 2015 09:45
Hello,

I'm really satisfied with the way you coded the part page layout.

I've modified a bit your code - just to highlight the dependencies
(rendering setup, makeup and so on; if anyone interested, see the
attachment).

You can drop the \definebodyfontenvironment line when you use
\definefont to set the part fonts, e.g.

\definefont[PartText][SerifBold sa 5]
\setuphead[part][textstyle=PartText]


On Mon, 22 Jun 2015 18:36:03 +0200, Wolfgang Schuster
schuster.wolfg...@gmail.com wrote:


This method to set your own layout is also used by other command (e.g.
the list mechanism used for the table of contents) and the
\defineheadplacement has also a alternative key which is needed when you
want an inline heading (e.g. \setuphead[...][alternative=text]).


...


The necessary key would be endless with each new layout and with the
\defineheadplacement command to create your own without adding
additional keys but you can also use the command key instead of
\defineheadplacement. The advantage of \defineheadplacement is that you
can better structure the code in the setups environment because you
don't have to worry about spaces.

Wolfgang


As \defineheadplacement is concerned:

You mentioned this command in your response, but
\defineheadplacement is used nowhere in your code and there is no
info about on wiki.

Could you provide a MWE how \defineheadplacement is supposed to be used?

You shouldn't use it because Hans kept it only for backwards
compatibility and \defineheadplacement is the better alternative. You
can also use the same rendering (the content of the setups environment)
for different head alternatives where you set the differences with the
\defineheadalternative command.

% HeadA

\defineheadplacement[HeadA][vertical]#1#2%
   {\startframedtext
  #1\quad #2%
\stopframedtext}

\definehead[HeadA][section][alternative=HeadA]

% HeadB

\defineheadalternative[HeadB][renderingsetup=HeadB] % alternative=vertical

\startsetups[HeadB]
   \startframedtext
 \headnumbercontent \qquad \headtextcontent
   \stopframedtext
\stopsetups

\definehead[HeadB][section][alternative=HeadB]

\starttext

\HeadA{Knuth}

\input knuth

\HeadB{Tufte}

\input tufte

\stoptext

Wolfgang




--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

Ull-Gra.test2.mkiv
Description: Binary data


Ull-Gra.test2.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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