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.
Guy Worthington
\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
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 -----
participants (2)
-
Guy Worthington
-
Patrick Gundlach