[NTG-context] combinedlist: different behaviour in mkiv

2012-09-21 Thread Stefan Rothe
Hi

I have defined a two-level head structure with independent numbering. It
works as intended with mkii, but with mkiv, the top-level number is
prepended to all second-level heads in the table of contents. With 
mkii, I get:

Part A First
  1   One
  2   Two
...

with mkiv:

Part A First
  A.1   One
  A.2   Two
...

How can I fix this?

Kind regards
Stefan


% Top level head
\definehead [AgendaPart] [section]
\setuphead [AgendaPart] [ownnumber=yes, number=yes,
numbercommand={Part }, style=\bf\tfb] 

\newcounter\AgendaPartNumber

\define [1] \agendapart { 
\doglobal\increment\AgendaPartNumber
\AgendaPart{\Character{\AgendaPartNumber}}{#1}
}

% Second level head, idependently numbered
\definehead [AgendaItem] [subsubsection]
\setuphead [AgendaItem] [ownnumber=yes, number=yes, style=\bf]

\newcounter\AgendaItemNumber

\define [1] \agendaitem {
\doglobal\increment\AgendaItemNumber
\AgendaItem{\AgendaItemNumber}{#1}
}

\definelist [AgendaPart]
\setuplist [AgendaPart] [width=1.5cm, style=bold, numbercommand={Part }]
\definelist [AgendaItem]
\setuplist [AgendaItem] [width=1.5cm, ownnumber=yes]

\definecombinedlist [toc] [AgendaPart, AgendaItem]
\setupcombinedlist [toc] [pagenumber=no]

% Test
\starttext

\placetoc

\agendapart{First}

\agendaitem{One}

\agendaitem{Two}

\agendapart{Second}

\agendaitem{Three}

\agendaitem{Four}

\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] combinedlist: different behaviour in mkiv

2012-09-21 Thread Philipp Gesang
Hi Stefan,

···date: 2012-09-20, Thursday···from: Stefan Rothe···

 % Top level head
 \definehead [AgendaPart] [section]
 \setuphead [AgendaPart] [ownnumber=yes, number=yes,
 numbercommand={Part }, style=\bf\tfb] 
 
 \newcounter\AgendaPartNumber
 
 \define [1] \agendapart { 
   \doglobal\increment\AgendaPartNumber
   \AgendaPart{\Character{\AgendaPartNumber}}{#1}
 }
 
 % Second level head, idependently numbered
 \definehead [AgendaItem] [subsubsection]
 \setuphead [AgendaItem] [ownnumber=yes, number=yes, style=\bf]

%% Adjust the “sectionsegments” parameter to include only the
%% head’s own structure level. (Multiple levels need to be
%% separated by cola (“:”)).
\definehead [AgendaItem] [subsubsection] [
  ownnumber=yes,
  number=yes,
  style=\bf,
  sectionsegments=subsubsection,
]

Btw why does your structure go section-subsubsection? Afair
these have depth 3 and 5 respectively, so it would look more
consistent to use section-subsection (3-4).

Hth
Philipp



pgp33UkiCwjjR.pgp
Description: PGP signature
___
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] combinedlist: different behaviour in mkiv

2012-09-21 Thread Wolfgang Schuster

Am 21.09.2012 um 11:24 schrieb Philipp Gesang ges...@stud.uni-heidelberg.de:

 Hi Stefan,
 
 ···date: 2012-09-20, Thursday···from: Stefan Rothe···
 
 % Top level head
 \definehead [AgendaPart] [section]
 \setuphead [AgendaPart] [ownnumber=yes, number=yes,
 numbercommand={Part }, style=\bf\tfb] 
 
 \newcounter\AgendaPartNumber
 
 \define [1] \agendapart { 
  \doglobal\increment\AgendaPartNumber
  \AgendaPart{\Character{\AgendaPartNumber}}{#1}
 }
 
 % Second level head, idependently numbered
 \definehead [AgendaItem] [subsubsection]
 \setuphead [AgendaItem] [ownnumber=yes, number=yes, style=\bf]
 
 %% Adjust the “sectionsegments” parameter to include only the
 %% head’s own structure level. (Multiple levels need to be
 %% separated by cola (“:”)).
 \definehead [AgendaItem] [subsubsection] [
  ownnumber=yes,
  number=yes,
  style=\bf,
  sectionsegments=subsubsection,
 ]
 
 Btw why does your structure go section-subsubsection? Afair
 these have depth 3 and 5 respectively, so it would look more
 consistent to use section-subsection (3-4).

+1

I wonder also why he uses such a complicated method for his headings when there 
is a better way.

\defineresetset [none][][0]

\definehead [agendapart] [section]
[sectionresetset=none,sectionsegments=agendapart,style=\bfb,conversion=A,bodypartlabel=part]
\definehead [agendaitem] [subsection] 
[sectionresetset=none,sectionsegments=agendaitem,style=\bf]

\setuplist [agendapart] [width=1.5cm,pagenumber=no,style=bold,label=yes]
\setuplist [agendaitem] [width=1.5cm,pagenumber=no]

\definecombinedlist [agenda] [agendapart,agendaitem]

\starttext

\placeagenda

\agendapart{First}

\agendaitem{One}

\agendaitem{Two}

\agendapart{Second}

\agendaitem{Three}

\agendaitem{Four}

\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] CP 1250 component

2012-09-21 Thread Wolfgang Schuster

Am 19.09.2012 um 15:02 schrieb Procházka Lukáš Ing. - Pontex s. r. o. 
l...@pontex.cz:

 Hello,
 
 I have problem using CP 1250 and component/environment.
 
 Suppose having a simple example:
 
  t-M.mkiv - File of macro definitions
 %\enableregime[cp1250]
 
 \def\ccc{č} % A Czech letter with diacritics
 
 
  t-Env.mkiv - Environment file - just load macros
 %\enableregime[cp1250]
 
 \input t-M.mkiv
 
 \startenvironment *
 \stopenvironment
 
 
  t-Comp.mkiv - Component - this file is to be compiled
 %\enableregime[cp1250]
 
 \environment t-Env.mkiv
 
 \startcomponent *
  Comp
 \stopcomponent
 
 
 I tried to place \enableregime[cp1250] statement to all places where it is 
 marked as comment now, but no position was accepted by ConTeXt - I was always 
 getting:
 
 
 ConTeXt  ver: 2012.08.02 10:55 MKIV  fmt: 2012.8.3  int: english/english
 ...
 regimes  loading  vector 'cp1250' is loaded
 (t-Env.mkiv (t-M.mkiv
 ! String contains an invalid utf-8 sequence.
 
 system   tex  error on line 3 in file t-M.mkiv: String contains an 
 invalid utf-8 sequence ...
 
 1 %\enableregime[cp1250]
 2
 3   \def\ccc{Ŕ}
 4
 
 l.3 \def\ccc{
 Ŕ}
 )
 Runaway definition?
 -´┐Ż
 ...
 
 
 Note that the following code works OK:
 
  t-Comp(alt).mkiv - Component with successful compilation
 \enableregime[cp1250]
 
 \input t-M.mkiv % The problematic file is loaded here
 
 \startcomponent *
  Comp
 \stopcomponent
 
 
 So is there a way how to involve the macro file t-M.mkiv (CP 1250, Czech) 
 into the environment file t-Env.mkiv?

I have no idea how to fix this but when you have this problem only in your 
environment file for a few string I would replace č with \ccaron.

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
___