Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   groff_tmac    ( 5 )

файлы макросов в системе набора GNU roff (macro files in the GNU roff typesetting system)

  Name  |  Description  |    Macro packages    |  Naming  |  Inclusion  |  Writing macros  |  See also  |

Macro packages

Macro packages come in two varieties; those which assume responsibility for page layout and other critical functions ('major' or 'full-service') and those which do not ('supplemental' or 'auxiliary'). GNU roff provides most major macro packages found in AT&T and BSD Unix systems, an additional full-service package, and many supplemental packages. Multiple full-service macro packages cannot be used by the same document. Auxiliary packages can generally be freely combined, though attention to their use of the groff language name spaces for identifiers (particularly registers, macros, strings, and diversions) should be paid. Name space management was a significant challenge in AT&T troff; groff's support for arbitrarily long identifiers affords few excuses for name collisions, apart from attempts at compatibility with the demands of historical documents.

Man pages an man an is used to compose man pages in the format originating in Version 7 Unix (1979). It has a small macro interface and is widely used; see groff_man(7).

doc mdoc doc is used to compose man pages in the format originating in 4.3BSD-Reno (1990). It provides many more features than an, but is also larger, more complex, and not as widely adopted; see groff_mdoc(7).

Because readers of man pages often do not know in advance which macros are used to format a given document, a wrapper is available.

andoc mandoc This macro file, specific to groff, recognizes whether a document uses man or mdoc format and loads the corresponding macro package. Multiple man pages, in either format, can be handled; andoc reloads each macro package as necessary.

Full-service packages The packages in this section provide a complete set of macros for writing documents of any kind, up to whole books. They are similar in functionality; it is a matter of taste which one to use.

me The classical me macro package; see groff_me(7).

mm The semi-classical mm macro package; see groff_mm(7).

mom The mom macro package, only available in groff. As this was not based on other packages, it was freely designed as quite a nice, modern macro package. See groff_mom(7).

ms The classical ms macro package; see groff_ms(7).

Localization packages For Western languages, the localization file sets the hyphenation mode and loads hyphenation patterns and exceptions. Localization files can also adjust the date format and provide translations of strings used by some of the full-service macro packages; alter the input encoding (see the next section); and change the amount of inter-sentence space. By default, troffrc loads the localization file for English.

As of groff 1.23.0, the following localization files exist.

cs Czech; localizes me, mm, mom, and ms. Sets the input encoding to Latin-2 by loading latin2.tmac.

de den German; localizes me, mm, mom, and ms. Sets the input encoding to Latin-1 by loading latin1.tmac.

de.tmac selects hyphenation patterns for traditional orthography, and den.tmac does the same for the new orthography ('Rechtschreibreform').

en English.

fr French; localizes me, mm, mom, and ms. Sets the input encoding to Latin-9 by loading latin9.tmac.

it Italian; localizes me, mm, mom, and ms.

ja Japanese.

sv Swedish; localizes me, mm, mom, and ms. Sets the input encoding to Latin-1 by loading latin1.tmac. Some of the localization of the mm package is handled separately; see groff_mmse(7).

zh Chinese.

Input encodings latin1 latin2 latin5 latin9 Various input encodings supported directly by groff. Normally, this macro is loaded at the very beginning of a document or specified as the first macro argument on the command line. groff loads latin1 by default at start-up. These macro packages don't work on EBCDIC hosts.

cp1047 Encoding support for EBCDIC. On those platforms it is loaded automatically at start-up. Due to different character ranges used in groff it doesn't work on architectures which are based on ASCII.

Some input encoding characters may not be available for a particular output device. For example, saying

groff -Tlatin1 -mlatin9 ...

fails if you use the Euro character in the input. Usually, this limitation is present only for drivers which have a limited set of output glyphs (ascii, latin1); for other drivers it is usually sufficient to install proper fonts which contain the necessary glyphs.

Auxiliary packages The macro packages in this section are not intended for stand- alone use, but can add functionality to any other macro package or to plain (or 'raw') groff documents.

62bit Provides macros for addition, multiplication, and division of 62-bit integers (allowing safe multiplication of 31-bit integers, for example).

ec Switch to the EC and TC font families. To be used with grodvi(1) — this man page also gives more details of how to use it.

hdtbl The Heidelberger table macros, contributed by Joachim Walsdorff, allow the generation of tables through a syntax similar to the HTML table model. Note that hdtbl is a macro package, not a preprocessor like tbl(1). hdtbl works only with the ps and pdf output drivers. See groff_hdtbl(7).

papersize This macro file is normally loaded at start-up by the troffrc file. It provides an interface to set the paper size on the command line with the option -d paper=size or troff. Possible values for size are the ISO and DIN formats 'A0–A6', 'B0–B6', 'C0–C6', and 'D0–D6'; the U.S. formats 'letter', 'legal', 'tabloid', 'ledger', 'statement', and 'executive'; and the envelope formats 'com10', 'monarch', and 'DL'. All formats, even those for envelopes, are in portrait orientation, with their longer dimension as the length. Appending 'l' (ell) to any of these denotes landscape orientation instead. An output device typically requires command-line options -p and -l to override the paper dimensions and orientation, respectively, defined in its DESC file; see subsection 'Paper sizes' of groff(1).

pdfpic A single macro is provided in this file, PDFPIC, to include a PDF graphic in a document, i.e., under the output driver pdf. For all other drivers, pspic is used. So pdfpic is an extension of pspic. This means you can safely replace all PSPIC with PDFPIC; nothing gets lost by that. The options of PDFPIC are identical to the PSDIF options.

pic This file provides proper definitions for the macros PS and PE, needed for the pic(1) preprocessor. They center each picture. Use it only if your macro package doesn't provide proper definitions for those two macros (most of them already do).

pspic A single macro is provided in this file, PSPIC, to include a PostScript graphic in a document. The ps, dvi, html, and xhtml output drivers support inclusion of PS images; for all other drivers the image is replaced with a hollow rectangle of the same size. This macro file is automatically loaded at start-up by troff so it isn't necessary to call it explicitly.

Syntax:

.PSPIC [-L|-R|-C|-I n] file [width [height]]

file is the name of the PostScript file; width and height give the desired width and height of the image. If neither a width nor a height argument is specified, the image's natural width (as given in the file's bounding box) or the current line length is used as the width, whatever is smaller. The width and height arguments may have scaling indicators attached; the default scaling indicator is i. This macro scales the graphic uniformly in the x and y directions so that it is no more than width wide and height high. Option -C centers the graphic horizontally, which is the default. The -L and -R options left-align and right-align the graphic, respectively. The -I option indents the graphic by n (default scaling indicator is m).

For use of .PSPIC within a diversion it is recommended to extend it with the following code, assuring that the diversion's width completely covers the image's width.

.am PSPIC . vpt 0 \h'(\\n[ps-offset]u + \\n[ps-deswid]u)' . sp -1 . vpt 1 ..

ptx A single macro is provided in this file, xx, for formatting permuted index entries as produced by the GNU ptx(1) program. If you need different formatting, copy the macro into your document and adapt it to your needs.

rfc1345 defines special character escape sequences based on the glyph mnemonics specified in RFC 1345 and the digraph table of the text editor Vim. See groff_rfc1345(7).

trace Use this for tracing macro calls. It is only useful for debugging. See groff_trace(7).

tty-char Defines fallback definitions of roff special characters for terminal devices. These definitions more poorly optically approximate typeset output compared to those of the tty file in favor of communicating more semantic information, which can allow easier processing with critical equipment.

www Additions of elements known from the HTML format, as used in World Wide Web pages; this includes URL links and mail addresses. See groff_www(7).