html2psrc(5)
๐ html2psrc โ the configuration file format for html2ps(1) ๐
okay bestie, sit down, grab a boba, because this is the manual page for html2psrc(5) and it's lowkey a whole vibe. this is the tea on how you configure html2ps. let's get into it ๐ซถ
โจ NAME โจ
html2psrc โ configuration file format for html2ps(1)
๐ธ DESCRIPTION ๐ธ
so basically, config files are where you control layout, resource info, all that good stuff. and normally? there should always be a global config file chillin' somewhere. in this file you typically say things like: which image conversion packages are available on your system, what the default paper size is, the default text fonts and sizes, etc. the whole setup, you know? ๐
on Unix and Windows systems, the installation script install can be used to automatically build a global config file with all the necessary definitions, and install all the files. and get this โ the files that get replaced by the installation are saved. so if you're for some reason not satisfied with the new version (no judgement), just execute the script backout to reinstall your earlier version. iconic, honestly. ๐
on other systems, you're gonna have to manually create a global config file, and insert the name of this file into the html2ps script (close to the beginning, the line starting with "$globrc="). the config file should contain a package block, and perhaps paper and hyphenation blocks, described below. โจ
each user can then have a personal config file (by default $HOME/.html2psrc) that complements/overrides the definitions made in the global file. it's also possible to specify alternative files on the command line, using the -f option. slay. ๐
๐ FILE FORMAT ๐
a config file can include other config files. this is done with:
@import "filename";
the rest of the config file consists of zero or more blocks. a block is given by a block name, followed by the block definition, like:
BODY {
font-size: 12pt;
font-family: Helvetica;
text-align: justify
}
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. (yes, it's giving optional. main character energy. ๐)
several blocks can share the same definition. the block names are then separated by commas, like:
H2, H4, H6 { font-style: italic }
a comment in a config file starts with the characters "/*" and ends with "*/":
@html2ps {
seq-number: 1; /* Automatic numbering of headings */
}
๐ Notations ๐
here are some definitions of terms used below, bestie:
- Flag: a value of either
0(absence, inactive etc) or1(presence, active etc). - 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. - Relative size: a size relative to current fontsize. the default and currently only recognized unit is
em. oneemequals the size of the current font. the value should be given as a real number, optionally followed by'em', as in'0.25em'. - Whitespace: any one of the characters: space, tab, newline, or carriage return.
๐ CSS2 blocks ๐
all blocks, except one โ the @html2ps block โ coincide 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:
BODY {
font-family: Times;
font-size: 11pt;
text-align: left;
background: white;
}
H1, H2, H3, H4, H5, H6 {
font-weight: bold;
margin-top: 0.8em;
margin-bottom: 0.5em;
}
H1 { font-size: 19pt }
H2 { font-size: 17pt }
H3 { font-size: 15pt }
H4 { font-size: 13pt }
H5 { font-size: 12pt }
H6 { font-size: 11pt }
P, OL, UL, DL, BLOCKQUOTE, PRE {
margin-top: 1em;
margin-bottom: 1em;
}
P {
line-height: 1.2em;
text-indent: 0;
}
OL, UL, DD { margin-left: 2em }
TT, KBD, PRE { font-family: Courier }
PRE { font-size: 9pt }
BLOCKQUOTE {
margin-left: 1em;
margin-right: 1em;
}
ADDRESS {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
TABLE {
margin-top: 1.3em;
margin-bottom: 1em;
}
DIV.noprint { display: none }
DEL { text-decoration: line-through }
A:link, HR { color: black }
@page {
margin-left: 2.5cm;
margin-right: 2.5cm;
margin-top: 3cm;
margin-bottom: 3cm;
}
๐ซ The program specific block @html2ps ๐ซ
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, and these are described in this section. okay let's go ๐ง
๐ฆ The package block ๐ฆ
this block is used to specify which program packages are installed on the system. typically, this is done in the global config file.
PerlMagickโ a flag specifying whether the Perl module PerlMagick is installed or not. the default is0.ImageMagickโ a flag specifying whether the ImageMagick package is installed or not. the default is0.pbmplusโ a flag specifying whether the pbmplus package is installed or not. the default is0.netpbmโ a flag specifying whether the netpbm package is installed or not. the default is0.djpegโ a flag specifying whether djpeg is installed or not. the default is0.Ghostscriptโ a flag specifying whether Ghostscript is installed or not. the default is0.TeXโ a flag specifying whether the TeX package is installed or not. the default is0.dvipsโ a flag specifying whether dvips is installed or not. the default is0.libwww-perlโ a flag specifying whether the Perl module library libwww-perl is installed or not. the default is0.geturlโ when neither of the Perl packages for retrieving remote documents are available, it is possible to use some other program likewgetorlynx. 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".checkโ the name of a program used for syntax checking HTML documents. no default, a good choice isweblint.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 thePATHfor a typical user.
๐ The paper block ๐
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.
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, andledger(this set of paper types is taken from Aladdin Ghostscript). the default isA4.heightโ an absolute size specifying the paper height.widthโ an absolute size specifying the paper width.
โ๏ธ The option block โ๏ธ
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.
twoupโ two column (2-up) output. the default is one column per page.baseโ use URL 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 URL should then be the URL of the original document.checkโ check the syntax of the HTML file (using an external syntax checker). the default is to not make a syntax check.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':bโ the ToC will be printed first. this requires that Ghostscript is installed.fโ the ToC will be generated from the links in the converted document.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 elementsH1,...,H6, you are out of luck!tโ the ToC will be generated from links having the attributerev=TOCin the converted document.
debugโ generate debugging information. you should always use this option when reporting problems with html2ps.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.encodingโ the document encoding. currently recognized values areISO-8859-1,EUC-JP,SHIFT-JIS, andISO-2022-JP(otherEUC-xxencodings may also work). the default isISO-8859-1.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 variableHTML2PSPATHis 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.)frameโ draws a frame around the text on every page ๐ผ๏ธ. The default is not to draw a frame, so you're opting in, bestie.grayscaleโ converts colour images into grayscale ones. Heads up though: your PostScript file gets smaller when images go grayscale, which is lowkey a glow-up and a diet at the same time. The default is to generate colour images ๐.helpโ shows usage information. It's giving "ask the manual, she knows" ๐ .hyphenateโ hyphenates the text. This one requires TeX hyphenation pattern files, so it's not just vibes, it needs actual files ๐.scaleimageโ scales in-line images by a factor num. The default is1.cookieโ enables cookie support, using a netscape formatted cookie file (requireslibwww-perl) ๐ช.languageโ specifies the language of the document (it overrides an eventualLANGattribute of theBODYelement). 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) ๐.landscapeโ generates code for printing in landscape mode. The default is portrait mode, so this is you choosing to lay it all the way out ๐.scalemathโ scales mathematical formulas by a factor num. The default is1โ.mainchapterโ specifies the start number for automatic numbering of headings (by setting theseq-numberparameter). The default is1๐ข.numberโ inserts page numbers. The default is to not number the pages, so flip the switch if you want them counted.startnoโ specifies the starting page number. The default is1.outputโ writes the PostScript code to file. The default is to write to standard output ๐พ.originalโ uses PostScript original images if they exist. For example, if a document contains an imagefigure.gif, and an encapsulated PostScript file namedfigure.psexists in the same directory, that file will be used instead โจ. This only works for documents read as local files. Note: if the PostScript file is large or contains bitmap images, this must be combined with the-Doption. In HTML 4.0 this can be achieved in a much better way with:
<OBJECT data="figure.ps" type="application/postscript">
<OBJECT data="figure.gif" type="image/gif">
<PRE>[Maybe some ASCII art for text browsers]</PRE>
</OBJECT>
</OBJECT>
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 ๐.xrefโ inserts cross references at every link to within the set of converted documents ๐.scaledocโ scales the entire document by a factor num. The default is1.styleโ this option complements/overrides definitions made in the configuration files. The string must follow the configuration file syntax. (Note: this is only supposed to be used on the command line, not in a configuration file.) ๐titlepageโ generates a title page. The default is to not generate one.textโ text mode, ignore images. The default is to include the images ๐ซ๐ผ๏ธ.underlineโ underlines text that constitutes a hypertext link. The default is to not underline.colourโ produces colour output for text and background, when specified. The default is black text on white background (mnemonic: coloUr ;-) ๐จ.versionโ prints information about the current version ofhtml2psโญ.webโ processes a web of documents by recursively retrieving and converting 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:aโ follow all links.bโ follow only links to within the same directory, or below, as the start document.lโ follow only links specified with"<LINK rel=NEXT>"in the document.pโ prompt for each remote document. This mode will automatically be entered after the first 50 documents.rโ follow only relative links.sโ follow only links to within the same server as the start document.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.#โ a positive integer giving the number of recursive levels. The default is4(when the option is present).
duplexโ generates postscript code for single or double sided printing. No default, valid values are:0โ single sided.1โ double sided.2โ double sided, opposite page reversed (tumble mode).
๐ธ The margin block ๐ธ
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. (Yes bestie, they moved. We don't make the rules ๐.)
middleโ an absolute size for the distance between the columns when printing two columns per page, default is2cm.
๐ซ The xref block ๐ซ
At every hyperlink (to within the set of converted documents) it is possible to have a cross reference inserted. The xref block is used to control this function.
textโ this defines the cross reference text to be inserted; the symbol$Nwill expand to the page number, default is"[p $N]".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 is1.
๐ The quote block ๐
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รฅl), Finnish, Spanish, French, German and Italian). It is possible to define different quotation marks for quotes within quotes.
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. (Iconic messy era tbh ๐.)
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:
openโ the quote opening character(s).closeโ the quote closing character(s). If undefined, it will equalopen.open2โ the quote opening character(s) for quotes within quotes. If undefined, it will equalopen.close2โ the quote closing character(s) for quotes within quotes. If undefined, it will equalclose.
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:
quote {
en {
open: "“";
close: "”";
open2: "`";
close2: "'";
}
es: en;
}
๐ The toc block ๐
When a table of contents (ToC) is generated from document headings and titles, the appearance is controlled by this block.
headingโ a string with HTML code specifying a heading used on the first ToC page.levelโ the maximum heading level used for building the ToC. The default is6, which means that all headings will generate ToC entries.indentโ the ToC entries are indented proportional to the corresponding heading level. This value specifies the size of the indentation. The default is1em.
๐ The titlepage block ๐
When a title page is generated, its appearance is controlled by this block.
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>".margin-topโ the size of the top margin on the title page. The default is4cm.
๐ฆ The font block ๐ฆ
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:
namesโ bestie, this is a string of four PostScript font names, separated by whitespace, matching the font styles normal, italic, bold, and bold-italic. If you give fewer than four names, the first one is used for the missing ones. ๐ And no cap: PostScript font names are case sensitive, so don't play.filesโ a string of four file names, separated by whitespace, for files containing font definitions for those four font styles as specified above. ๐
Example time, bestie! Say 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:
TABLE { font-family: myfont }
@html2ps {
font {
myfont {
names: "MyFont-Roman MyFont-Italic MyFont-Bold MyFont-
BoldItalic";
files: "/x/y/myfr.pfa /x/y/myfi.pfa /x/y/myfb.pfa
/x/y/myfbi.pfa";
}
}
}
โจ The hyphenation block โจ
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:
fileโ a hyphenation pattern file in TeX format for this language. ๐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". ๐ฆ
For example, for English (with language code 'en') one can have a block like:
en {
file: "/opt/tex/lib/macros/hyphen.tex";
extfile: "/opt/tdb/lib/html2ps/enhyphext";
}
The hyphenation block itself can furthermore have these key-values:
minโ a positive integer defining the minimum number of letters a word must contain to make it a candidate for hyphenation. The default is8. ๐ขstartโ a positive integer defining the minimum number of letters that must precede the hyphen when a word is hyphenated. The default is4. โจendโ a positive integer defining the minimum number of letters that must follow the hyphen when a word is hyphenated. The default is3. ๐
โจ The header block โจ
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.
leftโ a left aligned header. If thealternateflag in this block is set to1, this will be the right header on even pages. โฌ ๏ธcenterโ a centered header. โ๏ธrightโ a right aligned header. If thealternateflag in this block is set to1, this will be the left header on even pages. โก๏ธodd-leftโ a left aligned header on odd pages. 1๏ธโฃodd-centerโ a centered header on odd pages. 1๏ธโฃodd-rightโ a right aligned header on odd pages. 1๏ธโฃeven-leftโ a left aligned header on even pages. 2๏ธโฃeven-centerโ a centered header on even pages. 2๏ธโฃeven-rightโ a right aligned header on even pages. 2๏ธโฃfont-familyโ the font used for the header, default isHelvetica. ๐๏ธfont-sizeโ the font size for the header, default is8pt. ๐font-styleโ the default is"normal". โจfont-weightโ the default is"normal". โจcolorโ the header color, default isblack. ๐คalternateโ a flag indicating whether the headers given by theleftandrightkeys should change place on even pages. Typically used for double sided printing. The default is1. ๐
โจ The footer block โจ
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.
leftโ a left aligned footer. If thealternateflag in this block is set to1, this will be the right footer on even pages. โฌ ๏ธcenterโ a centered footer. โ๏ธrightโ a right aligned footer. If thealternateflag in this block is set to1, this will be the left footer on even pages. โก๏ธodd-leftโ a left aligned footer on odd pages. 1๏ธโฃodd-centerโ a centered footer on odd pages. 1๏ธโฃodd-rightโ a right aligned footer on odd pages. 1๏ธโฃeven-leftโ a left aligned footer on even pages. 2๏ธโฃeven-centerโ a centered footer on even pages. 2๏ธโฃeven-rightโ a right aligned footer on even pages. 2๏ธโฃfont-familyโ the font used for the footer, default isHelvetica. ๐๏ธfont-sizeโ the font size for the footer, default is8pt. ๐font-styleโ the default is"normal". โจfont-weightโ the default is"normal". โจcolorโ the footer color, default isblack. ๐คalternateโ a flag indicating whether the footers given by theleftandrightkeys should change place on even pages. Typically used for double sided printing. The default is1. ๐
โจ The frame block โจ
The appearance of the optional frame (drawn on each page) is controlled by this block.
widthโ the width of the frame, default is0.6pt. ๐marginโ the size of the frame margin, default is0.5cm. ๐colorโ the colour of the frame, default isblack. ๐ค
โจ The justify block โจ
This block specifies the maximum amount of extra space inserted between words and letters when text justification is in effect.
wordโ maximum amount of extra space inserted between words. The default is15pt. ๐letterโ maximum amount of extra space inserted between letters within words. The default is0pt. โจ
โจ The draft block โจ
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.
textโ the text to be printed, default is"DRAFT". ๐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">. ๐จ๏ธdirโ specifies print direction,0=downwards,1=upwards. โฌ๏ธโฌ๏ธfont-familyโ the default isHelvetica. ๐๏ธfont-styleโ the default is"normal". โจfont-weightโ the default is"bold". ๐ชcolorโ the default is"F0F0F0". ๐จ
โจ The colour block โจ
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;". ๐
โจ Key-value pairs in the @html2ps block โจ
html2psrcโ the name of the default personal configuration file. The default is$HOME/.html2psrc. ๐imgaltโ specifies which text should be written as a replacement for in-line images when theIMGelement has noALTattribute. The default is"[IMAGE]". ๐ผ๏ธdatefmtโ the symbol$Dcan be used in page headers and footers to insert the current date/time; the value of thedatefmtkey specifies the format used. The syntax is the same as in thestrftime(3)routine. The default is"%e %b %Y %R", which gives a date string like" 7 May 2010 13:22". ๐localeโ the locale (language code) used for formating language dependent parts of the date/time indatefmt. If unspecified, the value is taken from environment variables, seesetlocale(3). No default. ๐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=...>". โ๏ธball-radiusโ the radius, given as a relative size, of the balls used in unordered lists. The default is0.25em. ๐ดnumbstyleโ page numbering style,0=arabic,1=roman. The default is0. ๐ขshowurlโ when this flag is set to1, the URL for external links are shown within parentheses after the link. The default is0. ๐seq-numberโ when this flag is set, the headings in the document will be sequentially numbered:H1headings will be numbered1,2,...,H2headings1.1,1.2, etc. The starting number forH1can be changed using the-M(--mainchapter) option. The default is0. ๐ข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 is1. ๐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 is0(avoid breaking tables when possible). ๐formsโ this flag is used to specify whetherFORMelements 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 is1. ๐textarea-dataโ when aTEXTAREAelement contains prefilled data, the text will be used as labels if this flag is set, otherwise ignored. The default is0. ๐page-breakโ set this flag to0to suppress the normal behavior of generating page breaks from the comment<!--NewPage-->etc, as specified below. The default is1. ๐expand-acronymsโ a lil flag that says whether acronyms (the ones coming from theACRONYMelement) get expanded or not. Default?0. ๐ โ๏ธspoofโ okay so some web servers are messy and hand you a different document depending on which user agent asked for it. If you wanna fool the server into thinking you're some specific browser, set this to that browser's identification, like"Mozilla/4.0". Heads up though: this only works if you're using one of the Perl packages to retrieve remote documents. ๐ssiโ when this flag is set, some Server Side Includes get processed while the document is being read from a local file. Examples:<!--#include file=...>,<!--#echo var="LAST_MODIFIED">,<!--#config timefmt=...>. Default is0. โจprefilledโ this flag decides whether the content of form elements gets rendered or not. So when it's on, the content ofTEXTAREAelements and the value of thevalueattribute of textINPUTelements will be shown, and checked radio buttons and checkboxes get marked too. Default is0. ๐
๐ฎ SYMBOLS ๐ฎ
These symbols are usable on the title page, the page headers/footers, and in the heading for the table of contents. Slay. ๐
Symbols shaped like "$[name]" expand to the value of the content attribute of META elements that have either of the attributes "name=name" or "http-equiv=name" โ and yes, that's case insensitive string matching. So for example, when a document containing:
<META name="expires" content="31 Dec 2011">
gets converted using a configuration file with:
footer { left: "Expires: $[expires]" }
this left footer gets inserted:
Expires: 31 Dec 2011
And on top of that, these symbols are also defined:
$Tโ current document title. ๐$Aโ author of the current document, as specified with<META name="Author" content="...">in the document head.$Uโ the URL, or file name, of the current document.$Nโ page number.$Hโ current document heading (level 1-3).$Dโ current date/time. The format is given by thedatefmtkey.
So $A is equivalent to $[author], but it's kept around for backwards compatibility. ๐ซถ
Wanna stop a symbol from expanding? Just put a backslash before the dollar sign, like "\$T". Iconic escape behaviour, no cap. ๐
๐ก HINTS ๐ก
Okay so picture this: a typical use of configuration files probably looks something like this. ๐
System specific definitions (like specifying which program packages are available) and global defaults (paper type, etc.) get defined in the global configuration file.
If more than one person uses the program on the system, each user can also have a personal configuration file with their own personal preferences. (On a single user system, you can just use the global configuration file for this purpose too. ๐ซถ)
You can also build a whole collection of configuration files for typical situations. Those files live in a directory that html2ps searches โ and that search path is defined with the environment variable HTML2PSPATH. For example, to print a document as slides โ landscape mode, big Helvetica text, thick frame โ you could make a configuration file called 'slides' say, containing:
@html2ps {
option {
landscape: 1;
frame: 1;
}
frame { width: 3pt }
}
BODY {
font-family: Helvetica;
font-size: 20pt;
}
H1 { font-size: 35pt }
H2 { font-size: 32pt }
H3 { font-size: 29pt }
H4 { font-size: 26pt }
H5 { font-size: 23pt }
H6 { font-size: 20pt }
PRE { font-size: 18pt }
Then use the command:
html2ps -f slides ...
to convert the document. But watch out bestie โ with this command, the file 'slides' is used instead of the personal configuration file. If you want both to be used, giving precedence to the definitions made in the file 'slides', use:
html2ps -f :slides ...
(The page breaks between the slides can, for example, be generated by adding '<HR class=PAGE-BREAK>' to the HTML document. โจ)
Now, for features that get turned on and off a lot โ ones that can't be controlled by command line options โ it might be a great idea to make lil tiny configuration files as "building blocks". For example a file 'A4' for printing on A4 paper (if you've got some other default paper type):
@html2ps { paper { type: A4 } }
and a file 'hnum' for automatic numbering of headings:
@html2ps { seq-number: 1 }
Combining this with the previous example โ to convert a document for printing on A4 sized slides with all headings numbered โ you'd use:
html2ps -f :slides:A4:hnum ...
Compositional config files? We love to see it. ๐ฆ
๐ SEE ALSO ๐
html2ps(1), setlocale(3), strftime(3)
๐ท๏ธ VERSION ๐ท๏ธ
This manpage describes html2ps version 1.0 beta7.
๐ AVAILABILITY ๐
http://user.it.uu.se/~jan/html2ps.html
๐ AUTHOR ๐
Jan Karrman (jan@it.uu.se)
That's the whole page, bestie, we ate and left no crumbs. ๐
Shoutout to the autogenerated footer: it says html2psrc(5), dated 7 May 2010. Periodt. ๐โจ๐
๐ฆ where this page comes from
- debian bookworm: html2ps 1.0b7-6 ยท GPL-2.0-or-later
- debian trixie: html2ps 1.0b7-6 ยท GPL-2.0-or-later
- epel 9: html2ps 1.0-0.53.b7.el9 ยท GPL-2.0-or-later
- fedora 43: html2ps 1.0-0.57.b7.fc43 ยท GPL-2.0-or-later
- fedora 44: html2ps 1.0-0.58.b7.fc44 ยท GPL-2.0-or-later
- ubuntu jammy: html2ps 1.0b7-5 ยท GPL-2.0-or-later
- ubuntu noble: html2ps 1.0b7-6 ยท GPL-2.0-or-later
- ubuntu questing: html2ps 1.0b7-6
- ubuntu resolute: html2ps 1.0b7-7 ยท GPL-2.0-or-later
- ubuntu stonking: html2ps 1.0b7-7 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms