home *** CD-ROM | disk | FTP | other *** search
- ==============================================================================
- dvisprep 0.2c 11-Jun-1994
- ==============================================================================
-
-
- Table of Contents
- =================
-
- 1 Introduction
- 2 Running dvisprep
- 3 Parameter files
- 3.1 Lists
- 3.2 Numbers
- 3.3 Symbols
- 3.4 Comments
- 3.5 Types of lists
- 3.6 Syntax and semantics for the different types of lists
- 3.7 Predefined table names
- 3.8 Predefined symbols
- 4 How dvispell works
- 5 Supplementing plain.dsi
- 5.1 Hints
-
-
- 1 Introduction
- ==============
-
- dvisprep compiles a dvispell parameter file into binary format, to be
- used by dvispell.
-
-
- 2 Running dvisprep
- ==================
-
- dvisprep [-q] <txt_file> [<bin_file>]
-
- <txt_file> is the input file. There is no default extension. If you
- type `-' for <txt_file>, input is read from standard input. In this
- case, <bin_file> must be specified.
-
- <bin_file> is the binary output file. If <bin_file> is not specified,
- the name of <txt_file> is used, with the extension replaced by `.dsb'.
-
- The -q option disables the logo.
-
- There are no default directories. It is recommended to put dvispell
- parameter files (in both text and binary formats) into directory
- \emtex\data.
-
-
- 3 Parameter files
- =================
-
-
- 3.1 Lists
- ---------
-
- LISP notation is used for declaring tables. The first element of a
- list is the list type. For some table types, the second element of a
- list is the table name.
-
- A list consists of a left parenthesis, the elements (which must be
- separated by blanks or new line characters) and a right parenthesis.
- The elements can be numbers, symbols or lists. Here is an example of
- a list:
-
- (list-type <list name> (third element consisting of 6 elements)
- another_table 1 "ff `a) % a comment
-
- This list contains the following elements:
-
- list-type
-
- symbol, same as <list-type>
-
- <list name>
-
- symbol
-
- (third ... elements)
-
- list containing 6 elements
-
- another_table
-
- symbol
-
- 1
-
- number
-
- "ff
-
- number
-
- `a
-
- number
-
-
- 3.2 Numbers
- -----------
-
- You can use the following notations for numbers (the syntax is similar
- to that used by TeX):
-
- `z
-
- code of character z. For portability of the parameter file,
- this should be used only for letters, digits and a subset of
- punctuation common to most codes (ASCII, EBCDIC)
-
- "7a
-
- hexadecimal number
-
- '172
-
- octal number
-
- 122
-
- decimal number
-
- All the examples above specify the same code. Numbers must be in the
- range 0 through 255.
-
-
- 3.3 Symbols
- -----------
-
- A symbol is a sequence of characters. Symbols are just names of
- objects like tables and characters. You should always start a symbol
- with a letter. A symbol ends at the next new line character, blank or
- closing parenthesis. You can enclose a symbol in <angle brackets>.
- This is required if the name contains a blank or a parenthesis.
- dvisprep and dvispell display symbols by enclosing them in
- <angle brackets>. Examples of symbols:
-
- zero umlaut-a sharp_s x <The letter X> digit-6
-
-
- 3.4 Comments
- ------------
-
- The parameter file may contain comments which are ignored by dvisprep.
- Comments are started with `%' and end at the next new line character.
- A `%' preceded by a ` does not start a comment. Empty lines are also
- ignored by dvisprep.
-
-
- 3.5 Types of lists
- ------------------
-
- There are the following table types:
-
- include
-
- inserts files (this is not a table, it's a directive which
- immediately takes effect)
-
- output
-
- specifies how to print a character given its symbolic name. The
- output table to be used can be set by the -o command line option
- of dvispell
-
- layout
-
- specifies how to convert character codes found in the DVI file
- into symbols. The layout table is chosen depending on the coding
- scheme of the current font
-
- font
-
- specifies how to convert character codes found in the DVI file
- into symbols. The layout table is chosen depending on the name of
- the current font. If both a layout table and a font table matches
- the current font, the font table takes precedence in order to
- implement exceptions
-
- conversion
-
- specifies how to convert sequences of symbols into other sequences
- of symbols. For instance, this is used for converting an accent
- code followed by a character code into an accented character
- or for converting a ligature into separate characters. The
- conversion table to be used can be set by the -c command line
- option of dvispell
-
- letters
-
- specifies what characters are letters. This is used for the -l
- command line option of dvispell
-
-
- 3.6 Syntax and semantics for the different types of lists
- ---------------------------------------------------------
-
- (include <FILENAME1> ...)
-
- Inserts the text files named in the list. After reading the
- files, processing is continued after the (include) list. Example:
-
- (include file1.dsi file2.dsi)
-
- The files inserted by (include) can in turn insert files; up to 8
- levels of nested files are supported.
-
- (output <TABLENAME> ENTRY1 ENTRY2 ...)
-
- The second element, <TABLENAME>, of an output table is the name of
- the output table. There are two types of entries:
-
- symbol
-
- the output table having this name is copied into the current
- output table
-
- list
-
- tells dvispell how to print a character. The first element
- is the symbolic name of the character. If there is no second
- element, the character will be discarded (if -u is given on
- the dvispell command line) or its symbolic name is printed (if
- -u is not given on the dvispell command line). If there is a
- second element, it must be a number (which is the character
- code to be printed) or a list of numbers (which are the
- character codes to be printed). If there are two or more
- entries for one symbol, the last one takes precedence
-
- (layout <TABLENAME> ENTRY1 ENTRY2 ...)
-
- The second element, <TABLENAME>, of a layout table is the name
- of the layout table. If the coding scheme of a TFM file matches
- the name of a layout table, that layout table will be used for
- characters of that font (unless the font name matches a font table
- entry). There are two types of entries:
-
- symbol
-
- the layout table having this name is copied into the current
- layout table
-
- list
-
- tells dvispell how to convert a character code into a symbol.
- The first element is a number, the character code. The second
- element is a symbol (the symbolic name of the character) or a
- list of symbols (that sequence of symbolic names will be used
- for the character code). If there are two or more entries for
- one character code, the last one takes precedence
-
- (font FONTS ENTRY1 ENTRY2 ...)
-
- The second element, FONTS, is either a symbol (the font name) or
- a list of symbols (the font names). If a font name matches the
- symbol or one of the symbols, respectively, the entries of this
- table are used for converting character codes to symbols. A
- font table contains the same sort of entries as a layout table.
- Usually, a font table just copies a layout table by specifying
- the name of a layout table. Fonts which don't match their coding
- scheme, like the Computer Modern text italic fonts (which contain
- \pounds instead of a dollar sign in position "24), should be put
- into a font table to override the layout table.
-
- (conversion <TABLENAME> ENTRY1 ENTRY2 ...)
-
- The second element, <TABLENAME> of a conversion table is the name
- of the conversion table. The name of a conversion table is used
- for copying the conversion table into other conversion tables and
- for specifying a conversion table on the dvispell command line
- (-c). There are two types of entries:
-
- symbol
-
- the conversion table having this name is copied into the
- current conversion table
-
- list
-
- defines replacement symbols for sequences of symbols. The
- first element is a symbol or a list of symbols. This sequence
- (of one or more symbolic names) is converted into the sequence
- of symbolic names given by the second element, which is a
- symbol or a list of symbols. If there is no second element,
- the sequence given by the first element will be discarded if
- encountered. If there are two or more entries for one symbol
- or sequence of symbols, the last one takes precedence
-
- (letters LETTER1 LETTER2 ...)
-
- The elements of the letters table, the symbolic names of
- characters, are appended to the set of letters. The set of
- letters is used for implementing the -l command line option of
- dvispell.
-
-
- 3.7 Predefined table names
- --------------------------
-
- If the -o command line option of dvispell is not used, the output
- table named DEFAULT will be used.
-
- If the -c command line option of dvispell is not used, the conversion
- table named DEFAULT will be used.
-
-
- 3.8 Predefined symbols
- ----------------------
-
- Some special symbols are generated for special events encountered in
- DVI files:
-
- START
-
- This symbol is generated at the beginning of the DVI file, before
- any other character
-
- END
-
- This symbol is generated at the end of the DVI file, after the
- last character
-
- WORDSPACE
-
- This symbol is generated between words
-
- NEWLINE
-
- This symbol is generated at the beginning of each new line
-
- NEWPAGE
-
- This symbol is generated at the end of each page
-
- NONLETTER
-
- This symbol is generated instead of a symbolic name if the -l
- command line option of dvispell has been specified and the symbol
- to be printed is not in the set of letters defined by the letter
- lists. After replacing the symbol by NONLETTER, conversions
- are applied again to be able to convert NONLETTER to something
- different
-
-
- 4 How dvispell works
- ====================
-
- dvispell converts the characters found in the DVI file into symbolic
- names using the layout and font tables. Symbols are also created for
- line breaks, page breaks, word spaces etc. The resulting sequence
- of symbols is converted into another sequence of symbols, using the
- active conversion table. Starting with the first symbol of the
- sequence, the LONGEST matching conversion table entry is sought. The
- matching symbols are replaced by the associated replacement symbols
- defined in the conversion table. After inserting the new symbols,
- searching for a match restarts at the first new symbol. If no match
- is found for the current symbol, dvispell moves to the next symbol,
- until the end of the sequence is reached. If symbols have been
- replaced, dvispell converts the new sequence in another sequence,
- using the same algorithm, continuing until no symbols are replaced
- in a pass over the sequence. If the -l command line option has been
- specified, all the symbols in the resulting sequence which are not
- in the set of letters, are replaced by NONLETTER and the conversion
- algorithm starts over again. The resulting sequence is printed using
- the active output table.
-
- Please note a subtle feature: matches involving symbols to the left of
- the current symbols are found in the next pass. Example:
-
- (b (c d))
- (c e)
- ((a c) x)
- ((a e) y)
-
- The sequence of symbols `a b' is not converted into `x d', as might be
- expected:
-
- 1st pass: a b -> a c d -> a e d
- ^ ^ (^ is below first symbol of match)
- 2nd pass: a e d -> y d
- ^ (^ is below first symbol of match)
- 3rd pass: a e d -> y d (last pass because there's no match)
-
- Of course, dvispell doesn't exactly work as outlined here: dvispell
- performs all the conversions in one pass, that is, you get output
- before dvispell has read the entire DVI file.
-
-
- 5 Supplementing plain.dsi
- =========================
-
- Adding accented characters (and other objects) to plain.dsi consists
- of 5 steps for each character:
-
- 1. Choose a descriptive name for the character
-
- 2. Add the character to the appropriate output table(s)
-
- 3. If the character is a letter, add the name to the letters list.
-
- 4. Add symbolic names for DVI codes into the layout tables if the
- codes from which your character is made up are not yet defined.
-
- 5. Add the character to a conversion table. You should create a new
- conversion table for your definitions. That table can be inserted
- into an existing table by putting the name of your table into an
- existing table.
-
-
- 5.1 Hints
- ---------
-
- Instead of modifying plain.dsi, you should create a new file, which
- includes plain.dsi (see polish.dsi).
-
- If a character is available both in code pages 437 and 850, add the
- character to table pc437. If a character exists only in code page
- 850, add the character to table pc850. This works because table pc850
- copies table pc437. If a character exists only in code page 437, add
- the character to table pc437 and add
-
- (name)
-
- to table pc850 remove the character from table pc850. (name) must
- be inserted AFTER the entry copying the pc437 table to override the
- copied entry.
-
- Avoid infinite loops in conversions. dvispell doesn't detect infinite
- loop.
-
- Do not use NONLETTER in the replacement sequence of a conversion.
- You'd get an infinite loop.
-
- Avoid long replacement sequences as the algorithm used by dvispell may
- fail in situations requiring lots of `passes' as outlined above if
- matches propagate too much to the left, that is, a replacement causes
- a match to the left of the current symbol resulting in a replacement
- which again causes a match to the left of that replacement and so on.
-
- -------- End of DVISPREP.DOC -------------
-