Cross referencing images and tables

Hi all, I noticed that when I use humanistic essay template (the english name could be different), the small tutorial tells me that if I use !image(nameimage) and #image(nameimage) I can write down the number of the image named “nameimage” and recall that number. The same for tables. And with that templates it works perfectly but when I try with other template I cannot. I’m becoming crazy trying to find the option to enable that funcion on another template, or to create a sostitution for the keywork “image” and “table” with prograssive numbers.

Can someone help me please?

To see where those are coming from, open up the Compile window for the Humanities template, and double-click on the “Undergraduate Essay” format in the left sidebar to edit it.

In the Replacements format pane, you’ll find all four of these codes—what you type in on the left, and what they are expanded to on the right (the “$@” token is used to store the key name you type in and insert it into the replacement wherever that token appears).

So this isn’t something the template itself does, it’s something the compile format does. The format in this case comes bundled with the template—while you are looking at the Replacements pane, you could alter the Save To setting above to “My Formats”, which would make this “Undergraduate Essay” format available to every project on your system.

However you might not want to actually use the entire format (fonts, footnote settings and so on). If you all you want are these replacements, I’d open the other project’s format designer and then simply drag and drop (or copy and paste) the replacements from this list to the other.

I was looking substitutions into compile but not into undergraduate essay, thank you very much for the assistance. I’m trying to build my own template for scientific papers, finding some troubles with citation, I use zotero but the only way need to export into RTF and I cannot manage to insert images in a file that I know will be exported in RTF

Yes, having these Replacements in the format means you can apply the format to any project that uses these replacements and they will work. You would otherwise have to set up each project to handle them (or always start from a template). With this, you can even start from Blank and get the behaviour for free.

Thank you, may I ask you to what the syntax <$n:figure:$@> and <$n#figure:$@> belong to? Its not markdown cause it works even if I don’t compile with markdown, is it a function of scrivener only?

Yes, that’s a Scrivener function. You can look up all of our placeholder codes and how to use them from the Help menu, in “List All Placeholders…”. The one caveat is what I mentioned above, regarding the “$@” code. That only works in Replacements, and makes it so that if you type in !image(ImageName), the replacement becomes <$n:figure:ImageName>. That alone you can type in yourself into the text editor if you want—the Replacement is there to make the syntax a little easier to remember and edit around.

Briefly, the code constructs a named counter stream:

A simple numerical counter: 1, 2, 3…
An arbitrary name for this number stream. You can thus have a counter for “figure”, “table”, “chapter”, etc.—as many as you want.
An arbitrary identifier for this one counter. It is what makes it so you can later on refer to this assigned number in cross-references.

Thus, <$r:part:SeventhPart> might render to “vii”, as $r generates Roman numerals in lower case.