summaryrefslogtreecommitdiff
path: root/sandbox/paultremblay/python_interface/docs/rst/howto.rst
blob: e7fa31e5f5cb95398aa39e2fd6236bd3b26780fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
^^^^^^^^^^^^^^^^^^^^^^^^
HOWTO: Docutils2fo 0.6
^^^^^^^^^^^^^^^^^^^^^^^^

..  $Id$ 

.. contents::

================
Convert to XML
================

Use the rst2xml.py script, and pass the the ``'--strip-comments'`` and 
``'--trim-footnote-reference-space'`` options::

 rst2xml.py --strip-comments --trim-footnote-reference-space my_file.rst > my_file.xml

================
Convert to FO 
================

Use the docutils_to_fo.py script::

 docutils_to_fo.py  my_file.xml > my_file.fo

Use the ``'--help'`` option to get options.

Alternatively, you can convert from RST to FO in one step::

 rst2xml.py --strip-comments --trim-footnote-reference-space my_file.rst | docutils_to_fo.py > my_file.fo

================
Convert to PDF 
================

Use the fop processor, an open source Java application at http://xmlgraphics.apache.org/fop/.
In order to run in from a unix system::

 fop my_file.fo my_file.pdf

To convert from RST to PDF with one command::

 rst2xml.py --strip-comments --trim-footnote-reference-space my_file.rst\
 | docutils_to_fo.py | fop -fo - my_file.pdf

===================
Format a Document
===================

1. Create a config file that with a section and instructions (as explained
   below)::

    [FO]

    paragraph.space-before = 12pt


2. Enable the ``'docutils_to_fo'`` script to read the config file. Either pass 
   the ``'--config'`` option::

     docutils_to_fo.py  --config my_config_file my_file.xml > my_file.fo

  or put this file where the script automatically reads it, either in 
  ``./docutils.conf``, or ``~/home/.docutils``. 

Unless otherwise noted, the rest of this document refers to creating the
config file.

==================
Create a Command
==================

Commands consist of instructions without a period in them. The following
sets ``'strict'`` = ``'True'``, making the processing quit when an error is 
encountered::

 strict = True 

 

================================
Create a Formatting Instruction
================================

Formatting instructions consist of 3 parts: the region to be formatted,
followed by a period; the formatting property, followed by an equal sign; and
the value of the property. The following command sets the space before plain
paragrahs to 12pt::

 paragraph.space-before = 12pt

.. tip::

 You can use the config file to pass commonly-used options of the 
 rst2xml.py command. Put these commands in the *general* section::

   [general]

   strip_comments = true
   trim-footnote-reference-space = true

   [FO]
   paragraph.space-before = 12pt


==============================
General Formatting for Blocks
==============================

Most of the regions in a docutils document consists of blocks. This is true of
the title, subtitle, section titles, paragrahs, block quotes, etc. All of thes
blocks can take the following properties:

* space-before
* space-after
* first-line-indent
* font (the same as font-family)
* font-size
* font-style
* color (for the color of the text)
* backgroud-color
* left-indent 
* right-indent 
* border (for the boders around the block) 
* line-spacing (for double space, for exampe)
* alignment 
* keep-with-next (to keep the block from ending a page)
* keep-with-previous (to keep the block from starting a new page)
* keep-on-same-page (to prevent a block form splitting across a page)
* page-break-before (to create page breaks) 
* page-break-after (to create page breaks) 

These properties are the most commonly used and have an easy-to-remember,
short name. In addition, one can use any of the valid FO properties, which can
be found, among other places, at http://www.w3schools.com/xslfo/obj_block.asp.
For example, ``'paragraph.border-before-color = red'`` specifies the color of the 
border on the before-edge for plain paragraphs.

============
Page Layout
============

Paper Size
-----------

::

 paper-size.height = 11in
 paper-size.width = 8.5in

Margins
---------
::

 page.top-margin = .75in
 page.bottom-margin = .75in
 page.right-margin = .75in
 page.left-margin = .75in

Different Margins for Odd and Even Pages (if desired)
------------------------------------------------------
::

 odd-page.top-margin = 1in
 odd-page.bottom-margin = 1in
 odd-page.right-margin = 1in
 odd-page.left-margin = 2in
 
 even-page.top-margin = 1in
 even-page.bottom-margin = 1in
 even-page.right-margin = 2in
 even-page.left-margin = 1in

Different Margins for the First Page (if desired)
---------------------------------------------------
::

 first-page.top-margin = 3in
 first-page.bottom-margin = 1in
 first-page.right-margin = .8in
 first-page.left-margin = 2in


====================
Headers and Footers
====================

Create a header
---------------

In the *document* (not the config file), use the following::

 .. header:: 

    A Christmas Carol 

The header will appear on every page, including any pages in the table
of contents section.

Create a footer
---------------

In the *document* (not the config file), use the following::

 .. footer:: 

    Charles Dickens 

The footer will appear on every page, including any pages in the table
of contents section.

Create a page number in a header or footer
--------------------------------------------

In the *document* (not the config file), use the following::

 .. role:: page-num
    
 .. footer:: 

    Charles Dickens.
    
    :page-num:`1`

Page numbers will be generated automatically.

Create space for a header or footer
------------------------------------

The defaults should create enough space for headers or footers. If you want to
change the defaults, use::

 header.height = 1in
 footer.height = 1in


Create space between header and body text
------------------------------------------

::

 header.space-before = .2in
    
Create space between footer and body text
------------------------------------------

::

 footer.space-before = -.1in

Format header and footer text
------------------------------

If your header or footer contains just one paragraphs, use the header or
footer region plus any block property::

 header.color = blue
 header.background-color = black


Create custom headers and footers for odd, even, etc.
--------------------------------------------------------

You can create different headers and footers for the following
regions:

* first page of the body
* odd page of the body
* even page of the body
* first page of the table of contents section
* odd page of the table of contents section
* even page of the table of contents section

These headers and footers can be formatted all at once, using the ``'header'``
and ``'footer'`` identifiers. By default, these headers and footers are all
centered. However, each inidividua header and footer can be customized, as
shown below.

Create a different header for the first and subsequent pages
-------------------------------------------------------------

In the *document* set up the headers and footers::


 .. container:: first-header
 
  first header text
 
 .. container:: first-footer
 
  first footer text
 
 .. container:: body-header
 
  body header
 
 .. container:: body-footer
 
  body footer

Use ``'first-header'``, ``'first-footer'``, ``'body-header'`` and
``'body-footer'`` to format these headers and footers::

 body-header.color = red
 body-footer.color = red
 first-header.background-color = red
 first-footer.background-color = red

Create a different header for odd and even pages
-------------------------------------------------

In the *document* set up the headers and footers::


 .. container:: odd-header
 
  odd header
 
 .. container:: odd-footer
 
  odd footer
 
 .. container:: even-header
 
  even header
 
 .. container:: even-footer
 
  even footer

Use ``'odd-header'``, ``'odd-footer'``, ``'even-header'`` and
``'even-footer'`` to format these headers and footers::

 odd-header.color = red
 odd-footer.color = red
 even-header.background-color = red
 even-footer.background-color = red

Create a different header for first, odd and even pages
--------------------------------------------------------

In the *document* set up the headers and footers::

 .. container:: first-header
 
  first header text
 
 .. container:: first-footer
 
  first footer text

 .. container:: odd-header
 
  odd header
 
 .. container:: odd-footer
 
  odd footer
 
 .. container:: even-header
 
  even header
 
 .. container:: even-footer
 
  even footer

Use ``'first-header'`` ``'first-footer'``, ``'odd-header'``,
``'odd-footer'``, ``'even-header'`` and ``'even-footer'`` to format
these headers and footers::

 first-header.font-style = italic
 first-footer.font-style = italic
 odd-header.color = red
 odd-footer.color = red
 even-header.background-color = red
 even-footer.background-color = red

Suppress first page header or footer
--------------------------------------

For simple pages
+++++++++++++++++

Use the following method if you want the same headers and footers on
all pages except the first. In the *document* create headers and
footers for the body, but not for the first page::

 .. container:: body-header
 
  body header
 
 .. container:: body-footer
 
  body footer

For odd and even pages if using standard page margins
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

Use the following method if (1) you wish to have different headers and
footers on odd and even pages, but no headers and footers on the first
page; and (2) you have the same margins for odd and even pages.

1. First, tell the formatter you desire a first-odd-even layout.
   (Without specifying this explicitly, the formatter will simply
   think you want an odd-even layout.)::

     document.page-layout = first-odd-even

2. Create odd and even headers, without creating any first headers
   and footers::

    .. container:: odd-header
    
     odd header
    
    .. container:: odd-footer
    
     odd footer
    
    .. container:: even-header
    
     even header
    
    .. container:: even-footer
    
     even footer

For odd and even pages if using custom page margins
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

Use the following method if (1) you wish to have different headers and
footers on odd and even pages, but no headers and footers on the first
page; and (2) you have different margins for odd and even pages.

1. First, set the margins for the first page to that of the odd page.
   (This step tells the formatter that set the page layout to
   first-odd-even, the layout desired; and it makes sure the first,
   odd page, is identical to the other odd pages.)  
   
::

     first-page.top-margin = .75in
     # etc.

2. Create odd and even headers, without creating any first headers
   and footers::

    .. container:: odd-header
    
     odd header
    
    .. container:: odd-footer
    
     odd footer
    
    .. container:: even-header
    
     even header
    
    .. container:: even-footer
    
     even footer


Create a different header for the first and subsequent pages for the TOC
-------------------------------------------------------------------------

In the *document* set up the headers and footers::


 .. container:: toc-first-header
 
     First header 
     
 .. container:: toc-first-footer
 
     First footer
     
 .. container:: toc-body-header
 
     Body header 
     
 .. container:: toc-body-footer
 
     Body footer
    

Use ``'toc-first-header'``, ``'toc-first-footer'``, ``'toc-body-header'`` and
``'toc-body-footer'`` to format these headers and footers::

 toc-body-header.color = red
 toc-body-footer.color = red
 toc-first-header.background-color = red
 toc-first-footer.background-color = red

Create a different header for odd and even pages for the TOC
--------------------------------------------------------------

In the *document* set up the headers and footers::


 .. container:: toc-odd-header
 
  odd header
 
 .. container:: toc-odd-footer
 
  odd footer
 
 .. container:: toc-even-header
 
  even header
 
 .. container:: toc-even-footer
 
  even footer

Use ``'toc-odd-header'``, ``'toc-odd-footer'``, ``'toc-even-header'`` and
``'toc-even-footer'`` to format these headers and footers::

 toc-odd-header.color = red
 toc-odd-footer.color = red
 toc-even-header.background-color = red
 toc-even-footer.background-color = red

Create a different header for first, odd and even pages for the TOC
--------------------------------------------------------------------

In the *document* set up the headers and footers::

 .. container:: toc-first-header
 
  first header text
 
 .. container:: toc-first-footer
 
  first footer text

 .. container:: toc-odd-header
 
  odd header
 
 .. container:: toc-odd-footer
 
  odd footer
 
 .. container:: toc-even-header
 
  even header
 
 .. container:: toc-even-footer
 
  even footer

Use ``'toc-first-header'`` ``'toc-first-footer'``, ``'toc-odd-header'``,
``'toc-odd-footer'``, ``'toc-even-header'`` and ``'toc-even-footer'`` to format
these headers and footers::

 toc-first-header.font-style = italic
 toc-first-footer.font-style = italic
 toc-odd-header.color = red
 toc-odd-footer.color = red
 toc-even-header.background-color = red
 toc-even-footer.background-color = red

Suppress first page header or footer for the TOC
-------------------------------------------------

Follow the same procedures as for the body. To supress the header and
footer when the headers and footers are otherwise the same for all
pages, create body headers and footers for the toc, but not for the
first page::

 .. container:: toc-body-header
 
     Body header 

To suppress when using different headers and footers for odd and even
pages, set up the odd and even headers/footers, and then signal to the
formatter that you wish for a first-odd-even layout, either through
the ``'document.page-layout'`` property, or by setting margins for the
first page.


Formatting the paragraphs in headers and footers
--------------------------------------------------

Use the header-paragraph and footer-paragraph to format paragraphs:: 

 header-paragraph.font-style = bold
 footer-paragraph.font-style = italic


================
Non Body Matter
================

Non Body matter refers to the document title and subtitle; the
bibliographic fields; the dedication; the abstract; and the table of
contents. 

Each such matter can be put in the front part, the toc (table of
contents) part, or the body part. 

The front part of a document occurrs first and has not headers or
footers. The toc part occurrs next, generally starts with page 1
(thought this can be changed), and page numberas are  formamtted with
Roman numberals (though this can be changed.)

The body part is part of any document. It generally starts with page 1
(though this can be changed) and page numbers are formatted with
Arabic numbers (though this can be changed).

Placing the title/subtitle
---------------------------

With the front part (default)
+++++++++++++++++++++++++++++++

::

 title-subtitle.placement = with-front

With the toc part
++++++++++++++++++

::

 title-subtitle.placement = with-toc

With the body part
+++++++++++++++++++

::

 title-subtitle.placement = with-body

Placing the bibliograph fields
-------------------------------

With the front part 
++++++++++++++++++++

::

 bibliographic-fields.placement = with-front

With the toc part (default)
++++++++++++++++++++++++++++

::

 bibliographic-fields.placement = with-toc

With the body part
+++++++++++++++++++

::

 bibliographic-fields.placement = with-body

Placing the dedication
-----------------------

With the front part 
++++++++++++++++++++

::

 dedication.placement = with-front

With the toc part (default)
++++++++++++++++++++++++++++

::

 dedication.placement = with-toc

With the body part
+++++++++++++++++++

::

 dedication.placement = with-body

Placing the abstract
-----------------------

With the front part (default)
++++++++++++++++++++++++++++++

::

 abstract.placement = with-front

With the toc part 
++++++++++++++++++

::

 abstract.placement = with-toc

With the body part
+++++++++++++++++++

::

 abstract.placement = with-body

Placing the toc
----------------

With the front part 
++++++++++++++++++++

::

 toc.placement = with-front

With the toc part 
++++++++++++++++++

::

 toc.placement = with-toc

With the body part
+++++++++++++++++++

::

 toc.placement = with-body

Changing the order of non-body matter
---------------------------------------

By default, docutils to fo places the non-body matter in the order it
occurrs in the docutils XML document (which may be different than the
RST document). This order is title/subtitle, bibliographic,
dedication, and table of contents. To change this order, use the
``'front.order'`` property. Its value is a list of the non-body order
areas in the order you wish it to occurr, speparated by commas::

 # changes the order of the abstract and the bibliographic fields
 front.order = title, abstract, dedication, toc, bibliographic

Changing the starting page number
----------------------------------

In order to change the starting page number of a toc section or body
section, use the ``'toc-section.start-page'`` or
``'body-section.start-page'`` properties::

 # toc now start on page 3
 toc-section.start-page = 3
 # body starts on page 15
 body-section.start-page = 15

Changing the format of the page number
----------------------------------------

In order to change the formatting of the page numbers, use the
``'toc-section.page-format'`` and ``'body-section.page-format'``::

 # upper case Roman numberals
 toc-section.page-format = I
 # upper case letters
 body-section.page-format = A

Formatting the title/subtitle
------------------------------

Use the property ``'title-subtitle'`` to format both the title and
subtitle. Use the property ``'title'``  to format just the title. Use the
property ``'subtitle'`` to format just the subtitle. All of these
properites are block properties, and can take any of the
properites of a block (see paragraph)::

 # center the title an subtitle
 title-subtitle.alignment = center
 # format the title
 title.font-size = 24pt
 # format the subtitle
 subtitle.font-size = 18pt

To create space before a title/subtitle, and to put the title/subtitle
on their own page::

 title-subtitle.page-break-before= true
 title-subtitle.space-before=3in

===================================
Formatting the bibliograhic fields
===================================

Formatting as a list
---------------------

By defaullt, bibliographic fields are formatted as a list. Use the
``'bibliograhic-fields'`` property to format the space after and before, the
left and right indent, and any other property you want to set on the list,
such as font for font-size::

 bibliographic-fields.space-after = 20pt
 bibliographic-fields.space-before = 20pt
 bibliographic-fields.left-indent = 20pt
 bibliographic-fields.right-indent = 20pt
 bibliographic-fields.background-color = grey

Putting the bibliographic fields on its own page
++++++++++++++++++++++++++++++++++++++++++++++++++

::

 bibliographic-fields.page-break-before = true
 # or, depending on your layout
 bibliographic-fields.page-break-after = true


To format space between items
++++++++++++++++++++++++++++++

Use the ``'space-between-items'`` property.

::


  bibliographic-fields.space-between-items = 30pt

To format space between field and text
+++++++++++++++++++++++++++++++++++++++

The ``'space-from-fields'`` works exactly as the ``'space-from-bullet''``: both
properties control the spacing from the list label and the text.

::

  bibliographic-fields.space-from-field = 3in

Formatting the field
++++++++++++++++++++++

Use the ``'bibliographic-field'`` property, and apply any block properties.
Note the slight, one letter difference between ``'bibliographic-fields``, which
formats the entire list, and ``'bibliographic-field'`` which formats just the
field::

 # change default font to normal
 bibliographic-field.font-style = normal

Changing the default text of the fields
+++++++++++++++++++++++++++++++++++++++++

By default, the docutils to FO converter gives expected names to each of the
bibliographic fields. If you wish to change the name, use the
``'bibliographic-fields.<fieldname-text>`` property::

  # change all the fields from the default to lower case
  bibliographic-fields.author-text = author
  bibliographic-fields.authors-text = authors
  bibliographic-fields.organization-text = organization
  # change 'contact' to 'email'
  bibliographic-fields.contact-text = email
  bibliographic-fields.status-text = status
  bibliographic-fields.copyright-text = copyright
  bibliographic-fields.address-text = address
  bibliographic-fields.revision-text = revision
  bibliographic-fields.date-text = date

Formatting the text of the field
+++++++++++++++++++++++++++++++++++

Use the ``'bibliographic-fields-text'`` identifier::

 bibliographic-fields-text.font-weight=bold

Formatting the text for individual paragraphs
+++++++++++++++++++++++++++++++++++++++++++++

For fields that have more than one paragraph, use the ``'bibliographic-fields-paragraph'``
identifier. This identifier can take any block property::

 bibliographic-fields-paragraph.space-before = 12pt

Note that using the ``'space-before'`` property has the same effect as
controlling the space between each paragraph, without putting unwated space
before the first paragraph. 

Formatting as blocks of text
-----------------------------

Use ``'the bibliographic-fields.format'`` to change the value of the default
format::

 bibliographic-fields.format = normal

Formatting the author field, etc.
----------------------------------

Each bibliographic field is a block, and its identifier is the name of the
field . 

:address: formats the address field
:author: formats the author field
:authors: formats the authors field
:contact: formats the contact field
:copyright: formats the copyright field
:date: formats the date field
:organization: formats the organization field
:revision: formats the revision field
:status: formats the status field
:version: formats the version field

::

 address.space-before=24pt
 author.font-style = bold
 authors.alignment = center
 contact.font-style = italic
 copyright.color = red
 date.background-color = blue
 organization.font-size = 24pt
 revision.alignment = center
 status.alignment = right
 version.font-style = bold-italic
        

Formatting custom bibliographic fields
----------------------------------------

Use the ``'bibliographic-fields-custom1'``,
``'bibliographic-fields-custom2'``, etc, to format each custom field, where
``'-custom1'`` refers to the first occurrence of a custom field,
''`-custom2'`` refers to the second such occurrence, and so on:: 

 bibliographic-field-custom1.color = green
 bibliographic-field-custom2.color = red

Changing the default text of the fields
+++++++++++++++++++++++++++++++++++++++++

As when the bibliiographic fields are formatted as a list, the text of the
fields can likewise be changed in the same manner when formatting the
bibliographic fields as blocks. It often makes sense to makes these fields
empty, especially when creating title page::

  bibliographic-fields.author-text = by
  bibliographic-fields.date-text = 

Including text for custom fields
+++++++++++++++++++++++++++++++++

Use the ``'bibliographic-field-custom#.text'`` property::

 bibliographic-field-custom1.text = Country
 bibliographic-field-custom2.text = Uses of software: 

Making a Title Page
--------------------

Here is the actual RST document::

 ======
 Title
 ======
 
 Subtitle
 =========
 
 
 :by: by
 :Author: Paul Tremblay
 :Address: Paul Tremblay 
           100 Market St. 
           Boston, MA, 01800
 
 :Country: USA
 :Organization: Open Source Software
 :useline: Uses
 :Uses: text processing
 
        documentation
 :Date: $Date$
 :Copyright: This document is in the public domain
 
 Text after.

Here is the configuration file::

 [general]
 trim-footnote-reference-space = true
 [FO]
 bibliographic-fields.format = normal
 
 # the by line by itself
 bibliographic-field-custom1.space-after = 12pt
 bibliographic-field-custom1.alignment = center

 # the line with 'usline' 
 bibliographic-field-custom3.space-after = 0pt
 bibliographic-field-custom3.font-style = bold

 # the Uses field
 bibliographic-field-custom4.space-before = 0pt

 # center align author
 author.alignment = center
 author.font-size = 16pt
 # put a border after the title
 author.border-bottom = 2px solid
 author.padding = 6pt

 # put a borer after copyright
 copyright.border-bottom = 2px solid
 copyright.padding = 6pt
 
 
 
 # set the default text to nothing
 bibliographic-fields.author-text =
 bibliographic-fields.authors-text = 
 bibliographic-fields.organization-text = 
 bibliographic-fields.copyright-text = 
 bibliographic-fields.address-text = 
 bibliographic-fields.date-text = 

 # commands
 strict = True


Formatting the dedication
--------------------------

Creating a dedication
+++++++++++++++++++++++

::

 :Dedication: I dedicate this thesis to my good friend John, who
   stood by me for many years while I struggled ...

Putting dedication on its own page
++++++++++++++++++++++++++++++++++++++++++++++++++

::

 dedication.page-break-before = true
 # or, depending on your layout
 dedication.page-break-after = true

Formatting the title
+++++++++++++++++++++++

Use the ``'dedication-title'`` identifier, which can take any block property::

 dedication-title.alignment = center
 dedication-title.font-size = 24pt

Formatting the paragraphs
++++++++++++++++++++++++++

Use the ``'dedication-paragraph'`` identifier, which can take any block property::

 dedication-paragraph.font-size = 10pt
 dedication-paragraph.alignment = right
 dedication-paragraph.font-style = italic


Formatting the abstract
--------------------------

Creating a abstract
+++++++++++++++++++++++

::


 :Abstract: Just an example of bibliograhic fields.
  This continues on.

Putting abstract on its own page
++++++++++++++++++++++++++++++++++++++++++++++++++

::

 abstract.page-break-before = true
 # or, depending on your layout
 abstract.page-break-after = true

Formatting the title
+++++++++++++++++++++++

Use the ``'abstract-title'`` identifier, which can take any block property::

 abstract-title.alignment = center
 abstract-title.font-size = 24pt

Formatting the paragraphs
++++++++++++++++++++++++++

Use the ``'abstract-paragraph'`` identifier, which can take any block property::

 abstract-paragraph.font-size = 10pt
 abstract-paragraph.alignment = right
 abstract-paragraph.font-style = italic


Formatting the toc
--------------------------

Creating a toc
+++++++++++++++++++++++

::

 .. contents:: Table of Contents

Putting toc on its own page
++++++++++++++++++++++++++++++++++++++++++++++++++

::

 toc.page-break-before = true
 # or, depending on your layout
 toc.page-break-after = true

Formatting the title
+++++++++++++++++++++++

Use the ``'toc-title'`` identifier, which can take any block property::

 toc-title.alignment = center
 toc-title.font-size = 24pt

Setting the defaults on each entry
++++++++++++++++++++++++++++++++++++

Use the ``'toc-default'`` to set properties for all of the toc entries
at once::


 # sets space between entries to 12pt
 toc-default.space-after = 12pt


Formatting the entries
++++++++++++++++++++++++++

Use the identifierst ``'toc-entry1'``, ``'toc-entry2'``, etc.
which can take any block property::

 # increase indents by 10mm
 toc-entry1.left-indent = 10mm
 toc-entry2.left-indent = 20mm
 toc-entry3.left-indent = 30mm
 toc-entry4.left-indent = 40mm
 toc-entry5.left-indent = 50mm


Format the toc numbers
+++++++++++++++++++++++

The format of the numbers for toc entry takes the same format as the
section numbers. See section numbers.

=========
Sections
=========

Creating sections
------------------

Sections are identified through their titles, which are marked up with
adornment: "underlines" below the title text, or underlines and matching
"overlines" above the title.


Here are some examples::

 ===============
 Heading1 Title
 ===============
 
 ---------------
 Heading2 Title
 ---------------
 
 Heading3 Title
 =============
 
 Heading4 Title
 -------------
 
 Heading5 Title
 `````````````
 
 Heading6 Title
 '''''''''''''
 
 Heading7 Title
 .............
 
Any combination of valid adornments can be used. The rst2xml.py utility
recognizes the first such example as the main section, the next such example
as the sub section, and so on.

See the http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#sections.


Formatting titles
-------------------

Use the identifiers ``'heading1'``, ``'heading2'``, ``'heading3'``, etc, to
format the titles for each section. Docutils to fo allows sections to go 7
levels deep. Headings are blocks and can take any property of a block (see
paragrahs). 

::

 heading1.font-size = 30pt
 heading1.font-style = bold
 heading2.font-size = 24pt
 # etc.
 heading7.font-size = normal
 heading7.font-style = bold

Creating section numbers
-------------------------

At the start of the document, put::

 .. sectnum::

Formatting section numbers
---------------------------

Use the ``'heading#'`` identifier plus the ``'number-format'`` to format the
section numbers. The value for formatting can take a combination of
punctuation and numbers, letters, or Roman numberals

::

 # (I.), (II.), (III.), etc
 heading1.number-format = (I.)

 # i.), ii.), etc 
 heading2.number-format = i.)

 # .1., .2., .3., etc
 heading3.number-format = .1.

 # a, b, c, etc
 heading4.number-format = a

 # A, B, C., etc
 heading5.number-format = A

.. Don't inherit section numbers
.. ------------------------------
.. 
.. By default, the numbers of each section inherit the numbers of the parent
.. section. to disable this formatting::
.. 
..  headings.inherit-sections-number = False

============
Transitions
============

Creating transitions
---------------------

To create a transition, in the *document* (not the config file), use
horizontal line of 4 or more repeated punctuation characters.

::


 Para.

 ----------

 Para.

Changing the text of the transtion.
-------------------------------------

The default transition text is a single paragraph of three asteristics. To
change the default, use the ``'transition.text'`` property::

 # change to three hypens
 transition.text = ---
 # change to nothing
 transition.text = 

Formatting the transition paragraph
------------------------------------

Use the ``'transition'`` identifier to format the paragraph of the transition
text. This identifier can take any block property.

::

 transition.space-before = 24pt
 transition.space-after = 24pt
 # change the default alignment from center
 transition.alignment = left


===========
Paragraphs
===========

Space before or after paragraphs
---------------------------------

::

 paragraph.space-before = 12pt
 paragraph.space-after = 12pt

Indent first line
-------------------

::

 paragraph.first-line-indent = 12pt

Font Family
-------------

::

 paragraph.font = monospace

Font Size
----------

::

 paragraph.font-size = 12pt

Font Style
-----------

Set ``'font-style'`` to ``'bold'``, ``'italic'``, ``'bold-italic'``,
or ``'normal'``::

 paragraph.font-style = bold-italic

Color (font color)
-------------------

::

 paragraph.color = red

Background color
------------------

::

 paragraph.backgroud-color = red

Left and right indent
----------------------

::

 paragraph.left-indent = 12pt 
 paragraph.right-indent = 12pt 

Borders
---------

::

 paragraph.border = solid black 1px

Use ``'border-top'``, ``'border-bottom'``, ``'border-left'``, and
``'border-right'`` to set properties on specific borders::

 # creates a bottom border
 paragraph.border-bottom = solid black 1px

Line spacing
--------------

::

 # double spaces paragraphs
 paragraph.line-spacing  = 2

Alignment
-----------

Use ``'alignment'`` to align text. Valid values are ``'left'``,
``'right'``, ``'center'``, and ``'justify'``.

::

 # center aligns text
 paragraph.alignment = center

Keep with previous text
-------------------------

::

 # paragrah won't start a new page
 keep-with-previous = true

Keep  with next text
----------------------

::

 # paragrah won't end the page
 keep-with-next = true

Keep from breaking across pages
---------------------------------
::

 keep-on-same-page = true


Page break before or after
----------------------------

::

 paragraph.page-break-before = yes
 paragraph.page-break-after = yes


No page break before or after
-------------------------------

::

 paragraph.page-break-after = no
 paragraph.page-break-before = no

Formatting for first paragrahs
--------------------------------

Docutils to FO allows first paragraphs to be formatted differently
from all others. First paragraphs refers to the first paragraphs after
a section of document, or the first paragaph after a list, code block,
admonition block, or table. British style dictates that such
paragraphs do not have their first line indented. 

::

 #indents all but first paragraph 12pt
 paragraph.first-line-indent = 12pt
 first-paragraph.first-line-indent = 0pt

============
Bullet List
============


Formatting the bullet list
----------------------------

Use the ``'bullet-list'`` property to format the space after and
before, the left and right indent, and any other property you want to
set on the list, such as font for font-size::

 bullet-list.space-after = 20pt
 bullet-list.space-before = 20pt
 bullet-list.left-indent = 20pt
 bullet-list.right-indent = 20pt
 bullet-list.background-color = grey


To format space between items
-------------------------------

Use the ``'space-between-items'`` property.

::


  bullet-list.space-between-items = 30pt

To format space between bullets and text
-------------------------------------------

Use the ``'space-from-bullet'`` identifier::


  bullet-list.space-from-bullet = 1in

Choosing the text for the bullet
-----------------------------------

Use the ``'bullet-list.text'`` property to change the default bullet::

 # change to hyphen
 bullet-list.text = -

If the ``'bullet-list.text'`` property is left empty, the converter
uses the text in the actual document::

 # use the text in the document 
 bullet-list.text = 


Formatting the  paragraphs
----------------------------

Use the ``'bullet-list-paragraph'`` identifier to format the text of
the bullet list. This identifier can take any block property::

 bullet-list-paragraph.space-before = 12pt
 bullet-list-paragraph.font-style = italic

Note that using the ``'space-before'`` property has the same effect as
controlling the space between each paragraph, without putting unwated space
before the first paragraph. 

Formatting nested bullet lists
-------------------------------

Use the ``'bullet-list-level2'`` to format nested lists::

 bullet-list-level2.space-before = 20pt
 bullet-list-level2.left-indent = 40pt
 bullet-list-level2.background-color = blue
 bullet-list-level2.space-from-bullet = 1.5in
 bullet-list-level2.text = †
 bullet-list-level2.space-between-items = 50pt


=================
Enumerated List
=================

Formatting the enumerated list
-------------------------------

Use the ``'enumerated-list'`` property to format the space after and
before, the left and right indent, and any other property you want to
set on the list, such as font for font-size::

 enumerated-list.space-after = 20pt
 enumerated-list.space-before = 20pt
 enumerated-list.left-indent = 20pt
 enumerated-list.right-indent = 20pt
 enumerated-list.background-color = grey


To format space between items
-------------------------------

Use the ``'space-between-items'`` property.

::


  enumerated-list.space-between-items = 30pt

To format space between enumerateds and text
---------------------------------------------

Use the ``'space-from-number'`` identifier::


  enumerated-list.space-from-number = 1in


Formatting the  paragraphs
---------------------------

Use the ``'enumerated-list-paragraph'`` identifier to format the text of
the enumerated list. This identifier can take any block property::

 enumerated-list-paragraph.space-before = 12pt
 enumerated-list-paragraph.font-style = italic

Note that using the ``'space-before'`` property has the same effect as
controlling the space between each paragraph, without putting unwated space
before the first paragraph. 

Formatting nested enumerated lists
-----------------------------------

Use the ``'enumerated-list-level2'`` to format nested lists::

 enumerated-list-level2.space-before = 20pt
 enumerated-list-level2.left-indent = 40pt
 enumerated-list-level2.background-color = blue
 enumerated-list-level2.space-from-number = 1.5in
 enumerated-list-level2.space-between-items = 50pt


=================
Definition List
=================

Formatting the definition list
-------------------------------

Use the ``'definition-list'`` property to format the space after and
before, the left and right indent, and any other property you want to
set on the list, such as font for font-size::

 definition-list.space-after = 20pt
 definition-list.space-before = 20pt
 definition-list.left-indent = 20pt
 definition-list.right-indent = 20pt
 definition-list.background-color = grey

Formatting space between items
-------------------------------

An item consists of both the term and definition.

::

 definition-list.space-between-items = 0pt

To format space below term
---------------------------

Use the ``'space-below-term'`` property.

::

  definition-list.space-below-term = 30pt

Formatting the term
---------------------

Use the ``'definition-term'`` identifier, which can take any block property::

 definition-term.right-indent = 10pt
 definition-term.color = red

Formatting the definition
--------------------------

Use the ``'definition-list-definition'`` identifier, which can take any block property::

 definition-list-definition.color = blue

Formatting the classifier
-------------------------

Use the ``'definition-list-classifier'`` identifier, which can take any inline property::

::

 definition-list-classifier.color = green

Formatting the  paragraphs
---------------------------

The ``'definition-list-definition'`` formats all the paragraphs in the
definiton. If you wish to change a property on the paragraphs instead, use the
``'definition-list-paragraph'`` identifier::

 # the space before dtermines the space between each paragraph
 definition-list-paragraph.space-before = 12pt

============
Field List
============


Formatting the field list
----------------------------

Use the ``'field-list'`` property to format the space after and
before, the left and right indent, and any other property you want to
set on the list, such as font for font-size::

 field-list.space-after = 20pt
 field-list.space-before = 20pt
 field-list.left-indent = 20pt
 field-list.right-indent = 20pt
 field-list.background-color = grey


To format space between items
-------------------------------

Use the ``'space-between-items'`` property.

::


  field-list.space-between-items = 30pt

To format space between field and text
-------------------------------------------

Use the ``'space-from-name'`` identifier::


  field-list.space-from-name = 1in

Formatting the field names
---------------------------

Use the ``'field-name'`` identifier, which can take any inline
properties::


  field-name.color = blue


Formatting the  paragraphs
----------------------------

Use the ``'field-list-paragraph'`` identifier to format the text of
the bullet list. This identifier can take any block property::

 field-list-paragraph.space-before = 12pt
 field-list-paragraph.font-style = italic

Note that using the ``'space-before'`` property has the same effect as
controlling the space between each paragraph, without putting unwated space
before the first paragraph. 


============
Option List
============

Choosing the layout
-------------------

::

 option-list.format = definition

Choosing the options separator
-------------------------------

By default, the docutils to FO convertor uses a comma to separate
options. To change the default, use the ``'options-list.separate'``
property::

 options-list.separator = :

Formatting the option list format
-----------------------------------

The option list can either be formatted as a list, with the options as
labels to the left of the description; or as a definition list, with
the options serving as the terms, and the descriptions in a paragraph
right below. For an option list with lenghty options, a definition
list may work better.

Use the ``'option-list.format'`` to determine the style, choosing
either ``'list'`` or ``'definition'``::

 # change default layout to a definitio list
 option-list.format = definition

Formatting the option list
----------------------------

Use the ``'option-list'`` property to format the space after and
before, the left and right indent, and any other property you want to
set on the list, such as font for font-size::

 option-list.space-after = 20pt
 option-list.space-before = 20pt
 option-list.left-indent = 20pt
 option-list.right-indent = 20pt
 option-list.background-color = grey


To format space between items
-------------------------------

Use the ``'space-between-items'`` property.

::


  option-list.space-between-items = 30pt
 

To format space between option and text
-------------------------------------------

Use the ``'space-from-option'`` identifier::


  option-list.space-from-option = 1in

Note: this option is only valid for option lists formatted as lists,
not for optons lists formatted as definition lists.

To format space below option and text
-------------------------------------------

Use the ``'space-below-option'`` identifier::


  option-list.space-below-option = 1in

Note: this option is only valid for option lists formatted as
definition lists, not for optons lists formatted as lists.


Formatting the options
---------------------------

Use the ``'options'`` identifier to format the option with the
arguments of the options. This identifier  can take any inline
properties::


  options.font-size = xx-small

Formatting the options without the argument
----------------------------------------------

Use the ``'option'`` identifier to format only the option without the
arguments of the options. This identifier  can take any inline
properties::


  option.color = green

.. option-group-block

Formatting the arguments of the options
----------------------------------------------

Use the ``'option-argument'`` identifier to format just the option of
the arugment. This identifier  can take any inline properties::


  option-argument.color = green


Formatting the description
----------------------------

Use the ``'option-list-body'`` identifier to format the text of
the option list::

 option-list-body.font-style = italic

..  option-list-description-block

Formatting the paragraphs
----------------------------

Use the ``'option-list-paragraph'`` identifier to format the text of
the bullet list. This identifier can take any block property::

 option-list-paragraph.space-before = 12pt
 option-list-paragraph.font-style = italic

Note that using the ``'space-before'`` property has the same effect as
controlling the space between each paragraph, without putting unwated space
before the first paragraph. 

===============
Literal Blocks
===============

To format a literal block, use the ``'literal-block'`` identifier. The
literal block takes any block properties::

 literal-block.background-color = red

===========
Line Blocks
===========

Formatting the entire line block
---------------------------------

Use the ``'line-block'`` indentifier to format the entire line block.
This identifier can take any block property::

 line-block.space-before = 24pt
 # set font properties, etc
 line-block.font-size = 10pt
 line-block.line-spacing = 1

Formatting the lines
----------------------

The lines have the identifier ``'line-level1'``, ``'line-level2'`` and
so fourth. Each level indicates how many levels the line is nested.
Lines may be nesed up to 5 levels deep. It makes sense to set overall
properties with the ``'line-block'`` identifier, and to use the
``'line-level#'`` to set the indents of for each level::

 line-level1.left-indent = 15mm
 line-level2.left-indent = 25mm
 line-level3.left-indent = 35mm
 line-level4.left-indent = 45mm
 line-level5.left-indent = 55mm

Create a stanza title
----------------------

In order to create a title for a stanza, in the *document* (not the
configuration file) include the line in a title_reference::

 | `stanza title 1` 
 | A one, two, a one two three four
 |
 | `stanza title 2`
 | Half a bee, philosophically,
 |     must, *ipso facto*, half not be.
 | But half the bee has got to be,
 |     *vis a vis* its entity.  D'you see?
 |
 | `stanza title 3`
 | But can a bee be said to be
 |     or not to be an entire bee,
 |         when half the bee is not a bee,
 |             due to some ancient injury?
 |
 | Singing...

Formatting the stanza title
-----------------------------

Use the ``'stanza-title'`` to format the stanza title::

 stanza-title.font-style = bold

You cannot do any formatting with a title reference (the text between
the \`\`). If you need to do inline markup on part of a stanza title,
only put the \`\` around the part that does not need the markup::

 
 | *stanza title* `3` 
 | But can a bee be said to be

If you need to format the entire stanza title, use the following work
around::


 .. role:: title
 
 | *stanza title 3* :title:`x` 
 | But can a bee be said to be
 |     or not to be an entire bee,
 |         when half the bee is not a bee,
 |             due to some ancient injury?

Number lines
------------

Use the ``'line-block.number'`` property, and choose a number for the
value. If a value of 5 is choosen, every 5th line will be numbered. If
10 is choosen, every 10th line will be nummbered, and so on.

::

 line-block.number = 5

Make numers closer to line
----------------------------

By default, docutils to fo puts the number to the very right of the
margin. There is not way to change this default. However, by
increasing the margin on the line-block, the numbers will render
closer::

 line-block.right-indent = 20mm

Keeping the lines on the same page
-----------------------------------

If the line block is relatively short, use the ``'keep-on-same-page'``
property.

::

 line-block.keep-on-same-page = true

If the line block is long, using this property could lead to
huge space on a page.

.. note a work around is to create a completely new stanza, and use
.. keep-on-same-page property. 

Creating space between stanzas
-------------------------------

Use a blank line to control the space between stanzas. There is no
othe way to control space. The rst2xml.py utility marks a new set of
line blocks when it detects a new indentation. In contrast, real verse
is marked by the space between stanzas.

==============
Block Quotes
==============

Creating block quotes
----------------------

Indent text to creat a block quote. Use two dashes before a single
paragraph to create an attribution for the block quote::

 This is an ordinary paragraph, introducing a block quote.

    "It is my business to know things.  That is my trade."

    -- Sherlock Holmes

Formatting block quotes
------------------------

Use the ``'block-quote'`` identifier to format block quotes. This
identifier can take any block properties::

 block-quote.space-before = 24pt
 block-quote.left-indent = 30mm
 block-quote.right-indent = 30mm

Formatting the paragraphs in block quotes
------------------------------------------

Use the ``'block-quote-paragraph'`` identifier to format the
individual paragraphs. Setting the ``'space-before'`` property changes
the space between each paragraph::

 block-quote-paragraph.space-before = 0pt
 block-quote-paragraph.first-line-indent = 12pt

Formatting the attribution 
----------------------------

Use the ``'block-quote-attribution'`` identifier to format the
attribution::

 block-quote-attribution.space-before = 12pt
 block-quote-attribution.font-style = italic


Changing the default text for the attribution
-----------------------------------------------

By default, the |script_name| puts and em-dash before the attribution
text. To change this text, use the
``'block-quote.attriubution-text'``. Set this to an empty string to
set no text before the attribution::

 # have no text before the attribution
 block-quote.attriubution-text = 

======
Tables
======

Creating Tables
----------------

Either::

 =====  =====
 col 1  col 2
 =====  =====
 1      Second column of row 1.
 2      Second column of row 2.
        Second line of paragraph.
 3      - Second column of row 3.
 
        - Second item in bullet
          list (row 3, column 2).
 \      Row 4; column 1 will be empty.
 =====  =====

Or::

 +------------------------+------------+----------+----------+
 | Header row, column 1   | Header 2   | Header 3 | Header 4 |
 | (header rows optional) |            |          |          |
 +========================+============+==========+==========+
 | body row 1, column 1   | column 2   | column 3 | column 4 |
 +------------------------+------------+----------+----------+
 | body row 2             | Cells may span columns.          |
 +------------------------+------------+---------------------+
 | body row 3             | Cells may  | - Table cells       |
 +------------------------+ span rows. | - contain           |
 | body row 4             |            | - body elements.    |
 +------------------------+------------+---------------------+

Or::

 .. csv-table:: Frozen Delights!
    :header: "Treat", "Quantity", "Description"
    :widths: 15, 10, 30
 
    "Albatross", 2.99, "On a stick!"
    "Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be
    crunchy, now would it?"
    "Gannet Ripple", 1.99, "On a stick!"

Formatting tables
-------------------

Use the ``'table'`` identifier to format properties on the entire
table::

 table.space-before = 24pt
 table.space-after = 24pt

Use the ``'width'`` property to change the width of the table::

 table.width = 4in

Changing the widths of the columns
------------------------------------

The formatter uses the columns values generated by the rst2xml.py
script to determine the width of the columns. In order to change this
default, use the ``'table.column-widths'`` property, followed by a
series of numbers separated by commas::

 # column 2 will be 4 times as wide as column 1
 table.column-widths = 10, 40 

Formatting tables and captions
-------------------------------

Use the identifier ``'table-and-caption'`` if (1) you have a CVS table
with a title (caption) and; (2) you wish to treat both table and
caption as one block of text to control spacing::

 table-and-caption.keep-on-same-page = true
 table-and-caption.space-before = 12pt

Formatting the table header
----------------------------

Use ``'table-header'`` identifier to format the head of a table. Use
this identfier to set font styles, background colors, font color,
alingnment, etc.

::

 table-header.font-style = bold
 table-header.color = white
 table-header.background-color = blue
 table-header.alignment = center

Formatting the table header cells
-----------------------------------

Use the ``'table-header-cell'`` identifier to format cells.

Formatting borders
+++++++++++++++++++

The defaults of cells are:

* 1px black solid for all borders except the top
* 2px black solid for the bottom border
* border-collapse = collapse (merget adjacent borders)
* padding = 1em

To change, use the ``'border-bottom'``, ``'border-top'``,
``'border-left'`` and ``'border-right'``.

::

 # set the bottom border of the cell to a more solid line
 table-header.border-bottom = 3 px black solid

Changing the vertical alignment
++++++++++++++++++++++++++++++++

::

 # set the vertical alingment to bottom
 # get rid of padding  on bottom
 table-header-cell.padding-bottom = 0em
 # vertically align text with bottom
 table-header-cell.vertical-alignment = bottom

Formatting the table body 
--------------------------

Use ``'table-body'`` identifier to format the body of a table. Use
this identfier to set font styles, background colors, font color,
alingnment, etc.

::

 table-body.font-style = normal
 table-body.color = green
 table-body.background-color = red
 table-body.alignment = left

Formatting the table body cells
-----------------------------------

Use the ``'table-cell'`` identifier to format cells.

::

 # set the vertical alingment to bottom
 # get rid of padding  on bottom
 table-cell.padding-bottom = 0em
 # vertically align text with bottom
 table-cell.vertical-alignment = bottom
 table-cell.border = .5px solid green

.. |script_name| replace:: docutils to Of