ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Bug in \setuplist
@ 2012-03-15 10:25 Willi Egger
  2012-03-15 12:59 ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Willi Egger @ 2012-03-15 10:25 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

Hi Guru's

While typesetting an old book (original is from 1853) I need to tweak the table of contents. It looks as follows:

CHAPTER II.

BEES CAPABLE OF DOMESTICATION. Astonishment of persons at their
tameness, 25. Bees intended for the comfort of man. Properties fitting
them for domestication. Bees never attack when filled with honey, 26.
....

I have attached a minimal example which works in Context version 2011.07.19 but not in 2012.01.25 nor in todays beta.
Compilation stops with an error complaining that the \MycommandA has an extra }.

Further there is the question how to get roman numerals when using the \Mycommand. - I realize, that all optional keys are ignored at the moment that the alternative=command is used.

Kind regards

Willi

[-- Attachment #2: test-placelist.pdf --]
[-- Type: application/pdf, Size: 7986 bytes --]

[-- Attachment #3: test-placelist.tex --]
[-- Type: application/octet-stream, Size: 1084 bytes --]

% Context file
% Filename: test-placelist.tex
% 
% 14-03-2012
% Copyright (c) 2012 BOEDE. All rights reserved.
%
% \nopdfcompression
% \enabletrackers[context.trace]
% \enabletrackers[system.jobfiles]


%\showframe
\define[3]\MycommandA{\blank CHAPTER~#1.\blank\WORD{#2}.\hskip0.25\bodyfontsize} % for chapters	
\define[3]\MycommandB{#2,\hskip0.5\bodyfontsize #3.\hskip0.25\bodyfontsize} % for (sub)section

\setuplist
	[chapter]
	[before=\blank,
	style=\WORD,
	prefix=no,
	sectionnumber=no,
	headnumber=no,
   alternative=command,
   command=\MycommandA]
\setuplist
	[section]
	[prefix=no,
	sectionnumber=no,
	headnumber=no,
	alternative=command,
	command=\MycommandB]
	
\starttext

\starttitle[title=Contents,list=Contents]
   \placelist[chapter,section][criterium=all]
\stoptitle


\startchapter[title=Introduction,list=Introduction]
   \startsection[title=Section A,list=Section A]
      sdasdad'klgag
   \stopsection
\stopchapter

\startchapter[title=Preface,list=Preface]
   \startsection[title=Section B,list=Section B]
      asfdsgbadfg
   \stopsection
\stopchapter

\stoptext

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in \setuplist
  2012-03-15 10:25 Bug in \setuplist Willi Egger
@ 2012-03-15 12:59 ` Wolfgang Schuster
  2012-03-15 16:21   ` Willi Egger
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2012-03-15 12:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 15.03.2012 um 11:25 schrieb Willi Egger:

> Hi Guru's
> 
> While typesetting an old book (original is from 1853) I need to tweak the table of contents. It looks as follows:
> 
> CHAPTER II.
> 
> BEES CAPABLE OF DOMESTICATION. Astonishment of persons at their
> tameness, 25. Bees intended for the comfort of man. Properties fitting
> them for domestication. Bees never attack when filled with honey, 26.
> ....
> 
> I have attached a minimal example which works in Context version 2011.07.19 but not in 2012.01.25 nor in todays beta.
> Compilation stops with an error complaining that the \MycommandA has an extra }.

You have to replace "\define[3]\…{…}" with "\unexpanded\def\…#1#2#3{…}".

> Further there is the question how to get roman numerals when using the \Mycommand. - I realize, that all optional keys are ignored at the moment that the alternative=command is used.

You can use \convertnumber but which numbers are wrong when you use your own command?

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in \setuplist
  2012-03-15 12:59 ` Wolfgang Schuster
@ 2012-03-15 16:21   ` Willi Egger
  2012-03-15 16:33     ` Wolfgang Schuster
  2012-03-15 16:39     ` Willi Egger
  0 siblings, 2 replies; 7+ messages in thread
From: Willi Egger @ 2012-03-15 16:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Wolfgang,

thank you very much for solving my problem! -- Indeed this works well.

What I need to do is to convert the chapter number into a roman number.

CHAPTER XIV.

BEES CAPABLE OF DOMESTICATION. Astonishment of persons at their
tameness, 25. Bees intended for the comfort of man. Properties fitting
them for domestication. Bees never attack when filled with honey, 26.
....

As you can see there are only chapter numbers given. All other entries in the TOC are not even headings in the text (!). So I will have to set these texts up with \writetolist. The texts in the TOC never match any text and are only indications on the subject dealt with on the given page. -- I seems that this was common in those days, I prepared earlier another book written in Dutch showing a similar setup.

Thank you for your kind help

Willi


On 15 Mar 2012, at 13:59, Wolfgang Schuster wrote:

> \unexpanded\def\…#1#2#3{…}

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in \setuplist
  2012-03-15 16:21   ` Willi Egger
@ 2012-03-15 16:33     ` Wolfgang Schuster
  2012-03-15 16:45       ` Willi Egger
  2012-03-15 16:39     ` Willi Egger
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2012-03-15 16:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 15.03.2012 um 17:21 schrieb Willi Egger:

> Hi Wolfgang,
> 
> thank you very much for solving my problem! -- Indeed this works well.
> 
> What I need to do is to convert the chapter number into a roman number.
> 
> CHAPTER XIV.
> 
> BEES CAPABLE OF DOMESTICATION. Astonishment of persons at their
> tameness, 25. Bees intended for the comfort of man. Properties fitting
> them for domestication. Bees never attack when filled with honey, 26.
> ….

You get the same number format as you use for the chapters in the text, when I change the format of the number to roman numerals I get them also in the TOC.

\definestructureconversionset[willi][][R]

\setuphead[chapter][sectionconversionset=willi]


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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in \setuplist
  2012-03-15 16:21   ` Willi Egger
  2012-03-15 16:33     ` Wolfgang Schuster
@ 2012-03-15 16:39     ` Willi Egger
  1 sibling, 0 replies; 7+ messages in thread
From: Willi Egger @ 2012-03-15 16:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

replying to my self:

I was not aware of this macro \convert{new_form}{number_to_be_converted} 

So in the meantime the commands which give the correct result become:

\unexpanded\def\Mychaptercommand#1#2#3{\blank CHAPTER~\convertnumber{R}{#1}.\blank{#2}.\hskip0.25\bodyfontsize}
\unexpanded\def\Mysectioncommand#1#2#3{#2, \hskip0.5\bodyfontsize #3.\hskip0.25\bodyfontsize}

used in 

\setuplist
	[chapter]
	[prefix=no,
	sectionnumber=no,
	headnumber=no,
   alternative=command,
   command=\Mychaptercommand]

\setuplist
	[section]
	[prefix=no,
	sectionnumber=no,
	headnumber=no,
	alternative=command,
	command=\Mysectioncommand]


Again thank you Wolfgang!

Willi	
On 15 Mar 2012, at 17:21, Willi Egger wrote:

> Hi Wolfgang,
> 
> thank you very much for solving my problem! -- Indeed this works well.
> 
> What I need to do is to convert the chapter number into a roman number.
> 
> CHAPTER XIV.
> 
> BEES CAPABLE OF DOMESTICATION. Astonishment of persons at their
> tameness, 25. Bees intended for the comfort of man. Properties fitting
> them for domestication. Bees never attack when filled with honey, 26.
> ....
> 
> As you can see there are only chapter numbers given. All other entries in the TOC are not even headings in the text (!). So I will have to set these texts up with \writetolist. The texts in the TOC never match any text and are only indications on the subject dealt with on the given page. -- I seems that this was common in those days, I prepared earlier another book written in Dutch showing a similar setup.
> 
> Thank you for your kind help
> 
> Willi
> 
> 
> On 15 Mar 2012, at 13:59, Wolfgang Schuster wrote:
> 
>> \unexpanded\def\…#1#2#3{…}
> 
> ___________________________________________________________________________________
> 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in \setuplist
  2012-03-15 16:33     ` Wolfgang Schuster
@ 2012-03-15 16:45       ` Willi Egger
  2012-03-15 17:39         ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Willi Egger @ 2012-03-15 16:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Wolfgang,

you are of course right. - When testing I switched to a test-file, where I did not set the romannumerals conversion in \setuphead. - Sorry ;-(

Is the use of the option-key in \setuphead[chapter][conversion=Romannumerals] depreciated?


Willi
On 15 Mar 2012, at 17:33, Wolfgang Schuster wrote:

> 
> Am 15.03.2012 um 17:21 schrieb Willi Egger:
> 
>> Hi Wolfgang,
>> 
>> thank you very much for solving my problem! -- Indeed this works well.
>> 
>> What I need to do is to convert the chapter number into a roman number.
>> 
>> CHAPTER XIV.
>> 
>> BEES CAPABLE OF DOMESTICATION. Astonishment of persons at their
>> tameness, 25. Bees intended for the comfort of man. Properties fitting
>> them for domestication. Bees never attack when filled with honey, 26.
>> ….
> 
> You get the same number format as you use for the chapters in the text, when I change the format of the number to roman numerals I get them also in the TOC.
> 
> \definestructureconversionset[willi][][R]
> 
> \setuphead[chapter][sectionconversionset=willi]
> 
> 
> 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in \setuplist
  2012-03-15 16:45       ` Willi Egger
@ 2012-03-15 17:39         ` Wolfgang Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2012-03-15 17:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen


Am 15.03.2012 um 17:45 schrieb Willi Egger:

> Hi Wolfgang,
> 
> you are of course right. - When testing I switched to a test-file, where I did not set the romannumerals conversion in \setuphead. - Sorry ;-(
> 
> Is the use of the option-key in \setuphead[chapter][conversion=Romannumerals] depreciated?

It’s available for backwards compatibility but not recommended, with \definestrcutureconversionset
you have also a nice way to set different conversion for each section block.

@Hans: Is there a reason why \setuphead use “conversion” and not “sectionconversion”?

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-15 17:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-15 10:25 Bug in \setuplist Willi Egger
2012-03-15 12:59 ` Wolfgang Schuster
2012-03-15 16:21   ` Willi Egger
2012-03-15 16:33     ` Wolfgang Schuster
2012-03-15 16:45       ` Willi Egger
2012-03-15 17:39         ` Wolfgang Schuster
2012-03-15 16:39     ` Willi Egger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).