ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \definehead with some extra's
@ 1999-04-01 13:25 Gilbert van den Dobbelsteen
  1999-04-01 14:49 ` Hans Hagen
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Gilbert van den Dobbelsteen @ 1999-04-01 13:25 UTC (permalink / raw)


I have a nice problem:

  \definehead[MYMONTH][paragraph]

Ok, Now I want to suppress the generation of heads:

  \setuphead[MYMONTH]
    [command=\mycommand]

  \def\mycommand#1#2#3{}

Ok, that works, but it has an expected side effect: The heads don't show up
in the contents. After studying several things I found out that #2 contains
the commands for putting things in the .tui file. So I want to execute the
commands to create the correct entries in the .tui file, but I do not want
to typeset anything at all. Can I do something like:

  \writetolist[MYMONTH][blahblah]

Or do I need to hand-code the stuff, something like this:

\definelist[MYLIST]

  \def\MYMONTH#1{%
    \writetolist[MYLIST][#1]}

(Sorry about the syntax, it is probably not correct CONTeXt, and the
arguments are probably not in the correct order).

Gilbert.


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

* Re: \definehead with some extra's
  1999-04-01 13:25 \definehead with some extra's Gilbert van den Dobbelsteen
@ 1999-04-01 14:49 ` Hans Hagen
  1999-04-01 16:10 ` Bug in \defineenumeration Taco Hoekwater
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 1999-04-01 14:49 UTC (permalink / raw)
  Cc: context

Gilbert van den Dobbelsteen wrote:
> 
> I have a nice problem:
> ...
> Ok, that works, but it has an expected side effect: The heads don't show up
> in the contents. After studying several things I found out that #2 contains
> the commands for putting things in the .tui file. So I want to execute the
> commands to create the correct entries in the .tui file, but I do not want
> to typeset anything at all. Can I do something like:
> 
>   \writetolist[MYMONTH][blahblah]
> 
> Or do I need to hand-code the stuff, something like this:
> 
> \definelist[MYLIST]
> 
>   \def\MYMONTH#1{%
>     \writetolist[MYLIST][#1]}
> 
> (Sorry about the syntax, it is probably not correct CONTeXt, and the
> arguments are probably not in the correct order).

This feature is already built in for quite some years:

\definelist[MyMonth]

\writetolist     [MyMonth]{a}{b}  % two entries 
\writebetweenlist[MyMonth]{a}     % one entry, e.g. \blank or \page

\placelist[MyMonth]               % or [MyMonth,MyDay,..]

You can set up lists (assign commands to handle the entries). Lists obey
the section numbering mechanism, so you can ask for local ones.
Actually, this is how tables of contents etc are produced. 

Lots of surprises still waiting for you ...

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: Bug in \defineenumeration
  1999-04-01 16:10 ` Bug in \defineenumeration Taco Hoekwater
@ 1999-04-01 15:41   ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 1999-04-01 15:41 UTC (permalink / raw)


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

Taco Hoekwater wrote:

> At least my version of context exhibits a rather nasty bug in

Big chance that we have the same version! 

> Try this little document (sorry, nl version):
> 
> \doornummeren[rommel][kopletter=kap]
> \starttekst
> 
> \startrommel [-]
> Wat tekst
> \stoprommel
>  
> How can I fix this?

Can you try the attached cont-new.tex? I didn't check out the other
options, but it looks like a double attributes handling takes place. The
attached version removes the outer attribute handler. These macros need
a bit cleaning up, I admit. 

Can you check if things still work ok? 

(There is a \def\kap##1{##1} still somewhere; has to do with complicated
interactive stuff; can probably be removed.) 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------

[-- Attachment #2: cont-new.tex --]
[-- Type: application/x-tex, Size: 1936 bytes --]

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

* Bug in \defineenumeration
  1999-04-01 13:25 \definehead with some extra's Gilbert van den Dobbelsteen
  1999-04-01 14:49 ` Hans Hagen
@ 1999-04-01 16:10 ` Taco Hoekwater
  1999-04-01 15:41   ` Hans Hagen
  1999-04-01 17:46 ` Taco Hoekwater
  1999-04-02 11:24 ` Taco Hoekwater
  3 siblings, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 1999-04-01 16:10 UTC (permalink / raw)


Hello Hans,

At least my version of context exhibits a rather nasty bug in 
enumerations: \cap prevents the reading of the optional argument to
the defined command.

Try this little document (sorry, nl version):

\doornummeren[rommel][kopletter=kap]
\starttekst

\startrommel [-]
Wat tekst
\stoprommel

\tracingnone

\rommel[-]
Nog wat text

\stoptekst

How can I fix this?

Greetings, Taco

-- 
Taco Hoekwater                                 taco.hoekwater@wkap.nl
Kluwer Academic Publishers                            -- Pre Press --
Achterom 119, 3311 KB Dordrecht, The Netherlands  tel.  31-78-6392550
---------------------------------------------------------------------


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

* Re: Bug in \defineenumeration
  1999-04-01 17:46 ` Taco Hoekwater
@ 1999-04-01 16:36   ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 1999-04-01 16:36 UTC (permalink / raw)
  Cc: ntg-context

Taco Hoekwater wrote:

> This is ok I think, but i'm not certain (I get an error related to
> numbers, but it might be something completely different).

Getthe latest from www.pragma-ade.nl.  A few days ago I added a feature
(cross linking enumerations was already supported, but I added global
cross linking). 

> Anyway, I'm going home: done enough for today. I am using the
> \defineenumeration to handle scientific enunciations, btw. This
> obviously has not been done before, and it is quite likely that there
> will be new/more bugs/feature requests to report soon.

Let's hope this code is rather ok. We use enumerations/descriptions a
lot, and in general the code is ok (like most old context stuff).
Looking forward to tantilizing feature requests. 

What are enunciations? What problems do you expect? The kap is among the
most troublesome concerning attributes. 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: Bug in \defineenumeration
  1999-04-01 13:25 \definehead with some extra's Gilbert van den Dobbelsteen
  1999-04-01 14:49 ` Hans Hagen
  1999-04-01 16:10 ` Bug in \defineenumeration Taco Hoekwater
@ 1999-04-01 17:46 ` Taco Hoekwater
  1999-04-01 16:36   ` Hans Hagen
  1999-04-02 11:24 ` Taco Hoekwater
  3 siblings, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 1999-04-01 17:46 UTC (permalink / raw)


>>>>> "Hans" == Hans Hagen <pragma@wxs.nl> writes:

    Hans> Taco Hoekwater wrote:
    >> At least my version of context exhibits a rather nasty bug in

    Hans> Big chance that we have the same version!

I haven't installed the new one from tetex yet. 
Mine is half-februari somewhere. 

    >> Try this little document (sorry, nl version):
    >> 
    >> \doornummeren[rommel][kopletter=kap] \starttekst
    >> 
    >> \startrommel [-] Wat tekst \stoprommel
    >> 
    >> How can I fix this?

    Hans> Can you try the attached cont-new.tex? I didn't check out
    Hans> the other options, but it looks like a double attributes
    Hans> handling takes place. The attached version removes the outer
    Hans> attribute handler. These macros need a bit cleaning up, I
    Hans> admit.

    Hans> Can you check if things still work ok?

This is ok I think, but i'm not certain (I get an error related to
numbers, but it might be something completely different). 

Anyway, I'm going home: done enough for today. I am using the
\defineenumeration to handle scientific enunciations, btw. This
obviously has not been done before, and it is quite likely that there
will be new/more bugs/feature requests to report soon. 

Greetings, Taco


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

* Re: Bug in \defineenumeration
  1999-04-01 13:25 \definehead with some extra's Gilbert van den Dobbelsteen
                   ` (2 preceding siblings ...)
  1999-04-01 17:46 ` Taco Hoekwater
@ 1999-04-02 11:24 ` Taco Hoekwater
  1999-04-02 11:58   ` Hans Hagen
                     ` (2 more replies)
  3 siblings, 3 replies; 10+ messages in thread
From: Taco Hoekwater @ 1999-04-02 11:24 UTC (permalink / raw)
  Cc: ntg-context

>>>>> "Hans" == Hans Hagen <pragma@wxs.nl> writes:

    Hans> Taco Hoekwater wrote:
    >> This is ok I think, but i'm not certain (I get an error related
    >> to numbers, but it might be something completely different).

    Hans> Getthe latest from www.pragma-ade.nl.  A few days ago I
    Hans> added a feature (cross linking enumerations was already
    Hans> supported, but I added global cross linking).

Sorry, but it is not OK. 

\doornummeren[definition][tekst=Definition]
\steldoornummerenin[definition] % some more here
	[plaats=aanelkaar,kopletter=kap,
	 paragraafnummer=ja,wijze=perdeel]

\startdefinition
....
\stopdefinition

This tries to evaluate the counter \@@ddDEFINITION@@ddnummer when
typesetting (as well as \@@ddDEFINITIONlinks etc. etc.).

    >> Anyway, I'm going home: done enough for today. I am using the
    >> \defineenumeration to handle scientific enunciations, btw. This
    >> obviously has not been done before, and it is quite likely that
    >> there will be new/more bugs/feature requests to report soon.

    Hans> Let's hope this code is rather ok. We use
    Hans> enumerations/descriptions a lot, and in general the code is
    Hans> ok (like most old context stuff).  Looking forward to
    Hans> tantilizing feature requests.

	\doornummeren[][plaats=aanelkaar,breedte=passend]

This is too literal in it's interpretation of 'fitting'. I'd like at
least one space between the number and the first char of the following 
paragraph.

	\doornummeren[][wijze=perdeel,paragraafnummer=ja]

Does not give the desired result, which is:

	Theorem 2.1 % 1st global theorem, in paragraph 2
	Theorem 3.2 % 2st global theorem, in paragraph 3

etc. Instead I get:

	Theorem 1 % 1st global theorem, in paragraph 2
	Theorem 2 % 2st global theorem, in paragraph 3

	\doornummeren[theorem][tekst=Theorem]
	\doornummeren[lemma][theorem][tekst=Lemma]
	\steldoornummerenin[...][wijze=perparagraaf,paragraafnummer=ja]

Only works out OK if the first thing I encounter is indeed a
theorem:

	Theorem 2.1 % 1st theorem, in paragraph 2
	Lemma   2.2 % 1st lemma, in paragraph 2

Otherwise, I'll get:

	Lemma     1 % 1st lemma, in paragraph 2 
	Theorem 2.2 % 1st theorem, in paragraph 2

    Hans> What are enunciations? What problems do you expect? The kap
    Hans> is among the most troublesome concerning attributes.

Theorems, propositions, corollaries etc. Problems as above.

    Hans> Hans

    Hans> -----------------------------------------------------------------
    Hans> Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt |
    Hans> The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 |
    Hans> www.pragma-ade.nl
    Hans> -----------------------------------------------------------------

-- 
Taco Hoekwater                                 taco.hoekwater@wkap.nl
Kluwer Academic Publishers                            -- Pre Press --
Achterom 119, 3311 KB Dordrecht, The Netherlands  tel.  31-78-6392550
---------------------------------------------------------------------


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

* Re: Bug in \defineenumeration
  1999-04-02 11:24 ` Taco Hoekwater
@ 1999-04-02 11:58   ` Hans Hagen
  1999-04-02 12:00   ` Hans Hagen
  1999-04-02 13:14   ` Hans Hagen
  2 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 1999-04-02 11:58 UTC (permalink / raw)
  Cc: ntg-context

Taco Hoekwater wrote:

> Sorry, but it is not OK.

> \doornummeren[definition][tekst=Definition]
> \steldoornummerenin[definition] % some more here
>         [plaats=aanelkaar,kopletter=kap,
>          paragraafnummer=ja,wijze=perdeel]
> 
> \startdefinition
> ....
> \stopdefinition
> 
> This tries to evaluate the counter \@@ddDEFINITION@@ddnummer when
> typesetting (as well as \@@ddDEFINITIONlinks etc. etc.).

Indeed. The \uppercase in \kap is the troublemaker. There is no easy way
around this, which is (see source) why \def\kap##1{##1} was there inside
this macro. I forgot to adapt that one to an update. I now simply
disable the kap option, because the proper solution (there are
workarounds possible, but they should work at all levels and thereby
increase the code a lot) is to let eetex provide something \nocase{},
which, when issued inside \uppercase or \lowercase, disables the
conversion.   

Suggestion: say  [...,tekst=DEFINITION,letter=\tx,...] instead and you
will get what you want: an uppercase label is a smaller typeface.  

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: Bug in \defineenumeration
  1999-04-02 11:24 ` Taco Hoekwater
  1999-04-02 11:58   ` Hans Hagen
@ 1999-04-02 12:00   ` Hans Hagen
  1999-04-02 13:14   ` Hans Hagen
  2 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 1999-04-02 12:00 UTC (permalink / raw)
  Cc: ntg-context

Taco Hoekwater wrote:

>         \doornummeren[][plaats=aanelkaar,breedte=passend]
> 
> This is too literal in it's interpretation of 'fitting'. I'd like at
> least one space between the number and the first char of the following
> paragraph.

Use   breedte=ruim (width=broad)   instead.

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: Bug in \defineenumeration
  1999-04-02 11:24 ` Taco Hoekwater
  1999-04-02 11:58   ` Hans Hagen
  1999-04-02 12:00   ` Hans Hagen
@ 1999-04-02 13:14   ` Hans Hagen
  2 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 1999-04-02 13:14 UTC (permalink / raw)
  Cc: ntg-context

Taco Hoekwater wrote:

The current numbering scheme is based on a tree like structure. Some
commands permit turning prefix numbers on/off, others don't. This has to
do with forcing consistency. 
In your case, paragraaf=ja does not work that way. Would it do, then
something else would be inconsistent. When I come to 'documenting' and
'optimizing' this part of context, I'll extend the mechanisms involved
to support this kind of reverse prefixing (down->top settings). 

For the moment, you need to play around a bit with numbers yourself. A
paragraph is a section-3 level heading. You can turn the prefix off at
every level. Next you can call for the paragraph number. By assigning it
to 'links' (left) it is put left of the number, and the period is added
there too. 

Concerning the related things: Define one parent and let all the others
hang on that one. The kap can be realized by using uppercase strings and
switching to the smaller typeface. 

Remind me to put this example in the manual!

\doornummeren
  [definition]
  [tekst=DEFINITION,

links={\stelsectiein[sectie-3][vorigenummer=nee]\kopnummer[paragraaf].},
   letter=klein,
   breedte=ruim,
   sectienummer=nee,
   wijze=pertekst]

\doornummeren[theorem][definition][tekst=THEOREM]
\doornummeren[lemma]  [definition][tekst=LEMMA]

\starttekst

\hoofdstuk{alpha}

\paragraaf {eerste}

\starttheorem    \input tufte \stoptheorem
\startlemma      \input tufte \stoplemma
\startlemma      \input tufte \stoplemma
\startlemma      \input tufte \stoplemma
\startdefinition \input tufte \stopdefinition

\paragraaf {tweede}

\startdefinition \input tufte  \stopdefinition

\stoptekst

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

end of thread, other threads:[~1999-04-02 13:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-01 13:25 \definehead with some extra's Gilbert van den Dobbelsteen
1999-04-01 14:49 ` Hans Hagen
1999-04-01 16:10 ` Bug in \defineenumeration Taco Hoekwater
1999-04-01 15:41   ` Hans Hagen
1999-04-01 17:46 ` Taco Hoekwater
1999-04-01 16:36   ` Hans Hagen
1999-04-02 11:24 ` Taco Hoekwater
1999-04-02 11:58   ` Hans Hagen
1999-04-02 12:00   ` Hans Hagen
1999-04-02 13:14   ` Hans Hagen

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).