Page 1 of 2

Codes for compiler

Posted: Sat Mar 17, 2012 10:38 pm
by stevecooperorg
I notice in my manuscript this code;

Code: Select all

<$wc100>


And wondered if there were any other useful codes available, and what they were? Couldn't find anything in the documentation.

Re: Codes for compiler

Posted: Mon Mar 19, 2012 6:32 pm
by Cosmicjive
These are known as "placeholder tags."

These are the tags that work in the Windows version of the application:

Statistics

<$wc>
Gets replaced during the Compile process with the total word count of the text currently being compiled.

<$wc50>
Gets replaced during the Compile process with the total word count of the text currently being compiled, rounded to the nearest 50 words.

<$wc100>
Gets replaced during the Compile process with the total word count of the text currently being compiled, rounded to the nearest 100 words.

<$wc500>
Gets replaced during the Compile process with the total word count of the text currently being compiled, rounded to the nearest 500 words.

<$wc1000>
Gets replaced during the Compile process with the total word count of the text currently being compiled, rounded to the nearest 1000 words.

<$cc>
Gets replaced during the Compile process with the total character count of the text currently being compiled.

<$cc50>
Gets replaced during the Compile process with the total character count of the text currently being compiled, rounded to the nearest 50 characters.

<$cc100>
Gets replaced during the Compile process with the total character count of the text currently being compiled, rounded to the nearest 100 characters.

<$cc500>
Gets replaced during the Compile process with the total character count of the text currently being compiled, rounded to the nearest 500 characters.

<$cc1000>
Gets replaced during the Compile process with the total character count of the text currently being compiled, rounded to the nearest 1000 characters.




Auto-Numbering

<$n>
Gets replaced with Arabic numerals during the Compile process. The number is incremented each time a <$n> tag is encountered in the text, so “<$n>, <$n>, <$n>” would become “1, 2, 3” in the compiled text.

<$sn>
The same as <$n> but intended to be used for sub-numbering. The count restarts each time an <$n> tag is encountered. Thus, “<$n> (<$sn>, <$sn>), <$n> (<$sn>, <$sn>)” would become “1 (1, 2), 2 (1, 2)” in the compiled text.

<$r>
Gets replaced with lowercase Roman numerals during the Compile process. The number is incremented each time a <$r> tag is encountered in the text, so “<$r>, <$r>, <$r>” would become “i, ii, iii” in the compiled text.

<$R>
Gets replaced with uppercase Roman numerals during the Compile process. The number is incremented each time a <$R> tag is encountered in the text, so “<$R>, <$R>, <$R>” would become “I, II, III” in the compiled text.

<$w>
Gets replaced with numbers as lowercase words (using the current language settings) during the Compile process. The number is incremented each time a <$w> tag is encountered in the text, so “<$w>, <$w>, <$w>” would become “one, two, three” in the compiled text.

<$t>
Gets replaced with numbers as title-case words (using the current language settings) during the Compile process. The number is incremented each time a <$t> tag is encountered in the text, so “<$t>, <$t>, <$t>” would become “One, Two, Three” in the compiled text.

<$W>
Gets replaced with numbers as uppercase words (using the current language settings) during the Compile process. The number is incremented each time a <$W> tag is encountered in the text, so “<$W>, <$W>, <$W>” would become “ONE, TWO, THREE” in the compiled text.

<$hn>
Gets replaced during the Compile process with hierarchical numbering based on the level of the document in which the tag occurs relative to the Draft folder or compile group (depending on the current compile settings). So occurrences of the <$hn> tag in the second document in the Draft folder may get replaced with the number “2”; occurrences of the tag in the third subdocument of the eight document in the Draft folder may be replaced with “8.3”.

Restarting auto-numbering streams:
<$rst>
Place <$rst> immediately before any of the auto-numbering tags to restart the numbering. So, for instance, “<$w>, <$w>, <$w>, <$rst><$w>, <$w>” would become “one, two, three, one, two” in the compiled text.

Page Numbers

<$p>
When used in the header or footer, gets replaced with the current page number.


-Jeff

Re: Codes for compiler

Posted: Mon Mar 19, 2012 6:59 pm
by StaceyUK
Cosmicjive wrote:These are known as "placeholder tags."

These are the tags that work in the Windows version of the application:

Statistics

<$wc>
Gets replaced during the Compile process with the total word count of the text currently being compiled.

<$wc50>
Gets replaced during the Compile process with the total word count of the text currently being compiled, rounded to the nearest 50 words.

<$wc100>
Gets replaced during the Compile process with the total word count of the text currently being compiled, rounded to the nearest 100 words.

<$wc500>
Gets replaced during the Compile process with the total word count of the text currently being compiled, rounded to the nearest 500 words.

<$wc1000>
Gets replaced during the Compile process with the total word count of the text currently being compiled, rounded to the nearest 1000 words.

<$cc>
Gets replaced during the Compile process with the total character count of the text currently being compiled.

<$cc50>
Gets replaced during the Compile process with the total character count of the text currently being compiled, rounded to the nearest 50 characters.

<$cc100>
Gets replaced during the Compile process with the total character count of the text currently being compiled, rounded to the nearest 100 characters.

<$cc500>
Gets replaced during the Compile process with the total character count of the text currently being compiled, rounded to the nearest 500 characters.

<$cc1000>
Gets replaced during the Compile process with the total character count of the text currently being compiled, rounded to the nearest 1000 characters.




Auto-Numbering

<$n>
Gets replaced with Arabic numerals during the Compile process. The number is incremented each time a <$n> tag is encountered in the text, so “<$n>, <$n>, <$n>” would become “1, 2, 3” in the compiled text.

<$sn>
The same as <$n> but intended to be used for sub-numbering. The count restarts each time an <$n> tag is encountered. Thus, “<$n> (<$sn>, <$sn>), <$n> (<$sn>, <$sn>)” would become “1 (1, 2), 2 (1, 2)” in the compiled text.

<$r>
Gets replaced with lowercase Roman numerals during the Compile process. The number is incremented each time a <$r> tag is encountered in the text, so “<$r>, <$r>, <$r>” would become “i, ii, iii” in the compiled text.

<$R>
Gets replaced with uppercase Roman numerals during the Compile process. The number is incremented each time a <$R> tag is encountered in the text, so “<$R>, <$R>, <$R>” would become “I, II, III” in the compiled text.

<$w>
Gets replaced with numbers as lowercase words (using the current language settings) during the Compile process. The number is incremented each time a <$w> tag is encountered in the text, so “<$w>, <$w>, <$w>” would become “one, two, three” in the compiled text.

<$t>
Gets replaced with numbers as title-case words (using the current language settings) during the Compile process. The number is incremented each time a <$t> tag is encountered in the text, so “<$t>, <$t>, <$t>” would become “One, Two, Three” in the compiled text.

<$W>
Gets replaced with numbers as uppercase words (using the current language settings) during the Compile process. The number is incremented each time a <$W> tag is encountered in the text, so “<$W>, <$W>, <$W>” would become “ONE, TWO, THREE” in the compiled text.

<$hn>
Gets replaced during the Compile process with hierarchical numbering based on the level of the document in which the tag occurs relative to the Draft folder or compile group (depending on the current compile settings). So occurrences of the <$hn> tag in the second document in the Draft folder may get replaced with the number “2”; occurrences of the tag in the third subdocument of the eight document in the Draft folder may be replaced with “8.3”.

Restarting auto-numbering streams:
<$rst>
Place <$rst> immediately before any of the auto-numbering tags to restart the numbering. So, for instance, “<$w>, <$w>, <$w>, <$rst><$w>, <$w>” would become “one, two, three, one, two” in the compiled text.

Page Numbers

<$p>
When used in the header or footer, gets replaced with the current page number.


-Jeff


Could we sticky post this answer please so it will be easier to locate for future reference? TIA.

Re: Codes for compiler

Posted: Fri Apr 27, 2012 11:12 am
by Simon Knight
Have a look under the Help menu.

Simon

Re: Codes for compiler

Posted: Fri Apr 27, 2012 4:54 pm
by Cosmicjive
Simon Knight wrote:Have a look under the Help menu.

Simon


These codes are not currently available under the help menu in the Windows version like they are in the Mac version, so the original poster's question was quite appropriate.

-Jeff

Re: Codes for compiler

Posted: Sat Apr 28, 2012 12:53 am
by AmberV
I've set this to sticky. In the meanwhile, listing codes should be easier to do in the user manual. We've been working on a way to escape them so that they don't turn into numbers and such when compiling. It's been kind of hard to write about them in Scrivener. :)

Re: Codes for compiler

Posted: Wed Aug 08, 2012 1:52 am
by jhuebert
I note that this list of placeholder tags supported in the Windows version is missing the custom auto-numbering tags needed for figure and table numbering: <$n:table:myTableName>, <$n:figure:myFigureName>, etc.

I love this software and am thinking of writing my thesis with Scrivener, but really want these tags to autonumber figures and tables. Is there any workaround to keep multiple auto-number streams going in a compilation?

Re: Codes for compiler

Posted: Sat Dec 15, 2012 11:41 pm
by fadedwave
I actually just had a question about this. My novel is divided into parts and chapters. There is a folder for each of the two parts and in each of those are folders for each of the chapters. Is there anyway to set up auto numbering so it correctly writes Part One and Part Two and separately have the chapters counting correctly? When I tried it went Part One, Chapter Two, Chapter Three, etc. I could try resetting the count, but then I'm not sure how to get the eventual Part Two to say Part Two and not Part One.

Hope this makes sense.

Again my structure looks like this

[ ] Part One
_____[Chapter One]
_____[Chapter Two]
...
_____[Chapter Nineteen]
[ ] Part Two
_____[Chapter Twenty]
...

Re: Codes for compiler

Posted: Sun Dec 16, 2012 9:56 am
by AmberV
At the moment there isn't a way of doing that. We'll have a way of making number streams in the future. For now you have to use different counter types. So you could do something like "Part One" and "Chapter 1".

Re: Codes for compiler

Posted: Mon Jun 24, 2013 1:19 pm
by adz1111
fadedwave,

I know you posted this a while back but (assuming you didn't resolve it) I have compile options set up for my novel almost as you require. Compile output is....

[new page]
Title Page

[new page]
Part I
Incarceration (Part 1's Title)

[new page]
CHAPTER ONE
text text (scenes spanning multiple pages)

[new page]
CHAPTER TWO
text text (scenes spanning multiple pages)

[new page]
CHAPTER THREE
text text (scenes spanning multiple pages)

[new page]
Part II
Liberation (Part 2's Title)

[new page]
CHAPTER FOUR
text text (scenes spanning multiple pages)

[new page]
CHAPTER FIVE
text text (scenes spanning multiple pages)

[new page]
CHAPTER SIX
text text (scenes spanning multiple pages)

etc etc

Binder Layout.JPG
Binder Layout.JPG (38.28 KiB) Viewed 33866 times

The binder layout in Scrivener to support that output above is in the first JPG above. Note, the Part's (yellow folder icons) title in the structure is printed out under the "PART I" automatically (as that is how I have set it up, you can omit that if you prefer no titles). However, the chapter's titles (whilst they have titles in the binder to help me see where I am) are not printed out - they are replaced with chapter 1, 2 etc . Chapters are the green folder icons; scenes are blue "text" icons btw and are collapsed in that picture. They also have titles (that do not print, but help me as a visual reference) and just flow one after the other with a "* * *" separator in the output.

Compile Layout.jpg
Compile Layout.jpg (21.86 KiB) Viewed 33866 times

The compile layout is in the second JPG above. Of course that doesn't show the specific settings for each line item in the compile layout. But assuming you have your stuff structured as I do in the binder it's those lines you need to tweak (for example if you do not want titles other than PART and Chapter).

If the above looks close enough for you to further tweak I have attached a blank "template" based on the above. If you extract it from the attached zip file and stick it in the templates directory, you can create a new project based on it.

Novel (with Parts) - Self numbering.zip
(146.85 KiB) Downloaded 970 times


:-)

Re: Codes for compiler

Posted: Sat Nov 23, 2013 8:47 pm
by SarsenLintel
Where can I find a list of the Placeholder tags / codes for the Mac?

I just had an idea for something I might want to do in the future and wanted to see whether it was already available on the Mac side. So I downloaded the Mac manual, went to Appendix C - Placeholder Tags. Only to be told to look at the entry on the Help menu for the complete list - which of course I can't, since I'm on Windows.

After a bit of searching it looks like <$n:[keyword]:[tag]> will probably accomplish what I want, but I'd still like to see the complete list if it's available anywhere?

Re: Codes for compiler

Posted: Wed Oct 08, 2014 3:23 pm
by @mpersand
Just as a matter of interest. These placeholder tags, are they something exclusive to Scrivener or do they come from some markup language (like HTML)?

Re: Codes for compiler

Posted: Wed Oct 08, 2014 4:06 pm
by adz1111
The codes are exclusive to Scrivener - they won't mean anything to anything else; only Scrivener looks for them.

Re: Codes for compiler

Posted: Fri Sep 04, 2015 7:23 am
by LauraEss
Probably non-sequitur but are there codes for figure and table numbers? If there are then I won't have to manually update them in the exegesis I'm writing.

Re: Codes for compiler

Posted: Fri Sep 04, 2015 8:18 am
by Briar Kit
LauraEss wrote:Probably non-sequitur but are there codes for figure and table numbers? If there are then I won't have to manually update them in the exegesis I'm writing.


This thread might help ...

viewtopic.php?f=18&t=31365&p=198020&hilit=Figure+numbering#p198008