Sage
Welcome to Sage
Volume (15%) Hide Volume
Topics
Font Formatting Tags

Overview

In addition to the Font Formatting Blocks, Sage also offers several Font Formatting Tags.

Bold

Use [b][end] for bold text:

The most [b]important[end] consideration is this...

The above produces this…


The most important consideration is this...


Italic

Use [i][end] for italic text:

The most [i]important[end] consideration is this...

The above produces this…


The most important consideration is this...


Underline

Use [u][end] for underlined text:

The most [u]important[end] consideration is this...

The above produces this…


The most important consideration is this...


Strikeout

Use [s][end] for strikeout text:

The most [s]important[end] trivial consideration is this...

The above produces this…


The most important trivial consideration is this...


Monospace

Use [m][end] for monospace text (in a shaded background):

Use the [m]Writeln[end] function to produce output...

The above produces this…


Use the Writeln function to produce output...


Teletype

Use [tt][end] for monspace (without the shaded background):

The most [tt]important[end] consideration is this...

The above produces this…


The most
important
consideration is this...


Keywords

Use [kw][end] to format as a keyword:

You should consider using a [kw]while[end] loop...

The above produces this…


You should consider using a while loop...


Keycaps

Use [kbd][end] for computer keycaps:

[kbd][&#8679] Shift[end]+[kbd]F7[end] and [kbd][&#8997] Alt[end]+[kbd]X[end] and [kbd]^ Ctrl[end]+[kbd]Q[end] [kbd][&crarr] Enter[end] and [kbd]Tab [&#8633][end] and [kbd][&#9003] Backspace[end] and [kbd][&#8682] Caps Lock[end]

The above produces this…


⇧ Shift+F7 and ⌥ Alt+X and ^ Ctrl+Q

↵ Enter and Tab ↹ and ⌫ Backspace and ⇪ Caps Lock


Use [kbd/ ...] for common keycaps with associated symbols:

Name Produces Short For
[kbd/ Alt] ⌥ Alt [kbd][&#8997] Alt[end]
[kbd/ Backspace] ⌫ Backspace [kbd][&#9003] Backspace[end]
[kbd/ CapsLock] ⇪ Caps Lock [kbd][&#8682] Caps Lock[end]
[kbd/ Cntrl] ^ Cntrl [kbd]^ Cntrl[end]
[kbd/ Command] ⌘ Command [kbd][&#8984] Command[end]
[kbd/ Control] ^ Control [kbd]^ Control[end]
[kbd/ Ctrl] ^ Ctrl [kbd]^ Ctrl[end]
[kbd/ Del] ⌦ Del [kbd][&#8998] Del[end]
[kbd/ Delete] ⌦ Delete [kbd][&#8998] 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][&#8679] Shift[end]
[kbd/ Tab] Tab ↹ [kbd][&#8633] Tab[end]
[kbd/ Up] [kbd][&uarr][end]
[kbd/ Windows] ⊞ Windows [kbd][&#8862] Windows[end]

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…

[kbd/ Shift] + [kbd/ Ctrl] + [kbd]F11[end]

You can do this…

[kbd/ Shift + Ctrl + F11]

Both of the above examples produce the same HTML…


⇧ Shift + ^ Ctrl + F11


The following characters serve as punctuation:
  • +
  • ,
  • _ (denotes a non-breaking space)
  • whitespace

These characters will appear outside keycaps, as shown in the preceding example. To work around this, simply quote these characters…

Press [kbd/ Alt+','] or [kbd/ Shift+Q, X].

The above produces…


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:

[kbd/ Shift + F11] [kbd/ Shift + F11]

Leading and trailing whitespace is ignored, however.

Highlight

Use [hl][end] to highlight text:

The most [hl]important[end] consideration is this...

The above produces this…


The most important consideration is this...


Tool-Tips

Use [abbr][end] to make a tool-tip explaining the meaning of a word or phrase:

[abbr "This is an example"]Example[end] (hover the mouse over the word)

The above produces this…


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…

[abbr]Example[note]This is another example[end] (hover the mouse over the word)

The above produces this…


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 [abbr]transcendental[note]not the root of a non-zero [\] polynomial of finite degree with rational coefficients, [\] such as [&pi] and e[end], [...]

The above produces this…


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.

Superscript & Subscript

Use [^][end] or [sup][end] for superscript:

X[^]e[end]

The above produces…


Xe


Use [v][end] or [sub][end] for subscript:

X[v]e[end]

The above produces…


Xe


Font Size

Use [+1][end], [+2][end], or [+3][end] to increase font size:

0 [+1]+1[end] [+2]+2[end] [+3]+3[end]

The above produces…


0
+1
+2
+3


Use [-1][end], [-2][end], or [-3][end] to decrease font size:

0 [-1]-1[end] [-2]-2[end] [-3]-3[end]

The above produces…


0
-1
-2
-3


Important

Do not use Font Size tags for section headings. Instead, use the [section] tag.


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.

Font Tags vs. Font Blocks

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:

    If not [i]im[end]moral, at least [i]a[end]moral.

    The above example produces:


    If not immoral, at least amoral.


  • Within a font formatting tag, the corresponding font formatting character is ignored. For example:

    The default password is: "[b]a* b* c*[end]"

    The above example produces:


    The default password is: "a* b* c*"


    Without using the [m] tag, the above example would require several instances of the pipe character:

    The default password is: "*a|* b|* c|**"

Guidelines

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.

See Also

Last Modified: 3/19 3:58:13 pm
In this article (top)  View article's Sage markup
3/19 3:58:13 pm