Thanks for taking a look at Scrivener! As you are writing a software manual, you might be interested in the Scrivener projects used to create our documentation. They are available for download from the support page. The Scapple project is newer, and has a few tricks you might find useful. For example, if a keyboard shortcut in Scapple were ever changed, I would only need to change it once, in the menu appendix. All references to the shortcut in the text refer back to that piece of data.
Anyway, to your question: if I understand correctly, you are trying to use the <$n:chapter> placeholder, both to generate chapter numbers, and to refer to those numbers periodically throughout the chapter text. There is another placeholder type you use should in this situation: <$n:chapter:name_of_chapter> (obviously the last part is up to you just like the “chapter” part is, feel free to use Italian if you prefer!
). These are referred to as named counters, because you can elsewhere refer to them by name to print the number, without incrementing the “chapter” number stream.
When you wish to refer to specific named counter, whether it has even been used yet in the flow of the text (for example, a reference from chapter 2 to chapter 10), the placeholder is: <$n#chapter:name_of_chapter>.
That’s all well and good, but when it comes to putting these placeholders in the compiler, you can only supply one generic placeholder for all of the items, yet with this technique, you need each item to have a unique name. The solution is another placeholder: <$title_no_spaces>. When this placeholder is encountered, the compiler will print the binder title for the section it is compiling, but with the spaces between words stripped out (that makes it easier for the compiler to recognise that this is all one tag). When combined with the above technique, we can embed this placeholder inside of the chapter numbering placeholder, like so:
<$n:chapter:<$title_no_spaces>>
By example: say you have a chapter named “Installing and Updating”. When you compile, internally the above placeholder will convert to:
<$n:chapter:InstallingandUpdating>
In another compile pass, this gets turned into a number, let’s say “2” for this example, but the important thing is that this is your reference code, once you use a “#” instead of a “:”, like so (note it isn’t case-sensitive):
Figure <$n#chapter:installingandupdating>.<$n:figure>
Of course if you plan on referring to these figures in the text, by number, you might want to expand these tricks to the figure numbering stream as well. Each figure can have its own unique name, and thus become a cross-reference hook.
Finally, all of that gets pretty ugly in the text editor, and having to type in all of those punctuation codes leads to error by typo. In our general non-fiction starter template, you’ll find a trick described in the “about” file, and demonstrated in the Replacements compile option pane, under the “Preset Replacements” tab. The trick is that since Scrivener’s numbering codes are plain text, a tool that uses search and replace can modify the text you type into something else. The Replacements pane provides that tool.
In that template I referred you to, you can type: !fig(NameOfFigure) and the compiler will turn it into <$n:figure:NameOfFigure>. If you are familiar with Regular Expressions, note they can be used here. You could create some very easy to type and look at replacements, such as: {NameOfChapter; NameOfFigure}. That’s all the specific information you need to construct the full chapter + figure placeholder syntax (along with some punctuation to help the regular expression find it). Since the rest of the placeholder syntax is identical from one to the next, there is no reason to type it in over and over (but like I say, you can if you want, no need to get complicated!).
You can read more about these codes in the Help/Placeholder Tags List… menu, on the Mac (for the time being these more advanced codes do not work in the Windows compiler).