Overview
Text Codes are special formatting instructions that produce output that would be tedious or error-prone to create manually.
Using Text Codes, you can add links in the middle of a sentence, including links to another part of the book or to a person entry. You can also add citations and footnotes without worrying about links, sequential numbering, or other details.
You may use Text Codes in:
- The Text property of the Text User Item.
- The Text property of the Heading User Item.
- The text of the Literal Text Person Entry Item.
- The text of files added via the Include User Item.
- The notes associated with place records in genealogy programs that support place records.
For example, if you want to link to a person entry from text you add to a Content Chapter, add a Person code in a Text User Item in that chapter.
Anchor Code
ANCHOR is not supported in place notes.
You may use the [ANCHOR:anchor-name]
code to create an anchor with the given anchor-name at the location in the text where the code appears.
The Anchor Code is the text equivalent of the Anchor User Item.
Example
To create an Anchor with the name "john-smith-immigration", you could add the following text to a Text User Item:
[ANCHOR:john-smith-immigration].
For more information, see the Anchors help page.
Anchor Link Code
ALINK is not supported in place notes.
You may use the [ALINK:anchor-name:text]
code to create a link to the location indicated by the anchor-name, which must be the Anchor Name of an Anchor in the book. This code will be replaced by an HTML link where clicking the text navigates to the location of the Anchor.
The Anchor Link Code is the text equivalent of the Anchor Link User Item.
Example
To create a link to the Anchor with the name "john-smith-immigration", you could add the following text to a Text User Item:
Read the full details of his ordeal in the [ALINK:john-smith-immigration:Immigration of John Smith].
For more information, see the Anchors help page.
Cite Code
You may use the [CITE:sourceNumber:text]
code to create a citation to a source. The sourceNumber must be the ID number of a source. A sequential citation number will be assigned to the text, and that number will appear in place of the [CITE:sourceNumber:text]
code. The text will appear in the next list of citations and footnotes.
The sourceNumber parameter must contain only the digits 0 through 9. Any other characters, including spaces, will produce unexpected results. You may reference a source even if it has not been referenced by genealogy records elsewhere in the book.
If you omit the text parameter, the citation will be formatted without the citation detail.
Example
To create a citation to source number 27 and with the detail text "p. 182", add the following text to a Text User Item:
[CITE:27:p. 182]
Footnote Code
You may use the [FOOTNOTE:text]
code to create a footnote. A sequential footnote number will be assigned to the text, and that number will appear in place of the [FOOTNOTE:text]
code. The text will appear in a list of citations and footnotes.
Example
To create a footnote "According to local legend", add the following text to a Text User Item:
[FOOTNOTE:According to local legend]
Footnote and Cite
The Footnote and Cite codes are aliases. When using the Cite code, if you omit the source number, it treats it as a Footnote code. So, [CITE:text]
and [FOOTNOTE:text]
will produce the same footnote output. Also, if you add a source number parameter to a Footnote code, it will produce a citation to that source, so [FOOTNOTE:27:p. 182]
will produce the same output as [CITE:27:p. 182]
.
The citation list inserted via the use of the Footnote and Cite codes will use the same heading as the Person Entry Citation List item. That string is specified in the Person Entry Strings section under the Edit Strings... command.
Person Code
You may use the [PERSON:personId]
code to create a link to the person indicated by the personId, which must be the ID number of a person in the book. This code will be replaced by an HTML link where clicking the person's name opens the associated person entry.
Example
To create a link to a person entry for person #1, you could add the following text to a Text User Item:
[PERSON:1] had many descendants.
Variations
Person Code with Link Text
You may use the [PERSON:personId:linkText]
code to create a link to the person. When you include the linkText parameter, that text will be used in the link rather than the person's name.
Example
To create a link to a person entry for person #1 using the text "His father", you could add the following text to a Text User Item:
[PERSON:1:His father] had many siblings.
Person Code with No PersonId
You may use the [PERSON]
code to return the name of the current person. This may be useful when adding Literal Text Items to the Person Entry. In most other contexts where Text Codes are supported, there is no "current person" and [PERSON]
is not useful.
You must omit all other parameters.
PersonID Code
You may use the [PERSONID]
code to return the ID number of the current person. This may be useful when adding Literal Text Items to the Person Entry. In most other contexts where Text Codes are supported, there is no "current person" and [PERSONID]
is not useful.
Person Image Code
You may use the [PERSON-IMAGE:id]
code to embed the primary image exhibit for the person indicated by the ID number.
The person must have a person entry in the book and must have a primary image exhibit that is eligible to appear in the book. This code will be replaced by HTML to embed the image and its caption. The image will be linked to the person entry.
The Person Image Code supports several optional parameters to customize the embedded image. The full format is:
[PERSON-IMAGE:id:width:height:alignment:class:lightBox:caption]
where
- id
- is a required parameter, the ID number of the person. Must be digits only, 0 to 9, no commas or other alphabetic characters or punctuation.
- width
- is an optional parameter, the maximum width of the image in pixels. Must be digits only, 0 to 9, no commas or other alphabetic characters or punctuation, and no unit indications such as "px". The defaults is 200 if not supplied.
- height
- is an optional parameter, the maximum height of the image in pixels. Must be digits only, 0 to 9, no commas or other alphabetic characters or punctuation, and no unit indications such as "px". The defaults is 250 if not supplied.
- alignment
- The alignment parameter is ignored in Gedcom Publisher. The parameter is supported in other tools that use the same implementation.
- class
- is an optional parameter, the name of a CSS class that will be added to the image's container if it is present. Defaults to no class value if not supplied. If you supply a class name, you should also create a User Style with the same name to modify the style of the embedded image.
- lightBox
- is an optional parameter, a single character that indicates whether to enable or disable LightBox functionality. The characters 'T' (true), 'Y' (yes), or 'L' (lightbox) enable the LightBox. Any other character disables the LightBox, with the recommended value being 'N' (no). The default is 'Y' (yes) if not supplied.
Lightbox functionality is not available in Gedcom Publisher and the lightbox parameter is ignored. The parameter is supported in other tools that use the same implementation.
- caption
- is an optional parameter, a single character that indicates whether to include or omit the exhibit's caption. The characters 'T' (true), 'Y' (yes), or 'C' (caption) insert the caption. Any other character omits the caption, with the recommended value being 'N' (no). The default is 'Y' (yes) if not supplied.
Image Resizing
The width and height parameters are maximums. Gedcom Publisher will adjust the image size to maintain the aspect ratio of the original image without exceeding either of the given values.
For example, if the original image is 200 by 300, and you specify 200 by 250 in the PERSON-IMAGE code, the resulting image will be 166 by 250.
Example
To insert the primary image of person #1, you could add the following text to a Text User Item:
[PERSON-IMAGE:1]
To insert the primary image of person #1 but limit the maximum size to 100 by 125:
[PERSON-IMAGE:1:100:125]
Variable Code
You may use the [VARIABLE:name]
code to insert the text from a Variable User Item. If you want to insert some text into certain pages of the book, you add a Variable User Item to hold the text and then insert the text anywhere Text Codes are allowed using the Variable code.
For example, if you have a Variable User Item named "Board Members", you can insert its text using [VARIABLE:Board Members]
.