3. Some details

3.1. Concepts

An input text consists of constructs. A construct is (in general) separated from other constructs by blank lines. Some constructs are one-line only, and after a one-line construct, the trailing blank line may be ommitted. In the previous chapter, we saw the constructs paragraph, table and list. A list of the constructs is in the table below:

Construct
Recognized by
Ends with
Usage
author
.author
End of line
Defines the author of the document
block
.block <type>
.block
Defines different type of blocks
cover
.cover
End of line
Defines an image for the cover page
csvfile
%,;csvfile <file> [sep]
End of line
Include the CSV-file as a simple table
heading
.h<level>
End of line
Defines a Chapter, section etc. title
headerlink
.headerlink
End of line
Defines a link for external scripts
header
.header
End of line
Includes a header-file if deemed appropriate
hr
.hr
End of line
Draws a horizontal line
image
.img
End of line
Includes an image
list
tab(s) with -,@ or #
blank line
Lists
lst
.lst
blank line
Listings
map
.map
blank line
Clickable map in HTML, an image in PS
note
.note
End of line
Defines a footnote
page
.page
End of line
Ejects a page
paragraph
other text
Blank line
Paragraphs of text
set
.set
End of line
Sets a variable
subtitle
.subtitle
End of line
Sets the document's subtitle
table
Tab
Blank line
Tables
title
.title
End of line
Sets the title for the document
toc
.toc
End of line
Some sort of intermediate title
video
.video
End of line
In HTML, include a video here, in PS, take an image from a video

Within constructs, requests can be made. For example, within a paragraph, some text may be requested as bold. These are format requests. Some are not really used for formatting, but they are called that anyway. You may notice that, for example .image is both a construct and a format request. If it is a format request, the image is presented as in-line with the text, whereas if it is used as a construct, the image is placed on it's own.

Most format requests are terminated by the end of line (except for example the .block request)

Format request
Request
Used for
note
.note
footnotes
blank
.blank
blank line
break
.br
line break
space
.space
spacing
underline
.u
underlined text
italic
.inospace
italic text without space before or after
italic
.i
italic text
bold
.b
bold text
center
.center
centered text
fixed
.fixed
fixed font
fixed
.fixednospace
fixed font without space before or after
font
.font
use a specific font
lst
.lst
listings
subscript
.sub
subscripts
superscript
.sup
superscripts
video
.video
include a video
image
.img
include an image
block
.block
include a block
link
.link
include a link
set
.set
set a variable
equation
.eqn
create an in-line equation
side note
.side
create a side note
left note
text<tab>
create a left note
stop indent
.back
stop indenting for left notes
indent after
====>
Indent so the line appears to follow the line above

3.2. Specific fonts

It is possible to use a specific font for parts of the text. If you want to change the font for all the text, use stylesheets.

The request for a text in a specific font is:

 .font [font name][size] text

For example:

 .font PinyonScript18 PinyonScript.

produces PinyonScript. Note that the fontname may be ommitted or the size, but not both. Of course, the fonts need to be available in the output processors.

If the fontname is ommitted, the current font is used, so .font 16 would produce a larger text. If the size is ommitted, the font is used in the same size as the current, so .font courierbolditalic bold and italic would produce bold and italic text.

The available fonts are stored in /usr/local/share/in3/fontmap and the first column is the one used in in3. A list can be generated with cut -d "tab" -f1 /usr/local/share/in3/fontmap

3.3. Characters

In3 tries its best to produce the right characters. That is not always straight forward, because the output handlers (groff or web browser) may have different ideas about what character is which.

To help in the translation, /usr/local/chare/in3/in3charmap1 contains a translation for web and groff. The file also contains a number of "percent-translations", for example: %%;8X; produces ✄. A percent translation always starts with a %%; and always ends with a ;. A special is the %%;%%;; which translates to %%;. So %%;%%;;8X produces %%;8X; A list of characters is available in the appendix.

It is possible to add your own translation in meta.in with an .in3charmap request. The syntax is:

 .in3charmap "in3-character","groff-character","html-character"

All the three characters must be present, even if they are empty. None of the characters may have a "," in them. The example below allows a quoted tab-character "tab" to be displayed:

 .in3charmap "%%;qtab;",""\s-6tab\s+6"",""<span style="font-size:0.4em">tab</span>""

The extra translations are read from meta.in for all processing, even for complete.in which may not be obvious directly.

3.4. Left notes and side notes

Left notes are short scribbles in the left margin. They are, for example, used when typesetting theater plays:

Comte: Enfin, vous l'emportez et la faveur du Roi
Vous élève en un rang qui n’était dû qu'a moi:
Il vous fait gouverneur du prince de Castille
Diege: Cette marque d'honneur qu'il met dans ma famille
Montre à tous qu'il est juste, et fait connaître assez
Qu'il sait récompenser les services passés.

A .back request, a table, a list or a heading at any level stops the hanging indenting.

Side notes may be more elaborate. They are placed in a column on the right side of the paragraph. Normally, when a side note appears somewhere in the text, the column on the right is reserved in the whole document.

Whether the column is reserved is detemined by the variable notes.

Value
Left note
Side note
0
no
no
1
yes
no
2
no
yes
3
yes
yes

This means, that it is possible to supress the side note column by setting notes to 0. It is advised to do so at a natural moment (just before a header, a list or a table), because doing it in the middle of a paragraph will produce surprising results, like wrong line length or dropped text.

Left and side notes are collected per paragraph and put in coluns to the right and left. Numbering of the side notes is restarted at the beginning of each paragraph.

Where a left note is a simple scriple in the left margin, a side note can have an actual referral. The formatting of the sidenote is determined by the following variables:

Variable
Initial value
Meaning
notes
0
Whether or not there are notes
sidechar
*
Character (or string) to be used for referral in the paragraph
sidenumber
0
Number of the last note that was used for referral
sideref
(empty)
Referral used in the side note column
sidesep
;
Character to separate side notes

The variables sidechar and sideref can have a referral to the value of sidenumber.

Referral
Meaning
%num
superscript numbering
%NUM
normal number
%alpha
lowercase letter
%ALPHA
uppercase letter

3.5. Indent after

A special formatting request is the indent after =========> It is there for very specific cases: plays in rhyme.


 
 Comte:  Ne le méritait pas! Moi?
 
 Diegue: ========================>Vous!
 
 Comte:  ==============================>Ton impudence
 .side irrespect
 
 Téméraire
 .side imprudent
 vieillard, aura sa récompense
 .side ici: punition
Comte: Ne le méritait pas! Moi?
Diegue: Ne le méritait pas! Moi? Vous!
Comte: Ne le méritait pas! Moi? Vous! Ton impudence¹ 1:irrespect;
Téméraire¹ vieillard, aura sa récompense² 1:imprudent; 2:ici: punition;

3.6. Tables

We've already touched upon the tables. We've seen:

In addition, a cell may contain <format=x> to set the alignment. X can be:

X
Meaning
center
Center the cell content
left
Left justify the content
right
Right justify the content

We also saw, that requests are possible in table cells. However, some requests require a new line (think of blocks). A combination of %n% replaces a newline in a cell. This allows us to create a table with:

    normal%n%.b bold%n%normal   norm%n%.u under%n%norm
    normal text%n%.b bold       and%n%.i italic%n%text

which gives:

normal bold normal
norm under norm
normal text bold
and italic text

Tables tend to expand to the complete width of the page. In3 will try to guess which column should be expanded. However, sometimes that is not a good idea. The variable tableexpand can be set to no to prevent table expansion, or to yes to enable it. As an example: the previous example table with .set tableexpand no gives:

normal bold normal
norm under norm
normal text bold
and italic text

The effect is mainly for the PS and PDF output. In html, no specific change will be visible.

For more flexibility, the variable colwidth can be set to a comma-separated list of column widths. The numbers are a percentage of the line length to the right side of the page, so overwriting the right margin. An x in a field will expand the table via this field, an empty field will allow the output processor to make a guess what the width could be. This is for PDFs. It also works well for simple tables, but if you use row- or columnspan, it quickly becomes very complex.

3.7. Pipe tables

There is another way, perhaps more intiutive to enter a table. You can draw a table with | and - symbols. There are a number of limitations; for example: you cannot use a | in the table text. Also, <format=xxx> is not supported. But, on the otherhand, it is much easier to include formatting commands.

|---------------------|
|  head               |
|---------------------|
| col 1  | col 2 +  3 |
|--------|------------|
|        | col  | col |
| col 1  | .b 2 |.u 3 |
|        |------|-----|
|        |  a   |  b  |
|---------------------|
| .block eqn          |
| r sup 2 over n sup 2|
| .block              |
|---------------------|
head
col 1
col 2 + 3
col 1
col 2
col 3
a
b
block/3_Details.in.9.svg

Some rules:

3.8. csvfile

Another option to make a simple table is to include a separate csv file. The request would be:

 .csvfile file.csv [ separator ]

where separator is the field separator, which can be a comma, a colon or a semi-colon. Fields may be quoted with single or double quotes. No colspan or rowspan is supported. As an example, including a file test.csv with the contents:

a;b;c
d;e;f

would give:

a
b
c
d
e
f

3.9. Chapter, sections et cetera

Text is normally divided into chapters, sections et cetera. In3 uses the request . .h1 Chapter title for chapter titles, .h2 Section title for section titles and so on until .h9. If you think you need more levels, than you should rethink your approach to the subject. Or maybe In3 is just not for you.

Unnumbered headings can also be used using .hu followed by a number. The following sequence is an example with .h3, .hu3, .h3. Note how the numbering continues, eventhough the number is not printed.

3.9.1. H3 heading with number

Unnumbered heading at level 3

3.9.3. H3 heading with number