5. Stylesheets

In3 supports stylesheets per output-type. It is also possible to put some information in meta.in.

5.1. Meta.in

The goal of meta.in is to provide meta-information about the text. It is not meant to generate output. In a meta.in you generally provide information like:
title
The title of the complete document
subtitle
The subtitle of the complete document
author
The author
cover
The image that should be on the cover. Using an image that is 1200x1600 gives the best results.
set cp2, cp3 ...
set conditional new page to keep headers with their text.

As an example, https://dullaart.website/oevres_literaires_francaises/total.pdf uses the following meta.in:
 .cover cover.jpg
 .title Sélection d'oevres littéraires
 .subtitle Condensées et annotées à l'usage de l'enseignement secondaire
 .author L. Dullaart
 .keywords French litterature, abstracts, literature français, enseignement, uittreksel Frans
 .set cp2 15
 .set cp3 12

5.2. HTML style sheet

If a stylesheet.css exists in the current directory, it is called in the HTML code. You can create styles for all the normal HTML elements. Example:

 

table.normal {
   border: 1px solid #ddd;
}

 

In addition, in3html creates div-containers for specific text-elements:

 

class/style
text element
example
alinea
standard alinea
·alinea { background-color: #DDDD00; }
alinea
alinea with a specific font
·alineacourier { font-family: "Courier New", Courier; }
fixed
font for fixed character-width
·fixed { font-family:courier, "courier new", monospace; }
cel
cell in a normal table
·cel { background-color: #DD00DD; }
left
left notes
·left { font-size: 80%; }
list
format for all lists
·list { background-color: #00DDDD; }
side
side notes (right hand side)
·side { font-size: 50%; background-color: #DD0000; }
table·note
the layout of notes; mostly used to align notes
table·note td { vertical-allign: top; }
toc
Table of contents
·toc { color: #000000; background-color: #DDDDDD; width: 100%; }
td.leftcol
column of the left-notes
td.leftcol { width: 15%; }
td.alineacol
column of the alinea
td.alineacol{ width: 15%; }
td.side
column of the side-notes
td.sidecol { width: 15%; }

For class blocks, a specific class is created, with the name of the block. These can be used in the css sheet, for example:
 div.classtest {
    color: #BB0000;
 }

with a block definition of
 .block classtest
 this is in the block
 .block

will produce:

this is in the block

5.3. Groff style sheet

For Groff, a modified set of mm macros, called in, is used.

Example:

 

 .ds Licon "Table of Contents"
 .nr Ej 1
 .ds HF  HB HB HI HI I I I
 .ds HP  16 12 12  0 0 0 0
 .nr Hb 4
 .nr Hs 1
 .nr Hps 0
 .ds pg*header ''- \\nP -''

 

The stylesheet for groff, which is called stylesheet.mm, because I used mm before I started tinkering with the groff macro's, can be used to change the appearance of the pdf-files. Most of the information is the same as for the mm macro set. Note that in3 does not (yet) support all the possibilities that an mm document has. Currently supported is:
.ds licon txt
Use txt as the header of the table of contents.
.nr Ej n
Eject a page before a header at level n
.nr Eo n
Eject to make sure separator pages and H1 are on odd numbered pages.
.ds HF l1 l2 ...
Define the header font for level l1, l2, ... Use either numerical font or by groff abbreviation
.ds HP l1 l2 ...
Define the header pitch size for level l1, l2, ... 0 is the same size as normal text.
.nr Hb n
Heading break level
.nr Hc n
Heading center level
.nr Hs n
Heading style; 0-> 1.1.1... , 1-> single
.ds pg*header ''text''
Use text as page header
.ds pg*footer ''text''
Use text as page footer

As an example, https://dullaart.website/oevres_literaires_francaises/total.pdf uses the following stylesheet.mm:
 .nr Ej 1
 .nr Eo 1
 .ds HF  3 3 2 2 2 2 2
 .nr Hb 4
 .nr Hs 1
 .nr Hps 0
 .ds HP  14 12 12 0 0 0 0
 .ds Licon "Table des mati\[`e]res
 .ds pg*header
 .ds pg*footer ''- \\nP -''

Fonts can be loaded at positions to change the appearance of the document. The font number can also be used the HF definition of header-fonts. The following fonts are default:
Nr
Font
Used for
1
Times
normal text, lists etc. Also for underlined text
2
Times Italic
Italic text
3
Times Bold
Bold text
4
Times Bold Italic
Bold italic text
6
Courier
fixed fonts

In addition, in3 will download the font SFOR to provide russian characters. The font is loaded and referenced by name, never by number.

For class blocks, defined with block classxxx, an environment can be created wth the class name. Within the environment, all things may be changed. At the end of the block, the environment will be popped off the stack. Because classes are implemented as environments, all class blocks will produce a line break in the pdf output. This means that the PDF output does not support inline class blocks. An example of the class block:
 .ev classtest
 .gcolor red
 .ev