Text Lines 🔗

Text lines consist of exactly what they sound like: they are lines of the file that contain ordinary text. For example, consider:

The red, evil fox swam with the slightly less evil, silver dog.

▶ Run

This is a valid GT program that consists of only one line of text. When this program is run, it just displays the text to the user. That's it! Multiple lines of text are also allowed, such as:

This is the first line.
And here's the second.

The third line! This line's the best.

▶ Run

When this program is run, it too would simply display all this text to the user. The user would see a blank line between the second and third line, just as it appears above.

Bold, Italic and Underlined Text 🔗

formatting, formatted text, font, text weight, text style

The way the text looks can be modified. You can make the text bolded, underlined, or italicized by adding special symbols before and after the text you want to change.

Place two asterisks around text you'd like to *bold* . Place two backslashes around text you'd like to /italicize/ . And place two underscores around text you'd like to _underline_ .

You can place these symbols around whole phrases. Here are some examples:

This will let you _show some text_ in bold.
This will let you /show some text/ in italics.
This will let you _show some text_ that is underlined.

In the above examples, "show some text" would be bolded in the first sentence, italicized in the second sentence, and underlined in the third sentence. Note that when modifying text using these symbols, there must be a space preceding the first "_", "/" or "_" that you use, with a character immediately following this symbol, and there must be a space immediately after the last "_", "/" or "_", with a character immediately preceding this symbol. So here are some examples that would not work:

This *won't work*for bold with no space after the 2nd asterisk.
This*won't work* for bold with no space before the 1st asterisk.
This _ won't work_ for bold with a space after the 1st asterisk.
This _won't work _ for bold with a space before the 2nd asterisk.

You can change the way the text looks in more than one such way at a time, for example, you can bold and italicize, or you can italicize and underline. However, if you use more than one type of modification in the same section of text, the order of the symbols appearing in the beginning and end must mirror each other. Whichever of these symbols comes first on the left, must come last on the right, whichever comes second on the left, must come second to last on the right, etc.

This will let you _/*put some text*/_ in bold, italics, and underline.

In the example above, notice how the asterisks stay on the outside, the backslashes stay in the middle, and the underscores stay snug beside the text. The phrase "put some text" will now be bolded, italicized, and underlined.


Next: