I would like to create a set of notes which each stand for numbered book sections within a container corresponding to a numbered chapter. I’m not convinced when I do this what the ordering will be so I’d like to do two, coupled things:
I’d like to number the sections within the outline and if I move one, have it renumber automatically or because I invoke an agent or something…
What would be cool, but that would probably magic, is to have that reordering change the physical layout of the map notes…
or… less magical, that the number be reflected in the title so that I could then visually reorder the notes in the map.
So…can I do 1? and can I do 3? I’m sure you can see why this would be useful as a use case, but I couldn’t find evidence that this has been done.
I concur with this solution but be aware aliases, e.g. in agents, will show a different numbering from their original note. If the latter is unacceptable, happily it appears ^sectionNumber^ can use offset designators so this seems to work:
How does this code get modified if the document to be number outlined is not the whole document or top-level?
I have a container for my dissertation chapters & sections. The first note-container is “Introduction” which I’d like to have display as “1 Introduction” rather than “1.1 Introduction” or “X.1 Introduction” etc etc.
Apologies for reviving an old topic but I can’t see it elsewhere and cannot figure out the code from @mwra Tbref code for ^sectionNumber^.
The starting point is that this isn’t a built-in function but code the user must build for themselves.
So, first we will make a user String attribute to hold our custom number: $MyOutlineString. This also avoids doing evaluation in $DisplayExpression which can slow things up if the DE is used by lots of notes.
This code goes in all notes in the (numbered) section of the outline. I’d add to an Edict rather than a Rule as it doesn’t need to be tested all the time. Edicts run less often and can run on demand too if you know data needs updating.
So the $Edict is (or adds the following to existing Edict code):
BTW, @mwra and I recently developed a function for handling the numbering of outlines. If you’re interested, perhaps we review this in a future meetup.
Ok, I’ll work on this to bring it down to the bare bones. My current implementation has a lot of personal methods and templates that are not ready for release.