ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* descriptions and enumerations
@ 2003-04-15 11:39 Guy Worthington
  2003-04-15 20:10 ` Patrick Gundlach
  0 siblings, 1 reply; 3+ messages in thread
From: Guy Worthington @ 2003-04-15 11:39 UTC (permalink / raw)


I'm having trouble developing a coupling.  

In the code below, you'll see a skeleton example, after which
follows a discussion, and then a bit more code.  I'm trying to show a
that each code snippet is coupled to the first example by using an 
\exampleContinued macro.

-----
\defineenumeration
 [example]
 [location=serried,
  text=Example,
  before=\blank,
  after=\blank,
  way=bychapter,
  style=italic]

\definedescription
 [exampleContinued]
 [location=serried,
  width=fit,
  distance=1em,
  text={Example~\headnumber[chapter].\nummer[example] 
            (continued)},
  before=\blank,
  after=\blank,
  style=italic] 

\setupcolors[state=start]

\starttext

\chapter{Introduction}

\input tufte

\example[ex:simpleExample] A Simple Example

\startJV
// A very simple applet
import java.applet.Applet;
import java.awt.Graphics;

/** This applet just says "Hello World"! */
public class HelloWorld extends Applet {
    ...
}
\stopJV

\input tufte

\exampleContinued[ex:simpleExample:1] The paint() method

\startJV
    /** Just says "Hello World
     * @param g
     */
    public void paint (Graphics g) {
        g.drawString("Hello World", 25, 10);
    }
\stopJV

\stoptext
-----

You'll see that the example (continue) line is all garbled, with the
first word (in this case "The") set in wrong type and also in the
wrong place.  

I'm hoping someone can unravel the mess.

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

* Re: descriptions and enumerations
  2003-04-15 11:39 descriptions and enumerations Guy Worthington
@ 2003-04-15 20:10 ` Patrick Gundlach
  2003-04-16  8:53   ` Guy Worthington
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Gundlach @ 2003-04-15 20:10 UTC (permalink / raw)


Guy Worthington <guyw@multiline.com.au> writes:

Hi,

> \definedescription
\defineenumeration

>  [exampleContinued]
>  [location=serried,
>   width=fit,
>   distance=1em,
>   text={Example~\headnumber[chapter].\nummer[example] 
>             (continued)},

warning: space gets eaten after \nummer[...]. I don't think that this
is the expected behaviour, but it is the way it is.

>   before=\blank,
>   after=\blank,
   number=no,
>   style=italic] 



> You'll see that the example (continue) line is all garbled, with the
> first word (in this case "The") set in wrong type and also in the
> wrong place.  

this is because \description takes one argument:

 \description{...}...\par


{...}		   <text>
...		   <text>


the "The" is taken (why not only the "T"??) as the argument. See
cont-en?.pdf chapter 10.


> I'm hoping someone can unravel the mess.

Most likely there is some more clever or elegant way. But probably too
clever for me.

Patrick

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

* Re: descriptions and enumerations
  2003-04-15 20:10 ` Patrick Gundlach
@ 2003-04-16  8:53   ` Guy Worthington
  0 siblings, 0 replies; 3+ messages in thread
From: Guy Worthington @ 2003-04-16  8:53 UTC (permalink / raw)


Patrick Gundlach wrote:
> Guy Worthington wrote:

>> [partial code to create an enumeration and a group of siblings of
>> the form:
>>
>>   Example 1.1 Blah
>>     ...
>>   Example 1.1(continued) Blah Blah
>>     ...
>>   Example 1.1(continued) Blah Blah Blah]

> Most likely there is some clever or elegant way. But probably
> too clever for me.

It's cleaner than my partial solution (and it works to boot).  In my
books I'd call that elegant.

-----
\defineenumeration
 [example]
 [location=serried,
  text=Example,
  before=\blank,
  after=\blank,
  way=bychapter,
  style=italic]

\defineenumeration
 [exampleContinued]
 [location=serried,
  width=fit,
  distance=1em,
  text={Example~\headnumber[chapter].\nummer[example] 
            (continued)},
  before=\blank,
  after=\blank,
  number=no,
  style=italic] 

\setupcolors[state=start]

\starttext

\chapter{Introduction}

\input tufte

\example[ex:simpleExample] A Simple Example

\startJV
// A very simple applet
import java.applet.Applet;
import java.awt.Graphics;

/** This applet just says "Hello World"! */
public class HelloWorld extends Applet {
    ...
}
\stopJV

\input tufte

\exampleContinued[ex:simpleExample:1] The paint() method

\startJV
    /** Just says "Hello World
     * @param g
     */
    public void paint (Graphics g) {
        g.drawString("Hello World", 25, 10);
    }
\stopJV

\stoptext
-----

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

end of thread, other threads:[~2003-04-16  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-15 11:39 descriptions and enumerations Guy Worthington
2003-04-15 20:10 ` Patrick Gundlach
2003-04-16  8:53   ` Guy Worthington

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