Little Girl's Mostly Linux Blog

txt2tagsCheatSheet

txt2tags Cheat Sheet

This page was last updated on October 10, 2009.

Table of Contents



Introduction

  • Why this page? So you can find almost everything you could ever want to do with txt2tags on one cheat sheet!
  • This page was created by Little Girl, who has no connection with the authors of txt2tags other than loving the program. Since this page is so useful to the author, she figured it might be enjoyed by others as well, so it is shared here freely.
  • With txt2tags, you can write documents in plain text using a simple markup language that’s easily readable and doesn’t interfere with word counting or spell checking. When finished writing the document, you can use the txt2tags program to convert it into various types of documents, like a web page, for example. For more information, see the txt2tags home page.
  • See an example page and the txt2tags source document used to create it.
  • See an example of some of the markup.



Before you begin

A txt2tags document is made up of three basic sections – the Header Area, the Configuration Area and the Body Area. A visual representation of the sections is shown here:

Header Area

  • The first three lines of the document.
  • This section is required.
  • It usually contains the title, author’s name, date, and version number.

Configuration Area

  • A varying number of lines.
  • This section is optional.
  • It can be used for settings that determine how the converted document looks or behaves.

Body Area

  • A varying number of lines.
  • This section is optional.
  • It is for the main contents or body of your document.



HEADER AREA

This section is required and uses the first three lines of the file. These lines must either be filled in with appropriate information or left blank. See the Header Area section of the txt2tags User Guide.


First line

The first line is formatted as a level one title. It can contain the name you want at the top of the document. The first line of this document is an example.

Put this in the Header Area:

Title Of The Document


Second line

The second line is italic. It can contain an attribution and/or the e-mail address of the author, or one line of any text you like. The second line of this document is an example.

Put this in the Header Area:

by Author


Third line

The third line is plain text. It can contain a version number, a last updated line (with the date automatically generated for you), or one line of any text you like. The third line of this document is an example.

Put this in the Header Area:

Last Updated: %%mtime(%A %B %d, %Y)



CONFIGURATION AREA

This section is optional. See the Config Area section of the txt2tags User Guide. From the fourth line on, you can add configuration lines to define how txt2tags should handle the file. In this section you can specify various things like encoding, background color, whether or not to use a Table of Contents, the symbols used for line breaks, etc. You can also use regular expressions (including Python regular expressions) to create filter rules to be used before or after the file is processed by txt2tags. See DetailsforPreProcandPostProcFilters for an explanation of how these work. Below are some examples of configuration lines:


Background color (HTML only)

You can define the background color of the converted document in the Configuration Area. The example uses white as the background color. You can change this to any other color as a word or hex code. This will only work for documents which are being converted to HTML.

Put this in the Configuration Area:

%!postproc: <BODY.*?> <BODY bgcolor="white">


Encoding type

This specifies which type of encoding you’d like to use on the converted file. The example uses UTF-8.

Put this in theConfiguration Area:

%!encoding: utf-8


Options

This specifies the default command line options to be used when txt2tags converts this file. All txt2tags command line options are available. Type man txt2tags in a terminal window to view them. The example shows how to tell txt2tags that you’d like a Table of Contents.

Put this in the Configuration Area:

%!options: --toc


Pre-processed plain links

To keep your file neat, you can list links in the Configuration Area, giving each a name. By using the names in the file you can call those links at any time. In the final conversion of the document, txt2tags will replace the names you typed with the raw links. The example uses T2TURL as the name and http://txt2tags.sourceforge.net as the link.

Put this in the Configuration Area:

%!preproc: T2TURL http://txt2tags.sourceforge.net

Put this in the Body Area:

I can use T2TURL anywhere in this document and it will be replaced automatically with the link.

To create this:

I can use http://txt2tags.sourceforge.net anywhere in this document and it will be replaced automatically with the link.


Pre-processed named links

This is similar to the pre-processed plain links, but instead of inserting raw links into the document, it inserts clickable named links. The name can be more than one word, and is case-sensitive by default. This means that if you use the rule in this example, you must type “Wikipedia” into your document with an upper case W to get txt2tags to recognize it and convert it to a clickable link during the conversion.

Put this in the Configuration Area:

%!preproc: (Wikipedia) [\1 http://www.wikipedia.org/]

Put this in the Body Area:

I use Wikipedia.

To create this:

I use Wikipedia.

To create a pre-processed named link that isn’t case sensitive, you must use (?i) in front of the name in when creating the rule. This means that if you use the rule in this example, you can type “Wikipedia” in any case you like (including mixed case), and txt2tags will recognize it and convert it to a clickable link. Note that the link will appear in the converted document in the case(s) you typed it in.

Put this in the Configuration Area:

%!preproc: (?i)(Wikipedia) [\1 http://www.wikipedia.org/]

Put this in the Body Area:

I use wikipedia.

To create this:

I use wikipedia.

Or put this in the Body Area:

I use WiKiPeDiA.

To create this:

I use WiKiPeDiA.


Pre-processed replacement text

If you know you’ll be repeatedly typing anything lengthy or complex and would like to use an easy to remember “tag” instead, you can define these tags in the Configuration Area. Then you can just type the tags to call the stored text. The tags will be processed by txt2tags during the document conversion.

Put this in the Configuration Area:

%!preproc: "JFK" "John F. Kennedy"

Put this in the Body Area:

JFK was the 35th President of the United States.

To create this:

John F. Kennedy was the 35th President of the United States.


Target file type

This specifies the type of file you’d like to convert the txt2tags file into. All possible targets are html, xhtml, sgml, tex, lout, man, mgp, moin, pm6, and txt.

Put this in the Configuration Area:

%!target: html


Table Of Contents

This specifies that you’d like to use a Table Of Contents. Up to three levels of contents will be displayed by default.

Put this in the Configuration Area:

%!options: --toc

If you’d like to define a different number of nesting levels than the default, add the line in this example directly beneath the Table Of Contents line, replacing N with 1, 2, 4 or 5.

Put this in the Configuration Area:

%!options: --toc-level N



BODY AREA

This is where the contents of your document go. See the Body Area section of the txt2tags User Guide. Using the methods below, you can have a Table Of Contents, different sections, headings, plain text, tables, lists, graphics, inserted files, etc.


Centered line of text

To center a line of text, insert a space, a pipe, and another space before the line of text.

Put this in the Body Area:

 | This is a centered line of text.

To create this:

This is a centered line of text.


Centered paragraph (Method 1)

To center a pagagraph, use the same method as with the centered line of text, creating each line of the paragraph separately. Each line must have a space, a pipe and a space before it.

Put this in the Body Area:

 | This is a centered paragraph. Each line must be
 | coded independently or it will fill the entire
 | screen, in which case you may as well not have
 | bothered centering the text, and in fact, it's
 | a good idea not to use this method.

To create this:

This is a centered paragraph. Each line must be
coded independently or it will fill the entire
screen, in which case you may as well not have
bothered centering the text, and in fact, it’s
a good idea not to use this method.


Centered paragraph (Method 2)

Another method, which works more elegantly than the one above, is to create one continuous line of centered text interrupted by inserting forced, coded line breaks rather than the Enter key. To center the pagagraph, insert a space, a pipe, and another space before the text. This presents a visually more elegant result.

Put this in the Body Area:

 | This is a centered paragraph using@@ forced line breaks for a better@@ look.

To create this:

This is a centered paragraph using
forced line breaks for a better
look.


Colored Text (HTML only)

By placing this code into the Configuration Area of your document, you can insert HTML tags into your document by using curly braces instead of < and > to surround the tags. Use the HTML code normally – with the exception of the different brackets – in the body of your document. For font color, use the example code below, changing red to whatever color you’d like to use. Words and hex codes are accepted as colors.

Put this in the Configuration Area:

%!postproc(html): {(.*?)} <\1>

Put this in the Body Area:

{font color="red"}This is colored text{/font}

To create this:

This is colored text.


Comments

Begin a line with a percent symbol to create a comment only visible in the raw form of the file.

Put this in the Configuration or Body Area:

% This is a comment.


CSS

A CSS file is a plain text file that can be used with any number of HTML files to define how they will look. You can use basic HTML markup to write all the pages on your site, and then create one CSS file to customize the look of the elements on all the pages. If you want to change anything, you just need to edit one file rather than individually editing all the HTML files.

There are two methods for using CSS to create your websites in txt2tags: style and css-sugar. The style method is used for customizing pages as a whole. The css-sugar method divides pages into zones, allowing for quite extensive customization. Download txt2tagsCSS.zip to see how both methods are used.


Date

Place this code anywhere in the Body Area to make txt2tags automatically replace it with the current date.

Put this in the Body Area:

%%date(%m-%d-%Y)

To create this:

01-27-2009


HTML tags (HTML only)

By placing this code into the Configuration Area of your document, you can insert HTML tags into your document by using curly braces instead of < and > to surround the tags. A few sample tags are shown here.

Put this in the Configuration Area:

%!postproc(html): {(.*?)} <\1>

Put this in the Body Area:

{del}Strikethrough{/del}

{font color="red"}Red{/font}

{b}Bold{/b}

To create this:

Strikethrough

Red

Bold


Image

To include an image in a document, surround the image file name with square brackets ([ and ]). An image link on a line by itself will include an image automatically aligned to the left.

Put this in the Body Area:

[txt2tagsimage.png]

To create this:


Image centered no text

Put a space before and after an image file name surrounded with square brackets ([ and ]) to center the image on the page.

Put this in the Body Area:

 [txt2tagsimage.png] 

To create this:


Images connected together

You can connect together any number of images. You may need to place them in a table with or without borders to control their behavior unless you surround them with text. Spaces are respected during conversion if you’d like to separate them from one another.

Put this in the Body Area:

| [txt2tagsimage.png][txt2tagsimage.png][txt2tagsimage.png][txt2tagsimage.png][txt2tagsimage.png]

To create this:


Image alignment

Images can be aligned with text by being placed to the left, center, or right of text. Insert a space between the text and the image. The left-aligned image may need to be placed inside a table with or without borders to control its behavior. The center-aligned image seems to behave without needing to be inside a table. The right-aligned image may need to be placed inside a table with or without borders to control its behavior.

Put this in the Body Area:

| [txt2tagsimage.png] left aligned

To create this:

left aligned

Put this in the Body Area:

| center [txt2tagsimage.png] aligned

To create this:

center aligned

Put this in the Body Area:

| right aligned [txt2tagsimage.png]

To create this:

right aligned


Images interspersed with text

As long as images are surrounded by text, they will appear exactly where you insert them. A table isn’t necessary in this case. Insert a space between the text and the images.

Put this into the Body Area:

Images [txt2tagsimage.png] interspersed [txt2tagsimage.png] with [txt2tagsimage.png] text.

To create this:

Images interspersed with text.


Include HTML file

This includes an HTML file in the document. Surround the filename in two sets of single quotes. Background color of the HTML file is ignored, with the background color of your document being used instead. Text color, formatting and alignment are honored, as well as background and border color of tables. Note that if you change the HTML file, you will need to reconvert the txt2tags document so the changes will be included. For a quick in-depth presentation of various methods of including documents in a txt2tags file, see my txt2tags Includes page.

Put this into the Body Area:

%!include: ''txt2tagsincludehtmlfile.html''

To create this:

HTML Sample

This is a sample.

column one row one column two row one
column one row two column two row two


Include HTML file’s source code

This includes an HTML file’s source code exactly as you typed it, preserving the layout. Surround the filename in two sets of backticks. For a quick in-depth presentation of various methods of including documents in a txt2tags file, see my txt2tags Includes page.

Put this into the Body Area:

%!include: ``txt2tagsincludehtmlfile.html``

To create this:

<html>
<head>
</head>
<body>
<h1 align=center><font color=”red”>HTML Sample</font></h1>
<p align=”center”><font color=”blue”>This is a sample.</font></p>
<table border=”7″ bordercolor=”green” bgcolor=”yellow” align=”center”>
<tr>
<td>column one row one</td>
<td>column two row one</td>
</tr>
<tr>
<td>column one row two</td>
<td>column two row two</td>
</tr>
</table>
<br>
</body>
</html>


Include text file as raw block

This includes a text file raw, running all the text together. Surround the filename in two sets of double quotes. For a quick in-depth presentation of various methods of including documents in a txt2tags file, see my txt2tags Includes page.

Put this in the Body Area:

%!include: ""txt2tagsincludetextfile.txt""

To create this:

Text Sample This is a sample.


Include text file verbatim

This includes a text file exactly as you typed it, respecting text position and line breaks. Surround the filename in two sets of backticks. For a quick in-depth presentation of various methods of including documents in a txt2tags file, see my txt2tags Includes page.

Put this in the Body Area:

%!include: ``txt2tagsincludetextfile.txt``

To create this:

Text Sample

This is a sample.


Include txt2tags file

This includes a txt2tags file verbatim. Note that the header and any other configuration lines at the top of the included file will be ignored by the parent file, and the source file's configuration rules will be applied to the included file. txt2tags will automatically crawl through the included file and use its contents in addition to those of the parent file when creating the Table of Contents. This is useful for breaking up a large document into manageable pieces. For a quick in-depth presentation of various methods of including documents in a txt2tags file, see my txt2tags Includes page.

Put this in the Body Area:

%!include: txt2tagsincludet2tfile.t2t

To create this:

txt2tags Sample

This is a sample.


Line Break (HTML only)

Line breaks (forced blank lines) can be added by placing a pre-processing rule in the Configuration Area, defining the label to be used. Then use the label specified in the rule to call the line break in your text. In the example, @@ was used to represent <BR>, which is the HTML code for a line break.

Put this in the Configuration Area:

%!postproc(html): @@ <BR>

Put this in the Body Area:

This text
@@
@@
has two line breaks.

Or put this in the Body Area:

This text@@@@has two line breaks.

To create this:

This text

has two line breaks.


Line - Separator

Lines are used to divide up the page into different sections. All lines will fill the entire width of the page automatically. A separator line can be created by typing 20 or more dashes (-) in a row.

Put this in the Body Area:

--------------------

To create this:



Line - Strong separator

Lines are used to divide up the page into different sections. All lines will fill the entire width of the page automatically. A strong separator line can be created by typing 20 or more equal symbols (=) in a row.

Put this in the Body Area:

====================

To create this:



Link - Anchor

To create an anchor, place the text you'd like to use as an anchor in brackets ([ and ]) immediately to the right of the plain or numbered title you'd like to link to.

Put this in the Body Area:

=== This level 3 title has an anchor ===[anchors_away]

To create this:

This level 3 title has an anchor

To use an anchor, insert a link made of a bracket ([) plus the text you'd like to use for the link plus a space plus a hash mark (#) plus the anchor text plus a closing bracket (]).

Put this in the Body Area:

Use [the anchor #anchors_away] you created.

To create this:

Use the anchor you created.


Link - Email

To create an email link, just type the address and it will be formatted as a clickable link for you in the converted file.

Put this in the Body Area:

name@domain.com

To create this:

name@domain.com


Link - Image

To create a clickable image link, insert an image filename in square brackets, a space, and a URL inside of square brackets.

Put this in the Body Area:

[[txt2tagsimage.png] http://txt2tags.sourceforge.net/]

To create this:


Link - Named

This includes a named (labeled) clickable link in your document. To create a named link, type the link text, a space, and the URL inside of square brackets.

Put this in the Body Area:

[This is a link http://txt2tags.sourceforge.net/]

To create this:

This is a link


Link - Plain

Just type a URL and it will be formatted correctly for you in the converted file.

Put this in the Body Area:

http://txt2tags.sourceforge.net/

To create this:

http://txt2tags.sourceforge.net/


List - Definition

A definition list is created by using a colon (:) and a space before each word you wish to define, and putting the definition on the next line. Close the list with two empty lines beneath it, which show up as one blank line in the converted document.

Put this in the Body Area:

: word one
definition of word one
: word two
definition of word two
: word three
definition of word three

To create this:


word one

definition of word one
word two

definition of word two
word three

definition of word three


List - Numbered

A numbered list is created by using a plus symbol (+) and a space before each item. To make a nested item, indent the + one or more spaces. You can have as many nested levels as you like. You can reverse nest only if you've nested to begin with. Insert a blank line after each item on the list if you like. Close the list with one empty item (a + and a space) beneath the list, which shows up as one blank line in the converted document.

Put this in the Body Area:

+ item one
+ item two
+ item three
 + sub-item one
 + sub-item two
 + sub-item three
+ item four
+ item five
+ item six
+

To create this:

  1. item one
  2. item two
  3. item three

    1. sub-item one
    2. sub-item two
    3. sub-item three

  4. item four
  5. item five
  6. item six


List - Plain

A plain list is created by using a dash (-) and a space before each item. To make a nested item, indent the dash one or more spaces. You can have as many nested levels as you like. You can reverse nest only if you've nested to begin with. Insert a blank line after each item on the list if you like. Close the list with two blank lines beneath the list, which show up as one blank line in the converted document.

Put this in the Body Area:

- item one
- item two
- item three
 - subitem one
 - subitem two
 - subitem three
 -
- item four
- item five
- item six

To create this:

  • item one
  • item two
  • item three
    • subitem one
    • subitem two
    • subitem three
  • item four
  • item five
  • item six


List - Mixed

A mixed list is a combination of a plain list and a numbered list. Follow the same rules when creating this list, with the exception of how to close the list. If your last item is a plain list item, close the list with two blank lines beneath the list, which show up as one blank line in the converted document (this is shown in the first example below). If your last item is a numbered list item, close the list with one empty item (a + and a space) beneath the list, which shows up as one blank line in the converted document (this is shown in the second example below).

Put this in the Body Area:

- item one
- item two
 + item one
 + item two
 + item three
  + subitem one
  + subitem two
  + subitem three
- item three
 - subitem one
 - subitem two
 - subitem three
- item four
- item five
- item six

To create this:

  • item one
  • item two

    1. item one
    2. item two
    3. item three

      1. subitem one
      2. subitem two
      3. subitem three

  • item three
    • subitem one
    • subitem two
    • subitem three
  • item four
  • item five
  • item six

Put this in the Body Area:

+ item one
+ item two
 - item one
 - item two
 - item three
  - subitem one
  - subitem two
  - subitem three
+ item three
 + subitem one
 + subitem two
 + subitem three
+ item four
+ item five
+ item six
+

To create this:

  1. item one
  2. item two
    • item one
    • item two
    • item three
      • subitem one
      • subitem two
      • subitem three
  3. item three

    1. subitem one
    2. subitem two
    3. subitem three

  4. item four
  5. item five
  6. item six


Marks (formatted text)

Text can be formatted in various ways: ordinary, monospaced, bold, italic, or underlined text. The various formats can also be combined for more than one effect at a time.

Plain text:

Put this in the Body Area:

This is plain text.

To create this:

This is plain text.

Monospaced text:

Put this in the Body Area:

``This is monospaced text.``

To create this:

This is monospaced text.

Bold text:

Put this in the Body Area:

**This is bold text.**

To create this:

This is bold text.

Italic text:

Put this in the Body Area:

//This is italic text.//

To create this:

This is italic text.

Underlined text:

Put this in the Body Area:

__This is underlined text.__

To create this:

This is underlined text.

Bold italic underlined text:

Put this in the Body Area:

**//__This is bold italic underlined text.__//**

To create this:

This is bold italic underlined text.

Bold italic underlined monospaced text:

Put this in the Body Area:

**//__``This is bold italic underlined monospaced text.``__//**

To create this:

This is bold italic underlined monospaced text.


Nested Quotes

You can add a nested quote by pressing the Tab key at the beginning of a line of text (or a word). Nesting is done by indenting more than once with multiple presses of the Tab key. The number of nested levels is unlimited. You can nest, reverse nest or randomly mix nesting levels.

Put this in the Body Area:

	quote
		quote
			quote
		quote
	quote

To create this:

	quote
		quote
			quote
		quote
	quote


Non-breaking space (HTML only)

This creates a non-breaking (fixed) space which can be used to control the placement of text, images or tables in a document. Place the processing rule in the Configuration area, defining what you'd like to use to call the non-breaking space in your document. The example below uses (nbs). Note that the \ is used to make txt2tags ignore the parentheses when processing the rule. Then insert the text in parentheses into your document wherever you'd like to use a non-breaking space.

Put this in the Configuration Area:

%!postproc(html): \(nbs\) &nbsp;

Put this in the Body Area:

space -->(nbs)<-- space

3 spaces -->(nbs)(nbs)(nbs)<-- 3 spaces

To create this:

space --> <-- space

3 spaces -->   <-- 3 spaces


Raw area

To insert a raw area of text into your document, place three sets of quotes (") on a line by themselves, type or paste the text you'd like to use on the next line, and place three sets of quotes on the next line.

Put this into the Body Area:

"""
This is a raw area. Marks, spacing and wrapping are not interpreted.
"""

To create this:

This is a raw area. Marks, spacing and wrapping are not interpreted.



Raw line

To insert a raw line into your document, place three sets of quotes (") followed by a space at the beginning of a line of text.

Put this into the Body Area:

""" This is a raw line. Marks are not interpreted.

To create this:

This is a raw line. Marks are not interpreted.


Raw text

To insert raw text into your document, place two sets of quotes (") immediately before and immediately after a line of text. Raw text can be included inside sentences or used independently.

Put this into the Body Area:

""This is raw text. Marks are not interpreted.""

To create this:

This is raw text. Marks are not interpreted.


Symbols - Copyright ©, Registered ®, and Trademark ™ (HTML only)

You can copy and paste the ©, ® and ™ symbols into your text, but you may need to specify the encoding to make sure the symbols appear properly in the finished document (UTF-8 encoding will cover you for any symbols you might need to display). Alternatively, you can let txt2tags create the symbols for you during the document conversion by adding a processing rule in the Configuration Area and then typing the bracketed letter that represents the symbol into the body of your text.

Put this into the Configuration Area:

%!postproc(html): \(C\) &copy;

Put this into the Body Area:

(C)

To create this:

©

Put this into the Configuration Area:

%!postproc(html): \(R\) &reg;

Put this into the Body Area:

(R)

To create this:

®

Put this into the Configuration Area:

%!postproc(html): \(TM\) ™

Put this into the Body Area:

(TM)

To create this:


Table - border

This is a plain table. The header row can be aligned left, right or center. Marks and colored text are interpreted in this table. To center the table on the page, add a space before the first pipe on each line.

Put this into the Body Area:

| This is a table | It has two columns |
| Here's another row | Also with two columns |
| Here's another row | Also with two columns |
| Here's another row | Also with two columns |

To create this:

This is a table It has two columns
Here's another row Also with two columns
Here's another row Also with two columns
Here's another row Also with two columns


Table - border - header row bold

This is a table with a bold header row, created by using two pipes at the beginning of the first line. With this method, the header row can only be aligned to the center of each column. If you wish to align the header row to the right or left, use marks to make the text bold instead. Marks and colored text are interpreted in this table. To center the table on the page, add a space before the first pipe on each line.

Put this into the Body Area:

|| This is a table | It has two columns |
| Here's another row | Also with two columns |
| Here's another row | Also with two columns |
| Here's another row | Also with two columns |

To create this:



This is a table It has two columns
Here's another row Also with two columns
Here's another row Also with two columns
Here's another row Also with two columns


Table - no border

This is a table with no border. The header row can be aligned to the left, right or center. Marks and colored text are interpreted in this table. To center the table on the page, add a space before the first pipe on each line.

Put this into the Body Area:

| This is a table | It has two columns
| Here's another row | Also with two columns
| Here's another row | Also with two columns
| Here's another row | Also with two columns

To create this:

This is a table It has two columns
Here's another row Also with two columns
Here's another row Also with two columns
Here's another row Also with two columns


Table - no border - header row bold

This is a table with no border and a bold header row. The header row can only be aligned to the center of each column. Marks and colored text are interpreted in this table. To center the table on the page, add a space before the first pipe on each line.

Put this into the Body Area:

|| This is a table | It has two columns
| Here's another row | Also with two columns
| Here's another row | Also with two columns
| Here's another row | Also with two columns

To create this:



This is a table It has two columns
Here's another row Also with two columns
Here's another row Also with two columns
Here's another row Also with two columns


Table alignment left, right and center

Width of cells is determined by content. Placement of the content within the cells determines its alignment. You can also use non-breaking spaces to align contents in cells (HTML only).

Put this into the Body Area:

|                  -----> |                  -----> |
| <-----                  | <-----                  |
|          -----          |          -----          |
| xxxxxxxxxxxxxxxxxxxxxxx | xxxxxxxxxxxxxxxxxxxxxxx |

To create this:

-----> ----->
<----- <-----
----- -----
xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx


Table alignment mixed structure horizontal (HTML only)

Tables can contain a mixed structure, determined by where the content is located in relation to the pipes. Width of cells is determined by content. Placement of the content within the cells determines its alignment. The use of an additional pipe on the right side of the table will force the contents to span the columns. The first example uses non-breaking spaces (HTML only) in the empty cells to ensure that those cells will have a border.

Put this into the Body Area:

| XXXXXXX | XXXXXXX |
| (nbs)   | XXXXXXX |
| XXXXXXX | XXXXXXX |
| XXXXXXX | (nbs)   |
| XXXXXXX | XXXXXXX |
|      XXXXXXX      ||
| XXXXXXX | XXXXXXX |

To create this:

XXXXXXX XXXXXXX
  XXXXXXX
XXXXXXX XXXXXXX
XXXXXXX  
XXXXXXX XXXXXXX
XXXXXXX
XXXXXXX XXXXXXX

Put this into the Body Area:

| XXXXXXX | XXXXXXX
|         | XXXXXXX
| XXXXXXX | XXXXXXX
| XXXXXXX |
| XXXXXXX | XXXXXXX
|      XXXXXXX      ||
| XXXXXXX | XXXXXXX

To create this:

XXXXXXX XXXXXXX
XXXXXXX
XXXXXXX XXXXXXX
XXXXXXX
XXXXXXX XXXXXXX
XXXXXXX
XXXXXXX XXXXXXX


Table alignment mixed structure vertical (HTML only)

Table cells can contain a mixed structure, determined by where the content is located in relation to the cell. Height of cells is determined by content. Placement of the content within the cells determines its alignment. The use of an span, paragraph, or div tags on the contents of a cell will force the contents to the top, bottom or center of the cell. Creative placement of cell contents can also be achieved by using line breaks (HTML only). The examples below use the span tag.

Put this in the Configuration Area:

%!postproc(html): {(.*?)} <\1>

Put this in the Body Area:

| XXXXXXX{br}XXXXXXX{br}XXXXXXX | XXXXXXX |
| XXXXXXX{br}XXXXXXX{br}XXXXXXX{br}XXXXXXX | XXXXXXX |
| XXXXXXX{br}XXXXXXX{br}XXXXXXX | {span style="position:relative; bottom:19px;"}XXXXXXX{/span} |
| XXXXXXX{br}XXXXXXX{br}XXXXXXX | {span style="position:relative; top:19px;"}XXXXXXX{/span} |

To create this:

XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX

Put this in the Body Area:

| XXXXXXX{br}XXXXXXX{br}XXXXXXX | XXXXXXX
| XXXXXXX{br}XXXXXXX{br}XXXXXXX{br}XXXXXXX | XXXXXXX
| XXXXXXX{br}XXXXXXX{br}XXXXXXX | {span style="position:relative; bottom:19px;"}XXXXXXX{/span}
| XXXXXXX{br}XXXXXXX{br}XXXXXXX | {span style="position:relative; top:19px;"}XXXXXXX{/span}

To create this:

XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX
XXXXXXX


Table Of Contents - Specify location

The Table Of Contents will be located at the top of the Body Area by default. If you'd like to specify a different location for it, place this code on a line by itself in the location you'd like the Table Of Contents to show up, adding a blank line before and after it if you get an error when converting the document.

Put this into the Body Area:

%%toc


Title - Plain

Plain titles are used to name the different sections of your document. To create the various levels of titles, use one, two, or three equal symbols (=) and a space on either side of the title text.

Put this into the Body Area:

= Level one title =

To create this:

Level one title

Put this into the Body Area:

== Level two title ==

To create this:

Level two title

Put this into the Body Area:

=== Level three title ===

To create this:

Level three title


Title - Numbered

Numbered titles are used to name the different sections of your document. The numbering will be done for you automatically depending on the level of title you choose. To create the various levels of titles, use one, two, or three plus symbols (+) and a space on either side of the title text.

Put this into the Body Area:

+ Level one numbered title +

To create this:

1. Level one numbered title

Put this into the Body Area:

++ Level two numbered title ++

To create this:

1.1. Level two numbered title

Put this into the Body Area:

+++ Level three numbered title +++

To create this:

1.1.1. Level three numbered title


Verbatim area

You can create a verbatim area by typing three backticks (`) on a line. Then enter the verbatim text, manually performing the formatting with spacing and the Enter key. Finish by adding another line of three backticks.

Put this into the Body Area:

```
     This is an example of a verbatim
  area. **Marks** are not interpreted
             but spacing is respected
 ```

To create this:

     This is an example of a verbatim
  area. **Marks** are not interpreted
             but spacing is respected


Verbatim line

You can create a verbatim area by typing three backticks (`) and a space before a line of text.

Put this into the Body Area:

``` This is verbatim text. **Marks** and wrapping are not interpreted.

To create this:

This is verbatim text. **Marks** and wrapping are not interpreted.



Obligatory Happy Ending

And they all lived happily ever after. The end.

Back to top

Creative Commons License Except where otherwise noted, content on http://mostlylinux.wordpress.com is Copyright © 2007 - 2009 by Little Girl, licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License, and offered free of charge without warranty of any kind, either expressed or implied.

5 Comments »

  1. Thank you for this good – example based! – overview: I’m using it regularly for searching some tags2html feature.

    Comment by hartrock — July 4, 2009 @ 9:20 pm

    • Sorry: of course it has to be ‘.. some ***txt2tags*** feature ..’ ;-)

      Comment by hartrock — July 4, 2009 @ 9:26 pm

    • You’re welcome – I’m glad you like it!

      Comment by mostlylinux — July 5, 2009 @ 12:48 pm

  2. Hello,

    I have a doubt: how can you create a table alignment mixed in VERTICAL structure? Is it possible in t2t format?!
    At t2t web site you show the creation of a table alignment mixed in horizontal structure

    Best regars,

    Marcos

    Comment by Marcos Rodrigo — October 9, 2009 @ 1:48 pm

    • If I understand your question, then hopefully the new Table alignment mixed structure vertical (HTML only) section above covers it. I also renamed the Table alignment mixed structure section to Table alignment mixed structure horizontal (HTML only) since that’s more accurate. Let me know if you had something entirely different in mind, and I’ll see what I can work up. (:

      Comment by mostlylinux — October 10, 2009 @ 7:18 am


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.