Advanced Formatting#
Standard Markdown formatting is somewhat limited, so novelWriter has some additional formatting codes for special use cases. These codes are all based on brackets, and some allow an additional value to be set after a colon.
This section covers all these formatting codes.
Formatting with Shortcodes#
For basic formatting, like emphasis, you should use the standard Markdown style formatting tags descried in Text Emphasis with Markdown whenever possible.
For additional formatting options, you can use shortcodes. Shortcodes is a form of in-line codes that wrap the section of text to be formatted. Shortcodes can be nested to apply multiple formats to the same piece of text.
These shortcodes are intended for special formatting cases, or more complex cases that cannot be solved with simple Markdown-like formatting codes. Available shortcodes are listed below.
Syntax |
Description |
---|---|
|
Text is displayed as bold text. |
|
Text is displayed as italicised text. |
|
Text is displayed as strike through text. |
|
Text is displayed as underlined text. |
|
Text is displayed as highlighted text. |
|
Text is displayed as superscript text. |
|
Text is displayed as subscript text. |
|
A reference to a footnote comment. |
Unlike Markdown style codes, these can be used anywhere within a paragraph. Even in the middle of a word if you need to. You can also freely combine them to form more complex formatting.
The shortcodes are available from the Format menu and in the editor toolbar, which can be activated by clicking the left-most icon button in the editor header.
Note
Shortcodes are not processed until you generate a preview or generate a manuscript document. So there is no highlighting of the text between the formatting markers. There is also no check that your markers make sense. You must ensure that you have both the opening and closing formatting markers where you want them.
New in version 2.2.
Vertical Space and Page Breaks#
You can apply page breaks to partition, chapter and scene headings for novel documents from the Manuscript Build tool. If you need to add a page break or additional vertical spacing in other places, there are special codes available for this purpose.
Adding more than one line break between paragraphs will not increase the space between those
paragraphs when generating a manuscript document. To add additional space between paragraphs, add
the text [vspace]
on a line of its own, and the Manuscript Build tool will insert a blank
paragraph in its place.
If you need multiple blank paragraphs just add a colon and a number to the above code. For
instance, writing [vspace:3]
will insert three blank paragraphs.
If you need to add a page break somewhere, put the text [new page]
on a line by itself before
the text you wish to start on a new page.
Note
The page break code is applied to the text that follows it. It adds a “page break before” mark
to the text when exporting to HTML or Open Document. This means that a [new page]
code which
has no text following it will not result in a page break.
Example
This is a text paragraph.
[vspace:2]
This is another text paragraph, but there will be two empty paragraphs
between them.
[new page]
This text will start on a new page if the build format supports pages.
Inserting Word Counts in the Text#
The cover page of a manuscript normally has the word count stated on it. Any statistics value collected by novelWriter can be inserted into any document using a special shortcode. You can insert the code for any of the available statistics values from the Insert menu under Word/Character Count.
The value inserted is the actual count for your entire manuscript, so it is not populated until you run the Manuscript Build tool. Until then they will show up as “0” in the viewer panel.
The available codes are:
Code |
Description |
---|---|
|
Characters |
|
Characters in Text |
|
Characters in Headings |
|
Paragraphs |
|
Headings |
|
Characters, No Spaces |
|
Characters in Text, No Spaces |
|
Characters in Headings, No Spaces |
|
Words |
|
Words in Text |
|
Words in Headings |
Example
This is an example cover page. A similar page is automatically generated when you create a new project.
Jane Smith[br]
42 Main Street[br]
1234 Capital City <<
[vspace:5]
#! Example
>> **By Jane Smith** <<
>> Word Count: [field:textWords] <<