ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Probelm with \defineenumeration
@ 2003-09-18 18:13 Willi Egger
  2003-09-19  6:43 ` K.H. Wesseling
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Willi Egger @ 2003-09-18 18:13 UTC (permalink / raw)


Hi everybody,

While trying to setup a simple literature reference list I encounter the
following problem:

I have defined an enumeration. After typesetting the enumerated list I get
on the first line the enumeration text and lost and alone in front of the
second line the enumeration number.

Is this something I do in a wrong way or is there a bug?

Please try the minimal example below

Kind regards Willi


\setupoutput[pdftex]
\defineenumeration
   [Literatur]
   [location={left,serried},
    style=\em,
    width=broad,
    distance=12pt,
    headstyle=\tfx,
    text=\em,
    left={[},
    right={]},
    inbetween={\blank[small]},
    after={\blank[small]}]

\starttext

\Literatur[Wiese1964] F. Wiese. Buchbinden. 1964.

\Literatur[Goddijn1994] P.Goddijn. Het restaureren van boeken. Koninglijke
Bibliotheek, Den Haag.1994.


\stoptext

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

* Re: Probelm with \defineenumeration
  2003-09-18 18:13 Probelm with \defineenumeration Willi Egger
@ 2003-09-19  6:43 ` K.H. Wesseling
  2003-09-19 19:15   ` Willi Egger
  2003-09-19  8:36 ` Hans Hagen
  2003-09-19  9:43 ` Patrick Gundlach
  2 siblings, 1 reply; 7+ messages in thread
From: K.H. Wesseling @ 2003-09-19  6:43 UTC (permalink / raw)


[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 1155 bytes --]

Beste Willi,

Attached PDF shows my version context does it right.

Karel.

> Hi everybody,
> 
> While trying to setup a simple literature reference list I encounter
> the following problem:
> 
> I have defined an enumeration. After typesetting the enumerated list I
> get on the first line the enumeration text and lost and alone in front
> of the second line the enumeration number.
> 
> Is this something I do in a wrong way or is there a bug?
> 
> Please try the minimal example below
> 
> Kind regards Willi
> 
> 
> \setupoutput[pdftex]
> \defineenumeration
>    [Literatur]
>    [location={left,serried},
>     style=\em,
>     width=broad,
>     distance=12pt,
>     headstyle=\tfx,
>     text=\em,
>     left={[},
>     right={]},
>     inbetween={\blank[small]},
>     after={\blank[small]}]
> 
> \starttext
> 
> \Literatur[Wiese1964] F. Wiese. Buchbinden. 1964.
> 
> \Literatur[Goddijn1994] P.Goddijn. Het restaureren van boeken.
> Koninglijke Bibliotheek, Den Haag.1994.
> 
> 
> \stoptext
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 



[-- Attachment #2: Attachment information. --]
[-- Type: text/plain, Size: 469 bytes --]

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  egger.pdf
     Date:  19 Sep 2003, 8:40
     Size:  20848 bytes.
     Type:  Unknown

[-- Attachment #3: egger.pdf --]
[-- Type: Application/Octet-stream, Size: 20848 bytes --]

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

* Re: Probelm with \defineenumeration
  2003-09-18 18:13 Probelm with \defineenumeration Willi Egger
  2003-09-19  6:43 ` K.H. Wesseling
@ 2003-09-19  8:36 ` Hans Hagen
  2003-09-19  9:43 ` Patrick Gundlach
  2 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2003-09-19  8:36 UTC (permalink / raw)


At 20:13 18/09/2003 +0200, you wrote:

>I have defined an enumeration. After typesetting the enumerated list I get
>on the first line the enumeration text and lost and alone in front of the
>second line the enumeration number.
>
>Is this something I do in a wrong way or is there a bug?

hm, this is due to the fact that the [ ] are not taken into the width 
calculations. This problem was introduced some time ago when i made a 
slightly more advanced width multiline calculator. In your case it's also 
triggered by text=\em which should be textstyle=\em  (now an extra space is 
added between the text and number)

The next alternative fixes the width calculation.

\def\@@dostartdefinitie#1[#2]#3%
   {\getvalue{\??dd#1\c!voor}%
    \begingroup
    \doadaptleftskip{\getvalue{\??dd#1\c!marge}}%
    \showcomposition
    \!!widthb\getvalue{\??dd#1\c!afstand}\relax
    \ifdim\!!widthb=\zeropoint\relax
      \doifvalue{\??dd#1\c!breedte}\v!ruim{\!!widthb=1em}%
    \fi
    % temp hack, we need to avoid this kind of preprocessing
    \setbox\@@definitiebox\hbox % preroll
      {\forgetall
       \trialtypesettingtrue
       \mindermeldingen
       \def\\{\crcr}%
       \@@definitiewoord{#1}[#2]{#3}%
         {\begstrut\getvalue{\??dd#1\c!tekst}\ignorespaces#3\endstrut}}%
    % so far
    \assignwidth
      {\!!widtha}
      {\getvalue{\??dd#1\c!breedte}}
      {\doifelsevaluenothing{\??dd#1\c!monster}
         {% preroll can move here (test first)
          \ifhbox\@@definitiebox\unhcopy\else\copy\fi \@@definitiebox}
         {\@@definitiewoord{#1}[#2]{#3}%
            {\getvalue{\??dd#1\c!tekst}\getvalue{\??dd#1\c!monster}}}}
      {\!!widthb}%
    \setbox\@@definitiebox\hbox
      {\forgetall
       \mindermeldingen
       \let\\\endgraf
       \doifelsevalue{\??dd#1\c!plaats}\v!aanelkaar
         {\@@definitiewoord{#1}[#2]{#3}%
            {\begstrut\getvalue{\??dd#1\c!tekst}#3\endstrut}}
         {\@@definitiewoord{#1}[#2]{#3}%
            {\vtop{\hsize\!!widtha\advance\hsize-\!!widthb
             \begstrut\getvalue{\??dd#1\c!tekst}\ignorespaces#3\endstrut}}}}%
    \doifelsevalue{\??dd#1\c!titeluitlijnen}\v!nee
      {\edef\@@leftdefinitieskip {\the\leftskip }%
       \edef\@@rightdefinitieskip{\the\rightskip}}
      {\ifcase\insidedefinition
         \edef\@@leftdefinitieskip {\the\leftskip }%
         \edef\@@rightdefinitieskip{\the\rightskip}%
       \fi}%
    \expanded{\inspringen[\getvalue{\??dd#1\c!inspringen}]}%
    \ifcase\insidedefinition % better a system mode
      \chardef\insidedefinition\plusone
    \or
      \chardef\insidedefinition\plustwo
    \fi} % now happens elsewhere : \noindent\ignorespaces

-------------------------------------------------------------------------
                                   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
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Re: Probelm with \defineenumeration
  2003-09-18 18:13 Probelm with \defineenumeration Willi Egger
  2003-09-19  6:43 ` K.H. Wesseling
  2003-09-19  8:36 ` Hans Hagen
@ 2003-09-19  9:43 ` Patrick Gundlach
  2 siblings, 0 replies; 7+ messages in thread
From: Patrick Gundlach @ 2003-09-19  9:43 UTC (permalink / raw)


"Willi Egger" <w.egger@boede.nl> writes:

Hello Willi,

> Is this something I do in a wrong way or is there a bug?

I did not look into it yet, but I can confirm that I get the same
error with the latest ConTeXt version. So I think that there must be
some bug.

Patrick
-- 
Silent is the goldfish in its bowl

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

* Re: Probelm with \defineenumeration
  2003-09-19  6:43 ` K.H. Wesseling
@ 2003-09-19 19:15   ` Willi Egger
  0 siblings, 0 replies; 7+ messages in thread
From: Willi Egger @ 2003-09-19 19:15 UTC (permalink / raw)


Hoi Karel,

Thanks, I see in your version it works.
I have to say, that I copied this definition from an other project, where it
used to work as in your file!
On the other hand I use the latest beta version, may be that there were
changes ....

Nederlands blijft een moelijke taal om te schrijven. De buitenlander heeft
er steeds last van. Bedankt voor de correctie!

Kind regards Willi
----- Original Message ----- 
From: "K.H. Wesseling" <k.h.wesseling@planet.nl>
To: <ntg-context@ntg.nl>
Sent: Friday, September 19, 2003 8:43 AM
Subject: Re: [NTG-context] Probelm with \defineenumeration


> Beste Willi,
>
> Attached PDF shows my version context does it right.
>
> Karel.
>
> > Hi everybody,
> >
> > While trying to setup a simple literature reference list I encounter
> > the following problem:
> >
> > I have defined an enumeration. After typesetting the enumerated list I
> > get on the first line the enumeration text and lost and alone in front
> > of the second line the enumeration number.
> >
> > Is this something I do in a wrong way or is there a bug?
> >
> > Please try the minimal example below
> >
> > Kind regards Willi
> >
> >
> > \setupoutput[pdftex]
> > \defineenumeration
> >    [Literatur]
> >    [location={left,serried},
> >     style=\em,
> >     width=broad,
> >     distance=12pt,
> >     headstyle=\tfx,
> >     text=\em,
> >     left={[},
> >     right={]},
> >     inbetween={\blank[small]},
> >     after={\blank[small]}]
> >
> > \starttext
> >
> > \Literatur[Wiese1964] F. Wiese. Buchbinden. 1964.
> >
> > \Literatur[Goddijn1994] P.Goddijn. Het restaureren van boeken.
> > Koninglijke Bibliotheek, Den Haag.1994.
> >
> >
> > \stoptext
> >
> > _______________________________________________
> > ntg-context mailing list
> > ntg-context@ntg.nl
> > http://www.ntg.nl/mailman/listinfo/ntg-context
> >
>
>
>


----------------------------------------------------------------------------
----


> The following section of this message contains a file attachment
> prepared for transmission using the Internet MIME message format.
> If you are using Pegasus Mail, or any another MIME-compliant system,
> you should be able to save it or view it from within your mailer.
> If you cannot, please ask your system administrator for assistance.
>
>    ---- File information -----------
>      File:  egger.pdf
>      Date:  19 Sep 2003, 8:40
>      Size:  20848 bytes.
>      Type:  Unknown
>

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

* Re: Probelm with \defineenumeration
  2003-09-19 10:21 Charles Doherty
@ 2003-09-19 10:43 ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2003-09-19 10:43 UTC (permalink / raw)


At 11:21 19/09/2003 +0100, you wrote:

>I tried your example and got the same misaligned result as yourself and 
>Patrick. However when I made text=, it aligned properly but your number, 
>of course,  is not in italics. This may help people who are in a position 
>to know what is going on.

text= is for a label and willy used it for a style switch (textstyle=..) so 
a space was introduced; this makes the text too wide and wrap (resulting in 
a linebreak)

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
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Probelm with \defineenumeration
@ 2003-09-19 10:21 Charles Doherty
  2003-09-19 10:43 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Charles Doherty @ 2003-09-19 10:21 UTC (permalink / raw)


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


"Willi Egger" <w.egger@boede.nl> writes:
>> Hi everybody,
>>
>> While trying to setup a simple literature reference list I encounter
>> the following problem:
>>
>> I have defined an enumeration. After typesetting the enumerated list I
>> get on the first line the enumeration text and lost and alone in front
>> of the second line the enumeration number.
>>
>> Is this something I do in a wrong way or is there a bug?

"K.H. Wesseling" <k.h.wesseling@planet.nl> writes:

> Beste Willi,
>
> Attached PDF shows my version context does it right.
>
> Karel.

Patrick Gundlach <pg@levana.de> writes:

> I did not look into it yet, but I can confirm that I get the same
> error with the latest ConTeXt version. So I think that there must be
> some bug.


Dear Willi, Karel and Patrick,

I tried your example and got the same misaligned result as yourself and 
Patrick. However when I made text=, it aligned properly but your 
number, of course,  is not in italics. This may help people who are in 
a position to know what is going on.

Charlie Doherty

ConTeXt  ver: 2003.8.8  fmt: 2003.8.18  int: english  mes: english

\defineenumeration
    [Literatur]
    [location={left,serried},
     style=\em,
     width=broad,
     distance=12pt,
     headstyle=\tfx,
     text=,
     left={[},
     right={]},
     inbetween={\blank[small]},
     after={\blank[small]}]

\starttext

\Literatur[Wiese1964] F. Wiese. Buchbinden. 1964.

\Literatur[Goddijn1994] P.Goddijn. Het restaureren van boeken.
Koninglijke Bibliotheek, Den Haag.1994.


\stoptext


[-- Attachment #2: pastedGraphic1.pdf --]
[-- Type: application/pdf, Size: 18672 bytes --]

[-- Attachment #3: Type: text/plain, Size: 179 bytes --]


Best wishes,
Charlie Doherty



**************
Charles Doherty,
Department of Early Irish History,
University College Dublin,
Belfield,
Dublin 4
Ireland
Telephone +353 1 7168381

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

end of thread, other threads:[~2003-09-19 19:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-18 18:13 Probelm with \defineenumeration Willi Egger
2003-09-19  6:43 ` K.H. Wesseling
2003-09-19 19:15   ` Willi Egger
2003-09-19  8:36 ` Hans Hagen
2003-09-19  9:43 ` Patrick Gundlach
2003-09-19 10:21 Charles Doherty
2003-09-19 10:43 ` 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).