ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Definitions
@ 2002-01-17 13:45 Giuseppe Bilotta
  2002-01-20 17:56 ` Definitions Giuseppe Bilotta
  0 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Bilotta @ 2002-01-17 13:45 UTC (permalink / raw)


Hello,

I have a bug report and an enhancement request for enumerations.

First of all: the bug.

I'm using

ConTeXt  ver: 2002.1.7  fmt: 2002.1.10  int: english  mes: english

(running pdf-e-TeX)
and there is an "undefined control sequence error" when using:

\defineenumeration[definizione]
                  [text=Definizione,
                   location=hanging,
                   hang=0,
                   headcolor=blue,
                   headstyle=normal,
                   way=bychapter]

\starttext

\definizione[relinv] (Relazione inversa). Siano dati due insiemi non vuoti
  $X$, $Y$ ed una relazione $§R$ di $X$ in $Y$ (i.e. $R\subseteq X\times Y$).
  Si dice che l'~insieme  ${§R}^{-1}\subseteq Y\times X$  \`e la relazione
  inversa di $§R$ se e solo se:

\stoptext

The undefined control sequence seems to be \preparednumber.

The enhancement request. When enumerations are used for create theorems,
lemmas, corollaries etc one sometimes needs to add an optional
argument that should be typeset in its own way but in relation to
the title rather than the content. For example, if I were to write
a calculus book and got to Lebesgue theorem I would like to write:

\starttheorem[leb][author=Lebesgue,]
Let $(S, \A, \mu)$ be a $sigma$-finite measure space ...
\stoptheorem

or

\starttheorem[cpt][author=Cantor,subj={uniform continuity}]
Let $(S, d)$ be a metric space ...
\stoptheorem

and I would like to be able to control the layout of the theorem
according to the presence and absence of the various extra fields.
In some way this would be a stripped-down version of my xdesc
module, so I will try to adapt those macros. But if there is an
easier way, please let me know.

--
Giuseppe "Oblomov" Bilotta


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

* Re: Definitions
  2002-01-17 13:45 Definitions Giuseppe Bilotta
@ 2002-01-20 17:56 ` Giuseppe Bilotta
  2002-01-20 23:28   ` Definitions Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Bilotta @ 2002-01-20 17:56 UTC (permalink / raw)
  Cc: ntg-context

Thursday, January 17, 2002 Giuseppe Bilotta wrote:

GB> Hello,

GB> I have a bug report and an enhancement request for enumerations.

GB> First of all: the bug.

I found the bug. It comes from the definition in core-des:

\def\special@@definitiewoord#1#2#3#4[#5]#6#7%
  {\strut
   \doifelsevalue{\??dd#1\c!nummer}{\v!nee}
     {\!!doneafalse}
     {\doifelse{#5}{-}
        {\!!doneafalse}
        {\!!doneatrue}}%
   \chardef\definitiekoppeling=0
   \iflocation
     \doifvaluesomething{\??dd#1\c!koppeling}
       {\processaction % genereert > of <
          [\getvalue{\??dd#1\c!koppelwijze}]
          [ \v!lokaal=>\chardef\definitiekoppeling=1, % old: default
           \v!globaal=>\chardef\definitiekoppeling=2]}% new: global crosslinking
   \fi
   \stelnummerin % the number is called indirectly
     [\getvalue{\??dd#1\??dd\c!nummer}]
     [\c!sectienummer=\getvalue{\??dd#1\c!sectienummer}]%
   \if!!donea
     \getvalue{\e!volgende#2#1}%
     \iflocation
       \bgroup
       \setvalue{\??dd#1\c!sectienummer}{\v!ja}%
       \protectconversion
      %\maakvoorafgaandenummer[#1]%
       \maakvoorafgaandenummer[\getvalue{\??dd#1\??dd\c!nummer}]%
       \ifcase\definitiekoppeling \or
         \xdef\internaldoornummer{#3{#1}}%
         \rawreference{\s!num}{#1:\internaldoornummer}{}%
       \or
         \xdef\internaldoornummer{\countervalue{\??dd\c!koppeling#1}}%
         \rawreference{\s!num}{#1:\internaldoornummer}{}%
       \fi
       \egroup
     \fi
    %\maakvoorafgaandenummer[#1]%
     \maakvoorafgaandenummer[\getvalue{\??dd#1\??dd\c!nummer}]%
     \hbox
       {\let\normalkap\relax % sorry, uppercase causes troubles
        \doattributes        % \nocase primitive needed
          {\??dd#1}\c!kopletter\c!kopkleur
          {\getvalue{\??dd#1\c!commando}% hook for taco 
             {\showdntext{#2#1}%
              \domakednnummer{#1}{#2}{#3}}}%
        \iflocation\ifcase\definitiekoppeling \else
          \edef\localconnection{\getvalue{\??dd#1\c!koppeling}:\internaldoornummer}%
          \doifreferencefoundelse{\localconnection}
            {\in[\localconnection]}{}% genereert > of <
         %\in[\localconnection]%
        \fi\fi}%
     \doifnot{#5}{-}{\rawreference{\s!num}{#5}{#3{#1}}}%
% Here is the bug -----------------------------^^^^^^
% When this gets called with \showdnnummer as #3, there
% is an expansion problem, since \showdnnummer is *not*
% properly expandable: it uses the command sequence
% \preparednumber which is defined by \showdnnummer itself
% If I change the line with something like
     \preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber
     \edef\thenumbertouse{%
       \preparednumber
       \nummer[\getvalue{\??dd#1\??dd\c!nummer}]}%
     \doifnot{#5}{-}{\rawreference{\s!num}{#5}{\thenumbertouse}}%
% everything goes on smoothly.
% Maybe we need and expandable version of showdnnummer?
   \else % Why was this strange expansion needed? 
     \hbox
       {\edef\!!stringa{\showdnpuretext{#2#1}}% nog eens testen binnen \expanded
        \expanded{\doattributes{\??dd#1}\noexpand\c!kopletter\noexpand\c!kopkleur
          {\noexpand\getvalue{\??dd#1\c!commando}%
             {\!!stringa}}}%
        \doifnot{#5}{-}{\rawreference{\s!num}{#5}{}}}%
   \fi}

--
Giuseppe "Oblomov" Bilotta


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

* Re: Definitions
  2002-01-20 17:56 ` Definitions Giuseppe Bilotta
@ 2002-01-20 23:28   ` Hans Hagen
  2002-01-21 15:31     ` Re[2]: Definitions Giuseppe Bilotta
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2002-01-20 23:28 UTC (permalink / raw)
  Cc: ntg-context

At 06:56 PM 1/20/2002 +0100, Giuseppe Bilotta wrote:

>      \doifnot{#5}{-}{\rawreference{\s!num}{#5}{#3{#1}}}%
>% Here is the bug -----------------------------^^^^^^
>% When this gets called with \showdnnummer as #3, there

Maybe a better way to go is the following:

\def\showdnnummer#1%
   {%\preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber
    \preparednumber
    \nummer[\getvalue{\??dd#1\??dd\c!nummer}]}

and move the \prepare ... to (2 times) after \maakvoorafgaandenummer 
(==makeprefixnumber)

can you test that?

btw, this (new) feature permits us to set the number-separators for each 
number class independently (so fig 1.2.3 versus table 1-2-3 and alike) but 
i guess that you already uncovered that.

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-pod.nl
-------------------------------------------------------------------------


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

* Re[2]: Definitions
  2002-01-20 23:28   ` Definitions Hans Hagen
@ 2002-01-21 15:31     ` Giuseppe Bilotta
  0 siblings, 0 replies; 7+ messages in thread
From: Giuseppe Bilotta @ 2002-01-21 15:31 UTC (permalink / raw)
  Cc: ntg-context

Monday, January 21, 2002 Hans Hagen wrote:

HH> Maybe a better way to go is the following:

HH> \def\showdnnummer#1%
HH>    {%\preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber
HH>     \preparednumber
HH>     \nummer[\getvalue{\??dd#1\??dd\c!nummer}]}

HH> and move the \prepare ... to (2 times) after \maakvoorafgaandenummer 
HH> (==makeprefixnumber)

HH> can you test that?

I can, but it requires looking up everywhere in the ConTeXt core
to see where showdnnummer is used and patch. Hm, looks like it's
only used in core-des.tex. Ok, I can do that.

I'm going to define:

\def\preparednnummer#1%
  {\preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber}

(or would this cause too much of a slowdown?)

And there is going to be one extra macro parameter in
dodoornummeren ... which causes even more slowdowns. Ok.

Do you want the patches sent privately or publicly?

HH> btw, this (new) feature permits us to set the number-separators for each 
HH> number class independently (so fig 1.2.3 versus table 1-2-3 and alike) but 
HH> i guess that you already uncovered that.

Yes, the problem was in being able to use it ;-)

--
Giuseppe "Oblomov" Bilotta


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

* Re: Definitions
  1999-04-11 21:41 ` Definitions Tobias Burnus
@ 1999-04-12 10:36   ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 1999-04-12 10:36 UTC (permalink / raw)
  Cc: NTG-CONTEXT

Tobias Burnus wrote:

> Hmmm, why do I get DEFINITION 1.1 but LEMMA 1?
> I even tried to add ``abschnittsnummer=ja,art=prokapitel'' after the Lemma, but
> it didn't worked. (Now I use the individuel definition, w/o inheriting
> anything.)

Hm. I'll send you a changed \special@@definitiewoord to test 

This kind of inheritance is only usefull if you want to use the same
number for all, whichis probbaly not what you want. Anyway, Taco will be
glad that you noticed this bug, because he uses ths kind of coupling. 

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] 7+ messages in thread

* Re: Definitions
  1999-04-10  9:46 Definitions Hans Hagen
@ 1999-04-11 21:41 ` Tobias Burnus
  1999-04-12 10:36   ` Definitions Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Tobias Burnus @ 1999-04-11 21:41 UTC (permalink / raw)
  Cc: NTG-CONTEXT

Hallo Hans, hi others,

> The definition is defined in the same way as tobias did, but we combine
> the definition with the settings:
> 
> \definierenummerierung
>   [definition]
>   [text=Definition,
>    platz=kleinerabstand,
>    kopfstil=\sc,
>    breite=breit,
>   abschnittsnummer=ja,
>   art=prokapitel]
> 
> The lemma inherit their settings from definition and get one additional
> setting.
> 
> \definierenummerierung
>   [lemma]
>   [definition]
>   [text=Lemma]

Hmmm, why do I get DEFINITION 1.1 but LEMMA 1?
I even tried to add ``abschnittsnummer=ja,art=prokapitel'' after the Lemma, but
it didn't worked. (Now I use the individuel definition, w/o inheriting
anything.)

Groeten, Gruß, Regards,

Tobias

PS: This is with context version 1999-04-11.
--
Tobias Burnus
Troppauer Str. 15
12205 Berlin
"This above all: To thine own self be true / And it must follow as the day the
night /
Thou canst not then be false to anyone."                  Polonius to Laertis
(Hamlet)
Vote against SPAM: http://www.politik-digital.de/spam/ (Petition to the EP)


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

* re: Definitions
@ 1999-04-10  9:46 Hans Hagen
  1999-04-11 21:41 ` Definitions Tobias Burnus
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 1999-04-10  9:46 UTC (permalink / raw)


Tobias asked me: 

> I get: 
> 
> DEFINITION 1.1  Some Text
> LEMMA 1.1       Some Text
> DEFINITION 1.2  Some Text
> 
> I'd like to have this:
> 
> DEFINITION 1.1  Some Text
> LEMMA 1.1  Some Text
> DEFINITION 1.2  Some Text
> 

His file looked like: 

> \definierenummerierung
>   [definition]
>   [text=Definition]
> \stellebeschreibungein
>   [definition]
>    platz=kleinerabstand,kopfstil=\sc,abschnittsnummer=ja,art=prokapitel]
> \definierenummerierung
>   [lemma][text=Lemma]
> \stellebeschreibungein
>   [lemma]
>   [platz=kleinerabstand,kopfstil=\sc,abschnittsnummer=ja,art=prokapitel]
> 
> \kapitel{One}
> 
> \absatz{eins}
> 
> \startdefinition This is some text ... \stopdefinition
> 
> \absatz{two}
> 
> \startlemma This is a some more text ... \stoplemma

The solution is: set the width to 'broad', or in german: 

  breite=breit

The example can however be defined more compact, so I thought it made
sense to post it here: 

The definition is defined in the same way as tobias did, but we combine
the definition with the settings:  

\definierenummerierung
  [definition]
  [text=Definition,
   platz=kleinerabstand,
   kopfstil=\sc,
   breite=breit,
   abschnittsnummer=ja,
   art=prokapitel]

The lemma inherit their settings from definition and get one additional
setting. 

\definierenummerierung
  [lemma]
  [definition]
  [text=Lemma]

-----------------------------------------------------------------
                                          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] 7+ messages in thread

end of thread, other threads:[~2002-01-21 15:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-17 13:45 Definitions Giuseppe Bilotta
2002-01-20 17:56 ` Definitions Giuseppe Bilotta
2002-01-20 23:28   ` Definitions Hans Hagen
2002-01-21 15:31     ` Re[2]: Definitions Giuseppe Bilotta
  -- strict thread matches above, loose matches on Subject: below --
1999-04-10  9:46 Definitions Hans Hagen
1999-04-11 21:41 ` Definitions Tobias Burnus
1999-04-12 10:36   ` Definitions 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).