2. Normal usage

2.1. Basics

In3 is a processor that compiles texts with requests in something displayable, Postscript, HTML or PDF. The first thing to realize is, that the text will not be formatted exactly. For HTML output, the exact format may depend on browser settings, additional stylesheets et cetera. Sure, CSS adepts may ensure that the web page looks exactly as you intended, making it unreadable on mobile phones or a nuisance when resizing the browser window.

For In3, you should expect the same for PDF and PS output. If you really want to create something exactly like you want it, use DTP software. Also, for the PS and PDF variant, there are some fine-tuning possibilities with a stylesheet, but that will be discussed later.

In3 allows requests on a line starting with a ".". For example: .b example will produce example. The request .b means: print this text in bold. Other requests are available for headers, notes, images et cetera. Tables and lists are produced with other starting characters, @, # and - for lists, a tab for tables.

2.2. A first run

As a first run, and probably to test the installation too, create a directory with sub-directories in3xml, roff, block and web. If you run configyour then this is enough. If you run In3 by hand, you should put a link to block in web

ln -s $(realpath block) web/block

Next, create a file first_example.in with the following content:

Lorem! Ipsum! What a geat words! 

If you have configyour on your system, run it now. Otherwise, do

	in3multipass first_text.in > in3xml/first_text.xml
	xml3roff in3xml/first_text.xml > roff/first_text.roff
	cat roff/first_text.roff |preconv> roff/first_text.tbl
	cat roff/first_text.tbl |tbl > roff/first_text.pic
	cat roff/first_text.pic |pic > roff/first_text.eqn
	cat roff/first_text.eqn |eqn > roff/first_text.rof
	cat roff/first_text.rof |groff -min -Kutf8  > roff/first_text.ps
	cat roff/first_text.ps  | ps2pdf - - > roff/first_text.pdf
	xml3html in3xml/first_text.xml > web/first_text.html

If you now view the file roff/first_text.pdf in your PDF viewer, you will get

first_test.xcf

Congratulations! you have now created your first PDF with In3.

2.3. Basic features

2.3.1. Paragraphs

In the input text, a paragraph is a block of text that is delimited by blank lines. Any text that is not specifically marked will be regarded as a paragraph. Also, any requests within a paragraph will be treated as part of that paragraph.

For example:


 This is a paragraph.
 .b With a request
 in it. 

will produce:

This is a paragraph. With a request in it.

2.3.2. Headers

In3 uses headers for chapter, section et cetera. The requests are .h<level> <title> For example, This text contains:

 .h1 Getting started
 .h2 Basics
 .h2 A first run
 .h2 Basic features
 .h3 Paragraphs
 .h3 Headers

Headers are automatically collected for a table of contents at the end.

2.3.3. Emphasis

We already saw that it is possible to embolden text with the .b request. The character formatting can be done with:

Request
Meaning
Example
.b
bold
Bold text
.i
italic
Italic text
.u
underline
underlined text
.fixed
fixed font
Fixed font

2.3.4. Some other requests

The request .break forces a line-break, even
if at that point it is not necessary. A .page forces a page break. The request .hr creates a horizontal line, like this:


2.4. Lists

Lists are a separate construct from a paragraph. List cannot be part of a paragraph. They must be separated from other constructs with a blank line before and after the list.

A list starts with a type-character, for example a - and a space or tab. An example would be

- first item
- second item

which produces:

There are 3 types of lists, and corresponding type-characters:

type
type char
Example
dashlist
-
- example
alpha list
@
a. example
numeric lists
#
1. example

Lists can be nested, using different types:

- dash first
- dash second
	@ alpha first
	@ aplha second
- dash third
	# num first
	# num second

produces:

Note that the indent before the second level is a tab.

Within a list, it is also possible to use the formating requests:

 - an item
 - a
 .b bold item
 - an
 .i italic
 item

gives:

2.5. Tables

The basic table is a set of lines that start with a tab and contains a tab-separated list of cells. Like a list, they must be separated with blank lines from other consructs.

	row 1, column1	row 1, column 2	row 1, column 3
	row 2, column1	row 2, column 2	row 2, column 3

The columns are separated by tabs. It produces:

row 1, column1
row 1, column 2
row 1, column 3
row 2, column1
row 2, column 2
row 2, column 3

Like in the lists, formatting requests may appear:

	.b Column 1	.i Column 2	.u Column 3
	row 1, column1	row 1, column 2	row 1, column 3
	row 2, column1	row 2, column 2	row 2, column 3

gives:

Column 1
Column 2
Column 3
row 1, column1
row 1, column 2
row 1, column 3
row 2, column1
row 2, column 2
row 2, column 3

It is also possible to make row- and colspans:

		<cs=3>Columns
	Rows	.b Column 1	.i Column 2	.u Column 3
	<rs=2>1 and 2	row 1, column1	row 1, column 2	row 1, column 3
	row 2, column1	row 2, column 2	row 2, column 3

gives:

Columns
Rows
Column 1
Column 2
Column 3
1 and 2
row 1, column1
row 1, column 2
row 1, column 3
row 2, column1
row 2, column 2
row 2, column 3

2.6. Variables

In3 uses different variables. A variable is set with

 .set variable value

and variables may be retrieved with

 .dumpvar variable

There are many predefined variables, which may also be altered. For example: the variable H2 contains the section number. You can use this in your text as .dumpvar H2 which will tell you 6 for this text.