mailing-list for TeXmacs Users

Text archives Help


[TeXmacs] Having trouble figuring out how to make a counter that resets to 0 automatically at each chapter


Chronological Thread 
  • From: "David G. Wonnacott" <address@hidden>
  • To: address@hidden
  • Subject: [TeXmacs] Having trouble figuring out how to make a counter that resets to 0 automatically at each chapter
  • Date: Fri, 29 Jul 2011 13:12:10 -0400

Hi TeXmacs folks,

I'm trying to get more sophisticated and say-what-I-mean in my use of TeXmacs, but am having trouble figuring out how to introduce an automatic counter that resets at each chapter. I'm trying to follow the descriptions in http://www.texmacs.org/tmdoc/main/styles/std/std-counter-dtd.en.html, but somehow I think I'm missing something. I have attached an example TeXmacs file that illustrates my woes. My apologies if this is obvious from the documentation, but somehow I'm not getting it; I'm not sure whether my basic use of counters is misguided but looks like it's working (and thus is confusing me), or whether instead I am using basic counters correctly but have blown it when it comes to counter groups.

Thanks for any help you can provide,
Dave W

<TeXmacs|1.0.7.3>

<style|book>

<\body>
<chapter|In Which an Attempt is Made to Create Some Counters>

This is a test of creating some counters, as I try to figure out how to get
a counter that auto-resets at each chapter. \ For example, suppose I want
to introduce a 'thingy', each of which is numbered, and in which the
numbers reset for each chapter.

\;

This inquiry is based on what I see in the online instructions at

<verbatim|http://www.texmacs.org/tmdoc/main/styles/std/std-counter-dtd.en.html>

\;

I think I can get a plain counter, plain-thingy, but not one that resets
(which I'm calling good-thingy). \ Here are the definitions (written first
without backslashes, so I can find them easily in this test):

\;

new-counter plain-thingy: <new-counter|plain-thingy>

check that chapter-nr gives us the chapter number: <value|chapter-nr>

add-to-counter-group good-thingy chapter
<add-to-counter-group|good-thingy|chapter>

\;

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr> \ <em|[NOTE
that the web site suggests nr-plain-thingy here, but that doesn't work.]>

inc-plain-thingy: <inc-plain-thingy>

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr>

inc-plain-thingy: <inc-plain-thingy>

inc-plain-thingy: <inc-plain-thingy>

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr>

next-plain-thingy: <next-plain-thingy>

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr>

next-plain-thingy: <next-plain-thingy>

next-plain-thingy: <next-plain-thingy>

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr>

\;

At this point, I am not sure about the difference between ``inc'' and
``next'' for counters. They both seem to do the same thing. \ Let's try
this all again with the good-thingy:

\;

Use good-thingy via good-thingy-nr: <value|good-thingy-nr>

inc-good-thingy: <inc-good-thingy>

Use good-thingy via good-thingy-nr: <value|good-thingy-nr> \ <em|[Hmm ...
this doesn't show any change ]>

next-good-thingy: <next-good-thingy>

Use good-thingy via good-thingy-nr: <value|good-thingy-nr> \ <em|[this
doesn't show any change either ]>

\;

So these don't seem to work; in my version of TeXmacs (1.0.7.3 on Ubuntu
10.04), the second set all just shows 0.

<chapter|In Which We See What Happens to Our Counters in a New Chapter>

This is just a cut-and-paste of the stuff from before:

\;

\;

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr>

inc-plain-thingy: <inc-plain-thingy>

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr>

inc-plain-thingy: <inc-plain-thingy>

inc-plain-thingy: <inc-plain-thingy>

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr>

next-plain-thingy: <next-plain-thingy>

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr>

next-plain-thingy: <next-plain-thingy>

next-plain-thingy: <next-plain-thingy>

Use plain thingy via plain-thingy-nr: <value|plain-thingy-nr>

\;

So my plain-thingy counter is not resetting...

\;

Use good-thingy via good-thingy-nr: <value|good-thingy-nr>

inc-good-thingy: <inc-good-thingy>

Use good-thingy via good-thingy-nr: <value|good-thingy-nr>

next-good-thingy: <next-good-thingy>

Use good-thingy via good-thingy-nr: <value|good-thingy-nr>

\;

And my good-thingy counter isn't working at all.

\;

Clearly I'm missing something ... but what?

\;
</body>

<\initial>
<\collection>
<associate|font-base-size|12>
<associate|page-type|letter>
<associate|preamble|false>
</collection>
</initial>

<\references>
<\collection>
<associate|auto-1|<tuple|1|?>>
<associate|auto-2|<tuple|2|?>>
<associate|ex-exec-negpower-each|<tuple|2.1|?>>
<associate|ex-exec-negpower-once|<tuple|2.2|?>>
<associate|ex-exec-negpower-tree|<tuple|2.4|?>>
<associate|ex-exec-power1-tree|<tuple|2.3|?>>
<associate|ex-exec-tree-wide|<tuple|2.5|?>>
</collection>
</references>

<\auxiliary>
<\collection>
<\associate|toc>

<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|1<space|2spc>>

<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-1><vspace|0.5fn>


<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|2<space|2spc>>

<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-2><vspace|0.5fn>
</associate>
</collection>
</auxiliary>

  • [TeXmacs] Having trouble figuring out how to make a counter that resets to 0 automatically at each chapter, David G. Wonnacott, 07/29/2011

Archive powered by MHonArc 2.6.19.

Top of page