Formatting Properties
Use a wide variety of formatting properties to program the look of the content
in your document. Together with the revision mechanism, you can create
named styles and combine them with your data to create beautiful, accurate
documents.
View on YouTube
Revisions
Revisions are used to alter the typesetting of any Span or Paragraph.
FormatPar
=
Span
{
TextFamily
:
TextFamilies
.
TimesNewRoman
;
"The following text is: "
;
}
;
ShowRevision
=
Block
{
FormatPar
{
Span
{
TextHeight
:
120%;
"Large"
}};
FormatPar
{
Span
{
Bold
;
"Bold"
}};
FormatPar
{
Span
{
Italic
;
"Italic"
}};
FormatPar
{
Span
{
TextHeight
:
120%;
Bold
;
Italic
;
"Large, Bold, Italic"
}};
};
The following text is:
Large
The following text is:
Bold
The following text is:
Italic
The following text is:
Large, Bold, Italic
Text Color
If you want to change color of the text in a Span, use the
TextColor
property.
ShowTextColor
=
Paragraph
{
"The following item is "
;
Span
{
TextColor
:
Colors
.
Red
;
"important"
;
};
" to note. "
;
};
The following item is
important
to note.
Text Background
The background color of text can be set with the
TextBackground
property.
ShowTextBackground
=
Paragraph
{
"The following item is "
;
Span
{
TextBackground
:
Colors
.
Yellow
;
"marked"
;
};
" with a highlighter. "
;
};
The following item is
marked
with a highlighter.
Italic Text
Make the font italic by setting the
TextItalic
property to true.
ShowItalic
=
Paragraph
{
"Make "
;
Span
{
TextItalic
:
true
;
"sure"
;
};
" to read the instructions. "
;
};
Make
sure
to read the instructions.
Italic shortcut
Apply the special Italic revision directly to a string for a more concise expression.
ShowItalic2
=
Paragraph
{
"Make "
;
Italic
"sure"
;
" to read the instructions. "
;
};
Make
sure
to read the instructions.
Bold Text
Make the font bold by setting the
TextWeight
property to Bold.
ShowBold
=
Paragraph
{
"Use "
;
Span
{
TextWeight
:
Bold
;
"extreme"
;
};
" caution. "
;
};
Use
extreme
caution.
Bold shortcut
Apply the special Bold revision directly to a string for a more concise expression.
ShowBold2
=
Paragraph
{
"Use "
;
Bold
"extreme"
;
" caution. "
;
};
Use
extreme
caution.
Font Face
Use the
TextFace
property to change the font face to one of the built-in styles.
ShowFace
=
Block
{
"Normal Text"
;
Span
{
TextFace
:
TextFaces
.
Mono
;
"Monospaced Text"
;
};
};
Normal Text
Monospaced Text
Font Family
Use the
TextFamily
property to change the font family to a specific installed family.
ShowFamily
=
Paragraph
{
TextFamily
:
TextFamilies
.
LibertinusSerif
;
"Classic font for journal articles"
;
};
Classic font for journal articles
Underlining Text
Use the
TextUnderline
property to underline text in a variety of styles.
ShowUnderline
=
Paragraph
{
Separator
:
Space
*
3;
foreach
(
var
u
in
TextUnderlines
) {
Span
{
TextUnderline
:
u
;
u
.
Name
;
};
}
};
None
Single
Words
Dotted
Dashed
DotDash
DotDotDash
Thick
Double
Wave
WavyDouble
Striking-out Text
Use the
TextStrike
property to strike-out sections of text.
StrikeText
=
Paragraph
{
Separator
:
Space
*
3;
foreach
(
var
s
in
TextStrikes
) {
Span
{
TextStrike
:
s
;
s
.
Name
;
};
}
};
None
Single
Double
Text Casing
You can control the mixture of uppercase and lowercase letters with the
TextCase
property.
ShowTextCase
=
Table
(
null
,
PadLR
(3), [
Column
.
Fit
(50%)]) {
foreach
(
var
tc
in
TextCases
) {
Row
{
tc
.
Name
;
Span
{
TextCase
:
tc
;
"hello Hello HELLO!"
;
};
};
}
};
None
hello Hello HELLO!
AllUpper
HELLO HELLO HELLO!
AllLower
hello hello hello!
WordUpper
Hello Hello Hello!
FirstUpper
Hello Hello HELLO!
FirstLower
hello Hello HELLO!
SmallCaps
hello Hello HELLO!
Letter Spacing
Change how much space is allocated between letters with the
TextLetterSpace
property.
ShowTextLetterSpace
=
Block
{
foreach
(
var
space
in
1
..
5) {
Paragraph
(
null
, [5%]) {
space
;
Tab
;
Span
{
TextLetterSpace
:
space
;
"The quick brown fox"
;
};
Span
{
TextColor
:
Colors
.
Green
;
" jumped over the lazy dog."
};
};
}
};
1
The quick brown fox
jumped over the lazy dog.
2
The quick brown fox
jumped over the lazy dog.
3
The quick brown fox
jumped over the lazy dog.
4
The quick brown fox
jumped over the lazy dog.
5
The quick brown fox
jumped over the lazy dog.
Letter Stretching
Text can be compressed or stretched with the
TextStretch
property.
ShowLetterScale
=
Block
{
foreach
(
var
stretch
in
[50%, 75%, 100%, 150%, 200%]) {
Paragraph
(
null
, [8%]) {
stretch
;
Tab
;
Span
{
TextStretch
:
stretch
;
"Stretch"
;
};
Span
{
TextColor
:
Colors
.
Green
;
" -> goal."
};
}
}
};
50%
Stretch
-> goal.
75%
Stretch
-> goal.
100%
Stretch
-> goal.
150%
Stretch
-> goal.
200%
Stretch
-> goal.
Separators
Insert content between elements with the
Separator
property.
ShowSeparator
=
Paragraph
{
Separator
:
", "
;
1
..
5
step
1;
};
1, 2, 3, 4, 5
Last Separator
Change the final separator in the revision with the
LastSeparator
property.
ShowLastSeparator
=
Paragraph
{
Separator
:
", "
;
LastSeparator
:
" and "
;
1
..
5
step
1;
};
1, 2, 3, 4 and 5
Pair Separator
To handle lists that have exactly two items, use the
PairSeparator
property.
OxfordList
=
Span
{
Separator
:
", "
;
LastSeparator
:
", and "
;
// Oxford comma
PairSeparator
:
" and "
;
};
ShowLists
=
Block
{
OxfordList
{1};
OxfordList
{1; 2};
OxfordList
{1; 2; 3};
};
1
1 and 2
1, 2, and 3