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
|
.\" @(#)html2psrc.5
.\"
.TH html2psrc 5 " 7 May 2010" "Autogenerated" "html2ps configuration file format"
.SH NAME
html2psrc - configuration file format for html2ps(1)
.SH DESCRIPTION
Configuration files are used for layout control, resource information
etc. Normally, there should always exist a global configuration file.
In this file one typically specify things like: what image conversion
packages are available on the system, the default paper size, the default
text fonts and sizes, etc.
.PP
For Unix and Windows systems, the installation script 'install' can be
used to automatically build a global configuration file with all necessary
definitions, and install all files. The files replaced by the installation
are saved. If you for some reason are not satisfied with the new version:
execute the script 'backout' to reinstall your earlier version.
.PP
On other systems, you will have to manually create a global
configuration file, and insert the name of this file into the
html2ps script (close to the beginning, the line starting with
"$globrc="). The configuration file should contain a
package block, and perhaps
paper and
hyphenation blocks, described below.
.PP
Each user can then have a personal configuration file (by default
$HOME/.html2psrc) that complements/overrides the definitions made in the
global file. It is also possible to specify alternative files on the
command line, using the -f option.
.SH FILE FORMAT
.PP
A configuration file can include other configuration files. This is done with:
.RS
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
@import "\fIfilename\fP";
.RE
.PD
.PP
.PP
The rest of the configuration file consists of zero or more blocks.
A block is given by a block name, followed by the block definition, as in:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
BODY {
.RE
.RS .5i
.PP
font-size: 12pt;
.PP
font-family: Helvetica;
.PP
text-align: justify
.RE
.RS .3i
.PP
}
.RE
.PD
.PP
.PP
The block definition, enclosed by curly braces: { }, consists of
key-value pairs and/or other blocks. A key-value pair consists of the key
name followed by a colon, followed by the value. Blocks and key-value pairs
are separated by semicolons. The semicolon may be omitted after a block.
.PP
Several blocks can share the same definition. The block names are then
separated be commas, as in:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
H2, H4, H6 { font-style: italic }
.RE
.PD
.PP
.PP
A comment in a configuration file starts with the characters
"/*" and ends with "*/":
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
@html2ps {
.RE
.RS .5i
.PP
seq-number: 1; /* Automatic numbering of headings */
.RE
.RS .3i
.PP
}
.RE
.PD
.PP
Notations
.PP
.PP
Here are some definitions of terms used below:
.LP
.RS
.PD 0
.TP
.B Flag:
A value of either 0 (absence, inactive etc) or 1 (presence, active etc).
.TP
.B Absolute size:
A real number optionally followed by one of the following two-letter
unit identifiers: cm (centimeters), mm (millimeters), in (inches),
pt (points, 1pt = 1/72 inch), pc (picas, 1pc = 12pt). The default
unit is centimeters.
.TP
.B Relative size:
A size relative to current fontsize. The default and currently only
recognized unit is em. One em equals the size of the current font.
The value should be given as a real number, optionally followed by 'em',
as in '0.25em'.
.TP
.B Whitespace:
Any one of the characters: space, tab, newline, or carriage return.
.RE
.PD
.PP
CSS2 blocks
.PP
.PP
All blocks, except one: the @html2ps
block, coincides with a subset of the
Cascading Style Sheets, level 2 CSS2 Specification (http://www.w3.org/TR/REC-CSS2/).
The following default settings for html2ps illustrate just about everything
that currently can be used from the CSS2 specification:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
BODY {
.RE
.RS .5i
.PP
font-family: Times;
.PP
font-size: 11pt;
.PP
text-align: left;
.PP
background: white;
.RE
.RS .3i
.PP
}
.PD
.PP
.PD 0
.PP
H1, H2, H3, H4, H5, H6 {
.RE
.RS .5i
.PP
font-weight: bold;
.PP
margin-top: 0.8em;
.PP
margin-bottom: 0.5em;
.RE
.RS .3i
.PP
}
.PP
H1 { font-size: 19pt }
.PP
H2 { font-size: 17pt }
.PP
H3 { font-size: 15pt }
.PP
H4 { font-size: 13pt }
.PP
H5 { font-size: 12pt }
.PP
H6 { font-size: 11pt }
.PD
.PP
.PD 0
.PP
P, OL, UL, DL, BLOCKQUOTE, PRE {
.RE
.RS .5i
.PP
margin-top: 1em;
.PP
margin-bottom: 1em;
.RE
.RS .3i
.PP
}
.PD
.PP
.PD 0
.PP
P {
.RE
.RS .5i
.PP
line-height: 1.2em;
.PP
text-indent: 0;
.RE
.RS .3i
.PP
}
.PD
.PP
.PD 0
.PP
OL, UL, DD { margin-left: 2em }
.PD
.PP
.PD 0
.PP
TT, KBD, PRE { font-family: Courier }
.PD
.PP
.PD 0
.PP
PRE { font-size: 9pt }
.PD
.PP
.PD 0
.PP
BLOCKQUOTE {
.RE
.RS .5i
.PP
margin-left: 1em;
.PP
margin-right: 1em;
.RE
.RS .3i
.PP
}
.PD
.PP
.PD 0
.PP
ADDRESS {
.RE
.RS .5i
.PP
margin-top: 0.5em;
.PP
margin-bottom: 0.5em;
.RE
.RS .3i
.PP
}
.PD
.PP
.PD 0
.PP
TABLE {
.RE
.RS .5i
.PP
margin-top: 1.3em;
.PP
margin-bottom: 1em;
.RE
.RS .3i
.PP
}
.PD
.PP
.PD 0
.PP
DIV.noprint { display: none }
.PD
.PP
.PD 0
.PP
DEL { text-decoration: line-through }
.PD
.PP
.PD 0
.PP
A:link, HR { color: black }
.PD
.PP
.PD 0
.PP
@page {
.RE
.RS .5i
.PP
margin-left: 2.5cm;
.PP
margin-right: 2.5cm;
.PP
margin-top: 3cm;
.PP
margin-bottom: 3cm;
.RE
.RS .3i
.PP
}
.RE
.PD
.PP
.PP
The program specific block \fI@html2ps\fP:
.PP
This block is used to specify parameters that are specific to
html2ps, and not covered by CSS2. The @html2ps block has
several sub-blocks and key-value pairs, these are described in this section.
.TP
The \fIpackage\fP block
.RS .5i
This block is used to specify which program
packages are installed on the system. Typically, this is done in the
global configuration file.
.TP
.B PerlMagick
A flag specifying whether the Perl module PerlMagick is installed
or not. The default is 0.
.TP
.B ImageMagick
A flag specifying whether the ImageMagick package is installed
or not. The default is 0.
.TP
.B pbmplus
A flag specifying whether the pbmplus package is installed
or not. The default is 0.
.TP
.B netpbm
A flag specifying whether the netpbm package is installed
or not. The default is 0.
.TP
.B djpeg
A flag specifying whether djpeg is installed or not.
The default is 0.
.TP
.B Ghostscript
A flag specifying whether Ghostscript is installed or not.
The default is 0.
.TP
.B TeX
A flag specifying whether the TeX package is installed or not.
The default is 0.
.TP
.B dvips
A flag specifying whether dvips is installed or not.
The default is 0.
.TP
.B libwww-perl
A flag specifying whether the Perl module library libwww-perl
is installed or not. The default is 0.
.TP
.B geturl
When neither of the Perl packages for retrieving remote documents
are available, it is possible to use some other program like wget or
lynx. This value should be set to a command that retrieves a document
with a complete MIME header, such as "wget -s -q -O-"
or "lynx -source -mime_header".
.TP
.B check
The name of a program used for syntax checking HTML documents.
No default, a good choice is weblint.
.TP
.B path
A colon separated list of directories where the executables from
the program packages are. It is only necessary to include directories
that are not in the PATH for a typical user.
.RE
.TP
The \fIpaper\fP block
.RS .5i
The paper size is defined in this block. The size can either be
given as one of the recognized paper types or by giving explicit values for
the paper height and width. As of version 1.0 beta2, one can also use the
@page block in CSS2
for the paper size. The paper block is kept for backwards compatibility.
Also, one can only specify explicit dimensions in @page, not any paper
types by name.
.TP
.B type
Paper type, possible choices are: A0, A1, A2, A3, A4,...,A10,
B0, B1,...,B10, letter, legal, arche, archd, archc, archb, archa,
flsa, flse, halfletter, 11x17, and ledger (this set of paper types
is taken from Aladdin Ghostscript). The default is A4.
.TP
.B height
An absolute size specifying the paper height.
.TP
.B width
An absolute size specifying the paper width.
.RE
.TP
The \fIoption\fP block
.RS .5i
This block is used to set default values for the command line
options. The key in the key-value pair is the option name, in either its
long or short form.
.TP
.B twoup
Two column (2-up) output. The default is one column per page.
.TP
.B base
Use \fIURL\fP as a base to expand relative references for in-line
images. This is useful if you have downloaded a document to a local file.
The \fIURL\fP should then be the \fIURL\fP of the original document.
.TP
.B check
Check the syntax of the HTML file (using an external syntax
checker). The default is to not make a syntax check.
.TP
.B toc
Generate a table of contents (ToC). The value should be a string
consisting of one of the letters 'f', 'h', or 't', optionally combined
with the letter 'b':
.LP
.RS
.PD 0
.TP
.B b
The ToC will be printed first. This requires that Ghostscript is
installed.
.TP
.B f
The ToC will be generated from the links in the converted document.
.TP
.B h
The ToC will be generated from headings and
titles in the converted documents. Note that if the document author
for some strange reason has chosen to use some other means to represent
the headings than the HTML elements H1,...,H6, you are out of luck!
.TP
.B t
The ToC will be generated from links having the attribute
rev=TOC in the converted document.
.RE
.PD
.PP
.TP
.B debug
Generate debugging information. You should always use this
option when reporting problems with html2ps.
.TP
.B DSC
Generate DSC compliant PostScript. This requires Ghostscript and
can take quite some time to do. Note that a PostScript file generated
with this option cannot be used as input to html2ps for reformatting
later.
.TP
.B encoding
The document encoding. Currently recognized values are ISO-8859-1,
EUC-JP, SHIFT-JIS, and ISO-2022-JP (other EUC-xx encodings may also
work). The default is ISO-8859-1.
.TP
.B rcfile
A colon separated list of configuration file names to use
instead of the default personal configuration file $HOME/.html2psrc.
Definitions made in one file override definitions in previous files
(the last file in the list has highest precedence). An empty file
name (as in ':file', 'file1::file3', or 'file:') will expand to the
default personal file. The environment variable HTML2PSPATH is used
to specify the directories where to search for these files. (Note:
this is only supposed to be used on the command line, not
in a configuration file.)
.TP
.B frame
Draw a frame around the text on each page. The default is
to not draw a frame.
.TP
.B grayscale
Convert colour images to grayscale images. Note that the
PostScript file will be smaller when the images are converted to
grayscale. The default is to generate colour images.
.TP
.B help
Show usage information.
.TP
.B hyphenate
Hyphenate the text. This requires TeX
hyphenation pattern files.
.TP
.B scaleimage
Scale in-line images with a factor \fInum\fP.
The default is 1.
.TP
.B cookie
Enable cookie support, using a netscape formatted cookie
\fIfile\fP (requires libwww-perl).
.TP
.B language
Specifies the language of the document
(overrides an eventual LANG attribute of the BODY element).
The language should be given according to
RFC1766 (ftp://ftp.nordu.net/rfc/rfc1766.txt) and
ISO 639 (http://www.w3.org/WAI/ER/IG/ert/iso639.htm).
.TP
.B landscape
Generate code for printing in landscape mode. The default
is portrait mode.
.TP
.B scalemath
Scale mathematical formulas with a factor \fInum\fP.
The default is 1.
.TP
.B mainchapter
Specifies the start number for automatic numbering of headings
(by setting the seq-number parameter), the default is 1.
.TP
.B number
Insert page numbers. The default is to not number the pages.
.TP
.B startno
Specifies the starting page number, the default is 1.
.TP
.B output
Write the PostScript code to \fIfile.\fP The default is
to write to standard output.
.TP
.B original
Use PostScript original images if they exist. For example, if a
document contains an image figure.gif, and an encapsulated PostScript
file named figure.ps exists in the same directory, that file will be
use instead. This only work for documents read as local files. Note:
if the PostScript file is large or contains bitmap images, this must
be combined with the -D option. In HTML 4.0 this can be achieved in a
much better way with:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
<OBJECT data="figure.ps" type="application/postscript">
.RE
.RS .4i
.PP
<OBJECT data="figure.gif" type="image/gif">
.RE
.RS .5i
.PP
<PRE>[Maybe some ASCII art for text browsers]</PRE>
.RE
.RS .4i
.PP
</OBJECT>
.RE
.RS .3i
.PP
</OBJECT>
.RE
.PD
.PP
.TP
.B rootdir
When a document is read from a local file, this value specifies
a base directory for resolving relative links starting with "/".
Typically, this should be the directory where your web server's home
page resides.
.TP
.B xref
Insert cross references at every link to
within the set of converted documents.
.TP
.B scaledoc
Scale the entire document with a factor \fInum\fP.
The default is 1.
.TP
.B style
This option complements/overrides definitions made in the
configuration files. The \fIstring\fP must follow the configuration
file syntax. (Note: this is only supposed to be used on the
command line, not in a configuration file.)
.TP
.B titlepage
Generate a title page. The default is to not generate one.
.TP
.B text
Text mode, ignore images. The default is to include the images.
.TP
.B underline
Underline text that constitutes a hypertext link. The default
is to not underline.
.TP
.B colour
Produce colour output for text and background, when specified.
The default is black text on white background (mnemonic: coloUr ;-).
.TP
.B version
Print information about the current version of html2ps.
.TP
.B web
Process a web of documents by recursively retrieve and convert
documents that are referenced with hyperlinks. When dealing with remote
documents it will of course be necessary to impose restrictions, to
avoid downloading the entire web... The value should be a string
consisting of one of the letters 'a', 'b', 'l', 'r', or 's', optionally
combined with a combination of the letters 'p', 'L', and a positive
integer:
.LP
.RS
.PD 0
.TP
.B a
Follow all links.
.TP
.B b
Follow only links to within the same directory, or below, as the
start document.
.TP
.B l
Follow only links specified with
"<LINK rel=NEXT>" in the document.
.TP
.B p
Prompt for each remote document. This mode will automatically be
entered after the first 50 documents.
.TP
.B r
Follow only relative links.
.TP
.B s
Follow only links to within the same server as the start document.
.TP
.B L
With this option, the order in which the documents are processed will
be: first all top level documents, then the documents linked to from
these etc. For example, if the document A has links to B and C, and
B has a link to D, the order will be A-B-C-D.
By default, each document will be followed by the first document
it links to etc; so the default order for the example is
A-B-D-C.
.TP
.B #
A positive integer giving the number of recursive levels. The
default is 4 (when the option is present).
.RE
.PD
.PP
.TP
.B duplex
Generate postscript code for single or double sided printing.
No default, valid values are:
.LP
.RS
.PD 0
.TP
.B 0
Single sided.
.TP
.B 1
Double sided.
.TP
.B 2
Double sided, opposite page reversed (tumble mode).
.RE
.PD
.PP
.RE
.TP
The \fImargin\fP block
.RS .5i
This block is used to specify page margins. The left, right, top
and bottom margins, previously defined with this block, should now be
defined using the @page
construction from CSS2.
.TP
.B middle
An absolute size for the distance between the columns when
printing two columns per page, default is 2cm.
.RE
.TP
The \fIxref\fP block
.RS .5i
At every hyperlink (to within the set of converted documents)
it is possible to have a cross reference inserted. The \fIxref\fP
block is used to control this function.
.TP
.B text
This defines the cross reference text to be inserted; the symbol
$N will expand to the page number, default is "[p $N]".
.TP
.B passes
The number of passes used to insert the cross references.
Normally, only one pass is run. But since the insertion of the page
numbers may effect the page breaks, it might for large documents with
many links be necessary with more than one pass to get the cross
references right. The default is 1.
.RE
.TP
The \fIquote\fP block
.RS .5i
Language specific quotation marks are defined in this block.
These quotation marks are used with the HTML 4.01 element Q for short
quotations. Quotation marks are predefined for a few languages (English,
Swedish, Danish, Norwegian (also Nynorsk and Bokm\(oal), Finnish, Spanish,
French, German and Italian). It is possible to define different quotation
marks for quotes within quotes.
.PP
A quotation mark is defined as a string, using the same encoding as the
converted document (normally ISO-8859-1), and/or with character entities.
Note that quotation mark characters for several languages are not
included in ISO-8859-1, and their corresponding character entities were
not been defined prior to HTML 4.0.
.PP
Quotation marks for a language can be defined explicitly in a sub-block
of the quote block. One can also identify the set of quotation
marks with another previously defined language, using a key-value pair.
The sub-block/key name should equal the language code as defined in
ISO 639. The language sub-block can have the following key-values:
.LP
.RS
.PD 0
.TP
.B open
The quote opening character(s).
.TP
.B close
The quote closing character(s). If undefined, it will equal
open.
.TP
.B open2
The quote opening character(s) for quotes within quotes. If undefined,
it will equal open.
.TP
.B close2
The quote closing character(s) for quotes within quotes. If undefined,
it will equal close.
.RE
.PD
.PP
.PP
Example: English and Spanish use the same set of quotation marks -
at least according to my book on typography. These (already known to
html2ps) are defined with:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
quote {
.RE
.RS .5i
.PP
en {
.RE
.RS .7i
.PP
open: "“";
.PP
close: "”";
.PP
open2: "`";
.PP
close2: "'";
.RE
.RS .5i
.PP
}
.PP
es: en;
.RE
.RS .3i
.PP
}
.RE
.PD
.PP
.RE
.TP
The \fItoc\fP block
.RS .5i
When a table of contents (ToC) is generated from document
headings and titles, the appearance is controlled by this block.
.TP
.B heading
A string with HTML code specifying a heading used on the first
ToC page.
.TP
.B level
The maximum heading level used for building the ToC. The
default is 6, which means that all headings will generate
ToC entries.
.TP
.B indent
The ToC entries are indented proportional to the corresponding
heading level. This value specifies the size of the indentation.
The default is 1em.
.RE
.TP
The \fItitlepage\fP block
.RS .5i
When a title page is generated, its appearance is controlled by
this block.
.TP
.B content
A string with HTML code specifying a heading used on the
title page, The default is
"<DIV align=center>
<H1><BIG>$T</BIG></H1>
<H2>$[author]</H2></DIV>".
.TP
.B margin-top
The size of the top margin on the title page,
The default is 4cm.
.RE
.TP
The \fIfont\fP block
.RS .5i
Currently, html2ps recognizes the fonts: Times,
New-Century-Schoolbook, Helvetica, Helvetica-Narrow, Palatino, Avantgarde,
Bookman, and Courier. To add a new font (family), choose a name (consisting
of letters, digits, hyphens, and underscores) for the font. Then define a
sub-block to the font block, with the same name as the chosen
font name. This block can contain two key-value pairs:
.LP
.RS
.PD 0
.TP
.B names
A string containing four PostScript font names, separated by
whitespace, corresponding to the font styles normal, italic, bold, and
bold-italic. If less than four names are given, the first is used for
the missing names. Note that PostScript font names are case sensitive.
.TP
.B files
A string of four file names, separated by whitespace, for files
containing font definitions for the four font styles as specified above.
.RE
.PD
.PP
.PP
Example: A font 'myfont' has its four font styles defined in local files.
To use this font in all tables in the converted documents, one can use
something like:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
TABLE { font-family: myfont }
.PD
.PP
.PD 0
.PP
@html2ps {
.RE
.RS .5i
.PP
font {
.RE
.RS .7i
.PP
myfont {
.RE
.RS .9i
.PP
names: "MyFont-Roman MyFont-Italic MyFont-Bold MyFont-BoldItalic";
.PP
files: "/x/y/myfr.pfa /x/y/myfi.pfa /x/y/myfb.pfa /x/y/myfbi.pfa";
.RE
.RS .7i
.PP
}
.RE
.RS .5i
.PP
}
.RE
.RS .3i
.PP
}
.RE
.PD
.PP
.RE
.TP
The \fIhyphenation\fP block
.RS .5i
Hyphenation pattern files for different languages are specified
in sub-blocks within this block. The blocks names should equal the
language code as defined in ISO 639. These language blocks can contain
the following two key-values:
.LP
.RS
.PD 0
.TP
.B file
A hyphenation pattern file in TeX format for this language.
.TP
.B extfile
A file containing a list of hyphenation exceptions for this language.
The exception file should contain words, separated by whitespaces, with
hyphens inserted where hyphenation is allowed, as in:
"in-fra-struc-ture white-space".
.RE
.PD
.PP
.PP
For example, for English (with language code 'en') one can have a block
like:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .7i
.PP
en {
.RE
.RS .9i
.PP
file: "/opt/tex/lib/macros/hyphen.tex";
.PP
extfile: "/opt/tdb/lib/html2ps/enhyphext";
.RE
.RS .7i
.PP
}
.RE
.PD
.PP
.PP
The hyphenation block itself can furthermore have these
key-values:
.TP
.B min
A positive integer defining the minimum number of letters a word
must contain to make it a candidate for hyphenation.
The default is 8.
.TP
.B start
A positive integer defining the minimum number of letters that
must precede the hyphen when a word is hyphenated.
The default is 4.
.TP
.B end
A positive integer defining the minimum number of letters that
must follow the hyphen when a word is hyphenated.
The default is 3.
.RE
.TP
The \fIheader\fP block
.RS .5i
This block is used to specify page headers. It is possible to
define left, center, and right headers. Different headers for odd and even
pages can be specified. Some symbols can be used that will expand to
document title, author, date etc. See below.
.TP
.B left
A left aligned header. If the alternate flag in this
block is set to 1, this will be the right header on even pages.
.TP
.B center
A centered header.
.TP
.B right
A right aligned header. If the alternate flag in this
block is set to 1, this will be the left header on even pages.
.TP
.B odd-left
A left aligned header on odd pages.
.TP
.B odd-center
A centered header on odd pages.
.TP
.B odd-right
A right aligned header on odd pages.
.TP
.B even-left
A left aligned header on even pages.
.TP
.B even-center
A centered header on even pages.
.TP
.B even-right
A right aligned header on even pages.
.TP
.B font-family
The font used for the header, default is Helvetica.
.TP
.B font-size
The font size for the header, default is 8pt.
.TP
.B font-style
The default is "normal".
.TP
.B font-weight
The default is "normal".
.TP
.B color
The header color, default is black.
.TP
.B alternate
A flag indicating whether the headers given by the
left and right keys should change place on
even pages. Typically used for double sided printing.
The default is 1.
.RE
.TP
The \fIfooter\fP block
.RS .5i
This block is used to specify page footers. It is possible to
define left, center, and right footers. Different footers for odd and even
pages can be specified. Some symbols can be used that will expand to
document title, author, date etc. See below.
.TP
.B left
A left aligned footer. If the alternate flag in
this block is set to 1, this will be the right footer on even pages.
.TP
.B center
A centered footer.
.TP
.B right
A right aligned footer. If the alternate flag in
this block is set to 1, this will be the left footer on even pages.
.TP
.B odd-left
A left aligned footer on odd pages.
.TP
.B odd-center
A centered footer on odd pages.
.TP
.B odd-right
A right aligned footer on odd pages.
.TP
.B even-left
A left aligned footer on even pages.
.TP
.B even-center
A centered footer on even pages.
.TP
.B even-right
A right aligned footer on even pages.
.TP
.B font-family
The font used for the footer, default is Helvetica.
.TP
.B font-size
The font size for the footer, default is 8pt.
.TP
.B font-style
The default is "normal".
.TP
.B font-weight
The default is "normal".
.TP
.B color
The footer color, default is black.
.TP
.B alternate
A flag indicating whether the footers given by the
left and right keys should change place on
even pages. Typically used for double sided printing.
The default is 1.
.RE
.TP
The \fIframe\fP block
.RS .5i
The appearance of the optional frame (drawn on each page) is
controlled by this block.
.TP
.B width
The width of the frame, default is 0.6pt.
.TP
.B margin
The size of the frame margin, default is 0.5cm.
.TP
.B color
The colour of the frame, default is black.
.RE
.TP
The \fIjustify\fP block
.RS .5i
This block specifies the maximum amount of extra space inserted
between words and letters when text justification is in effect.
.TP
.B word
Maximum amount of extra space inserted between words.
The default is 15pt.
.TP
.B letter
Maximum amount of extra space inserted between letters
within words. The default is 0pt.
.RE
.TP
The \fIdraft\fP block
.RS .5i
It is possible to have some text written in a large font diagonally
across each page. Typically this is a word, written in a very light colour,
indicating that the document is a draft.
.TP
.B text
The text to be printed, default is "DRAFT".
.TP
.B print
A flag specifying whether the draft text should be printed or not.
If unspecified, the draft text is printed when the document head contains
<META name="Status" content="Draft">.
.TP
.B dir
Specifies print direction, 0=downwards, 1=upwards.
.TP
.B font-family
The default is Helvetica.
.TP
.B font-style
The default is "normal".
.TP
.B font-weight
The default is "bold".
.TP
.B color
The default is "F0F0F0".
.RE
.TP
The \fIcolour\fP block
.RS .5i
The 16 standard colour names from HTML 4.01 (although their
use in HTML elements are now deprecated) are recognized by html2ps.
Use this block to extend this list of colours. This is done with
key-value pairs, where the key is the colour name, and the value is
the colour given as a hexadecimal RGB value, for example: "brown:
A52A2A;".
.RE
.B Key-value pairs in the @html2ps block
.TP
.B html2psrc
The name of the default personal configuration file.
The default is $HOME/.html2psrc.
.TP
.B imgalt
Specifies which text should be written as a replacement
for in-line images when the IMG element has no ALT attribute.
The default is "[IMAGE]".
.TP
.B datefmt
The symbol $D can be used in page headers and footers to insert the
current date/time; the value of the datefmt key specifies the
format used. The syntax is the same as in the strftime(3) routine. The
default is "%e %b %Y %R", which gives a date
string like " 7 May 2010 13:22".
.TP
.B locale
The locale (language code) used for formating language dependent
parts of the date/time in datefmt. If unspecified, the value
is taken from environment variables, see setlocale(3). No default.
.TP
.B doc-sep
A string of HTML code that will be inserted between the
documents when more than one are converted. The default is
"<!--NewPage-->", which will cause
a page break. You may use (almost) any HTML code, for example
"<HR><HR>" or
"<IMG src=...>".
.TP
.B ball-radius
The radius, given as a relative size, of the balls used in
unordered lists. The default is 0.25em.
.TP
.B numbstyle
Page numbering style, 0=arabic, 1=roman. The default is 0.
.TP
.B showurl
When this flag is set to 1, the URL for external links are shown
within parentheses after the link. The default is 0.
.TP
.B seq-number
When this flag is set, the headings in the document will be
sequentially numbered: H1 headings will be numbered 1, 2,..., H2 headings
1.1, 1.2, etc. The starting number for H1 can be changed using the -M
(--mainchapter) option. The default is 0.
.TP
.B extrapage
A flag specifying whether an extra (empty) page should be printed,
when necessary, to ensure that the title page, the table of contents, and
the document itself will start on odd pages. This is typically
desirable for double sided printing. The default is 1.
.TP
.B break-table
A flag specifying if a table should be broken across two pages
when it does not fit on the current page, but it does on a page of its own.
The default is 0 (avoid breaking tables when possible).
.TP
.B forms
This flag is used to specify whether FORM elements in the document
should be processed or ignored. Some forms may be suitable for printing out
and be filled out (with a pen), others are not. The default is 1.
.TP
.B textarea-data
When a TEXTAREA element contains prefilled data, the text will be
used as labels if this flag is set, otherwise ignored. The default is
0.
.TP
.B page-break
Set this flag to 0 to suppress the normal behavior of generating
page breaks from the comment <!--NewPage--> etc, as
specified below. The default is 1.
.TP
.B expand-acronyms
A flag specifying whether acronyms, given by the ACRONYM element,
should be expanded or not. The default is 0.
.TP
.B spoof
Some web servers return different documents depending on which user
agent is used to retrieve the document. You can fool the web server that
a certain browser is used, by setting this value to the identification
used by the browser, such as "Mozilla/4.0". This only works if you are
using one of the Perl packages to retrieve remote documents.
.TP
.B ssi
When this flag is set, some Server Side Includes will be processed
when the document is read from a local file. Examples are
<!--#include file=...>,
<!--#echo var="LAST_MODIFIED">,
<!--#config timefmt=...>. The default is 0.
.TP
.B prefilled
This flag controls whether the content of form elements should be
rendered or not. That is, when this flag is set, the content of TEXTAREA
elements, and the value of the value attribute of text INPUT elements will
be shown. Also, checked radio buttons and checkboxes will be marked.
The default is 0.
.RE
.SH SYMBOLS
.PP
The following symbols can be used on the title page, the page headers/footers,
and in the heading for the table of contents:
.PP
Symbols of the form "$[\fIname\fP]"
will expand to the value of the content attribute of
META elements, having either of the attributes
"name=\fIname\fP" or
"http-equiv=\fIname\fP" (case insensitive string matching).
For example, when a document containing:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
<META name="expires" content="31 Dec 2011">
.RE
.PD
.PP
.PP
is converted, using a configuration file with:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
footer { left: "Expires: $[expires]" }
.RE
.PD
.PP
.PP
this left footer will be inserted:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
Expires: 31 Dec 2011
.RE
.PD
.PP
.PP
In addition, these symbols are defined:
.LP
.RS
.PD 0
.TP
.B $T
Current document title.
.TP
.B $A
Author of current document, as specified with <META name="Author"
content="..."> in the document head.
.TP
.B $U
The URL, or file name, of current document.
.TP
.B $N
Page number.
.TP
.B $H
Current document heading (level 1-3).
.TP
.B $D
Current date/time. The format is given by the datefmt key.
.RE
.PD
.PP
.PP
So $A is equivalent to $[author], but kept for
backwards compatibility.
.PP
To avoid symbol expansion, precede the dollar sign with a backslash,
as in "\\$T".
.SH HINTS
.PP
I imagine that a typical use of configuration files can be something
along the following lines.
.PP
System specific definitions (e.g. specification of available program packages)
and global defaults (paper type etc) are defined in the global configuration
file.
.PP
If there is more than one user of the program on the system, each user can
also have a personal configuration file with his/hers own personal preferences.
(On a single user system one can use the global configuration file for this
purpose as well.)
.PP
One may also develop a collection of configuration files for typical
situations. These files are placed in a directory that is searched by html2ps
(the search path is defined with the environment variable HTML2PSPATH).
For example, to print a document as slides - in landscape mode, with
large text in Helvetica, and a thick frame - one can create a
configuration file, called 'slides' say, containing:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
@html2ps {
.RE
.RS .5i
.PP
option {
.RE
.RS .7i
.PP
landscape: 1;
.PP
frame: 1;
.RE
.RS .5i
.PP
}
.PP
frame { width: 3pt }
.RE
.RS .3i
.PP
}
.PP
BODY {
.RE
.RS .5i
.PP
font-family: Helvetica;
.PP
font-size: 20pt;
.RE
.RS .3i
.PP
}
.PP
H1 { font-size: 35pt }
.PP
H2 { font-size: 32pt }
.PP
H3 { font-size: 29pt }
.PP
H4 { font-size: 26pt }
.PP
H5 { font-size: 23pt }
.PP
H6 { font-size: 20pt }
.PP
PRE { font-size: 18pt }
.RE
.PD
.PP
.PP
Then use the command:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
html2ps -f slides ...
.RE
.PD
.PP
.PP
to convert the document. Note that with this command the file 'slides' is used
instead of the personal configuration file. If you want both to
be used, giving precedence to definitions made in the file 'slides', use
the command:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
html2ps -f :slides ...
.RE
.PD
.PP
.PP
(The page breaks between the slides can for example be generated by
adding '<HR class=PAGE-BREAK>' to the HTML document.)
.PP
For features that are frequently turned on and off, and that cannot be
controlled by command line options, it may be a good idea to create small
configuration files as "building blocks". For example a file 'A4' for
printing on A4 paper (if you have some other default paper type):
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
@html2ps { paper { type: A4 } }
.RE
.PD
.PP
.PP
and a file 'hnum' for automatic numbering of headings:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
@html2ps { seq-number: 1 }
.RE
.PD
.PP
.PP
Combining this with the previous example: to convert a document for printing
on A4 sized slides with all headings numbered, use the command:
.RS
.RE
.RS .0i
.PD
.PP
.PD 0
.RE
.RS .3i
.PP
html2ps -f :slides:A4:hnum ...
.RE
.PD
.PP
.SH SEE ALSO
html2ps(1), setlocale(3), strftime(3)
.SH VERSION
This manpage describes html2ps version 1.0 beta7.
.SH AVAILABILITY
http://user.it.uu.se/~jan/html2ps.html
.SH AUTHOR
Jan Karrman (jan@it.uu.se)
|