Font Formatting Tags
In addition to the Font Formatting Blocks,
Sage also offers several Font Formatting Tags.
Use [b]…[end]
for bold text:
The most important consideration is this...
Sage
The most [b]important[end] consideration is this...
copied to clipboard
The above produces this…
The most important consideration is this...
Use [i]…[end]
for italic text:
The most important consideration is this...
Sage
The most [i]important[end] consideration is this...
copied to clipboard
The above produces this…
The most important consideration is this...
Use [u]…[end]
for underlined text:
The most important consideration is this...
Sage
The most [u]important[end] consideration is this...
copied to clipboard
The above produces this…
The most important consideration is this...
Use [s]…[end]
for strikeout text:
The mostimportant trivial consideration is this...
Sage
The most [s]important[end] trivial consideration is this...
copied to clipboard
The above produces this…
The most
Use [m]…[end]
for monospace text (in a shaded background):
Use the Writeln function to produce output...
Sage
Use the [m]Writeln[end] function to produce output...
copied to clipboard
The above produces this…
Use the Writeln function to produce output...
Use [tt]…[end]
for monspace (without the shaded background):
The most
Sage
The most [tt]important[end] consideration is this...
copied to clipboard
The above produces this…
The most
important
consideration is this...
Use [kw]…[end]
to format as a keyword:
You should consider using a while loop...
Sage
You should consider using a [kw]while[end] loop...
copied to clipboard
The above produces this…
You should consider using a while loop...
Use [kbd]…[end]
for computer keycaps:
⇧ Shift+F7 and ⌥ Alt+X and ^ Ctrl+Q ↵ Enter and Tab ↹ and ⌫ Backspace and ⇪ Caps Lock
Use [kbd/ ...] for common keycaps with associated
symbols:
Sage's Help Insight, ^ Ctrl+Space,
offers suggestions from the above table.
You can also use [kbd/ ...] for longer key sequences.
For example, instead of…
⇧ Shift + ^ Ctrl + F11
The following characters serve as punctuation:
Press ⌥ Alt+, or ⇧ Shift+Q, X.
Along similar lines, you need to quote
square brackets, single-quotes, and double-quotes.
Unlike other tags, [kbd/] honors all spaces.
For example, in a [pre] block,
these two are visibly different:
Sage
[kbd][⇧] Shift[end]+[kbd]F7[end]
and [kbd][⌥] Alt[end]+[kbd]X[end]
and [kbd]^ Ctrl[end]+[kbd]Q[end]
[kbd][&crarr] Enter[end]
and [kbd]Tab [↹][end]
and [kbd][⌫] Backspace[end]
and [kbd][⇪] Caps Lock[end]
copied to clipboard
The above produces this…
⇧ Shift+F7 and ⌥ Alt+X and ^ Ctrl+Q ↵ Enter and Tab ↹ and ⌫ Backspace and ⇪ Caps Lock
Name | Produces | Short For |
---|---|---|
[kbd/ Alt] | ⌥ Alt | [kbd][⌥] Alt[end] |
[kbd/ Backspace] | ⌫ Backspace | [kbd][⌫] Backspace[end] |
[kbd/ CapsLock] | ⇪ Caps Lock | [kbd][⇪] Caps Lock[end] |
[kbd/ Cntrl] | ^ Cntrl | [kbd]^ Cntrl[end] |
[kbd/ Command] | ⌘ Command | [kbd][⌘] Command[end] |
[kbd/ Control] | ^ Control | [kbd]^ Control[end] |
[kbd/ Ctrl] | ^ Ctrl | [kbd]^ Ctrl[end] |
[kbd/ Del] | ⌦ Del | [kbd][⌦] Del[end] |
[kbd/ Delete] | ⌦ Delete | [kbd][⌦] Delete[end] |
[kbd/ Down] | ↓ | [kbd][&darr][end] |
[kbd/ Enter] | ↵ Enter | [kbd][&crarr] Enter[end] |
[kbd/ Left] | ← | [kbd][&larr][end] |
[kbd/ Return] | ↵ Return | [kbd][&crarr] Return[end] |
[kbd/ Right] | → | [kbd][&rarr][end] |
[kbd/ Shift] | ⇧ Shift | [kbd][⇧] Shift[end] |
[kbd/ Tab] | Tab ↹ | [kbd][↹] Tab[end] |
[kbd/ Up] | ↑ | [kbd][&uarr][end] |
[kbd/ Windows] | ⊞ Windows | [kbd][⊞] Windows[end] |
Sage
[kbd/ Shift] + [kbd/ Ctrl] + [kbd]F11[end]
copied to clipboard
You can do this…
Sage
[kbd/ Shift + Ctrl + F11]
copied to clipboard
Both of the above examples produce the same HTML…
⇧ Shift + ^ Ctrl + F11
- +
- ,
- _ (denotes a non-breaking space)
- whitespace
Sage
Press [kbd/ Alt+','] or [kbd/ Shift+Q, X].
copied to clipboard
The above produces…
Press ⌥ Alt+, or ⇧ Shift+Q, X.
Sage
[kbd/ Shift + F11]
[kbd/ Shift + F11]
copied to clipboard
Leading and trailing whitespace is ignored, however.
Use [hl]…[end]
to highlight text:
The most important consideration is this...
Sage
The most [hl]important[end] consideration is this...
copied to clipboard
The above produces this…
The most important consideration is this...
Use [abbr]…[end]
to make a tool-tip explaining the meaning of a word or phrase:
Example (hover the mouse over the word)
If you find it awkward to place the fly-over hint first,
followed by the actual visible text,
use this alternative notation…
Example (hover the mouse over the word)
Although the text after [note]
cannot contain formatting (bold, italics, links, etc),
it may contain character entities,
for example…
To prove that a number is transcendental, …
Above, we're using [&pi] in the fly-over hint,
which isn't possible using the earlier syntax.
Also, note the use of [\] tags –
without these, we would have the following…
To prove that a number is transcendental, …
This oddness stems from the fact that, in HTML,
the fly-over hint for an abbr tag is placed in an
HTML attribute, where line breaks are significant.
Sage
[abbr "This is an example"]Example[end]
(hover the mouse over the word)
copied to clipboard
The above produces this…
Example (hover the mouse over the word)
Sage
[abbr]Example[note]This is another example[end]
(hover the mouse over the word)
copied to clipboard
The above produces this…
Example (hover the mouse over the word)
Sage
To prove that a number is
[abbr]transcendental[note]not the root of a non-zero [\]
polynomial of finite degree with rational coefficients, [\]
such as [&pi] and e[end], [...]
copied to clipboard
The above produces this…
To prove that a number is transcendental, …
To prove that a number is transcendental, …
Use [^]…[end]
or [sup]…[end]
for superscript:
Xe
Use [v]…[end]
or [sub]…[end]
for subscript:
Xe
Sage
X[^]e[end]
copied to clipboard
The above produces…
Xe
Sage
X[v]e[end]
copied to clipboard
The above produces…
Xe
Use [+1]…[end],
[+2]…[end],
or [+3]…[end]
to increase font size:
0
Use [-1]…[end],
[-2]…[end],
or [-3]…[end]
to decrease font size:
0
Note that Font Size tags are additive:
a [+2] tag is equivalent to
a [+1] tag that is nested in
another [+1] tag.
Similarly,
a [-1] tag is equivalent to
a [+2] tag that is nested in
a [-3] tag.
Sage
0 [+1]+1[end] [+2]+2[end] [+3]+3[end]
copied to clipboard
The above produces…
0
+1
+2
+3
Sage
0 [-1]-1[end] [-2]-2[end] [-3]-3[end]
copied to clipboard
The above produces…
0
-1
-2
-3
There are two advantages to using these formatting tags,
compared to formatting blocks:
- You can start and/or end formatting in the middle of a word,
as in:
Sage If not [i]im[end]moral, at least [i]a[end]moral. copied to clipboardThe above example produces:
If not immoral, at least amoral. - Within a font formatting tag, the corresponding font
formatting character is ignored. For example:
Sage The default password is: "[b]a* b* c*[end]" copied to clipboardThe above example produces:Without using the [m] tag, the above example would require several instances of the pipe character:
The default password is: "a* b* c*"Sage The default password is: "*a|* b|* c|**" copied to clipboard
In general (for the [b], [i], [u],
and [m] tags), you should use
Font Formatting Blocks instead,
except where one of the above two issues comes into play.
⏱ Last Modified: 1/6 11:08:10 am