This version is out of date, covering development from v9.5.0 to v9.7.3. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v9 Icon

Getting section numbering via Action code

Export code includes a code ^sectionNumber^ which gives output like this 2.6.2.3.44. It is effectively a chaining all the $SiblingOrder values for ancestors and that of the current note.

This can be achieved in action code but is somewhat inelegant as root level notes require a different handling and action code conditionals require a full expression inside the branch. This code sets $MyString to the section number of the current object:

$MyString = if($OutlineDepth >1){
   collect(ancestor,$SiblingOrder).reverse.format(".")+"."+$SiblingOrder;
}else{
   $SiblingOrder
};

Or, in one-line form:

$MyString = if($OutlineDepth >1){collect(ancestor,$SiblingOrder).reverse.format(".")+"."+$SiblingOrder;}else{$SiblingOrder};

Other approaches

There are several ways to number (parts of) a document whether internally or (only) for export. These techniques use one or both of two user attributes:

The technique uses two user attributes:

The techniques are: