./PaxHeaders.22577/groff-1.22.30000644000000000000000000000013112426110271013760 xustar000000000000000030 mtime=1415090361.025951413 30 atime=1415090360.925952663 29 ctime=1415090361.03895125 groff-1.22.3/0000755000175000001440000000000012426110271012537 5ustar00wlusers00000000000000groff-1.22.3/PaxHeaders.22577/FDL0000644000000000000000000000013212426110213014225 xustar000000000000000030 mtime=1415090315.143525022 30 atime=1415090315.143525022 30 ctime=1415090315.143525022 groff-1.22.3/FDL0000644000175000001440000005466212426110213013100 0ustar00wlusers00000000000000 GNU Free Documentation License Version 1.3, 3 November 2008 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. The "publisher" means any person or entity that distributes copies of the Document to the public. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements". 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License. However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document. 11. RELICENSING "Massive Multiauthor Collaboration Site" (or "MMC Site") means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A "Massive Multiauthor Collaboration" (or "MMC") contained in the site means any set of copyrightable works thus published on the MMC site. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. "Incorporate" means to publish or republish a Document, in whole or in part, as part of another Document. An MMC is "eligible for relicensing" if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008. The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing. ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. groff-1.22.3/PaxHeaders.22577/Makefile.sub0000644000000000000000000000013212426110213016125 xustar000000000000000030 mtime=1415090315.145524997 30 atime=1415090315.145524997 30 ctime=1415090315.145524997 groff-1.22.3/Makefile.sub0000644000175000001440000000435212426110213014767 0ustar00wlusers00000000000000# Copyright (C) 1989-2014 Free Software Foundation, Inc. # Written by James Clark (jjc@jclark.com) # # This file is part of groff. # # groff is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or # (at your option) any later version. # # groff is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Makefile.sub # DISTCLEANFILES=\ Makefile \ config.cache \ config.log \ config.status \ groff.log \ groff.sum \ src/include/config.h \ site.bak \ site.exp \ stamp-h \ test-groff MOSTLYCLEANADD=\ Makefile.cfg \ conftest* M4MACROS=\ $(srcdir)/m4/ax_compare_version.m4 \ $(srcdir)/m4/ax_prog_perl_version.m4 \ $(srcdir)/m4/codeset.m4 \ $(srcdir)/m4/fcntl-o.m4 \ $(srcdir)/m4/glibc21.m4 \ $(srcdir)/m4/groff.m4 \ $(srcdir)/m4/iconv.m4 \ $(srcdir)/m4/lib-ld.m4 \ $(srcdir)/m4/lib-link.m4 \ $(srcdir)/m4/lib-prefix.m4 \ $(srcdir)/m4/localcharset.m4 distfiles: configure $(srcdir)/configure: configure.ac $(srcdir)/aclocal.m4 cd $(srcdir) && autoconf && rm -rf autom4te.cache $(srcdir)/aclocal.m4: $(M4MACROS) cd $(srcdir) && aclocal -I m4 config.status: configure $(SHELL) config.status --recheck # autoheader might not change config.hin, so touch a stamp file. $(srcdir)/config.hin: stamp-h.in $(srcdir)/stamp-h.in: configure.ac $(srcdir)/aclocal.m4 cd $(srcdir) && autoheader echo timestamp > $(srcdir)/stamp-h.in config.h: stamp-h stamp-h: config.hin config.status $(SHELL) config.status # Always create the site-font directory as a guide to the user. install_data: -test -d $(DESTDIR)$(localfontdir) \ || $(mkinstalldirs) $(DESTDIR)$(localfontdir) ######################################################################## # Emacs settings ######################################################################## # # Local Variables: # mode: makefile # End: groff-1.22.3/PaxHeaders.22577/Makefile.init0000644000000000000000000000013212426110213016277 xustar000000000000000030 mtime=1415090315.145524997 30 atime=1415090315.145524997 30 ctime=1415090315.145524997 groff-1.22.3/Makefile.init0000644000175000001440000000203312426110213015133 0ustar00wlusers00000000000000# Copyright (C) 1989-2014 Free Software Foundation, Inc. # Written by James Clark (jjc@jclark.com) # # This file is part of groff. # # groff is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or # (at your option) any later version. # # groff is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Makefile.init # SHELL=/bin/sh .PHONY: all all: $(SHELL) configure $(MAKE) all ######################################################################## # Emacs settings ######################################################################## # # Local Variables: # mode: makefile # End: groff-1.22.3/PaxHeaders.22577/Makefile.in0000644000000000000000000000013212426110213015742 xustar000000000000000030 mtime=1415090315.145524997 30 atime=1415090315.794516884 30 ctime=1415090315.145524997 groff-1.22.3/Makefile.in0000644000175000001440000010004612426110213014601 0ustar00wlusers00000000000000# Copyright (C) 1989-2014 Free Software Foundation, Inc. # Written by James Clark (jjc@jclark.com) # # This file is part of groff. # # groff is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or # (at your option) any later version. # # groff is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Makefile.in # SHELL=@SHELL@ PACKAGE_TARNAME=@PACKAGE_TARNAME@ srcdir=@srcdir@ top_srcdir=@abs_top_srcdir@ VPATH=@srcdir@ top_builddir=@abs_top_builddir@ # `HOST' is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM HOST=@host@ # `RT_SEP' is the operating system's native PATH SEPARATOR CHAR, which # is to be used in runtime PATHs compiled into groff executables. RT_SEP=@GROFF_PATH_SEPARATOR@ # `SH_SEP' is a alternative PATH SEPARATOR CHAR, to be used in shell # scripts and makefile rules; it may be the same as `RT_SEP', but, # particularly in some Microsoft environments, it may differ. SH_SEP=@PATH_SEPARATOR@ # `GLIBC21' is yes if the host operating system uses GNU libc 2.1 or newer, # otherwise no. GLIBC21=@GLIBC21@ version=`cat $(top_srcdir)/VERSION` # No additional number if revision is zero. revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION` # Define `page' to be letter if your PostScript printer uses 8.5x11 # paper (USA) and define it to be A4, if it uses A4 paper (rest of the # world). PAGE=@PAGE@ # The name of the ghostscript program. Normally, gs, on GNU/Linux # but it might be different on MS-DOS/MS-WIN32 systems. GHOSTSCRIPT=@GHOSTSCRIPT@ # `ALT_GHOSTSCRIPT_PROGS' specifies a list alternative names, # which can be tried if `GHOSTSCRIPT' cannot be found at run time. ALT_GHOSTSCRIPT_PROGS=@ALT_GHOSTSCRIPT_PROGS@ # Similarly, `ALT_AWK_PROGS' specifies a list of alternative names, # which can be tried at run time, to identify the awk program. ALT_AWK_PROGS=@ALT_AWK_PROGS@ # Normally the Postscript driver, grops, produces output that conforms # to version 3.0 of the Adobe Document Structuring Conventions. # Unfortunately some spoolers and previewers can't handle such output. # The BROKEN_SPOOLER_FLAGS variable tells grops what it should do to # make its output acceptable to such programs. This variable controls # only the default behaviour of grops; the behaviour can be changed at # runtime by the grops -b option (and so by groff -P-b). # Use a value of 0 if your spoolers and previewers are able to handle # conforming PostScript correctly. # Add 1 if no %%{Begin,End}DocumentSetup comments should be generated; # this is needed for early versions of TranScript that get confused by # anything between the %%EndProlog line and the first %%Page: comment. # Add 2 if lines in included files beginning with %! should be # stripped out; this is needed for the OpenWindows 2.0 pageview previewer. # Add 4 if %%Page, %%Trailer and %%EndProlog comments should be # stripped out of included files; this is needed for spoolers that # don't understand the %%{Begin,End}Document comments. I suspect this # includes early versions of TranScript. # Add 8 if the first line of the PostScript output should be %!PS-Adobe-2.0 # rather than %!PS-Adobe-3.0; this is needed when using Sun's Newsprint # with a printer that requires page reversal. BROKEN_SPOOLER_FLAGS=@BROKEN_SPOOLER_FLAGS@ # `DEVICE' is the default device. DEVICE=ps # `XDEVDIRS' is either `font/devX{75,100}{,-12}' or empty. XDEVDIRS=@XDEVDIRS@ # `XPROGDIRS' is either `src/devices/xditview src/utils/xtotroff' or empty. XPROGDIRS=@XPROGDIRS@ # `XLIBDIRS' is either `src/libs/libxutil' or empty. XLIBDIRS=@XLIBDIRS@ # `TTYDEVDIRS' is either `font/devascii font/devlatin1' (for # ASCII) or `font/devcp1047' (for EBCDIC) plus font/devutf8. TTYDEVDIRS=@TTYDEVDIRS@ font/devutf8 # `OTHERDEVDIRS' is either `font/devlj4 font/devlbp' (for ASCII) or # empty (for EBCDIC). OTHERDEVDIRS=@OTHERDEVDIRS@ # `PSPRINT' is the command to use for printing a PostScript file, # for example `lpr'. PSPRINT=@PSPRINT@ # `DVIPRINT' is the command to use for printing a TeX dvi file, # for example `lpr -d'. DVIPRINT=@DVIPRINT@ # Prefix for names of programs that have Unix counterparts. # For example, if `g' is `g' then troff will be installed as # gtroff. This doesn't affect programs like grops or groff that have # no Unix counterparts. Note that the groff versions of eqn and tbl # will not work with Unix troff. g=@g@ # Common prefix for installation directories. # Used in definitions of exec_prefix, datasubdir, fontpath, manroot. # This must already exist when you do make install. prefix=@prefix@ exec_prefix=@exec_prefix@ # `bindir' says where to install executables. bindir=@bindir@ # `libdir' says where to install platform-dependent data. libdir=@libdir@ libprogramdir=$(libdir)/groff # `datasubdir' says where to install platform-independent data files. datadir=@datadir@ datarootdir=@datarootdir@ dataprogramdir=$(datadir)/groff datasubdir=$(dataprogramdir)/$(version)$(revision) # `infodir' says where to install info files. infodir=@infodir@ # `docdir' says where to install documentation files. docdir=@docdir@ # `exampledir' says where to install example files. exampledir=$(docdir)/examples # `htmldocdir' says where to install documentation in HTML format. htmldocdir=$(docdir)/html # `pdfdocdir' says where to install documentation in PDF format. pdfdocdir=$(docdir)/pdf # `fontdir' says where to install dev*/*. fontdir=$(datasubdir)/font # `oldfontdir' says where to install old font sets (as dev*/*). oldfontdir=$(datasubdir)/oldfont # `localfontdir' says where local fonts will be installed (as dev*/*). localfontdir=$(dataprogramdir)/site-font # `legacyfontdir' is for compatibility with non-GNU troff. legacyfontdir=/usr/lib/font # `fontpath' says where to look for dev*/*. fontpath=$(localfontdir)$(RT_SEP)$(fontdir)$(RT_SEP)$(legacyfontdir) # `tmacdir' says where to install macros. tmacdir=$(datasubdir)/tmac # `systemtmacdir' says where to install platform-dependent macros. systemtmacdir=$(libprogramdir)/site-tmac # `localtmacdir' says where local files will be installed. localtmacdir=$(dataprogramdir)/site-tmac # `appresdir' says where to install the application resource file for # gxditview. appresdir=@appresdir@ glilypond_dir=@glilypond_dir@ gpinyin_dir=@gpinyin_dir@ groffer_dir=@groffer_dir@ grog_dir=@grog_dir@ libprogramdir=@libprogramdir@ referdir=@referdir@ # `tmacpath' says where to look for macro files. # The current directory will be prepended in unsafe mode only; the home # directory will be always added. # `troffrc' and `troffrc-end' (and `eqnrc') are searched neither in the # current nor in the home directory. tmacpath=$(systemtmacdir)$(RT_SEP)$(localtmacdir)$(RT_SEP)$(tmacdir) # `sys_tmac_prefix' is prefix (if any) for system macro packages. sys_tmac_prefix=@sys_tmac_prefix@ # `pnmtops_nosetpage' is the command to be run to generate an eps # file. Some versions of pnmtops provide the -nosetpage option. # We detect this and use it if present. pnmtops_nosetpage=@pnmtops_nosetpage@ # `tmac_wrap' is list of system macro packages that should be made # available to groff by creating a corresponding macro package # in the groff macro directory that references the system macro # package. tmac_wrap=@tmac_wrap@ # If there is a groff version of a macro package listed in $(tmac_wrap), # then the groff version will be installed with a prefix of this. # Don't make this empty. tmac_prefix=g # The groff -mm macros will be available as -m$(tmac_m_prefix)m. tmac_m_prefix=\ `for i in $(tmac_wrap) ""; do case "$$i" in m) echo $(tmac_prefix);; esac; done` # The groff -ms macros will be available as -m$(tmac_s_prefix)s. tmac_s_prefix=\ `for i in $(tmac_wrap) ""; do case "$$i" in s) echo $(tmac_prefix);; esac; done` # The groff -man macros will be available as -m$(tmac_an_prefix)an. tmac_an_prefix=\ `for i in $(tmac_wrap) ""; do case "$$i" in an) echo $(tmac_prefix);; esac; done` # Extension to be used for refer index files. Index files are not # sharable between different architectures, so you might want to use # different suffixes for different architectures. Choose an extension # that doesn't conflict with refer or any other indexing program. indexext=.i # Directory containing the default index for refer. indexdir=/usr/dict/papers # The filename (without suffix) of the default index for refer. indexname=Ind # common_words_file is a file containing a list of common words. # If your system provides /usr/lib/eign it will be copied onto this, # otherwise the supplied eign file will be used. common_words_file=$(datasubdir)/eign # `manroot' is the root of the man page directory tree. mandir=@mandir@ manroot=$(mandir) # `man1ext' is the man section for user commands. man1ext=1 man1dir=$(manroot)/man$(man1ext) # `man5ext' is the man section for file formats. man5ext=5 man5dir=$(manroot)/man$(man5ext) # `man7ext' is the man section for macros. man7ext=7 man7dir=$(manroot)/man$(man7ext) # `dist' target is disallowed in some `configure' combinations. doc_dist_target_ok=@doc_dist_target_ok@ # The configure script checks whether the user wants the info documentation. # For the repo version this mechanism also suppresses building via `makeinfo'. make_infodoc=@make_infodoc@ make_install_infodoc=@make_install_infodoc@ make_uninstall_infodoc=@make_uninstall_infodoc@ # The configure script checks whether all necessary utility programs for # grohtml are available -- only then we can build the HTML documentation. make_htmldoc=@make_htmldoc@ make_install_htmldoc=@make_install_htmldoc@ make_uninstall_htmldoc=@make_uninstall_htmldoc@ make_htmlexamples=@make_htmlexamples@ make_install_htmlexamples=@make_install_htmlexamples@ make_uninstall_htmlexamples=@make_uninstall_htmlexamples@ # However, there may always be some prebuild HTML documentation make_install_shipped_htmldoc=@make_install_shipped_htmldoc@ make_uninstall_shipped_htmldoc=@make_uninstall_shipped_htmldoc@ # The configure script also checks whether all necessary utility programs # for pdfroff are available -- only then we can build PDF documentation. make_pdfdoc=@make_pdfdoc@ make_install_pdfdoc=@make_install_pdfdoc@ make_uninstall_pdfdoc=@make_uninstall_pdfdoc@ make_pdfexamples=@make_pdfexamples@ make_install_pdfexamples=@make_install_pdfexamples@ make_uninstall_pdfexamples=@make_uninstall_pdfexamples@ # `other' documentation, e.g., `meref.me' and `pic.ms', as well as their # generated counterparts.. make_otherdoc=@make_otherdoc@ make_install_otherdoc=@make_install_otherdoc@ make_uninstall_otherdoc=@make_uninstall_otherdoc@ # `examples' -- a generic switch, but the generated examples are furtherly # subdivided to catch HTML and PDF production availability. make_examples=@make_examples@ make_install_examples=@make_install_examples@ make_uninstall_examples=@make_uninstall_examples@ # Windows `.cmd' files make_winscripts=@make_winscripts@ make_install_winscripts=@make_install_winscripts@ make_uninstall_winscripts=@make_uninstall_winscripts@ # All the previous installation directories, when used, are prefixed with # $(DESTDIR) during install and uninstall, to support staged installations. # DEFINES should include the following: # # -DWORDS_BIGENDIAN if your target platform is big-endian # -DIS_EBCDIC_HOST if the host's encoding is EBCDIC # # -DHAVE_DIRECT_H if you have # -DHAVE_DIRENT_H if you have # -DHAVE_CC_INTTYPES_H if you have a C++ # -DHAVE_PROCESS_H if you have # -DHAVE_LIMITS_H if you have # -DHAVE_CC_LIMITS_H if you have a C++ # -DHAVE_MATH_H if you have # -DHAVE_CC_OSFCN_H if you have a C++ # -DHAVE_STDDEF_H if you have # -DHAVE_STDLIB_H if you have # -DHAVE_STRING_H if you have # -DHAVE_STRINGS_H if you have # -DHAVE_SYS_DIR_H if you have # -DHAVE_SYS_PARAM_H if you have # -DHAVE_SYS_STAT_H if you have # -DHAVE_SYS_TIME_H if you have # -DHAVE_SYS_TYPES_H if you have # -DHAVE_UNISTD_H if you have # # -DHAVE_FMOD if you have fmod() # -DHAVE_GETCWD if you have getcwd() # -DHAVE_GETTIMEOFDAY if you have gettimeofday() # -DHAVE_ICONV if you have iconv() # -DHAVE_ISATTY if you have isatty() # -DHAVE_KILL if you have kill() # -DHAVE_LANGINFO_CODESET if you have nl_langinfo() # -DHAVE_MKSTEMP if you have mkstemp() # -DHAVE_MMAP if you have mmap() # -DHAVE_PUTENV if you have putenv() # -DHAVE_RENAME if you have rename() # -DHAVE_SETLOCALE if you have setlocale() # -DHAVE_SNPRINTF if you have snprintf() # -DHAVE_STRCASECMP if you have strcasecmp() # -DHAVE_STRNCASECMP if you have strncasecmp() # -DHAVE_STRERROR if you have strerror() # -DHAVE_STRSEP if you have strsep() # -DHAVE_STRTOL if you have strtol() # -DHAVE_SYMLINK if you have symlink() # -DHAVE_VSNPRINTF if you have vsnprintf() # # -DNEED_DECLARATION_GETTIMEOFTODAY # if your C++ doesn't declare # gettimeofday() # -DNEED_DECLARATION_HYPOT if your C++ doesn't declare hypot() # -DNEED_DECLARATION_PCLOSE if your C++ doesn't declare pclose() # -DNEED_DECLARATION_POPEN if your C++ doesn't declare popen() # -DNEED_DECLARATION_PUTENV if your C++ doesn't declare # putenv() # -DNEED_DECLARATION_RAND if your C++ doesn't declare rand() # -DNEED_DECLARATION_SNPRINTF if your C++ doesn't declare # snprintf() # -DNEED_DECLARATION_SRAND if your C++ doesn't declare srand() # -DNEED_DECLARATION_STRCASECMP if your C++ doesn't declare # strcasecmp() # -DNEED_DECLARATION_STRNCASECMP # if your C++ doesn't declare # strncasecmp() # -DNEED_DECLARATION_VFPRINTF if your C++ doesn't declare # vfprintf() # -DNEED_DECLARATION_VSNPRINTF if your C++ doesn't declare # vsnprintf() # # -DHAVE_DECL_GETC_UNLOCKED if you have getc_unlocked() # -DHAVE_DECL_SYS_SIGLIST if you have sys_siglist[] # # -DHAVE_STRUCT_EXCEPTION if defines struct exception # -DHAVE_SYS_NERR if you have sysnerr in or # -DHAVE_SYS_ERRLIST if you have sys_errlist in or # # -DICONV_CONST=const if declaration of iconv() needs const # -DLONG_FOR_TIME_T if localtime() takes a long * not a time_t * # -DRETSIGTYPE=int if signal handlers return int not void # -DRET_TYPE_SRAND_IS_VOID if srand() returns void not int # # -DWCOREFLAG=0200 if the 0200 bit of the status returned by # wait() indicates whether a core image was # produced for a process that was terminated # by a signal # # -DHAVE_WORKING_O_NOATIME define if 's O_NOATIME flag works # -DHAVE_WORKING_O_NOFOLLOW define if 's O_NOFOLLOW flag works # # -Duintmax_t= define to `unsigned long' or `unsigned long # long' if does not exist # # -DTRADITIONAL_CPP if your C++ compiler uses a traditional # (Reiser) preprocessor # -DARRAY_DELETE_NEEDS_SIZE if your C++ doesn't understand `delete []' # # -DPAGE=A4 if the the printer's page size is A4 # -DGHOSTSCRIPT=gs the name (and directory if required) of the # ghostscript program # DEFINES=@DEFS@ # Include # # {fmod,getcwd,mkstemp,putenv,snprintf,strcasecmp, # strerror,strncasecmp,strtol}.$(OBJEXT) # # in LIBOBJS if your C library is missing the corresponding function. # vsnprintf is defined in the snprintf.$(OBJEXT) module. LIBOBJS=@LIBOBJS@ # `CCC' is the compiler for C++ (.cpp) files. CCC=@CXX@ CC=@CC@ # CCDEFINES are definitions for C++ compilations. CCDEFINES=$(DEFINES) # CDEFINES are definitions for C compilations. CDEFINES=$(DEFINES) CCFLAGS=@CXXFLAGS@ CFLAGS=@CFLAGS@ CPPFLAGS=@CPPFLAGS@ LDFLAGS=@LDFLAGS@ X_CFLAGS=@X_CFLAGS@ X_LIBS=@X_LIBS@ X_EXTRA_LIBS=@X_EXTRA_LIBS@ X_PRE_LIBS=@X_PRE_LIBS@ YACC=@YACC@ YACCFLAGS=-v GREP=@GREP@ EGREP=@EGREP@ MAKEINFO=@MAKEINFO@ EXEEXT=@EXEEXT@ OBJEXT=@OBJEXT@ LIBEXT=@LIBEXT@ LIBS=@LIBS@ LIBM=@LIBM@ LIBICONV=@LIBICONV@ RANLIB=@RANLIB@ INSTALL=@INSTALL@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ INSTALL_SCRIPT=@INSTALL_SCRIPT@ INSTALL_DATA=@INSTALL_DATA@ INSTALL_INFO=@INSTALL_INFO@ LN_S=@LN_S@ AR=ar ETAGS=etags ETAGSFLAGS= # Flag that tells etags to assume C++. ETAGSCCFLAG=-C # Full path to perl. PERL=@PERL@ PERLVERSION=@PERLVERSION@ # Sed command with which to edit sh scripts. SH_SCRIPT_SED_CMD=@SH_SCRIPT_SED_CMD@ # Sed script to deal with OS dependencies in sh scripts. SH_DEPS_SED_SCRIPT=$(top_builddir)/arch/misc/shdeps.sed # The program to create directory hierarchies. mkinstalldirs= $(SHELL) $(top_srcdir)/mkinstalldirs PURIFY=purify PURIFYCCFLAGS= #PURIFYCCFLAGS=-g++=yes \ # -collector=`dirname \`$(CCC) -print-libgcc-file-name\``/ld # Passing down MAKEOVERRIDES prevents $(MAKE) from containing a second # copy of $(MDEFINES) when making individual directories; this could # cause the argument list to become too long on some systems. MDEFINES=\ "ALT_AWK_PROGS=$(ALT_AWK_PROGS)" \ "ALT_GHOSTSCRIPT_PROGS=$(ALT_GHOSTSCRIPT_PROGS)" \ "AR=$(AR)" \ "BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)" \ "CC=$(CC)" \ "CCC=$(CCC)" \ "CCDEFINES=$(CCDEFINES)" \ "CCFLAGS=$(CCFLAGS)" \ "CDEFINES=$(CDEFINES)" \ "CFLAGS=$(CFLAGS)" \ "CPPFLAGS=$(CPPFLAGS)" \ "DEVICE=$(DEVICE)" \ "DVIPRINT=$(DVIPRINT)" \ "EGREP=$(EGREP)" \ "ETAGS=$(ETAGS)" \ "ETAGSCCFLAG=$(ETAGSCCFLAG)" \ "ETAGSFLAGS=$(ETAGSFLAGS)" \ "EXEEXT=$(EXEEXT)" \ "GLIBC21=$(GLIBC21)" \ "GREP=$(GREP)" \ "HOST=$(HOST)" \ "INSTALL_DATA=$(INSTALL_DATA)" \ "INSTALL_INFO=$(INSTALL_INFO)" \ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ "LDFLAGS=$(LDFLAGS)" \ "LIBEXT=$(LIBEXT)" \ "LIBICONV=$(LIBICONV)" \ "LIBM=$(LIBM)" \ "LIBOBJS=$(LIBOBJS)" \ "LIBS=$(LIBS)" \ "MAKEINFO=$(MAKEINFO)" \ "MAKEOVERRIDES=$(MAKEOVERRIDES)" \ "OBJEXT=$(OBJEXT)" \ "OTHERDEVDIRS=$(OTHERDEVDIRS)" \ "PAGE=$(PAGE)" \ "PERL=$(PERL)" \ "PERLVERSION=$(PERLVERSION)" \ "GHOSTSCRIPT=$(GHOSTSCRIPT)" \ "PSPRINT=$(PSPRINT)" \ "PURIFY=$(PURIFY)" \ "PURIFYCCFLAGS=$(PURIFYCCFLAGS)" \ "RANLIB=$(RANLIB)" \ "RT_SEP=$(RT_SEP)" \ "SH_SEP=$(SH_SEP)" \ "SHELL=$(SHELL)" \ "SH_SCRIPT_SED_CMD=$(SH_SCRIPT_SED_CMD)" \ "SH_DEPS_SED_SCRIPT=$(SH_DEPS_SED_SCRIPT)" \ "TTYDEVDIRS=$(TTYDEVDIRS)" \ "XDEVDIRS=$(XDEVDIRS)" \ "XLIBDIRS=$(XLIBDIRS)" \ "XPROGDIRS=$(XPROGDIRS)" \ "X_CFLAGS=$(X_CFLAGS)" \ "X_LIBS=$(X_LIBS)" \ "X_EXTRA_LIBS=$(X_EXTRA_LIBS)" \ "X_PRE_LIBS=$(X_PRE_LIBS)" \ "YACC=$(YACC)" \ "YACCFLAGS=$(YACCFLAGS)" \ "appresdir=$(appresdir)" \ "groffer_dir=$(groffer_dir)" \ "gpinyin_dir=$(gpinyin_dir)" \ "glilypond_dir=$(glilypond_dir)" \ "grog_dir=$(grog_dir)" \ "referdir=$(referdir)" \ "bindir=$(bindir)" \ "common_words_file=$(common_words_file)" \ "datadir=$(datadir)" \ "dataprogramdir=$(dataprogramdir)" \ "datasubdir=$(datasubdir)" \ "docdir=$(docdir)" \ "exampledir=$(exampledir)" \ "exec_prefix=$(exec_prefix)" \ "fontdir=$(fontdir)" \ "fontpath=$(fontpath)" \ "g=$(g)" \ "htmldocdir=$(htmldocdir)" \ "pdfdocdir=$(pdfdocdir)" \ "indexdir=$(indexdir)" \ "indexext=$(indexext)" \ "indexname=$(indexname)" \ "infodir=$(infodir)" \ "legacyfontdir=$(legacyfontdir)" \ "libdir=$(libdir)" \ "libprogramdir=$(libprogramdir)" \ "localfontdir=$(localfontdir)" \ "localtmacdir=$(localtmacdir)" \ "make_infodoc=$(make_infodoc)" \ "make_install_infodoc=$(make_install_infodoc)" \ "make_uninstall_infodoc=$(make_uninstall_infodoc)" \ "make_htmldoc=$(make_htmldoc)" \ "make_install_htmldoc=$(make_install_htmldoc)" \ "make_uninstall_htmldoc=$(make_uninstall_htmldoc)" \ "make_htmlexamples=$(make_htmlexamples)" \ "make_install_htmlexamples=$(make_install_htmlexamples)" \ "make_uninstall_htmlexamples=$(make_uninstall_htmlexamples)" \ "make_install_shipped_htmldoc=$(make_install_shipped_htmldoc)" \ "make_uninstall_shipped_htmldoc=$(make_uninstall_shipped_htmldoc)" \ "make_pdfdoc=$(make_pdfdoc)" \ "make_install_pdfdoc=$(make_install_pdfdoc)" \ "make_uninstall_pdfdoc=$(make_uninstall_pdfdoc)" \ "make_pdfexamples=$(make_pdfexamples)" \ "make_install_pdfexamples=$(make_install_pdfexamples)" \ "make_uninstall_pdfexamples=$(make_uninstall_pdfexamples)" \ "make_otherdoc=$(make_otherdoc)" \ "make_install_otherdoc=$(make_install_otherdoc)" \ "make_uninstall_otherdoc=$(make_uninstall_otherdoc)" \ "make_examples=$(make_examples)" \ "make_install_examples=$(make_install_examples)" \ "make_uninstall_examples=$(make_uninstall_examples)" \ "make_winscripts=$(make_winscripts)" \ "make_install_winscripts=$(make_install_winscripts)" \ "make_uninstall_winscripts=$(make_uninstall_winscripts)" \ "man1dir=$(man1dir)" \ "man1ext=$(man1ext)" \ "man5dir=$(man5dir)" \ "man5ext=$(man5ext)" \ "man7dir=$(man7dir)" \ "man7ext=$(man7ext)" \ "manroot=$(manroot)" \ "mkinstalldirs=$(mkinstalldirs)" \ "oldfontdir=$(oldfontdir)" \ "pnmtops_nosetpage=$(pnmtops_nosetpage)" \ "prefix=$(prefix)" \ "revision=$(revision)" \ "sys_tmac_prefix=$(sys_tmac_prefix)" \ "systemtmacdir=$(systemtmacdir)" \ "tmac_an_prefix=$(tmac_an_prefix)" \ "tmac_m_prefix=$(tmac_m_prefix)" \ "tmac_s_prefix=$(tmac_s_prefix)" \ "tmac_wrap=$(tmac_wrap)" \ "tmacdir=$(tmacdir)" \ "tmacpath=$(tmacpath)" \ "top_builddir=$(top_builddir)" \ "top_srcdir=$(top_srcdir)" \ "version=$(version)" MAKE_K_FLAG=`for f in x $(MAKEFLAGS); do \ case $$f in \ *=* | --[!k]*);; \ *k*) echo ' -k ';; \ esac; \ done` INCDIRS=\ src/include LIBDIRS=\ src/libs/libgroff \ src/libs/libdriver \ src/libs/libbib \ $(XLIBDIRS) ALLLIBDIRS=\ src/libs/libgroff \ src/libs/libdriver \ src/libs/libbib \ src/libs/libxutil CCPROGDIRS=\ src/roff/groff \ src/roff/troff \ src/preproc/preconv \ src/preproc/tbl \ src/preproc/pic \ src/preproc/eqn \ src/preproc/grn \ src/preproc/refer \ src/preproc/soelim \ src/preproc/html \ src/devices/grops \ src/devices/grotty \ src/devices/grodvi \ src/devices/grolj4 \ src/devices/grohtml \ src/devices/grolbp \ src/utils/tfmtodit \ src/utils/hpftodit \ src/utils/lookbib \ src/utils/indxbib \ src/utils/lkbib \ src/utils/addftinfo CPROGDIRS=\ src/utils/pfbtops SHPROGDIRS=\ src/devices/gropdf PROGDEPDIRS=\ arch/misc PROGDIRS=\ $(PROGDEPDIRS) \ $(CCPROGDIRS) \ $(CPROGDIRS) \ $(SHPROGDIRS) \ $(XPROGDIRS) ALLPROGDIRS=\ $(PROGDEPDIRS) \ $(CCPROGDIRS) \ $(CPROGDIRS) \ $(SHPROGDIRS) \ src/devices/xditview \ src/utils/xtotroff DEVDIRS=\ font/devps \ font/devdvi \ font/devhtml ALLTTYDEVDIRS=\ font/devascii \ font/devlatin1 \ font/devutf8 \ font/devcp1047 # `doc' must be processed before `contrib/pdfmark', # pdf stuff must be processed before `contrib/mom', # devpdf fonts depends on `afmtodit' OTHERDIRS=\ src/utils/afmtodit \ font/devpdf \ arch/mingw \ contrib/chem \ contrib/eqn2graph \ contrib/gdiffmk \ contrib/glilypond \ contrib/gperl \ contrib/gpinyin \ contrib/grap2graph \ contrib/groff_filenames \ contrib/groffer \ contrib/hdtbl \ contrib/mm \ contrib/pdfmark \ contrib/pic2graph \ contrib/mom \ doc \ man \ src/roff/grog \ src/roff/nroff \ tmac # OTHERDIRS is handled specially in the `$(TARGETS)' rule to avoid # dependency problems with parallel builds. ALLDIRS=\ $(INCDIRS) \ $(LIBDIRS) \ $(PROGDIRS) \ $(DEVDIRS) \ $(XDEVDIRS) \ $(OTHERDEVDIRS) \ $(TTYDEVDIRS) # $(OTHERDIRS) EXTRADIRS=\ font/devps/generate \ font/devdvi/generate \ font/devlj4/generate \ doc NOMAKEDIRS=\ m4 \ arch/djgpp \ contrib/chem/examples \ contrib/chem/examples/122 \ contrib/hdtbl/examples \ contrib/mm/examples \ contrib/mm/mm \ contrib/mom/examples \ contrib/mom/momdoc \ contrib/gdiffmk/tests \ src/libs/snprintf \ src/libs/gnulib/lib \ src/libs/gnulib/lib/uniwidth \ src/libs/gnulib/m4 \ src/libs/gnulib/build-aux \ src/libs/gnulib/build-aux/snippet \ src/libs/gnulib \ font/devps/old \ font/devpdf/util \ font/util GNULIBDIRS=\ src/libs/gnulib DISTDIRS=\ $(INCDIRS) \ $(ALLLIBDIRS) \ $(ALLPROGDIRS) \ $(DEVDIRS) \ $(XDEVDIRS) \ $(OTHERDEVDIRS) \ $(ALLTTYDEVDIRS) \ $(OTHERDIRS) \ $(EXTRADIRS) \ $(NOMAKEDIRS) \ $(GNULIBDIRS) TARGETS=\ all \ install_bin install_data \ clean distclean mostlyclean realclean extraclean \ distfiles \ TAGS \ depend \ uninstall_sub \ fonts # This ENVSETUP gork is required by the DJGPP build on Windows 9X, # where Make needs to be case-sensitive to find files like BI and VERSION. ENVSETUP=\ if test -f $(srcdir)/makefile.ccpg* && \ test -f $(srcdir)/Makefile.ccpg*; then \ FNCASE=y; export FNCASE; \ else :; \ fi do=all dodirs=$(ALLDIRS) $(OTHERDIRS) dot # Default target for subdir_Makefile subdir=src/roff/troff $(TARGETS): @$(ENVSETUP); $(MAKE) $(MAKE_K_FLAG) do=$@ $(ALLDIRS) @$(ENVSETUP); $(MAKE) $(MAKE_K_FLAG) do=$@ $(OTHERDIRS) dot clean: clean-gnulib clean-gnulib: @$(ENVSETUP); cd src/libs/gnulib; $(MAKE) $(MAKE_K_FLAG) clean distclean: distclean-gnulib distclean-gnulib: @$(ENVSETUP); cd src/libs/gnulib; $(MAKE) $(MAKE_K_FLAG) distclean rm -rf src/libs/gnulib/autom4te.cache dot: FORCE @$(ENVSETUP); \ $(MAKE) $(MAKE_K_FLAG) $(MDEFINES) srcdir=$(srcdir) VPATH=$(srcdir) \ -f $(top_srcdir)/Makefile.comm \ -f $(top_srcdir)/Makefile.sub $(do) $(LIBDIRS): FORCE $(INCDIRS) $(PROGDEPDIRS) $(GNULIBDIRS) @$(ENVSETUP); \ if test $(srcdir) = .; then \ srcdir=.; \ else \ srcdir=$(top_srcdir)/$@; \ fi; \ test -d $@ || $(mkinstalldirs) $@; \ cd $@; \ test -f Makefile.dep || touch Makefile.dep; \ $(MAKE) $(MAKE_K_FLAG) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \ -f $(top_srcdir)/Makefile.comm \ -f $$srcdir/Makefile.sub \ -f $(top_srcdir)/Makefile.lib \ -f Makefile.dep $(do) $(CPROGDIRS) $(XPROGDIRS): FORCE $(LIBDIRS) @$(ENVSETUP); \ if test $(srcdir) = .; then \ srcdir=.; \ else \ srcdir=$(top_srcdir)/$@; \ fi; \ test -d $@ || $(mkinstalldirs) $@; \ cd $@; \ test -f Makefile.dep || touch Makefile.dep; \ $(MAKE) $(MAKE_K_FLAG) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \ -f $(top_srcdir)/Makefile.comm \ -f $$srcdir/Makefile.sub \ -f $(top_srcdir)/Makefile.cpg \ -f Makefile.dep $(do) $(CCPROGDIRS): FORCE $(LIBDIRS) @$(ENVSETUP); \ if test $(srcdir) = .; then \ srcdir=.; \ else \ srcdir=$(top_srcdir)/$@; \ fi; \ test -d $@ || $(mkinstalldirs) $@; \ cd $@; \ test -f Makefile.dep || touch Makefile.dep; \ $(MAKE) $(MAKE_K_FLAG) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \ -f $(top_srcdir)/Makefile.comm \ -f $$srcdir/Makefile.sub \ -f $(top_srcdir)/Makefile.ccpg \ -f Makefile.dep $(do) $(DEVDIRS) $(XDEVDIRS) $(OTHERDEVDIRS) $(TTYDEVDIRS): FORCE \ $(PROGDEPDIRS) $(CCPROGDIRS) $(CPROGDIRS) @$(ENVSETUP); \ if test $(srcdir) = .; then \ srcdir=.; \ else \ srcdir=$(top_srcdir)/$@; \ fi; \ test -d $@ || $(mkinstalldirs) $@; \ cd $@; \ $(MAKE) $(MAKE_K_FLAG) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \ -f $(top_srcdir)/Makefile.comm \ -f $$srcdir/Makefile.sub \ -f $(top_srcdir)/Makefile.dev $(do) $(GNULIBDIRS): FORCE @$(ENVSETUP); \ if test $(srcdir) = .; then \ srcdir=.; \ else \ srcdir=$(top_srcdir)/$@; \ fi; \ test -d $@ || $(mkinstalldirs) $@; \ case $(do) in \ all) \ cd $@; \ args=`$(top_builddir)/config.status --config`; \ test -f Makefile \ || eval $$srcdir/configure "$$args" --srcdir=$$srcdir; \ $(MAKE) ACLOCAL=: AUTOCONF=: AUTOHEADER=: AUTOMAKE=: $(do) ;; \ esac $(OTHERDIRS): $(PROGDEPDIRS) $(CCPROGDIRS) $(CPROGDIRS) $(SHPROGDIRS) $(INCDIRS) $(PROGDEPDIRS) $(SHPROGDIRS) $(OTHERDIRS): FORCE @$(ENVSETUP); \ if test $(srcdir) = .; then \ srcdir=.; \ else \ srcdir=$(top_srcdir)/$@; \ fi; \ test -d $@ || $(mkinstalldirs) $@; \ cd $@; \ $(MAKE) $(MAKE_K_FLAG) $(MDEFINES) srcdir=$$srcdir VPATH=$$srcdir \ -f $(top_srcdir)/Makefile.comm \ -f $$srcdir/Makefile.sub \ -f $(top_srcdir)/Makefile.man $(do) .PHONY: dist dist: if test "${doc_dist_target_ok}" != yes; then \ echo "The \`dist' target is not applicable to this configuration"; \ exit 1; \ fi -rm -fr tmp rm -f groff-$(version)$(revision).tar.gz mkdir tmp for d in $(DISTDIRS); do \ $(mkinstalldirs) tmp/$$d; \ done cp Makefile tmp -cp * tmp 2>/dev/null -for d in $(DISTDIRS); do \ (cd tmp/$$d; \ cp $(top_srcdir)/$$d/* . 2>/dev/null;); \ done cd tmp; $(MAKE) srcdir=. VPATH=. distfiles cd tmp; $(MAKE) srcdir=. VPATH=. extraclean for d in $(EXTRADIRS); do \ (cd tmp/$$d; \ if test -f Makefile; then \ $(MAKE) extraclean; \ else \ $(MAKE) -f $(top_builddir)/$$d/Makefile extraclean; \ fi); \ done for d in $(GNULIBDIRS); do \ (cd tmp/$$d; \ if test -f config.status; then \ ./config.status; \ fi; \ if test -f Makefile; then \ $(MAKE) distclean; \ else \ $(MAKE) -f $(top_builddir)/$$d/Makefile distclean; \ fi; \ rm -rf autom4te.cache); \ done rm -f tmp/Makefile cp Makefile.init tmp/Makefile mv tmp groff-$(version)$(revision) tar cfh - groff-$(version)$(revision) \ | gzip -c >groff-$(version)$(revision).tar.gz rm -fr groff-$(version)$(revision) # $(PROGDIRS): libgroff # grops grotty grodvi: libdriver # refer lookbib indxbib lkbib: libbib # $(LIBDIRS) $(PROGDIRS): include .PHONY: $(ALLDIRS) dot $(TARGETS) FORCE # Create a Makefile in $(subdir). This is useful for development since it # avoids running make recursively. subdir_Makefile: Makefile.cfg $(MAKE) do=Makefile $(subdir) Makefile.cfg: Makefile >Makefile.cfg for var in $(MDEFINES); do \ echo "$$var" >>Makefile.cfg; \ done Makefile: Makefile.in $(SHELL) config.status .PHONY: install install: -test -d $(DESTDIR)$(prefix) \ || $(mkinstalldirs) $(DESTDIR)$(prefix) @$(ENVSETUP); $(MAKE) $(MAKE_K_FLAG) $(MDEFINES) \ do=do_install $(dodirs) cd $(DESTDIR)$(dataprogramdir); \ rm -f current; \ $(LN_S) $(version)$(revision) current .PHONY: uninstall uninstall: uninstall_sub uninstall_dirs .PHONY: uninstall_dirs # Use `rmdir' here so that the directories are only removed if they are empty. uninstall_dirs: rm -f $(DESTDIR)$(dataprogramdir)/current -rmdir \ $(DESTDIR)$(man1dir) \ $(DESTDIR)$(man5dir) \ $(DESTDIR)$(man7dir) \ $(DESTDIR)$(manroot) \ $(DESTDIR)$(tmacdir) \ $(DESTDIR)$(systemtmacdir) \ $(DESTDIR)$(localtmacdir) \ $(DESTDIR)$(fontdir) \ $(DESTDIR)$(localfontdir) \ $(DESTDIR)$(oldfontdir) \ $(DESTDIR)$(bindir) \ $(DESTDIR)$(datasubdir) \ $(DESTDIR)$(dataprogramdir) \ $(DESTDIR)$(libprogramdir) \ $(DESTDIR)$(libdir) \ $(DESTDIR)$(infodir) \ $(DESTDIR)$(exampledir) \ $(DESTDIR)$(htmldocdir) \ $(DESTDIR)$(pdfdocdir) \ $(DESTDIR)$(docdir) \ $(DESTDIR)$(datadir)/doc/groff \ $(DESTDIR)$(datadir)/doc \ $(DESTDIR)$(datadir) 2>/dev/null || : .PHONY: check check: @echo There is no validation suite for this package. #check: site.exp docheck #.PHONY: docheck #docheck: # if $(SHELL) -c "runtest --version" > /dev/null 2>&1; then \ # runtest; \ # else \ # echo "WARNING: could not find \`runtest'" 1>&2; \ # fi # This snippet has been taken from the automake package. #site.exp: # @echo "Making a new site.exp file..." # @echo "## these variables are automatically generated by make ##" >site.tmp # @echo "# Do not edit here. If you wish to override these values" >>site.tmp # @echo "# edit the last section" >>site.tmp # @echo "set tool groff" >>site.tmp # @echo "set srcdir $(srcdir)/testsuite" >>site.tmp # @echo "set objdir `pwd`" >> site.tmp # @echo "## All variables above are generated by configure. Do not edit! ##" >> site.tmp # @test ! -f site.exp \ # || sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp # @rm -f site.bak # @test ! -f site.exp || mv site.exp site.bak # @mv site.tmp site.exp FORCE: .NOEXPORT: ######################################################################## # Emacs settings ######################################################################## # # Local Variables: # mode: makefile # End: groff-1.22.3/PaxHeaders.22577/TODO0000644000000000000000000000013212426110213014365 xustar000000000000000030 mtime=1415090315.147524972 30 atime=1415090315.147524972 30 ctime=1415090315.147524972 groff-1.22.3/TODO0000644000175000001440000000223612426110213013226 0ustar00wlusers00000000000000# Copyright (C) 2000-2014 Free Software Foundation, Inc. # # This file is part of `groffer' which is part of `groff'. # # `groff' is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # `groff' is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see # . Unicode input: Making groff 21bit input-clean. Make -Tlj4 work with -X. Guess man5ext and man7ext variables. Provide man.sun implementing .TX. Improve GROFF_PRINT macro in aclocal.m4. Provide a `check' target. Provide a `bindist' target. Implement tmac.bib in terms of tmac.s. Support long options using GNU getopt. Catch the following error in -me: .(z .(l C .)z Arrows for next/previous page from R5 xditview. groff-1.22.3/PaxHeaders.22577/ChangeLog.1180000644000000000000000000000013212426110213015757 xustar000000000000000030 mtime=1415090315.139525072 30 atime=1415090315.139525072 30 ctime=1415090315.139525072 groff-1.22.3/ChangeLog.1180000644000175000001440000036515312426110213014632 0ustar00wlusers00000000000000 Version 1.18.1 released ======================= 2002-10-08 Werner LEMBERG * doc/webpage.ms, NEWS: Updated. 2002-10-07 Werner LEMBERG * tmac/doc-common (Ss): Add final `.ns' (similar to `.Sh') to suppress additional whitespace after the header. * tmac/doc-ditroff, tmac/doc-nroff (Am): New string to be in sync with NetBSD. * src/preproc/grn/grn.man, tmac/groff_mdoc.man, NEWS: Updated. 2002-10-07 Ruslan Ermilov * tmac/doc-common(doc-volume-operating-system-ateol): New flag. (Dt): Use it to improve language localization (especially Russian and French). 2002-10-07 Daniel Senderowicz * src/preproc/grn/gprint.h (BSPLINE, BEZIER): New macros. * src/preproc/grn/hdb.cc (DBGetType): Parse spline and bezier drawing commands. * src/preproc/grn/hgraph.cc (drawwig): Add parameter to control curve type. Call `picurve' for BSPLINE. (HGPrintElt): Handle BSPLINE. * src/preproc/grn/README: Document it. 2002-10-03 Werner LEMBERG * src/roff/troff/node.cc (break_char_node::col): New variable. Updated constructor. (space_node::tprint, word_space_node::tprint): Call `fill_color' unconditionally. (space_node::space_node): Remove assertion. (break_char_node::add_self): Pass color argument to space node. * src/roff/troff/input.cc (token::add_to_node_list, token::process): Ditto. * src/roff/troff/env.cc (environment::do_break, environment::add_padding): Ditto. 2002-10-02 Werner LEMBERG Redesigning color support in troff. Colors are no longer represented as separate nodes but are now part of glyph nodes and friends. This fixes the current formatting misbehaviour due to the changes introduced on 2002-09-20. Some extra code is necessary for proper grotty support: Without adding color variables to space-related nodes, the background color would be changed too late. * src/roff/troff/node.h, src/roff/troff/node.cc: s/current_pagecolor/current_fill_color/. s/current_glyphcolor/current_glyph_color/. (glyph_color_node, fill_color_node): Removed. (node::get_glyph_color, node::get_fill_color): New virtual member functions. (space_node::col): New variable. Updated constructors of space_node and derived classes accordingly. (hmotion_node::col): New variable. Updated constructors of hmotion_node and space_char_hmotion_node accordingly. (vmotion_node::col): New variable. Updated constructor accordingly. (draw_node::gcol, draw_node::fcol): New variables. Updated constructor accordingly. (special_node::gcol, special_node::fcol): New variables. Updated constructors accordingly. (troff_output_file::put_char, troff_output_file::put_charwidth, troff_output_file::draw): Set glyph and fill color. (troff_output_file::start_special): Set glyph and fill color. Always set current font. (troff_output_file::fill_color, troff_output_file::glyph_color): Don't call `do_motion'. (glyph_node::gcol, glyph_node::fcol): New variables. Updated constructors of glyph_node and ligature_node accordingly. (glyph_node::get_glyph_color, glyph_node::get_fill_color): New member functions. (glyph_node::merge_glyph_node, kern_pair_node::add_discretionary_hyphen, node::add_discretionary_hyphen): Updated. (break_char_node::merge_self): Updated. (word_space_node::tprint, space_node::tprint, hmotion_node::tprint, vmotion_node::tprint): Handle color. (make_glyph_node, make_node, node::add_char): Updated. * src/roff/troff/env.cc (environment::space_newline, environment::space, environment::output_line, environment::do_break, environment::make_tab_node, environment::add_padding, title): Updated. (environment_switch, environment_copy): Don't add color nodes. * src/roff/troff/input.cc (do_glyph_color, do_fill_color): Return nothing. (token::next): Updated. \m and \M now are as transparent as \s. (process_input_stack, token::add_to_node_list, token::process, read_draw_node): Updated. (charinfo_to_node_list): Don't add color nodes. * doc/groff.texinfo: Updated. 2002-09-27 Ruslan Ermilov * tmac/doc-common (ds-operating-system-FreeBSD-4.*): New version strings. 2002-09-27 Colin Watson * src/roff/troff/node.cc (bracket_node::copy): Check `list' != 0. 2002-09-23 Werner LEMBERG * src/devices/grolbp/lbp.cc: Replace `300' with `font::res' where appropriate. (DEFAULT_LINEWIDTH_FACTOR): New macro. (linewidth_factor): New global variable. (lbp_printer::set_line_thickness): Fix case for size < 0, using linewidth_factor. (long_options): Add -w/--linewidth option. (usage): Updated. (main): Handle -w option to set linewidth_factor. (lbp_printer::lbp_printer): Initialize req_linethickness, not line_thickness. * src/devices/grolbp/grolbp.man, NEWS, doc/webpage.ms: Updated. 2002-09-22 Paco Andrés Verdú Fixed a bug in the line thickness setting code. * src/devices/grolbp/lbp.cc (lbp_printer::req_linethickness): New variable. (lbp_printer::set_line_thickness): Pass environment as second parameter. Implement it actually. (lpb_printer::set_char, lbp_printer::draw): Use `req_linethickness' and `set_line_thickness, depending on the current font size. 2002-09-21 Werner LEMBERG Some Debian patches. * src/roff/groff/pipeline.h (MAX_COMMANDS): Increase to 12. * src/roff/troff/node.cc (bracket_node::copy): Initialize `list->last'. 2002-09-20 Werner LEMBERG * configure: Regenerated with autoconf 2.54. 2002-09-20 Werner LEMBERG * src/roff/troff/env.h (environment): Rename cur_glyph_color to glyph_color. Rename cur_fill_color to fill_color. * src/roff/troff/env.cc: Updated. 2002-09-20 Werner LEMBERG * src/roff/troff/env.cc (title): Copy color status after processing title. * src/roff/troff/input.cc (charinfo_to_node_list): Emit glyph and fill color nodes to reset colors properly. * tmac/www.tmac (DC): Fix color handling. * src/preproc/pic/pic.man, doc/pic.ms: Document some color issues. * doc/groff.texinfo: Fixing documentation of `tl' request. * doc/webpage.ms: Updated. 2002-09-19 Werner LEMBERG * src/roff/troff/env.cc (environent_switch, environment_copy): Emit glyph and fill color nodes to initialize colors properly. 2002-09-17 Colin Watson * src/roff/troff/env.cc (environment::set_glyph_color, environment::set_fill_color): Fix typo which prevented \m[] work correctly. 2002-09-17 Werner LEMBERG Add left and right italic correction to non-slanted PS fonts. This is an experimental feature to improve image rendering of grohtml. * font/devps/generate/Makefile (RFLAG): New variable, set to `-i 0'. ({T,H,C,P,N,BM,A,HN}{R,B}, ZD, S, ZDR): Use it. * font/devps/*: All non-slanted fonts regenerated. * NEWS: Updated. 2002-09-16 Werner LEMBERG Add a site-specific font directory. * Makefile.in (localfontdir, legacyfontdir): New variables. (fontpath): Use them. (MDEFINES, uninstall_dirs): Updated. * Makefile.comm (.man.n): Add `LOCALFONTDIR' and `LEGACYFONTDIR'. Remove `FONTPATH' and `MACROPATH'. * src/roff/troff/troff.man, NEWS: Updated. * doc/groff.texinfo (Font Directories): New section. Other minor fixes. * src/devices/grodvi/grodvi.man, src/devices/grohtml/grohtml.man, src/devices/grolbp/grolbp.man, src/devices/grolj4/grolj4.man, src/preproc/grn/grn.man: Minor fixes. * src/devices/grohtml/post-html.cc (html_printer::do_tab_ts): Remove unused variable. 2002-09-11 Werner LEMBERG * doc/groff.texinfo, man/groff_font.man: Clarify argument of \N. * man/groff_out.man: Fix documentation of 'N'. 2002-09-09 Gaius Mulley * doc/Makefile.in (webpage.html): Depend on gnu.eps also. * src/roff/troff/env.cc (indent): Emit html tag only if break_flag is set. * src/devices/grohtml/post-html.cc (text_glob::is_br_ni): Removed. (text_glob::is_br, html_printer::lookahead_for_tables): Updated. (html_printer::do_tab_ts): Call `emit_table_header' with `FALSE'. * src/devices/grohtml/html-text.cc (html_text::start_tag) : Call `begin' with `FALSE'. 2002-09-09 Ralph Corderoy * src/libs/libgroff/string.cc (string::extract): Fix position of terminating null byte. 2002-09-08 Werner LEMBERG Add global option `nospaces' to tbl so that leading and trailing spaces in data items are ignored. * src/libs/libgroff/string.cc (string::remove_spaces): New member function to remove leading and trailing spaces. * src/include/stringclass.h: Updated. * src/preproc/tbl/table.h (table): Add flag `NOSPACES'. * src/preproc/tbl/main.cc (process_options): Handle `nospaces' option. Fix typo in error messages. (process_data): Implement `nospaces' option. * src/preproc/tbl/tbl.man, NEWS, doc/webpage.ms: Updated. 2002-09-07 Werner LEMBERG * src/include/config.hin: Add `HAVE_ISATTY'. * src/libs/libgroff/tmpfile.cc (xtmpfile_list): Drop `const' for `fname' member. * src/libs/libgroff/tmpname.cc: Include `time.h'. * src/libs/libdriver/input.cc (Char): Add `operator==' and `operator!=' for `char'. * doc/groff.texinfo: Replace @ifnottex block for top node with @ifhtml block. 2002-09-06 Werner LEMBERG * doc/Makefile.in (.texinfo.html): Add -I switch. * doc/groff.texinfo: Add @ifnottex block for top node to make translation to HTML work. 2002-09-05 Gaius Mulley * src/preproc/html/pre-html.cc (LETTER_LENGTH): Removed. (get_papersize, determine_vertical_offset): Removed. (char_buffer::do_image): Always specify letter size. (main): Updated. (imageList::createPage): Use -dDEVICEHEIGHTPOINTS instead of -sPAPERSIZE. 2002-09-05 Werner LEMBERG * doc/groff.texinfo, tmac/groff_man.man: Improve documentation of default indentation. 2002-09-04 Gaius Mulley * src/preproc/html/pre-html.cc (imageList::createPage): Use -sPAPERSIZE for gs. (generateImages): Clean up push-back buffer. 2002-09-04 Ralph Corderoy * doc/groff.texinfo: Minor fixes. 2002-08-21 Gaius Mulley * src/preproc/html/pre-html.cc (DEFAULT_LINE_LENGTH): New macro. (MAX_WIDTH, A4_LENGTH, A4_OFFSET, LETTER_OFFSET): Removed. (gsPaper): Removed. (determine_vertical_offset): Use LETTER_LENGTH. (createPage): Moved to ... (imageList::createPage): This. Call gs with -dDEVICEWIDTHPOINTS to avoid cropping. (imageList::getMaxX): New function. (createImage): Moved to ... (imageList::createImage): This. (imageList::createImages): New function. (generateImages): Read `maxx' directly. Updated. (scanArguments): Don't specify `gsPaper' for `-o'. (makeTempFiles): Call `xtmpfile' with the last argument set to `TRUE'. 2002-08-24 Werner LEMBERG * src/include/nonposix.h (mkdir, WAIT, creat) [_MSC_VER]: Define. (WAIT, _WAIT_CHILD) [!_MSC_VER]: Define. * src/preproc/html/pre-html.cc (waitForChild): Use WAIT. * src/preproc/html/pushback.cc: Include nonposix.h. * src/roff/groff/pipeline.c: Define strcasecmp and strncasecmp conditionally. 2002-08-23 Werner LEMBERG Use $(OBJEXT) for the object file extension. * Makefile.comm (.SUFFIXES): Add .obj. (.cc.obj, .c.obj): New implicit rules. * Makefile.in (OBJEXT): New variable, initialized from autoconf. (MDEFINES): Add EXEEXT and OBJEXT. * */Makefile.sub: s/.o/.$(OBJEXT)/. 2002-08-22 Werner LEMBERG * INSTALL: Mention texinfo 4.2 as a prerequisite. 2002-08-21 Gaius Mulley * src/devices/grohtml/post-html.cc (colType): Make enum global to the file. (html_printer::update_min_max, html_printer::add_table_end): New methods. (html_printer::lookahead_for_tables): Use them. Reset page offset correctly. (html_printer::~html_printer): Add creation of creator comment up. 2002-08-20 Werner LEMBERG * tmac/an-old.tmac (T&): New dummy macro to avoid warning. * man/groff_tmac.man: Fix typos. * man/groff_font.man: Minor reordering. * contrib/eqn2graph/eqn2graph.man (Tp): New macro. 2002-08-18 Gaius Mulley Avoid endless loops while scanning for tables. * src/devices/grohtml/post-html.cc (list::insert): Set ptr->right->left. (html_printer::next_horiz_pos): Add `text_glob' argument; update all callers. Return immediately if that argument is NULL. (html_printer::calc_nf): Don't test if `g' is NULL. (html_printer::lookahead_for_tables): Use `glyphs.move_right_get_data'. Don't test if `g' is NULL. 2002-08-18 Gaius Mulley A better fix, replacing fix 2002-08-15, for increasing SIZE. * src/devices/grohtml/post-html.cc (char_block): Make `buffer' a pointer. (char_block::char_block): Allocate `buffer'. (char_buffer::add_string): Use it. 2002-08-15 Werner LEMBERG * src/devices/grops/grops.man, src/devices/grolj4/grolj4.man, src/devices/grodvi/grodvi.man: Document default line thickness. 2002-08-15 Gaius Mulley * src/devices/grohtml/post-html.cc (char_block): Increase SIZE to 8192. 2002-08-14 Werner LEMBERG * doc/webpage.ms: Updated. 2002-08-09 Werner LEMBERG * src/roff/troff/node.cc (node::add_char): Call `freeze_space' for unbreakable space. 2002-08-08 Aaron Campbell * src/preproc/pic/object.cc (object_spec::make_move): Fix typo (&& -> &). 2002-08-08 Werner LEMBERG * src/roff/troff/input.cc (read_rgb, read_cmy, read_cmyk): Call tok.next(). (read_gray): Ditto. Don't push back a space but a newline onto the stack. 2002-08-07 Gaius Mulley Add fonts `CI', `CB', and `CBI' to grohtml which have been omitted inadvertently. * src/devices/grohtml/post-html.cc (html_printer::end_font, html_printer::start_font): Handle them. * src/devices/grohtml/html-text.cc (html_text::do_italic): Don't reset bold and tt. (html_text::do_bold): Don't reset italic and tt. (html_text::do_tt, html_text::do_pre): Don't reset bold and italic. * font/devhtml/DESC.proto: Add those fonts. * font/devhtml/Makefile.sub (PROTOFONTS): Updated. 2002-08-07 Werner LEMBERG * MORE.STUFF: Added gpresent. * tmac/trace.tmac: Show nesting level by a corresponding amount of whitespace before printing the logging message. 2002-07-31 Colin Watson * src/devices/grohtml/html-table.cc (html_table::finish_row): Initialize `n' to zero. This fixes a segfault on ARM. 2002-07-30 Werner LEMBERG * doc/grnexmpl.me: Remove calls to .st and .sc which are undefined. 2002-07-29 Werner LEMBERG * src/preproc/pic/pic.y (print_arg, relative_path): Add missing final semicolon. 2002-07-28 Colin Watson * src/devices/grohtml/post-html (html_printer::troff_tag): Handle `.ps'. (html_printer::html_printer): Initialize `pointsize'. 2002-07-26 Werner LEMBERG * doc/Makefile.sub (PROCESSEDEXAMPLEFILES): Remove gnu.eps and gnu.png. (CLEANNOTSRCDIRADD): Add gnu.eps and gnu.png. (gnu.eps): Add -rle switch to pnmtops. (distfiles): Add gnu.eps and gnu.png. 2002-07-25 Petter Reinholdtsen * src/libs/libdriver/input.cc (Char): Add const to `operator=='. Add `operator!='. 2002-07-24 Werner LEMBERG * doc/Makefile.in, doc/Makefile.sub (groff_bin_path): Don't use ' \+' but ' *' for sed. (GROFF): Set GROFF_COMMAND_PREFIX to empty value. 2002-07-23 Werner LEMBERG * doc/groff.texinfo: Document `papersize' keyword. * NEWS, man/groff_font.man: Updated. 2002-07-23 Colin Watson Extend papersize keyword to accept more than a single entry. The first valid will be used. * src/libs/libgroff/font.cc (font::load_desc): Implement it. (font::scan_papersize): Really skip final newline. * src/preproc/html/pre-html.cc (get_papersize): Ditto. 2002-07-23 Werner LEMBERG * configure.ac: Test for isatty. * configure: Regenerated. * src/include/posix.h: Check HAVE_ISATTY. * src/roff/troff/input.cc [ISATTY_MISSING]: Removed. * src/utils/lookbib/lookbib.cc: Include posix.h. Don't declare isatty. 2002-07-21 Werner LEMBERG * NEWS: Add `output' request. * REVISION: Increased to 1. Version 1.18.0 released ======================= 2002-07-19 Gaius Mulley Allow internal glyph indices > 0xFF in grohtml for input characters. * src/devices/grohtml/post-html.cc (to_unicode): Use `unsigned int' as parameter. (html_printer::add_to_sbuf): Use `unsigned int' as first parameter. Updated all callers. (html_printer::sbuf_continuation, html_printer::overstrike): Ditto. (html_printer): Updated. 2002-07-19 Werner LEMBERG * font/devhtml/R.proto: Updated to HTML 4, adding many glyphs. * font/devutf8/R.proto: Adding some missing glyphs. * font/devutf8/NOTES: Updated. * tmac/dvi.tmac: Add more composite glyphs. * tmac/html.tmac: Updated. * man/groff_char.man: Add `sum' and `product' entities. * NEWS: Updated. 2002-07-18 Gaius Mulley Improved table, tab, and indenting support. * src/roff/troff/input.cc (file_iterator::suppress_newline_flag, string_iterator::suppress_newline_flag): Removed. Updated all function which have used it. * src/roff/troff/env.cc: Include `input.h'. (environment::add_node): Accept 0 as parameter. (environment::add_html_tag): Add `force' parameter. Updated all callers. (environment::add_html_tag_tabs): Ditto. For the moment, support left-aligned tabs only. (environment::make_html_tag): New function. (fill, no_fill): Set .br html tag additionally. (environment::newline): Emit `eol.ce' or `eol' tag for html. (environment::add_html_tag_eol): Removed. (tab_stops::distance_to_next_tab): Add variant for handling nextpos'. (environment::distance_to_next_tab): Ditto. Updated all callers. (environment::handle_tab): Handle tabs for html. * src/roff/troff/env.h: Updated. * src/roff/troff/div.cc: Updated all callers of `environment::add_html_tag'. * src/devices/grohtml/html-table.cc, src/devices/grohtml/html-table.h: New files. * src/devices/grohtml/html-text.cc (html_text): New members `blank_para' and `start_space'. (html_text::issue_tag): Don't emit TABLE_TAG. Handle indentation for PRE_TAG and P_TAG. (html_text::end_tag): Updated. (html_text::table_is_void, html_text::issue_table_begin, html_text::issue_table_end): Removed. (html_text::do_push): Simplified. [DEBUGGING]: Small fix. (html_text::push_para): Add new parameter for indentation; updated all callers. Handle PRE_TAG. (html_text::do_indent, html_text::do_table, html_text::done_table, html_text::is_in_table): Removed. (html_text::do_pre): Handle P_TAG also. (html_text::shutdown): Handle p->indent. (html_text::check_emit_text): Simplified. (html_text::do_emittext): Reset `blank_para'. (html_text::do_para): Add new parameter for indentation; updated all callers. (html_text::remove_indent): New function. (html_text::do_space): Handle verbatim text properly. (html_text::ever_emitted_text, html_text::starts_with_space, html_text::remove_para_align): New functions. (html_text::dump_stack_element, html_text::dump_stack): Updated. * src/devices/grohtml/html_text.h (HTML_TAG): Remove TABLE_TAG. Updated. * src/devices/grohtml/post-html.cc: Include html-table.h. (INDENTATION): Removed. (text_glob): Added many `is_' functions. Added table description `tab'. Added `get_arg',`get_tab_args', `remember_table', and `get_table' member functions. (list): Add `insert' and `move_to' member functions. (page): Add `insert_tag' member function. (page::dump_page) [DEBUG_TABLES]: Improved. (html_printer): Add `table' and `max_linelength' elements. Add many `do_', `insert_', `next_horiz_pos', `lookahead_for_tables', `shutdown_table', `calc_nf', `calc_po_in', `remove_tabs', `remove_courier_tabs'. (html_printer::emit_raw): Handle indentation. (html_printer::do_center, html_printer::write_header): Updated. (html_printer::is_courier_until_eol): Check for tag. (html_printer::do_linelength): Handle max_linelength. (html_printer::do_page_offset, html_printer::do_indentation): Handle fill_on. (html_printer::do_tempindent): Updated. (html_printer::do_indentedparagraph): Removed. (html_printer::do_indent): Simplified. (html_printer::do_eol): Use `ever_emitted_text'. (html_printer::do_flush, html_printer::do_links): Don't call done_table. (html_printer::do_break): Handle end_tempindent. (html_printer::troff_tag): Get argument. Don't handle `.ip'. Handle `.tab-ts', `.tab-te', `.col', `tab', and `tab0' tags. (html_printer::flush_page): Call `lookahead_for_tables'. Don't call `done_table'. (html_printer::add_to_sbuf): Always call do_indent. * src/devices/grohtml/Makefile.sub: Updated. * tmac/an-old.tmac (TP): Don't handle html device specially. (an-do-tag-html): New function which will be used instead of `an-do-tag' if html device is used. * tmac/html.tmac: Call .po to pass default page offset to grohtml. * tmac/s.tmac (@IP): Don't handle html device specially. (@IP-html): New function which will be used instead of `@IP' if html device is used. * tmac/www.tmac (HTML-NS, HTML-TAG-NS): New auxiliary macros -- this is a hack which will eventually vanish again. (PIMG): Handle `-C' option correctly if not html. (HR): Use HTML-NS. 2002-07-17 Werner LEMBERG * src/utils/afmtodit/afmtodit.pl: Don't use `-P-' for invoking perl. 2002-07-14 Eric S. Raymond * contrib/pic2graph/pic2graph.*: Use convert(1). * contrib/eqn2graph/eqn2graph.*: Minor fixes. 2002-07-14 Bernd Warken * tmac/groff_trace.man: New file. * tmac/Makefile.sub: Updated. * NEWS: Updated. 2002-07-13 Werner LEMBERG * src/roff/groff/groff.man: Add some cross references. 2002-07-12 Werner LEMBERG * src/roff/troff/input.cc (substring_request): Add warnings for string indices out of range. 2002-07-11 Werner LEMBERG * font/devdvi/generate/ec.map: Fix typo (`(l' -> `/l'). * font/devdvi/*EC: Regenerated. 2002-07-10 Bernd Warken * man/groff_char.man: Updated and extended. 2002-07-10 Werner LEMBERG * src/roff/troff/input.cc (length_macro): Renamed to... (length_request): This. Move call of `tok.next()' to the very end, otherwise the register value hasn't been updated yet. (init_input_requests): Updated. 2002-07-09 Werner LEMBERG * src/roff/troff/input.cc (substring_macro): Renamed to... (substring_request): This. (init_input_requests): Updated. * src/roff/troff/request.h: Updated. 2002-07-08 Robert D. Goulding * src/roff/grog/grog.sh: Fix typo. 2002-07-08 Werner LEMBERG * win32-diffs: Updated. Handle `papersize' keyword properly in DESC. * src/libs/libgroff/font.cc (font::scan_papersize): Fix argument type. Updated all callers. * src/libs/libgroff/paper.cc: Add four more paper formats used by grolj4. * src/include/paper.h: Updated. * src/devices/grolbp/lbp.cc: Remove unnecessary semicolons. Other minor C syntax fixes. (papersize, paperlength, paperwidth): Renamed to `user_*'. (lbp_printer): Add `papersize', `paperlength', and `paperwidth' members. (lbp_printer::lbp_printer): Pass three arguments. Set paper dimensions properly. (make_printer, main): Updated. (handle_unknown_desc_command): Fix error messages. (main): Handle papersize keyword in DESC properly. * src/devices/grolj4/lj4.cc (paper_size): Renamed to `user_paper_size'. (lbp_printer::lbp_printer): Pass an argument. Set paper_size properly. (handle_unknown_desc_command): Removed. (make_printer, main): Updated. * src/devices/grolj4/grolj4.man: Minor documentation fix. * man/groff_font.man, NEWS: Updated. 2002-07-07 Werner LEMBERG Integrated eqn2graph, contributed by Eric S. Raymond. * contrib/eqn2graph/{Makefile.sub, eqn2graph.sh, eqn2graph.man}: New files. * Makefile.in, NEWS: Updated. 2002-06-04 Werner LEMBERG Changing the substring request to make it fit better with other string manipulation functions in other programming languages: Index 0 is now the first character in the string, and index -1 indicates the last character. Since this request didn't work properly anyway in the last release, it doesn't harm too much to change the syntax. * src/roff/troff/input.cc (substring_macro): Use loops to get the real string length (ignoring COMPATIBLE_SAVE and COMPATIBLE_RESTORE) and offsets. Implement change described above. * man/groff_char.man, tmac/doc-common (doc-header), tmac/doc.tmac (doc-do-Bd-args, doc-do-Bl-args): Changed accordingly. * NEWS, doc/groff.texinfo, man/groff_diff.man: Updated. 2002-06-03 Werner LEMBERG Make .chop work with .de1 and friends. COMPATIBLE_SAVE and COMPATIBLE_RESTORE are completely ignored. * src/roff/troff/input.cc (char_list::set, char_list::get): New functions. (macro): `length' field renamed to `len'. Added new field `empty_macro' (1 if macro is empty), to be used instead of checking `len'. Updated all callers. (macro::empty): Updated. (macro::length, macro::set, macro::get): New functions. (macro::append): Ignore COMPATIBLE_SAVE and COMPATIBLE_RESTORE. Set `empty_macro'. (chop_macro): Check and remove trailing COMPATIBLE_SAVE/ COMPATIBLE_RESTORE pairs. (asciify): Ignore COMPATIBLE_SAVE and COMPATIBLE_RESTORE. * src/roff/troff/request.h: Updated. * doc/groff.texinfo: Document .chop's behaviour better. 2002-06-02 Werner LEMBERG * doc/pic.ms: Fix documentation for the addition of positions. * tmac/doc.tmac, tmac/an-old.tmac: Need groff version 1.18. 2002-06-29 Werner LEMBERG Implementation of string arguments of the form \*[foo arg1 arg2 ...] * src/roff/troff/input.cc (have_string_arg): New global variable. (read_mode): New enumeration. (read_escape_name): Use it. Update all calls. (read_long_escape_name): Use it. Update all calls. Set have_string_arg if appropriate. (get_char_for_escape_name): Add parameter for handling space character. (interpolate_string_with_args, decode_string_args): New functions. (get_copy, token::next): Call it if necessary. (interpolate_string): Fix error message. * NEWS, doc/groff.texinfo, man/groff.man, man/groff_diff.man: Document it. 2002-06-24 Bernd Warken * man/groff_tmac.man: Updated and extended. 2002-06-24 Werner LEMBERG * doc/pic.ms, src/preproc/pic/pic.man: Fix description of `:='. 2002-06-23 Werner LEMBERG * doc/pic.ms: Improve documentation of composite block objects. 2002-06-22 Werner LEMBERG * src/roff/troff/input.cc (init_registers): Add three registers `seconds', `minutes', and `hours' to hold the current time. * NEWS, doc/groff.texinfo, man/groff.man, man/groff_diff.man: Updated. 2002-06-20 Werner LEMBERG Make \X accept both `\ ' and `\~', converting them to single space characters. * src/roff/troff/token.h (token): Add TOKEN_UNSTRETCHABLE_SPACE. (token::unstretchable_space): New inline function. * src/roff/troff/input.cc (token::next, token::delimiter, token::description, token::add_to_node_list, token::process): Handle TOKEN_UNSTRETCHABLE_NODE. (encode_char): Handle tok.stretchable_space and tok.unstretchable_space. * NEWS, doc/groff.texinfo: Document it.. 2002-06-19 Werner LEMBERG * src/devices/grops/ps.cc (ps_printer::special): Fix error message. * src/devices/grotty/tty.cc (tty_printer::special): Add `sgr' keyword to enable/disable SGR output. (tty_printer::change_fill_color): New function. * NEWS, src/devices/grotty/grotty.man: Document `sgr' special. * src/roff/troff/input.cc (output_request): Add missing `tok.next()' call. 2002-06-18 Werner LEMBERG Add a `color' request and a `.color' register to control usage of colours. * src/roff/troff/input.cc (disable_color_flag): Replaced with... (color_flag): This (which is the inverse). (activate_color): New function. (main, init_input_requests): Updated. * src/roff/troff/troff.h, src/roff/troff/node.cc (troff_output_file::fill_color, troff_output_file::glyph_color): Updated. * NEWS, doc/groff.texinfo, man/groff_diff.man, man/groff.man: Document the changes. 2002-06-17 Colin Watson Circumvent bug in autoconf 2.53 regarding top_builddir. * aclocal.m4 (GROFF_BUILDDIR): s/top_builddir/groff_top_builddir/. * Makefile.in, doc/Makefile.in: s/@top_builddir@/@groff_top_builddir@/. * configure: Regenerated (with autoconf 2.53). 2002-06-17 Werner LEMBERG * src/libs/libgroff/font.cc (font::load_desc): Fix computation of `paperwidth' and `paperlength' for the `papersize' keyword. 2002-06-16 P. Alejandro Lopez-Valencia * src/devices/grops/grops.man: Add info about Type 42 fonts. 2002-06-15 Gaius Mulley * src/devices/grohtml/post-html.cc (html_printer::emit_raw, html_printer::do_linelength, html_printer::do_pageoffset, html_printer::do_indentation, html_printer::do_tempindent, html_printer::do_break, html_printer::begin_page): Clear indented text. * tmac/html.tmac: Disable hyphenation. 2002-06-15 Werner LEMBERG Don't produce HTML files if utility programs are missing. * Makefile.in (make_html, make_install_html): New variables. (MDEFINES): Updated. * aclocal.m4 (GROFF_HTML_PROGRAMS): New function to test for HTML utility programs. * configure.ac: Use it. * configure: Regenerated. * doc/Makefile.sub (PROCESSEDEXAMPLEFILES): Move webpage.html to... (HTMLEXAMPLESFILES): This new variable. (EXAMPLESIMAGEFILES): Renamed to... (HTMLEXAMPLEIMAGEFILES): This. (CLEANADD): Add HTMLEXAMPLEFILES. (all): Use `make_html'. (html): New target. (install_data): Use `make_install_html'. Move html stuff to... (install_html): This new target. (uninstall_sub): Updated. 2002-06-14 Bernd Warken * src/roff/grog/Makefile.sub (grog): Renamed to... (grog.old): This. (grog): New rule to always install grog.sh as grog. 2002-06-08 Bernd Warken * src/roff/grog/grog.pl: Fix typo. 2002-06-07 Werner LEMBERG * doc/groff.texinfo: Add more info on .tr arguments. 2002-06-05 Werner LEMBERG * NEWS, src/roff/grog/grog.man, doc/groff.texinfo: Updated. * aclocal.m4 (GROFF_MKSTEMP): Include unistd.h. * configure: Regenerated. 2002-06-05 Ralph Corderoy * src/roff/troff/symbol.cc (table_sizes): Add more values. * src/roff/grog/grog.pl, src/roff/grog/grog.sh: Recognize mom. 2002-06-04 Werner LEMBERG * aclocal.m4 (GROFF_PAGE): Don't use `prefix' directly since it is not initialized at the time we need it in case `--prefix' hasn't been set. Check for `ac_default_prefix' also. Test for `papersize' keyword also and generalize allowed whitespace. * configure: Regenerated. * font/devps/Makefile.sub (DESC): Use `papersize' instead of `paperlength'. * src/libs/libgroff/Makefile.sub (version, revision): Replaced with... (src_version, src_revision): New variables to avoid overwriting from parent make process. (version.cc): Updated. * src/preproc/html/pre-html.cc: Include paper.h and font.h. (linebuf, linebufsize): New global variables. (sys_fatal): Use `fatal' to abort properly. (get_line): New function. (get_resolution): Use it. Improve error messages. (get_papersize): Check `papersize' also. Use `get_line'. Improve error messages. 2002-06-03 Werner LEMBERG * Makefile.comm (CLEANNOTSRCDIRADD): New target for files which should be removed only if builddir is not srcdir. (mostlyclean): Handle `CLEANNOTSRCDIRADD'. (clean): Depend on `mostlyclean'. (distclean): Depend on `clean'. (realclean, extraclean): Depend on `distclean'. (.y.cc, .y.o): Simplified. The output files are no longer written to srcdir but to builddir. * Makefile.in (MDEFINES): Add `version' and `revision'. (uninstall_dirs): Fix order of directories. * doc/Makefile.sub (version, revision): Removed. (CLEANADD): Removed grnexmpl.g, groff, groff-*. Added `HTMLDOCFILES'. (CLEANNOTSRCDIRADD): New target for grnexmpl.h, groff, groff-*. * src/preproc/eqn/Makefile.sub, src/preproc/pic/Makefile.sub, src/preproc/refer/Makefile.sub (YTABC, YTABH): Don't use `srcdir' as prefix. * doc/texinfo.tex (\authortt): New macro. (\shortcontt): Define. (\titlepage): Set \tt to \authortt while defining \authorfont. (\appendixbox): New macro. (\chapmacro, \appendixentry): Use \appendixbox to get even indentation for letters. (\summarycontents): Set \tt. (\internalpagesize): Add two arguments for real paper width and height as needed by pdfTeX. (\letterpaper, \smallbook, \afourpaper, \afivepaper, \afourlatex): Updated. (\tempdima, \tempdimb): New temporary dimensions. (\pagesizesyyy): Updated. 2002-06-02 Werner LEMBERG Adding a new keyword `papersize' to the DESC file format (similar but not completely identical to grolbp's extension). grops now has a -p command line option to override `papersize'. Finally, grolbp has been adapted to the new syntax. * src/libs/libgroff/paper.cc, src/include/paper.h: New files. It defines and initializes the `papersizes[]' array with NUM_PAPERSIZES elements. * src/libs/libgroff/Makefile.sub (OBJS): Add `paper.o'. (CCSRCS): Add `paper.cc'. * src/include/font.h (font): Add `papersize' element. * src/libs/libgroff/font.cc (font::unit_scale): New helper function. (font::scan_papersize): New function. (font::load_desc): Use it for handling `papersize' keyword. * src/libs/libgroff/fontfile.cc: Initialize `font::papersize'. * src/devices/grops/ps.cc: Include paper.h. (user_paper_length): New global variable. (ps_printer): Use paper length as initializer. (make_printer): Updated. (main): Handle new `-p' option. * src/devices/grops/grops.man: Updated. * src/devices/grolbp/lbp.cc: Include paper.h. s/papersizes/lbp_papersizes/. (set_papersize): Use new `papersizes' array. (handle_unknown_desc_command): Don't handle `papersize'. (main): Use `font::scan_papersize' for handling `-p' option. * src/devices/grolbp/grolbp.man: Updated. * man/groff_font.man: Document `papersize'. * NEWS: Updated. 2002-05-30 Werner LEMBERG * src/devices/grops/TODO: Updated. * src/devices/grops/grops.man: More info on paper formats. * man/groff_font.man: Document `paperheight' and `paperwidth'. 2002-05-29 Werner LEMBERG * doc/Makefile.sub (CLEANADD): Add grnexmpl.g, groff, and groff-* to list only if srcdir != currdir. (distfiles): New target. * Makefile.in (EXTRADIRS): Add font/devlj4/generate. (NOMAKEDIRS): New variable. (DISTDIRS): Use it. 2002-05-26 Werner LEMBERG Add .output request, similar to \! at top-level. * src/roff/troff/input.cc (transparent): Remove unused declaration. (output_request): New function. (init_input_requests): Add it. Sorted. * NEWS, doc/groff.texinfo, man/groff_diff.man, man/groff.man: Document it. * Makefile.in (MDEFINES): Add INSTALL_INFO. (prepare_examples): Fix typo. * doc/groff.texinfo (@direntry): Fix it. 2002-05-25 Werner LEMBERG Including the doc subdir into groff's Makefile system. * aclocal.m4 (GROFF_INSTALL_INFO): New function. * configure.ac: Use it. Generate `doc/Makefile'. * configure: Regenerated. * Makefile.in (infodir, INSTALL_INFO): New variables. (MDEFINES, uninstall_dirs): Updated. (OTHERDIRS): Add `doc'. * Makefile.comm (CLEANDIRADD): New variable. (mostlyclean): Use it. * doc/Makefile.sub, doc/Makefile.in: New files. * doc/Makefile: Removed. * NEWS, INSTALL: Updated. 2002-05-24 Werner LEMBERG * doc/homepage.ms: Renamed to ... * doc/webpage.ms: This. Use `.NHR'. 2002-05-23 Werner LEMBERG Integrating the `mom' macro package, contributed by Peter Schaffter . * contrib/mom/*: New subdirectory tree. * Makefile.in (docdir, exampledir, htmldocdir): New variables to be used for documentation files. (MDEFINES, uninstall_dirs): Use them. (OTHERDIRS): Add contrib/mom. * Makefile.comm (.man.n): Add @DOCDIR@, @EXAMPLEDIR@, and @HTMLDOCDIR@. * MANIFEST, NEWS: Updated. 2002-05-22 Gaius Mulley Change syntax of \O: \O[0] suppresses output, \O[1] enables output if at outer level; at start-up we are at outer level. * src/roff/troff/input.cc (do_suppress): Implement it. Simplify \O[3]. Add option -p to show progress information. pre-grohtml will now render only one page at a time, reducing the size of needed disk resources enormously. * src/preproc/html/pre-html.cc (imagePageStem): Replaced with... (imagePageName): New global variable. (psPageName, show_progress, currentPageNo): New global variables. (html_system): Close saved stderr and stdout handles. (write_end_image): Accept a parameter to control \O escape. (write_start_image): Adapted to new \O meaning. (char_buffer::write_upto_newline): Updated. (createAllPages): Replaced with... (createPage): This new function to create a single page for images. It uses `psselect' from the psutils package. (removeAllPages): Removed. (createImage): Updated. Handle progress display. (char_buffer::do_html, char_buffer::do_image) [DEBUGGING]: Removed. (scanArguments): Add option -p. (makeTempFiles): Updated to create temp files for psPageName and imagePageName. (removeTempFiles): Removed. (main): Updated. * src/devices/grohtml/post-html.cc (header_desc::write_headings, html_printer::write_header): Append `\0' to `buffer'. (html_printer::do_eol): Depend on `current_paragraph->emitted_text'. (main): Handle -p. * src/devices/grohtml/html-text.cc (html_text::dump_stack_element): Handle `text_emitted'. (html_text::table_is_void): Slightly rewritten. (stop): New external symbol. (html_text::do_push) [DEBUGGING]: Use it and simplify. (html_text::shutdown): Call `dump_stack'. (html_text::do_space): Rewritten. * src/devices/grohtml/grohtml.man: Document -p and the need of `psselect'. * tmac/www.tmac (DC, HTML-DO-IMAGE, HTML-IMAGE-END): Updated to new \O syntax. Call \O[0] if `ps4html' is active. * tmac/s.tmac (@EQ, @EN): Handle html better. (@TS, TE): Ditto. * tmac/html.tmac: Don't use black for background colour. * src/roff/troff/node.cc: Include `div.h'. (troff_output_file::really_print_line): Don't use `is_on'. (troff_output_file::word_marker, troff_output_file::flush_tbuf troff_output_file::check_charinfo, troff_output_file::put_char_width, troff_output_file::put_char, troff_output_file::determine_line_limits, troff_output_file::draw, real_output_file::begin_page, glyph_color_node::tprintf, fill_color_node::tprint, hline_node::tprint, vline_node::tprint): Use `is_on'. (troff_output_file::really_on): Call `do_motion'. (suppress_node::tprint): Use `get_page_number' instead of `%' register. Call `reset_output_registers' conditionally on `is_on'. * doc/groff.texinfo: Document new syntax of \O. * NEWS, man/groff_diff.man: Updated. 2002-05-22 Werner LEMBERG * MORE.STUFF: Add info about David Frey's deroff implementation. Mention troff.org. 2002-05-16 Werner LEMBERG Pic's `with' attribute now accepts positions. * src/preproc/pic/pic.y: Make `.', BOX, CIRCLE, ELLIPSE, ARC, LINE, ARROW, SPLINE, and `[' left-associative tokens to fix shift/reduce conflicts. (object_spec): Add rule for `WITH' and `position'. (relative_path): Give `corner' the precedence of `CHOP'. * src/preproc/pic/object.h (path): New members `pos' and `is_position'. * src/preproc/pic/object.cc: Updated initializers of `path'. (path::follow): Handle `is_position'. * doc/pic.ms: Completely updated grammar description. Many typographical improvements. 2002-05-15 Werner LEMBERG * src/roff/troff/env.cc(hyphen_trie::hpf_getc): Accept ^^x (char code of x in range 0-127) also. * doc/groff.texinfo, man/groff_diff.man: Updated. Added keywords `north', `south', `east', and `west' for corners in pic. * src/preproc/pic/lex.cc (lookup_keyword): Add NORTH, SOUTH, EAST, and WEST. (yylex): Handle them. * src/preproc/pic/pic.y: Add tokens NORTH, SOUTH, EAST, and WEST. (corner): Handle them. 2002-05-14 Werner LEMBERG * src/devices/grops/grops.man: Clarify handling of `download' file. 2002-05-11 Werner LEMBERG Adding `warnscale' and `spreadwarn' requests, based on a patch from Jeffrey Friedl . * src/roff/troff/input.cc (spread_limit, warn_scale, warn_scaling_indicator): New global variables. (warnscale_request, spreadwarn_requests): New functions. (main): Initialize `warn_scale' and `warn_scaling_indicator'. (init_input_requests): Updated. (error_type): Add `OUTPUT_WARNING'. (do_error): Handle it. (output_warning): New warning function which shows output location. * src/roff/troff/env.h (spread_limit): New external variable. * src/roff/troff/env.cc (environment::choose_breakpoint): Use `output_warning'. (distribute_space): Emit warning if added space is larger than `spread_limit'. (environment::possibly_break_line): Emit warning if a line can't be adjusted on both sides. * doc/groff.texinfo, man/groff_diff.man, man/groff.man: Document it. 2002-05-08 Werner LEMBERG * src/roff/troff/node.cc (special_node::special_node): Use env_definite_font(curenv) instead of curenv->get_font(). Otherwise \X''\% crashes, for example. * doc/groff.texinfo: Document \! and \? used at top-level. 2002-05-06 Werner LEMBERG * src/preproc/pic/pic.man: Fix some keyword syntax. Other minor typographical fixes. * src/roff/groff/groff.man: Fix typos. 2002-05-04 Werner LEMBERG * src/roff/groff/groff.man ([ShortOpt]): Renamed to... (ShortOpt[]): This to avoid problems with refer. * doc/pic.ms: Fix typo. Fix pic grammar description. * tmac/an-old.tmac (ne): Use de1, not de. 2002-05-03 Werner LEMBERG * doc/groff.texinfo: Finished separation of glyphs and characters. Don't use the string `Appendix' for appendix headers (both in the text and the table of contents). * man/groff_tmac.man, src/roff/troff/troff.man: Fix order of tmac directories. Use registers LL and LT (similar to -ms) for controlling the length of title and line, respectively, in the -man and -mdoc macro packages. * tmac/doc-ditroff (doc-setup-page-layout), tmac/doc-nroff (doc-setup-page-layout): Use \n[LL] and \n[LT]. * tmac/an-old.tmac: Set \n[LL] and \n[LT] if not defined. (TH): Use \n[LL]. (an-header, an-p-footer): Use \n[LT]. * NEWS, tmac/groff_man.man, tmac/groff_mdoc.man, doc/groff.texinfo: Document it. 2002-05-02 Werner LEMBERG * doc/fdl.texi: New file. * doc/groff.texinfo: Include it. Define and use @copying. Starting with separating glyph, symbol, and character. 2002-04-27 Werner LEMBERG * Makefile.in (EXEEXT): Set it. * src/*/Makefile.sub (PROG): Add $(EXEEXT) for all non-script programs. * src/include/nonposix.h: Define GS_NAME. * src/preproc/html/pre-html.cc (createAllPages): Use GS_NAME. Some preliminary changes for EMX support under OS/2. * src/preproc/pic/main.cc (main), src/roff/groff/pipeline.c: Add __EMX__ similar to __MSDOS__. * src/utils/indxbib/indxbib.cc (main) [__EMX__]: Use `unlink'. 2002-04-25 Werner LEMBERG * doc/groff.texinfo: Integrated groff_out.man. Some macro fixes. 2002-04-23 Werner LEMBERG * man/groff_out.man: Minor fixes. 2002-04-23 Werner LEMBERG * doc/groff.texinfo: Moving @cindex entries after @Def* to get correct page references. Fixed many index entries. 2002-04-23 Bernd Warken * man/roff.man: Enlarged. 2002-04-22 Werner LEMBERG * doc/groff.texinfo: More examples, other fixes. 2002-04-20 Werner LEMBERG * src/roff/troff/input.cc (pipe_output): Multiple calls to `pi' will now form a chain, e.g. .pi foo .pi bar is now the same as .pi foo | bar This is for compatibility with plan 9's troff. * tmac/tty.tmac: Set default tab values to 0.8i to be compatible with UNIX troff. * NEWS: Updated. * doc/groff.texinfo: Add documentation of remaining requests and registers. 2002-04-19 Werner LEMBERG * doc/groff.texinfo: Add documentation of remaining escapes. * font/devdvi/generate/tc.map: Remove entry for `sr'. * font/devdvi/*TC: Regenerated. 2002-04-18 Werner LEMBERG * src/roff/troff/input.cc (token::next): Make \H behave consistently if not in compatibility mode, i.e., increment relative to the previous height. * doc/groff.texinfo: Updated accordingly. 2002-04-17 Werner LEMBERG * doc/groff.texinfo: Document \\, \e, \E, \., and \c. 2002-04-16 Bernd Warken * src/roff/groff/groff.man: Improve documentation of -P option. Other minor fixes. 2002-04-15 Werner LEMBERG Add new escape \F to switch font family. * src/roff/troff/input.cc (token::next): Handle \F. * src/roff/troff/env.cc (environment::set_family): Handle `interrupted' flag. * NEWS, doc/groff.texinfo, man/groff_diff.man, man/groff.man: Document it. 2002-04-14 Werner LEMBERG * tmac/doc.tmac (doc-tag-list): Use \Z to avoid stretching of spaces in tags. 2002-04-13 Werner LEMBERG Implement \f[] as an alternative to \fP. Change \mP and \MP to \m[] and \M[], respectively. * src/roff/troff/symbol.cc (EMPTY_SYMBOL): New global variable. (symbol::symbol): Handle NULL string and empty string differently. * src/roff/troff/symbol.h (symbol::is_empty): New inline function. * src/roff/troff/input.cc (read_escape_name, read_long_escape_name): Add optional parameter. Updated calling functions. (get_copy, do_glyph_color, do_fill_color, token::next): Use `symbol::is_empty'. * src/roff/troff/env.cc (environment::set_font): Ditto. * src/preproc/pic/troff.cc (troff_output::set_fill, troff_output::reset_color: Updated. * tmac/www.tmac: Updated. * NEWS, man/groff_diff.man, man/groff.man, doc/groff.texinfo, doc/homepage.ms, src/devices/grotty/grotty.man, tmac/groff_www.man: Updated. * tmac/Xps.tmac: Remove some redundant code. * tmac/doc-common, tmac/doc-ditroff, tmac/doc-nroff, tmac/doc.tmac, tmac/dvi.tmac, man/roff.man, man/groff_out.man, man/groff.man, man/groff_diff.man, src/roff/groff/groff.man: Replace \f[P] with \f[]. 2002-04-13 Bernd Warken * src/include/printer.h, src/libs/libdriver/printer.cc (printer::change_fill_color): New member function. * src/libs/libdriver/input.cc (parse_D_command): Use it. 2002-04-12 Werner LEMBERG * doc/groff.texinfo: Completed pass on gtroff reference. 2002-04-11 Werner LEMBERG * doc/groff.texinfo: More fixes. 2002-04-11 Bernd Warken * src/include/color.h: Decorate with `const'. Use `size_t'. Include `stddef.h'. * src/libs/libgroff.color.cc: Decorate with `const'. Use `size_t'. (color::color): Initialize members. * src/libs/libdriver/input.cc (parse_D_command): Handle `f' command according to the documentation. * man/groff_out.man: Updated. Minor fixes. 2002-04-11 Gaius Mulley * src/preproc/html/pre-html.cc (write_start_image): Remove redundant output. * tmac/www.tmac (DC, HTML-DO-IMAGE): Ditto. * src/devices/grohtml/post-html.cc (page::add_and_encode): Using \C'hy' caused an assertion failure. * src/roff/troff/env.cc (environment::environment): Initialize `emitted_node'. (environment::copy): Handle `ignore_next_eol' and `emitted_node'. 2002-04-10 Werner LEMBERG * man/groff_diff.man, man/groff.man, NEWS, doc/groff.texinfo: Document pvs request and .pvs register. 2002-04-09 Werner LEMBERG * doc/groff.texinfo: Improve and fix documentation of diversions and environments. 2002-04-08 Werner LEMBERG * doc/groff.texinfo: Fix documentation of drawing functions. Other minor fixes. 2002-04-07 Werner LEMBERG * doc/groff.texinfo: Better documentation of double quotes as arguments. Other minor fixes. 2002-04-06 Werner LEMBERG * man/groff_font.man: Document names of special characters better. * doc/groff.texinfo: Minor improvements. * tmac/lbp.tmac: Load latin1.tmac. * tmac/X.tmac, tmac/Xps.tmac: Load latin1.tmac or cp1047.tmac. * font/devX*/*: Regenerated (all chars > 0x80 removed). 2002-04-05 Werner LEMBERG * tmac/tty.tmac: Don't use shc request. * tmac/latin1.tmac, tmac/cp1047.tmac: Translate soft hyphen to `\%'. * NEWS: Updated. * man/groff_diff.man: Minor fixes. * font/devlbp/*: Remove all `charXXX' entities. * src/libs/libgroff/font.cc (font::~font): Deallocate `special_device_coding'. (font::load): Use `new' for allocating `special_device_coding'. * src/libs/libgroff/nametoindex.cc (character_indexer::lookup_char): Removed unused member. 2002-04-05 Werner LEMBERG * src/drivers/grops/psrm.cc (skip_possible_newline): New function. (resource_manager::do_begin_binary, resource_manager::do_begin_data): Use it. * doc/texinfo.tex: Updated to version 4.2. * src/roff/troff/token.h: Add TOKEN_ZERO_WIDTH_BREAK for `\:'. (token::zero_width_break): New inline function. * src/roff/troff/input.cc (token::next): Use it. (token::description): Updated. (encode_char): Ignore `\%', `\&', `\)', and `\:'. (token::add_to_node_list, token::process): Use it. * NEWS, doc/groff.texinfo: Updated. * src/preproc/eqn/over.cc (over_box::output): Fix typo. * tmac/tty.tmac: Add missing backslash. 2002-04-04 Tadziu Hoffmann * src/preproc/eqn/box.cc (set_script_size, box::top_level): Use `.ps' register instead of `.s' to handle fractional point sizes. * src/preproc/eqn/limit.cc (limit_box::compute_metrics, limit_box::output): Ditto. * src/preproc/eqn/other.cc (size_box::compute_metrics, size_box::output): Ditto. * src/preproc/eqn/over.cc (over_box::compute_metrics, over_box::output): Ditto. * src/preproc/eqn/script.cc (script_box::compute_metrics, script_box::output): Ditto. * src/preproc/eqn/sqrt.cc (sqrt_box::compute_metrics, sqrt_box::output): Ditto. 2002-04-03 Michael Selway * src/drivers/grops/psrm.cc (resource_manager::do_begin_binary): Fix typo. 2002-04-03 Werner LEMBERG * doc/homepage.ms: Reduce title size. * doc/groff.texinfo: Fix documentation of .t register. Fix handling of colon. Fix `\' vs. `\\'. * src/roff/troff/input.cc (exit_troff): Emit LAST_PAGE_EJECTOR only if page length is positive to avoid a loop. * tmac/an-old.tmac (ne): Increase page length to avoid problems with tbl. 2002-04-02 P. Alejandro Lopez-Valencia * src/include/nonposix.h, src/roff/groff/pipeline.c: s/__CYGWIN32__/__CYGWIN__/. 2002-03-28 Gaius Mulley * doc/gnu.xpm: New image contributed by Emily Mulley. * doc/Makefile (gnu.eps, gnu.png): Use pnmdepth. (homepage.html): Be dependent on gnu.eps. * doc/homepage.ms: Updated to new image. * src/devices/grohtml/post-html.cc (html_printer): New member `sbuf_prev_hpos'. (html_printer::flush_sbuf, html_printer::set_char): Set it. (html_printer::sbuf_continuation): Use it. 2002-03-28 Werner LEMBERG * src/libs/libgroff/getopt.c: Updated to latest version. * tmac/README: More on hyphen.tex license. 2002-03-26 Larry Kollar * doc/groff.texinfo: Add documentation of most missing requests. 2002-03-25 Werner LEMBERG Add three glyphs `t+-', `tmu', and `tdi' which are textual variants of `+-', `mu', and `di', respectively. * font/devascii/R.proto, font/devutf8/R.proto, font/devlatin1/R.proto, font/devhtml/R.proto, font/devcp1047/R.proto, font/devlpb/*: Add them. * font/devps/generate/textmap: Ditto. * font/devps/*: Regenerated. * font/devlj4/generate/text.map: Add them. * font/devlj4/*: Regenerated. * font/devdvi/generate/tc.map: Use them. * font/devdvi/generate/texsy.map: Add them. * font/devdvi/*: Regenerated. * font/devX*/*: Regenerated. * tmac/latin1.tmac, tmac/cp1047.tmac, tmac/tty.tmac, tmac/tty-char.tmac: Updated. * NEWS, man/groff_char.man: Updated. 2002-03-24 Werner LEMBERG * tmac/dvi.tmac, tmac/X.tmac, tmac/ps.tmac, tmac/html.tmac, tmac/lj4.tmac, tmac/tty.tmac: Replace most `.char' with `.fchar'. * tmac/ec.tmac: Remove `.rchar' calls (no longer necessary since we use `.fchar' in dvi.tmac. * tmac/dvi.tmac: Improve definition of \[Fo] and \[Fc]. * tmac/Xps.tmac: Simplify some char definitions. Add definition for \[f/]. * man/groff_char.man: Updated for new X.tmac. * tmac/README: New file. 2002-03-23 Phil Lobbes * Makefile.comm (.y.o): New rule for make on Solaris 2.5.1 -- the internal .y.o rule took precendence over the .y.cc rule, compiling the yacc files with gcc instead of g++. 2002-03-23 Werner LEMBERG * tmac/dvi.tmac: Add replacement font for `CB'. * tmac/doc.tmac: s/request/macro/ in messages. (doc-generic-macro): Improve error message. * tmac/groff_mdoc.man: Minor improvements. 2002-03-22 Werner LEMBERG * doc/groff.texinfo: Document possible conflict between `tr' and `char' requests. 2002-03-21 Werner LEMBERG Improve handling of hyphenation patterns. It is now possible to use most of TeX's pattern files unmodified. To make the process more flexible, a new request `hpfcode' has been added which provides a character code mapping for the `hpf' request. See comment before hpf_getc() for more details. * src/roff/troff/env.cc (insert_hyphenation, hpf_getc): New functions. (read_patterns_file): Additional parameter for exception dictionary. Extended to recognize \pattern, \hyphenation, and \endinput. (do_hyphenation_patterns_file): Updated. * src/roff/troff/env.h (hpf_code_table): New extern. * src/roff/troff/input.cc (hpf_code_table): New array. (init_hpf_code_table, hyphenation_patterns_file_code): New functions. (hyphenation_code): Handle translation from `trin' correctly. (main, init_input_requests): Updated. (charinfo::set_translation): Handle hyphenation code also. * src/roff/troff/charinfo.h (charinfo::get_translation_input): New inline function. * src/roff/troff/env.cc (WORD_MAX): Reduced to 256 since `unsigned char' is used for offsets in hyphenation exceptions. * tmac/hyphen.us: Replace with contents of unmodified `hyphen.tex'. * NEWS, man/groff_diff.man, man/groff.man: Document it. 2002-03-20 Larry Kollar * doc/groff.texinfo: Add documentation for `hpfa' and `trin' requests. 2002-03-18 Werner LEMBERG * tmac/html.tmac: Fix serious typo. 2002-03-17 Larry Kollar * doc/groff.texinfo: Add documentation for `writec' request. 2002-03-17 Werner LEMBERG Added request `hpfa' to append hyphenation patterns. * src/roff/troff/env.cc (hyphen_trie::read_patterns_file): Add parameter `append'. (hyphenation_patterns_file): Renamed to... (do_hyphenation_patterns_file): This. (hyphenation_patterns_file, hyphenation_patterns_file_append): New functions. (init_hyphen_requests): Updated. * NEWS, man/groff.man, man/groff_diff.man: Document it. 2002-03-16 Werner LEMBERG Added request `writec' in analogy to `tmc'. * src/roff/troff/input.cc (write_request): Renamed to... (do_write_request): This. Added one parameter. (write_request, write_request_continue): New functions. (init_input_requests): Updated. * NEWS, man/groff.man, man/groff_diff.man: Document it. * font/devdvi/DESC.in (sizes): Allow all sizes in the range 5-10000pt. * NEWS: Document it. 2002-03-15 Werner LEMBERG * man/groff.man: Add writem request. Add request `trin' (translate input) to make `.asciify' work correctly. This is necessary since `charXXX' entity names are no longer hardcoded in font definition files. * src/roff/troff/charinfo.h (charinfo): Add `asciify_code' and `translate_input' members. (charinfo::set_asciify_code, charinfo::get_asciify_code, charinfo::set_translation_input): New methods. (charinfo::set_translation): Add third argument. * src/roff/troff/input.cc (charinfo:set_translation): Set `asciify_code'. (do_translate): Add second argument. (translate_input): New function. (init_input_requests): Updated. * src/roff/troff/node.cc (glyph_node::asciify, composite_node::asciify): Use `get_asciify_code'. * tmac/cp1047.tmac, tmac/latin1.tmac: Use `trin'. * NEWS, man/groff.man, man/groff_diff.man: Updated. 2002-03-14 Larry Kollar * doc/groff.texinfo: Improve documentation of .RS and .RE. 2002-03-14 Werner LEMBERG Add a new request `sizes' similar to the `sizes' command in DESC files. * src/roff/troff/env.cc (override_sizes): New function. (init_env_requests): Use it. * src/roff/troff/token.h: Export `read_string'. * NEWS, man/groff_diff.man, man/groff.man: Document it. 2002-03-12 Werner LEMBERG * doc/groff.texinfo: More fixes for texinfo 4.1 and higher. 2002-03-10 Werner LEMBERG * tmac/pspic.tmac: Add support for -Tdvi. * tmac/dvi.tmac: Include pspic.tmac. * src/devices/grodvi/grodvi.man: Document it. * NEWS: Updated. * font/devlj4/generate/Makefile: Fix URL of metric files. 2002-03-09 Werner LEMBERG * PROBLEMS: The static constructor bug has been fixed in z/OS V1R3. 2002-03-09 Larry Kollar * tmac/groff_ms.man: Add documentation for RS and RE macros. 2002-03-08 Werner LEMBERG * doc/groff.texinfo: Fixes for texinfo 4.1. 2002-03-07 Werner LEMBERG * src/include/lib.h: Include getopt.h if groff-getopt.h can't be included. Handle CYGWIN properly. 2002-03-07 Paco Andrés Verdú * font/devlbp/Makefile.sub (DEVFILES): Add some missing fonts. * tmac/lbp.tmac: Add some font translations. 2002-03-02 Werner LEMBERG * font/devcp1047/R.proto, font/devlatin1/R.proto, font/devhtml/R.proto: Remove `charXXX' entries. * tmac/tty.tmac, tmac/html.tmac: Load latin1.tmac or cp1047.tmac where appropriate. * font/devlj4/generate/text.map: Remove `charXXX' entries. * font/devlj4/*: Regenerated all font definition files. * tmac/lj4.tmac: Load latin1.tmac. * src/utils/hpftodit/hpftodit.cc (do_file): Partially undo change from 2000-06-17: LJ4 metric files are *not* text files. * tmac/troffrc, tmac/dvi.tmac, tmac/ps.tmac: Don't use .T string register to test for EBCDIC. 2002-03-01 Werner LEMBERG * src/utils/afmtodit/afmtodit.pl: Skip comment lines in encoding files (as grops already does). * src/utils/afmtodit/afmtodit.man: Document comment lines in map files. * src/devices/grops/grops.man: Document comment lines in encoding files. * tmac/cp1047.tmac: New file. * tmac/dvi.tmac, tmac/tty-char.tmac: Use it. * tmac/ps.tmac: Load latin1.tmac or cp1047.tmac. * tmac/Makefile.sub (NORMALFILES): Updated. * tmac/ec.tmac: Don't load latin1.tmac again. * font/devps/generate/lgreekmap, font/devps/generate/symbolchars, font/devps/generate/dingbats.map, font/devps/generate/dingbats.rmap, font/devps/text.enc, font/devps/generate/Makefile (symbolmap): Add header comment. * font/devps/generate/textmap: Ditto. Remove `charXXX' entries. * font/devps/symbolmap: Regenerated. * font/devps/*: Regenerated all font definition files. 2002-02-28 Werner LEMBERG Add color support to grodvi (for drawing colors are currently translated to gray values). * src/devices/grodvi/dvi.cc (FILL_MAX): Removed. (dvi_printer): Add `cur_color' member. (dvi_printer::set_color): New function. (draw_dvi_printer): Remove `fill'. (draw_dvi_printer::fill_next): Pass environment as parameter. Update code for new color support translated to gray. (dvi_printer::set_char): Updated. (dvi_printer::begin_page, dvi_printer::end_page): Handle color changes crossing the page border. (dvi_printer::draw): Updated. Remove cases `f' and `F'. * tmac/dvi.tmac: Add color definitions. * NEWS, src/devices/grodvi/grodvi.man: Updated. * tmac/an-old.tmac (R): Make this a macro to emit a warning if used incorrectly. * aclocal.m4 (GROFF_NEED_DECLARATION): Use test similar to recent versions of autoconf. * configure: Updated. * doc/homepage.ms: Use `.blm'. * tmac/www.tmac (www-depth): New auxiliary variable. (www-pop-level): Don't issue HTML tag. (ULS, ULE, LI): Use absolute indentation. * src/devices/grops/ps.cc (ps_printer::begin_page, ps_printer::end_page): Switch forth and back to default color while starting a new page. 2002-02-27 Werner LEMBERG Add EC and TC fonts to devdvi. * src/utils/tfmtodit/tfmtodit.man: Document patching of exbase.mf. * font/devdvi/generate/cork.map: Renamed to... * font/devdvi/generate/ec.map: This. Remove entry for `aq'. * font/devdvi/generate/tc.map: New file. * font/devdvi/generate/Makefile (*EC, *TC): New creation rules for EC and TC fonts. (FONTS): Updated. * font/devdvi/*EC, font/devdvi/*TC: New font definition files. * font/devdvi/Makefile.sub (DEVFILES): Updated. * tmac/ec.tmac: New file. * tmac/Makefile.sub (NORMALFILES): Updated. * NEWS, src/devices/grodvi/grodvi.man: Updated. * man/groff_char.man: Check `ECFONTS' register. * font/devdvi/{TR,TI,TB,TBI,HR}: Fix `name' field. 2002-02-26 Werner LEMBERG * font/devdvi/generate/*.map: Remove all `charXXX' entries. * font/devdvi/generate/cork.map: Add 'y and 'Y. * font/devdvi/*: Updated. * tmac/dvi.tmac: Formatting. Add font `HBI' for the dvi output. Add support for font families `T' and `H'. * font/devdvi/HBI: New file. * font/devdvi/B: Renamed to ... * font/devdvi/TB: This. * font/devdvi/BI: Renamed to ... * font/devdvi/TBI: This. * font/devdvi/I: Renamed to ... * font/devdvi/TI: This. * font/devdvi/R: Renamed to ... * font/devdvi/TR: This. * font/devdvi/H: Renamed to ... * font/devdvi/HR: This. * font/devdvi/Makefile.sub (DEVFILES): Updated. * font/devdvi/generate/Makefile (HBI): New rule. (FONTS): Updated. (R, I, B, BI, H): Renamed to ... (TR, TI, TB, TBI, HR): This, respectively. (srcdir): Fixed. * NEWS, src/devices/grodvi/grodvi.man: Updated. * font/devdvi/DESC.in: Don't mount R, I, B, BI, and CWI. Add `styles' and `family' keywords. * tmac/dvi.tmac: Alias `H' to `HR'. Add some fspecial requests for italic fonts. Add TR and TI as special. Add support for `_' with font CWI. * src/roff/troff/number.cc (parse_expr): Add missing `break' for operator `:'. Until now, the expression `0:1' would return 2 instead of 1. 2002-02-25 Werner LEMBERG * man/groff_char.man: Added some missing PS glyph names (from the Adobe Glyph List). * font/devps/generate/textmap, font/devps/symbolmap: Add `arrowupdn'. * doc/groff.texinfo: Minor additions and fixes. * man/groff_diff.man: Remove documentation of fp request. This is already covered in the original troff manual. Updated to be consistent with other doc files. * NEWS: Updated. 2002-02-24 Werner LEMBERG * aclocal.m4 (GROFF_EBCDIC): Don't include `font/devutf8' in TTYDEVDIRS. Define new variable OTHERDEVDIRS (containing `font/devlj4 font/devlbp' if not EBCDIC). * Makefile.in (TTYDEVDIRS): Always include `font/devutf8'. (OTHERDEVDIRS): New variable. (MDEFINES, DEVDIRS, ALLDIRS, DISTDIRS): Updated. * configure: Regenerated. * NEWS, src/devices/grotty/grotty.man: Updated. 2002-02-23 Werner LEMBERG * src/roff/troff/input.cc (do_overstrike, do_bracket, get_line_arg): Honour input level. Add new symbol `mc' corresponding to U+00B5 MICRO SIGN. * font/*/*: Implement it in all font files. * font/devps/generate/textmap, font/devps/generate/symbolchars, * font/devps/symbolmap: Updated. * font/devlj4/generate/text.map: Updated. * font/devdvi/generate/CompileFonts (sizes): Add LaTeX sizes. * font/devdvi/generate/texmi.map: Updated. * font/devutf8/R.proto: Remove all `charXXX' entries. * font/devutf8/NOTES: Updated. * font/devX*/*: Regenerated with xtotroff, using fonts from XFree86 version 4.1.0. * tmac/latin1.tmac, tmac/psold.tmac, tmac/tty-char.tmac: Updated. * NEWS, man/groff_char.man: Updated. 2002-02-21 Phil Lobbes * src/include/lib.h [HAVE_SNPRINTF]: Include stdarg.h. 2002-02-20 Ralph Corderoy * src/roff/grog/grog.pl: Fix computation of $refer. 2002-02-19 Werner LEMBERG * src/include/lib.h [!HAVE_SNPRINTF]: Add declarations for `snprintf' and `vsnprintf'. * src/include/htmlindicate.h: Renamed to... * src/include/htmlhint.h: This. * src/include/Makefile.sub: Updated. * src/preproc/eqn/main.cc: Updated. 2002-02-18 Werner LEMBERG * man/roff.man, man/groff_out.man, man/groff.man, man/groff_diff.man, man/ditroff.man, src/roff/groff/groff.man, src/roff/troff/troff.man: Updated to latest changes in www.tmac. * win32-diffs: Updated. 2002-02-17 Werner LEMBERG * doc/Makefile (clean): Add *.eps. (MEMACROS): Removed. (TFLAG): New variable. (TROFF): Use it. Add -ww. (GROFF): Use TFLAG, FFLAG, -U, -p, -e, -t, and -ww. (.me.dit): Fixed. (.ms.html, .ms.ascii, .ms.ps, homepage.html): Simplify. * tmac/www.tmac: Use dummy diversion while resetting and disabling `.tl'. * tmac/e.tmac: Inserted some more `\"' to remove warnings if used unstripped. * src/roff/troff/troff.man: Fix order of parameter description. * NEWS: Updated. 2002-02-16 Gaius Mulley Simplify image handling for grohtml. Fix

bug. * src/devices/grohtml/html-text.cc (DEBUGGING): Don't undefine but comment out. (html_text::dump_stack): Don't emit newline while debugging. (html_text::do_push) [DEBUGGING]: Print more info. (html_text::check_emit_text): Fix handling of

. * src/devices/grohtml/html.h: Updated. * src/devices/grohtml/output.cc (FPUTC, FPUTS, PUTC): New macros, replacing `fputc', `fputs', `putc'. If DEBUGGING is defined, they send its data to stderr also. Update all callers. (simple_output::space_or_newline) [DEBUGGING]: Removed. * src/devices/grohtml/post-html.cc (html_printer::do_links, html_printer::html_printer): Remove `DEBUGGING' conditionals. * src/include/html-strings.h (HTML_IMAGE_{CENTERED,LEFT,RIGHT,END}): Removed. * src/libs/libgroff/htmlhint.cc (is_in_graphic_start, is_inline_image): Removed. (html_begin_suppress, html_end_suppress): Don't take a parameter. (graphic_start, graphic_end): Removed. * src/include/htmlindicate.h: Updated. * src/preproc/html/pre-html.cc (DEBUG_HTML): Removed. (macroset_template): New global variable. (makeFileName): Use `macroset_template'. (write_end_image): Don't take a parameter. Don't emit newline. (write_start_image: Don't emit newline. (char_buffer::write_upto_newline): Updated. (char_buffer::skip_to_newline): Renamed to ... (char_buffer::skip_until_newline): This. Fix code. (char_buffer::write_file_troff, char_buffer::write_file_html): Simplified. (createAllPages, createImage) [DEBUGGING]: Handle `debug' flag. (removeAllPages): Remove `DEBUGGING' conditionals. (addRegDef, dump_args): New functions. (char_buffer::do_html, char_buffer::do_image): Handle `www-image-template' command line variable. Add more debugging code. (addps4html): Removed. (removeTempFiles) [DEBUGGING]: Handle `debug' flag. * src/preproc/eqn/main.cc: Include `ctype.h'. (suppress_html): Removed. (do_file): Updated. (inline_equation): Use `html_begin_suppress' and `html_end_suppress'. * src/preproc/pic/troff.cc: Don't include `htmlindicate.h'. (troff_output::start_picture, troff_output::finish_picture): Updated. * src/preproc/tbl/main.cc: Don't include `htmlindicate.h'. (process_input_file): Updated. * src/roff/troff/div.cc (page_number): Set page number only if the `ps4html' register isn't defined. * src/roff/troff/input.cc (image_no): New external variable. (do_suppress): Use it. * src/roff/troff/node.h (suppress_node::image_id): New member. * src/roff/troff/node.cc (image_no): Remove `static' keyword. (suppress_node::suppress_node): Initialize `image_id' member. (suppress_node::same): Handle `image_id' also. (suppress_node::copy): Updated. (last_image_id): New global variable. (suppress_node::tprint): Use it. * tmac/an-old.tmac (TS, TE, EQ, EN): Use HTML-IMAGE and HTML-IMAGE-END. * tmac/pspic.mac (PSPIC): Fix html support. * tmac/s.tmac (@EQ, @EN, @TS, TE, PS, PE): Ditto. * tmac/www.tmac (www-image-template): Set up. (HTMLINDEX): Renamed to... (HX): This. (BODYCOLOR): Renamed to... (BCL): This. (BACKGROUND): Renamed to... (BGIMG): This. (URL): Change order of parameters for consistency. (MAILTO): Renamed to... (MTO): This. (IMAGE, PNG-IMAGE, MARGIN-PNG-IMAGE): Renamed to... (IMG, PIMG, MPIMG): This. (HTML-H-BEGIN, HTML-H-END): Renamed to... (HnS, HnE): This. (LINKS): Renamed to... (LK): This. (LINE): Renamed to... (HR): This. (NO-AUTO-RULE): Renamed to... (NHR): This. (HTML-TL): Renamed to... (HTL): This. (UL-BEGIN, UL-END): Renamed to... (ULS, ULE): This. (DROPCAP): Renamed to... (DC): This. (TS, TE, EQ, EN): Provide default definitions. (www-make-unique-name): Updated. (HTML-IMAGE-INLINE): Fix typo. * tmac/groff_www.man: Updated. * doc/Makefile (homepage.html): Add option -r to grohtml. Use shortened image name. * doc/groff.texinfo: Updated info on grohtml strings and macros. * doc/homepage.ms: Updated and extended. 2002-02-14 Werner LEMBERG Don't use `CSI 39 m' and `CSI 49 m' but `CSI 0 m'. * src/devices/grotty/tty.cc (SGR_DEFAULT_COLOR, SGR_BACK_DEFAULT_COLOR): Replaced with ... (tty_printer::put_color): Use it. (ttr_printer::end_page): Simplify. 2002-02-13 Werner LEMBERG * tmac/groff_tmac.man: Moved to... * man/groff_tmac.man: This place. * tmac/Makefile.sub, man/Makefile.sub: Updated. 2002-02-12 Werner LEMBERG * src/libs/libgroff/Makefile.sub (snprintf.o): Don't use $(COMPILE.c) to not include groff's assert.h. * src/drivers/grotty/tty.cc (main): Add GROFF_NO_SGR environment variable. * NEWS, src/drivers/grotty/grotty.man: Document it. 2002-02-11 Werner LEMBERG * src/libs/snprintf/snprintf.c: Updated to latest version (2002-02-11). * src/roff/grog/grog.pl (process): Fix handling of `.['. We now test whether there is `.]' also. Don't check for spaces after `.['. * src/roff/grog/grog.sh: Do the same. 2002-02-10 Werner LEMBERG Illegal -> Invalid. * src/libs/libgroff/illegal.cc: Renamed to ... * src/libs/libgroff/invalid.cc: This. (illegal_char_table): Renamed to ... (invalid_char_table): This. * src/libs/libgroff/Makefile.sub: Updated. * win32-diffs: Updated. * doc/groff.texinfo, src/devices/grops/psrm.cc (ps_get_line), src/libs/libdriver/input.cc (fatal_command, parse_color_command, parse_x_command), src/libs/libgroff/font.cc (text_file::next, font::load), src/preproc/eqn/main.cc (read_line, main), src/preproc/eqn/lex.cc (file_input::read_line), src/preproc/pic/lex.cc (file_input::read_line, simple_file_input::get, simple_file_input::peek), src/preproc/pic/main.cc (top_input::get, top_input::peek), src/preproc/pic/pic.man, src/preproc/refer/main.cc (input_stack::push_file), src/preproc/refer/refer.cc (do_file, do_bib), src/preproc/tbl/main.cc (table_input::get), src/preproc/grn/grn.man, src/preproc/grn/main.cc (interpret), src/roff/troff/input.cc (file_iterator::fill, file_iterator::peek, do_zero_width, read_request, encode_char, ps_get_line, transparent_file, get_char_for_escape_name, transparent_translate, asciify, input_char_description, read_string, set_string), src/roff/troff/env.cc (environment::add_html_tag), src/roff/troff/troff.man, tmac/e.tmac (`@(', `(f'): Do it. * src/include/lib.h: Updated. * src/preproc/eqn/eqn.cc: Removed. * NEWS: Updated. * src/preproc/grn/hdb.cc (DBRead): Fix fscanf() fields. 2002-02-09 Werner LEMBERG * doc/gnu.xpm: New image. * doc/Makefile (DOCS): Add homepage.ps. Add rules for converting xpm->png and xpm->eps. Use `gnu.{xpm,eps}' as image names. * doc/homepage.ms: Updated. 2002-02-09 Gaius Mulley * tmac/www.tmac (www-error): New macro, replacing calls to `@error'. (IMAGE): Change image position parameters to `-L', `-R', and `-C'. Remove calls to `B1' and `B2' (PNG-IMAGE): New macro for inclusion of images in PNG format. (www-left-ll-trap, www-left-po-trap, www-right-ll-trap): New auxiliary variables for MARGIN-PNG-IMAGE. (www-finish-left-po, www-finish-right-ll, www-finish-left-ll): New auxiliary macros for MARGIN-PNG-IMAGE. (MARGIN-PNG-IMAGE): New macro to put an image in PNG format into the margin. (www-heading-no): New auxiliary variable for HTML-H-{BEGIN,END}. (HTML-H-BEGIN, HTML-H-END): New macros to begin and end a heading. (DROPCAP): New macro to produce dropcap characters. (www-do-image): Renamed back to... (HTML-DO-IMAGE): This. Updated all callers. * doc/Makefile (gnubw.eps): Updated. * doc/homepage.ms: Updated. 2002-02-08 Werner LEMBERG * doc/pic.ms: Fixed typos (\(*tx -> \*(tx). Added `linethick' to table in section `Style Variables'. 2002-02-08 Gaius Mulley * src/libs/libdriver/input.cc (get_extended_arg): Fix conditional. 2002-02-07 Werner LEMBERG Adding options -C (compatibility mode) and -c (grotty's old output scheme) to nroff. * src/roff/nroff/nroff.sh: Implement it. Remove `-Wall'. * NEWS, src/roff/nroff/nroff.man: Updated. * PROBLEMS: Document bison 1.32 bug. Some fixes to make groff compile on z/OS 1.2 UNIX (was OS/390). * src/roff/troff/node.cc (make_tfont): Define it earlier. * src/roff/troff/div.h: Add prototype for `end_diversions'. * src/roff/troff/input.cc: Add prototype for `process_input_stack'. * src/roff/troff/env.h: Add prototype for `title'. Adding EBCDIC support to grotty. * src/devices/grotty/tty.cc (CSI): New macro. (SGR_*, tty_printer::put_color): Use it. 2002-02-06 Werner LEMBERG Implementing color support in grotty. The new switch -c activates the old drawing scheme, disabling color at the same time. The new switch `-i' selects italic instead of underlining (SGR only). * src/devices/grotty/tty.cc (putstring): New define instead of `fputs'. Updated all callers. (old_drawing_scheme): New global variable. (COLOR_CHANGE): New enum value. (SGR_*): New defines containing color handling escape sequences. (TTY_MAX_COLORS, DEFAULT_COLOR_IDX): New defines. (glyph): New members `back_color_idx' and `fore_color_idx'. (glyph::order): Add COLOR_CHANGE. (tty_printer): New members `cur_fore_idx', `curr_back_idx', `is_underline', `is_bold', `cu_flag', `tty_colors'. New methods `make_underline', `make_bold', `color_to_idx', `change_color', `put_color'. (cu_flag): Moved into `tty_printer' class. (tty_printer::tty_printer): Initialize colors. (tty_printer::add_char, tty_printer::set_char, tty_printer::special, tty_printer::draw, tty_printer::end_page): Handle colors also. (main): Add options `-c' and `-i'. (usage): Updated. * NEWS, src/devices/grotty/grotty.man: Updated. * src/include/errarg.h (errarg): Add support for `unsigned int'. * src/libs/libgroff/errarg.c: Implement it. * src/include/printer.h (printer): Add `change_color' method (currently used by grotty only). * src/libs/libdriver/printer.cc: Implement it. * src/libs/libdriver/input.cc (parse_D_command, do_file): Add call to `pr->change_color'. * src/roff/troff/node.cc (troff_output_file::fill_color, troff_output_file::glyph_color): Call `do_motion'. * tmac/tty.tmac: Add color definitions. * src/roff/groff/groff.man: Minor fixes. 2002-02-05 Bernd Warken * src/libs/libdriver/input.cc: Introduce `EnvInt' typedef and use it. This is a preparation for future changes. 2002-02-05 Werner LEMBERG * src/roff/troff/input.cc (process_input_stack): Fix the case where leading spaces are followed by \f or \s; previously, an incorrect space width has been used. * doc/roff.man (quoted_char): Fix argument. (comment): Define string. 2002-02-04 Larry Kollar * doc/groff.texinfo: More fixes. 2002-02-04 Werner LEMBERG * src/preproc/eqn/box.cc (output_string): Don't use \\*[...]. * src/preproc/eqn/main.cc (do_file, inline_equation): Call `restore_compatibility' before `output_string' -- the LINE_STRING register now already contains proper switches from and to compatibility mode. * man/groff_char.man: Add Euro symbol. * man/groff_diff.man: Improve documentation of `.am1' and `.as1'. * tmac/tty.tmac: Add `EUR' as replacement for `eu' and `Eu'. * doc/groff.texinfo (Defstr*): Print strings with full syntax. Other minor fixes. * doc/Makefile (.SUFFIXES, .texinfo.pdf, clean): Add support for texinfo->pdf. (.texinfo.html): Add support for texinfo->html. 2002-02-03 Werner LEMBERG Added three new requests `ds1', `as1', and `ami'. The former two are equivalent to `ds' and `as' with the difference that compatibility mode is saved on entry, switched off during string expansion, and restored on exit. The latter is the pendant to `dei' for `am'. (do_define_string): Use `define_mode' and `calling mode'. Insert COMPATIBLE_SAVE and COMPATIBLE_RESTORE at the beginning and end of string, respectively. (define_string, append_string): Use `calling_mode'. (define_nocomp_string, append_nocomp_string, define_string_indirect): New functions. (init_input_requests): Updated. * NEWS, man/groff_diff.man, man/groff.man: Document it. * src/preproc/eqn/box.cc (box::top_level, box::extra_space): Use `as1' for assigning LINE_STRING (this is `10' usually). Sun's mm macro package accesses this string register directly. * src/preproc/eqn/main.cc (inline_equation): Use `as1'. * tmac/trace.tmac: Trace calls to `am' also. Make it work in compatibility mode. 2002-02-02 Larry Kollar * doc/groff.texinfo, tmac/groff_ms.man: More fixes. 2002-01-31 Werner LEMBERG * tmac/an-old.tmac (I): Use \, and \/ to improve spacing. 2002-01-31 Bernd Warken * src/devices/grolbp/lbp.cc (main): Delete `pr'. * man/groff_out.man: Revised and updated. 2002-01-30 Bernd Warken * src/libs/libdriver/input.cc [USE_ENV_STACK]: New macro to comment out the unused `{' and `}' commands. Undefined by default. (IntArray): Make `data' private. (IntArray::operator[], IntArray::get_data, IntArray::len): Use these new methods instead. (skip_line_D, skip_to_end_of_line): New functions. (get_D_fixed_args): Use `skip_line_D'. Changed to handle dummy odd arguments by ... (get_D_fixed_args_odd_dummy): This new function. (get_D_variable_args): Split some code into ... (get_possibly_integer_args): This new function. (send_draw): Use more `const'. (delete_current_env): New function. (position_to_end_of_args): Use `size_t'. Updated. (send_draw): Updated. (parse_D_command): Handle `c', `C', and `t' better. Updated. (do_file): Updated. 2002-01-29 Werner LEMBERG * NEWS: Revised. * doc/groff.texinfo: Introduce @Def...List, @Def...Item, and @Def...ListEnd which replaces @Def...x. This is necessary to get proper HTML output -- see the comment in the file for more information. Updated all calls. 2002-01-29 Gaius Mulley Fixes to make color changes of 2002-01-21 work with grohtml. * src/devices/grohtml/post-html.cc (style): Updated. (html_printer): Remove unused methods. (html_printer::do_font, html_printer::draw, html_printer::set_char, html_printer::special): Updated. * src/devices/grohtml/html-text.cc (debugStack, turnDebug, html_text::dump_stack_element, html_text::dump_stack) [DEBUGGING]: Added some debugging code. (html_text::start_tag): Updated. (html_text::do_push): New method. (html_text::push_para): Call it. Add method for handling color. (html_text::do_color): Updated. (html_text::shutdown): Handle color. * src/devices/grohtml/html-text.h (tag_definition): New member `col'. Updated. 2002-01-28 Werner LEMBERG * tmac/ps.tmac, tmac/html.tmac: Fix compatibility mode issues. 2002-01-27 Gaius Mulley Add two switches -a and -g to control the antialiasing bits for text and graphics, respectively. * src/devices/grohtml/post-html.cc (main): Dummy code for `-a' and `-g'. * src/devices/grohtml/grohtml.man: Document them. * src/preproc/html/pre-html.cc (MIN_ALPHA_BITS, MAX_ALPHA_BITS): New macros. (textAlphaBits, graphicAlphaBits, antiAlias): New global variables. (setupAntiAlias): New function. (createAllPages): Updated. (scanArguments): Handle `-a' and `-g'. (main): Call `setupAntiAlias'. * NEWS: Updated. 2002-01-27 Werner LEMBERG * doc/groff.texinfo (Def*): Call index function after deffn. * tmac/html.tmac: Call `nroff' request. 2002-01-26 Larry Kollar * tmac/groff_ms.man: Add some omissions. 2002-01-25 Larry Kollar * tmac/groff_ms.man: Typographical improvements. 2002-01-25 Werner LEMBERG * doc/groff.texinfo: Updated version and copyright. * src/devices/grops/grops.man: Updated. * tmac/groff_tmac.man: Fix `ig' macro. * tmac/an-old.tmac (ne): Redefine `ne' request to be a no-op in nroff mode. Use `.ne' unconditionally everywhere. (TS): Only insert some vertical space. Doing a page break is no longer necessary due to the redefinition of the `ne' request. * src/libs/libdriver/input.cc (parse_D_command): Don't emit a warning for unknown subcommands but parse and pass them to the device driver. 2002-01-24 Werner LEMBERG * tmac/groff_www.man, NEWS: Fix typos. 2002-01-21 Werner LEMBERG Complete revision of color support: Adapt programs to the new libdriver/input.cc. Color spaces are no longer converted to RGB but transferred as-is in the troff intermediate output format. Handle default color gracefully. troff now supports a `default' color (which can't be changed). grops will now use the proper color space functions if available. Update pic. Note that currently grohtml doesn't handle colors properly. This has to be fixed. * src/libs/libgroff/itoa.c (UINT_DIGITS): New macro. (ui_to_a): New function. * src/include/lib.h: Updated. * src/include/color.h (color_scheme): Replace `NONE' with `DEFAULT'. (color): Simplified; removed all `double' members and methods. A new array `components' now holds the color parameters. (color::is_default, color::get_components): New methods. (color::operator==, color:operator!=): New. (Red, Green, Blue, Cyan, Magenta, Yellow, Black, Gray): New macros to make access to the `components' array more comprehensible. * src/libs/libgroff/color.cc: Implement new color support. (atoh): Small fixes. (color::read_encoding): Simplified for new troff intermediate color output format. (default_color): New global variable. * src/roff/troff/input.cc (default_symbol): New global variable. (lookup_color): Use it. (default_black): Removed. (do_glyph_color, do_fill_color): Simplified. (define_color): Handle default color. Improve warnings. (do_if_request): Handle default color. * src/roff/troff/env.cc (environment::environment): Initialize colors with `default_color'. * src/roff/troff/node.cc (troff_output_file::put): Add method for `unsigned int'. (troff_output_file::hex): Removed. (troff_output_file::fill_color, troff_output_file::glyph_color): Updated to include/color.h and libdriver/input.cc. * src/preproc/pic/object.cc (draw_arrow): New parameter to set fill color properly (identically to the outline color). \D'f...' doesn't work any more. All function calls to it updated. * src/devices/grohtml/post-html.cc (html_printer::do_body, main): Updated. * src/devices/grohtml/html-text.cc (html_text::issue_color_begin): Updated. * src/devices/grops/ps.cc (ps_output::put_color): New method. (ps_printer::sbuf_color): Make a real member instead of pointer. (ps_printer::fill_color, ps_printer::output_color): Removed. (ps_printer::ps_printer): Updated. (ps_printer::set_char): Ditto. (ps_printer::set_color): Use various color schemes. Use `put_color' method. (ps_printer::flush_sbuf): Don't set color. (ps_printer::fill_path): Take `environment' as parameter. Simplify color handling. (ps_printer::set_line_thickness): Renamed to ... (ps_printer::set_line_thickness_and_color): This (and updated). (ps_printer::set_color): Change second parameter from `complete' to `fill' which better describes what it does. (ps_printer::draw): Call `flush_sbuf' to output graphic commands and text in the right order. Updated. Remove branches for `f' and `F'; this is handled by libdriver/input.cc. * src/devices/grops/ps.h: Updated. * font/devps/prologue (FL): Redefined. ({F,C}r,k,g: New color functions (with and without filling). * doc/pic.ms, src/preproc/pic/pic.man: Small fixes. * man/groff_diff.man, man/groff.man, man/groff_out.man, doc/groff.texinfo, NEWS: Updated. 2002-01-20 Bernd Warken * src/libs/libdriver/input.cc: Completely rewritten. See comments in this file for what has been changed. 2002-01-19 Werner LEMBERG * test-groff: Fix GROFF_FONT_PATH. * tmac/andoc.tmac: Add dummy macros for equation support -- eqnrc is read before .TH or .Dd is parsed. 2002-01-18 Gaius Mulley * src/libs/libgroff/geometry.cc (check_output_arc_limits): Fix quadrant boundaries. 2002-01-18 Werner LEMBERG * devices/grops/ps.cc: Aargh! Fix the fix of the incorrectly applied last patch. 2002-01-17 Ruslan Ermilov * tmac/doc.common: Initialize %I register for the %I macro to avoid (harmless) warning. * tmac/doc.tmac (Bd): There is no reason to enforce -compact when in the SYNOPSIS section. 2002-01-17 Bruno Haible * src/preproc/pic/lex.cc (get_token): Fix typo. 2002-01-17 Werner LEMBERG * devices/grops/ps.cc: Fix incorrectly applied last patch. 2002-01-17 Larry Kollar * tmac/groff_ms.man: Completely rewritten. 2002-01-16 Werner LEMBERG * tmac/an-old.tmac (TS): Force break, inserting some vertical space. 2002-01-15 Gaius Mulley * devices/grops/ps.cc (ps_printer::fill_path): Fix handling of fill colors. (ps_printer::draw): Ditto. 2002-01-14 Ruslan Ermilov * tmac/groff_mdoc.man: Minor fixes. 2002-01-13 Werner LEMBERG * man/groff_out.man: Some fixes. 2002-01-13 Gaius Mulley * doc/pic.ms: Fix typos. 2002-01-12 Werner LEMBERG * doc/groff.texinfo, doc/groff.man: More on a printable backslash. 2002-01-10 Werner LEMBERG * font/devutf8/R.proto, font/devhtml/R.prot: Add `Eu' and `eu' symbols. * NEWS: Updated. 2002-01-09 Bernd Warken * man/groff_out.man: Revised. * man/roff.man: Minor fixes. * src/roff/troff/troff.man: Some reordering. 2002-01-09 Werner LEMBERG * tmac/an-old.tmac: Add dummy macros for equation support. 2002-01-07 Werner LEMBERG doc/groff.texinfo: Fix documentation of glyph searching algorithm. * tmac/an-old.tmac: Revert change 2001-12-23. This breaks too many man pages. * tmac/groff_man.man: Small improvements. 2002-01-07 Bernd Warken * man/groff_diff.man: Revised. 2002-01-06 Werner LEMBERG * tmac/www.tmac: Remove extraneous backslash. 2002-01-06 Bernd Warken * man/ditroff.man, src/roff/groff/groff.man, man/groff.man: Revised. 2002-01-05 Werner LEMBERG Integrated groffer, contributed by Bernd Warken. * contrib/groffer/*: New. * Makefile.in, NEWS: Updated. 2002-01-04 Werner LEMBERG * doc/groff.texinfo: Added macros `@Defmpreg' and `@Defmpregx' for registers defined in macro packages. Revising the ms part. 2002-01-04 Larry Kollar * doc/groff.texinfo: Add documentation for ms macros. 2002-01-02 Werner LEMBERG First step in adding PS support for the Euro symbol. `eu' is the official Euro logo, `Eu' is a font-specific glyph variant. * font/devps/text.enc: Add `Euro' at position 9. * font/devps/generate/textmap: Add `Euro' as symbol `Eu'. * font/devps/symbolmap: Regenerated. * NEWS: Updated. 2002-01-02 Bernd Warken * man/roff.man: Revised. 2002-01-01 Bernd Warken * src/roff/groff/groff.man: Completely rewritten. 2001-12-31 Werner LEMBERG * doc/Makefile: Updated. 2001-12-30 Werner LEMBERG * tmac/www.tmac: Make all names of internal macros/registers/strings lowercase, and prepend `www-'. Other minor changes. * src/roff/troff/troff.man: Add preprocessor string at BOF. 2001-12-30 Gaius Mulley Implement option `-b' in grohtml to set the HTML background colour. * src/devices/grohtml/post-html.cc (default_background): New global variable. (html_printer::html_printer): Initialize `background' to `default_background'. (main): Implement option `-b'. (usage): Updated. * src/preproc/html/pre-html.cc (scanArguments): Add dummy handling of `-b' option. * src/devices/grohtml/grohtml.man: Updated. * doc/Makefile (.ms.html): Use `-b'. * tmac/html.tmac: Don't set background color. Add new grohtml tag `.html-tl'. * src/devices/grohtml/post-html.cc (title_desc): Add `with_h1' member variable. (title_desc::title_desc): Updated. (html_printer::troff_tag): Handle `.html-tl'. (html_printer::write_title): Use `with_h1'. * tmac/www.tmac (www-end-nowhere): New auxiliary macro. (HTML-TL): New macro. Add support for unordered lists in HTML. * tmac/www.tmac (www-level): New auxiliary register. (www-level1, www-level2, www-level3): New auxiliary strings. (www-push-level, www-pop-level): New auxiliary macros (UL-BEGIN, UL-END, LI): User macros for unordered lists. Miscellaneous. * src/preproc/html/pre-html.cc (DEFAULT_IMAGE_RES): Increase to 100. (DEFAULT_VERTICAL_OFFSET): Removed. (IMAGE_BOARDER_PIXELS): Set to 0. (A4_LENGTH, A4_OFFSET, LETTER_LENGTH, LETTER_OFFSET): New macros. (vertical_offset): Initialize with 0. (gsPaper): New global variable. (get_resolution): Scan for and return unsigned int. (get_papersize): New function to get paper length from devps/DESC. (determine_vertical_offset): New function. (createAllPages): Produce gray-level images and use proper page length. (createImage): Use `-quiet' option of pnmcrop. (addZ): Fix passing of `-Z'. (scanArguments): Fix handling of `-o'. (main): Call `determine_vertical_offset'. * src/devices/grohtml/post-html.cc (html_printer::draw): Comment out code for `l'. * src/libs/libgroff/tmpfile.cc (add_tmp_file): Fix buffer length. * src/roff/troff/node.cc (troff_output_file::check_charinfo): Handle glyph descenders properly. * doc/homepage.ms: Include `gnubw.eps'. * doc/Makefile (gnubw.eps): New rule. (homepage.html): Depend on `gnubw.eps'. 2001-12-25 Werner LEMBERG * src/roff/troff/input.cc (default_black): Fix return value. 2001-12-24 Ruslan Ermilov * tmac/doc-common (Dt): Change output of architecture strings. Do some syntax cleanup. * tmac/groff_mdoc.man: Updated. 2001-12-23 Werner LEMBERG Adding an `itc' request (input line trap accepting \c). * src/roff/troff/env.h (environment): New member `continued_input_trap'. Make `do_input_trap' a friend function instead of `input_trap'. * src/roff/troff/env.cc (environment::environment, environment::copy): Updated. (environment::newline): Implement it. (do_input_trap): New function. (input_trap): Call `do_input_trap'. (input_trap_continued): New function. (init_env_requests): Updated. * src/roff/troff/TODO: Updated. * tmac/an-old.tmac (SH, SS, B, I, SM, SB, TP): Use `.itc' instead of `.it'. * src/preproc/grn/hdb.cc (DBRead): Really chop after 127 characters. 2001-12-22 Ruslan Ermilov * tmac/doc-common, tmac/doc-syms: Small updates. 2001-12-22 Colin Watson * tmac/an-old.tmac (an-p-footer): Set title length in environment 1. 2001-12-22 Bernd Warken * MANIFEST: New file. 2001-12-22 Werner LEMBERG * src/preproc/grn/grn.man: Updated. 2001-12-22 Solar Designer * src/preproc/grn/hdb.cc (MAXSTRING_S): New macro. (DBRead): Use it. 2001-12-19 Werner LEMBERG Implement a fallback character request `.fchar'. * src/roff/troff/charinfo.h (charinfo): New flag `fallback'. (is_fallback): New inline function. * src/roff/troff/input.cc (do_define_character): New function. (define_character): Call `do_define_character'. (define_fallback_character): New function. (init_input_requests): Add `fchar'. (charinfo::charinfo): Updated. (charinfo::set_macro): New argument to set `fallback' flag. * src/roff/troff/node.cc (make_glyph_node, make_node, node::add_char): Check `fallback' flag. * NEWS, man/groff_diff.man, man/groff_man: Updated. 2001-12-16 Werner LEMBERG * groff.texinfo: Document exact search algorithm for glyphs. 2001-12-15 Werner LEMBERG * Makefile.cpg, Makefile.ccpg, Makefile.man: Add dummy file to the left side of $(MANPAGES) rule to make it always non-empty. 2001-12-14 Werner LEMBERG * src/roff/troff/input.cc (default_black): Define default color `black' if not yet defined. 2001-12-13 Werner LEMBERG Implement new string-valued register `.fn' to return the current real (internal) font name. * env.cc (environment::get_font_name_string): New function. (init_env_requests): Add `.fn' register. * env.h (environment): Updated. * node.cc (font_info): Make `get_font_name' a friend. (get_font_name): New function. * node.h: Updated. * man/groff_diff.man, man/groff.man, NEWS: Updated. 2001-12-12 Ralph Corderoy * src/preproc/eqn/main.cc (inline_equation): Fix typos. 2001-12-12 Werner LEMBERG * tmac/groff_man.man, doc/groff.texinfo: There is no .R macro. 2001-12-10 Gaius Mulley * man/groff_diff.man: Adding documentation for \O. 2001-12-10 Werner LEMBERG * src/preproc/html/pre-html.cc (TROFF_COMMAND): Removed. (scanArguments): Use PROG_PREFIX for the name of the troff binary. 2001-12-09 Werner LEMBERG * man/roff.man: Revised. * src/roff/groff/groff.man: Replace man page references with a pointer to roff.man. 2001-12-09 Bernd Warken * man/roff.man: Completely rewritten. 2001-12-06 Ralph Corderoy * src/preproc/eqn/main.cc (inline_equation): Improve error message. 2001-12-05 Werner LEMBERG * src/roff/troff/input.cc (get_delim_file_name): Removed since no longer used. * src/devices/grohtml/post-html.cc (html_printer::html_printer): Fix order of initializers. * NEWS: Updated. 2001-12-05 Gaius Mulley * doc/groff.texinfo: Fix documentation of \O. * src/devices/grohtml/html-text.cc (html_text::do_indent, html_text::do_table, html_text::do_emittext, html_text::do_para): Use `const' for first argument. (html_text::do_table): Use cast. * src/devices/grohtml/html-text.h: Updated. * src/devices/grohtml/output.cc (simple_output::put_string): Add method for `const string &s'. * src/devices/grohtml/html.h: Updated. * src/devices/grohtml/post-html.cc (MAX_STRING_LENGTH): Removed. (ANCHOR_TEMPLATE): Modified. (manufacture_headings): New global variable to handle `-h' option. (is_subsection): Removed. (char_buffer::add_string): Add `const' to first argument. Protect against invalid string argument. Add method for `const string &s'. (text_glob): Completely redesigned. (page): Use `const' for strings and remove string length variable. (page::add_html): Removed. (page::add_end_encode): New member function. (to_unicode): Moved upwards. (title_desc, header_desc): Updated. (header_desc::write_headings): Updated to new ANCHOR_TEMPLATE definition. (html_printer::is_bold, html_printer::make_bold): New member functions. (html_printer::end_of_line): Updated. (generate_img_src, html_printer::do_auto_image, html_printer::do_title, html_printer::write_header, html_printer::determine_header_level, html_printer::do_heading, html_printer::do_linelength, html_printer::do_pageoffset, html_printer::do_indentation, html_printer::do_tempindent, html_printer::do_indentedparagraph, html_printer::do_break, html_printer::flush_sbuf, get_html_translation, html_printer::begin_page, html_printer::special): Rewritten to get rid of static string length limit. (html_printer::troff_tag): Added `.no-auto-rule'. (html_printer::flush_globs): Small fix. (html_printer::determine_space): Don't compute `space_width'. (html_printer::translate_to_html): Renamed to ... (html_printer::emit_html): This (with updates). (html_printer::write_header): Implement `-h' option. (html_printer::draw): Remove commented-out code. Handle `F' command. (html_printer::add_char_to_sbuf): Removed. (html_printer::add_to_sbuf): Rewritten. (html_printer::sbuf_continuation): Fixed. (html_printer::seen_backwards_escape, reverse, html_printer::remove_last_char_from_sbuf): Removed. (char_translate_to_html, str_translate_to_html): Removed. (html_printer::overstrike): New function member. (html_printer::set_char): Use it. (html_printer::do_body): New function member. (html_printer::~html_printer): Use it. (main): Handle `-h' option. (usage): Updated. * src/devices/grohtml/grohtml.man: Document -h switch. * src/preproc/html/pre-html.cc: Include searchpath.h Replace `POSTSCRIPTRES' macro with `postscriptRes' variable. (get_resolution): New function. (checkImageDir): Use `0777' permissions in mkdir() (write_start_image): Rewritten to use `\O[5...]'. (createImage, generateImages): Updated. (main): Handle `F' and `h' options. Use `get_resolution'. * src/roff/troff/input.cc (begin, end, image): Removed. (do_suppress): Take parameter. Handle modified syntax of `\O'. (token::next): Updated. (init_markup_requests): Removed. (main): Updated. * src/roff/troff/div.h: Add declaration for begin_page(). * tmac/color-html.tmac: Removed. Contents moved to... * tmac/html.tmac: Here. Set background color. * tmac/color.tmac: Removed. Contents moved to... * tmac/ps.tmac: Here. * tmac/www.tmac: Remove the title command when generating images for html. (NO_AUTO_RULE): New macro. (HTML_DO_IMAGE): Use revised `\O' escapes. * tmac/Makefile.sub, tmac/groff_www.man, tmac/troffrc: Updated. 2001-12-02 Werner LEMBERG * tmac/groff_mdoc.man: Fix typo. 2001-12-01 Colin Watson * man/roff.man: Fix typo. 2001-11-29 Werner LEMBERG * src/libs/libbib/map.c, src/utils/pfbtops/pfbtops.c: Include stdlib.h. * src/roff/troff/input.cc (read_draw_node): Emit error message if more than one argument to \D'f ...'. * tmac/Makefile.sub (NORMALFILES): Add lbp.tmac. 2001-11-28 Werner LEMBERG * tmac/an-old.tmac, tmac/doc.tmac: Assure that the macro package is loaded only once. * tmac/groff_man.man: Minor cosmetic fix. 2001-11-27 Werner LEMBERG * src/roff/groff/groff.man, tmac/groff_tmac.man, tmac/groff_www.man: s/mwww/www/. 2001-11-26 Werner LEMBERG * aclocal.m4 (GROFF_MKSTEMP): Implement test using C++ linkage. * configure: Regenerated. * win32-diffs: Updated. * tmac/groff_mwww.tmac: Renamed to ... * tmac/groff_www.tmac: This. * tmac/mwww.tmac: Removed. * NEWS, tmac/Makefile.sub: Updated. 2001-11-21 Werner LEMBERG * doc/groff.texinfo: Improve documentation of the `\v' escape. Fix explanation of `\D' and `rt'. 2001-11-20 Werner LEMBERG * tmac/an-old.tmac (an-header): Set header length equal to page width. * doc/groff.texinfo: Improve documentation of `ne' request. Other minor fixes. * NEWS: Small fix. 2001-11-19 Werner LEMBERG * NEWS, man/Makefile.sub: Updated. 2001-11-19 Bernd Warken * man/ditroff.man: New file. 2001-11-17 Werner LEMBERG * man/groff_differences.man: Renamed to ... * man/groff_diff.man: This. Updated. * man/Makefile.sub, src/roff/troff/troff.man, NEWS: Updated. * src/preproc/html/pushbackbuffer.cc: Renamed to ... * src/preproc/html/pushback.cc: This. Updated. * src/preproc/html/pushbackbuffer.h: Renamed to ... * src/preproc/html/pushback.h: This. * src/preproc/html/Makefile.sub, src/preproc/html/pre-html.cc: Updated. * src/libs/libgroff/htmlindicate.cc: Renamed to ... * src/libs/libgroff/htmlhint.cc: This. * src/libs/libgroff/Makefile.sub: Updated. * tmac/an-old.tmac (an-end): Fix page length. 2001-11-16 Werner LEMBERG * NEWS, man/groff_differences.man, doc/groff.texinfo: Updated. * man/Makefile.sub: Include groff_differences.man. * VERSION: Set to 1.18. * REVISION: Set to 0. 2001-11-16 Bernd Warken * src/roff/troff/input.cc (do_define_macro): Allow whitespace before the second dot (or ending macro name) to end a macro. * doc/groff.texinfo: Doc fix. 2001-11-16 Ruslan Ermilov * tmac/doc-common (doc-header): Handle very long document titles better. 2001-11-16 Werner LEMBERG * tmac/doc.tmac (doc-do-Bl-args): Fix .substring requests. 2001-11-15 Werner LEMBERG * src/roff/troff/troff.man: Revised and split into troff.man and... * man/groff_differences.man: New file. * NEWS: Updated. 2001-11-13 Werner LEMBERG * tmac/an-old.tmac (TS, TE): New macros for table support. 2001-11-12 Werner LEMBERG * src/include/lib.h: Provide a fix for emx to not include groff-getopt.h. 2001-10-27 Werner LEMBERG * src/roff/troff/input.cc (substring_macro): Fix computation of boundary values. 2001-10-20 Werner LEMBERG Undo change from 2001-08-28. * src/roff/troff/input.cc (have_input): New global variable. (token::next): Set `have_input' for \f, \H, \R, \s, and \S if not in compatibility mode. (process_input_stack): Use it. 2001-10-19 Ruslan Ermilov * tmac/doc.tmac (doc-flag-recursion): Protect arguments against being handled as end-of-sentence characters, 2001-10-10 Gaius Mulley * src/roff/troff/input.cc (file_iterator): New members `suppress_newline_flag' and `seen_escape'. (file_iterator::next_file): Updated. (file_iterator::fill): Use it. (string_iterator): New member `suppress_newline_flag'. (string_iterator::fill): Set it. (get_color_element): Use MAX_COLOR_VAL. * src/roff/troff/env.cc (environment): Remove `need_eol'. (no_fill): Don't set `env->ignore_next_eol'. (environment::newline): Handle `eol' tag properly. Emit `eol.ce'. (environment::add_html_tag): Set `env->ignore_next_eol'. Don't handle `.ce'. * src/roff/troff/env.h (environment): Updated. * src/devices/grohtml/post-html.cc (text_glob::is_eol_ce): New member function. (html_printer::outstanding_eol): New member function. (html_printer::do_title): Use new functions. (html_printer::troff_tag): Test `id_eol_ce'. 2001-10-10 Werner LEMBERG * tmac/color.tmac, tmac/color-html.tmac: Use `.do' to make those files work with -C also. 2001-10-05 Werner LEMBERG * doc/pic.ms: Minor fix. * src/preproc/html/pre-html.cc (scanArguments): Don't handle `-?' as a valid command line switch. * src/devices/grohtml/post-html.cc (main): Ditto. (usage): Updated. * src/devices/grohtml/grohtml.man: Updated. * src/roff/groff/groff.cc (main): Pass `-v' to predriver also. 2001-10-04 Werner LEMBERG Implementing color support in troff, pic, grops, and grohtml. These changes are based on a major patch provided by Gaius Mulley . New request: `defcolor', supporting rgb, cmy, cmyk, and gray definitions with both hex values and fractions. New escapes: \m and \M for drawing and background color, respectively. This corresponds to the troff output commands `m' and `DF'. groff and troff accept command line switch `-c' to disable color output (which is automatically disabled in compatibility mode). New scaling indicator `f' for fractions (1f = 65536u). New conditional operator `m' to test for defined colors with `if' and `ie'. New keywords `color' (or `colour', `colored', `coloured'), `outline' (or `outlined'), and `shaded' added to pic. * src/include/color.h: New file. * src/include/driver.h: Include it. * src/include/printer.h: Include color.h. (environment): New members `col' and `fill'. (printer): Remove `adjust_arc_center' member function. * src/include/Makefile.sub: Updated. * src/libs/libdriver/input.cc (do_file): Initialize `env.col' and `env.fill'. Handle `m' and `DF' troff commands. * src/libs/libgroff/color.cc: New file. * src/libs/libgroff/Makefile.sub: Updated. * src/preproc/html/pre-html.cc (IMAGE_BORDER_PIXELS): Set to 2. (stop): Removed. (createImage): Fix computation of `y2'. Use `pnmcrop' also. (buffer::write_file_html): Remove calls to `stop'. * src/preproc/pic/common.h (common_output): New abstract function members `set_color', `reset_color', `get_last_filled', and `get_outline_color'. * src/preproc/pic/object.h: Add `IS_SHADED' and `IS_OUTLINED'. (object_spec): Add members `shaded' and `outlined'. * src/preproc/pic/output.h (output): `command' is now abstract. New function members `set_color', `reset_color', `get_last_filled', and `get_outline_color'. * src/preproc/pic/lex.cc (lookup_keyword): Recognize `colo[u]r[ed]', `outline[d]', and `shaded'. * src/preproc/pic/object.cc (output::command): Removed. (output::set_location): Moved to output.h. (graphic_object): Add protected members `outline_color' and `color_fill'. Add member functions `set_outline_color', `get_outline_color', and `set_fill_color'. (closed_object): Add member function `set_fill_color'. Add member `color_fill'. (graphic_object::print_text): Use `out->set_color' and `out->reset_color'. (box_object::print, ellipse_object::print, circle_object::print, line_object::print, spline_object::print, arc_object::print): Ditto. (object_spec::make_object): Implement `IS_OUTLINED' and `IS_SHADED'. * src/preproc/pic/pic.y: Add tokens `COLORED', `OUTLINED', and `SHADED', making them `%left'. Add rules `object_spec [SHADED|COLORED|OUTLINED] text'. * src/preproc/pic/tex.cc (tex_output): New dummy function members `set_color', `reset_color', `get_last_filled', and `get_outline_color'. * src/preproc/pic/troff.cc (simple_output): New abstract function members `set_color', `reset_color', and `get_last_filled'. (simple_output::polygon, simple_output::circle, simple_output::ellipse): Use `get_last_filled'. (troff_output): New members `last_filled' and `last_outlined'. New function members `set_color', `reset_color', `get_last_filled', and `get_outline_color'. (troff_output::finish_picture): Use `reset_color'. (troff_output::set_fill): Test `last_filled'. * src/preproc/pic/pic.man: Updated. * src/roff/groff/groff.cc (main): Implement `-c' option. (synopsis, help): Updated. src/roff/groff/groff.man: Updated. * src/roff/troff/troff.h: Include color.h. (warning_type): Add WARN_COLOR. * src/roff/troff/env.h (environment): New members `{cur,prev}_{glyph,fill}_color'. New member functions `get_{prev_,}{glyph,fill}_color'. * src/roff/troff/env.cc: Initialize and implement them. * src/roff/troff/input.cc: New global variable `disable_color_flag'. Replace `NULL' with `0' everywhere for consistency. (lookup_color, default_black, do_glyph_color, do_fill_color, get_color_element, read_rgb, read_cmy, read_cmyk, read_gray, define_color): New functions. (token::next): Implement \M and \m escapes. (do_if_request): Implement `m' operator. (usage): Updated. (main): Implement `-c' option. (init_markup_requests): Add `defcolor' request. (warning_table): Add `color' warning. * src/roff/troff/node.h (glyph_color_node, fill_color_node): New classes. * src/roff/troff/node.cc (troff_output_file): New members `current_{page,glyph}color'. New member functions `put_hex', `glyph_color', and `fill_color'. (glyph_color_node::*, fill_color_node::*): Implement it. * src/roff/troff/number.cc (SCALE_INDICATOR_CHARS): Add `f'. (parse_term): Add support for `f'. * src/roff/troff/troff.man: Updated. * src/devices/grodvi/dvi.cc (draw_dvi_printer::draw): Add dummy entry for `F'. * src/devices/grolbp/lbp.cc (lbp_printer::draw): Ditto. * src/devices/grolj4/lj4.cc (lj4_printer::draw): Ditto. * src/devices/grohtml/html-text.h (HTML_TAG): Add COLOR_TAG. (tag_definition): Use `void *' for arg1. (html_text): New member functions `do_color' and `done_color'. Use `void *' for second parameter of `push_para' member function. New `push_para' member function with a single parameter. Use `char *' for parameter of `issue_table_begin' member funtion. New `issue_color_begin' member function. * src/devices/grohtml/html-text.cc (html_text::end_tag): Handle COLOR_TAG. (html_text::issue_color_begin): New function. (html_text::issue_table_begin): Use `char *' for parameter. (html_text::start_tag, html_text::shutdown, html_text::check_emit_text): Updated. (html_text::push_para): Use `void *' for second parameter. Add same function with only one parameter. (html_text::do_*): Updated. (html_text::do_color, html_text::done_color): New functions. * src/devices/grohtml/post-html.cc (style): New member `col'. Mew member `style' with 6 parameters. (style::style, style::operator==): Updated. (html_printer::do_font): Use it. (html_printer::draw): Add dummy entry for `F'. (html_printer::set_char): Updated. * src/devices/grohtml/grohtml.man: Updated. * src/devices/grops/ps.cc (ps_output::put_float): Use `%g' to have trailing zeroes removed. (ps_printer): New members `sbuf_color', `fill_color', and `output_color'. Removed member `fill'. New member function `set_color'. (ps_printer::ps_printer, ps_printer::set_char): Updated. (ps_printer::flush_sbuf, ps_printer::set_line_thickness, ps_printer::fill_path, ps_printer::draw): Use `set_color'. * tmac/color-html.tmac, tmac/color.tmac: New files. * tmac/troffrc: Include them. * tmac/www.tmac (URL, FTP, MAILTO): Use blue color. * tmac/Makefile.sub: Updated. * NEWS, doc/groff.texinfo, doc/pic.ms, man/groff_out.man, man/groff.man: Updated. * font/devps/prologue.ps: Define FC and CO functions. 2001-10-04 Gaius Mulley Fix incorrect cropping of images and incorrect handling of special characters. Fix handling of file names in \O. * src/include/geometry.h: New file. * src/libs/libgroff/geometry.cc: New file. * src/libs/libdriver/printer.cc (printer::adjust_arc_center): Moved to `geometry.cc'. * src/roff/troff/input.cc (get_delim_file_name): Fixed problem with initial spaces. (do_suppress): Updated. * src/roff/troff/node.cc: Include geometry.h. (troff_output_file::flush_tbuf): Fixed parameters to `check_output_limits'. (troff_output_file::check_charinfo): Ditto. (troff_output_file::determine_line_limits): Add support for `Da' and `Dl' commands. * src/devices/grohtml/post-html.cc (str_translate_to_html): Add new parameter `is_special' to decode special characters from escape sequences. (html_printer::do_title, html_printer::do_heading, html_printer::do_indentedparagraph, html_printer::translate_to_html, html_printer::special): Updated. 2001-10-03 Werner LEMBERG * Makefile.sub (DISTCLEANFILES): Add stamp-h. Fix entry for config.h. * test-groff (GROFF_BIN_PATH): Add $builddir/roff/groff. * tmac/troffrc: Translate nonbreakable space character to `\~'. * src/preproc/eqn/eqn.man: Document -d command line option. 2001-09-27 Werner LEMBERG * man/groff.man: Use .ev xxx .na .nh .ev instead of the old code (`.ad .hy' after the table) to suppress incorrect hyphenation for grohtml output. 2001-09-22 Werner LEMBERG * man/groff_font.man, man/groff_out.man: Minor fixes. 2001-09-20 Werner LEMBERG * PROBLEMS: Updated, reordered. Improved EPS section (thanks to Arnold Robbins ). 2001-09-09 Werner LEMBERG * configure: Regenerated with autoconf 2.52. * doc/groff.texinfo: Complete revision of indices. 2001-09-07 Werner LEMBERG * doc/Makefile (clean): Updated to delete all indices. 2001-09-05 Werner LEMBERG * src/roff/troff/troff.man: Remove superfluous line. * tmac/s.tmac: Enable all warnings only if no -W or -w option is given on the command line (or rather, if only the default warnings are set). 2001-09-03 Werner LEMBERG * man/groff.man, src/preproc/eqn/eqn.man, tmac/groff_mdoc.man: Don't use .ne for TTY devices. 2001-08-31 Werner LEMBERG * src/roff/troff/token.h, src/roff/troff/input.cc: s/TOKEN_TRANSPARENT_ESCAPE/TOKEN_OPAQUE_ESCAPE/. 2001-08-28 Werner LEMBERG * src/roff/troff/token.h (token_type): Add TOKEN_TRANSPARENT_ESCAPE. * src/roff/troff/input.cc (token::next): Return TOKEN_TRANSPARENT_ESCAPE for \f, \H, \R, \s, and \S if not in compatibility mode. (token::description): Updated. (process_input_stack): Reset `bol' for TOKEN_TRANSPARENT_ESCAPE. (token::add_to_node_list, token::process): Ignore TOKEN_TRANSPARENT_ESCAPE. 2001-08-27 Werner LEMBERG * tmac/an-old.tmac: Fix `S' string. 2001-08-26 Werner LEMBERG * src/roff/troff/troff.man: Don't use .ne for TTY devices. 2001-08-25 Werner LEMBERG * doc/pic.ms: Replace `\\' with `\e' (and fixing some single backslashes). Many other minor fixes. * configure.ac: Add message at end to inform how to compile xditview. * configure: Regenerated. 2001-08-24 Werner LEMBERG * src/include/getopt.h, src/libs/libgroff/{getopt.c, getopt1.c}: Updated to latest version of libc. 2001-08-23 Werner LEMBERG * configure.ac: Don't create subdirectories before AC_CONFIG_FILES. Autoconf 2.50 and newer can handle this. * configure: Regenerated. 2001-08-21 Werner LEMBERG * doc/pic.ms: Fix typo. * src/preproc/tbl/tbl.man: Document case of global options. 2001-08-21 Gaius Mulley * src/devices/grohtml/post-html.cc (html_printer::end_font): Fix handling of `CR' font. 2001-08-20 Werner LEMBERG Use a config.h file. * src/include/lib.h: Include config.h. * All C files: Ditto (if necessary). * All C++ source and header files: Include lib.h first (if necessary). * src/include/config.hin: New file (autogenerated by autoheader). * stamp-h.in: New file. * configure.ac: Updated. * aclocal.m4: Add third parameters to AC_DEFINE macros. (GROFF_ARRAY_DELETE): Simplified. * Makefile.sub (DISTCLEANFILES): Updated. Added targets for remaking config.status, config.hin, config.h, stamp-h.in, and stamp-h. * configure: Regenerated. 2001-08-19 Werner LEMBERG * NEWS: Updated. 2001-08-18 Sebastian Krahmer * src/preproc/pic/pic.y (format_number): Use do_sprintf(). (do_sprintf): Use snprintf(). 2001-08-18 Werner LEMBERG * src/libs/snprintf/*: Added an snprintf module written by Mark Martinec. * src/libs/libgroff/Makefile.sub: Updated. * configure.ac: Add test for snprintf(). * Makefile.in: Updated. * configure: Regenerated. * src/preproc/html/pre-html.cc (make_message): Reactivate code which uses snprintf(). 2001-08-14 Ruslan Ermilov * tmac/doc.tmac (Ex): New implementation. * tmac/doc-common, tmac/groff_tmac.man: Updated. 2001-08-13 Ruslan Ermilov * tmac/doc.tmac (Rv): Implement support for 0 or more than 1 argument. * tmac/groff_tmac.man: Updated. 2001-08-13 Werner LEMBERG * src/preproc/tbl/tbl.man: Minor documentation update. 2001-08-13 John David Anglin * src/libs/libgroff/tmpname.cc: Add prototype for gettimeofday(). * configure.ac: Add declaration test for gettimeofday(). * Makefile.in: Document NEED_DECLARATION_GETTIMEOFDAY defines. * aclocal.m4: Include sys/time.h for gettimeofday declaration test. * configure: Regenerated. 2001-08-11 Werner LEMBERG * aclocal.m4 (GROFF_MKSTEMP): Define HAVE_MKSTEMP. * configure.ac: Add declaration test for strcasecmp(). * Makefile.in: Updated. * configure: Regenerated. * src/include/lib.h [!HAVE_MKSTEMP]: Add prototype for mkstemp() -- this is necessary because groff's mkstemp.cc is C++. Add declaration conditionally for strcasecmp(). 2001-08-10 Werner LEMBERG Integrated pic2graph, contributed by Eric S. Raymond. * contrib/pic2graph/{Makefile.sub, pic2graph.sh, pic2graph.man}: New files. * Makefile.in, NEWS: Updated. * src/preproc/tbl/tbl.man: Revised. 2001-08-09 Eric S. Raymond * src/preproc/tbl/tbl.man: Extended to cover all tbl features. 2001-08-09 Werner LEMBERG * src/preproc/tbl/main.cc (process_data): Fix recognition of .lf requests. 2001-08-08 Paul Eggert * Makefile.sub (configure): Depend on configure.ac, not configure.in. * INSTALL.gen: Upgrade to autoconf 2.52's INSTALL. 2001-08-07 Werner LEMBERG * src/utils/afmtodit/afmtodit.man, src/roff/groff/groff.man: Minor fixes. 2001-08-06 Werner LEMBERG * src/roff/troff/troff.man: Improve documentation of -E option. 2001-07-28 Ralph Corderoy * src/preproc/html/pushbackbuffer.cc (pushBackBuffer::readNumber): Simplified. 2001-07-27 Werner LEMBERG * src/preproc/refer/refer.cc: Undo last change. * src/devices/grohtml/post-html.cc: Ditto. 2001-07-26 Werner LEMBERG * src/preproc/refer/refer.cc: Include `lib.h'. * src/devices/grohtml/post-html.cc: Ditto. 2001-07-25 Gaius Mulley * aclocal.m4 (GROFF_PAGE): Add `AC_DEFINE(PAGEA4)'. * src/preproc/html/pre-html.cc: Use it for DEFAULT_VERTICAL_OFFSET. * Makefile.in: Comment updated. * configure: Regenerated. 2001-07-25 Werner LEMBERG * src/preproc/pic/pic.cc: Removed. * src/preproc/pic/pic_tab.h: Removed. * src/preproc/refer/label.cc: Removed. * doc/Makefile (.ms.html): Don't use a file name extension in argument to grohtml's -I option. * Makefile.in (dist): Remove CVS directories. Call `distfiles' target. * src/devices/grohtml/grohtml.man: Add information about valid versions of pnmtopng. * src/preproc/html/pre-html.cc (TRANSPARENT): Use `white' as colour name instead of number. 2001-07-24 Werner LEMBERG * doc/groff.texinfo: Minor fixes. 2001-07-21 Gaius Mulley * doc/Makefile (.ms.html): Put image files into a subdirectory. (clean): Updated. 2001-07-20 Werner LEMBERG * src/libs/libgroff/tmpname.cc: New file, defining get_tempname(). * src/libs/libgroff/mkstemp.cc: New file. * src/libs/libgroff/mksdir.cc: New file. * src/libs/libgroff/tmpfile.cc [HAVE_MKSTEMP_PROTO]: Removed. (xtmpfile) [!HAVE_MKSTEMP]: Removed. * src/libs/libgroff/Makefile.sub: Updated. * src/include/lib.h: Add mksdir() prototype. * src/include/posix.h: Define S_IXUSR if not yet defined. * src/preproc/html/pre-html.cc (MAX_RETRIES): Removed. (createAllPages): Use mksdir() instead of current code. * src/utils/indxbib/indxbib.cc [HAVE_MKSTEMP_PROTO]: Removed. (main): [!HAVE_MKSTEMP]: Removed. * aclocal.m4 (GROFF_MKSTEMP): Updated to use new mkstemp.cc file. (GROFF_INTTYPES_H, GROFF_UNSIGNED_LONG_LONG, GROFF_UINTMAX_T): New macros. * configure.ac: Add tests for stdint.h, sys/time.h, and gettimeofday(). Call new GROFF_xxx macros. * configure: Regenerated. * Makefile.in: Comments updated. 2001-07-20 Gaius Mulley * src/preproc/html/pre-html.cc (scanArguments): Use getopt_long() instead of current code. * src/devices/grohtml/post-html.cc (main): Handle `-d' option. * src/roff/groff/groff.cc (possible_command::insert_args): New function. (main): Use it for predriver handling instead of insert_arg(). 2001-07-19 Werner LEMBERG * doc/Makefile: Added GROFF_BIN_PATH to make it work with uninstalled groff also. * src/include/posix.h: Define S_IWUSR if not yet defined. 2001-07-18 Werner LEMBERG * NEWS: Updated. 2001-07-18 Ruslan Ermilov * tmac/groff_mdoc.man: Document new -width and -column syntax. Some other minor fixes. * tmac/an-old.tmac: Add `AT' and `UC' macros. 2001-07-17 Gaius Mulley Replace call to `troff' with `groff -Z' to make it aware of GROFF_BIN_PATH. * src/preproc/html/pre-html.cc (TROFF_COMMAND): New macro. (troff_command, command_prefix): Removed. (alterDeviceTo): Use groff. (addZ): New function. (char_buffer::do_html): Use it. (scanArguments): Use TROFF_COMMAND. (findPrefix): Removed. (main): Updated. * src/roff/groff/groff.cc (main): Handle zflag for preprocessors. 2001-07-17 Eric S. Raymond * doc/pic.ms: Documentation fixes. 2001-07-17 Werner LEMBERG Replace atexit() with global destructor. * src/libs/libgroff/tmpfile.cc (xtmpfile_list): Add constructor. (xtmpfile_list_init): New global structure to deallocate xtmpfile_list on exit. Its destructor inherits most code from remove_tmp_files(). (remove_tmp_files): Deleted. (add_tmp_file): Simplified. 2001-07-16 Werner LEMBERG Replace strdup() with strsave(). * src/devices/grolbp/lbp.cc [!HAVE_STRDUP]: Removed. (set_papersize): Use strsave() and a_delete. (main): Use strsave(). * src/preproc/html/pre-html.cc (make_message, createAllPages, removeAllPages): Use strsave() and a_delete. * configure.ac: Remove test for strdup. * Makefile.in: Comment updated. * configure: Regenerated. 2001-07-15 Werner LEMBERG * win32-diffs: Updated. 2001-07-14 Werner LEMBERG * src/preproc/html/pre-html.cc (makeTempFiles): Activate new code, removing the old one. * src/utils/indxbib/indxbib.cc (main): Remove compiler warning. 2001-07-14 Ralph Corderoy * src/libs/libgroff/tmpfile.cc (xtmpfile): Fix guard for `namep'. 2001-07-12 Ruslan Ermilov Merge -xwidth into -width. Add -xwidth functionality to -column also. * tmac/doc.tmac (Bl): Add dummy doc-typeXXX and doc-spaceXXX to avoid warning. (doc-do-Bl-args): Merge -xwidth code with -width. Test whether string immediately following a leading dot starts with a valid mdoc argument. Add similar code to the -column branch. (doc-Bl-usage): Updated. * groff_mdoc.man: s/-xwidth/-width/. 2001-07-12 Gaius Mulley * src/devices/grohtml/post-html.cc (text_glob::is_br): Stop titles running into centered or non-formatted text. 2001-07-11 Werner LEMBERG Introduce short and long prefixes to have the selection at run-time whether there is a 8+3 limit for names of temporary files. * src/libs/libgroff/tmpfile.cc (TMPFILE_PREFIX): Replaced with... (TMPFILE_PREFIX_SHORT, TMPFILE_PREFIX_LONG): This. (tmpfile_prefix, tmpfile_prefix_len, use_short_prefix): New variables. (temp_init): New global structure to initialize above three variables. (xtmptemplate): Use two parameters for long and short prefix. Simplify code use above three variables. (xtmpfile): Use long and short prefixes as parameters. * src/include/lib.h: Updated. * src/preproc/html/pre-html.cc ({PAGE,PS,REGION}_TEMPLATE): Replace with ... ({PAGE,PS,REGION}_TEMPLATE_{SHORT,LONG}): This. (createAllPages, makeTempFiles): Updated. 2001-07-09 Werner LEMBERG * REVISION: Increased to 3. Copyright 2001-2002 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Local Variables: version-control: never coding: latin-1 End: groff-1.22.3/PaxHeaders.22577/m40000644000000000000000000000013212426110213014140 xustar000000000000000030 mtime=1415090315.568519709 30 atime=1415090348.184111958 30 ctime=1415090315.568519709 groff-1.22.3/m4/0000755000175000001440000000000012426110213013053 5ustar00wlusers00000000000000groff-1.22.3/m4/PaxHeaders.22577/ax_compare_version.m40000644000000000000000000000013112426110213020341 xustar000000000000000030 mtime=1415090315.568519709 29 atime=1415090348.39110937 30 ctime=1415090315.568519709 groff-1.22.3/m4/ax_compare_version.m40000644000175000001440000001465212426110213017210 0ustar00wlusers00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_compare_version.html # =========================================================================== # # SYNOPSIS # # AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # # DESCRIPTION # # This macro compares two version strings. Due to the various number of # minor-version numbers that can exist, and the fact that string # comparisons are not compatible with numeric comparisons, this is not # necessarily trivial to do in a autoconf script. This macro makes doing # these comparisons easy. # # The six basic comparisons are available, as well as checking equality # limited to a certain number of minor-version levels. # # The operator OP determines what type of comparison to do, and can be one # of: # # eq - equal (test A == B) # ne - not equal (test A != B) # le - less than or equal (test A <= B) # ge - greater than or equal (test A >= B) # lt - less than (test A < B) # gt - greater than (test A > B) # # Additionally, the eq and ne operator can have a number after it to limit # the test to that number of minor versions. # # eq0 - equal up to the length of the shorter version # ne0 - not equal up to the length of the shorter version # eqN - equal up to N sub-version levels # neN - not equal up to N sub-version levels # # When the condition is true, shell commands ACTION-IF-TRUE are run, # otherwise shell commands ACTION-IF-FALSE are run. The environment # variable 'ax_compare_version' is always set to either 'true' or 'false' # as well. # # Examples: # # AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) # AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) # # would both be true. # # AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) # AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) # # would both be false. # # AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) # # would be true because it is only comparing two minor versions. # # AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) # # would be true because it is only comparing the lesser number of minor # versions of the two values. # # Note: The characters that separate the version numbers do not matter. An # empty string is the same as version 0. OP is evaluated by autoconf, not # configure, so must be a string, not a variable. # # The author would like to acknowledge Guido Draheim whose advice about # the m4_case and m4_ifvaln functions make this macro only include the # portions necessary to perform the specific comparison specified by the # OP argument in the final configure script. # # LICENSE # # Copyright (c) 2008 Tim Toolan # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 11 dnl ######################################################################### AC_DEFUN([AX_COMPARE_VERSION], [ AC_REQUIRE([AC_PROG_AWK]) # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. AS_VAR_PUSHDEF([A],[ax_compare_version_A]) A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/[[^0-9]]//g'` AS_VAR_PUSHDEF([B],[ax_compare_version_B]) B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/[[^0-9]]//g'` dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary dnl # then the first line is used to determine if the condition is true. dnl # The sed right after the echo is to remove any indented white space. m4_case(m4_tolower($2), [lt],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` ], [gt],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` ], [le],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` ], [ge],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` ],[ dnl Split the operator from the subversion count if present. m4_bmatch(m4_substr($2,2), [0],[ # A count of zero means use the length of the shorter version. # Determine the number of characters in A and B. ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` # Set A to no more than B's length and B to no more than A's length. A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` ], [[0-9]+],[ # A count greater than zero means use only that many subversions A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` ], [.+],[ AC_WARNING( [illegal OP numeric parameter: $2]) ],[]) # Pad zeros at end of numbers to make same length. ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" B="$B`echo $A | sed 's/./0/g'`" A="$ax_compare_version_tmp_A" # Check for equality or inequality as necessary. m4_case(m4_tolower(m4_substr($2,0,2)), [eq],[ test "x$A" = "x$B" && ax_compare_version=true ], [ne],[ test "x$A" != "x$B" && ax_compare_version=true ],[ AC_WARNING([illegal OP parameter: $2]) ]) ]) AS_VAR_POPDEF([A])dnl AS_VAR_POPDEF([B])dnl dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. if test "$ax_compare_version" = "true" ; then m4_ifvaln([$4],[$4],[:])dnl m4_ifvaln([$5],[else $5])dnl fi ]) dnl AX_COMPARE_VERSION groff-1.22.3/m4/PaxHeaders.22577/glibc21.m40000644000000000000000000000013212426110213015702 xustar000000000000000030 mtime=1415090315.568519709 30 atime=1415090348.386109433 30 ctime=1415090315.568519709 groff-1.22.3/m4/glibc21.m40000644000175000001440000000161312426110213014541 0ustar00wlusers00000000000000# glibc21.m4 serial 5 dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.1 or newer, or uClibc. # From Bruno Haible. AC_DEFUN([gl_GLIBC21], [ AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc], [ac_cv_gnu_library_2_1], [AC_EGREP_CPP([Lucky], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif #ifdef __UCLIBC__ Lucky user #endif ], [ac_cv_gnu_library_2_1=yes], [ac_cv_gnu_library_2_1=no]) ] ) AC_SUBST([GLIBC21]) GLIBC21="$ac_cv_gnu_library_2_1" ] ) groff-1.22.3/m4/PaxHeaders.22577/lib-ld.m40000644000000000000000000000013212426110213015622 xustar000000000000000030 mtime=1415090315.568519709 30 atime=1415090348.357109795 30 ctime=1415090315.568519709 groff-1.22.3/m4/lib-ld.m40000644000175000001440000000714312426110213014465 0ustar00wlusers00000000000000# lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) groff-1.22.3/m4/PaxHeaders.22577/lib-link.m40000644000000000000000000000013212426110213016160 xustar000000000000000030 mtime=1415090315.568519709 30 atime=1415090348.344109958 30 ctime=1415090315.568519709 groff-1.22.3/m4/lib-link.m40000644000175000001440000010044312426110213015020 0ustar00wlusers00000000000000# lib-link.m4 serial 26 (gettext-0.18.2) dnl Copyright (C) 2001-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[m4_translit([$1],[./+-], [____])]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes popdef([NAME]) popdef([Name]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. The missing-message dnl defaults to 'no' and may contain additional hints for the user. dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[m4_translit([$1],[./+-], [____])]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, dnl because these -l options might require -L options that are present in dnl LIBS. -l options benefit only from the -L options listed before it. dnl Otherwise, add it to the front of LIBS, because it may be a static dnl library that depends on another static library that is present in LIBS. dnl Static libraries benefit only from the static libraries listed after dnl it. case " $LIB[]NAME" in *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *) LIBS="$LIB[]NAME $LIBS" ;; esac AC_LINK_IFELSE( [AC_LANG_PROGRAM([[$3]], [[$4]])], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) popdef([NAME]) popdef([Name]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_libname_spec, dnl acl_library_names_spec, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) groff-1.22.3/m4/PaxHeaders.22577/iconv.m40000644000000000000000000000013112426110213015574 xustar000000000000000030 mtime=1415090315.568519709 29 atime=1415090348.35910977 30 ctime=1415090315.568519709 groff-1.22.3/m4/iconv.m40000644000175000001440000002206412426110213014437 0ustar00wlusers00000000000000# iconv.m4 serial 19 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif ]], [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ]])], [am_cv_func_iconv_works=yes], , [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) fi ]) groff-1.22.3/m4/PaxHeaders.22577/localcharset.m40000644000000000000000000000013212426110213017123 xustar000000000000000030 mtime=1415090315.568519709 30 atime=1415090348.340110008 30 ctime=1415090315.568519709 groff-1.22.3/m4/localcharset.m40000644000175000001440000000112512426110213015760 0ustar00wlusers00000000000000# localcharset.m4 serial 7 dnl Copyright (C) 2002, 2004, 2006, 2009-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_LOCALCHARSET], [ dnl Prerequisites of lib/localcharset.c. AC_REQUIRE([AM_LANGINFO_CODESET]) AC_REQUIRE([gl_FCNTL_O_FLAGS]) AC_CHECK_DECLS_ONCE([getc_unlocked]) dnl Prerequisites of the lib/Makefile.am snippet. AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_GLIBC21]) ]) groff-1.22.3/m4/PaxHeaders.22577/fcntl-o.m40000644000000000000000000000013212426110213016021 xustar000000000000000030 mtime=1415090315.568519709 30 atime=1415090348.386109433 30 ctime=1415090315.568519709 groff-1.22.3/m4/fcntl-o.m40000644000175000001440000001107412426110213014662 0ustar00wlusers00000000000000# fcntl-o.m4 serial 4 dnl Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Paul Eggert. # Test whether the flags O_NOATIME and O_NOFOLLOW actually work. # Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise. # Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise. AC_DEFUN([gl_FCNTL_O_FLAGS], [ dnl Persuade glibc to define O_NOATIME and O_NOFOLLOW. dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes dnl AC_GNU_SOURCE. m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], [AC_REQUIRE([AC_GNU_SOURCE])]) AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CHECK_FUNCS_ONCE([symlink]) AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include #if HAVE_UNISTD_H # include #else /* on Windows with MSVC */ # include # include # defined sleep(n) _sleep ((n) * 1000) #endif #include #ifndef O_NOATIME #define O_NOATIME 0 #endif #ifndef O_NOFOLLOW #define O_NOFOLLOW 0 #endif static int const constants[] = { O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY }; ]], [[ int result = !constants; #if HAVE_SYMLINK { static char const sym[] = "conftest.sym"; if (symlink ("/dev/null", sym) != 0) result |= 2; else { int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); if (fd >= 0) { close (fd); result |= 4; } } if (unlink (sym) != 0 || symlink (".", sym) != 0) result |= 2; else { int fd = open (sym, O_RDONLY | O_NOFOLLOW); if (fd >= 0) { close (fd); result |= 4; } } unlink (sym); } #endif { static char const file[] = "confdefs.h"; int fd = open (file, O_RDONLY | O_NOATIME); if (fd < 0) result |= 8; else { struct stat st0; if (fstat (fd, &st0) != 0) result |= 16; else { char c; sleep (1); if (read (fd, &c, 1) != 1) result |= 24; else { if (close (fd) != 0) result |= 32; else { struct stat st1; if (stat (file, &st1) != 0) result |= 40; else if (st0.st_atime != st1.st_atime) result |= 64; } } } } } return result;]])], [gl_cv_header_working_fcntl_h=yes], [case $? in #( 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( *) gl_cv_header_working_fcntl_h='no';; esac], [gl_cv_header_working_fcntl_h=cross-compiling])]) case $gl_cv_header_working_fcntl_h in #( *O_NOATIME* | no | cross-compiling) ac_val=0;; #( *) ac_val=1;; esac AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], [Define to 1 if O_NOATIME works.]) case $gl_cv_header_working_fcntl_h in #( *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( *) ac_val=1;; esac AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], [Define to 1 if O_NOFOLLOW works.]) ]) groff-1.22.3/m4/PaxHeaders.22577/ax_prog_perl_version.m40000644000000000000000000000013212426110213020705 xustar000000000000000030 mtime=1415090315.568519709 30 atime=1415090348.389109395 30 ctime=1415090315.568519709 groff-1.22.3/m4/ax_prog_perl_version.m40000644000175000001440000000410412426110213017542 0ustar00wlusers00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_prog_perl_version.html # =========================================================================== # # SYNOPSIS # # AX_PROG_PERL_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE]) # # DESCRIPTION # # Makes sure that perl supports the version indicated. If true the shell # commands in ACTION-IF-TRUE are executed. If not the shell commands in # ACTION-IF-FALSE are run. Note if $PERL is not set (for example by # running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail. # # Example: # # AC_PATH_PROG([PERL],[perl]) # AX_PROG_PERL_VERSION([5.8.0],[ ... ],[ ... ]) # # This will check to make sure that the perl you have supports at least # version 5.8.0. # # NOTE: This macro uses the $PERL variable to perform the check. # AX_WITH_PERL can be used to set that variable prior to running this # macro. The $PERL_VERSION variable will be valorized with the detected # version. # # LICENSE # # Copyright (c) 2009 Francesco Salvestrini # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 12 AC_DEFUN([AX_PROG_PERL_VERSION],[ AC_REQUIRE([AC_PROG_SED]) AC_REQUIRE([AC_PROG_GREP]) AS_IF([test -n "$PERL"],[ ax_perl_version="$1" AC_MSG_CHECKING([for perl version]) changequote(<<,>>) perl_version=`$PERL --version 2>&1 \ | $SED -n -e '/This is perl/b inspect b : inspect s/.* (\{0,1\}v\([0-9]*\.[0-9]*\.[0-9]*\))\{0,1\} .*/\1/;p'` changequote([,]) AC_MSG_RESULT($perl_version) AC_SUBST([PERL_VERSION],[$perl_version]) AX_COMPARE_VERSION([$ax_perl_version],[le],[$perl_version],[ : $2 ],[ : $3 ]) ],[ AC_MSG_WARN([could not find the perl interpreter]) $3 ]) ]) groff-1.22.3/m4/PaxHeaders.22577/groff.m40000644000000000000000000000013112426110213015561 xustar000000000000000030 mtime=1415090315.568519709 29 atime=1415090348.36310972 30 ctime=1415090315.568519709 groff-1.22.3/m4/groff.m40000644000175000001440000010241012426110213014416 0ustar00wlusers00000000000000# Autoconf macros for groff. # Copyright (C) 1989-2014 Free Software Foundation, Inc. # # This file is part of groff. # # groff is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or # (at your option) any later version. # # groff is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . AC_DEFUN([GROFF_PRINT], [if test -z "$PSPRINT"; then AC_CHECK_PROGS([LPR], [lpr]) AC_CHECK_PROGS([LP], [lp]) if test -n "$LPR" && test -n "$LP"; then # HP-UX provides an lpr command that emulates lpr using lp, # but it doesn't have lpq; in this case we want to use lp # rather than lpr. AC_CHECK_PROGS([LPQ], [lpq]) test -n "$LPQ" || LPR= fi if test -n "$LPR"; then PSPRINT="$LPR" elif test -n "$LP"; then PSPRINT="$LP" fi fi AC_SUBST([PSPRINT]) AC_MSG_CHECKING([for command to use for printing PostScript files]) AC_MSG_RESULT([$PSPRINT]) # Figure out DVIPRINT from PSPRINT. AC_MSG_CHECKING([for command to use for printing dvi files]) if test -n "$PSPRINT" && test -z "$DVIPRINT"; then if test "x$PSPRINT" = "xlpr"; then DVIPRINT="lpr -d" else DVIPRINT="$PSPRINT" fi fi AC_SUBST([DVIPRINT]) AC_MSG_RESULT([$DVIPRINT])]) # Bison generated parsers have problems with C++ compilers other than g++. # So byacc is preferred over bison. AC_DEFUN([GROFF_PROG_YACC], [AC_CHECK_PROGS([YACC], [byacc 'bison -y'], [yacc])]) # We need Perl 5.6.1 or newer. AC_DEFUN([GROFF_PERL], [PERLVERSION=v5.6.1 AC_PATH_PROG([PERL], [perl], [no]) if test "x$PERL" = "xno"; then AC_MSG_ERROR([perl binary not found], 1) fi AX_PROG_PERL_VERSION([$PERLVERSION], true, \ AC_MSG_ERROR([perl version is too old], 1))]) # It is possible to fine-tune generation of documentation. AC_DEFUN([GROFF_DOC_CHECK], [AC_ARG_WITH([doc], [AS_HELP_STRING([--with-doc[[=TYPE]]], [choose which manuals (beside man pages) are desirable. \ TYPE can be `yes' or `no', or a comma-separated list of \ one or multiple of `html', `info', `other', `pdf', and \ `examples', to restrict what is produced])], [doc="$withval"], [doc=yes]) test "x$doc" = xno && doc='' if test "x$doc" = xyes; then doc_dist_target_ok=yes docadd_html=yes docadd_info=yes docadd_other=yes docadd_pdf=yes docadd_examples=yes else # Don't use case/esac, verify input. doc_dist_target_ok=no docadd_html=no docadd_info=no docadd_other=no docadd_pdf=no docadd_examples=no OFS=$IFS IFS=',' set -- $doc IFS=$OFS for i do test "x$i" = xhtml && { docadd_html=yes; continue; } test "x$i" = xinfo && { docadd_info=yes; continue; } test "x$i" = xother && { docadd_other=yes; continue; } test "x$i" = xpdf && { docadd_pdf=yes; continue; } test "x$i" = xexamples && { docadd_examples=yes; continue; } AC_MSG_WARN([Invalid `--with-doc' argument:] $i) done fi if test $docadd_html = yes; then make_install_shipped_htmldoc=install_shipped_htmldoc make_uninstall_shipped_htmldoc=uninstall_shipped_htmldoc else make_install_shipped_htmldoc= make_uninstall_shipped_htmldoc= fi if test $docadd_other = yes; then make_otherdoc=otherdoc make_install_otherdoc=install_otherdoc make_uninstall_otherdoc=uninstall_otherdoc else make_otherdoc= make_install_otherdoc= make_uninstall_otherdoc= fi if test $docadd_examples = yes; then make_examples=examples make_install_examples=install_examples make_uninstall_examples=uninstall_examples else make_examples= make_install_examples= make_uninstall_examples= fi AC_SUBST([doc_dist_target_ok]) AC_SUBST([make_install_shipped_htmldoc]) AC_SUBST([make_uninstall_shipped_htmldoc]) AC_SUBST([make_otherdoc]) AC_SUBST([make_install_otherdoc]) AC_SUBST([make_uninstall_otherdoc]) AC_SUBST([make_examples]) AC_SUBST([make_install_examples]) AC_SUBST([make_uninstall_examples])]) # We need makeinfo 4.8 or newer. AC_DEFUN([GROFF_MAKEINFO], [if test $docadd_info = yes; then missing= AC_CHECK_PROG([MAKEINFO], [makeinfo], [makeinfo]) if test -z "$MAKEINFO"; then missing="\`makeinfo' is missing." else AC_MSG_CHECKING([for makeinfo version]) # We need an additional level of quoting to make sed's regexps work. [makeinfo_version=`$MAKEINFO --version 2>&1 \ | sed -e 's/^.* \([^ ][^ ]*\)$/\1/' -e '1q'`] AC_MSG_RESULT([$makeinfo_version]) # Consider only the first two numbers in version number string. makeinfo_version_major=`IFS=.; set x $makeinfo_version; echo 0${2}` makeinfo_version_minor=`IFS=.; set x $makeinfo_version; echo 0${3}` makeinfo_version_numeric=` expr ${makeinfo_version_major}000 \+ ${makeinfo_version_minor}` if test $makeinfo_version_numeric -lt 4008; then missing="\`makeinfo' is too old." fi fi if test -n "$missing"; then infofile=doc/groff.info test -f ${infofile} || infofile=${srcdir}/${infofile} if test ! -f ${infofile} \ || test ${srcdir}/doc/groff.texinfo -nt ${infofile}; then AC_MSG_ERROR($missing [Get the `texinfo' package version 4.8 or newer.]) else AC_MSG_WARN($missing [Get the `texinfo' package version 4.8 or newer if you want to convert `groff.texinfo' into a PDF or HTML document.]) fi fi make_infodoc=infodoc make_install_infodoc=install_infodoc make_uninstall_infodoc=uninstall_infodoc else make_infodoc= make_install_infodoc= make_uninstall_infodoc= MAKEINFO= fi AC_SUBST([MAKEINFO]) AC_SUBST([make_infodoc]) AC_SUBST([make_install_infodoc]) AC_SUBST([make_uninstall_infodoc])]) # The following programs are needed for grohtml. AC_DEFUN([GROFF_HTML_PROGRAMS], [make_htmldoc= make_install_htmldoc= make_uninstall_htmldoc= make_htmlexamples= make_install_htmlexamples= make_uninstall_htmlexamples= AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH]) missing= AC_FOREACH([groff_prog], [pnmcut pnmcrop pnmtopng psselect pnmtops], [AC_CHECK_PROG(groff_prog, groff_prog, [found], [missing]) if test $[]groff_prog = missing; then missing="$missing \`groff_prog'" fi;]) test "$GHOSTSCRIPT" = "missing" && missing="$missing \`gs'" if test -z "$missing"; then if test $docadd_html = yes; then make_htmldoc=htmldoc make_install_htmldoc=install_htmldoc make_uninstall_htmldoc=uninstall_htmldoc if test $docadd_examples = yes; then make_htmlexamples=html_examples make_install_htmlexamples=install_htmlexamples make_uninstall_htmlexamples=uninstall_htmlexamples fi fi else plural=`set $missing; test $[#] -gt 1 && echo s` missing=`set $missing missing="" while test $[#] -gt 0 do case $[#] in 1) missing="$missing$[1]" ;; 2) missing="$missing$[1] and " ;; *) missing="$missing$[1], " ;; esac shift done echo $missing` docnote=. test $docadd_html = yes && docnote='; therefore, it will neither be possible to prepare, nor to install, documentation in HTML format.' AC_MSG_WARN([missing program$plural: The program$plural $missing cannot be found in the PATH. Consequently, groff's HTML backend (grohtml) will not work properly$docnote ]) doc_dist_target_ok=no fi AC_SUBST([make_htmldoc]) AC_SUBST([make_install_htmldoc]) AC_SUBST([make_uninstall_htmldoc]) AC_SUBST([make_htmlexamples]) AC_SUBST([make_install_htmlexamples]) AC_SUBST([make_uninstall_htmlexamples])]) # To produce PDF docs, we need both awk and ghostscript. AC_DEFUN([GROFF_PDFDOC_PROGRAMS], [make_pdfdoc= make_install_pdfdoc= make_uninstall_pdfdoc= make_pdfexamples= make_install_pdfexamples= make_uninstall_pdfexamples= AC_REQUIRE([GROFF_AWK_PATH]) AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH]) missing="" test "$AWK" = missing && missing="\`awk'" test "$GHOSTSCRIPT" = missing && missing="$missing \`gs'" if test -z "$missing"; then if test $docadd_pdf = yes; then make_pdfdoc=pdfdoc make_install_pdfdoc=install_pdfdoc make_uninstall_pdfdoc=uninstall_pdfdoc if test $docadd_examples = yes; then make_pdfexamples=pdfexamples make_install_pdfexamples=install_pdfexamples make_uninstall_pdfexamples=uninstall_pdfexamples fi fi else plural=`set $missing; test $[#] -eq 2 && echo s` test x$plural = xs \ && missing=`set $missing; echo "$[1] and $[2]"` \ || missing=`echo $missing` docnote=. test $docadd_pdf = yes && docnote='; therefore, it will neither be possible to prepare, nor to install, documentation and most of the examples in PDF format.' AC_MSG_WARN([missing program$plural: The program$plural $missing cannot be found in the PATH. Consequently, groff's PDF formatter (pdfroff) will not work properly$docnote ]) doc_dist_target_ok=no fi AC_SUBST([make_pdfdoc]) AC_SUBST([make_install_pdfdoc]) AC_SUBST([make_uninstall_pdfdoc]) AC_SUBST([make_pdfexamples]) AC_SUBST([make_install_pdfexamples]) AC_SUBST([make_uninstall_pdfexamples])]) # Check whether pnmtops can handle the -nosetpage option. AC_DEFUN([GROFF_PNMTOPS_NOSETPAGE], [AC_MSG_CHECKING([whether pnmtops can handle the -nosetpage option]) if echo P2 2 2 255 0 1 2 0 | pnmtops -nosetpage > /dev/null 2>&1 ; then AC_MSG_RESULT([yes]) pnmtops_nosetpage="pnmtops -nosetpage" else AC_MSG_RESULT([no]) pnmtops_nosetpage="pnmtops" fi AC_SUBST([pnmtops_nosetpage])]) # Check location of `gs'; allow `--with-gs=PROG' option to override. AC_DEFUN([GROFF_GHOSTSCRIPT_PATH], [AC_REQUIRE([GROFF_GHOSTSCRIPT_PREFS]) AC_ARG_WITH([gs], [AS_HELP_STRING([--with-gs=PROG], [actual [/path/]name of ghostscript executable])], [GHOSTSCRIPT=$withval], [AC_CHECK_TOOLS(GHOSTSCRIPT, [$ALT_GHOSTSCRIPT_PROGS], [missing])]) test "$GHOSTSCRIPT" = "no" && GHOSTSCRIPT=missing]) # Preferences for choice of `gs' program... # (allow --with-alt-gs="LIST" to override). AC_DEFUN([GROFF_GHOSTSCRIPT_PREFS], [AC_ARG_WITH([alt-gs], [AS_HELP_STRING([--with-alt-gs=LIST], [alternative names for ghostscript executable])], [ALT_GHOSTSCRIPT_PROGS="$withval"], [ALT_GHOSTSCRIPT_PROGS="gs gswin32c gsos2"]) AC_SUBST([ALT_GHOSTSCRIPT_PROGS])]) # Check location of `awk'; allow `--with-awk=PROG' option to override. AC_DEFUN([GROFF_AWK_PATH], [AC_REQUIRE([GROFF_AWK_PREFS]) AC_ARG_WITH([awk], [AS_HELP_STRING([--with-awk=PROG], [actual [/path/]name of awk executable])], [AWK=$withval], [AC_CHECK_TOOLS(AWK, [$ALT_AWK_PROGS], [missing])]) test "$AWK" = "no" && AWK=missing]) # Preferences for choice of `awk' program; allow --with-alt-awk="LIST" # to override. AC_DEFUN([GROFF_AWK_PREFS], [AC_ARG_WITH([alt-awk], [AS_HELP_STRING([--with-alt-awk=LIST], [alternative names for awk executable])], [ALT_AWK_PROGS="$withval"], [ALT_AWK_PROGS="gawk mawk nawk awk"]) AC_SUBST([ALT_AWK_PROGS])]) # GROFF_CSH_HACK(if hack present, if not present) AC_DEFUN([GROFF_CSH_HACK], [AC_MSG_CHECKING([for csh hash hack]) cat <conftest.sh #! /bin/sh true || exit 0 export PATH || exit 0 exit 1 EOF chmod +x conftest.sh if echo ./conftest.sh | (csh >/dev/null 2>&1) >/dev/null 2>&1; then AC_MSG_RESULT([yes]) $1 else AC_MSG_RESULT([no]) $2 fi rm -f conftest.sh]) # From udodo!hans@relay.NL.net (Hans Zuidam) AC_DEFUN([GROFF_ISC_SYSV3], [AC_MSG_CHECKING([for ISC 3.x or 4.x]) if grep ['[34]\.'] /usr/options/cb.name >/dev/null 2>&1 then AC_MSG_RESULT([yes]) AC_DEFINE([_SYSV3], [1], [Define if you have ISC 3.x or 4.x.]) else AC_MSG_RESULT([no]) fi]) AC_DEFUN([GROFF_POSIX], [AC_MSG_CHECKING([whether -D_POSIX_SOURCE is necessary]) AC_LANG_PUSH([C++]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include extern "C" { void fileno(int); } ]]) ], [AC_MSG_RESULT([yes]) AC_DEFINE([_POSIX_SOURCE], [1], [Define if -D_POSIX_SOURCE is necessary.])], [AC_MSG_RESULT([no])]) AC_LANG_POP([C++])]) # srand() of SunOS 4.1.3 has return type int instead of void AC_DEFUN([GROFF_SRAND], [AC_LANG_PUSH([C++]) AC_MSG_CHECKING([for return type of srand]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include extern "C" { void srand(unsigned int); } ]]) ], [AC_MSG_RESULT([void]) AC_DEFINE([RET_TYPE_SRAND_IS_VOID], [1], [Define if srand() returns void not int.])], [AC_MSG_RESULT([int])]) AC_LANG_POP([C++])]) # In April 2005, autoconf's AC_TYPE_SIGNAL is still broken. AC_DEFUN([GROFF_TYPE_SIGNAL], [AC_MSG_CHECKING([for return type of signal handlers]) for groff_declaration in \ 'extern "C" void (*signal (int, void (*)(int)))(int);' \ 'extern "C" void (*signal (int, void (*)(int)) throw ())(int);' \ 'void (*signal ()) ();' do AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include #ifdef signal # undef signal #endif $groff_declaration ]], [[ int i; ]]) ], [break], [continue]) done if test -n "$groff_declaration"; then AC_MSG_RESULT([void]) AC_DEFINE([RETSIGTYPE], [void], [Define as the return type of signal handlers (`int' or `void').]) else AC_MSG_RESULT([int]) AC_DEFINE([RETSIGTYPE], [int], [Define as the return type of signal handlers (`int' or `void').]) fi]) AC_DEFUN([GROFF_SYS_NERR], [AC_LANG_PUSH([C++]) AC_MSG_CHECKING([for sys_nerr in , , or ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include #include ]], [[ int k; k = sys_nerr; ]]) ], [AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_SYS_NERR], [1], [Define if you have sys_nerr in , , or .])], [AC_MSG_RESULT([no])]) AC_LANG_POP([C++])]) AC_DEFUN([GROFF_SYS_ERRLIST], [AC_MSG_CHECKING([for sys_errlist[] in , , or ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include #include ]], [[ int k; k = (int)sys_errlist[0]; ]]) ], [AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_SYS_ERRLIST], [1], [Define if you have sys_errlist in , , or .])], [AC_MSG_RESULT([no])])]) AC_DEFUN([GROFF_OSFCN_H], [AC_LANG_PUSH([C++]) AC_MSG_CHECKING([C++ ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]], [[ read(0, 0, 0); open(0, 0); ]]) ], [AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_CC_OSFCN_H], [1], [Define if you have a C++ .])], [AC_MSG_RESULT([no])]) AC_LANG_POP([C++])]) AC_DEFUN([GROFF_LIMITS_H], [AC_LANG_PUSH([C++]) AC_MSG_CHECKING([C++ ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]], [[ int x = INT_MIN; int y = INT_MAX; int z = UCHAR_MAX; ]]) ], [AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_CC_LIMITS_H], [1], [Define if you have a C++ .])], [AC_MSG_RESULT([no])]) AC_LANG_POP([C++])]) AC_DEFUN([GROFF_TIME_T], [AC_LANG_PUSH([C++]) AC_MSG_CHECKING([for declaration of time_t]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]], [[ time_t t = time(0); struct tm *p = localtime(&t); ]]) ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_DEFINE([LONG_FOR_TIME_T], [1], [Define if localtime() takes a long * not a time_t *.])]) AC_LANG_POP([C++])]) AC_DEFUN([GROFF_STRUCT_EXCEPTION], [AC_MSG_CHECKING([struct exception]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include ]], [[ struct exception e; ]]) ], [AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_STRUCT_EXCEPTION], [1], [Define if defines struct exception.])], [AC_MSG_RESULT([no])])]) AC_DEFUN([GROFF_ARRAY_DELETE], [AC_LANG_PUSH([C++]) AC_MSG_CHECKING([whether ANSI array delete syntax is supported]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM(, [[ char *p = new char[5]; delete [] p; ]]) ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_DEFINE([ARRAY_DELETE_NEEDS_SIZE], [1], [Define if your C++ doesn't understand `delete []'.])]) AC_LANG_POP([C++])]) AC_DEFUN([GROFF_TRADITIONAL_CPP], [AC_LANG_PUSH([C++]) AC_MSG_CHECKING([traditional preprocessor]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define name2(a, b) a/**/b ]], [[ int name2(foo, bar); ]]) ], [AC_MSG_RESULT([yes]) AC_DEFINE([TRADITIONAL_CPP], [1], [Define if your C++ compiler uses a traditional (Reiser) preprocessor.])], [AC_MSG_RESULT([no])]) AC_LANG_POP([C++])]) AC_DEFUN([GROFF_WCOREFLAG], [AC_MSG_CHECKING([w_coredump]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #include #include ]], [[ main() { #ifdef WCOREFLAG exit(1); #else int i = 0; ((union wait *)&i)->w_coredump = 1; exit(i != 0200); #endif } ]]) ], [AC_MSG_RESULT([yes]) AC_DEFINE(WCOREFLAG, 0200, [Define if the 0200 bit of the status returned by wait() indicates whether a core image was produced for a process that was terminated by a signal.])], [AC_MSG_RESULT([no])], [AC_MSG_RESULT([no])])]) AC_DEFUN([GROFF_BROKEN_SPOOLER_FLAGS], [AC_MSG_CHECKING([default value for grops -b option]) test -n "${BROKEN_SPOOLER_FLAGS}" || BROKEN_SPOOLER_FLAGS=0 AC_MSG_RESULT([$BROKEN_SPOOLER_FLAGS]) AC_SUBST([BROKEN_SPOOLER_FLAGS])]) AC_DEFUN([GROFF_PAGE], [AC_MSG_CHECKING([default paper size]) groff_prefix=$prefix test "x$prefix" = "xNONE" && groff_prefix=$ac_default_prefix if test -z "$PAGE"; then descfile= if test -r $groff_prefix/share/groff/font/devps/DESC; then descfile=$groff_prefix/share/groff/font/devps/DESC elif test -r $groff_prefix/lib/groff/font/devps/DESC; then descfile=$groff_prefix/lib/groff/font/devps/DESC else for f in $groff_prefix/share/groff/*/font/devps/DESC; do if test -r $f; then descfile=$f break fi done fi if test -n "$descfile"; then if grep ['^paperlength[ ]\+841890'] $descfile >/dev/null 2>&1; then PAGE=A4 elif grep ['^papersize[ ]\+[aA]4'] $descfile >/dev/null 2>&1; then PAGE=A4 fi fi fi if test -z "$PAGE"; then dom=`awk '([$]1 == "dom" || [$]1 == "search") { print [$]2; exit}' \ /etc/resolv.conf 2>/dev/null` if test -z "$dom"; then dom=`(domainname) 2>/dev/null | tr -d '+'` if test -z "$dom" \ || test "$dom" = '(none)'; then dom=`(hostname) 2>/dev/null | grep '\.'` fi fi # If the top-level domain is two letters and it's not `us' or `ca' # then they probably use A4 paper. case "$dom" in [*.[Uu][Ss]|*.[Cc][Aa])] ;; [*.[A-Za-z][A-Za-z])] PAGE=A4 ;; esac fi test -n "$PAGE" || PAGE=letter if test "x$PAGE" = "xA4"; then AC_DEFINE([PAGEA4], [1], [Define if the printer's page size is A4.]) fi AC_MSG_RESULT([$PAGE]) AC_SUBST([PAGE])]) AC_DEFUN([GROFF_CXX_CHECK], [AC_REQUIRE([AC_PROG_CXX]) AC_LANG_PUSH([C++]) if test "$cross_compiling" = no; then AC_MSG_CHECKING([that C++ compiler can compile simple program]) fi AC_RUN_IFELSE([ AC_LANG_SOURCE([[ int main() { return 0; } ]]) ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([a working C++ compiler is required])], [:]) if test "$cross_compiling" = no; then AC_MSG_CHECKING([that C++ static constructors and destructors are called]) fi AC_RUN_IFELSE([ AC_LANG_SOURCE([[ extern "C" { void _exit(int); } int i; struct A { char dummy; A() { i = 1; } ~A() { if (i == 1) _exit(0); } }; A a; int main() { return 1; } ]]) ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([a working C++ compiler is required])], [:]) AC_MSG_CHECKING([that header files support C++]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #include ]], [[ fopen(0, 0); ]]) ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([header files do not support C++ (if you are using a version of gcc/g++ earlier than 2.5, you should install libg++)])]) AC_LANG_POP([C++])]) AC_DEFUN([GROFF_TMAC], [AC_MSG_CHECKING([for prefix of system macro packages]) sys_tmac_prefix= sys_tmac_file_prefix= for d in /usr/share/lib/tmac /usr/lib/tmac; do for t in "" tmac.; do for m in an s m; do f=$d/$t$m if test -z "$sys_tmac_prefix" \ && test -f $f \ && grep '^\.if' $f >/dev/null 2>&1; then sys_tmac_prefix=$d/$t sys_tmac_file_prefix=$t fi done done done AC_MSG_RESULT([$sys_tmac_prefix]) AC_SUBST([sys_tmac_prefix]) AC_MSG_CHECKING([which system macro packages should be made available]) tmac_wrap= if test "x$sys_tmac_file_prefix" = "xtmac."; then for f in $sys_tmac_prefix*; do suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"` case "$suff" in e) ;; *) grep "Copyright.*Free Software Foundation" $f >/dev/null \ || tmac_wrap="$tmac_wrap $suff" ;; esac done elif test -n "$sys_tmac_prefix"; then files=`echo $sys_tmac_prefix*` grep "\\.so" $files >conftest.sol for f in $files; do case "$f" in ${sys_tmac_prefix}e) ;; *.me) ;; */ms.*) ;; *) b=`basename $f` if grep "\\.so.*/$b\$" conftest.sol >/dev/null \ || grep -l "Copyright.*Free Software Foundation" $f >/dev/null; then : else suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"` case "$suff" in tmac.*) ;; *) tmac_wrap="$tmac_wrap $suff" ;; esac fi esac done rm -f conftest.sol fi AC_MSG_RESULT([$tmac_wrap]) AC_SUBST([tmac_wrap])]) AC_DEFUN([GROFF_G], [AC_MSG_CHECKING([for existing troff installation]) if test "x`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>&1) 2>/dev/null`" = x0; then AC_MSG_RESULT([yes]) g=g else AC_MSG_RESULT([no]) g= fi AC_SUBST([g])]) # We need the path to install-sh to be absolute. AC_DEFUN([GROFF_INSTALL_SH], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) ac_dir=`cd $ac_aux_dir; pwd` ac_install_sh="$ac_dir/install-sh -c"]) # Test whether install-info is available. AC_DEFUN([GROFF_INSTALL_INFO], [if test $docadd_info = yes; then AC_CHECK_PROGS([INSTALL_INFO], [install-info], [:]) fi]) # At least one UNIX system, Apple Macintosh Rhapsody 5.5, # does not have -lm ... AC_DEFUN([GROFF_LIBM], [AC_CHECK_LIB([m], [sin], [LIBM=-lm]) AC_SUBST([LIBM])]) # ... while the MinGW implementation of GCC for Microsoft Win32 # does not seem to have -lc. AC_DEFUN([GROFF_LIBC], [AC_CHECK_LIB([c], [main], [LIBC=-lc]) AC_SUBST([LIBC])]) # Check for EBCDIC -- stolen from the OS390 Unix LYNX port AC_DEFUN([GROFF_EBCDIC], [AC_MSG_CHECKING([whether character set is EBCDIC]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ /* Treat any failure as ASCII for compatibility with existing art. Use compile-time rather than run-time tests for cross-compiler tolerance. */ #if '0' != 240 make an error "Character set is not EBCDIC" #endif ]]) ], [groff_cv_ebcdic="yes" TTYDEVDIRS="font/devcp1047" AC_MSG_RESULT([yes]) AC_DEFINE(IS_EBCDIC_HOST, 1, [Define if the host's encoding is EBCDIC.])], [groff_cv_ebcdic="no" TTYDEVDIRS="font/devascii font/devlatin1" OTHERDEVDIRS="font/devlj4 font/devlbp" AC_MSG_RESULT([no])]) AC_SUBST([TTYDEVDIRS]) AC_SUBST([OTHERDEVDIRS])]) # Check for OS/390 Unix. We test for EBCDIC also -- the Linux port (with # gcc) to OS/390 uses ASCII internally. AC_DEFUN([GROFF_OS390], [if test "$groff_cv_ebcdic" = "yes"; then AC_MSG_CHECKING([for OS/390 Unix]) case `uname` in OS/390) CFLAGS="$CFLAGS -D_ALL_SOURCE" AC_MSG_RESULT([yes]) ;; *) AC_MSG_RESULT([no]) ;; esac fi]) # Check whether Windows scripts like `afmtodit.cmd' should be installed. AC_DEFUN([GROFF_CMD_FILES], [AC_MSG_CHECKING([whether to install .cmd wrapper scripts for Windows]) case "$host_os" in *mingw*) make_winscripts=winscripts make_install_winscripts=install_winscripts make_uninstall_winscripts=uninstall_winscripts AC_MSG_RESULT([yes]) ;; *) make_winscripts= make_install_winscripts= make_uninstall_winscripts= AC_MSG_RESULT([no]) ;; esac AC_SUBST([make_winscripts]) AC_SUBST([make_install_winscripts]) AC_SUBST([make_uninstall_winscripts])]) # Check whether we need a declaration for a function. # # Stolen from GNU bfd. AC_DEFUN([GROFF_NEED_DECLARATION], [AC_MSG_CHECKING([whether $1 must be declared]) AC_LANG_PUSH([C++]) AC_CACHE_VAL([groff_cv_decl_needed_$1], [AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_MATH_H #include #endif ]], [[ #ifndef $1 char *p = (char *) $1; #endif ]]) ], [groff_cv_decl_needed_$1=no], [groff_cv_decl_needed_$1=yes])]) AC_MSG_RESULT([$groff_cv_decl_needed_$1]) if test $groff_cv_decl_needed_$1 = yes; then AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), [1], [Define if your C++ doesn't declare ]$1[().]) fi AC_LANG_POP([C++])]) # If mkstemp() isn't available, use our own mkstemp.cpp file. AC_DEFUN([GROFF_MKSTEMP], [AC_MSG_CHECKING([for mkstemp]) AC_LANG_PUSH([C++]) AC_LIBSOURCE([mkstemp.cpp]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #include #include int (*f) (char *); ]], [[ f = mkstemp; ]]) ], [AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_MKSTEMP], [1], [Define if you have mkstemp().])], [AC_MSG_RESULT([no]) _AC_LIBOBJ([mkstemp])]) AC_LANG_POP([C++])]) # Test whether exists, doesn't clash with , # and declares uintmax_t. Taken from the fileutils package. AC_DEFUN([GROFF_INTTYPES_H], [AC_LANG_PUSH([C++]) AC_MSG_CHECKING([C++ ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include ]], [[ uintmax_t i = (uintmax_t)-1; ]]) ], [groff_cv_header_inttypes_h=yes AC_DEFINE([HAVE_CC_INTTYPES_H], [1], [Define if you have a C++ .])], [groff_cv_header_inttypes_h=no]) AC_MSG_RESULT([$groff_cv_header_inttypes_h]) AC_LANG_POP([C++])]) # Test for working `unsigned long long'. Taken from the fileutils package. AC_DEFUN([GROFF_UNSIGNED_LONG_LONG], [AC_LANG_PUSH([C++]) AC_MSG_CHECKING([for unsigned long long]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ unsigned long long ull = 1; int i = 63; unsigned long long ullmax = (unsigned long long)-1; ]], [[ return ull << i | ull >> i | ullmax / ull | ullmax % ull; ]]) ], [groff_cv_type_unsigned_long_long=yes], [groff_cv_type_unsigned_long_long=no]) AC_MSG_RESULT([$groff_cv_type_unsigned_long_long]) AC_LANG_POP([C++])]) # Define uintmax_t to `unsigned long' or `unsigned long long' # if does not exist. Taken from the fileutils package. AC_DEFUN([GROFF_UINTMAX_T], [AC_REQUIRE([GROFF_INTTYPES_H]) if test $groff_cv_header_inttypes_h = no; then AC_REQUIRE([GROFF_UNSIGNED_LONG_LONG]) test $groff_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type], [Define uintmax_t to `unsigned long' or `unsigned long long' if does not exist.]) fi]) # Identify PATH_SEPARATOR character to use in GROFF_FONT_PATH and # GROFF_TMAC_PATH which is appropriate for the target system (POSIX=':', # MS-DOS/Win32=';'). # # The logic to resolve this test is already encapsulated in # `${srcdir}/src/include/nonposix.h'. AC_DEFUN([GROFF_TARGET_PATH_SEPARATOR], [AC_MSG_CHECKING([separator character to use in groff search paths]) cp ${srcdir}/src/include/nonposix.h conftest.h AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include "conftest.h" ]], [[ #if PATH_SEP_CHAR == ';' make an error "Path separator is ';'" #endif ]]) ], [GROFF_PATH_SEPARATOR=":"], [GROFF_PATH_SEPARATOR=";"]) AC_MSG_RESULT([$GROFF_PATH_SEPARATOR]) AC_SUBST(GROFF_PATH_SEPARATOR)]) # Check for X11. AC_DEFUN([GROFF_X11], [AC_REQUIRE([AC_PATH_XTRA]) groff_no_x=$no_x if test -z "$groff_no_x"; then OLDCFLAGS=$CFLAGS OLDLDFLAGS=$LDFLAGS OLDLIBS=$LIBS CFLAGS="$CFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" LIBS="$LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" LIBS="$LIBS -lXaw" AC_MSG_CHECKING([for Xaw library and header files]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #include #include ]], []) ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) groff_no_x="yes"]) LIBS="$LIBS -lXmu" AC_MSG_CHECKING([for Xmu library and header files]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ #include #include ]], []) ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) groff_no_x="yes"]) CFLAGS=$OLDCFLAGS LDFLAGS=$OLDLDFLAGS LIBS=$OLDLIBS fi if test "x$groff_no_x" = "xyes"; then AC_MSG_NOTICE([gxditview and xtotroff won't be built]) else XDEVDIRS="font/devX75 font/devX75-12 font/devX100 font/devX100-12" XPROGDIRS="src/devices/xditview src/utils/xtotroff" XLIBDIRS="src/libs/libxutil" fi AC_SUBST([XDEVDIRS]) AC_SUBST([XPROGDIRS]) AC_SUBST([XLIBDIRS])]) # Set up the `--with-appresdir' command line option. # Don't quote AS_HELP_STRING! AC_DEFUN([GROFF_APPRESDIR_OPTION], [AC_ARG_WITH([appresdir], AS_HELP_STRING([--with-appresdir=DIR], [X11 application resource files]))]) # Get a default value for the application resource directory. # # We ignore the `XAPPLRES' and `XUSERFILESEARCHPATH' environment variables. # # By default if --with-appresdir is not used, we will install the # gxditview resources in $prefix/lib/X11/app-defaults. # # Note that if --with-appresdir was passed to `configure', no prefix is # added to `appresdir'. AC_DEFUN([GROFF_APPRESDIR_DEFAULT], [if test -z "$groff_no_x"; then if test "x$with_appresdir" = "x"; then if test "x$prefix" = "xNONE"; then appresdir=$ac_default_prefix/lib/X11/app-defaults else appresdir=$prefix/lib/X11/app-defaults fi else appresdir=$with_appresdir fi fi AC_SUBST([appresdir])]) # Emit warning if --with-appresdir hasn't been used. AC_DEFUN([GROFF_APPRESDIR_CHECK], [if test -z "$groff_no_x"; then if test "x$with_appresdir" = "x"; then AC_MSG_NOTICE([ The application resource files for gxditview (GXditview and GXditview-color) will be installed in: $appresdir (existing files will be saved by appending `.old' to the file name). To install them into a different directory, say, `/etc/X11/app-defaults', add `--with-appresdir=/etc/X11/app-defaults' to the configure script command line options and rerun it (`prefix' value has no effect on a --with-appresdir option). If the gxditview resources are installed in a directory that is not one of the default X11 resources directories (common default directories are /usr/lib/X11/app-defaults, /usr/share/X11/app-defaults and /etc/X11/app-defaults), you will have to set the environment variable XFILESEARCHPATH to this path. More details can be found in the X(7) manual page, or in "X Toolkit Intrinsics - C Language Interface manual" ]) fi fi]) # Set up the `--with-grofferdir' command line option. AC_DEFUN([GROFF_GROFFERDIR_OPTION], [AC_ARG_WITH([grofferdir], AS_HELP_STRING([--with-grofferdir=DIR], [groffer files location]))]) AC_DEFUN([GROFF_GROFFERDIR_DEFAULT], [if test "x$with_grofferdir" = "x"; then groffer_dir=$libprogramdir/groffer else groffer_dir=$with_grofferdir fi AC_SUBST([groffer_dir])]) AC_DEFUN([GROFF_LIBPROGRAMDIR_DEFAULT], libprogramdir=$libdir/groff AC_SUBST([libprogramdir])) AC_DEFUN([GROFF_GLILYPONDDIR_DEFAULT], glilypond_dir=$libprogramdir/glilypond AC_SUBST([glilypond_dir])) AC_DEFUN([GROFF_GPINYINDIR_DEFAULT], gpinyin_dir=$libprogramdir/gpinyin AC_SUBST([gpinyin_dir])) AC_DEFUN([GROFF_GROGDIR_DEFAULT], grog_dir=$libprogramdir/grog AC_SUBST([grog_dir])) AC_DEFUN([GROFF_REFERDIR_DEFAULT], referdir=$libprogramdir/refer AC_SUBST([referdir])) groff-1.22.3/m4/PaxHeaders.22577/codeset.m40000644000000000000000000000013212426110213016105 xustar000000000000000030 mtime=1415090315.568519709 30 atime=1415090348.389109395 30 ctime=1415090315.568519709 groff-1.22.3/m4/codeset.m40000644000175000001440000000150012426110213014737 0ustar00wlusers00000000000000# codeset.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2006, 2008-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[char* cs = nl_langinfo(CODESET); return !cs;]])], [am_cv_langinfo_codeset=yes], [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE([HAVE_LANGINFO_CODESET], [1], [Define if you have and nl_langinfo(CODESET).]) fi ]) groff-1.22.3/PaxHeaders.22577/REVISION0000644000000000000000000000013212426110213015056 xustar000000000000000030 mtime=1415090315.146524985 30 atime=1415090348.340110008 30 ctime=1415090315.146524985 groff-1.22.3/REVISION0000644000175000001440000000000212426110213013704 0ustar00wlusers000000000000003 groff-1.22.3/PaxHeaders.22577/contrib0000644000000000000000000000013212426110212015257 xustar000000000000000030 mtime=1415090314.799529323 30 atime=1415090314.658531085 30 ctime=1415090314.799529323 groff-1.22.3/contrib/0000755000175000001440000000000012426110212014172 5ustar00wlusers00000000000000groff-1.22.3/contrib/PaxHeaders.22577/gdiffmk0000644000000000000000000000013212426110213016667 xustar000000000000000030 mtime=1415090315.447521222 30 atime=1415090323.337422584 30 ctime=1415090315.447521222 groff-1.22.3/contrib/gdiffmk/0000755000175000001440000000000012426110213015602 5ustar00wlusers00000000000000groff-1.22.3/contrib/gdiffmk/PaxHeaders.22577/Makefile.sub0000644000000000000000000000013212426110213021174 xustar000000000000000030 mtime=1415090315.446521234 30 atime=1415090323.336422597 30 ctime=1415090315.446521234 groff-1.22.3/contrib/gdiffmk/Makefile.sub0000644000175000001440000000327012426110213020034 0ustar00wlusers00000000000000# Makefile.sub for `gdiffmk' (integration into the groff source tree) # File position: /contrib/gdiffmk/Makefile.sub # Copyright (C) 2004-2014 Free Software Foundation, Inc. # Written by Mike Bianchi > # This file is part of the gdiffmk utility, which is part of groff. # groff is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # groff is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public # License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . ######################################################################## MAN1=gdiffmk.n MOSTLYCLEANADD=gdiffmk tests/runtests RM=rm -f all: gdiffmk gdiffmk: gdiffmk.sh sed -e "s|@BINDIR@|$(bindir)|g" \ -e "s|@VERSION@|$(version)$(revision)|g" \ -e $(SH_SCRIPT_SED_CMD) $(srcdir)/gdiffmk.sh >$@ chmod +x $@ install_data: gdiffmk -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir) $(RM) $(DESTDIR)$(bindir)/gdiffmk $(INSTALL_SCRIPT) gdiffmk $(DESTDIR)$(bindir)/gdiffmk uninstall_sub: $(RM) $(DESTDIR)$(bindir)/gdiffmk ######################################################################## # Emacs settings ######################################################################## # # Local Variables: # mode: makefile # End: groff-1.22.3/contrib/gdiffmk/PaxHeaders.22577/ChangeLog0000644000000000000000000000013212426110213020516 xustar000000000000000030 mtime=1415090315.446521234 30 atime=1415090315.446521234 30 ctime=1415090315.446521234 groff-1.22.3/contrib/gdiffmk/ChangeLog0000644000175000001440000000574612426110213017370 0ustar00wlusers000000000000002014-09-03 Bernd Warken * all `gdiffmk' source files: Add and improve the copying information. Remove last update. Add Emacs setting if necessary. 2014-03-30 Steffen Nurpmeso * Makefile.sub: Put straight error-prevention prefixes for `rm'. 2009-09-22 Colin Watson * gdiffmk.sh: Don't use bash specific syntax. 2008-01-04 Werner LEMBERG * gdiffmk.man: Replace .URL with .UR/.UE. Replace .MTO with .MT/.ME. Don't include www.tmac. 2006-09-13 Werner LEMBERG * tests/test_baseline*: Renamed to... * tests/baseline.*: This. * tests/runtests.in: Updated. 2006-02-26 Claudio Fontana * Makefile.sub: Add DESTDIR to install and uninstall targets to support staged installations. 2005-05-16 Keith Marshall * gdiffmk.sh: Add space in shebang, conforming to portability recommendation in autoconf docs. * tests/runtests.in: Likewise. 2005-01-16 Mike Bianchi * gdiffmk.sh (Usage): Fix typos. : Allow `-M ' also. * gdiffmk.man: Updated. 2005-01-13 Mike Bianchi * gdiffmk.sh: Add the -D, -M, and -B options, which provide actions akin to nrchbar. Thanks to Larry Kollar (http://home.alltel.net/kollar/groff/). * gdiffmk.man: Updated. * tests/runtests.in: Added tests for gdiffmk's -D, -M, and -B options. * tests/baseline8, tests/baseline9, tests/baseline10: New files. 2004-12-16 Mike Bianchi * tests/runtests.in: Fix typo (s/$(srcdir)/${srcdir}/). 2004-12-15 Werner LEMBERG The configure script now generates tests/runtests. * tests/tests.sh: Renamed to... * tests/runtests.in: This. Add proper $srcdir prefixes to make it run from build directory. * README, Makefile.sub (CLEANADD), tests/test_baseline7: Updated. 2004-12-14 Werner LEMBERG * gdiffmk.sh: Make sed pattern work with alternate result of GNU diff's -D option, using `!' instead of `not' in #endif comments. (Exit): Use prefix for each emitted message line. 2004-12-14 Mike Bianchi * tests/*: New files for testing gdiffmk. * README, gdiffmk.man, gdiffmk.sh: Updated. Minor fixes. 2004-12-13 Mike Bianchi Add `-x' command line option to select a diff program. * gdiffmk.sh: Add code to handle `-x'. Move test for working `diff' down. Fix sed pattern -- `.mc *' needs to be followed by `.mc .'. (Usage): Updated. * gdiffmk.man: Updated. 2004-12-12 Mike Bianchi * README: New file. 2004-12-11 Mike Bianchi First import of gdiffmk files. Copyright 2004-2009, 2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Local Variables: version-control: never coding: latin-1 End: groff-1.22.3/contrib/gdiffmk/PaxHeaders.22577/README0000644000000000000000000000013212426110213017624 xustar000000000000000030 mtime=1415090315.447521222 30 atime=1415090315.447521222 30 ctime=1415090315.447521222 groff-1.22.3/contrib/gdiffmk/README0000644000175000001440000000403312426110213016462 0ustar00wlusers00000000000000gdiffmk is approximately a recreation of the original Bell Labs/AT&T diffmk command for troff/nroff documents, with enhancements. It should not be confused with `diffmk' commands that operate on XML. The inspiration for this code was a Perl 2 version written in 1989 by Randal L. Schwartz. See landfield.com/software/comp.sources.misc/archive-name/volume06/diffmk.p.gz The command also attempts to reproduce some of the functionality of the old `nrchbar' command. See open-systems.ufl.edu/mirrors/ftp.isc.org/usenet/comp.sources.unix/volume10/nrchbar.Z Thanks to Werner Lemberg for help in making the package more portable and fit into the GNU groff source structure. Gnu diff(1) with the -Dname option does all of the work and sed(1) translates the output into something groff/troff/nroff can handle. Note the BUGS on the man page. The `tests' directory contains simple tests. `runtests run' runs them and compares the output against baseline files. Calling `runtests' without argument gives the usage. ---------------------------------------------------------------------------- Copyright (C) 2004-2014 Free Software Foundation, Inc. Written by Mike Bianchi > This file is part of the gdiffmk utility, which is part of groff. groff is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. groff is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with groff; see the files COPYING and LICENSE in the top directory of the groff source. If not, write to the Free Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. # Emacs settings Local Variables: mode: text End: groff-1.22.3/contrib/gdiffmk/PaxHeaders.22577/gdiffmk.sh0000644000000000000000000000013212426110213020707 xustar000000000000000030 mtime=1415090315.446521234 30 atime=1415090315.446521234 30 ctime=1415090315.446521234 groff-1.22.3/contrib/gdiffmk/gdiffmk.sh0000644000175000001440000001601112426110213017544 0ustar00wlusers00000000000000#! /bin/sh # Copyright (C) 2004-2014 Free Software Foundation, Inc. # Written by Mike Bianchi > # This file is part of the gdiffmk utility, which is part of groff. # groff is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # groff is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public # License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # This file is part of GNU gdiffmk. cmd=$( basename $0 ) Usage () { if test "$#" -gt 0 then echo >&2 "${cmd}: $@" fi echo >&2 "\ Usage: ${cmd} [ OPTIONS ] FILE1 FILE2 [ OUTPUT ] Place difference marks into the new version of a groff/nroff/troff document. FILE1 and FILE2 are compared, using \`diff', and FILE2 is output with groff \`.mc' requests added to indicate how it is different from FILE1. FILE1 Previous version of the groff file. \`-' means standard input. FILE2 Current version of the groff file. \`-' means standard input. Either FILE1 or FILE2 can be standard input, but not both. OUTPUT Copy of FILE2 with \`.mc' commands added. \`-' means standard output (the default). OPTIONS: -a ADDMARK Mark for added groff source lines. Default: \`+'. -c CHANGEMARK Mark for changed groff source lines. Default: \`|'. -d DELETEMARK Mark for deleted groff source lines. Default: \`*'. -D Show the deleted portions from changed and deleted text. Default delimiting marks: \`[[' .... \`]]'. -B By default, the deleted texts marked by the \`-D' option end with an added troff \`.br' command. This option prevents the added \`.br'. -M MARK1 MARK2 Change the delimiting marks for the \`-D' option. -x DIFFCMD Use a different diff(1) command; one that accepts the \`-Dname' option, such as GNU diff. --version Print version information on the standard output and exit. --help Print this message on the standard error. " exit 255 } Exit () { exitcode=$1 shift for arg do echo >&2 "${cmd}: $1" shift done exit ${exitcode} } # Usage: FileRead exit_code filename # # Check for existence and readability of given file name. # If not found or not readable, print message and exit with EXIT_CODE. FileRead () { case "$2" in -) return ;; esac if test ! -e "$2" then Exit $1 "File \`$2' not found." fi if test ! -r "$2" then Exit $1 "File \`$2' not readable." fi } # Usage: FileCreate exit_code filename # # Create the given filename if it doesn't exist. # If unable to create or write, print message and exit with EXIT_CODE. FileCreate () { case "$2" in -) return ;; esac if ! touch "$2" 2>/dev/null then if test ! -e "$2" then Exit $1 "File \`$2' not created; " \ "Cannot write directory \`$( dirname "$2" )'." fi Exit $1 "File \`$2' not writeable." fi } WouldClobber () { case "$2" in -) return ;; esac if test "$1" -ef "$3" then Exit 3 \ "The $2 and OUTPUT arguments both point to the same file," \ "\`$1', and it would be overwritten." fi } ADDMARK='+' CHANGEMARK='|' DELETEMARK='*' MARK1='[[' MARK2=']]' RequiresArgument () { # Process flags that take either concatenated or # separated values. case "$1" in -??*) expr "$1" : '-.\(.*\)' return 1 ;; esac if test "$#" -lt 2 then Exit 255 "Option \`$1' requires a value." fi echo "$2" return 0 } badoption= DIFFCMD=diff D_option= br=.br for OPTION do case "${OPTION}" in -a*) ADDMARK=$( RequiresArgument "${OPTION}" $2 ) && shift ;; -c*) CHANGEMARK=$( RequiresArgument "${OPTION}" $2 ) && shift ;; -d*) DELETEMARK=$( RequiresArgument "${OPTION}" $2 ) && shift ;; -D ) D_option=D_option ;; -M* ) MARK1=$( RequiresArgument "${OPTION}" $2 ) && shift if [ $# -lt 2 ] then Usage "Option \`-M' is missing the MARK2 value." fi MARK2=$2 shift ;; -B ) br=. ;; -x* ) DIFFCMD=$( RequiresArgument "${OPTION}" $2 ) && shift ;; --version) echo "GNU ${cmd} (groff) version @VERSION@" exit 0 ;; --help) Usage ;; --) # What follows -- are file arguments shift break ;; -) break ;; -*) badoption="${cmd}: invalid option \`$1'" ;; *) break ;; esac shift done ${DIFFCMD} -Dx /dev/null /dev/null >/dev/null 2>&1 || Usage "The \`${DIFFCMD}' program does not accept" \ "the required \`-Dname' option. Use GNU diff instead. See the \`-x DIFFCMD' option." if test -n "${badoption}" then Usage "${badoption}" fi if test "$#" -lt 2 -o "$#" -gt 3 then Usage "Incorrect number of arguments." fi if test "1$1" = 1- -a "2$2" = 2- then Usage "Both FILE1 and FILE2 are \`-'." fi FILE1=$1 FILE2=$2 FileRead 1 "${FILE1}" FileRead 2 "${FILE2}" if test "$#" = 3 then case "$3" in -) # output goes to standard output ;; *) # output goes to a file WouldClobber "${FILE1}" FILE1 "$3" WouldClobber "${FILE2}" FILE2 "$3" FileCreate 3 "$3" exec >$3 ;; esac fi # To make a very unlikely label even more unlikely ... label=__diffmk_$$__ sed_script=' /^#ifdef '"${label}"'/,/^#endif \/\* '"${label}"'/ { /^#ifdef '"${label}"'/ s/.*/.mc '"${ADDMARK}"'/ /^#endif \/\* '"${label}"'/ s/.*/.mc/ p d } /^#ifndef '"${label}"'/,/^#endif \/\* [!not ]*'"${label}"'/ { /^#else \/\* '"${label}"'/,/^#endif \/\* '"${label}"'/ { /^#else \/\* '"${label}"'/ s/.*/.mc '"${CHANGEMARK}"'/ /^#endif \/\* '"${label}"'/ s/.*/.mc/ p d } /^#endif \/\* \(not\|!\) '"${label}"'/ { s/.*/.mc '"${DELETEMARK}"'/p a\ .mc } d } p ' if [ ${D_option} ] then sed_script=' /^#ifdef '"${label}"'/,/^#endif \/\* '"${label}"'/ { /^#ifdef '"${label}"'/ s/.*/.mc '"${ADDMARK}"'/ /^#endif \/\* '"${label}"'/ s/.*/.mc/ p d } /^#ifndef '"${label}"'/,/^#endif \/\* [!not ]*'"${label}"'/ { /^#ifndef '"${label}"'/ { i\ '"${MARK1}"' d } /^#else \/\* '"${label}"'/ ! { /^#endif \/\* [!not ]*'"${label}"'/ ! { p d } } /^#else \/\* '"${label}"'/,/^#endif \/\* '"${label}"'/ { /^#else \/\* '"${label}"'/ { i\ '"${MARK2}"'\ '"${br}"' s/.*/.mc '"${CHANGEMARK}"'/ a\ .mc '"${CHANGEMARK}"' d } /^#endif \/\* '"${label}"'/ s/.*/.mc/ p d } /^#endif \/\* \(not\|!\) '"${label}"'/ { i\ '"${MARK2}"'\ '"${br}"' s/.*/.mc '"${DELETEMARK}"'/p a\ .mc } d } p ' fi diff -D"${label}" -- ${FILE1} ${FILE2} | sed -n "${sed_script}" # EOF ######################################################################## # Emacs settings # # Local Variables: # mode: text # End: groff-1.22.3/contrib/gdiffmk/PaxHeaders.22577/gdiffmk.man0000644000000000000000000000013212426110213021050 xustar000000000000000030 mtime=1415090315.446521234 30 atime=1415090315.446521234 30 ctime=1415090315.446521234 groff-1.22.3/contrib/gdiffmk/gdiffmk.man0000644000175000001440000001264512426110213017716 0ustar00wlusers00000000000000.\"-*- nroff -*- .TH GDIFFMK @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@" .SH NAME . .\" gdiffmk \- mark differences between groff/nroff/troff files . . .\" -------------------------------------------------------------------- .\" Legal Terms .\" -------------------------------------------------------------------- . .de co Copyright \[co] 2004-2014 Free Software Foundation, Inc. This file is part of the gdiffmk utility, which is part of groff, a free software project. You can redistribute and/or modify gdiffmk under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. gdiffmk is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . .. . .de au This document was written and is maintained by .MT MBianchi@Foveal.com Mike Bianchi .MT . .. . .\" -------------------------------------------------------------------- .SH SYNOPSIS .\" -------------------------------------------------------------------- . .nr a \n(.j .ad l .nr i \n(.i .in +\w'\fBgdiffmk 'u .ti \niu .B gdiffmk .de OP . ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]" . el .RB "[\ " "\\$1" "\ ]" .. .OP \-a \%addmark .OP \-c \%changemark .OP \-d \%deletemark [\ \c .B \-D .OP \-B .OP \-M "mark1 mark2" ] .OP \-x \%diffcmd .OP \-\- .OP \-\-help .OP \%\-\-version .I \%file1 .I \%file2 [\ \c .IR \%output \ \c ] .br .ad \na . . .\" -------------------------------------------------------------------- .SH DESCRIPTION .\" -------------------------------------------------------------------- . .B gdiffmk compares two .BR groff (1), .BR nroff (1), or .BR troff (1) documents, .I file1 and .IR file2 , and creates an output which is .I file2 with added `margin character' (.mc) commands that indicate the differences. . . .LP If the .I output filename is present, the output is written there. . If it is .B \- or absent the output is written to the standard output. . . .LP If the .I file1 or .I file2 argument is .B \- the standard input is read for that input. . Clearly both cannot be .BR \- . . . .LP Note that the output is not necessarily compatible with all macro packages and all preprocessors. . See the .B BUGS section below. . . .\" -------------------------------------------------------------------- .SH OPTIONS .\" -------------------------------------------------------------------- . .TP .BI \-a addmark Use the .I addmark for source lines not in .I file1 but present in .IR file2 . . Default: .BR + . . .TP .B \-B By default, the deleted texts marked by the .B \-D option end with an added troff break command, .BR .br , to ensure that the deletions are marked properly. . This is the only way to guarantee that deletions and small changes get flagged. . This option directs the program not to insert these breaks; it makes no sense to use it without .BR \-D . . .TP .BI \-c changemark Use the .I changemark for changed source lines. . Default: .BR | . . .TP .BI \-d deletemark Use the .I deletemark for deleted source lines. . Default: .BR * . . .TP .B \-D Show the deleted portions from changed and deleted text. . Default delimiting marks: .BR "[[" " \&.\|.\|.\& " "]]" . . .TP .BI \-M "mark1 mark2" Change the delimiting marks for the .B \-D option. . It makes no sense to use this option without .BR \-D . . .TP .BI \-x diffcmd Use the .I diffcmd command to perform the comparison of .I file1 and .IR file2 . . In particular, .I diffcmd should accept the GNU .B diff .BI \-D name option. . Default: .BR diff (1). . .TP .B \-\- All the following arguments are treated as file names, even if they begin with .BR \- . . .TP .B \-\-help Print a usage message on standard error output and exit. . .TP .B \-\-version Print version information on the standard output and exit. . . .\" -------------------------------------------------------------------- .SH BUGS .\" -------------------------------------------------------------------- . The output is not necessarily compatible with all macro packages and all preprocessors. . A workaround that is often successful against preprocessor problems is to run .B gdiffmk on the output of all the preprocessors instead of the input source. . . .LP .B gdiffmk relies on the .BI \-D name option of GNU .BR diff (1) to make a merged `#ifdef' output format. . It hasn't been tested whether other versions of .BR diff (1) do support this option. . See also the .BI \-x diffcmd option. . . .LP Report bugs to .MT bug-groff@gnu.org .ME . . Include a complete, self-contained example that will allow the bug to be reproduced, and say which version of .B gdiffmk you are using. . . .\" -------------------------------------------------------------------- .SH COPYRIGHT .\" -------------------------------------------------------------------- .co .\" -------------------------------------------------------------------- .SH AUTHORS .\" -------------------------------------------------------------------- .au . . .\" -------------------------------------------------------------------- .SH "SEE ALSO" .\" -------------------------------------------------------------------- . .BR groff (@MAN1EXT@), .BR nroff (@MAN1EXT@), .BR gtroff (@MAN1EXT@), .BR diff (@MAN1EXT@) . .\" Local Variables: .\" mode: nroff .\" End: groff-1.22.3/contrib/gdiffmk/PaxHeaders.22577/tests0000644000000000000000000000013212426110267020042 xustar000000000000000030 mtime=1415090359.244973678 30 atime=1415090315.014526635 30 ctime=1415090359.244973678 groff-1.22.3/contrib/gdiffmk/tests/0000755000175000001440000000000012426110267016755 5ustar00wlusers00000000000000groff-1.22.3/contrib/gdiffmk/tests/PaxHeaders.22577/baseline.90000644000000000000000000000013212426110213021762 xustar000000000000000030 mtime=1415090315.621519046 30 atime=1415090315.621519046 30 ctime=1415090315.621519046 groff-1.22.3/contrib/gdiffmk/tests/baseline.90000644000175000001440000000230612426110213020621 0ustar00wlusers00000000000000.ig \"-*- nroff -*- Copyright (C) 2004-2014 Free Software Foundation, Inc. This file is part of the gdiffmk utility, which is part of groff. Written by Mike Bianchi > Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. .. .ll 25 .pl 20 .nf file1 and file2 #1 <<<< file1 only >>>> .br .mc | file2 only file2 only .mc file1 and file2 #2 .mc + file2 only .mc file1 and file2 #3 <<<< file1 only file1 only >>>> .br .mc * .mc file1 and file2 #4 file1 and file2 #5 . .\" Emacs setup .\" Local Variables: .\" mode: nroff .\" End: groff-1.22.3/contrib/gdiffmk/tests/PaxHeaders.22577/file10000644000000000000000000000013212426110213021031 xustar000000000000000030 mtime=1415090315.621519046 30 atime=1415090315.621519046 30 ctime=1415090315.621519046 groff-1.22.3/contrib/gdiffmk/tests/file10000644000175000001440000000022212426110213017663 0ustar00wlusers00000000000000.ll 25 .pl 20 .nf file1 and file2 #1 file1 only file1 and file2 #2 file1 and file2 #3 file1 only file1 only file1 and file2 #4 file1 and file2 #5 groff-1.22.3/contrib/gdiffmk/tests/PaxHeaders.22577/runtests.in0000644000000000000000000000013212426110213022325 xustar000000000000000030 mtime=1415090315.621519046 30 atime=1415090315.891515671 30 ctime=1415090315.621519046 groff-1.22.3/contrib/gdiffmk/tests/runtests.in0000644000175000001440000000630412426110213021166 0ustar00wlusers00000000000000#! /bin/sh # # A very simple function test for gdiffmk.sh. # # Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. # Written by Mike Bianchi > # This file is part of the gdiffmk utility, which is part of groff. # groff is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # groff is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public # License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # This file is part of GNU gdiffmk. srcdir=@srcdir@ command=../gdiffmk # Test the number of arguments and the first argument. case $#-$1 in 1-clean ) rm -fv result* tmp_file* exit 0 ;; 1-run ) ;; * ) echo >&2 "$0 [ clean | run ] Run a few simple tests on \`${command}'."' clean Remove the result? and tmp_file? files. run Run the tests. ' exit 255 ;; esac function TestResult { if cmp -s $1 $2 then echo $2 PASSED else echo '' echo $2 TEST FAILED diff $1 $2 echo '' fi } tmpfile=/tmp/$$ trap 'rm -f ${tmpfile}' 0 1 2 3 15 # Run tests. # 3 file arguments ResultFile=result.1 ${command} ${srcdir}/file1 ${srcdir}/file2 ${ResultFile} 2>${tmpfile} cat ${tmpfile} >>${ResultFile} TestResult ${srcdir}/baseline ${ResultFile} # OUTPUT to stdout by default ResultFile=result.2 ${command} ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1 TestResult ${srcdir}/baseline ${ResultFile} # OUTPUT to stdout via - argument ResultFile=result.3 ${command} ${srcdir}/file1 ${srcdir}/file2 - >${ResultFile} 2>&1 TestResult ${srcdir}/baseline ${ResultFile} # FILE1 from standard input via - argument ResultFile=result.4 ${command} - ${srcdir}/file2 <${srcdir}/file1 >${ResultFile} 2>&1 TestResult ${srcdir}/baseline ${ResultFile} # FILE2 from standard input via - argument ResultFile=result.5 ${command} ${srcdir}/file1 - <${srcdir}/file2 >${ResultFile} 2>&1 TestResult ${srcdir}/baseline ${ResultFile} # Different values for addmark, changemark, deletemark ResultFile=result.6 ${command} -aA -cC -dD ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1 TestResult ${srcdir}/baseline.6 ${ResultFile} # Test for accidental file overwrite. ResultFile=result.7 cp ${srcdir}/file2 tmp_file.7 ${command} -aA -dD -cC ${srcdir}/file1 tmp_file.7 tmp_file.7 \ >${ResultFile} 2>&1 TestResult ${srcdir}/baseline.7 ${ResultFile} # Test -D option ResultFile=result.8 ${command} -D ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1 TestResult ${srcdir}/baseline.8 ${ResultFile} # Test -D and -M options ResultFile=result.9 ${command} -D -M '<<<<' '>>>>' \ ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1 TestResult ${srcdir}/baseline.9 ${ResultFile} # Test -D and -B options ResultFile=result.10 ${command} -D -B ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1 TestResult ${srcdir}/baseline.10 ${ResultFile} # EOF groff-1.22.3/contrib/gdiffmk/tests/PaxHeaders.22577/baseline.100000644000000000000000000000013212426110213022032 xustar000000000000000030 mtime=1415090315.620519059 30 atime=1415090315.620519059 30 ctime=1415090315.620519059 groff-1.22.3/contrib/gdiffmk/tests/baseline.100000644000175000001440000000227212426110213020673 0ustar00wlusers00000000000000.ig \"-*- nroff -*- Copyright (C) 2004-2014 Free Software Foundation, Inc. This file is part of the gdiffmk utility, which is part of groff. Written by Mike Bianchi > Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. .. .ll 25 .pl 20 .nf file1 and file2 #1 [[ file1 only ]] . .mc | file2 only file2 only .mc file1 and file2 #2 .mc + file2 only .mc file1 and file2 #3 [[ file1 only file1 only ]] . .mc * .mc file1 and file2 #4 file1 and file2 #5 . .\" Emacs setup .\" Local Variables: .\" mode: nroff .\" End: groff-1.22.3/contrib/gdiffmk/tests/PaxHeaders.22577/baseline.60000644000000000000000000000013212426110213021757 xustar000000000000000030 mtime=1415090315.620519059 30 atime=1415090315.620519059 30 ctime=1415090315.620519059 groff-1.22.3/contrib/gdiffmk/tests/baseline.60000644000175000001440000000221112426110213020611 0ustar00wlusers00000000000000.ig \"-*- nroff -*- Copyright (C) 2004-2014 Free Software Foundation, Inc. This file is part of the gdiffmk utility, which is part of groff. Written by Mike Bianchi > Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. .. .ll 25 .pl 20 .nf file1 and file2 #1 .mc C file2 only file2 only .mc file1 and file2 #2 .mc A file2 only .mc file1 and file2 #3 .mc D .mc file1 and file2 #4 file1 and file2 #5 . .\" Emacs setup .\" Local Variables: .\" mode: nroff .\" End: groff-1.22.3/contrib/gdiffmk/tests/PaxHeaders.22577/file20000644000000000000000000000013212426110213021032 xustar000000000000000030 mtime=1415090315.621519046 30 atime=1415090315.621519046 30 ctime=1415090315.621519046 groff-1.22.3/contrib/gdiffmk/tests/file20000644000175000001440000000022212426110213017664 0ustar00wlusers00000000000000.ll 25 .pl 20 .nf file1 and file2 #1 file2 only file2 only file1 and file2 #2 file2 only file1 and file2 #3 file1 and file2 #4 file1 and file2 #5 groff-1.22.3/contrib/gdiffmk/tests/PaxHeaders.22577/baseline.80000644000000000000000000000013212426110213021761 xustar000000000000000030 mtime=1415090315.621519046 30 atime=1415090315.620519059 30 ctime=1415090315.621519046 groff-1.22.3/contrib/gdiffmk/tests/baseline.80000644000175000001440000000227612426110213020626 0ustar00wlusers00000000000000.ig \"-*- nroff -*- Copyright (C) 2004-2014 Free Software Foundation, Inc. This file is part of the gdiffmk utility, which is part of groff. Written by Mike Bianchi > Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. .. .ll 25 .pl 20 .nf file1 and file2 #1 [[ file1 only ]] .br .mc | file2 only file2 only .mc file1 and file2 #2 .mc + file2 only .mc file1 and file2 #3 [[ file1 only file1 only ]] .br .mc * .mc file1 and file2 #4 file1 and file2 #5 . .\" Emacs setup .\" Local Variables: .\" mode: nroff .\" End: groff-1.22.3/contrib/gdiffmk/tests/PaxHeaders.22577/baseline0000644000000000000000000000013212426110213021613 xustar000000000000000030 mtime=1415090315.620519059 30 atime=1415090315.620519059 30 ctime=1415090315.620519059 groff-1.22.3/contrib/gdiffmk/tests/baseline0000644000175000001440000000221112426110213020445 0ustar00wlusers00000000000000.ig \"-*- nroff -*- Copyright (C) 2004-2014 Free Software Foundation, Inc. This file is part of the gdiffmk utility, which is part of groff. Written by Mike Bianchi > Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. .. .ll 25 .pl 20 .nf file1 and file2 #1 .mc | file2 only file2 only .mc file1 and file2 #2 .mc + file2 only .mc file1 and file2 #3 .mc * .mc file1 and file2 #4 file1 and file2 #5 . .\" Emacs setup .\" Local Variables: .\" mode: nroff .\" End: groff-1.22.3/contrib/gdiffmk/tests/PaxHeaders.22577/baseline.70000644000000000000000000000013212426110213021760 xustar000000000000000030 mtime=1415090315.620519059 30 atime=1415090315.620519059 30 ctime=1415090315.620519059 groff-1.22.3/contrib/gdiffmk/tests/baseline.70000644000175000001440000000017312426110213020617 0ustar00wlusers00000000000000gdiffmk: The FILE2 and OUTPUT arguments both point to the same file, gdiffmk: `tmp_file.7', and it would be overwritten. groff-1.22.3/contrib/PaxHeaders.22577/gpinyin0000644000000000000000000000013212426110213016735 xustar000000000000000030 mtime=1415090315.462521034 30 atime=1415090323.535420109 30 ctime=1415090315.462521034 groff-1.22.3/contrib/gpinyin/0000755000175000001440000000000012426110213015650 5ustar00wlusers00000000000000groff-1.22.3/contrib/gpinyin/PaxHeaders.22577/Makefile.sub0000644000000000000000000000013212426110213021242 xustar000000000000000030 mtime=1415090315.462521034 30 atime=1415090323.534420121 30 ctime=1415090315.462521034 groff-1.22.3/contrib/gpinyin/Makefile.sub0000644000175000001440000000433012426110213020100 0ustar00wlusers00000000000000# Makefile.sub for `gpinyin' (preprocessor for added Perl parts) # File position: /contrib/gpinyin/Makefile.sub # Copyright (C) 2014 Free Software Foundation, Inc. # Written by Bernd Warken . # This file is part of `gpinyin' which is part of `groff'. # `groff' is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # `groff' is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see # . ######################################################################## MAN1=gpinyin.n MOSTLYCLEANADD=gpinyin $(MAN1) # not all make programs have $(RM) predefined. RM=rm -f all: gpinyin gpinyin: gpinyin.pl sed -f "$(SH_DEPS_SED_SCRIPT)" \ -e "s|@g@|$(g)|g" \ -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \ -e "s|@gpinyin_dir@|$(DESTIR)$(gpinyin_dir)|" \ -e "s|@VERSION@|$(version)$(revision)|g" \ -e "$(SH_SCRIPT_SED_CMD)" \ $(srcdir)/gpinyin.pl >$@; \ chmod +x $@ .PHONY: install_data install_data: gpinyin subs.pl test -d $(DESTDIR)$(bindir) || \ $(mkinstalldirs) $(DESTDIR)$(bindir); \ $(RM) $(DESTDIR)$(bindir)/gpinyin; \ $(INSTALL_SCRIPT) gpinyin $(DESTDIR)$(bindir)/gpinyin; \ test -d $(DESTDIR)$(gpinyin_dir) || \ $(mkinstalldirs) $(DESTDIR)$(gpinyin_dir); \ $(RM) $(DESTDIR)$(gpinyin_dir)/subs.pl; \ $(INSTALL_SCRIPT) $(srcdir)/subs.pl \ $(DESTDIR)$(gpinyin_dir)/subs.pl .PHONY: uninstall_sub uninstall_sub: $(RM) $(DESTDIR)$(bindir)/gpinyin; \ $(RM) $(DESTDIR)$(gpinyin_dir)/subs.pl; -test -d $(DESTDIR)$(gpinyin_dir) && \ rmdir $(DESTDIR)$(gpinyin_dir) ######################################################################## # Emacs settings ######################################################################## # # Local Variables: # mode: makefile # End: groff-1.22.3/contrib/gpinyin/PaxHeaders.22577/ChangeLog0000644000000000000000000000013212426110213020564 xustar000000000000000030 mtime=1415090315.462521034 30 atime=1415090315.462521034 30 ctime=1415090315.462521034 groff-1.22.3/contrib/gpinyin/ChangeLog0000644000175000001440000000340112426110213017420 0ustar00wlusers000000000000002014-10-11 Werner LEMBERG * Makefile.sub (gpinyin): Handle `gpinyin_dir'. 2014-10-11 Bernd Warken * gpinyin.pl: Version 1.0.4 Remove `use IPC::System::Simple'. 2014-10-10 Bernd Warken * gpinyin.pl: Version 1.0.3 Remove beginning empty line for `pinyin' parts. 2014-09-25 Bernd Warken * gpinyin.pl: Version 1.0.2 * Makefile.sub: Add .PHONY. Restructure install and uninstall. 2014-09-03 Bernd Warken Version 1.0.1 * all `gpinyin' files: Copying and Emacs settings. 2014-08-27 Bernd Warken Version 1.0.0 * gpinyin.pl, subs.pl, gpinyin.man: Make `gpinyin' runnable. 2014-08-08 Bernd Warken * gpinyin.pl: Version 0.9.2 * subs.pl: Rename `sub.pl'. * Makefile.sub: Change `sub.pl' to `subs.pl'. 2014-08-08 Bernd Warken * gpinyin.pl: Version 0.9.1 * sub.pl: New file for storing subs later on. * Makefile.sub: Add new gpinyin path for sub.pl. 2014-08-01 Bernd Warken * gpinyin.pl, gpinyin.man, ChangeLog, Makefile.sub: First version 0.9.0 of gpinyin 2014-08-01 Bernd Warken ________________________________________________________________________ License Copyright (C) 2014 Free Software Foundation, Inc. Written by Bernd Warken . Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. This file is part of `gpinyin', which is part of the `groff' project. ####### Emacs settings Local Variables: mode: change-log End: groff-1.22.3/contrib/gpinyin/PaxHeaders.22577/subs.pl0000644000000000000000000000013212426110213020323 xustar000000000000000030 mtime=1415090315.462521034 30 atime=1415090315.462521034 30 ctime=1415090315.462521034 groff-1.22.3/contrib/gpinyin/subs.pl0000755000175000001440000004076312426110213017176 0ustar00wlusers00000000000000#! /usr/bin/env perl # gpinyin - European-like Chinese writing `pinyin' into `groff' # Source file position: /contrib/gpinyin/gpinyin.pl # Installed position: /bin/gpinyin # Copyright (C) 2014 Free Software Foundation, Inc. # Written by Bernd Warken . # This file is part of `gpinyin', which is part of `groff'. # `groff' is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # `groff' is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You can find a copy of the GNU General Public License in the internet # at . ######################################################################## ######################################################################## # All Pinyin syllables from wikipedia ######################################################################## my %syllables = ( 'a' => 1, 'ai' => 1, 'an' => 1, 'ang' => 1, 'ao' => 1, 'ba' => 1, 'bai' => 1, 'ban' => 1, 'bang' => 1, 'bao' => 1, 'bei' => 1, 'ben' => 1, 'beng' => 1, 'bi' => 1, 'bian' => 1, 'biao' => 1, 'bie' => 1, 'bin' => 1, 'bing' => 1, 'bo' => 1, 'bu' => 1, 'ca' => 1, 'cai' => 1, 'can' => 1, 'cang' => 1, 'cao' => 1, 'ce' => 1, 'cen' => 1, 'ceng' => 1, 'cha' => 1, 'chai' => 1, 'chan' => 1, 'chang' => 1, 'chao' => 1, 'che' => 1, 'chen' => 1, 'cheng' => 1, 'chi' => 1, 'chong' => 1, 'chou' => 1, 'chu' => 1, 'chua' => 1, 'chuai' => 1, 'chuan' => 1, 'chuang' => 1, 'chui' => 1, 'chun' => 1, 'chuo' => 1, 'ci' => 1, 'cong' => 1, 'cou' => 1, 'cu' => 1, 'cuan' => 1, 'cui' => 1, 'cun' => 1, 'cuo' => 1, 'da' => 1, 'dai' => 1, 'dan' => 1, 'dang' => 1, 'dao' => 1, 'de' => 1, 'dei' => 1, 'den' => 1, 'deng' => 1, 'di' => 1, 'dian' => 1, 'diao' => 1, 'die' => 1, 'ding' => 1, 'diu' => 1, 'dong' => 1, 'dou' => 1, 'du' => 1, 'duan' => 1, 'dui' => 1, 'dun' => 1, 'duo' => 1, 'e' => 1, 'ei' => 1, 'en' => 1, 'eng' => 1, 'er' => 1, 'fa' => 1, 'fan' => 1, 'fang' => 1, 'fei' => 1, 'fen' => 1, 'feng' => 1, 'fiao' => 1, 'fo' => 1, 'fou' => 1, 'fu' => 1, 'ga' => 1, 'gai' => 1, 'gan' => 1, 'gang' => 1, 'gao' => 1, 'ge' => 1, 'gei' => 1, 'gen' => 1, 'geng' => 1, 'gong' => 1, 'gou' => 1, 'gu' => 1, 'gua' => 1, 'guai' => 1, 'guan' => 1, 'guang' => 1, 'gui' => 1, 'gun' => 1, 'guo' => 1, 'ha' => 1, 'hai' => 1, 'han' => 1, 'hang' => 1, 'hao' => 1, 'he' => 1, 'hei' => 1, 'hen' => 1, 'heng' => 1, 'hong' => 1, 'hou' => 1, 'hu' => 1, 'hua' => 1, 'huai' => 1, 'huan' => 1, 'huang' => 1, 'hui' => 1, 'hun' => 1, 'huo' => 1, 'ji' => 1, 'jia' => 1, 'jian' => 1, 'jiang' => 1, 'jiao' => 1, 'jie' => 1, 'jin' => 1, 'jing' => 1, 'jiong' => 1, 'jiu' => 1, 'ju' => 1, 'juan' => 1, 'jue' => 1, 'jun' => 1, 'ka' => 1, 'kai' => 1, 'kan' => 1, 'kang' => 1, 'kao' => 1, 'ke' => 1, 'kei' => 1, 'ken' => 1, 'keng' => 1, 'kong' => 1, 'kou' => 1, 'ku' => 1, 'kua' => 1, 'kuai' => 1, 'kuan' => 1, 'kuang' => 1, 'kui' => 1, 'kun' => 1, 'kuo' => 1, 'la' => 1, 'lai' => 1, 'lan' => 1, 'lang' => 1, 'lao' => 1, 'le' => 1, 'lei' => 1, 'leng' => 1, 'li' => 1, 'lia' => 1, 'lian' => 1, 'liang' => 1, 'liao' => 1, 'lie' => 1, 'lin' => 1, 'ling' => 1, 'liu' => 1, 'lo' => 1, 'long' => 1, 'lou' => 1, 'lu' => 1, 'luan' => 1, 'lun' => 1, 'luo' => 1, 'lü' => 1, 'lüe' => 1, 'ma' => 1, 'mai' => 1, 'man' => 1, 'mang' => 1, 'mao' => 1, 'me' => 1, 'mei' => 1, 'men' => 1, 'meng' => 1, 'mi' => 1, 'mian' => 1, 'miao' => 1, 'mie' => 1, 'min' => 1, 'ming' => 1, 'miu' => 1, 'mo' => 1, 'mou' => 1, 'mu' => 1, 'na' => 1, 'nai' => 1, 'nan' => 1, 'nang' => 1, 'nao' => 1, 'ne' => 1, 'nei' => 1, 'nen' => 1, 'neng' => 1, 'ni' => 1, 'nian' => 1, 'niang' => 1, 'niao' => 1, 'nie' => 1, 'nin' => 1, 'ning' => 1, 'niu' => 1, 'nong' => 1, 'nou' => 1, 'nu' => 1, 'nuan' => 1, 'nun' => 1, 'nuo' => 1, 'nü' => 1, 'nüe' => 1, 'o' => 1, 'ong' => 1, 'ou' => 1, 'pa' => 1, 'pai' => 1, 'pan' => 1, 'pang' => 1, 'pao' => 1, 'pei' => 1, 'pen' => 1, 'peng' => 1, 'pi' => 1, 'pian' => 1, 'piao' => 1, 'pie' => 1, 'pin' => 1, 'ping' => 1, 'po' => 1, 'pou' => 1, 'pu' => 1, 'qi' => 1, 'qia' => 1, 'qian' => 1, 'qiang' => 1, 'qiao' => 1, 'qie' => 1, 'qin' => 1, 'qing' => 1, 'qiong' => 1, 'qiu' => 1, 'qu' => 1, 'quan' => 1, 'que' => 1, 'qun' => 1, 'ran' => 1, 'rang' => 1, 'rao' => 1, 're' => 1, 'ren' => 1, 'ri' => 1, 'rong' => 1, 'rou' => 1, 'ru' => 1, 'ruan' => 1, 'rui' => 1, 'run' => 1, 'ruo' => 1, 'sa' => 1, 'sai' => 1, 'san' => 1, 'sang' => 1, 'sao' => 1, 'se' => 1, 'sen' => 1, 'seng' => 1, 'sha' => 1, 'shai' => 1, 'shan' => 1, 'shang' => 1, 'shao' => 1, 'she' => 1, 'shei' => 1, 'shen' => 1, 'sheng' => 1, 'shi' => 1, 'shou' => 1, 'shu' => 1, 'shua' => 1, 'shuai' => 1, 'shuan' => 1, 'shuang' => 1, 'shui' => 1, 'shun' => 1, 'shuo' => 1, 'si' => 1, 'song' => 1, 'sou' => 1, 'su' => 1, 'suan' => 1, 'sui' => 1, 'sun' => 1, 'suo' => 1, 'ta' => 1, 'tai' => 1, 'tan' => 1, 'tang' => 1, 'tao' => 1, 'te' => 1, 'teng' => 1, 'ti' => 1, 'tian' => 1, 'tiao' => 1, 'tie' => 1, 'ting' => 1, 'tong' => 1, 'tou' => 1, 'tu' => 1, 'tuan' => 1, 'tui' => 1, 'tun' => 1, 'tuo' => 1, 'wa' => 1, 'wai' => 1, 'wan' => 1, 'wang' => 1, 'wei' => 1, 'wen' => 1, 'weng' => 1, 'wo' => 1, 'wu' => 1, 'xi' => 1, 'xia' => 1, 'xian' => 1, 'xiang' => 1, 'xiao' => 1, 'xie' => 1, 'xin' => 1, 'xing' => 1, 'xiong' => 1, 'xiu' => 1, 'xu' => 1, 'xuan' => 1, 'xue' => 1, 'xun' => 1, 'ya' => 1, 'yai' => 1, 'yan' => 1, 'yang' => 1, 'yao' => 1, 'ye' => 1, 'yi' => 1, 'yin' => 1, 'ying' => 1, 'yo' => 1, 'yong' => 1, 'you' => 1, 'yu' => 1, 'yuan' => 1, 'yue' => 1, 'yun' => 1, 'za' => 1, 'zai' => 1, 'zan' => 1, 'zang' => 1, 'zao' => 1, 'ze' => 1, 'zei' => 1, 'zen' => 1, 'zeng' => 1, 'zha' => 1, 'zhai' => 1, 'zhan' => 1, 'zhang' => 1, 'zhao' => 1, 'zhe' => 1, 'zhei' => 1, 'zhen' => 1, 'zheng' => 1, 'zhi' => 1, 'zhong' => 1, 'zhou' => 1, 'zhu' => 1, 'zhua' => 1, 'zhuai' => 1, 'zhuan' => 1, 'zhuang' => 1, 'zhui' => 1, 'zhun' => 1, 'zhuo' => 1, 'zi' => 1, 'zong' => 1, 'zou' => 1, 'zu' => 1, 'zuan' => 1, 'zui' => 1, 'zun' => 1, 'zuo' => 1, ); ######################################################################## # Unicode variables for utf8 tty (nroff) ######################################################################## my %tones1_Unicode = ( 'A' => q(\\[u0100]), 'E' => q(\\[u0112]), 'I' => q(\\[u012A]), 'O' => q(\\[u014C]), 'U' => q(\\[u016A]), 'Ü' => q(\\[u016A]), 'a' => q(\\[u0101]), 'e' => q(\\[u0113]), 'i' => q(\\[u012B]), 'o' => q(\\[u014D]), 'u' => q(\\[u016B]), 'ü' => q(\\[u01D6]), ); my %tones2_Unicode = ( 'A' => q(\\[u00C1]), 'E' => q(\\[u00C9]), 'I' => q(\\[u00CD]), 'O' => q(\\[u00D3]), 'U' => q(\\[u00DA]), 'Ü' => q(\\[u01D7]), 'a' => q(\\[u00E1]), 'e' => q(\\[u00E9]), 'i' => q(\\[u00ED]), 'o' => q(\\[u00F3]), 'u' => q(\\[u00FA]), 'ü' => q(\\[u01D8]), ); my %tones3_Unicode = ( 'A' => q(\\[u01CD]), 'E' => q(\\[u011A]), 'I' => q(\\[u01CF]), 'O' => q(\\[u01D1]), 'U' => q(\\[u01D3]), 'Ü' => q(\\[u01D9]), 'a' => q(\\[u01CE]), 'e' => q(\\[u011B]), 'i' => q(\\[u01D0]), 'o' => q(\\[u01D2]), 'u' => q(\\[u01D4]), 'ü' => q(\\[u01DA]), ); my %tones4_Unicode = ( 'A' => q(\\[u00C0]), 'E' => q(\\[u00C8]), 'I' => q(\\[u00CC]), 'O' => q(\\[u00D2]), 'U' => q(\\[u00D9]), 'Ü' => q(\\[u01DB]), 'a' => q(\\[u00E0]), 'e' => q(\\[u00E8]), 'i' => q(\\[u00EC]), 'o' => q(\\[u00F2]), 'u' => q(\\[u00F9]), 'ü' => q(\\[u01DC]), ); ######################################################################## # glyph variables for troff ######################################################################## #my $tone1_macron = '\\[a-]'; #my $tone2_acute = '\\[aa]'; #my $tone3_caron = '\\[ah]'; #my $tone4_grave = '\\[ga]'; my @accents = ( '', '\\[a-]', '\\[aa]', '\\[ah]', '\\[ga]', ); my %tones2_glyphs = ( 'A' => q(\\['A]), 'E' => q(\\['E]), 'I' => q(\\['I]), 'O' => q(\\['O]), 'U' => q(\\['U]), 'a' => q(\\['a]), 'e' => q(\\['e]), 'i' => q(\\['i]), 'o' => q(\\['o]), 'u' => q(\\['u]), ); my %tones4_glyphs = ( 'A' => q(\\[`A]), 'E' => q(\\[`E]), 'I' => q(\\[`I]), 'O' => q(\\[`O]), 'U' => q(\\[`U]), 'a' => q(\\[`a]), 'e' => q(\\[`e]), 'i' => q(\\[`i]), 'o' => q(\\[`o]), 'u' => q(\\[`u]), ); ######################################################################## # subs ######################################################################## # Pinyin consists of syllables with a final number to be translated # into an accent. Such numbered syllables are combined into words. # Such words can have a final punctuation. A line is a collection of # such words. my @roffs = ( 'n', 't', ); ######################################################################## sub err { my $s = shift; print STDERR $s; 1; } # err() ######################################################################## sub handle_line { my $starting_blanks = shift; my $line = shift; #&err('handle_line start: ' . $line); my %outline = ( 'n' => $starting_blanks, 't' => $starting_blanks, ); # transform to Ü only for inside of Perl $line =~ s/\\ \(:U /Ü/gx; $line =~ s/\\ \[:U\] /Ü/gx; # handle_line() # transform to ü only for inside of Perl $line =~ s/\\ \(:u /ü/gx; $line =~ s/\\ \[:u\] /ü/gx; $line =~ s/U[eE]/Ü/g; $line =~ s/u[eE]/ü/g; $line =~ s/\\\(aq/'/g; # \(aq is an apostrophe $line =~ s/\\\[aq\]/'/g; # \[aq] is an apostrophe $line =~ s/^[']//; # remove leading apostrophe $line =~ s/[']$//; # remove final apostrophe $line =~ s/['][']+/'/g; # combine apostrophe groups $line =~ s/([0-4])'/$1/; $line =~ s/([^0-4])'/${1}0/; my @words = split /\s+/, $line; # handle_line() for my $word ( @words ) { #&err('handle_line word: ' . $word); next unless ( $word ); # this is a word, maybe composed of several syllables my $punctuation = $1 if ( $word =~ s/([,.?!:;]*)$// ); # `$word' is now without punctuation my %outword = &handle_word($word); next unless ( %outword ); for my $roff ( @roffs ) { #&err('handle_line roff ' . $roff . ': ' . $outword{$roff}); # combine words to line next unless ( $outword{$roff} ); # non-initial space $outline{$roff} .= ' ' if ( $outline{$roff} ); $outline{$roff} .= $outword{$roff}; $outline{$roff} .= $punctuation; } } #for my $roff ( @roffs ) { #&err('handle_line end ' . $roff . ': ' . $outline{$roff}); #} return %outline; } # handle_line() ######################################################################## sub handle_word { my $word = shift; #&err('handle_word start: ' . $word); $word =~ s/5/0/g; # transform 5 to 0 $word =~ s/([^0-4])$/${1}0/; # add lacking final no-tone # remove apostrophes with tone $word =~ s/ ([0-4]) ['] /$1/gx; # replace apostrophes without tone by 0 $word =~ s/ ([^0-4]) ['] /${1}0/gx; # handle_word() # detect wrong tone numbers if ( $word =~ s/[5-9]/0/g ) { &err('word ' . $word . ': wrong tone number ' . $1); return {}; } $word =~ s/[']//g; # remove apostrophes # remove starting apostrophe or number $word =~ s/^(['0-4])+//; # add 0 for final no-tone $word .= '0' if ( $word =~ /[^0-4]$/ ); if ( $word =~ /^[0-9]/ ) { # word starts with number print 'word: ' . $word . ' starts with tone number'; $word =~ s/^[0-9]+//; } #&err('handle_word 0: ' . $word); # handle_word() my %outword = ( 'n' => '', 't' => '', ); # split word into syllables while ( $word =~ /^[a-zA-ZüÜ']/ ) { $word =~ s/^([a-zA-ZüÜ']+)([0-4])//; my $syll = $1; my $tone = $2; #err('handle_word split: ' . $syll . ' ' . $tone); my %outsyll = &handle_syll( $syll, $tone ); next unless ( %outsyll ); for my $roff ( @roffs ) { my $out = $outsyll{$roff}; $out = '\\[aq]' . $out if ( $out && $out =~ /^[aeo]/ ); $outword{$roff} .= $out; #&err('handle_word ' . $roff . ': ' . $outword{$roff}); } } return %outword; } # handle_word() ######################################################################## sub handle_syll { my $syll = shift; my $tone = shift; #&err( 'handle_syll start: ' . $syll . ' ' . $tone); my $lower_case = lc($syll); $lower_case =~ s/Ü/ü/g; unless ( exists($syllables{$lower_case}) ) { err('The syllable ' . $syll . ' is not a Chinese syllable.'); return {}; } my %outsyll = ( 'n' => '', 't' => '', ); if ( $tone == 0 ) { # no accent # use u umlaut without accent $syll =~ s/Ü/\\[:U]/g; $syll =~ s/ü/\\[:u]/g; for my $roff ( @roffs ) { $outsyll{$roff} = $syll; #&err('handle_syll 0 outsyll ' . $roff . ': ' . $outsyll{$roff}); } return %outsyll; } # end of tone 0 # handle_syll() # split syllable $syll =~ /^ ([a-zA-Z]*) ([aeiouAEIOUüÜ]+) ([a-zA-Z]*) $/x; my $initial = $1; my $vowels = $2; my $final = $3; unless ( $vowels ) { &err( 'Syllable ' . $syll . ' does not have vowels' ); return {}; } # split vowels my $vowels_before = ''; my $vowel = ''; my $vowels_after = ''; # handle_syll() # find vowel for accent if ( $vowels =~ /^[aeiouAEIOU]$/ ) { # only 1 vowel #&err('handle_syll single vowel ' . $vowels); $vowel = $vowels; } elsif ( $vowels eq 'ü' ) { $vowel = $vowels; } elsif ( $vowels eq 'Ü' ) { $vowel = $vowels; } elsif ( $vowels =~ /^([^aeAE]*)([aeAE])(.*)$/ ) { # a, A, e or E $vowels_before = $1; $vowel = $2; $vowels_after = $3; } elsif ( $vowels =~ /^([^oO]*)(oO)(.*)$/ ) { # o or O $vowels_before = $1; $vowel = $2; $vowels_after = $3; } elsif ( $vowels =~ /^(\w)(\w)(.*)$/ ) { # take 2nd vowel $vowels_before = $1; $vowel = $2; $vowels_after = $3; } else { &err( 'Unknown vowels: ' . $vowels . ' in syllable: ' . $syll ); return {}; } # unless ( $vowel =~ /^[aeiouAEIOU]$/ ) { # print STDERR q(The argument `) . $vowel . q(' is not a vowel!); # return {}; # } # handle_syll() $outsyll{'n'} = &vowel_n($vowel, $tone); $outsyll{'t'} = &vowel_t($vowel, $tone); for my $roff ( @roffs ) { $outsyll{$roff} = $initial . $vowels_before . $outsyll{$roff} . $vowels_after . $final; #&err('handle_syll out ' . $roff . ': ' . $outsyll{$roff}); } return %outsyll; } # handle_syll() ######################################################################## sub vowel_n { # Unicode for nroff my $vowel = shift; my $tone = shift; #&err('vowel_n: ' . $vowel . ' ' . $tone); return '' unless ( $vowel ); if ( $tone == 1 ) { # macron $vowel = $tones1_Unicode{$vowel}; } elsif ( $tone == 2 ) { # acute $vowel = $tones2_Unicode{$vowel}; } elsif ( $tone == 3 ) { # caron $vowel = $tones3_Unicode{$vowel}; } elsif ( $tone == 4 ) { # grave $vowel = $tones4_Unicode{$vowel}; } return $vowel; } # vowel_nr() ######################################################################## sub vowel_t { # named glyphs for troff my $vowel = shift; my $tone = shift; #&err( 'vowel_t: ' . $vowel . ' ' . $tone); return '' unless ( $vowel ); # \o'\s-2\[:u]\s0\[a-]' if ( $vowel =~ /[üÜ]/ ) { my $smaller = 2; $vowel = q(\\o'\\s-) . $smaller . q(\\[:u]\\s0) . $accents[$tone] . q('); return $vowel; } $vowel = q(\\[.i]) if ( $vowel eq 'i' ); if ( $tone == 1 ) { # macron $vowel = q(\\o') . $vowel . $accents[$tone] . q('); } elsif ( $tone == 2 ) { # acute $vowel = $tones2_glyphs{$vowel}; } elsif ( $tone == 3 ) { # caron $vowel = q(\\o') . $vowel . $accents[$tone] . q('); } elsif ( $tone == 4 ) { # grave $vowel = $tones4_glyphs{$vowel}; } return $vowel; } # vowel_t() ######################################################################## sub finish_pinyin_mode { #&err( 'finish' ); my $n = shift; my $t = shift; push @$n, '\\}'; push @$t, '\\}'; for ( @$n ) { # Unicode for nroff print; } for ( @$t ) { # glyphs for troff print; } 1; } # finish_pinyin_mode() 1; ######################################################################## ### Emacs settings # Local Variables: # mode: CPerl # End: groff-1.22.3/contrib/gpinyin/PaxHeaders.22577/gpinyin.man0000644000000000000000000000013212426110213021164 xustar000000000000000030 mtime=1415090315.462521034 30 atime=1415090315.462521034 30 ctime=1415090315.462521034 groff-1.22.3/contrib/gpinyin/gpinyin.man0000644000175000001440000001775012426110213020034 0ustar00wlusers00000000000000.TH GPINYIN @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@" .SH NAME gpinyin \- Chinese European-like writing within groff . .SH "SYNOPSIS" .\" The .SH was moved to this place in order to appease `apropos'. . .\" -------------------------------------------------------------------- .\" Legalese .\" -------------------------------------------------------------------- . .de co Copyright \[co] 2014 Free Software Foundation, Inc. This file is part of gpinyin, which is part of groff, a free software project. You can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. The license text is available in the internet at .UR http://www.gnu.org/licenses/gpl-2.0.html .UE . .. . .de au This file was written by Bernd Warken . .. . .\" -------------------------------------------------------------------- .\" Characters .\" -------------------------------------------------------------------- . .ie t .ds EL \f[S]\N'188'\f[P] .el .ds EL \&.\|.\|.\&\ .\" ie t .char \[Ellipsis] \f[S]\N'188'\f[P] .\" el .char \[Ellipsis] \&.\|.\|.\&\ .\" called with \[Ellipsis] . . .\" -------------------------------------------------------------------- .\" SH "SYNOPSIS" .\" -------------------------------------------------------------------- . .SY gpinyin .OP \- .OP \-\- .OP \& "\%filespec \*(EL" .YS . .BR "gpinyin -h" | --help .br .BR "gpinyin -v" | --version . . .\" -------------------------------------------------------------------- .SH DESCRIPTION .\" -------------------------------------------------------------------- . This is a preprocesor for .BR \%groff (@MAN1EXT@). . It allows to add the Chinese European-like language .I Pinyin into .BR groff (7) files. . . .\" -------------------------------------------------------------------- .SH "OPTIONS" .\" -------------------------------------------------------------------- . .\" -------------------------------------------------------------------- .SS "Breaking Options" .\" -------------------------------------------------------------------- . An option is .IR breaking , when the program just writes the information that was asked for and then stops. . All other arguments will be ignored by that. . The .I breaking options are here . .TP .B -h\~\fR|\fB\~--help Print help information with a short explanation of options to standard output. . . .TP .B -v\~\fR|\fB\~--version Print version information to standard output. . . .\" -------------------------------------------------------------------- .SS "Filespec Options" .\" -------------------------------------------------------------------- . So far, there are only .I filespec and .I breaking options. . . .P .I filespec arguments are file names or the minus sign .B \- for standard input. . As usual, the argument .B \-\- can be used in order to let all following arguments mean file names, even if the names begin with a minus character .BR \- . . . .\" -------------------------------------------------------------------- .SH "PINYIN PARTS" .\" -------------------------------------------------------------------- . .I Pinyin parts in .I groff files are enclosed by two .B .pinyin requests with different arguments. . The starting request is .RS .EX \e.pinyin start .EE .RE or .RS .EX \e.pinyin begin .EE .RE and the ending request is .RS .EX \e.pinyin stop .EE .RE or .RS .EX \e.pinyin end .EE .RE . . .\" -------------------------------------------------------------------- .SH "PINYIN DETAILS" .\" -------------------------------------------------------------------- . .I Pinyin is used for writing the Chinese language in a European-like (romanization) way. . The Chinese language consists of more than 400 syllables, each with one of 5 different tones. . In .IR Pinyin , such toned syllables can be appended to word-like connections. . . .\" -------------------------------------------------------------------- .SS "Syllables" .\" -------------------------------------------------------------------- . The Chinese language is based on about 411 defined .IR syllables , see .UR http://en.wikipedia.org/wiki/Pinyin_table .UE . . . .P In .IR Pinyin , each syllable consists of 1 to 6 European-like letters, the normal ASCII characters in upper and lower case, the only unusual characters are the .BR "U dieresis " ( umlaut ) in both cases, i.e. .BR [a-zA-ZüÜ] . . . .P In the .B groff gpinyin input, all ASCII letters are written as usual. . But the .BR u / U .B dieresis can be written as either as .B \e[\[aq]u] or .B ue in lower case or .BR \e[\[aq]U] , .BR Ue , .B UE in upper case. . . .\" -------------------------------------------------------------------- .SS "Tones" .\" -------------------------------------------------------------------- . Each syllable has exactly one of 5 defined .IR tones . . The 5th tone is not written at all, but each tone 1 to 4 is written as an accent above a defined vowel within the syllable. . . .P In the source file, these tones are written by adding a number 0 to 5 after the syllable name. . . .P In each writing, the tone numbers 1 to 4 are transformed into accents above vowels. . . .P The 1st tone is the horizontal macron .BR \e[a\-] .B \[a-] , similar to a minus or sub character, but on top of the vowel. . In each source file, write the 1st tone as .IB "syllable" 1\fR. . . .P The 2nd tone is the accute accent .B \e[aa] .BR \[aa] . . In each source file, write the 2nd tone as .IB "syllable" 2\fR. . . .P The 3rd tone is the caron sign, .BR \e[ah] .B \[ah] , which looks a bit like a small .B v above the vowel. . In each source file, write the 3rd tone as .IB "syllable" 3\fR. . . .P The 4th tone is the grave accent .B \e[ga] .BR \[ga] . . In each source file, write the 4th tone as .IB "syllable" 4\fR. . . .P The 5th tone is the no-tone. . The numbers 0 and 5 can be used for the .BR ( no-tone ). . The .B no-tone number can be omitted, when the syllable is the end of some word. . But within a word of syllables, one of the .B no-tone numbers 0 or 5 must be written. . . .\" -------------------------------------------------------------------- .SH "SEE ALSO" .\" -------------------------------------------------------------------- . .TP .BR \%groff (@MAN1EXT@) .TQ .BR \%grog (@MAN1EXT@) .TQ .BR \%groffer (@MAN1EXT@) Man\-pages with section .B 1 related to .IR groff . . They can be called with either .RS .RS .EX .BI man " name" .BI groffer "name" .EE .RE .RE . . .TP .BR \%groff (@MAN7EXT@) .TQ .BR \%groff_char (@MAN7EXT@) Man\-pages with section .B 7 related to .IR groff . . They can be called with either .RS .RS .EX .BI "man 7" " name" .BI "groffer 7" " name" .EE .RE .RE . . .P Internet documents related to .I pinyin are .RS .br .UR http://\:en.wikipedia.org/\:wiki/\:Pinyin .I Wikipedia pinyin .UE , . .br .UR http://\:en.wikipedia.org/\:wiki/\:Pinyin_table .I Pinyin Table .UE , . .br .UR http://\;www.sino.uni-heidelberg.de/\:course_resources/\:s02/\:\ py-vowels.htm .I Unicode vowels for Pinyin .UE , . .br .UR http://\:www.foolsworkshop.com/\:ptou/\:index.html .IR pinyin to Unicode .UE , . .br .UR http://\:www.mandarintools.com/ .I Online Chinese Tools .UE , . .br .UR http://\:www.pinyin.info/\:index.html .I Main pinyin website .UE , . .br .UR http://\:www.pinyin.info/\:rules/\:where.html .I Where do the tone marks go? .UE , . .br .UR http://\:git.savannah.gnu.org/\:gitweb/\:\ ?p=cjk.git;a=blob_plain;f=doc/\:pinyin.txt;hb=HEAD .I Pinyin for TeX 1 .UE , . .br .UR http://\:git.savannah.gnu.org/\:gitweb/\:\ ?p=cjk.git;a=blob_plain;f=texinput/p\:inyin.sty;hb=HEAD .I Pinyin for TeX 2 .UE . . .RE . . .\" -------------------------------------------------------------------- .SH "COPYING" .\" -------------------------------------------------------------------- .co .\" -------------------------------------------------------------------- .SH "AUTHORS" .\" -------------------------------------------------------------------- .au . . .\" -------------------------------------------------------------------- .\" Emacs settings .\" -------------------------------------------------------------------- . .\" Local Variables: .\" mode: nroff .\" coding: latin-1 .\" End: groff-1.22.3/contrib/gpinyin/PaxHeaders.22577/gpinyin.pl0000644000000000000000000000013212426110213021024 xustar000000000000000030 mtime=1415090315.462521034 30 atime=1415090315.462521034 30 ctime=1415090315.462521034 groff-1.22.3/contrib/gpinyin/gpinyin.pl0000755000175000001440000001177612426110213017701 0ustar00wlusers00000000000000#! /usr/bin/env perl # gpinyin - European-like Chinese writing `pinyin' into `groff' # Source file position: /contrib/gpinyin/gpinyin.pl # Installed position: /bin/gpinyin # Copyright (C) 2014 Free Software Foundation, Inc. # Written by Bernd Warken . my $version = '1.0.4'; # This file is part of `gpinyin', which is part of `groff'. # `groff' is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # `groff' is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You can find a copy of the GNU General Public License in the internet # at . ######################################################################## use strict; use warnings; #use diagnostics; # temporary dir and files use File::Temp qw/ tempfile tempdir /; # needed for temporary dir use File::Spec; # for `copy' and `move' use File::Copy; # for fileparse, dirname and basename use File::Basename; # current working directory use Cwd; # $Bin is the directory where this script is located use FindBin; ######################################################################## # system variables and exported variables ######################################################################## $\ = "\n"; # final part for print command ######################################################################## # read-only variables with double-@ construct ######################################################################## our $File_split_env_sh; our $File_version_sh; our $Groff_Version; my $before_make; # script before run of `make' { my $at = '@'; $before_make = 1 if '@VERSION@' eq "${at}VERSION${at}"; } my %at_at; my $file_gpinyin_test_pl; my $gpinyin_libdir; if ($before_make) { my $gpinyin_source_dir = $FindBin::Bin; $at_at{'BINDIR'} = $gpinyin_source_dir; $at_at{'G'} = ''; $gpinyin_libdir = '@gpinyin_dir@'; } else { $at_at{'BINDIR'} = '@BINDIR@'; $at_at{'G'} = '@g@'; $gpinyin_libdir = '@gpinyin_dir@'; unshift(@INC, $gpinyin_libdir); } require 'subs.pl'; ######################################################################## # options ######################################################################## foreach (@ARGV) { if ( /^(-h|--h|--he|--hel|--help)$/ ) { print q(Usage for the `gpinyin' program:); print 'gpinyin [-] [--] [filespec...] normal file name arguments'; print 'gpinyin [-h|--help] gives usage information'; print 'gpinyin [-v|--version] displays the version number'; print q(This program is a `groff' preprocessor that handles ) . q(pinyin parts in `roff' files.); exit; } elsif (/^(-v|--v|--ve|--ver|--vers|--versi|--versio|--version)$/) { print q(`gpinyin' version ) . $version; exit; } } ######################################################################## # input ######################################################################## my $pinyin_mode = 0; # not in Pinyin mode my @output_n = # nroff ( '.ie n \\{\\', ); my @output_t = # troff ( '.el \\{\\', ); foreach (<>) { # get line from input chomp; s/\s+$//; # remove final spaces # &err('gpinyin: ' . $_); my $line = $_; # with starting blanks # .pinyin start or begin line if ( $line =~ /^[.']\s*pinyin\s+(start|begin)$/ ) { if ( $pinyin_mode ) { # `.pinyin' was started twice, ignore &err( q[`.pinyin' starter was run several times] ); } else { # new pinyin start $pinyin_mode = 1; } next; } # .pinyin stop or end line if ( $line =~ /^[.']\s*pinyin\s+(stop|end)$/ ) { if ( $pinyin_mode ) { # normal stop $pinyin_mode = 0; &finish_pinyin_mode( \@output_n, \@output_t ); } else { # ignore &err( 'gpinyin: there was a .pinyin stop without ' . 'being in pinyin mode' ); } next; } # now not a .pinyin line if ( $pinyin_mode ) { # within Pinyin my $starting_blanks = ''; $starting_blanks = $1 if ( s/^(s+)// ); # handle starting spaces my %outline = &handle_line($starting_blanks, $line); #&err('gpinyin outline n: ' . $outline{'n'} ); #&err('gpinyin outline t: ' . $outline{'t'} ); push @output_n, $outline{'n'}; push @output_t, $outline{'t'}; } else { # normal roff line, not within Pinyin print $line; } next; } # end of input line ######################################################################## # end of file without stopping `pinyin' mode if ( $pinyin_mode ) { &finish_pinyin_mode( \@output_n, \@output_t ); } ######################################################################## 1; ######################################################################## ### Emacs settings # Local Variables: # mode: CPerl # End: groff-1.22.3/contrib/PaxHeaders.22577/glilypond0000644000000000000000000000013212426110213017261 xustar000000000000000030 mtime=1415090315.453521147 30 atime=1415090323.402421772 30 ctime=1415090315.453521147 groff-1.22.3/contrib/glilypond/0000755000175000001440000000000012426110213016174 5ustar00wlusers00000000000000groff-1.22.3/contrib/glilypond/PaxHeaders.22577/ChangeLog.0x0000644000000000000000000000013212426110213021436 xustar000000000000000030 mtime=1415090315.452521159 30 atime=1415090315.452521159 30 ctime=1415090315.452521159 groff-1.22.3/contrib/glilypond/ChangeLog.0x0000644000175000001440000000726312426110213020304 0ustar00wlusers000000000000002013-04-11 Bernd Warken * old groff_lilypond: There is now a free `git' package containing all old versions of the former name `groff_lilypond v0.*'. They work with `lilypond' parts in `roff' files, but were not installed. This package can be got at: $ git clone git@github.com:RUNOFF/groff_lilypond.git The new versions `glilypond 1.*' are not included there. 2013-03-28 Bernd Warken Rename `groff_lilypond' to `glilypond' for *.pl and *.man files. Split the single Perl script into several minor *.pl files. Construct `Makefile.sub' in order to have installed `glilypond'. Public versions will be v1.x. Rename `ChangeLog' to `ChangeLog.0x' for the old versions of `groff_lilypond' v0.*. New `ChangeLog' for the new versions `glilypond' 1.*. * groff_lilypond.pl: Vanished. Renamed to `glilypond.pl'. * groff_lilypond.man: Vanished. Renamed to `glilypond.man'. * ChangeLog.0x: Moved from `ChangeLog'. It is this file. It describes only the old `groff_lilypond' versions v0.*. See file `ChangeLog' for the files of the new `glilypond' v1.*. 2013-03-11 Bernd Warken * groff_lilypond.pl: Publishing groff_lilypond version v0.6. New options: -e|--eps_dir, -l|--license, -k|--keep_files, -p|--prefix=..., -t|--temp_dir=... Install --eps_dir as directory for the useful EPS files. * groff_lilypond.man: Include the new options. Add section SEE ALSO. 2013-03-03 Bernd Warken * groff_lilypond.pl: New code with Perl references. Publishing groff_lilypond version v0.5. New options: --usage, -V|--Verbose|--verbose, --file_prefix=..., -o|--output=..., --temp_dir=... Perl >=5.10.0 needed. * groff_lilypond.man: Include the new options. 2013-02-23 Bernd Warken * groff_lilypond_pl: Remove `.lilypond include' for lilypond regions. Within `groff' mode. it is still allowed. * groff_lilypond.man: Update `.lilypond include'. 2013-02-23 Bernd Warken New version v0.4 of groff_lilypond. * groff_lilypond_pl: Major rewrite. New options: --file_prefix, --temp_dir, and --license. * groff_lilypond.man: documents the new features. 2013-02-16 Bernd Warken * groff_lilypond.man: Minor corrections. 2013-02-12 Bernd Warken * groff_lilypond.pl: Add deletion of unused temporary files. 2013-02-12 Bernd Warken * contrib/lilypond: Version v0.3 for groff_lilypond * groff_lilypond.pl: A new request was added for importing lilypond files: .lilypond include ... The argument handling was improved. 2013-02-11 Bernd Warken * contrib/lilypond: Version v0.2 for groff_lilypond * groff_lilypond.pl: Now there are 2 modes for generationg the EPS files: --ly2eps (the default) and --pdf2eps (that's the old mode from version v0.1 with pdf to ps to eps). With ly2eps mode, lilypond generates the EPS files itself, for each page one EPS file. * groff_lilypond.man: Corresponding updated man-page 2013-02-10 Bernd Warken * contrib/lilypond: New files for adding lilypond parts into groff files. These files will not yet be installed. * groff_lilypond.pl: Program written in Perl, version v0.1 * groff_lilypond.man: Corresponding man-page Copyright 2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Local Variables: version-control: never mode: change-log-mode coding: utf-8 End: groff-1.22.3/contrib/glilypond/PaxHeaders.22577/Makefile.sub0000644000000000000000000000013212426110213021566 xustar000000000000000030 mtime=1415090315.452521159 30 atime=1415090323.401421784 30 ctime=1415090315.452521159 groff-1.22.3/contrib/glilypond/Makefile.sub0000644000175000001440000000473412426110213020434 0ustar00wlusers00000000000000# Makefile.sub for `glilypond' # File position: /contrib/lilypond/Makefile.sub # Copyright (C) 2013-2014 Free Software Foundation, Inc. # Written by Werner Lemberg and # Bernd Warken . # This file is part of `glilypond' which is part of `groff'. # `groff' is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # `groff' is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . ######################################################################## MAN1=glilypond.n MOSTLYCLEANADD=glilypond $(MAN1) all: glilypond # files going to lib directory `$(glilypond_dir)' GLILYPOND_LIB=\ $(srcdir)/subs.pl \ $(srcdir)/oop_fh.pl \ $(srcdir)/args.pl GLILYPOND_LIB_=`echo $(GLILYPOND_LIB) | sed 's|$(srcdir)/||g'` RM=rm -f # create perl executable `glilypond', being stored into `bindir' glilypond: $(srcdir)/glilypond.pl $(RM) $@ sed -f "$(SH_DEPS_SED_SCRIPT)" \ -e "s|@g@|$(g)|g" \ -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \ -e "s|@glilypond_dir@|$(DESTDIR)$(glilypond_dir)|g" \ -e "s|@VERSION@|$(version)$(revision)|g" \ $(srcdir)/glilypond.pl >$@ chmod +x $@ install_data: glilypond $(GLILYPOND_LIB) -test -d $(DESTDIR)$(bindir) \ || $(mkinstalldirs) $(DESTDIR)$(bindir) $(RM) $(DESTDIR)$(bindir)/glilypond $(INSTALL_SCRIPT) glilypond $(DESTDIR)$(bindir)/glilypond -test -d $(DESTDIR)$(glilypond_dir) \ || $(mkinstalldirs) $(DESTDIR)$(glilypond_dir) for f in $(GLILYPOND_LIB_); do \ $(RM) $(DESTDIR)$(glilypond_dir)/$$f; \ $(INSTALL_SCRIPT) $(srcdir)/$$f $(DESTDIR)$(glilypond_dir)/$$f; \ done uninstall_sub: $(RM) $(DESTDIR)$(bindir)/glilypond -for f in $(GLILYPOND_LIB_); do \ $(RM) $(DESTDIR)$(glilypond_dir)/$$f; \ done -test -d $(DESTDIR)$(glilypond_dir) && \ rmdir $(DESTDIR)$(glilypond_dir) ######################################################################## # Emacs settings ######################################################################## # # Local Variables: # mode: makefile # End: groff-1.22.3/contrib/glilypond/PaxHeaders.22577/README.txt0000644000000000000000000000013212426110213021034 xustar000000000000000030 mtime=1415090315.452521159 30 atime=1415090315.452521159 30 ctime=1415090315.452521159 groff-1.22.3/contrib/glilypond/README.txt0000644000175000001440000000241312426110213017672 0ustar00wlusers00000000000000 Copyright (C) 2013-2014 Free Software Foundation, Inc. Written by Bernd Warken Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is part of `glilypond', which is part of `groff'. ######################################################################## In order to run `glilypond', your system must have installed Perl of at least version `v5.6'. ######################################################################## In order to have this program installed by `make', the creation of a libdir (library directory) must be programmed in some system files. The following actions must be taken: 1) /m4/groff.m4: Add `AC_DEFUN([GROFF_GROFFERDIR_DEFAULT])'. 2) /configure.ac: Add `GROFF_GROFFERDIR_DEFAULT'. 3) /Makefile.in: Add several informations of `glilypond_dir' With that, the program `autoconf' can be run in order to update the configure files and Makefile's. Now `$glilypond_dir' can be used as libdir. ######################################################################## ### Emacs settings # Local Variables: # mode: text # End: groff-1.22.3/contrib/glilypond/PaxHeaders.22577/glilypond.pl0000644000000000000000000000013212426110213021674 xustar000000000000000030 mtime=1415090315.452521159 30 atime=1415090315.452521159 30 ctime=1415090315.452521159 groff-1.22.3/contrib/glilypond/glilypond.pl0000755000175000001440000004374612426110213020553 0ustar00wlusers00000000000000#! /usr/bin/env perl package main; ######################################################################## # debugging ######################################################################## # See `Mastering Perl', chapter 4. # use strict; # use warnings; # use diagnostics; use Carp; $SIG[__DIE__] = sub { &Carp::croak; }; use Data::Dumper; ######################################################################## # Legalese ######################################################################## our $Legalese; { use constant VERSION => 'v1.3.1'; # version of glilypond ### This constant `LICENSE' is the license for this file `GPL' >= 2 use constant LICENSE => q* glilypond - integrate `lilypond' into `groff' files Source file position: `/contrib/glilypond/glilypond.pl' Installed position: `/bin/glilypond' Copyright (C) 2013-2014 Free Software Foundation, Inc. Written by Bernd Warken This file is part of `GNU groff'. `GNU groff' is free software: you can redistribute it and/or modify it under the terms of the `GNU General Public License' as published by the `Free Software Foundation', either version 2 of the License, or (at your option) any later version. `GNU groff' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the `GNU General Public License' for more details. You should have received a copy of the 'GNU General Public License` along with `groff', see the files `COPYING' and `LICENSE' in the top directory of the `groff' source package. If not, see . *; $Legalese = { 'version' => VERSION, 'license' => LICENSE, } } ##### end legalese ######################################################################## # global variables and BEGIN ######################################################################## use integer; use utf8; use Cwd qw[]; use File::Basename qw[]; use File::Copy qw[]; use File::HomeDir qw[]; use File::Spec qw[]; use File::Path qw[]; use File::Temp qw[]; use FindBin qw[]; use POSIX qw[]; BEGIN { use constant FALSE => 0; use constant TRUE => 1; use constant EMPTYSTRING => ''; use constant EMPTYARRAY => (); use constant EMPTYHASH => (); our $Globals = { 'before_make' => FALSE, 'groff_version' => EMPTYSTRING, 'prog' => EMPTYSTRING, }; { ( my $volume, my $directory, $Globals->{'prog'} ) = File::Spec->splitpath($0); # $Globals->{'prog'} is `glilypond' when installed, # `glilypond.pl' when not } $\ = "\n"; # adds newline at each print $/ = "\n"; # newline separates input $| = 1; # flush after each print or write command { { # script before run of `make' my $at = '@'; $Globals->{'before_make'} = TRUE if '@VERSION@' eq "${at}VERSION${at}"; } my $file_test_pl; my $glilypond_libdir; if ( $Globals->{'before_make'} ) { # in source, not yet installed my $glilypond_dir = $FindBin::Bin; $glilypond_dir = Cwd::realpath($glilypond_dir); $glilypond_libdir = $glilypond_dir; } else { # already installed $Globals->{'groff_version'} = '@VERSION@'; $glilypond_libdir = '@glilypond_dir@'; } unshift(@INC, $glilypond_libdir); umask 0077; # octal output: `printf "%03o", umask;' } require 'subs.pl'; } #die "test: "; ######################################################################## # OOP declarations for some file handles ######################################################################## require 'oop_fh.pl'; our $stdout = new FH_STDOUT(); our $stderr = new FH_STDERR(); # verbose printing, not clear wether this will be set by `--verbose', # so store this now into a string, which can be gotten later on, when # it will become either STDERR or /dev/null our $v = new FH_STRING(); # for standard output, either STDOUT or output file our $out; # end of FH ######################################################################## # Args: command line arguments ######################################################################## # command line arguments are handled in 2 runs: # 1) split short option collections, `=' optargs, and transfer abbrevs # 2) handle the transferred options with subs our $Args = { 'eps_dir' => EMPTYSTRING, # can be overwritten by `--eps_dir' # `eps-func' has 2 possible values: # 1) `ly' from `--ly2eps' (default) # 2) `pdf' `--pdf2eps' 'eps_func' => 'ly', # files names of temporary files start with this string, # can be overwritten by `--prefix' 'prefix' => 'ly', # delete or do not delete temporary files 'keep_all' => FALSE, # the roff output goes normally to STDOUT, can be a file with `--output' 'output' => EMPTYSTRING, # temporary directory, can be overwritten by `--temp_dir', # empty for default of the program 'temp_dir' => EMPTYSTRING, # regulates verbose output (on STDERR), overwritten by `--verbose' 'verbose' => FALSE, }; { # `Args' require 'args.pl'; &run_first(); &install_verbose(); &run_second(); &handle_args(); } # end `Args' ######################################################################## # temporary directory .../tmp/groff/USER/lilypond/TIME ######################################################################## our $Temp = { # store the current directory 'cwd' => Cwd::getcwd(), # directory for EPS files 'eps_dir' => EMPTYSTRING, # temporary directory 'temp_dir' => EMPTYSTRING, }; { # `Temp' if ( $Args->{'temp_dir'} ) { #---------- # temporary directory was set by `--temp_dir' #---------- my $dir = $Args->{'temp_dir'}; $dir = &path2abs($dir); $dir = &make_dir($dir) or die "The directory `$dir' cannot be used temporarily: $!"; # now `$dir' is a writable directory opendir( my $dh, $dir ) or die "Could not open temporary directory `$dir': $!"; my $file_name; my $found = FALSE; my $prefix = $Args->{'prefix'}; my $re = qr< ^ $prefix _ >x; READDIR: while ( defined($file_name = readdir($dh)) ) { chomp $file_name; if ( $file_name =~ /$re/ ) { # file name starts with $prefix_ $found = TRUE; last READDIR; } next; } $Temp->{'temp_dir'} = $dir; my $n = 0; while ( $found ) { $dir = File::Spec->catdir( $Temp->{'temp_dir'}, ++$n ); next if ( -e $dir ); $dir = &make_dir($dir) or next; $found = FALSE; last; } $Temp->{'temp_dir'} = $dir; } else { # $Args->{'temp_dir'} not given by `--temp_dir' #---------- # temporary directory was not set #---------- { # search for or create a temporary directory my @tempdirs = EMPTYARRAY; { my $tmpdir = File::Spec->tmpdir(); push @tempdirs, $tmpdir if ( $tmpdir && -d $tmpdir && -w $tmpdir ); my $root_dir = File::Spec->rootdir(); # `/' in Unix my $root_tmp = File::Spec->catdir($root_dir, 'tmp'); push @tempdirs, $root_tmp if ( $root_tmp ne $tmpdir && -d $root_tmp && -w $root_tmp ); # home directory of the actual user my $home = File::HomeDir->my_home; my $home_tmp = File::Spec->catdir($home, 'tmp'); push @tempdirs, $home_tmp if ( -d $home_tmp && -w $home_tmp ); # `/var/tmp' in Unix my $var_tmp = File::Spec->catdir('', 'var', 'tmp'); push @tempdirs, $var_tmp if ( -d $var_tmp && -w $var_tmp ); } my @path_extension = qw( groff ); # TEMPDIR/groff/USER/lilypond/ { # `$<' is UID of actual user, # `getpwuid' gets user name in scalar context my $user = getpwuid($<); push @path_extension, $user if ( $user ); push @path_extension, qw( lilypond ); } TEMPS: foreach ( @tempdirs ) { my $dir; # final directory name in `while' loop $dir = &path2abs($_); next TEMPS unless ( $dir ); # beginning of directory name my @dir_begin = ( File::Spec->splitdir($dir), @path_extension ); my $n = 0; my $dir_blocked = TRUE; BLOCK: while ( $dir_blocked ) { # should become the final dir name $dir = File::Spec->catdir(@dir_begin, ++$n); next BLOCK if ( -d $dir ); # dir name is now free, create it, and end the blocking my $res = &make_dir( $dir ); die "Could not create directory: $dir" unless ( $res ); $dir = $res; $dir_blocked = FALSE; } next TEMPS unless ( -d $dir && -w $dir ); # $dir is now a writable directory $Temp->{'temp_dir'} = $dir; # tmp/groff/USER/lilypond/TIME last TEMPS; } # end foreach tmp directories } # end to create a temporary directory die "Could not find a temporary directory" unless ( $Temp->{'temp_dir'} && -d $Temp->{'temp_dir'} && -w $Temp->{'temp_dir'} ); } # end temporary directory $v->print( "Temporary directory: `" . $Temp->{'temp_dir'} . "'\n" ); $v->print( "file_prefix: `" . $Args->{'prefix'} . "'" ); #---------- # EPS directory #---------- my $make_dir = FALSE; if ( $Args->{'eps_dir'} ) { # set by `--eps_dir' my $dir = $Args->{'eps_dir'}; $dir = &path2abs($dir); if ( -e $dir ) { goto EMPTY unless ( -w $dir ); # `$dir' is writable if ( -d $dir ) { my $upper_dir = $dir; my $found = FALSE; opendir( my $dh, $upper_dir ) or $found = TRUE; my $prefix = $Args->{'prefix'}; my $re = qr< ^ $prefix _ >x; while ( not $found ) { my $file_name = readdir($dh); if ( $file_name =~ /$re/ ) { # file name starts with $prefix_ $found = TRUE; last; } next; } my $n = 0; while ( $found ) { $dir = File::Spec->catdir($upper_dir, ++$n); next if ( -d $dir ); $found = FALSE; } $make_dir = TRUE; $Temp->{'eps_dir'} = $dir; } else { # `$dir' is not a dir, so unlink it to create it as dir if ( unlink $dir ) { # could remove `$dir' $Temp->{'eps_dir'} = $dir; $make_dir = TRUE; } else { # could not remove stderr->print( "Could not use EPS dir `" . $dir . "', use temp dir." ); } # end of unlink } # end test of -d $dir } else { $make_dir = TRUE; } # end of if -e $dir if ( $make_dir ) { # make directory `$dir' my $made = FALSE; $dir = &make_dir($dir) and $made = TRUE; if ( $made ) { $Temp->{'eps_dir'} = $dir; $v->print( "Directory for useful EPS files is `" . $dir . "'." ); } else { $v->print( "The EPS directory `" . $dir . "' cannot be used: $!" ); } } else { # `--eps_dir' was not set, so take the temporary directory $Temp->{'eps_dir'} = $Args->{'temp_dir'}; } # end of make dir } EMPTY: unless ( $Temp->{'eps_dir'} ) { # EPS-dir not set or available, use temp dir, # but leave $Temp->{'}eps_dir'} empty $v->print( "Directory for useful EPS files is the " . "temporary directory `" . $Temp->{'temp_dir'} . "'." ); } } # end `Temp' ######################################################################## # Read: read files or stdin ######################################################################## our $Read = { 'file_numbered' => EMPTYSTRING, 'file_ly' => EMPTYSTRING, # `$file_numbered.ly' }; { # read files or stdin my $ly_number = 0; # number of lilypond file # `$Args->{'prefix'}_[0-9]' my $lilypond_mode = FALSE; my $arg1; # first argument for `.lilypond' my $arg2; # argument for `.lilypond include' my $path_ly; # path of ly-file my $check_file = sub { # for argument of `.lilypond include' my $file = shift; # argument is a file name $file = &path2abs($file); unless ( $file ) { die "Line `.lilypond include' without argument"; return ''; } unless ( -f $file && -r $file ) { die "Argument `$file' in `.lilypond include' is not a readable file"; } return $file; }; # end sub &$check_file() my $increase_ly_number = sub { ++$ly_number; $Read->{'file_numbered'} = $Args->{'prefix'} . '_' . $ly_number; $Read->{'file_ly'} = $Read->{'file_numbered'} . '.ly'; $path_ly = File::Spec->catdir($Temp->{'temp_dir'}, $Read->{'file_ly'} ); }; my %eps_subs = ( 'ly' => \&create_ly2eps, # lilypond creates EPS files 'pdf' => \&create_pdf2eps, # lilypond creates PDF file ); # about lines starting with `.lilypond' my $ly; my $fh_include_file; my %lilypond_args = ( 'start' => sub { $v->print( "\nline: `.lilypond start'" ); die "Line `.lilypond stop' expected." if ( $lilypond_mode ); $lilypond_mode = TRUE; &$increase_ly_number; $v->print( "ly-file: `" . $path_ly . "'" ); $ly = new FH_FILE($path_ly); }, 'end' => sub { $v->print( "line: `.lilypond end'\n" ); die "Expected line `.lilypond start'." unless ( $lilypond_mode ); $lilypond_mode = FALSE; $ly->close(); if ( exists $eps_subs{ $Args->{'eps_func'} } ) { $eps_subs{ $Args->{'eps_func'} }->(); } else { die "Wrong argument for \%eps_subs: " . $Args->{'eps_func'} . "'"; } }, 'include' => sub { # `.lilypond include file...' # this may not be used within lilypond mode next LILYPOND if ( $lilypond_mode ); my $file_arg = shift; my $file = &$check_file($file_arg); next LILYPOND unless ( $file ); # file can be read now # `$fh_write_ly' must be opened &$increase_ly_number; $ly = new FH_FILE($path_ly); my $include = new FH_READ_FILE($file); my $res = $include->read-all(); # is a refernce to an array foreach ( @$res ) { chomp; $ly->print($_); } $ly->close(); if ( exists $eps_subs{ $Args->{'eps_func'} } ) { $eps_subs{ $Args->{'eps_func'} }->(); } else { die "Wrong argument for \$eps_subs: `" . $Args->{'eps_func'} . "'"; } }, # end `.lilypond include' ); # end definition %lilypond_args LILYPOND: foreach (<>) { chomp; my $line = $_; # now the lines with '.lilypond ...' if ( / ^ [.'] \s* lilypond ( .* ) $ /x ) { # .lilypond ... my $args = $1; $args =~ s/ ^ \s* //x; $args =~ s/ \s* $ //x; $args =~ s/ ^ ( \S* ) \s* //x; my $arg1 = $1; # `start', `end' or `include' $args =~ s/["'`]//g; my $arg2 = $args; # file argument for `.lilypond include' if ( exists $lilypond_args{$arg1} ) { $lilypond_args{$arg1}->($arg2); next; } else { # not a suitable argument of `.lilypond' $stderr->print( "Unknown command: `$arg1' `$arg2': `$line'" ); } next LILYPOND; } # end if for .lilypond if ( $lilypond_mode ) { # do lilypond-mode # see `.lilypond start' $ly->print( $line ); next LILYPOND; } # do lilypond-mode # unknown line without lilypond unless ( / ^ [.'] \s* lilypond /x ) { # not a `.lilypond' line $out->print($line); next LILYPOND; } } # end foreach <> } # end Read ######################################################################## # clean up ######################################################################## END { exit unless ( defined($Temp->{'temp_dir'}) ); if ( $Args->{'keep_all'} ) { # With --keep_all, no temporary files are removed. $v->print( "keep_all: `TRUE'" ); $v->print( "No temporary files will be deleted:" ); opendir my $dh_temp, $Temp->{'temp_dir'} or die "Cannot open " . $Temp->{'temp_dir'} . ": $!"; for ( sort readdir $dh_temp ) { next if ( / # omit files starting with a dot ^ \. /x ); if ( / ^ $Args->{'prefix'} _ /x ) { my $file = File::Spec->catfile( $Temp->{'temp_dir'}, $_ ); $v->print( "- " . $file ); next; } next; } # end for sort readdir closedir $dh_temp; } else { # keep_all is not set # Remove all temporary files except the eps files. $v->print( "keep_all: `FALSE'" ); $v->print( "All temporary files except *.eps will be deleted" ); if ( $Temp->{'eps_dir'} ) { # EPS files are in another dir, remove temp dir if ( &is_subdir( $Temp->{'eps_dir'}, $Temp->{'temp_dir'} ) ) { $v->print( "EPS dir is subdir of temp dir, so keep both." ); } else { # remove temp dir $v->print( "Try to remove temporary directory `" . $Temp->{'temp_dir'} ."':" ); if ( File::Path::remove_tree($Temp->{'temp_dir'}) ) { # remove succeeds $v->print( "...done." ); } else { # did not remove $v->print( "Failure to remove temporary directory." ); } # end test on remove } # end is subdir } else { # no EPS dir, so keep EPS files opendir my $dh_temp, $Temp->{'temp_dir'} or die "Cannot open " . $Temp->{'temp_dir'} . ": $!"; for ( sort readdir $dh_temp ) { next if ( / # omit files starting with a dot ^ \. /x ); next if ( / # omit EPS-files \.eps $ /x ); if ( / ^ $Args->{'prefix'} _ /x ) { # this includes `PREFIX_temp*' my $file = File::Spec->catfile( $Temp->{'temp_dir'}, $_ ); $v->print( "Remove `" . $file . "'" ); unlink $file or $stderr->print( "Could not remove `$file': $!" ); next; } # end if prefix next; } # end for readdir temp dir closedir $dh_temp; } # end if-else EPS files } # end if-else keep files if ( $Temp->{'eps_dir'} ) { # EPS files in $Temp->{'eps_dir'} are always kept $v->print( "As EPS directrory is set as `" . $Temp->{'eps_dir'} . "', no EPS files there will be deleted." ); opendir my $dh_temp, $Temp->{'eps_dir'} or die "Cannot open `" . $Temp->{'eps_dir'} . ": $!"; for ( sort readdir $dh_temp ) { next if ( / # omit files starting with a dot ^ \. /x ); if ( / ^ $Args->{'prefix'} _ .* \.eps $ /x ) { my $file = File::Spec->catfile( $Temp->{'eps_dir'}, $_ ); $v->print( "- " . $file ); next; } # end if *.eps next; } # end for sort readdir closedir $dh_temp; } 1; } # end package Clean 1; ######################################################################## ### Emacs settings # Local Variables: # mode: CPerl # End: groff-1.22.3/contrib/glilypond/PaxHeaders.22577/ChangeLog0000644000000000000000000000013212426110213021110 xustar000000000000000030 mtime=1415090315.452521159 30 atime=1415090315.452521159 30 ctime=1415090315.452521159 groff-1.22.3/contrib/glilypond/ChangeLog0000644000175000001440000001274112426110213017753 0ustar00wlusers000000000000002014-09-03 Bernd Warken * glilypond.pl: New version 1.3.1 * all `glilypond' files: Copying and Emacs setting. 2014-07-06 Bernd Warken * glilypond.pl: New version 1.3 * glilypond.man: Make man-page compatible with doclifter. 2014-07-04 Bernd Warken * glilypond.man: Transform to classical man-page style. 2014-07-03 Bernd Warken * glilypond.man: Improve definitions. 2014-03-30 Steffen Nurpmeso * Makefile.sub: Put straight error-prevention prefixes for `rm'. 2014-03-30 Steffen Nurpmeso * Makefile.sub (uninstall_sub): Typo. 2014-03-11 Ingo Schwarze (tiny change) * Makefile.sub (install_data): POSIX conformance. Do not use $< outside inference rules, and even less when there are multiple targets. 2014-02-14 Bernd Warken * examples/example.groff: Add this directory and this file. 2014-01-06 Bernd Warken Remove archive git@github.com:RUNOFF/groff_lilypond.git 2013-10-30 Bernd Warken * glilypond.man: Correct writing. 2013-05-10 Bernd Warken * glilypond.pl: Correct position information. Add debug code. * args.pl, oop_fh.pl, subs.pl: Correct position information. 2013-04-25 Bernd Warken * Makefile.sub: minor corrections. 2013-04-24 Bernd Warken Public `glilypond' version `v1.1'. * args.pl, sub.pl, glilypond.man: Change option `-v' to mean `--verbose' instead of former `--version' such as many GNU programs do. Correct sub `&usage()' and man-page. * args.pl, glilypond.pl, oop_fh.pl, subs.pl: Remove spaces in ` -> ', some `( ... )', and some `{ ... }' places for better readability of the Perl source code. 2013-04-24 Bernd Warken * args.pl, oop_fh.pl: Remove 1st line calling `perl'. * subs.pl: Remove 1st line calling `perl'. Remove sub `&perl_version()'. Adjust sub `&usage()'. * glilypond.pl: Keep 1st line, which will be reset by running `make'. Remove all parts of Perl testing. * perl_test.pl: Remove this file. * README.txt: Add information about needed Perl version. * Makefile.sub: Corrections for removing Perl test. Use `$<'. 2013-04-24 Bernd Warken * Makefile.sub: Remove Perl test. 2013-04-12 Bernd Warken * glilypond.pl: Fix END for early exit of `--version'. 2013-04-12 Bernd Warken * subs.pl: Replace `state' by global variable. So the Perl version can be older. * perl_test.pl: Replace the Perl version by `v5.6', analogously to `groffer'. 2013-04-11 Bernd Warken * Makefile.sub: Corrections for Emacs. 2013-04-11 Bernd Warken * old groff_lilypond: There is now a free `git' package containing all old versions of the former name `groff_lilypond v0.*'. They work with `lilypond' parts in `roff' files, but were not installed. This package can be got at: $ git clone git@github.com:RUNOFF/groff_lilypond.git The new versions `glilypond 1.*' are not included there. 2013-03-29 Bernd Warken Published version is `v1.0'. Run `autoconf' again. 2013-03-29 Bernd Warken * /m4/groff.m4, /configure.ac: Add libdir information for `glilypond'. * /Makefile.in: Add `/contrib/glilypond'. Run `autoconf'. `glilypond' can now be installed to the system. 2013-03-29 Bernd Warken Rename `groff_lilypond' to `glilypond'. So remove the former source directory `/contrib/lilypond' and newly install `/contrib/glilypond', which now has many files. The new version starts at `v1.0'. Version will now be v1.*. All former files of versions v0.* vanished or were renamed. This is not yet an information about publishing. * ChangeLog.0x: old `ChangeLog' file for the old `groff_lilypond' versions v0.*. In the future, this file won't be changed any more. * ChangeLog: New file. It is this file. It displays the history of `glilypond' versions v1.* or later. * glilypond.pl: New main Perl file written from `groff_lilypond.pl' in a totally different way. It is split now into 4 Perl files. * args.pl: New Perl file. It handles the command line options for a run of `glilypond.pl'. * oop_fh.pl: New Perl file. OOP handling of file handles. * perl_test.pl: Test whether the actual Perl program has a suitable versions. For `Makefile.sub' and `glilypond.pl'. * subs.pl: New Perl file. Defines the global subs for `glilypond.pl'. * Makefile.sub: Newly written `Makefile' for this subdirectory of `groff'. `glilypond' should be able to be installed by `make' with this file. * glilypond.man: Newly written man-page for `glilypond'. * README.txt: New file about the installation. ######################################################################## Copyright 2013-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Local Variables: version-control: never coding: utf-8 End: groff-1.22.3/contrib/glilypond/PaxHeaders.22577/subs.pl0000644000000000000000000000013212426110213020647 xustar000000000000000030 mtime=1415090315.453521147 30 atime=1415090315.453521147 30 ctime=1415090315.453521147 groff-1.22.3/contrib/glilypond/subs.pl0000644000175000001440000002727212426110213017517 0ustar00wlusers00000000000000my $License = q* ######################################################################## # Legalese ######################################################################## Subroutines for `glilypond'. Source file position: `/contrib/glilypond/subs.pl' Installed position: `/lib/groff/glilypond/subs.pl' Copyright (C) 2013-2014 Free Software Foundation, Inc. Written by Bernd Warken This file is part of `glilypond', which is part of `GNU groff'. `GNU groff' is free software: you can redistribute it and/or modify it under the terms of the `GNU General Public License' as published by the `Free Software Foundation', either version 3 of the License, or (at your option) any later version. `GNU groff' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the `GNU General Public License' for more details. You should have received a copy of the 'GNU General Public License` along with `groff', see the files `COPYING' and `LICENSE' in the top directory of the `groff' source package. If not, see . *; ##### end legalese # use strict; # use warnings; # use diagnostics; use integer; use utf8; use feature 'state'; ######################################################################## # subs for using several times ######################################################################## sub create_ly2eps { # `--ly2eps' default our ( $out, $Read, $Temp ); my $prefix = $Read->{'file_numbered'}; # with dir change to temp dir # `$ lilypond --ps -dbackend=eps -dgs-load-fonts \ # output=file_without_extension file.ly' # extensions are added automatically my $opts = '--ps -dbackend=eps -dinclude-eps-fonts -dgs-load-fonts ' . "--output=$prefix $prefix"; &run_lilypond("$opts"); Cwd::chdir $Temp->{'cwd'} or die "Could not change to former directory `" . $Temp->{'cwd'} . "': $!"; my $eps_dir = $Temp->{'eps_dir'}; my $dir = $Temp->{'temp_dir'}; opendir( my $dh, $dir ) or die "could not open temporary directory `$dir': $!"; my $re = qr< ^ $prefix - .* \.eps $ >x; my $file; while ( readdir( $dh ) ) { chomp; $file = $_; if ( /$re/ ) { my $file_path = File::Spec->catfile($dir, $file); if ( $eps_dir ) { my $could_copy = FALSE; File::Copy::copy($file_path, $eps_dir) and $could_copy = TRUE; if ( $could_copy ) { unlink $file_path; $file_path = File::Spec->catfile($eps_dir, $_); } } $out->print( '.PSPIC ' . $file_path ); } } # end while readdir closedir( $dh ); } # end sub create_ly2eps() sub create_pdf2eps { # `--pdf2eps' our ( $v, $stdout, $stderr, $out, $Read, $Temp ); my $prefix = $Read->{'file_numbered'}; # with dir change to temp dir &run_lilypond("--pdf --output=$prefix $prefix"); my $file_pdf = $prefix . '.pdf'; my $file_ps = $prefix . '.ps'; # pdf2ps in temp dir my $temp_file = &next_temp_file; $v->print( "\n##### run of `pdf2ps'" ); # `$ pdf2ps file.pdf file.ps' my $output = `pdf2ps $file_pdf $file_ps 2> $temp_file`; die 'Program pdf2ps does not work.' if ( $? ); &shell_handling($output, $temp_file); $v->print( "##### end run of `pdf2ps'\n" ); # ps2eps in temp dir $temp_file = &next_temp_file; $v->print( "\n##### run of `ps2eps'" ); # `$ ps2eps file.ps' $output = `ps2eps $file_ps 2> $temp_file`; die 'Program ps2eps does not work.' if ( $? ); &shell_handling($output, $temp_file); $v->print( "##### end run of `ps2eps'\n" ); # change back to former dir Cwd::chdir $Temp->{'cwd'} or die "Could not change to former directory `" . $Temp->{'cwd'} . "': $!"; # handling of .eps file my $file_eps = $prefix . '.eps'; my $eps_path = File::Spec->catfile($Temp->{'temp_dir'}, $file_eps); if ( $Temp->{'eps_dir'} ) { my $has_copied = FALSE; File::Copy::copy( $eps_path, $Temp->{'eps_dir'} ) and $has_copied = TRUE; if ( $has_copied ) { unlink $eps_path; $eps_path = File::Spec->catfile( $Temp->{'eps_dir'}, $file_eps ); } else { $stderr->print( "Could not use EPS-directory." ); } # end Temp->{'eps_dir'} } # print into groff output $out->print( '.PSPIC ' . $eps_path ); } # end sub create_pdf2eps() sub is_subdir { # arg1 is subdir of arg2 (is longer) my ( $dir1, $dir2 ) = @_; $dir1 = &path2abs( $dir1 );; $dir2 = &path2abs( $dir2 );; my @split1 = File::Spec->splitdir($dir1); my @split2 = File::Spec->splitdir($dir2); for ( @split2 ) { next if ( $_ eq shift @split1 ); return FALSE; } return TRUE; } sub license { our ( $Legalese, $stdout ); &version; $stdout->print( $Legalese->{'license'} ); } # end sub license() sub make_dir { # make directory or check if it exists our ( $v, $Args ); my $dir_arg = shift; chomp $dir_arg; $dir_arg =~ s/^\s*(.*)\s*$/$1/; unless ( $dir_arg ) { $v->print( "make_dir(): empty argument" ); return FALSE; } unless ( File::Spec->file_name_is_absolute($dir_arg) ) { my $res = Cwd::realpath($dir_arg); $res = File::Spec->canonpath($dir_arg) unless ( $res ); $dir_arg = $res if ( $res ); } return $dir_arg if ( -d $dir_arg && -w $dir_arg ); # search thru the dir parts my @dir_parts = File::Spec->splitdir($dir_arg); my @dir_grow; my $dir_grow; my $can_create = FALSE; # dir could be created if TRUE DIRPARTS: for ( @dir_parts ) { push @dir_grow, $_; next DIRPARTS unless ( $_ ); # empty string for root directory # from array to path dir string $dir_grow = File::Spec->catdir(@dir_grow); next DIRPARTS if ( -d $dir_grow ); if ( -e $dir_grow ) { # exists, but not a dir, so must be removed die "Couldn't create dir `$dir_arg', it is blocked by `$dir_grow'." unless ( -w $dir_grow ); # now it's writable, but not a dir, so it can be removed unlink ( $dir_grow ) or die "Couldn't remove `$dir_grow', " . "so I cannot create dir `$dir_arg': $!"; } # $dir_grow does no longer exist, so the former dir must be writable # in order to create the directory pop @dir_grow; $dir_grow = File::Spec->catdir(@dir_grow); die "`$dir_grow' is not writable, " . "so directory `$dir_arg' can't be createdd." unless ( -w $dir_grow ); # former directory is writable, so `$dir_arg' can be created File::Path::make_path( $dir_arg, { mask => oct('0700'), verbose => $Args->{'verbose'}, } ) # `mkdir -P' or die "Could not create directory `$dir_arg': $!"; last DIRPARTS; } die "`$dir_arg' is not a writable directory" unless ( -d $dir_arg && -w $dir_arg ); return $dir_arg; } # end sub make_dir() my $number = 0; sub next_temp_file { our ( $Temp, $v, $Args ); ++$number; my $temp_basename = $Args->{'prefix'} . '_temp_' . $number; my $temp_file = File::Spec->catfile( $Temp->{'temp_dir'} , $temp_basename ); $v->print( "next temporary file: `$temp_file'" ); return $temp_file; } # end sub next_temp_file() sub path2abs { our ( $Temp, $Args ); my $path = shift; $path =~ s/ ^ \s* ( .* ) \s* $ /$1/x; die "path2abs(): argument is empty." unless ( $path ); # Perl does not support shell `~' for home dir if ( $path =~ / ^ ~ /x ) { if ( $path eq '~' ) { # only own home $path = File::HomeDir->my_home; } elsif ( $path =~ m< ^ ~ / ( .* ) $ >x ) { # subdir of own home $path = File::Spec->catdir( $Temp->{'cwd'}, $1 ); } elsif ( $path =~ m< ^ ~ ( [^/]+ ) $ >x ) { # home of other user $path = File::HomeDir->users_home($1); } elsif ( $path =~ m< ^ ~ ( [^/]+ ) /+ ( .* ) $ >x ) { # subdir of other home $path = File::Spec-> catdir( File::HomeDir->users_home($1), $2 ); } } $path = File::Spec->rel2abs($path); # now $path is absolute return $path; } # end sub path2abs() sub run_lilypond { # arg is the options collection for `lilypond' to run # either from ly or pdf our ( $Temp, $v ); my $opts = shift; chomp $opts; my $temp_file = &next_temp_file; my $output = EMPTYSTRING; # change to temp dir Cwd::chdir $Temp->{'temp_dir'} or die "Could not change to temporary directory `" . $Temp->{'temp_dir'} . "': $!"; $v->print( "\n##### run of `lilypond " . $opts . "'" ); $output = `lilypond $opts 2>$temp_file`; die "Program lilypond does not work, see `$temp_file': $?" if ( $? ); chomp $output; &shell_handling($output, $temp_file); $v->print( "##### end run of `lilypond'\n" ); # stay in temp dir } # end sub run_lilypond() sub shell_handling { # Handle ``-shell-command output in a string (arg1). # stderr goes to temporary file $TempFile. our ( $out, $v, $Args ); my $out_string = shift; my $temp_file = shift; my $a = &string2array($out_string); # array ref for ( @$a ) { $out->print( $_ ); } $temp_file && -f $temp_file && -r $temp_file || die "shell_handling(): $temp_file is not a readable file."; my $temp = new FH_READ_FILE($temp_file); my $res = $temp->read_all(); for ( @$res ) { chomp; $v->print($_); } unlink $temp_file unless ( $Args->{'keep_all'} ); } # end sub shell_handling() sub string2array { my $s = shift; my @a = (); for ( split "\n", $s ) { chomp; push @a, $_; } return \@a; } # end string2array() sub usage { # for `--help' our ( $Globals, $Args ); my $p = $Globals->{'prog'}; my $usage = EMPTYSTRING; $usage = '###### usage:' . "\n" if ( $Args->{'verbose'} ); $usage .= qq*Options for $p: Read a `roff' file or standard input and transform `lilypond' parts (everything between `.lilypond start' and `.lilypond end') into `EPS'-files that can be read by groff using `.PSPIC'. There is also a command `.lilypond include ' that can include a complete `lilypond' file into the `groff' document. # Breaking options: $p -?|-h|--help|--usage # usage $p --version # version information $p --license # the license is GPL >= 3 # Normal options: $p [options] [--] [filename ...] There are 2 options for influencing the way how the `EPS' files for the `roff' display are generated: --ly2eps `lilypond' generates `EPS' files directly (default) --pdf2eps `lilypond' generates a `PDF' file that is transformed -k|--keep_all do not delete any temporary files -v|--verbose print much information to STDERR Options with an argument: -e|--eps_dir=... use a directory for the EPS files -o|--output=... sent output in the groff language into file ... -p|--prefix=... start for the names of temporary files -t|--temp_dir=... provide the directory for temporary files. The directories set are created when they do not exist. *; # old options: # --keep_files -k: do not delete any temporary files # --file_prefix=... -p: start for the names of temporary files $main::stdout->print( $usage ); } # end sub usage() sub version { # for `--version' our ( $Globals, $Legalese, $stdout, $Args ); my $end; if ( $Globals->{'groff_version'} ) { $end = " version $Globals->{'groff_version'}"; } else { $end = '.'; } my $output = EMPTYSTRING; $output = "###### version:\n" if ( $Args->{'verbose'} ); $output .= "`" . $Globals->{'prog'} . "' version `" . $Legalese->{'version'} . "' is part of `GNU groff'" . $end; $stdout->print($output); } # end sub version() # end of subs 1; ######################################################################## ### Emacs settings # Local Variables: # mode: CPerl # End: groff-1.22.3/contrib/glilypond/PaxHeaders.22577/glilypond.man0000644000000000000000000000013212426110213022034 xustar000000000000000030 mtime=1415090315.452521159 30 atime=1415090315.452521159 30 ctime=1415090315.452521159 groff-1.22.3/contrib/glilypond/glilypond.man0000644000175000001440000003761512426110213020706 0ustar00wlusers00000000000000.TH glilypond @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@" .SH NAME glilypond \(em integrate lilypond parts into groff . .\" This .SH was moved to this place in order to appease `apropos'. . .\" glilypond - integrate `lilypond' parts into `groff' files .\" Source file position: /contrib/glilypond.man .\" Installed position: /share/man/man1/glilypond.1 . . .\" -------------------------------------------------------------------- .\" Legalese .\" -------------------------------------------------------------------- . .de co Copyright \[co] 2013-2014 Free Software Foundation, Inc. This file is part of glilypond, which is part of GNU groff, a free software project. You can redistribute it and/or modify it under the terms of the GNU General Public License version 2 (GPL2) as published by the Free Software Foundation. The license text is available in the internet at .UR http://\%www.gnu.org/\%licenses/\%gpl-2.0.html .UE . .. . .de au This document was written by .MT groff\-bernd.warken\-72@web.de Bernd Warken .ME . .. . .\" -------------------------------------------------------------------- .\" Characters .\" -------------------------------------------------------------------- . .\" Ellipsis ... .ie t .ds EL \fS\N'188'\fP .el .ds EL \&.\|.\|.\&\ .\" called with \*(EL . .ad l . . .\" -------------------------------------------------------------------- .SH SYNOPSIS .\" -------------------------------------------------------------------- . .SY glilypond .OP \& options .OP \- .OP \-\- .OP \& "\%filespec \*(EL" .YS . . .\" -------------------------------------------------------------------- .SH DESCRIPTION .\" -------------------------------------------------------------------- . .B glilypond transforms sheet music written in the .I lilypond language into the .BR groff (@MAN7EXT@) language using the .B .PSPIC request, such that .BR groff (@MAN1EXT@) can transform it into a format that can be displayed directly. . . .P Files in .I groff language and .I "standard input" can be provided as arguments. . . .\" -------------------------------------------------------------------- .SH "OPTION OVERVIEW" .\" -------------------------------------------------------------------- . .\" -------------------------------------------------------------------- .SS "Breaking Options" .\" -------------------------------------------------------------------- . .nh .nf .TP .BR \-? | \-h | \-\-help | \-\-usage Print help or usage information, then leave the program. . .TP .B \-\-version Print version information. . .TP .BR \-l | \-\-license Print license information. .fi .hy . . .\" -------------------------------------------------------------------- .SS "Options for building EPS Files" .\" -------------------------------------------------------------------- . .TP .OP \-\-ly2eps Here the .B lilypond program creates .I eps files directly. . This is the default. . . .TP .OP \-\-pdf2eps The program .B glilypond generates a .I pdf file using .BR lilypond . . Then the .I eps file is generated by .B pdf2ps and .BR ps2eps R . . . .\" -------------------------------------------------------------------- .SS "Directories and Files" .\" -------------------------------------------------------------------- . .TP .BR \-e | \-\-eps_dir "\fI directory_name\fP" Normally all .I EPS files are sent to the temporary directory. . With this option, you can generate your own directory, in which all useful .I EPS files are send. . So at last, the temporary directory can be removed. . . .TP .BR -p | --prefix "\fI begin_of_name\fP" Normally all temporary files get names that start with the .BI ly \*(EL prefix. . With this option, you can freely change this prefix. . . .TP .BR -k | --keep_all Normally all temporary files without the .I eps files are deleted. . With this option, all generated files either by the .B lilypond program or other format transposers are kept. . . .TP .BR -t | --temp_dir "\fI dir\fP" With this option, you call a directory that is the base for the temporary directory. . This directory name is used as is without any extensions. . If this directory does not exist it is be created. . The temporary directory is created by Perl's security operations directly under this directory. . In this temporary directory, the temporary files are stored. . . .\" -------------------------------------------------------------------- .SS "Output" .\" -------------------------------------------------------------------- . .TP .BR -o | --output "\fI file_name\fP" Normally all .I groff output of this program is sent to .BR STDOUT R . . With this option, that can be changed, such that the output is stored into a file named in the option argument .IR file_name . . . .TP .BR -v | -V | --verbose A lot more of information is sent to STDERR. . . .\" -------------------------------------------------------------------- .SS "Short Option Collections" .\" -------------------------------------------------------------------- . The argument handling of options . . .P .I "Short options" are arguments that start with a single dash .BR \- . . Such an argument can consist of arbitrary many options without option argument, composed as a collection of option characters following the single dash. . . .P Such a collection can be terminated by an option character that expects an option argument. . If this option character is not the last character of the argument, the following final part of the argument is the option argument. . If it is the last character of the argument, the next argument is taken as the option argument. . . .P This is the standard for .I POSIX and .I GNU option management. . . .P For example, . .TP .BI \-kVe " some_dir" is a collection of the short options .B \-k and .B \-V without option argument, followed by the short option .B \-e with option argument that is the following part of the argument .IR some_dir . . So this argument could also be written as several arguments .B \-k \-V \-e .IR some_dir . . . .\" -------------------------------------------------------------------- .SS "Handling of Long Options" .\" -------------------------------------------------------------------- . Arguments that start with a double dash .B \-\- are so-called .I "long options" R . . Each double dash argument can only have a single long option. . . .P .I "Long options" have or have not an option argument. . An option argument can be the next argument or can be appended with an equal sign .B = to the same argument as the long option. . . .TP .B \-\-help is a long option without an option argument. . .TP .BI \-\-eps_dir " some_dir" .TQ .BI \-\-eps_dir= some_dir is the long option .B \-\-eps_dir with the option argument .IR some_dir . . . .P Moreover the program allows abbreviations of long options, as much as possible. . . .P The .I "long option" .B \-\-keep_all can be abbreviated from .B \-\-keep_al up to .B \-\-k because the program does not have another .I "long option" whose name starts with the character .BR k . . . .P On the other hand, the option .B \-\-version cannot be abbreviated further than .B \-\-vers because there is also the .I long option .B \-\-verbose that can be abbreviated up to .BR \-\-verb . . . .P An option argument can also be appended to an abbreviation. . So is .BI \-\-e= some_dir the same as .B \-\-eps_dir .IR some_dir . . . .P Moreover the program allows an arbitrary usage of upper and lower case in the option name. . This is .I Perl style. . . .P For example, the .I "long option" .B \-\-keep_all can as well be written as .B \-\-Keep_All or even as an abbreviation like .BR \-\-KeE . . . .\" -------------------------------------------------------------------- .SH FILESPEC ARGUMENTS .\" -------------------------------------------------------------------- . An argument that is not an option or an option argument is called a .I filespec argument. . . .P Without any .I filespec argument, .I "standard input" is read. . . .P Each .I filespec argument must either be the name of a readable file or a dash .B \- for .IR "standard input" . . Each input must be written in the .I roff or .I groff language and can include .I lilypond parts. . . .P Normally arguments starting with a dash .B \- are interpreted as an option. . But if you use an argument that consists only of a doubled dash .B \-\- R , all following arguments are taken as .I filespec argument, even if such an argument starts with a dash. . This is handled according to the .I GNU standard. . . .\" -------------------------------------------------------------------- .SH "THE LILYPOND PARTS IN ROFF INPUT" .\" -------------------------------------------------------------------- . .\" -------------------------------------------------------------------- .SS "Integrated Lilypond Codes" .\" -------------------------------------------------------------------- . A .I lilypond part within a structure written in the .I groff language is the whole part between the marks .RS .EX .B ".lilypond start" .EE .RE and .RS .EX .B ".lilypond end" .EE .RE . . .P A .I groff input can have several of these .I lilypond parts. . . .P When processing such a .I lilypond part between .B ".lilypond start" and .B ".lilypond end" we say that the .B glilypond program is in .IR "lilypond mode" . . . .P These .I lilypond parts are sent into temporary .I lilypond files with the file name extension .BR .ly . . These files are transformed later on into .I EPS files. . . .\" -------------------------------------------------------------------- .SS "Inclusion of ly-Files" .\" -------------------------------------------------------------------- . An additional command line for file inclusion of .I lilypond files is given by .EX .BI ".lilypond include" " file_name" .EE in .I groff input. . For each such .I include command, one file of .I lilypond code can be included into the .I groff code. . Arbitrarily many of these commands can be included in the .I groff input. . . .P These include commands can only be used outside the .I lilypond parts. . Within the .IR "lilypond mode" , this inclusion is not possible. . So .B ".lilypond include" may not be used in .IR "lilypond mode" , i.e.\& between .B ".lilypond start" and .BR ".lilypond end" . . . These included .IR ly -files are also transformed into .I EPS files. . . .\" -------------------------------------------------------------------- .SH "GENERATED FILES" .\" -------------------------------------------------------------------- . By the transformation process of .I lilypond parts into .I EPS files, there are many files generated. . By default, these files are regarded as temporary files and as such stored in a temporary directory. . . .P This process can be changed by command line options. . . .\" -------------------------------------------------------------------- .SS "Command Line Options for Directories" .\" -------------------------------------------------------------------- . The temporary directory for this program is either created automatically or can be named by the option .BR -t | --temp_dir .IR dir . . . .P Moreover, the .I EPS files that are later on referred by .B .PSPIC command in the final .I groff output can be stored in a different directory that can be set by the command line option .BR -e | --eps_dir .IR directory_name . . With this option, the temporary directory can be removed completely at the end of the program. . . .P The beginning of the names of the temporary files can be set by the command line option .OP -p | --prefix .IR begin_of_name . . . .P All of the temporary files except the .I EPS files are deleted finally. . This can be changed by setting the command line option .OP -k | --keep_files . . With this, all temporary files and directories are kept, not deleted. . . .P These .I EPS files are stored in a temporary or .I EPS directory. . But they cannot be deleted by the transformation process because they are needed for the display which can take a long time. . . .\" -------------------------------------------------------------------- .SH "TRANSFORMATION PROCESSES FOR GENERATING EPS FILES" .\" -------------------------------------------------------------------- . .\" -------------------------------------------------------------------- .SS "Mode ly2eps" .\" -------------------------------------------------------------------- . This mode is the default. . It can also be chosen by the option .BR --ly2eps . . . .P In this mode, the .B .ly files are transformed by the .B lilypond program into many files of different formats, including .I eps files, using .RS .EX .BI "$ lilypond \-\-ps \-dbackend=eps \-dgs\-load\-fonts \-\-output=" file\-name .EE .RE for each .B .ly file. . The output .I file\-name must be provided without an extension, its directory is temporary. . . .P There are many .I EPS files created. . One having the complete transformed .B ly file, named .IB file\-name .eps \fR.\fP . . .P Moreover there are .I EPS files for each page, named .IB file\-name \- digit .eps \fR.\fP . . .P The last step to be done is replacing all .I lilypond parts by the collection of the corresponding .I EPS page files. . This is done by .I groff commands .EX .BI ".PSPIC " file-name \- digit .eps .EE . . .\" -------------------------------------------------------------------- .SS "Mode pdf2eps" .\" -------------------------------------------------------------------- . This mode can be chosen by the option .BR --pdf2eps . . . .P In this mode, the .B .ly files are transformed by the .BR lilypond (1) program into .I pdf files, using .RS .EX .BI "lilypond \-\-pdf \-\-output=" file-name .EE .RE for each .B .ly file. . The .I file-name must be provided without the extension .BR .pdf . . By this process, a file .IB file-name .pdf is generated. . . .P The next step is to transform these .I PDF files into a .I PS file. . This is done by the .BR pdf2ps (1) program using .RS .EX \fR$ \fP \fBpdf2ps\fP \fIfile-name\fP \fB.pdf\fP \fIfile-name\fP \fB.ps\fP .EE .RE . . The next step creates an .I EPS file from the .I PS file. . This is done by the .BR ps2eps (1) program using .RS .EX .RB "$ " "ps2eps " \fIfile-name\fP ".ps" .EE .RE . . .P By that, a file .IB file-name .eps is created for each .I lilypond part in the .I groff file or standard input. . . .P The last step to be done is replacing all .I lilypond parts by the .I groff command .RS .EX .BI ".PSPIC " file-name .eps .EE .RE . . .\" -------------------------------------------------------------------- .SH "THE GENERATED NEW ROFF STRUCTURE" .\" -------------------------------------------------------------------- . The new .BR groff (@MAN7EXT@) structure generated by .B glilypond is either . .TP 1) sent to standard output and can there be saved into a file or piped into .BR groff (@MAN1EXT@) or .BR groffer (@MAN1EXT@) or . .TP 2) stored into a file by given the option .BR \-o\ \~| \~\-\-output .I file_name . . .\" -------------------------------------------------------------------- .SH "SEE ALSO" .\" -------------------------------------------------------------------- . .TP .BR groff (@MAN1EXT@) the usage of the groff program and pointers to the documentation and availability of the .I groff system. . The main source of information for the .I groff system is the .I groff .BR info (1) file. . . .TP .BR groff (@MAN7EXT@) documents the .I groff language. . . .TP .BR groff_tmac (@MAN5EXT@) contains documentation of the .B .PSPIC request. . . .TP .BR lilypond (1) The documentation of the .B lilypond program. . The main source of information for the .I lilypond language is the .I lilypond .BR info (1) file. . . .TP .BR pdf2ps (1) transform a .I PDF file into a .I Postscript format. . . .TP .BR ps2eps (1) transform a .I PS file into an .I EPS format. . . .\" -------------------------------------------------------------------- .SH "COPYING" .\" -------------------------------------------------------------------- .co .\" -------------------------------------------------------------------- .SH "AUTHORS" .\" -------------------------------------------------------------------- .au . . .\" -------------------------------------------------------------------- .\" Emacs settings .\" -------------------------------------------------------------------- . .\" Local Variables: .\" mode: nroff .\" End: groff-1.22.3/contrib/glilypond/PaxHeaders.22577/args.pl0000644000000000000000000000013212426110213020627 xustar000000000000000030 mtime=1415090315.452521159 30 atime=1415090315.452521159 30 ctime=1415090315.452521159 groff-1.22.3/contrib/glilypond/args.pl0000644000175000001440000002736112426110213017476 0ustar00wlusers00000000000000######################################################################## # Legalese ######################################################################## my $License = q* groff_lilypond - integrate `lilypond' into `groff' files Source file position: `/contrib/glilypond/args.pl' Installed position: `/lib/groff/glilypond' Copyright (C) 2013-2014 Free Software Foundation, Inc. Written by Bernd Warken This file is part of `GNU groff'. `GNU groff' is free software: you can redistribute it and/or modify it under the terms of the `GNU General Public License' as published by the `Free Software Foundation', either version 3 of the License, or (at your option) any later version. `GNU groff' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the `GNU General Public License' for more details. You should have received a copy of the 'GNU General Public License` along with `groff', see the files `COPYING' and `LICENSE' in the top directory of the `groff' source package. If not, see . *; ##### end legalese # use strict; # use warnings; # use diagnostics; use integer; our ( $Globals, $Args, $stderr, $v, $out ); # ---------- # subs for second run, for remaining long options after splitting and # transfer # ---------- my %opts_with_arg = ( '--eps_dir' => sub { $Args->{'eps_dir'} = shift; }, '--output' => sub { $Args->{'output'} = shift; }, '--prefix' => sub { $Args->{'prefix'} = shift; }, '--temp_dir' => sub { $Args->{'temp_dir'} = shift; }, ); # end of %opts_with_arg my %opts_noarg = ( '--help' => sub { &usage; exit; }, '--keep_all' => sub { $Args->{'keep_all'} = TRUE; }, '--license' => sub { &license; exit; }, '--ly2eps' => sub { $Args->{'eps_func'} = 'ly'; }, '--pdf2eps' => sub { $Args->{'eps_func'} = 'pdf'; }, '--verbose' => sub { $Args->{'verbose'} = TRUE; }, '--version' => sub { &version; exit; }, ); # end of %opts_noarg # used variables in both runs my @files = EMPTYARRAY; #---------- # first run for command line arguments #---------- # global variables for first run my @splitted_args; my $double_minus = FALSE; my $arg = EMPTYSTRING; my $has_arg = FALSE; # Split short option collections and transfer these to suitable long # options from above. Note that `-v' now means `--verbose' in version # `v1.1', earlier versions had `--version' for `-v'. my %short_opts = ( '?' => '--help', 'e' => '--eps_dir', 'h' => '--help', 'l' => '--license', 'k' => '--keep_all', 'o' => '--output', 'p' => '--prefix', 't' => '--temp_dir', 'v' => '--verbose', 'V' => '--verbose', ); # transfer long option abbreviations to the long options from above my @long_opts; $long_opts[3] = { # option abbreviations of 3 characters '--e' => '--eps_dir', '--f' => '--prefix', # --f for --file_prefix '--h' => '--help', '--k' => '--keep_all', # and --keep_files '--o' => '--output', '--p' => '--prefix', # and --file_prefix '--t' => '--temp_dir', '--u' => '--help', # '--usage' is mapped to `--help' }; $long_opts[4] = { # option abbreviations of 4 characters '--li' => '--license', '--ly' => '--ly2eps', '--pd' => '--pdf2eps', '--pr' => '--prefix', }; $long_opts[6] = { # option abbreviations of 6 characters '--verb' => '--verbose', '--vers' => '--version', }; # subs for short splitting and replacing long abbreviations my $split_short = sub { my @chars = split //, $1; # omit leading dash # if result is TRUE: run `next SPLIT' afterwards CHARS: while ( @chars ) { my $c = shift @chars; unless ( exists $short_opts{$c} ) { $stderr->print( "Unknown short option `-$c'." ); next CHARS; } # short option exists # map or transfer to special long option from above my $transopt = $short_opts{$c}; if ( exists $opts_noarg{$transopt} ) { push @splitted_args, $transopt; $Args->{'verbose'} = TRUE if ( $transopt eq '--verbose' ); next CHARS; } if ( exists $opts_with_arg{$transopt} ) { push @splitted_args, $transopt; if ( @chars ) { # if @chars is not empty, option $transopt has argument # in this arg, the rest of characters in @chars push @splitted_args, join "", @chars; @chars = EMPTYARRAY; return TRUE; # use `next SPLIT' afterwards } # optarg is the next argument $has_arg = $transopt; return TRUE; # use `next SPLIT' afterwards } # end of if %opts_with_arg } # end of while CHARS return FALSE; # do not do anything }; # end of sub for short_opt_collection my $split_long = sub { my $from_arg = shift; $from_arg =~ /^([^=]+)/; my $opt_part = lc($1); my $optarg = undef; if ( $from_arg =~ /=(.*)$/ ) { $optarg = $1; } N: for my $n ( qw/6 4 3/ ) { $opt_part =~ / # match $n characters ^ ( .{$n} ) /x; my $argn = $1; # get the first $n characters # no match, so luck for fewer number of chars next N unless ( $argn ); next N unless ( exists $long_opts[$n]->{$argn} ); # not in $n hash, so go on to next loop for $n # now $n-hash has arg # map or transfer to special long opt from above my $transopt = $long_opts[$n]->{$argn}; # test on option without arg if ( exists $opts_noarg{$transopt} ) { # opt has no arg $stderr->print( 'Option ' . $transopt . 'has no argument: ' . $from_arg . '.' ) if ( defined($optarg) ); push @splitted_args, $transopt; $Args->{'verbose'} = TRUE if ( $transopt eq '--verbose' ); return TRUE; # use `next SPLIT' afterwards } # end of if %opts_noarg # test on option with arg if ( exists $opts_with_arg{$transopt} ) { # opt has arg push @splitted_args, $transopt; # test on optarg in arg if ( defined($optarg) ) { push @splitted_args, $1; return TRUE; # use `next SPLIT' afterwards } # end of if optarg in arg # has optarg in next arg $has_arg = $transopt; return TRUE; # use `next SPLIT' afterwards } # end of if %opts_with_arg # not with and without option, so is not permitted $stderr->print( "`" . $transopt . "' is unknown long option from `" . $from_arg . "'" ); return TRUE; # use `next SPLIT' afterwards } # end of for N return FALSE; # do nothing }; # end of split_long() #---------- # do split and transfer arguments #---------- sub run_first { SPLIT: foreach (@ARGV) { # Transform long and short options into some given long options. # Split long opts with arg into 2 args (no `='). # Transform short option collections into given long options. chomp; if ( $has_arg ) { push @splitted_args, $_; $has_arg = EMPTYSTRING; next SPLIT; } if ( $double_minus ) { push @files, $_; next SPLIT; } if ( $_ eq '-' ) { # file arg `-' push @files, $_; next SPLIT; } if ( $_ eq '--' ) { # POSIX arg `--' push @splitted_args, $_; $double_minus = TRUE; next SPLIT; } if ( / # short option or collection of short options ^ - ( [^-] .* ) $ /x ) { $split_short->($1); next SPLIT; } # end of short option if ( /^--/ ) { # starts with 2 dashes, a long option $split_long->($_); next SPLIT; } # end of long option # unknown option without leading dash is a file name push @files, $_; next SPLIT; } # end of foreach SPLIT # all args are considered $stderr->print( "Option `$has_arg' needs an argument." ) if ( $has_arg ); push @files, '-' unless ( @files ); @ARGV = @splitted_args; }; # end of first run, splitting with map or transfer #---------- # open or ignore verbose output #---------- sub install_verbose { if ( $Args->{'verbose'} ) { # `--verbose' was used # make verbose output into $v my $s = $v->get(); # get content of string so far as array ref, close $v = new FH_STDERR(); # make verbose output into STDERR if ( $s ) { for ( @$s ) { # print the file content into new verbose output $v->print($_); } } # verbose output is now active (into STDERR) $v->print( "Option `-v' means `--verbose'." ); $v->print( "Version information is printed by option `--version'." ); $v->print( "#" x 72 ); } else { # `--verbose' was not used # do not be verbose, make verbose invisible $v->close(); # close and ignore the string content $v = new FH_NULL(); # this is either into /dev/null or in an ignored string } # end if-else about verbose # `$v->print' works now in any case $v->print( "Verbose output was chosen." ); my $s = $Globals->{'prog_is_installed'} ? '' : ' not'; $v->print( $Globals->{'prog'} . " is" . $s . " installed." ); $v->print( 'The command line options are:' ); $s = " options:"; $s .= " `" . $_ . "'" for ( @ARGV ); $v->print( $s ); $s = " file names:"; $s .= " `" . $_ . "'\n" for ( @files ); $v->print( $s ); } # end install_verbose() #---------- # second run of command line arguments #---------- sub run_second { # Second run of args with new @ARGV from the former splitting. # Arguments are now splitted and transformed into special long options. my $double_minus = FALSE; my $has_arg = FALSE; ARGS: for my $arg ( @ARGV ) { # ignore `--', file names are handled later on last ARGS if ( $arg eq '--' ); if ( $has_arg ) { unless ( exists $opts_with_arg{$has_arg} ) { $stderr->print( "`\%opts_with_args' does not have key `" . $has_arg . "'." ); next ARGS; } $opts_with_arg{$has_arg}->($arg); $has_arg = FALSE; next ARGS; } # end of $has_arg if ( exists $opts_with_arg{$arg} ) { $has_arg = $arg; next ARGS; } if ( exists $opts_noarg{$arg} ) { $opts_noarg{$arg}->(); next ARGS; } # not a suitable option $stderr->print( "Wrong option `" . $arg . "'." ); next ARGS; } # end of for ARGS: if ( $has_arg ) { # after last argument die "Option `$has_arg' needs an argument."; } }; # end of second run sub handle_args { # handling the output of args if ( $Args->{'output'} ) { # `--output' was set in the arguments my $out_path = &path2abs($Args->{'output'}); die "Output file name $Args->{'output'} cannot be used." unless ( $out_path ); my ( $file, $dir ); ( $file, $dir ) = File::Basename::fileparse($out_path) or die "Could not handle output file path `" . $out_path . "': " . "directory name `" . $dir . "' and file name `" . $file . "'."; die "Could not find output directory for `" . $Args->{'output'} . "'" unless ( $dir ); die "Could not find output file: `" . $Args->{'output'} . "'" unless ( $file ); if ( -d $dir ) { die "Could not write to output directory `" . $dir . "'." unless ( -w $dir ); } else { $dir = &make_dir($dir); die "Could not create output directory in: `" . $out_path . "'." unless ( $dir ); } # now $dir is a writable directory if ( -e $out_path ) { die "Could not write to output file `" . $out_path . "'." unless ( -w $out_path ); } $out = new FH_FILE( $out_path ); $v->print( "Output goes to file `" . $out_path . "'." ); } else { # `--output' was not set $out = new FH_STDOUT(); } # no $out is the right behavior for standard output # $Args->{'prefix'} .= '_' . $Args->{'eps_func'} . '2eps'; @ARGV = @files; } 1; ######################################################################## ### Emacs settings # Local Variables: # mode: CPerl # End: groff-1.22.3/contrib/glilypond/PaxHeaders.22577/oop_fh.pl0000644000000000000000000000013212426110213021145 xustar000000000000000030 mtime=1415090315.452521159 30 atime=1415090315.452521159 30 ctime=1415090315.452521159 groff-1.22.3/contrib/glilypond/oop_fh.pl0000644000175000001440000001570012426110213020006 0ustar00wlusers00000000000000my $License = q* ######################################################################## # Legalese ######################################################################## Source file position: `/contrib/glilypond/oop_fh.pl' Installed position: `/lib/groff/glilypond/oop_fh.pl' Copyright (C) 2013-2013 Free Software Foundation, Inc. Written by Bernd Warken This file is part of `glilypond', which is part of `GNU groff'. glilypond - integrate `lilypond' into `groff' files `GNU groff' is free software: you can redistribute it and/or modify it under the terms of the `GNU General Public License' as published by the `Free Software Foundation', either version 3 of the License, or (at your option) any later version. `GNU groff' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the `GNU General Public License' for more details. You should have received a copy of the 'GNU General Public License` along with `groff', see the files `COPYING' and `LICENSE' in the top directory of the `groff' source package. If not, see . *; ##### end legalese # use strict; # use warnings; # use diagnostics; use integer; ######################################################################## # OOP for writing file handles that are open by default, like STD* ######################################################################## # -------------------------- _FH_WRITE_OPENED -------------------------- { # FH_OPENED: base class for all opened file handles, like $TD* package _FH_WRITE_OPENED; use strict; sub new { my ( $pkg, $std ) = @_; bless { 'fh' => $std, } } sub open { } sub close { } sub print { my $self = shift; for ( @_ ) { print { $self->{'fh'} } $_; } } } # ------------------------------ FH_STDOUT ---------------------------- { # FH_STDOUT: print to noral output STDOUT package FH_STDOUT; use strict; @FH_STDOUT::ISA = qw( _FH_WRITE_OPENED ); sub new { &_FH_WRITE_OPENED::new( '_FH_WRITE_OPENED', *STDOUT ); } } # end FH_STDOUT # ------------------------------ FH_STDERR ----------------------------- { # FH_STDERR: print to STDERR package FH_STDERR; use strict; @FH_STDERR::ISA = qw( _FH_WRITE_OPENED ); sub new { &_FH_WRITE_OPENED::new( 'FH_OPENED', *STDERR ); } } # end FH_STDERR ######################################################################## # OOP for file handles that write into a file or string ######################################################################## # ------------------------------- FH_FILE ------------------------------ { # FH_FILE: base class for writing into a file or string package FH_FILE; use strict; sub new { my ( $pkg, $file ) = @_; bless { 'fh' => undef, 'file' => $file, 'opened' => main::FALSE, } } sub DESTROY { my $self = shift; $self->close(); } sub open { my $self = shift; my $file = $self->{'file'}; if ( $file && -e $file ) { die "file $file is not writable" unless ( -w $file ); die "$file is a directory" if ( -d $file ); } open $self->{'fh'}, ">", $self->{'file'} or die "could not open file `$file' for writing: $!"; $self->{'opened'} = main::TRUE; } sub close { my $self = shift; close $self->{'fh'} if ( $self->{'opened'} ); $self->{'opened'} = main::FALSE; } sub print { my $self = shift; $self->open() unless ( $self->{'opened'} ); for ( @_ ) { print { $self->{'fh'} } $_; } } } # end FH_FILE # ------------------------------ FH_STRING ----------------------------- { # FH_STRING: write into a string package FH_STRING; # write to \string use strict; @FH_STRING::ISA = qw( FH_FILE ); sub new { my $pkg = shift; # string is a reference to scalar bless { 'fh' => undef, 'string' => '', 'opened' => main::FALSE, } } sub open { my $self = shift; open $self->{'fh'}, ">", \ $self->{'string'} or die "could not open string for writing: $!"; $self->{'opened'} = main::TRUE; } sub get { # get string, move to array ref, close, and return array ref my $self = shift; return '' unless ( $self->{'opened'} ); my $a = &string2array( $self->{'string'} ); $self->close(); return $a; } } # end FH_STRING # -------------------------------- FH_NULL ----------------------------- { # FH_NULL: write to null device package FH_NULL; use strict; @FH_NULL::ISA = qw( FH_FILE FH_STRING ); use File::Spec; my $devnull = File::Spec->devnull(); $devnull = '' unless ( -e $devnull && -w $devnull ); sub new { my $pkg = shift; if ( $devnull ) { &FH_FILE::new( $pkg, $devnull ); } else { &FH_STRING::new( $pkg ); } } # end new() } # end FH_NULL ######################################################################## # OOP for reading file handles ######################################################################## # ---------------------------- FH_READ_FILE ---------------------------- { # FH_READ_FILE: read a file package FH_READ_FILE; use strict; sub new { my ( $pkg, $file ) = @_; die "File `$file' cannot be read." unless ( -f $file && -r $file ); bless { 'fh' => undef, 'file' => $file, 'opened' => main::FALSE, } } sub DESTROY { my $self = shift; $self->close(); } sub open { my $self = shift; my $file = $self->{'file'}; if ( $file && -e $file ) { die "file $file is not writable" unless ( -r $file ); die "$file is a directory" if ( -d $file ); } open $self->{'fh'}, "<", $self->{'file'} or die "could not read file `$file': $!"; $self->{'opened'} = main::TRUE; } sub close { my $self = shift; close $self->{'fh'} if ( $self->{'opened'} ); $self->{'opened'} = main::FALSE; } sub read_line { # Read 1 line of the file into a chomped string. # Do not close the read handle at the end. my $self = shift; $self->open() unless ( $self->{'opened'} ); my $res; if ( defined($res = CORE::readline($self->{'fh'}) ) ) { chomp $res; return $res; } else { $self->close(); return undef; } } sub read_all { # Read the complete file into an array reference. # Close the read handle at the end. # Return array reference. my $self = shift; $self->open() unless ( $self->{'opened'} ); my $res = []; my $line; while ( defined ( $line = CORE::readline $self->{'fh'} ) ) { chomp $line; push @$res, $line; } $self->close(); $self->{'opened'} = main::FALSE; return $res; } } # end of OOP definitions package main; 1; ######################################################################## ### Emacs settings # Local Variables: # mode: CPerl # End: groff-1.22.3/contrib/PaxHeaders.22577/pdfmark0000644000000000000000000000013212426110213016704 xustar000000000000000030 mtime=1415090315.494520634 30 atime=1415090323.937415083 30 ctime=1415090315.494520634 groff-1.22.3/contrib/pdfmark/0000755000175000001440000000000012426110213015617 5ustar00wlusers00000000000000groff-1.22.3/contrib/pdfmark/PaxHeaders.22577/Makefile.sub0000644000000000000000000000013212426110213021211 xustar000000000000000030 mtime=1415090315.493520646 30 atime=1415090323.936415096 30 ctime=1415090315.493520646 groff-1.22.3/contrib/pdfmark/Makefile.sub0000644000175000001440000000704612426110213020056 0ustar00wlusers00000000000000# Copyright (C) 2005-2014 Free Software Foundation, Inc. # Written by Keith Marshall (keith.d.marshall@ntlworld.com) # # This file is part of groff. # # groff is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or # (at your option) any later version. # # groff is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . MAN1=\ pdfroff.n CMDFILES=\ pdfroff TMACFILES=\ pdfmark.tmac \ spdf.tmac PDFDOCFILES=\ pdfmark.pdf MOSTLYCLEANDIRADD=\ pdfroff-* MOSTLYCLEANADD=\ gnu.eps \ $(PDFDOCFILES) \ $(CMDFILES) \ pdf[0-9]* GROFF_BIN_DIR=$(top_builddir)/src/roff/groff GROFF_OTHER_BIN_DIRS=\ $(top_builddir)/src/roff/troff \ $(top_builddir)/src/devices/grops GROFF_BIN_DIRS=$(GROFF_BIN_DIR) $(GROFF_OTHER_BIN_DIRS) GROFF_BIN_PATH=`echo $(GROFF_BIN_DIRS) | sed -e 's| *|$(SH_SEP)|g'` FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font MFLAG=-M$(srcdir) -M$(top_builddir)/tmac -M$(top_srcdir)/tmac PFLAG=-dpaper=$(PAGE) -P-p$(PAGE) PDFROFF=\ GROFF_TMPDIR=. \ GROFF_COMMAND_PREFIX= \ GROFF_BIN_DIR="$(GROFF_BIN_DIR)" \ GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \ ./pdfroff --keep-temporary-files $(FFLAG) $(MFLAG) $(PFLAG) RM=rm -f .SUFFIXES: .ms .pdf .ms.pdf: $(PDFROFF) -mspdf --stylesheet=$(srcdir)/cover.ms $< >$@ all: pdfroff $(make_pdfdoc) # The pdf files use the local script to generate. $(PDFDOCFILES): pdfroff pdfdoc: gnu.eps $(PDFDOCFILES) gnu.eps: if test -f $(top_srcdir)/doc/gnu.eps; then \ cp $(top_srcdir)/doc/gnu.eps . ; \ elif test -f $(top_builddir)/doc/gnu.eps; then \ cp $(top_builddir)/doc/gnu.eps . ; \ else \ xpmtoppm $(top_srcdir)/doc/gnu.xpm | pnmdepth 15 \ | $(pnmtops_nosetpage) -noturn -rle >$@ ; \ fi pdfroff: pdfroff.sh $(SH_DEPS_SED_SCRIPT) sed -f $(SH_DEPS_SED_SCRIPT) \ -e "s|@VERSION@|$(version)$(revision)|" \ -e "s|@GROFF_AWK_INTERPRETERS@|$(ALT_AWK_PROGS)|" \ -e "s|@GROFF_GHOSTSCRIPT_INTERPRETERS@|$(ALT_GHOSTSCRIPT_PROGS)|" \ -e "s|@GROFF_BIN_DIR@|$(bindir)|" $(srcdir)/pdfroff.sh >$@ chmod +x $@ install_data: install_always $(make_install_pdfdoc) install_always: -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir) for f in $(CMDFILES); do \ $(RM) $(DESTDIR)$(bindir)/$$f; \ $(INSTALL_SCRIPT) $$f $(DESTDIR)$(bindir)/$$f; \ done -test -d $(DESTDIR)$(tmacdir) || $(mkinstalldirs) $(DESTDIR)$(tmacdir) for f in $(TMACFILES); do \ $(RM) $(DESTDIR)$(tmacdir)/$$f; \ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(tmacdir)/$$f; \ done install_pdfdoc: install_always -test -d $(DESTDIR)$(pdfdocdir) \ || $(mkinstalldirs) $(DESTDIR)$(pdfdocdir) for f in $(PDFDOCFILES); do \ $(RM) $(DESTDIR)$(pdfdocdir)/$$f; \ $(INSTALL_DATA) $$f $(DESTDIR)$(pdfdocdir)/$$f; \ done uninstall_sub: uninstall_always $(make_uninstall_pdfdoc) uninstall_always: -for f in $(CMDFILES); do $(RM) $(DESTDIR)$(bindir)/$$f; done -for f in $(TMACFILES); do $(RM) $(DESTDIR)$(tmacdir)/$$f; done uninstall_pdfdoc: uninstall_always -for f in $(PDFDOCFILES); do $(RM) $(DESTDIR)$(pdfdocdir)/$$f; done # Emacs settings ######################################################################## # # Local Variables: # mode: makefile # End: groff-1.22.3/contrib/pdfmark/PaxHeaders.22577/TODO0000644000000000000000000000013212426110213017451 xustar000000000000000030 mtime=1415090315.494520634 30 atime=1415090315.494520634 30 ctime=1415090315.494520634 groff-1.22.3/contrib/pdfmark/TODO0000644000175000001440000000344012426110213016310 0ustar00wlusers00000000000000 -*- text -*- Copyright 2004-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. TODO items for pdfmark.tmac =========================== Add copyright information to PDF documentation. -------- Add acknowledgements and trade mark ownership notifications to PDF documentation. -------- Provide documentation in man page and texinfo formats. -------- Add comments in spdf.tmac, to clarify its operation. Also add commentary in pdfmark.tmac, to clarify operation of recent changes. -------- Make Makefile generic, so 'configure' can resolve target system dependencies. * Comment added 2005-02-26 by Keith Marshall If this refers to contrib/pdfmark/Makefile, then it is addressed by the new `pdfroff' script; the original Makefile may be considered redundant. Local system dependencies are resolved by `configure', and applied to `pdfroff', when it is generated from `pdfroff.sh'. -------- Improve Makefile.sub, to integrate pdfmark.tmac installation into a regular groff build. Add it to groff's Makefile.in. * Comment added 2005-02-26 by Keith Marshall Completed. -------- Provide a `pdfmark' script (or call it `groff2pdf'?) which actually converts a groff input file to pdf, and which takes care of the necessary intermediate steps to handle PDF marks. * Comment added 2005-02-26 by Keith Marshall This facility now provided by `pdfroff' script; documented in `pdfroff.man'. Man page still requires an additional section, to describe use of `stylesheet' feature. Script also requires documentation in PDF and texinfo formats. groff-1.22.3/contrib/pdfmark/PaxHeaders.22577/ChangeLog0000644000000000000000000000013212426110213020533 xustar000000000000000030 mtime=1415090315.493520646 30 atime=1415090315.492520659 30 ctime=1415090315.493520646 groff-1.22.3/contrib/pdfmark/ChangeLog0000644000175000001440000003550512426110213017401 0ustar00wlusers000000000000002014-10-14 Keith Marshall Deduce "--no-toc-relocation" from input stream (revisited). * pdfroff.sh (WRKFILE): Correct malformed sed expression. * spdf.tmac (TC): Prefer value of pdfroff's PHASE register to defined state of pdf:href.map, when choosing to emit control record to... (toc_relocation): ...enable this. 2014-10-13 Keith Marshall Deduce "--no-toc-relocation" from input stream. * pdfroff.sh (WRKFILE): Scan it for "pdfroff-option:set" records; apply settings; check for equivalent of "--no-toc-relocation" option. * spdf.tmac (TC): Emit "pdfroff-option:set toc-relocation=enabled". 2014-10-12 Keith Marshall Avoid spurious user visible control messages on stderr. * pdfroff.sh (REFCOPY): Ensure that at least one pdfhref mark of type 'Z' will remain in the reference map, after all references have been resolved; this is required, to suppress writing of reference control records to stderr during the final PDF output processing phase. 2014-09-04 Bernd Warken * all pdfmark source files: Copying (remove last updates and replace years with package years) and Emacs setup. 2014-03-30 Steffen Nurpmeso * Makefile.sub: Put straight error-prevention prefixes for `rm'. 2014-03-29 Steffen Nurpmeso * Makefile.sub: Handle examples separately, controlled by $(make{_,_install_,_uninstall_}examples). 2013-01-28 Deri James * pdfmark.tmac (pdfmark, pdf:composed): Use `\!' instead of `\X'. With the old pdfmark there are gaps between two of the lines, but with the new version they disappear. The use of `.br' and `.in 0' is arbitrary any request which causes an implicit break could be used. Two breaks together only produce one line break, but if there is an intervening `\X' then the second break finds the line buffer not empty and generates another line break. Using `\!' does alter the position of the pdfmark lines in the intermediate file sent to grops (the pdfmark lines are output immediately rather than being serialised through the output line processing), but this has no effect since the contents of the pdfmark line stay the same. It is the contents which determine where bookmarks jump to not the position of the record in the input stream to grops. I initially used `.output', but hit a snag if a pdfbookmark occurs before the document starts to output (message saying to insert an explicit `.br'), this is quite likely for things like `.pdfinfo /Author' which occur at the top of the document. So I'm using the `\!' escape. 2012-09-20 Werner LEMBERG Simplify enviroment handling. Suggested by Ivan Shmakov . * Makefile.sub (PDFROFF): Don't use export. 2011-12-26 Mike Frysinger Fix parallel build race failure. Sometimes building in parallel will fail in the pdfmark directory: make[2]: Entering directory '.../contrib/pdfmark' rm -f pdfroff rm -f pdfmark.pdf sed -f ... ./pdfroff.sh >pdfroff ...; ./pdfroff ... pdfmark.ms >pdfmark.pdf /bin/sh: ./pdfroff: Permission denied chmod +x pdfroff make[2]: *** [pdfmark.pdf] Error 126 This is because the generated pdf files use the local generated pdfroff helper script, but they don't depend directly upon it, so make tries to create the two in parallel and randomly falls over. * Makefile.sub: Have all the .pdf files explicitly depend on the `pdfroff' helper script. 2010-12-23 Keith Marshall Update copyright notices; pdfmark.tmac bug-fix. * pdfmark.tmac: Update copyright notices. (pdf*href.mark.resolve): Avoid premature removal, by aliasing to... (pdf*href.mark.begin): ...this, rather than renaming. * pdfroff.sh, pdfroff.man: Update copyright notices. 2010-12-14 Keith Marshall Clean up handling of temporary files directory. * .cvsignore (pdfroff-*): Ignore sub-directories matching this. * Makefile.sub (MOSTLCLEANDIRADD): Schedule them for removal. 2010-12-02 Keith Marshall Address potential temporary file security vulnerabilities. * pdfroff.sh (GROFF_TMPDIR): Use mktemp(1) to assign it, if possible; fall back to ${TMPDIR}, ${TMP} or ${TEMP} if unsuccessful. * pdfroff.man: Document it. 2009-08-16 Colin Watson Make pdfroff's GhostScript invocation safer. * pdfroff.sh (PDFROFF_POSTPROCESSOR_COMMAND): Add `-dSAFER' option. * pdfroff.man: Document it. 2008-12-28 Keith Marshall Avoid phantom line wrapping in pdfhref hot-spots. * pdfmark.tmac (pdf*href.mark.end): Emit hot-spot end markers within scope of `\Z', to prevent possible output line length overflow which may occur only in the layout computation passes, but not in the final output pass. Problem observed and identified by Nick Stoughton; it causes some hot-spots to be displaced from their proper locations. 2007-04-11 Keith Marshall Avoid stray newlines in folded pdfmark literal content. * pdfmark.tmac (pdf*pdfmark.dispatch.wrapped): New string; define it when accumulating long literal content; make it undefined otherwise. (PDFMARK.FOLDWIDTH, PDFMARK.FOLDWIDTH.MAX): Reserve space for two extra characters, to accommodate a space and an escaped newline, while accumulating literal content, in case folding is required. (pdf*pdfmark.dispatch) [pdf*pdfmark.dispatch.wrapped]: Add them. 2007-04-11 Keith Marshall * pdfmark.tmac (pdfbookmark): Don't evaluate within diversions; defer placement until diversion is copied out at top level. 2007-02-06 Eric S. Raymond * pdfroff.man: Update .UR/.UE and .MT/.ME to latest changes in an-ext.tmac. 2007-01-30 Werner LEMBERG * pdfroff.man: Updated. 2007-01-21 Werner LEMBERG * pdfroff.man: Revised, based on a patch from Eric Raymond. It now uses the new macros from an-ext.tmac. This is the first of a series of man patches which Eric has contributed. 2006-07-30 Keith Marshall * pdfroff.sh (PDFROFF_KILL_NULL_PAGES): Require `%%BeginPageSetup' on PostScript output line immediately following `%%Page:'. 2006-07-29 Keith Marshall * pdfroff.sh (PDFROFF_KILL_NULL_PAGES): Require `sed' to match a more explicit regular expression, for detection of redundant pages. 2006-07-14 Keith Marshall * pdfroff.sh (PDFWRITE): Local shell variable replaced... (PDFROFF_POSTPROCESSOR_COMMAND): by this new environment variable... (GROFF_GHOSTSCRIPT_INTERPRETER): with this bound to it. (PDFROFF_COLLATE, PDFROFF_KILL_NULL_PAGES): New environment variables. (--no-kill-null-pages): New command line option; implement it, and... (--help): Add description for it. * pdfroff.man (PDFROFF_POSTPROCESSOR_COMMAND): Document it. (PDFROFF_COLLATE, PDFROFF_KILL_NULL_PAGES): Document them. (--no-kill-null-pages): Document it. 2006-07-14 Zvezdan Petkovic * pdfroff.sh (--emit-ps): New command line option; implement it. (--help): Add description for it. * pdfroff.man (--emit-ps): Document it. 2006-06-11 Werner LEMBERG * pdfroff.man: Add `.ig' block after NAME section to make mandb happy. 2006-03-31 Keith Marshall Split `pdfmark' output as required, to avoid excessively long `ps:exec' intermediate output records. * pdfmark.tmac (pdfmark): Macro extended to deploy ... (pdf*pdfmark.limit): New macro; use it to define ... (PDFMARK.FOLDWIDTH, PDFMARK.FOLDWIDTH.MAX): New registers. (pdf*compose.first, pdf*compose.next, pdf*compose.literal): New macros; each will be aliased as required to ... (pdf*compose): ... this, to dynamically construct ... (pdf:composed.line, pdf:composed.literal): ... these new strings. (pdf:compose.test): New dynamically constructed string; use it to detect parenthesised literals in pdfmark content, so folding can be avoided within them, subject to honouring of `PDFMARK.FOLDWIDTH'. (pdf*length.increment): New macro; it triggers output folding when ... (pdf:length): ... this new register exceeds `PDFMARK.FOLDWIDTH.MAX'. (pdf*pdfmark.post.first, pdf*pdfmark.post.next): New macros; each will be aliased as required to ... (pdf*pdfmark.post): ... this, and invoked by ... (pdf*pdfmark.dispatch): ... this new macro; use it to define ... (pdf:composed): ... this dynamically constructed macro; use ... (pdf*end): ... this new macro to terminate it. 2006-03-09 Keith Marshall Incorporate portability recommendations by Ralf Wildenhues * pdfroff.sh: Avoid unsafe quoting in variable substitutions of the form "${VAR+"set"}"; remove outer quotes everywhere; prefix with `x' on each side of comparisons. ($NULLCMD): Define when `$ZSH_VERSION' is set, i.e. when host has `/bin/sh -> zsh'; also... (emulate sh): Invoke, for this case. Enhancement/bug fix requested by Werner LEMBERG * pdfroff.sh (--help): Direct output to `stdout', not `stderr'. (--keep-temporary-files): New option; implement it. * pdfroff.man (OPTIONS): Document `--keep-temporary-files' option. (FILES): Note names and purpose of files it affects. * Makefile.sub (PDFROFF): Add `--keep-temporary-files' option; retain them in `GROFF_TMPDIR=.'. (CLEANADD): Include temporary files matching `pdf[0-9]*'. 2006-03-08 Werner LEMBERG * pdfmark.ms: Update URL for Adobe Reference Manual. 2006-02-26 Claudio Fontana * Makefile.sub: Add DESTDIR to install and uninstall targets to support staged installations. 2006-02-25 Werner LEMBERG * pdfmark.ms: Correct typo; reported by Thomas Klausner. 2006-02-24 Werner LEMBERG * pdfmark.ms, pdfroff.sh: Replace legal/illegal with valid/invalid. 2005-06-22 Keith Marshall pdfroff.sh portability enhancement. * pdfroff.sh (ARGLIST): Variable removed. (GROFF_STYLE): Use it for all groff invocations. (INPUT_FILES): Pass to all groff invocations, instead of ARGLIST. (CS_MACRO, CE_MACRO): Initialize independently. (CS_FILTER): Simplify quoting; it used to confuse some shells. (Source): CVS keyword removed; replaced by... (RCSfile, Revision): these. 2005-06-17 Keith Marshall * pdfroff.sh (MATCH): Correct quoting. (Source): Add terminating `$' on CVS keyword. 2005-06-17 Zvezdan Petkovic * Makefile.sub: (RM): Define as `rm -f', for `make' programs which don't predefine it. 2005-06-16 Bernd Warken * pdfroff.sh (NULLDEV): Correct misspelled instance of NULDEV. 2005-05-28 Werner LEMBERG * Makefile.sub (.ms.pdf): Use `--stylesheet', not `--style'. 2005-05-26 Werner LEMBERG * Makefile.sub, pdfmark.tmac, pdfroff.sh, spdf.tmac: Update postal address for Free Software Foundation. 2005-05-17 Keith Marshall Improve portability of `pdfroff' shell script. * pdfroff.sh: Add space in shebang, conforming to portability guidelines in `autoconf' docs. (searchpath): New shell function; use it instead of `type' command to locate prerequisite helper programs. * pdfroff.man: Document influence of `OSTYPE' and `PATH_SEPARATOR' environment variables. * Makefile.sub (pdfroff): Make it depend on SH_DEPS_SED_SCRIPT, from arch/misc/shdeps.sh; use it to customize PATH_SEPARATOR initialization code for `searchpath' function in pdfroff.sh. 2005-05-16 Keith Marshall Interim documentation update. * pdfmark.ms (GROFF-WEBSITE): New string; use it in references and examples. (Section 2.5): Add definitions of D and Z operators, for use with pdfhref macro. (Section 2.5.4): Complete description of pdfhref macro usage for `Linking to Internet Resources'; provide examples. 2005-05-14 Nick Stoughton * pdfmark.tmac (LB): Renamed to ... (PDFLB): This to avoid conflicts with mm's LB macro. 2005-05-02 Keith Marshall Handle parsing anomalies in Cygwin's `ash', and similar, shells. * pdfroff.sh ($CAT, $GREP, $SED, $GROFF, $DIFF): Avoid interpreting misdirected error messages, which `type' sends to `stdout' in some shells, as a successful program file match. ($AWK, $GS): Likewise; also ensure that multiple choice match prototypes are eval'ed as such, in case token splitting occurs before variable expansion. 2005-04-24 Keith Marshall Add support for folded outlines in PDF documents. * pdfmark.tmac (PDFOUTLINE.FOLDLEVEL): New register. (pdf:bm.emit): Use it. * pdfmark.ms: Document it. 2005-03-25 Werner LEMBERG * Makefile.in: Removed. 2005-03-24 Werner LEMBERG * Makefile: Renamed to... * Makefile.in: This. 2005-03-22 Keith Marshall * pdfroff.sh: Eliminate invalid program reference to $AWK, when invoked with `--no-reference-dictionary' option. 2005-03-02 Keith Marshall * contrib/pdfmark/Makefile.sub (install_data): Use $(INSTALL_SCRIPT) to install `pdfroff'. * contrib/pdfmark/pdfroff.man (opte): New macro. Use it to remove spurious equal signs from SYNOPSIS. 2005-02-28 Keith Marshall Provide `pdfroff' shell script, and manpage to document it; runs multiple groff passes, to format PDF documents. * pdfroff.sh: New shell script template; * pdfroff.man: New man page to document it. Integrate `pdfmark' into normal groff build system; install macro `pdfmark' packages, build and install `pdfroff', and PDF format documentation. * Makefile.sub: Rewritten. * pdfmark.tmac: Modified. (pdfhref): New macro operators, `D' and `Z'. (pdf*href-D, pdf*href-Z): New macros: implement them. (pdf*href.mark.resolve, pdf*href.mark.emit, pdf*href.mark.flush): Modified macro algorithm, to eliminate inconsistencies between `grohtml' representations of `opminy' from differing groff versions. (pdf*href.mark, pdf*href.mark.release, pdf*href.mark.close): deleted (redundant macros). (PDFHREF.LEADING): Default value changed (was 2.5p; now -1.0p). Global comment updates. * TODO: Updated. 2004-12-10 Werner LEMBERG * TODO: Updated. 2004-12-08 Keith Marshall First import of pdfmark files. ________________________________________________________________________ Copyright (C) 2004-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Local Variables: version-control: never coding: latin-1 End: groff-1.22.3/contrib/pdfmark/PaxHeaders.22577/pdfroff.man0000644000000000000000000000013212426110213021104 xustar000000000000000030 mtime=1415090315.493520646 30 atime=1415090315.493520646 30 ctime=1415090315.493520646 groff-1.22.3/contrib/pdfmark/pdfroff.man0000644000175000001440000004555112426110213017754 0ustar00wlusers00000000000000.TH PDFROFF @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@" .SH NAME pdfroff \- create PDF documents using groff . . .\" pdfroff.1 .\" File position: /contrib/pdfmark/pdfroff.man . .\" -------------------------------------------------------------------- .\" Legal Matters .\" -------------------------------------------------------------------- . .de co Copyright \[co] 2005-2014 Free Software Foundation, Inc. This file is part of groff, the free GNU roff type-setting system. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License (FDL), Version 1.3 or any later version published by the Free Software Foundation; with no Front-Cover Texts, no Back-Cover Texts, and the following Invariant Sections:-- a) This "Legal Matters" section, extending from the definition of .co to the end of the enclosing .au definition. b) The entire sections bearing the heading "COPYING" and "AUTHORS". A copy of the Free Documentation License is included as a file called FDL in the main directory of the groff source package, it is also available in the internet at .UR http://\:www.gnu.org/\:copyleft/\:fdl.html the GNU copyleft site .UE . .. . .de au It was originally written by .MT keith.d.marshall@\:ntlworld.com Keith Marshall .ME , who also wrote the implementation of the .I pdfroff program, to which it relates. .. . .\" -------------------------------------------------------------------- .\" Local macro definitions . .hw pdfmark . .de NH . hy 0 \&\\$* . hy .. . . .\" -------------------------------------------------------------------- . . . .\" -------------------------------------------------------------------- .SH SYNOPSIS .\" -------------------------------------------------------------------- . .SY pdfroff .OP \-abcegilpstzCEGNRSUVXZ .OP \-d cs .OP \-f fam .OP \-F dir .OP \-I dir .OP \-L arg .OP \-m name .OP \-M dir .OP \-n num .OP \-o list .OP \-P arg .OP \-r cn .OP \-T dev .OP \-w name .OP \-W name .OP \-\-emit\-ps .OP \-\-no\-toc\-relocation .OP \-\-no-kill\-null\-pages .OP \-\-stylesheet=\fIname\fP .OP \-\-no\-pdf\-output .OP \-\-pdf\-output=\fIname\fP .OP \-\-no\-reference\-dictionary .OP \-\-reference\-dictionary=\fIname\fP .OP \-\-report\-progress .OP \-\-keep\-temporary\-files .I file .\|.\|. . .SY pdfroff .B \-h | .B \-\-help . .SY pdfroff .B \-v | .B \-\-version .RI [ option\ .\|.\|. ] .YS . . .\" -------------------------------------------------------------------- .SH DESCRIPTION .\" -------------------------------------------------------------------- . .B pdfroff is a wrapper program for the GNU text processing system, .BR groff . . It transparently handles the mechanics of multiple pass .B groff processing, when applied to suitably marked up .B groff source files, such that tables of contents and body text are formatted separately, and are subsequently combined in the correct order, for final publication as a single PDF document. . A further optional \*(lqstyle sheet\*(rq capability is provided; this allows for the definition of content which is required to precede the table of contents, in the published document. . .P For each invocation of .BR pdfroff , the ultimate .B groff output stream is post-processed by the GhostScript interpreter, to produce a finished PDF document. . .P .B pdfroff makes no assumptions about, and imposes no restrictions on, the use of any .B groff macro packages which the user may choose to employ, in order to achieve a desired document format; however, it .I does include specific built in support for the .B pdfmark macro package, should the user choose to employ it. . Specifically, if the .I pdfhref macro, defined in the .B pdfmark.tmac package, is used to define public reference marks, or dynamic links to such reference marks, then .B pdfroff performs as many preformatting .B groff passes as required, up to a maximum limit of .IR four , in order to compile a document reference dictionary, to resolve references, and to expand the dynamically defined content of links. . . .\" -------------------------------------------------------------------- .SH USAGE .\" -------------------------------------------------------------------- . The command line is parsed in accordance with normal GNU conventions, but with one exception \(em when specifying any short form option (i.e., a single character option introduced by a single hyphen), and if that option expects an argument, then it .I must be specified independently (i.e., it may .I not be appended to any group of other single character short form options). . . .P Long form option names (i.e., those introduced by a double hyphen) may be abbreviated to their minimum length unambiguous initial substring. . . .P Otherwise, .B pdfroff usage closely mirrors that of .B groff itself. . Indeed, with the exception of the .BR \-h , .BR \-v , and .BI \-T \ dev short form options, and all long form options, which are parsed internally by .BR pdfroff , all options and file name arguments specified on the command line are passed on to .BR groff , to control the formatting of the PDF document. . Consequently, .B pdfroff accepts all options and arguments, as specified in .BR groff (@MAN1EXT@), which may also be considered as the definitive reference for all standard .BR pdfroff options and argument usage. . . .\" -------------------------------------------------------------------- .SH OPTIONS .\" -------------------------------------------------------------------- . .B pdfroff accepts all of the short form options (i.e., those introduced by a single hyphen), which are available with .B groff itself. . In most cases, these are simply passed transparently to .BR groff ; the following, however, are handled specially by .BR pdfroff . . .TP .B \-h Same as .BR \-\-help ; see below. . .TP .B \-i Process standard input, after all other specified input files. . This is passed transparently to .BR groff , but, if grouped with other options, it .I must be the first in the group. . Hiding it within a group breaks standard input processing, in the multiple pass .B groff processing context of .BR pdfroff . . .TP .BI \-T \ dev Only .B \-T\ ps is supported by .BR pdfroff . . Attempting to specify any other device causes .B pdfroff to abort. . .TP .B \-v Same as .BR \-\-version ; see below. . . .P See .BR groff (@MAN1EXT@) for a description of all other short form options, which are transparently passed through .BR pdfroff to .BR groff . . . .P All long form options (i.e., those introduced by a double hyphen) are interpreted locally by .BR pdfroff ; they are .B not passed on to .BR groff , unless otherwise stated below. . .TP .B \-\-help Causes .B pdfroff to display a summary of the its usage syntax, and supported options, and then exit. . .TP .B \-\-emit\-ps Suppresses the final output conversion step, causing .B pdfroff to emit PostScript output instead of PDF. . This may be useful, to capture intermediate PostScript output, when using a specialised postprocessor, such as .I gpresent for example, in place of the default .I GhostScript PDF writer. . .TP .B \-\-keep\-temporary\-files Suppresses the deletion of temporary files, which normally occurs after .B pdfroff has completed PDF document formatting; this may be useful, when debugging formatting problems. . .IP See section .BR FILES , for a description of the temporary files used by .BR pdfroff . . .TP .B \-\-no\-pdf\-output May be used with the .BI \%\-\-reference\-dictionary= name option (described below) to eliminate the overhead of PDF formatting, when running .B pdfroff to create a reference dictionary, for use in a different document. . .TP .B \-\-no\-reference\-dictionary May be used to eliminate the overhead of creating a reference dictionary, when it is known that the target PDF document contains no public references, created by the .I pdfhref macro. . .TP .B \-\-no\-toc\-relocation May be used to eliminate the extra .B groff processing pass, which is required to generate a table of contents, and relocate it to the start of the PDF document, when processing any document which lacks an automatically generated table of contents. . .TP .B \-\-no\-kill\-null\-pages While preparing for simulation of the manual collation step, which is traditionally required to relocate of a .I "table of contents" to the start of a document, .B pdfroff accumulates a number of empty page descriptions into the intermediate .I PostScript output stream. During the final collation step, these empty pages are normally discarded from the finished document; this option forces .B pdfroff to leave them in place. . .TP .BI \-\-pdf\-output= name Specifies the name to be used for the resultant PDF document; if unspecified, the PDF output is written to standard output. A future version of .B pdfroff may use this option, to encode the document name in a generated reference dictionary. . .TP .BI \-\-reference\-dictionary= name Specifies the name to be used for the generated reference dictionary file; if unspecified, the reference dictionary is created in a temporary file, which is deleted when .B pdfroff completes processing of the current document. . This option .I must be specified, if it is desired to save the reference dictionary, for use in references placed in other PDF documents. . .TP .B \-\-report\-progress Causes .B pdfroff to display an informational message on standard error, at the start of each .B groff processing pass. . .TP .BI \-\-stylesheet= name Specifies the name of an .IR "input file" , to be used as a style sheet for formatting of content, which is to be placed .I before the table of contents, in the formatted PDF document. . .TP .B \-\-version Causes .B pdfroff to display a version identification message. . The entire command line is then passed transparently to .BR groff , in a .I one pass operation .IR only , in order to display the associated .B groff version information, before exiting. . . .\" -------------------------------------------------------------------- .SH ENVIRONMENT .\" -------------------------------------------------------------------- . The following environment variables may be set, and exported, to modify the behaviour of .BR pdfroff . . .TP .B PDFROFF_COLLATE Specifies the program to be used for collation of the finished PDF document. . .IP This collation step may be required to move .I tables of contents to the start of the finished PDF document, when formatting with traditional macro packages, which print them at the end. . However, users should not normally need to specify .BR \%PDFROFF_COLLATE , (and indeed, are not encouraged to do so). If unspecified, .B pdfroff uses .BR sed (@MAN1EXT@) by default, which normally suffices. . .IP If .B \%PDFROFF_COLLATE .I is specified, then it must act as a filter, accepting a list of file name arguments, and write its output to the .I stdout stream, whence it is piped to the .BR \%PDFROFF_POSTPROCESSOR_COMMAND , to produce the finished PDF output. . .IP When specifying .BR \%PDFROFF_COLLATE , it is normally necessary to also specify .BR \%PDFROFF_KILL_NULL_PAGES . . .IP .B \%PDFROFF_COLLATE is ignored, if .B pdfroff is invoked with the .I \%\-\-no\-kill\-null\-pages option. . .TP .B PDFROFF_KILL_NULL_PAGES Specifies options to be passed to the .B \%PDFROFF_COLLATE program. . .IP It should not normally be necessary to specify .BR \%PDFROFF_KILL_NULL_PAGES . . The internal default is a .BR sed (@MAN1EXT@) script, which is intended to remove completely blank pages from the collated output stream, and which should be appropriate in most applications of .BR pdfroff . . However, if any alternative to .BR sed (@MAN1EXT@) is specified for .BR \%PDFROFF_COLLATE , then it is likely that a corresponding alternative specification for .B \%PDFROFF_KILL_NULL_PAGES is required. . .IP As in the case of .BR \%PDFROFF_COLLATE , .B \%PDFROFF_KILL_NULL_PAGES is ignored, if .B pdfroff is invoked with the .I \%\-\-no\-kill\-null\-pages option. . .TP .B PDFROFF_POSTPROCESSOR_COMMAND Specifies the command to be used for the final document conversion from PostScript intermediate output to PDF. . It must behave as a filter, writing its output to the .I stdout stream, and must accept an arbitrary number of .I files .\|.\|.\& arguments, with the special case of .I \- representing the .I stdin stream. . .IP If unspecified, .B \%PDFROFF_POSTPROCESSOR_COMMAND defaults to . .RS 2 .IP .I .ad l .NH gs \-dBATCH \-dQUIET \-dNOPAUSE \-dSAFER \-sDEVICE=pdfwrite \-sOutputFile=\- .ad .RE . .TP .B GROFF_TMPDIR Identifies the directory in which .B pdfroff should create temporary files. . If .B \%GROFF_TMPDIR is .I not specified, then the variables .BR TMPDIR , .B TMP and .B TEMP are considered in turn, as possible temporary file repositories. If none of these are set, then temporary files are created in the current directory. . .TP .B GROFF_GHOSTSCRIPT_INTERPRETER Specifies the program to be invoked, when .B pdfroff converts .B groff PostScript output to PDF. . If .B \%PDFROFF_POSTPROCESSOR_COMMAND is specified, then the command name it specifies is .I implicitly assigned to .BR \%GROFF_GHOSTSCRIPT_INTERPRETER , overriding any explicit setting specified in the environment. . If .B \%GROFF_GHOSTSCRIPT_INTERPRETER is not specified, then .B pdfroff searches the process .BR PATH , looking for a program with any of the well known names for the GhostScript interpreter; if no GhostScript interpreter can be found, .B pdfroff aborts. . .TP .B GROFF_AWK_INTERPRETER Specifies the program to be invoked, when .B pdfroff is extracting reference dictionary entries from a .B groff intermediate message stream. . If .B \%GROFF_AWK_INTERPRETER is not specified, then .B pdfroff searches the process .BR PATH , looking for any of the preferred programs, \[oq]gawk\[cq], \[oq]mawk\[cq], \[oq]nawk\[cq], and \[ok]awk\[cq], in this order; if none of these are found, .B pdfroff issues a warning message, and continue processing; however, in this case, no reference dictionary is created. . .TP .B OSTYPE Typically defined automatically by the operating system, .B OSTYPE is used on Microsoft Win32/MS-DOS platforms .IR only , to infer the default .B \%PATH_SEPARATOR character, which is used when parsing the process .B PATH to search for external helper programs. . .TP .B PATH_SEPARATOR If set, .B \%PATH_SEPARATOR overrides the default separator character, (\[oq]:\[cq] on POSIX/UNIX systems, inferred from .B OSTYPE on Microsoft Win32/MS-DOS), which is used when parsing the process .B PATH to search for external helper programs. . .TP .B SHOW_PROGRESS If this is set to a non-empty value, then .B pdfroff always behaves as if the .B \%\-\-report\-progress option is specified, on the command line. . . .\" -------------------------------------------------------------------- .SH FILES .\" -------------------------------------------------------------------- . Input and output files for .B pdfroff may be named according to any convention of the user\[aq]s choice. Typically, input files may be named according to the choice of the principal formatting macro package, e.g., .IB file .ms might be an input file for formatting using the .B ms macros .RB ( s.tmac ); normally, the final output file should be named .IB file .pdf\c \&. . . .P Temporary files, created by .BR pdfroff , are placed in the file system hierarchy, in or below the directory specified by environment variables (see section .BR ENVIRONMENT ). . If .BR mktemp (@MAN1EXT@) is available, it is invoked to create a private subdirectory of the nominated temporary files directory, (with subdirectory name derived from the template .BR pdfroff-XXXXXXXXXX ); if this subdirectory is successfully created, the temporary files will be placed within it, otherwise they will be placed directly in the directory nominated in the environment. .P All temporary files themselves are named according to the convention .BI pdf $$ .*\c \&, where .I $$ is the standard shell variable representing the process ID of the .B pdfroff process itself, and .I * represents any of the extensions used by .B pdfroff to identify the following temporary and intermediate files. . .TP .BI pdf $$ .tmp A scratch pad file, used to capture reference data emitted by .BR groff , during the .I reference dictionary compilation phase. . .TP .BI pdf $$ .ref The .IR "reference dictionary" , as compiled in the last but one pass of the .I reference dictionary compilation phase; (at the start of the first pass, this file is created empty; in successive passes, it contains the .I reference dictionary entries, as collected in the preceding pass). . .IP If the .BR \%\-\-reference\-dictionary =\c .I name option is specified, this intermediate file becomes permanent, and is named .IR name , rather than .BI pdf $$ .ref\c \&. . .TP .BI pdf $$ .cmp Used to collect .I reference dictionary entries during the active pass of the .I reference dictionary compilation phase. . At the end of any pass, when the content of .BI pdf $$ .cmp compares as identical to .BI pdf $$ .ref\c \&, (or the corresponding file named by the .BR \%\-\-reference\-dictionary =\c .I name option), then .I reference dictionary compilation is terminated, and the .I document reference map is appended to this intermediate file, for inclusion in the final formatting passes. . .TP .BI pdf $$ .tc An intermediate .I PostScript file, in which \*[lq]Table of Contents\*[rq] entries are collected, to facilitate relocation before the body text, on ultimate output to the .I GhostScript postprocessor. . .TP .BI pdf $$ .ps An intermediate .I PostScript file, in which the body text is collected prior to ultimate output to the .I GhostScript postprocessor, in the proper sequence, .I after .BI pdf $$ .tc\c \&. . . .\" -------------------------------------------------------------------- .SH SEE ALSO .\" -------------------------------------------------------------------- . See .BR groff (@MAN1EXT@) for the definitive reference to document formatting with .BR groff . . Since .B pdfroff provides a superset of all .B groff capabilities, .BR groff (@MAN1EXT@) may also be considered to be the definitive reference to all .I standard capabilities of .BR pdfroff , with this document providing the reference to .BR pdfroff \[aq]s extended features. . . .P While .B pdfroff imposes neither any restriction on, nor any requirement for, the use of any specific .B groff macro package, a number of supplied macro packages, and in particular those associated with the package .BR pdfmark.tmac , are best suited for use with .BR pdfroff as the preferred formatter. . Detailed documentation on the use of these packages may be found, in PDF format, in the reference guide .BR "\*(lqPortable Document Format Publishing with GNU Troff\*(rq" , included in the installed documentation set as .BR \%@PDFDOCDIR@/pdfmark.pdf . . . .\" -------------------------------------------------------------------- .SH COPYING .\" -------------------------------------------------------------------- .co .\" -------------------------------------------------------------------- .SH AUTHORS .\" -------------------------------------------------------------------- .au . . .\" -------------------------------------------------------------------- .\" EOF / vim: ft=groff / -*- nroff -*- groff-1.22.3/contrib/pdfmark/PaxHeaders.22577/cover.ms0000644000000000000000000000013212426110213020440 xustar000000000000000030 mtime=1415090315.493520646 30 atime=1415090315.493520646 30 ctime=1415090315.493520646 groff-1.22.3/contrib/pdfmark/cover.ms0000644000175000001440000000171212426110213017277 0ustar00wlusers00000000000000.\" -*- nroff -*- .\" Copyright (C) 2004-2014 Free Software Foundation, Inc. .\" .\" Copying and distribution of this file, with or without modification, .\" are permitted in any medium without royalty provided the copyright .\" notice and this notice are preserved. .\" .de CS .if !rCO .nr CO 0 .if !rTL .nr TL 0 .\".nr PO*SAVED \\n[PO] .nr LL*SAVED \\n[LL] .nr HM*SAVED \\n[HM] .nr HM 0 .nr PO (2.1c+\\n[CO]u) .nr LL 17.1c \& .nr PS*SAVED \\n[PS] .nr VS*SAVED \\n[VS] .nr PS 24 .nr VS 30 .CD .fam T .sp |(5.9c+\\n[TL]u) .als AU au@first .. .de au@first .sp 1.5v .als AU au@next .AU \\$@ .. .de au@next .DE .nr PS 18 .nr VS 18 .CD .sp 0.5v \\$* .. .de AI \H'-4z'\\$*\H'0' .. .de CE .DE .sp |17.5c .PSPIC gnu.eps .nr PS 19 .CD .fam H .tkf HR 10z 2p 20z 4p \H'-4z'A GNU MANUAL\H'0' .DE .\".nr PO \\n[PO*SAVED] .nr LL \\n[LL*SAVED] .nr PS \\n[PS*SAVED] .nr VS \\n[VS*SAVED] .nr HM \\n[HM*SAVED] .\".rr PO*SAVED .rr LL*SAVED .rr PS*SAVED .rr VS*SAVED .rr HM*SAVED .fam .. groff-1.22.3/contrib/pdfmark/PaxHeaders.22577/README0000644000000000000000000000013212426110213017641 xustar000000000000000030 mtime=1415090315.494520634 30 atime=1415090315.494520634 30 ctime=1415090315.494520634 groff-1.22.3/contrib/pdfmark/README0000644000175000001440000000440612426110213016503 0ustar00wlusers00000000000000 -*- text -*- Copyright (C) 2004-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. README for pdfmark.tmac ======================= Copyright (C) 2004, 2009 Free Software Foundation Inc. Contributed by Keith Marshall (keith.d.marshall@ntlworld.com) This is free software. See file COPYING, for copying permissions, and warranty disclaimer. This is a preview release of a proposed pdfmark.tmac macro package, for use with GNU troff (groff). It is not yet complete, and should be considered as an alpha release; there are a few problems to be resolved (see file PROBLEMS). Partial documentation is provided, in groff-ms format. To convert this to PDF format, you will require a working groff installation, a working ghostscript installation, with the gs command in your PATH, and a GNU-compatible make. The tarball should be unpacked in the top directory of your groff source tree, then: cd /contrib/pdfmark make pdfmark where is the top directory of your current groff source tree. Included in this package, are: pdfmark.tmac -- the core pdfmark macro set spdf.tmac -- a rudimentary set of bindings for ms macros pdfmark.ms -- preliminary documentation cover.ms -- a template for the documentation cover sheet gnu.eps -- the groff logo, copied from the groff distribution Makefile -- makefile, for formatting the documentation README -- this file PROBLEMS -- a list of known problems TODO -- a list of planned features, not yet implemented To make the pdfmark macros generally usable, copy pdfmark.tmac to the 'site-tmac' directory appropriate to your groff installation; (ms users may also wish to copy spdf.tmac). The macros may then be accessed, by including the '-mpdfmark' option on the groff command line; (for ms users, '-mspdf' is equivalent to '-ms -mpdfmark', with some extra macros 'thrown in'). Comments, and bug reports are welcomed. Please post to the groff mailing list, groff@gnu.org; (you must be subscribed to this list to post mails). To subscribe, visit http://lists.gnu.org/mailman/listinfo/groff groff-1.22.3/contrib/pdfmark/PaxHeaders.22577/PROBLEMS0000644000000000000000000000013212426110213020127 xustar000000000000000030 mtime=1415090315.493520646 30 atime=1415090315.493520646 30 ctime=1415090315.493520646 groff-1.22.3/contrib/pdfmark/PROBLEMS0000644000175000001440000000170612426110213016771 0ustar00wlusers00000000000000 -*- text -*- Copyright (C) 2004-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Known PROBLEMS in pdfmark.tmac ============================== Bounding boxes for link hot-spots which straddle a page break are not computed correctly. *** Resolved: 06-Dec-2004 (KDM): pdfmark.tmac.patch-20041206 *** -------- Documents including a large number of cross references may fail, with an 'input stack limit exceeded' error. *** Resolved: 27-Sep-2004 (KDM): pdfmark.tmac.patch-20040927 *** -------- Links placed in diversions, such as footnotes or floating keeps, resolve to the wrong destinations; (mapping order becomes confused between links in diversion, and links in running text following the diversion). -------- Annotations placed by .pdfnote cannot exceed about 200 chars. groff-1.22.3/contrib/pdfmark/PaxHeaders.22577/pdfmark.tmac0000644000000000000000000000013212426110213021253 xustar000000000000000030 mtime=1415090315.493520646 30 atime=1415090315.493520646 30 ctime=1415090315.493520646 groff-1.22.3/contrib/pdfmark/pdfmark.tmac0000644000175000001440000021150512426110213020115 0ustar00wlusers00000000000000.\" -*- nroff -*- .ig pdfmark.tmac Copyright (C) 2004-2014 Free Software Foundation, Inc. Written by Keith Marshall (keith.d.marshall@ntlworld.com) This file is part of groff. groff is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. groff is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Author's Note ============= While I have written this macro package from scratch, much of my inspiration has come from discussion on the groff mailing list (mailto:groff@gnu.org). I am particularly indebted to: Kees Zeelenberg, for an earlier macro package he posted, a study of which helped me to get started. Carlos J. G. Duarte and Werner Lemberg, whose discussion on computation of the bounding boxes for link "hot-spots" forms the basis of such computations in this package. .. .if !\n(.g .ab These pdfmark macros require groff. .\" .\" Check if we have already been loaded -- do not reload .if d pdfmark .nx .\" .\" ====================================================================== .\" Module PDFMARK: Insert Arbitrary PDFMARK Code in the Postscript Stream .\" ====================================================================== .\" .\" PDFMARK output may be disabled, by zeroing the PDFOPMODE register, .\" ( which mimics a more generic OPMODE, if it is defined ). .\" .if rOPMODE .aln PDFOPMODE OPMODE .\" .\" but if OPMODE wasn't defined, .\" then make the default PDFMARK mode ENABLED. .\" .if !rPDFOPMODE .nr PDFOPMODE 1 .\" .\" PDFMARK output must be constrained to a maximum line length limit, .\" for strict compliance with the Postscript DSC. This limit is defined .\" in register "PDFMARK.FOLDWIDTH.MAX". This is user definable, up to a .\" ceiling value of 255, which is also its default value; this limit .\" is enforced for each PDFMARK, by macro "pdf*pdfmark.limit". .\" .de pdf*pdfmark.limit .\" ---------------------------------------------------------------- .\" Usage: .\" .pdf*pdfmark.limit REGISTER-NAME DEFAULT-MAXIMUM-VALUE .\" ---------------------------------------------------------------- .\" .\" If a register named REGISTER-NAME has not been defined, then .\" define it now, with default value = DEFAULT-MAXIMUM-VALUE. .\" .if !r\\$1 .nr \\$1 \\$2 .\" .\" But when it has already been defined, ensure that its value does .\" not exceed DEFAULT-MAXIMUM-VALUE; if value does exceed this ceiling, .\" then redefine it, to enforce the limit. .\" .if (\\n[\\$1] > \\$2) .nr \\$1 \\$2 .. .\" The "pdfmark" macro is responsible for emitting the appropriate .\" Postscript code. .\" .de pdfmark .\" ---------------------------------------------------------------- .\" Usage: .\" .pdfmark text of pdfmark instruction .\" Macro supplies the required opening "[" and closing "pdfmark" .\" operator; DO NOT include them in the instruction text! .\" ---------------------------------------------------------------- .\" .if \\n[PDFOPMODE] \{\ .\" .\" Strict DSC compliance forbids emission of ps:exec lines which .\" exceed 255 characters in length. We will allow the user to specify .\" an alternative lesser limit ... .\" . pdf*pdfmark.limit PDFMARK.FOLDWIDTH.MAX 255 .\" .\" ... and we will also support a second lesser limit, which will be .\" applied to literal text parenthetically embedded within the PDFMARK. .\" . pdf*pdfmark.limit PDFMARK.FOLDWIDTH \\n[PDFMARK.FOLDWIDTH.MAX] .\" .\" We will push out the entire PDFMARK in one chunk, provided it fits .\" within this limit. .\" . length pdf:length "[\\$* pdfmark\" . ie !(\\n[pdf:length] > \\n[PDFMARK.FOLDWIDTH]) \{\ . \" . \" This PDFMARK is suitable for single chunk output ... . \" . nop \!x X ps:exec [\\$* pdfmark . \} . el \{\ . \" ... but, when the limit would be violated, then we must . \" recompose the specified PDFMARK, spreading it over as many . \" continuation lines as are necessary. . \" . als pdf*compose pdf*compose.first . while \\n(.$ \{\ . pdf*compose \\$1 . shift . \} . \" . \" Complete the PDFMARK recomposition, by appending a . \" "pdfmark" operator, and push it out to the intermediate . \" output stream, (excluding its final line break). . \" . pdf*compose pdfmark . pdf*pdfmark.dispatch . \" . \" And clean up when done. . \" . rm pdf*compose pdf*pdfmark.post . rm pdf:compose.test pdf:composed.literal . \} . rr pdf:length . \} .. .\" When a PDFMARK exceeds the specified output record length limit, .\" then we decompose it, subsequently using the dynamically overloaded .\" macro, "pdf*compose", to reassemble it into as many continuation .\" records as it may require. .\" .\" Each call to "pdf*compose" uses macro "pdf*length.increment" to .\" keep track of the current output record length, so ensuring that .\" the active maximum length limit is not violated. .\" .de pdf*length.increment .\" ---------------------------------------------------------------- .\" Usage: .\" .pdf*length.increment NEXT-ADDITION .\" ---------------------------------------------------------------- .\" .ie d pdf:composed.line \ . length pdf:length "\\*[pdf:composed.line] \\$*\" .el .length pdf:length "\\$*\" .. .\" The first call to "pdf*compose" for each PDFMARK is directed .\" to "pdf*compose.first"; this initialises the local strings .\" and macros used to compose the eventual PDFMARK output. .\" .de pdf*compose.first .\" ---------------------------------------------------------------- .\" Usage: .\" .als pdf*compose pdf*compose.first .\" . pdf*compose TOKEN .\" ---------------------------------------------------------------- .\" .\" Ensure that the output record accumulator will be initialised .\" on posting of the first composed PDFMARK record. .\" .als pdf*pdfmark.post pdf*pdfmark.post.first .\" .\" The first token passed to "pdf*compose" should not be a .\" literal, but be prepared to handle one, just in case. .\" .ds pdf:compose.test \\$1 .substring pdf:compose.test 0 0 .ie '('\\*[pdf:compose.test]' \{\ .\" .\" We found a literal, even though we didn't expect it; .\" if it's a single element literal, we can just handle it .\" as if it is a regular token anyway. .\" . ds pdf:compose.test "\\$\\n(.$\" . substring pdf:compose.test -1 . if !')'\\*[pdf:compose.test]' \{\ . \" . \" But when it is the first of a literal sequence, . \" then we need to set up "pdf*compose" to handle it. . \" . ds pdf:composed.literal "[\\$*\" . als pdf*compose pdf*compose.literal . \} . \} .el .ds pdf:compose.test ) .if ')'\\*[pdf:compose.test]' \{\ .\" .\" In the normal case, we start each new PDFMARK with a .\" regular token; save it as the first in the composed output .\" line sequence, and set up "pdf*compose" to collect .\" the rest of the sequence. .\" . ds pdf:composed.line "[\\$*\" . als pdf*compose pdf*compose.next . \} .. .\" Subsequent calls to "pdf*compose", while collecting .\" regular tokens, are then directed to "pdf*compose.next". .\" .de pdf*compose.next .\" ---------------------------------------------------------------- .\" Usage: .\" .als pdf*compose pdf*compose.next .\" . pdf*compose TOKEN .\" ---------------------------------------------------------------- .\" .\" This first checks to ensure that the supplied token really is .\" a regular token, and not the first element in a literal. .\" .ds pdf:compose.test \\$1 .substring pdf:compose.test 0 0 .ie '('\\*[pdf:compose.test]' \{\ .\" .\" The supplied token represents the first element of a literal, .\" but it may be a single element literal, which we simply handle .\" as a regular token anyway. .\" . ds pdf:compose.test "\\$\\n(.$\" . substring pdf:compose.test -1 . if !')'\\*[pdf:compose.test]' \{\ . \" . \" The supplied token is the first of a sequence of elements . \" which collectively define a literal, so start collecting a . \" composite literal token, and change the "pdf*compose" . \" state, to collect and append the remaining elements. . \" . ds pdf:composed.literal "\\$*\" . als pdf*compose pdf*compose.literal . \} . \} .el .ds pdf:compose.test ) .if ')'\\*[pdf:compose.test]' \{\ .\" .\" The supplied token IS a regular token; add it, but ensure that .\" the active maximum record length limit is honoured. .\" . pdf*length.increment "\\$*\" . ie (\\n[pdf:length] > \\n[PDFMARK.FOLDWIDTH.MAX]) \{\ . \" . \" Adding this token would cause the current PDFMARK record, in . \" groff's intermediate output file, to overflow the active record . \" length limit, so post the current record and start another. . \" . pdf*pdfmark.dispatch . ds pdf:composed.line "\\$*\" . \} . el \{\ . \" . \" This token will fit in the current PDFMARK record, without . \" violating the active length limit, so simply add it. . \" . ie d pdf:composed.line .as pdf:composed.line " \\$*\" . el .ds pdf:composed.line "\\$*\" . \} . \} .. .\" While assembling a multiple token literal sequence into a single .\" literal token, successive calls to "pdf*compose" are directed .\" to "pdf*compose.literal". .\" .de pdf*compose.literal .\" ---------------------------------------------------------------- .\" Usage: .\" .als pdf*compose pdf*compose.literal .\" . pdf*compose TOKEN .\" ---------------------------------------------------------------- .\" .\" First, check to ensure that the current token can be appended to .\" the accumulated literal, without extending it beyond the maximum .\" allowed literal token length. .\" .length pdf:length "\\*[pdf:composed.literal] \\$*\" .ie (\\n[pdf:length] > (\\n[PDFMARK.FOLDWIDTH] - 2)) \{\ .\" .\" If it has grown too long, then it must be folded across two .\" physical PDFMARK output records, so check if we can accommodate .\" the portion collected so far within the current output record. .\" . pdf*length.increment "\\*[pdf:composed.literal]\" . if (\\n[pdf:length] > (\\n[PDFMARK.FOLDWIDTH.MAX] - 2)) \{\ . \" . \" The current output record CAN'T accommodate the currently . \" composed portion of the literal, so flush out the current . \" record, to make way for the accumulated literal, and mark . \" the dispatch mode as "wrapped", for the fragments of the . \" folded literal string, which are to follow. . \" . pdf*pdfmark.dispatch . ds pdf*pdfmark.dispatch.wrapped . \} . ie d pdf:composed.line \{\ . \" . \" If we DIDN'T need to flush the current output record, . \" then we can simply append the accumulated literal to it... . \" . as pdf:composed.line " \\*[pdf:composed.literal]\" . \} . el \{\ . \" . \" otherwise, when the current record has been flushed, or is . \" empty, then we promote the accumulated literal, to make it . \" the next output record... . \" . rn pdf:composed.literal pdf:composed.line . \} .\" .\" Now, to complete the fold, flush out any accumulated partial .\" output record, and continue accumulating the literal, starting .\" with the current token. .\" . pdf*pdfmark.dispatch . ds pdf:composed.literal "\\$*\" . \} .el \{\ .\" .\" Alternatively, when we HAVEN'T identified a need to fold the .\" current output record, then we simply append the current token .\" to the accumulated literal token buffer string. .\" . as pdf:composed.literal " \\$*\" . \} .\" .\" Having ensured that we have sufficient space, in which to .\" append the current token to the currently accumulated literal, .\" we check its rightmost character, to see if is the closing .\" parenthesis, which completes the literal. .\" .ds pdf:compose.test \\$\\n(.$ .substring pdf:compose.test -1 .if ')'\\*[pdf:compose.test]' \{\ .\" .\" The literal has been completely collected, so we may now append .\" it to the current output record, as a single literal token, but .\" subject to the constraint that it must not extend the output .\" record beyond the maximum permitted length. .\" . pdf*length.increment "\\*[pdf:composed.literal]\" . ie (\\n[pdf:length] > \\n[PDFMARK.FOLDWIDTH.MAX]) \{\ . \" . \" So, when the literal cannot be accommodated within the maximum . \" length constraint, then we flush the current record, and start . \" a new one, with the literal token as its first entry. . \" . pdf*pdfmark.dispatch . rn pdf:composed.literal pdf:composed.line . \} . el \{\ . \" . \" When the literal CAN be accommodated within the maximum length . \" constraint, then ... . \" . ie d pdf:composed.line \{\ . \" . \" When an output record has already been instantiated, we . \" append the literal token to it, and discard the accumulator . \" string, which is no longer required. . \" . as pdf:composed.line " \\*[pdf:composed.literal]\" . rm pdf:composed.literal . \} . el \{\ . \" . \" But when no output record yet exists, then we simply . \" reassign the accumulated literal token, to instantiate a . \" new output record. . \" . rn pdf:composed.literal pdf:composed.line . \} . \} .\" .\" Finally, since we have completed the accumulation of the literal, we .\" revert to the "unwrapped" mode of operation for "pdf*pdfmark.dispatch", .\" and restore the normal "pdf*compose" action, for collection of the next .\" token (if any). .\" . rm pdf*pdfmark.dispatch.wrapped . als pdf*compose pdf*compose.next . \} .. .\" While composing a multiple record PDFMARK, each composed record .\" must be added to the collection, whenever the partially composed .\" output record has been filled; this is handled when necessary, .\" by calling the "pdf*pdfmark.dispatch" macro. .\" .de pdf*pdfmark.dispatch .\" ---------------------------------------------------------------- .\" Usage: .\" .pdf*pdfmark.dispatch .\" ---------------------------------------------------------------- .\" .if d pdf:composed.line \{\ .\" .\" This is simply a wrapper around the overloaded "pdf*pdfmark.post" .\" macro, ensuring that an output record has actually been collected .\" before attempting to post it; it then cleans up after posting, to .\" ensure that each collected record is posted only once. .\" . if d pdf*pdfmark.dispatch.wrapped \{\ . \" . \" When dispatching an excessively long literal string, which . \" must be wrapped over multiple records, this mode is active . \" for all but the closing record; we must escape the newline . \" at the end of each such unclosed literal record. . \" . as pdf:composed.line " \\\\\\\\\" . \} . pdf*pdfmark.post . rm pdf:composed.line . \} .. .\" For each PDFMARK, the first call of "pdf*pdfmark.post" is directed .\" to the "pdf*pdfmark.post.first" macro; this initialises the state .\" of the "pdf:composed" macro, for assembly of a new PDFMARK. .\" .de pdf*pdfmark.post.first . nop \!x X ps:exec \\*[pdf:composed.line] .\" .\" Subsequent calls to "pdf*pdfmark.post" are redirected to the .\" alternative "pdf*pdfmark.post.next" macro, which simply appends .\" additional PDFMARK records to the "pdf:composed" macro. .\" .als pdf*pdfmark.post pdf*pdfmark.post.next .. .de pdf*pdfmark.post.next . nop \!+\\*[pdf:composed.line] .. .\" "pdf*end" is a dummy macro. It is required to mark the end .\" of each individual fragment which is added to "pdf:composed"; .\" other than this, it does nothing. .\" .de pdf*end .. .\" .\" Some supporting macros defer actual pdfmark output until an .\" appropriate time for it to be written; the "pdfsync" macro .\" provides a mechanism for flushing such deferred output; .\" it should be called from an end macro, and at any other time .\" when it may be deemed necessary to flush pdfmark context. .\" .de pdfsync .\" ---------------------------------------------------------------- .\" Usage: .\" .pdfsync buffer ... .\" Arguments indicate which "buffer(s)" to flush: .\" O -> bookmark (outline) cache .\" M -> document metadata diversion .\" If no argument, flush ALL buffers .\" ---------------------------------------------------------------- .\" .ie \\n(.$ \{\ . while \\n(.$ \{\ . if '\\$1'O' .pdf:bm.sync 1 . if '\\$1'M' \{\ . if dpdf:metadata .pdf:metadata . rm pdf:metadata . \} . shift . \} . \} .el .pdfsync O M .. .\" .\" some helper functions ... .\" .\" "pdf:warn" and "pdf:error" write diagnostic messages to stderr .\" .de pdf:warn .\" ---------------------------------------------------------- .\" Usage: .\" .pdf:warn text of message .\" ---------------------------------------------------------- .\" .tm \\n(.F:\\n(.c: macro warning: \\$* .. .de pdf:error .\" ---------------------------------------------------------- .\" Usage: .\" .pdf:error text of message .\" ---------------------------------------------------------- .\" .tm \\n(.F:\\n(.c: macro error: \\$* .. .\" "pdf:pop", assisted by "pdf*pop", allows us to retrieve register, .\" or string values, from a string masquerading as a data queue, .\" or as a stack. .\" .de pdf:pop .\" ---------------------------------------------------------------- .\" Usage: .\" .pdf:pop .\" $1 = nr for numeric register, ds for string .\" $2 = name of register or string to be assigned .\" $3 = name of string, from which data is to be retrieved .\" ---------------------------------------------------------------- .\" .pdf*pop \\$* \\*[\\$3] .. .de pdf*pop .ds pdf:stack \\$3 .\\$1 \\$2 \\$4 .shift 4 .ie \\n(.$ .ds \\*[pdf:stack] \\$* .el .rm \\*[pdf:stack] .rm pdf:stack .. .\" .\" .\" =========================================================== .\" Module PDFINFO: Insert MetaData Entries into a PDF Document .\" =========================================================== .\" .\" N.B. .\" Output from the macros in this module is deferred, until .\" subsequent invocation of .pdfsync, or .pdfexit .\" .\" ."pdfinfo" provides a general purpose form of metadata entry ... .\" it allows arbitrary text to be associated with any specified .\" metadata field name. .\" .de pdfinfo .\" ------------------------------------------------------------------- .\" Usage: .\" .pdfinfo /FieldName field content ... .\" Examples: .\" .pdfinfo /Title A PDF Document .\" .pdfinfo /Author Keith Marshall .\" ------------------------------------------------------------------- .\" .ds pdf:meta.field \\$1 .shift .da pdf:metadata \!.pdfmark \\*[pdf:meta.field] (\\$*) /DOCINFO .di .rm pdf:meta.field .. .\" .\" Macro "pdfview" defines a special form of metadata entry ... .\" it uses the /DOCVIEW pdfmark, to specify the initial (default) view, .\" when the document is opened. .\" .de pdfview .\" ------------------------------------------------------------------- .\" Usage: .\" .pdfview view parameters ... .\" Examples: .\" .pdfview /PageMode /UseOutlines .\" .pdfview /Page 2 /View [/FitH \n(.p u] .\" ------------------------------------------------------------------- .\" .da pdf:metadata \!.pdfmark \\$* /DOCVIEW .di .. .\" .\" .\" ===================================================================== .\" Module PDFNOTE: Insert "Sticky Note" Style Comments in a PDF Document .\" ===================================================================== .\" .\" "PDFNOTE.WIDTH" and "PDFNOTE.HEIGHT" set the preferred size for .\" display of the "sticky note" pane, when opened. Acrobat Reader .\" seems not to honour these -- perhaps GhostScript doesn't encode .\" them correctly! Anyway, let's set some suitable default values, .\" in case the user has a set up which does work as advertised. .\" .nr PDFNOTE.WIDTH 3.5i .nr PDFNOTE.HEIGHT 2.0i .\" .\" "pdf:bbox" defines the expression used to set the size and location .\" of the bounding rectangle for display of notes and link "hot-spots". .\" This is defined, such that a note is placed at troff's current text .\" position on the current page, with its displayed image size defined .\" by the "PDFNOTE.WIDTH" and "PDFNOTE.HEIGHT" registers, while the .\" bounds for a link "hot-spot" are matched to the text region which .\" defines the "hot-spot". .\" .ds pdf:bbox \\n[pdf:llx] u \\n[pdf:lly] u \\n[pdf:urx] u \\n[pdf:ury] u .\" .\" Getting line breaks into the text of a PDFNOTE is tricky -- we need .\" to get a "\n" into the Postscript stream, but three levels of "\" are .\" swallowed, when we invoke "pdfnote". The following definition of "PDFLB", .\" (for LineBreak), is rather ugly, but does allow us to use .\" .\" .pdfnote Some text.\*[PDFLB]Some more text, on a new line. .\" .ds PDFLB \\\\\\\\\\\\\\\\n .\" .de pdfnote .\" ---------------------------------------------------------------------- .\" Usage: .\" .pdfnote [-T "Text for Title"] Text of note ... .\" ---------------------------------------------------------------------- .\" .if \\n[PDFOPMODE] \{\ .\" .\" First, compute the bounding rectangle, .\" for this PDFNOTE instance .\" . mk pdf:ury . nr pdf:llx \\n(.k+\\n(.o+\\n[.in] . nr pdf:lly \\n[pdf:ury]-\\n[PDFNOTE.HEIGHT] . nr pdf:urx \\n[pdf:llx]+\\n[PDFNOTE.WIDTH] . ds pdf:note.instance /Rect [\\*[pdf:bbox]] .\" .\" Parse any specified (recognisable) PDFNOTE options .\" . while dpdf:note\\$1 \{\ . pdf:note\\$1 \\$@ . shift \\n[pdf:note.argc] . \} .\" .\" Emit the note, and clean up .\" . pdfmark \\*[pdf:note.instance] /Contents (\\$*) /ANN . rm pdf:note.instance . rr pdf:note.argc . \} .. .de pdf:note-T .nr pdf:note.argc 2 .as pdf:note.instance " /Title (\\$2) .. .\" .\" .\" ===================================================================== .\" Module PDFBOOKMARK: Add an Outline Reference in the PDF Bookmark Pane .\" ===================================================================== .\" .\" "PDFBOOKMARK.VIEW" controls how the document will be displayed, .\" when the user selects a bookmark. This default setting will fit .\" the page width to the viewing window, with the bookmarked entry .\" located at the top of the viewable area. .\" .ds PDFBOOKMARK.VIEW /FitH \\n[PDFPAGE.Y] u .\" .\" "PDFOUTLINE.FOLDLEVEL" controls how the document outline will be .\" displayed. It is a number, defining the maximum heading level .\" which will be visible, without outline expansion by the user, in .\" the initial view of the document outline. Assuming that no sane .\" document will ever extend to 10,000 levels of nested headings, .\" this initial default value causes outlines to be fully expanded. .\" .nr PDFOUTLINE.FOLDLEVEL 10000 .\" .\" The actual job of creating an outline reference .\" is performed by the "pdfbookmark" macro. .\" .de pdfbookmark .\" ------------------------------------------------------------------ .\" Usage: .\" .pdfbookmark [-T tag] level "Text of Outline Entry" .\" .\" $1 = nesting level for bookmark (1 is top level) .\" $2 = text for bookmark, (in PDF viewer bookmarks list) .\" $3 = suffix for PDF internal bookmark name (optional) .\" ------------------------------------------------------------------ .\" .ie '\\n(.z'' \{\ .\" .\" When we are at the top diversion level, i.e. actually emitting text .\" to the output device stream, then we compute the location of, and .\" plant this bookmark immediately. .\" . if \\n[PDFOPMODE] \{\ . \" . \" Make the bookmark name "untagged" by default, . \" then parse any specified options, to set a "tag", if required . \" . ds pdf:href-T . while dpdf:href.opt\\$1 \{\ . pdf:href.opt\\$1 \\$@ . shift \\n[pdf:href.argc] . \} . rr pdf:href.argc . \" . \" If we found "--" to mark the end of the options, discard it . \" . if '\\$1'--' .shift . \" . \" Synchronise the bookmark cache . \" to the requested bookmark nesting level . \" . pdf:bm.sync \\$1 . shift . \" . \" Increment the bookmark serialisation index . \" in order to generate a uniquely serialised bookmark name, . \" ( which we return in the string "PDFBOOKMARK.NAME" ), . \" and insert this bookmark into the cache . \" . pdf:href.sety . nr pdf:bm.nr +1 . ds PDFBOOKMARK.NAME pdf:bm\\n[pdf:bm.nr]\\*[pdf:href-T] . ds pdf:bm\\n[pdf:bm.nr] /Dest /\\*[PDFBOOKMARK.NAME] . pdfmark \\*[pdf:bm\\n[pdf:bm.nr]] /View [\\*[PDFBOOKMARK.VIEW]] /DEST . as pdf:bm\\n[pdf:bm.nr] " /Title (\\$*) . pdf:href.options.clear . rr PDFPAGE.Y . \} . \} .el \{\ .\" .\" But when we are collecting a diversion which will be written out later, .\" then we must defer bookmark placement, until we emit the diversion. .\" (don't rely on $0 == pdfbookmark here; it may be a volatile alias). .\" . nop \!.pdfbookmark \\$@ . \} .. .\" .\" Macro "pdf:bm.sync" is called for each bookmark created, .\" to establish a cache entry at the appropriate nesting level. .\" It will flush ALL previous cache content, when called to .\" add a new bookmark at level 1, or if simply called at .\" level 1, without adding any bookmark. .\" .de pdf:bm.sync .\" ------------------------------------------------------------------ .\" Usage: .\" .pdf:bm.sync level .\" $1 = nesting level of current bookmark, or 1 to flush cache .\" ------------------------------------------------------------------ .\" .\" First validate the bookmark nesting level .\" adjusting it if required .\" .if \\$1>\\n[pdf:bm.nl] .nr pdf:bm.nl +1 .ie \\$1>\\n[pdf:bm.nl] \{\ . pdf:warn adjusted level \\$1 bookmark; should be <= \\n[pdf:bm.nl] . \} .el .nr pdf:bm.nl \\$1 .if \\n[pdf:bm.nl]<1 \{\ . pdf:warn bad arg (\\$1) in \\$0 \\$1; \\$0 1 forced . nr pdf:bm.nl 1 . \} .\" .\" If reverting from a higher to a lower nesting level, .\" cyclicly adjust cache counts for each pending higher level .\" .if \\n[pdf:bm.lc]>=\\n[pdf:bm.nl] \{\ . nr pdf:bm.lc +1 . if !rpdf:bm.c\\n[pdf:bm.lc].c .nr pdf:bm.c\\n[pdf:bm.lc].c 0 . while \\n[pdf:bm.lc]>\\n[pdf:bm.nl] \{\ . as pdf:bm.c\\n[pdf:bm.lc] " \\n[pdf:bm.c\\n[pdf:bm.lc].c] . rr pdf:bm.c\\n[pdf:bm.lc].c . nr pdf:bm.lc -1 . \} . \} .\" .\" Update the cache level, .\" flushing when we are at level 1 .\" .nr pdf:bm.lc \\n[pdf:bm.nl] .ie \\n[pdf:bm.nl]=1 \{\ . while \\n[pdf:bm.ic]<\\n[pdf:bm.nr] .pdf:bm.emit 0 . rr pdf:bm.rc . \} .el .nr pdf:bm.c\\n[pdf:bm.nl].c +1 .. .\" Macro "pdf:bm.emit" is called, when the cache is at level 1. .\" This flushes ALL pending bookmarks from the cache, i.e. the .\" preceding level 1 bookmark, and any nested dependents, .\" which it may have. .\" .de pdf:bm.emit .\" ------------------------------------------------------------------ .\" Usage: .\" .pdf:bm.emit flag .\" $1 = reference counting flag, used to control recursion .\" ------------------------------------------------------------------ .\" .\" First check for nested dependents, .\" and append the "dependent count" to the bookmark, as required. .\" .nr pdf:bm.ic +1 .nr pdf:bm.lc +1 .pdf:pop nr pdf:bm.rc pdf:bm.c\\n[pdf:bm.lc] .if \\n[pdf:bm.rc] \{\ . ds pdf:bm.fold . if \\n[pdf:bm.lc]>\\n[PDFOUTLINE.FOLDLEVEL] .ds pdf:bm.fold - . as pdf:bm\\n[pdf:bm.ic] " /Count \\*[pdf:bm.fold]\\n[pdf:bm.rc] . rm pdf:bm.fold . \} .pdfmark \\*[pdf:bm\\n[pdf:bm.ic]] /OUT .rm pdf:bm\\n[pdf:bm.ic] .\" .\" For ALL dependents, if any, .\" recursively flush out any higher level dependents, .\" which they themselves may have .\" .while \\n[pdf:bm.rc] \{\ . nr pdf:bm.rc -1 . pdf:bm.emit \\n[pdf:bm.rc] . \} .\" .\" Finally, .\" unwind the recursive call stack, until we return to the top level. .\" .nr pdf:bm.rc \\$1 .nr pdf:bm.lc -1 .. .nr pdf:bm.nr 0 .nr pdf:bm.nl 1 .nr pdf:bm.lc 0 .nr pdf:bm.ic 0 .\" .\" .\" ============================================================= .\" Module PDFHREF: Create Hypertext References in a PDF Document .\" ============================================================= .\" .\" "PDFHREF.VIEW" controls how the document will be displayed, .\" when the user follows a link to a named reference. .\" .ds PDFHREF.VIEW /FitH \\n[PDFPAGE.Y] u .\" .\" This default setting will fit the page width to the viewing .\" window, with the bookmarked entry located close to the top .\" of the viewable area. "PDFHREF.VIEW.LEADING" controls the .\" actual distance below the top of the viewing window, where .\" the reference will be positioned; 5 points is a reasonable .\" default offset. .\" .nr PDFHREF.VIEW.LEADING 5.0p .\" .\" Yuk!!! .\" PDF view co-ordinates are mapped from the bottom left corner, .\" of the page, whereas page printing co-ordinates are mapped .\" conventionally, from top left. .\" .\" Macro "pdf:href.sety" transforms the vertical position of the .\" last printed baseline, from the printing co-ordinate domain to .\" the PDF view domain. .\" .de pdf:href.sety .\" ---------------------------------------------------------------- .\" Usage: .\" .pdf:href.sety .\" ---------------------------------------------------------------- .\" .\" This computation yields the vertical view co-ordinate .\" in groff's basic units; don't forget to append grops' "u" .\" conversion operator, when writing the pdfmark! .\" .nr PDFPAGE.Y \\n(.p-\\n(nl+\\n[PDFHREF.VIEW.LEADING] .. .\" When we create a link "hot-spot" ... .\" "PDFHREF.LEADING" sets the distance above the top of the glyph .\" bounding boxes, in each line of link text, over which the link .\" hot-spot will extend, while "PDFHREF.HEIGHT" sets the hot-spot .\" height, PER LINE of text occupied by the reference. .\" .\" Since most fonts specify some leading space within the bounding .\" boxes of their glyphs, a better appearance may be achieved when .\" NEGATIVE leading is specified for link hot-spots; indeed, when .\" the default 10pt Times font is used, -1.0 point seems to be a .\" reasonable default value for "PDFHREF.LEADING" -- it may be .\" changed, if desired. .\" .\" "PDFHREF.HEIGHT" is initially set as one vertical spacing unit; .\" note that it is defined as a string, so it will adapt to changes .\" in the vertical spacing. Changing it is NOT RECOMMENDED. .\" .nr PDFHREF.LEADING -1.0p .ds PDFHREF.HEIGHT 1.0v .\" .\" PDF readers generally place a rectangular border around link .\" "hot-spots". Within text, this looks rather ugly, so we set .\" "PDFHREF.BORDER" to suppress it -- the three zeroes represent .\" the border parameters in the "/Border [0 0 0]" PDFMARK string, .\" and may be changed to any valid form, as defined in Adobe's .\" PDFMARK Reference Manual. .\" .ds PDFHREF.BORDER 0 0 0 .\" .\" "PDFHREF.COLOUR" (note British spelling) defines the colour to .\" be used for display of link "hot-spots". This will apply both .\" to borders, if used, and, by default to text; however, actual .\" text colour is set by "PDFHREF.TEXT.COLOUR", which may be reset .\" independently of "PDFHREF.COLOUR", to achieve contrasting text .\" and border colours. .\" .\" "PDFHREF.COLOUR" must be set to a sequence of three values, .\" each in the range 0.0 .. 1.0, representing the red, green, and .\" blue components of the colour specification in the RGB colour .\" domain, which is shared by "groff" and the PDF readers. .\" .ds PDFHREF.COLOUR 0.35 0.00 0.60 .defcolor pdf:href.colour rgb \*[PDFHREF.COLOUR] .\" .\" "PDFHREF.TEXT.COLOUR", on the other hand, is simply defined .\" using any "groff" colour name -- this default maps it to the .\" same colour value as "PDFHREF.COLOUR". .\" .ds PDFHREF.TEXT.COLOUR pdf:href.colour .\" .\" Accommodate users who prefer the American spelling, COLOR, to .\" the British spelling, COLOUR. .\" .als PDFHREF.COLOR PDFHREF.COLOUR .als PDFHREF.TEXT.COLOR PDFHREF.TEXT.COLOUR .\" .\" All PDF "Hypertext" reference capabilities are accessed .\" through the "pdfhref" macro .\" .de pdfhref .\" ----------------------------------------------------------------- .\" Usage: .\" .pdfhref ... .\" ----------------------------------------------------------------- .\" .if \\n[PDFOPMODE] \{\ .\" .\" Loop over all subcommands specified in the argument list .\" . while \\n(.$ \{\ . \" . \" Initially, assume each subcommand will complete successfully . \" . nr pdf:href.ok 1 . \" . \" Initialise -E and -X flags in the OFF state . \" . nr pdf:href-E 0 . nr pdf:href-X 0 . \" . \" Handle the case where subcommand is specified as "-class", . \" setting up appropriate macro aliases for subcommand handlers. . \" . if dpdf*href\\$1 .als pdf*href pdf*href\\$1 . if dpdf*href\\$1.link .als pdf*href.link pdf*href\\$1.link . if dpdf*href\\$1.file .als pdf*href.file pdf*href\\$1.file . \" . \" Repeat macro alias setup . \" for the case where the subcommand is specified as "class", . \" (without a leading hyphen) . \" . if dpdf*href-\\$1 .als pdf*href pdf*href-\\$1 . if dpdf*href-\\$1.link .als pdf*href.link pdf*href-\\$1.link . if dpdf*href-\\$1.file .als pdf*href.file pdf*href-\\$1.file . \" . \" Process one subcommand ... . \" . ie dpdf*href \{\ . \" . \" Subcommand "class" is recognised ... . \" discard the "class" code from the argument list, . \" set the initial argument count to swallow all arguments, . \" and invoke the selected subcommand handler. . \" . shift . nr pdf:argc \\n(.$ . pdf*href \\$@ . \" . \" When done, . \" discard all arguments actually consumed by the handler, . \" before proceeding to the next subcommand (if any). . \" . shift \\n[pdf:argc] . \} . el \{\ . \" . \" Subcommand "class" is not recognised ... . \" issue a warning, and discard the entire argument list, . \" so aborting this "pdfhref" invocation . \" . pdf:warn \\$0: undefined reference class '\\$1' ignored . shift \\n(.$ . \} . \" . \" Clean up temporary reference data, . \" to ensure it doesn't propagate to any future reference . \" . rm pdf*href pdf:href.link pdf:href.files . rr pdf:href-E pdf:href-X . pdf:href.options.clear . \} . rr pdf:href.ok . \} .. .\" .\" Macros "pdf:href.flag" and "pdf:href.option" .\" provide a generic mechanism for switching on flag type options, .\" and for decoding options with arguments, respectively .\" .de pdf:href.flag .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .nr pdf:href\\$1 1 .nr pdf:href.argc 1 .. .de pdf:href.option .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .ds pdf:href\\$1 \\$2 .nr pdf:href.argc 2 .. .\" .\" Valid PDFHREF options are simply declared .\" by aliasing option handlers to "pdf:href.option", .\" or to "pdf:href.flag", as appropriate .\" .als pdf:href.opt-A pdf:href.option \" affixed text .als pdf:href.opt-D pdf:href.option \" destination name .als pdf:href.opt-E pdf:href.flag \" echo link descriptor .als pdf:href.opt-F pdf:href.option \" remote file specifier .als pdf:href.opt-N pdf:href.option \" reference name .als pdf:href.opt-P pdf:href.option \" prefixed text .als pdf:href.opt-T pdf:href.option \" bookmark "tag" .als pdf:href.opt-X pdf:href.flag \" cross reference .\" .\" For references to another document file .\" we also need to support OS dependent file name specifiers .\" .als pdf:href.opt-DF pdf:href.option \" /DOSFile specifier .als pdf:href.opt-MF pdf:href.option \" /MacFile specifier .als pdf:href.opt-UF pdf:href.option \" /UnixFile specifier .als pdf:href.opt-WF pdf:href.option \" /WinFile specifier .\" .\" Macro "pdf:href.options.clear" ensures that ALL option .\" argument strings are deleted, after "pdfhref" has completed .\" all processing which depends on them .\" .de pdf:href.options.clear .\" ----------------------------------------------------------------- .\" Usage: .\" .pdf:href.options.clear [option ...] .\" ----------------------------------------------------------------- .\" .\" When an option list is specified ... .\" .ie \\n(.$ \{\ . \" . \" then loop through the list, . \" deleting each specified option argument string in turn . \" . while \\n(.$ \{\ . if dpdf:href-\\$1 .rm pdf:href-\\$1 . shift . \} . \} .\" .\" ... but when no list is specified, .\" then recurse, to clear all known option argument strings .\" .el .pdf:href.options.clear A D F N P T DF MF UF WF .. .\" .\" "PDFHREF.INFO" establishes the content of the cross reference .\" data record, which is exported via the "stderr" stream, when a .\" cross reference anchor is created using a "pdfhref" macro request .\" of the form .\" .\" .pdfhref M -N name -X text ... .\" .\" .ds PDFHREF.INFO \\*[PDFHREF.NAME] reference data ... .\" .ds PDFHREF.INFO page \\n% \\$* .\" .\" Macro "pdf*href-M" is the handler invoked by "pdfhref", when .\" called with the "M" reference class specifier, to create a .\" named cross reference mark, and to emit a cross reference .\" data record, as specified by "PDFHREF.INFO". .\" .de pdf*href-M .\" ----------------------------------------------------------------- .\" Usage: .\" .pdfhref M [-X] [-N name | -D name] [-E] descriptive text ... .\" ----------------------------------------------------------------- .\" .\" Initially, declare the -D and -N string options as empty, .\" so we avoid warning messages when we try to use them, and find .\" that they are undefined. .\" .ds pdf:href-D .ds pdf:href-N .\" .\" Parse, interpret, and strip any specified options from the .\" argument list. (Note that only options with a declared handler .\" will be processed; there is no provision for detecting invalid .\" options -- anything which is not recognised is assumed to start .\" the "descriptive text" component of the argument list). .\" .while dpdf:href.opt\\$1 \{\ . pdf:href.opt\\$1 \\$@ . shift \\n[pdf:href.argc] . \} .\" .\" If we found "--", to mark the end of the options, .\" then we should discard it. .\" .if '\\$1'--' .shift .\" .\" All PDF reference markers MUST be named. The name may have been .\" supplied using the "-N Name" option, (or the "-D Name" option); .\" if not, deduce it from the first "word" in the "descriptive text", .\" if any, and set the marker -- if we still can't identify the name .\" for the destination, then this marker will not be created. .\" .pdf*href.set \\*[pdf:href-N] \\*[pdf:href-D] \\$1 .\" .\" If we specified a cross reference, with the "-X" option, and the .\" reference mark has been successfully created, then we now need to .\" write the cross reference info to the STDERR stream .\" .if \\n[pdf:href-X] .pdf*href.export \\*[PDFHREF.INFO] .\" .\" Irrespective of whether this marker is created, or not, .\" the descriptive text will be copied to the groff output stream, .\" provided the "-E" option was specified .\" .if \\n[pdf:href-E] \&\\$* .. .\" .de pdf*href.set .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .pdf*href.map.init .ie \\n(.$ \{\ . \" . \" a marker name has been supplied ... . \" if we are formatting for immediate output, . \" emit PDFMARK code to establish the associated view . \" . ie '\\n(.z'' \{\ . pdf:href.sety . pdfmark /Dest /\\$1 /View [\\*[PDFHREF.VIEW]] /DEST . ds PDFHREF.NAME \\$1 . rr PDFPAGE.Y . \} . \" . \" but, when formatting a diversion ... . \" delay output of the PDFMARK code, until the diversion . \" is eventually written out . \" . el \!.\\$0 \\$@ . \" . \" check if we also need to emit cross reference data . \" (caller will do this if "pdf:href-X" is set, but it is . \" not necessary, when "pdf:href.map" already exists) . \" . if dpdf:href.map .nr pdf:href-X 0 . \} .el \{\ . \" marker is unnamed ... . \" issue error message; do not emit reference data . \" . pdf:warn pdfhref destination marker must be named . nr pdf:href-X 0 . \} .. .de pdf*href.export .\" .\" Called ONLY by "pdf*href-M", .\" this macro ensures that the emission of exported reference data .\" is synchronised with the placement of the reference mark, .\" especially when the mark is defined within a diversion. .\" .ie '\\n(.z'' .tm gropdf-info:href \\*[PDFHREF.NAME] \\$* .el \!.\\$0 \\$@ .. .\" .\" Macro "pdf*href-D" is invoked when "pdfhref" is called .\" with the "D" reference class specifier; it provides a .\" standardised mechanism for interpreting reference data .\" exported by the "M" reference class, and may be used .\" to directly define external reference data, without the .\" use of "M" reference class designators in the source .\" document. .\" .de pdf*href-D .ds pdf:href-N .\" .\" Parse, interpret, and strip any specified options from the .\" argument list. (Note that only options with a declared handler .\" will be processed; there is no provision for detecting invalid .\" options -- anything which is not recognised is assumed to start .\" the "descriptive text" component of the argument list). .\" .while dpdf:href.opt\\$1 \{\ . pdf:href.opt\\$1 \\$@ . shift \\n[pdf:href.argc] . \} .\" .\" If we found "--", to mark the end of the options, .\" then we should discard it. .\" .if '\\$1'--' .shift .\" .ie '\\*[pdf:href-N]'' \{\ . pdf:warn pdfhref defined reference requires a name . \} .el \{\ . ds pdf:href(\\*[pdf:href-N]).info \\$* . \} .. .\" .\" Macro "pdf*href-F" is invoked when "pdfhref" is called .\" with the "F" reference class specifier; it allows the user .\" to provide an alternative interpreter macro, which will be .\" called when a "PDFHREF.INFO" record is retrieved to define .\" the text of a cross reference link "hot spot". .\" .de pdf*href-F .\" ---------------------------------------------------------------- .\" Usage: .\" .pdfhref F [macro-name] .\" ---------------------------------------------------------------- .\" .\" Set macro specified by "macro-name" as the format interpreter .\" for parsing "PDFHREF.INFO" records; if "macro-name" is omitted, .\" or is specified as the reserved name "default", then use the .\" default format parser, "pdf*href.format", defined below. .\" .if '\\$1'default' .shift \\n(.$ .ie \\n(.$ .als pdf*href.format \\$1 .el .als pdf*href.format pdf*href.default .nr pdf:argc 1 .. .\" The default reference formatting macro is defined below. .\" It parses the "PDFHREF.INFO" record specific to each reference, .\" recognising the keywords "file", "page" and "section", when they .\" appear in initial key/value pairs, replacing the key/value pair .\" with "PDFHREF.FILEREF", "PDFHREF.PAGEREF" or "PDFHREF.SECTREF" .\" respectively; any additional data in the "PDFHREF.INFO" record .\" is enclosed in typographic double quotes, and the parsed record .\" is appended to "PDFHREF.PREFIX", to be returned as the formatted .\" reference text. .\" .\" Default definitions for the reference strings "PDFHREF.PREFIX", .\" "PDFHREF.FILEREF", "PDFHREF.PAGEREF" and "PDFHREF.SECTREF" are .\" provided, in the English language. Users may substitute any .\" desired alternative definitions, for example, when formatting .\" documents in other languages. In each case, "\\$1" may be used .\" in the substitution, to represent the "value" component of the .\" respective key/value pair specified in the "PDFHREF.INFO" record. .\" .ds PDFHREF.PREFIX see .ds PDFHREF.PAGEREF page \\$1, .ds PDFHREF.SECTREF section \\$1, .ds PDFHREF.FILEREF \\$1 .\" .de pdf*href.format .\" ----------------------------------------------------------------- .\" Usage: (to be called ONLY by "pdfhref") .\" .pdf*href.format cross reference data ... .\" ----------------------------------------------------------------- .\" .\" This macro is responsible for defining the strings "PDFHREF.TEXT" .\" and "PDFHREF.DESC", which are used by the "pdfhref" macro, as the .\" basis for generating the text content of a link "hot spot"; (any .\" user specified alternate formatter MUST do likewise). .\" .\" Note that "PDFHREF.TEXT" defines the overall format for the "link .\" text", while "PDFHREF.DESC" is the descriptive component thereof. .\" .\" This default implementation, subject to user customisation of the .\" "internationalisation" strings defined above, formats "hot spots" .\" of the style .\" .\" see page N, section S, "descriptive text ..." .\" .ds PDFHREF.TEXT \\*[PDFHREF.PREFIX] .while d\\$0.\\$1 \{\ . \\$0.\\$1 "\\$2" . shift 2 . \} .\" .\" Retrieve the descriptive text from the cross reference data, .\" ONLY IF no overriding description has been set by the calling .\" "pdfhref" macro invocation. .\" .if \\n(.$ .if !dPDFHREF.DESC .ds PDFHREF.DESC \\$* .\" .\" Augment "PDFHREF.TEXT" so the descriptive text will be included .\" in the text of the formatted reference .\" .if dPDFHREF.DESC .as PDFHREF.TEXT " \(lq\\\\*[PDFHREF.DESC]\(rq .\" .\" Finally, suppress any leading spaces, .\" which may have been included in the PDFHREF.TEXT definition. .\" .ds PDFHREF.TEXT \\*[PDFHREF.TEXT] .. .de pdf*href.format.file .\" ---------------------------------------------------------------------- .\" Include a file identifier in a formatted reference. .\" This is invoked ONLY by "pdf*href.format", and ONLY IF the .\" reference data includes an initial file identifier tuple. .\" ---------------------------------------------------------------------- .\" .as PDFHREF.TEXT " \\*[PDFHREF.FILEREF] .. .de pdf*href.format.page .\" ---------------------------------------------------------------------- .\" Include a page number in a formatted reference. .\" This is invoked ONLY by "pdf*href.format", and ONLY IF the .\" reference data includes an initial page number tuple. .\" ---------------------------------------------------------------------- .\" .as PDFHREF.TEXT " \\*[PDFHREF.PAGEREF] .. .de pdf*href.format.section .\" ---------------------------------------------------------------------- .\" Include a section number in a formatted reference. .\" This is invoked ONLY by "pdf*href.format", and ONLY IF the .\" reference data includes an initial section number tuple. .\" ---------------------------------------------------------------------- .\" .as PDFHREF.TEXT " \\*[PDFHREF.SECTREF] .. .\" .\" Make "pdf*href.format" the default cross reference formatter .\" .als pdf*href.default pdf*href.format .\" .\" .\" Macro "pdf*href" provides a generic mechanism for placing link .\" "hot-spots" in a PDF document. ALL "pdfhref" class macros which .\" create "hot-spots" are aliased to this macro; each must also have .\" an appropriately aliased definition for "pdf*href.template". .\" .de pdf*href .\" ------------------------------------------------------------------ .\" Usage: .\" .pdf*href class [options ...] [link text ...] .\" ------------------------------------------------------------------ .\" .\" First, we initialise an empty string, which will be affixed to .\" the end of the "link text". (This is needed to cancel the effect .\" of a "\c" escape, which is placed at the end of the "link text" .\" to support the "-A" option -- any text supplied by the user, when .\" the "-A" option is specified, will replace this empty string). .\" .ds pdf:href-A .\" .\" Now we interpret, and remove any specified options from the .\" argument list. (Note that only options with a declared handler .\" will be processed; there is no provision for detecting invalid .\" options -- anything which is not recognised is assumed to start .\" the "link text" component of the argument list). .\" .while dpdf:href.opt\\$1 \{\ . pdf:href.opt\\$1 \\$@ . shift \\n[pdf:href.argc] . \} .\" .\" If we found "--", to mark the end of the options, then we should .\" discard it. .\" .if '\\$1'--' .shift .\" .\" All PDF link classes REQUIRE a named destination. This may have .\" been supplied using the "-D Name" option, but, if not, deduce it .\" from the first "word" in the "link text", if any -- if we still .\" can't identify the destination, then set "pdf:href.ok" to zero, .\" so this link will not be created. .\" .if !dpdf:href-D .pdf:href.option -D \\$1 .if '\\*[pdf:href-D]'' \{\ . pdf:error pdfhref has no destination . nr pdf:href.ok 0 . \} .\" .\" Some PDF link classes support a "/File (FilePathName)" argument. .\" .if dpdf*href.file \{\ . \" . \" When this is supported, it may be specified by supplying . \" the "-F FileName" option, which is captured in "pdf:href-F". . \" . if dpdf:href-F \{\ . \" . \" the /File key is present, so set up the link specification . \" to establish the reference to the specified file . \" . als pdf*href.link pdf*href.file . ds pdf:href.files /File (\\*[pdf:href-F]) . \" . \" in addition to the /File key, . \" there may also be platform dependent alternate file names . \" . if dpdf:href-DF .as pdf:href.files " /DOSFile (\\*[pdf:href-DF]) . if dpdf:href-MF .as pdf:href.files " /MacFile (\\*[pdf:href-MF]) . if dpdf:href-UF .as pdf:href.files " /UnixFile (\\*[pdf:href-UF]) . if dpdf:href-WF .as pdf:href.files " /WinFile (\\*[pdf:href-WF]) . \} . \" In some cases, the "/File" key is REQUIRED. . \" We will know it is missing, if "pdf*href.link" is not defined. . \" . if !dpdf*href.link \{\ . \" . \" When a REQUIRED "/File" key specification is not supplied, . \" then complain, and set "pdf:href.ok" to abort the creation . \" of the current reference. . \" . pdf:error pdfhref: required -F specification omitted . nr pdf:href.ok 0 . \} . \" Now, we have no further use for "pdf*href.file". . \" . rm pdf*href.file . \} .\" .\" Now, initialise a string, defining the PDFMARK code sequence .\" to create the reference, using the appropriate type indicators. .\" .ds pdf:href.link /Subtype /Link \\*[pdf*href.link] .\" .\" And now, we have no further use for "pdf*href.link". .\" .rm pdf*href.link .\" .\" If the user specified any "link prefix" text, (using the "-P text" .\" option), then emit it BEFORE processing the "link text" itself. .\" .if dpdf:href-P \&\\*[pdf:href-P]\c .ie \\n[pdf:href.ok] \{\ . \" . \" This link is VALID (so far as we can determine) ... . \" Modify the "link text" argument specification, as required, . \" to include any pre-formatted cross reference information . \" . ie \\n(.$ \{\ . \" . \" One or more "link text" argument(s) are present, . \" so, set the link description from the argument(s) ... . \" . ds PDFHREF.DESC \\\\$* . ie \\n[pdf:href-X] \{\ . \" . \" ... and, when the "-X" flag is set, . \" also include formatted location information, . \" derived from the cross reference record. . \" . pdf*href.format \\*[pdf:href(\\*[pdf:href-D]).info] . \} . el \{\ . \" ... but, when the "-X" flag is NOT set, . \" use only the argument(s) as the entire content . \" of the "link text" . \" . rn PDFHREF.DESC PDFHREF.TEXT . \} . \} . el \{\ . \" No "link text" arguments are present, . \" so, format the cross reference record to define . \" the content of the "link text". . \" . pdf*href.format \\*[pdf:href(\\*[pdf:href-D]).info] . \} . \" Apply border and colour specifications to the PDFMARK string . \" definition, as required. . \" . if dPDFHREF.BORDER .as pdf:href.link " /Border [\\*[PDFHREF.BORDER]] . if dPDFHREF.COLOUR .as pdf:href.link " /Color [\\*[PDFHREF.COLOUR]] . \" . \" Emit the "link text", in its appropriate colour, marking the . \" limits of its bounding box(es), as the before and after output . \" text positions. . \" . pdf*href.mark.begin "\\*[pdf:href.link]" . if dPDFHREF.COLOUR .defcolor pdf:href.colour rgb \\*[PDFHREF.COLOUR] . nop \&\m[\\*[PDFHREF.TEXT.COLOUR]]\\*[PDFHREF.TEXT]\m[]\c . pdf*href.mark.end . \" . \" Clean up the temporary registers and strings, used to . \" compute the "hot-spot" bounds, and format the reference, . \" . rm PDFHREF.DESC PDFHREF.TEXT . \} .\" .\" But when we identify an INVALID link ... .\" We simply emit the "link text", with no colour change, no border, .\" and no associated "hot-spot". .\" .el \&\\$*\c .\" .\" And then, if the user specified any affixed text, (using the .\" "-A text" option), we tack it on at the end. .\" .nop \&\\*[pdf:href-A] .. .de pdf*href.map.init .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .\" .if dpdf:href.map-1 \{\ . \" . \" We have a reference map, but we haven't started to parse it yet. . \" This must be the first map reference in pass 2, so we need to . \" "kick-start" the parsing process, by loading the first indexed . \" sub-map into the global map. . \" . rn pdf:href.map-1 pdf:href.map . als pdf:href.map.internal pdf:href.map . nr pdf:href.map.index 1 1 . \} .als pdf*href.map.init pdf*href.mark.idle .. .\" .\" "pdf*href-Z" is used to add link co-ordinate entries to the .\" "pdf:href.map". Primarily, it is used by the "pdfroff" formatter, .\" to pass link co-ordinate data from one "groff" formatting pass to .\" the next, and is not generally useful to the end user. .\" .de pdf*href-Z .\" ---------------------------------------------------------------------- .\" Usage: .\" .pdfhref Z page-index x-displacement y-displacement .\" Where: .\" page-index is the reference mark's page number .\" x-displacement is its offset from the left edge of the page .\" y-displacement is its offset from the top edge of the page .\" ( both displacement values are expressed in basic groff units, ) .\" ( and measured perpendicular to their respective page edges. ) .\" ---------------------------------------------------------------------- .\" .ie \\n(.$=3 .ds pdf:href.map-\\n+[pdf*href-Z.index] \\$* .el .pdf:error pdfhref Z operator expects exactly three arguments .. .\" Initialise the auto-incrementing "pdf*href-Z.index" register, .\" to ensure that sub-map numbering starts at 1. .\" .nr pdf*href-Z.index 0 1 .\" .de pdf*href.map.read .\" ---------------------------------------------------------------------- .\" Usage: (internal use only): .\" .pdf*href.map.read co-ordinate name list ... .\" ---------------------------------------------------------------------- .\" .\" Reads values from "pdf:href.map" to each named register, in turn .\" Reading to "null" discards the corresponding value in "pdf:href.map" .\" .while \\n(.$ \{\ . \" . \" Loop over all registers named in the argument list, . \" assigning values from "pdf:href.map" to each in turn. . \" . pdf:pop nr pdf:\\$1 pdf:href.map.internal . if !dpdf:href.map.internal \{\ . \" . \" We ran out of map references in the current sub-map, . \" so move on to the next indexed sub-map, if any. . \" . if dpdf:href.map-\\n+[pdf:href.map.index] \{\ . rn pdf:href.map-\\n[pdf:href.map.index] pdf:href.map . als pdf:href.map.internal pdf:href.map . \} . \} . \" . \" Proceed to the next named co-ordinate, (if any), specified . \" in the argument list. . \" . shift . \} .\" .\" Discard any assignments to a register named "null" .\" .rr pdf:null .. .de pdf*href.mark.begin .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .pdf*href.map.init .ie dpdf:href.map \{\ . \" . \" Once we have established a document reference map, . \" then this, and all subsequent calls to "pdf*href.mark.begin", . \" may be redirected to the reference mark resolver, and the . \" "pdf*href.mark.end" macro has nothing further to do. . \" . pdf*href.mark.resolve \\$@ . als pdf*href.mark.begin pdf*href.mark.resolve . als pdf*href.mark.end pdf*href.mark.idle . \} .el \{\ . \" Since we don't yet have a document reference map, the . \" reference mark resolver will not work, in this pass of the . \" formatter; this, and all subsequent calls to "pdf*href.mark.begin", . \" may be redirected to "pdf*href.mark.end", which is responsible . \" for emitting the reference mark data to be incorporated into . \" the reference map in a subsequent formatting pass. . \" . pdf*href.mark.end . als pdf*href.mark.begin pdf*href.mark.end . \} .. .de pdf*href.mark.resolve .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .ie '\\n(.z'' \{\ . ds pdf:href.link \\$1 . nr pdf:urx \\n(.o+\\n(.l . pdf*href.map.read spg llx ury epg urx.end lly.end . ie \\n[pdf:spg]=\\n[pdf:epg] \{\ . \" . \" This link is entirely contained on a single page ... . \" emit the text, which defines the content of the link region, . \" then make it active. . \" . pdf*href.mark.emit 1 \\n[pdf:urx.end] . if \\n[pdf:lly]<\\n[pdf:lly.end] \{\ . \" . \" This link spans multiple output lines; we must save its . \" original end co-ordinates, then define a new intermediate . \" end point, to create a PDFMARK "hot-spot" extending from . \" the start of the link to the end if its first line. . \" . nr pdf:ury +1v . nr pdf:llx \\n(.o+\\n[.in] . nr pdf:lly \\n[pdf:lly.end]-\\*[PDFHREF.HEIGHT] . if \\n[pdf:ury]<\\n[pdf:lly] \{\ . nr pdf:lly +\\*[PDFHREF.HEIGHT]-1v . pdf*href.mark.emit 2 . nr pdf:ury \\n[pdf:lly.end]-\\*[PDFHREF.HEIGHT] . \} . pdf*href.mark.emit 0 \\n[pdf:urx.end] . \} . pdf*href.mark.flush . \} . el \{\ . \" This link is split across a page break, so ... . \" We must mark the "hot-spot" region on the current page, . \" BEFORE we emit the link text, as we will have moved off . \" this page, by the time the text has been output. . \" . \" First step: define the region from the start of the link, . \" to the end of its first line. . \" . pdf*href.mark.emit 1 \\n[pdf:urx] . \" . \" All additional regions MUST align with the left margin. . \" . nr pdf:llx \\n(.o+\\n[.in] . \" . \" If the current page can accommodate more than the current line, . \" then it will include a second active region for this link; this . \" will extend from just below the current line to the end of page . \" trap, if any, or the bottom of the page otherwise, and occupy . \" the full width of the page, between the margins. . \" . nr pdf:ury +1v . pdf*href.mark.emit 3 . \" . \" We now need a page transition trap, to map the active link . \" region(s), which overflow on to the following page(s); (the . \" handler for this trap MUST have been previously installed). . \" . ie dpdf*href.mark.hook \{\ . \" . \" The page transition trap handler has been installed, . \" so we may activate both it, and also the appropriate . \" termination handler, to deactivate it when done. . \" . als pdf*href.mark.hook pdf*href.mark.trap . \" . \" Now we set up "pdf:epg" to count the number of page breaks . \" which this link will span, and emit the link text, leaving . \" the page trap macro to map active regions on intervening . \" pages, which are included in the link. . \" . nr pdf:epg -\\n[pdf:spg] 1 . \} . el \{\ . \" There was no handler initialised for the page trap, . \" so we are unable to map the active regions for this link; . \" we may discard the remaining map data for this link, . \" and issue a diagnostic. . \" . pdf:error pdfhref: link dissociated at page break (trap not initialised) . if dPDFHREF.BROKEN.COLOR \{\ . \" . \" The user may opt to have such broken links highlighted. . \" We use "PDFHREF.BROKEN.COLOUR" to specify this requirement, . \" but the user may prefer the American spelling, so we will . \" handle both as equivalent. . \" . als PDFHREF.BROKEN.COLOUR PDFHREF.BROKEN.COLOR . \} . if dPDFHREF.BROKEN.COLOUR \{\ . if dPDFHREF.COLOUR .als PDFHREF.COLOUR PDFHREF.BROKEN.COLOUR . \} . \} . \} . \} .el \!.\\$0 \\$@ .. .\" .\" Macro "pdf*href.mark.emit" is called only by "pdf*href". It is .\" responsible for emitting the PDFMARK code, to establish the .\" "hot-spot" region associated with a document or resource link. .\" .de pdf*href.mark.emit .\" ---------------------------------------------------------------------- .\" Usage: .\" .pdf*href.mark.emit [] .\" == 0 --> normal operation -- link height = 1 line .\" == 1 --> start of link -- add leading above text .\" == 2 --> overtall link -- set intermediate baseline .\" == 3 --> split link -- break at bottom of page .\" ---------------------------------------------------------------------- .\" .if \\$1=1 \{\ . \" . \" Initialising a new link region ... . \" Some different versions of "groff" disagree about the vertical . \" displacement of "opminy", as emitted by "\O1|\h'-\w"|"u'\O2\c", . \" relative to the current text baseline. Therefore, recompute . \" the link displacement, independently of "opminy". . \" . mk pdf:ury.base . while \\n[pdf:ury.base]<\\n[pdf:ury] .nr pdf:ury.base +1v . nr pdf:ury.base -1m+\\n[PDFHREF.LEADING] . \" . \" adjust the end-point vertical displacement by the same offset, . \" and then relocate the link starting point to its new displacement, . \" as established by this base line relative computation. . \" . nr pdf:lly.end +\\n[pdf:ury.base]-\\n[pdf:ury]+\\*[PDFHREF.HEIGHT] . rnn pdf:ury.base pdf:ury . \} .if \\$1<2 \{\ . \" . \" Link segment fits on a single line ... . \" Set its height and end-point horizontal displacement accordingly. . \" . nr pdf:lly \\n[pdf:ury]+\\*[PDFHREF.HEIGHT] . if \\n[pdf:lly]>=\\n[pdf:lly.end] .nr pdf:urx \\$2 . \} .ie \\$1=3 \{\ . \" . \" Link segment extends beyond the next page break ... . \" Recompute truncated height, to just fit portion on current page, . \" recursing to emit it, and leaving page trap mechanism to place . \" continuation region(s) on following page(s). . \" . nr pdf:lly (\\n[.t]u-\\n[.V]u)/1v . if \\n[pdf:lly]>0 \{\ . nr pdf:lly \\n[pdf:ury]+\\n[pdf:lly]v-1v+\\*[PDFHREF.HEIGHT] . pdf*href.mark.emit 2 . \} . \} .el \{\ . \" Link region size and placement has been fully specified ... . \" Emit it. . \" . pdfmark \\*[pdf:href.link] /Rect [\\*[pdf:bbox]] /ANN . \} .. .\" .\" When "pdf*href" emits a link for which the "hot-spot" spans a .\" page break, then we need to provide a "hook" in to the page break .\" trap, so we can map the "hot-spot" regions which are to be placed .\" on either side of the page break. .\" .\" Macro "pdf*href.mark.idle" is a dummy macro, which provide this .\" "hook" for normal page breaks, where there is no link "hot-spot" .\" crossing the break. .\" .de pdf*href.mark.idle .\" ---------------------------------------------------------------------- .\" Usage: .\" Called only as an internal hook, by a page trap macro. .\" Expects no arguments, and does nothing. .\" ---------------------------------------------------------------------- .. .\" .\" Macro "pdf*href.mark.trap" is the active "hook", which is substituted .\" for "pdf*href,mark.idle" at those page breaks which are crossed by .\" a link "hot-spot". .\" .de pdf*href.mark.trap .\" ---------------------------------------------------------------------- .\" Usage: .\" Called only as an internal hook, by a page trap macro. .\" Expects no arguments. Maps residual link "hot-spot" regions, .\" which spill beyond any page break. Not to be invoked directly .\" by the user, nor by any user supplied macro. .\" ---------------------------------------------------------------------- .\" .mk pdf:ury .nr pdf:ury +1v-1m-\\n[PDFHREF.LEADING] .ie \\n-[pdf:epg] \{\ . \" . \" The link "hot-spot" extends across more than one page break, . \" so, for each page which is completely contained within the . \" extent of the link, simply mark the entire text area on the . \" page as a "hot-spot". . \" . pdf*href.mark.emit 3 . \} .el \{\ . \" The link "hot-spot" ends on the page which immediately follows . \" the current page transition, so we may now finalise this link. . \" . nr pdf:lly \\n[pdf:ury]+\\*[PDFHREF.HEIGHT] . if \\n[pdf:lly.end]>\\n[pdf:lly] \{\ . \" . \" The "hot-spot" extends beyond the first line of text, . \" on its final page; compute and emit "hot-spot" region to cover . \" the full with of the text area, including all but the last . \" line of the link text. . \" . while \\n[pdf:lly.end]>\\n[pdf:lly] .nr pdf:lly +1v . nr pdf:lly -1v . pdf*href.mark.emit 2 . \" . \" Now, adjust the vertical "hot-spot" mapping reference, . \" to identify the correct position for the the last line of . \" text, over which the "hot-spot" extends. . \" . nr pdf:ury \\n[pdf:lly.end]-\\*[PDFHREF.HEIGHT] . \} . \" . \" We now have exactly one final line of text, over which we must . \" emit a "hot-spot" region; map it, terminate page trap processing . \" for this "hot-spot", and clean up the "hot-spot" mapping context. . \" . pdf*href.mark.emit 0 \\n[pdf:urx.end] . als pdf*href.mark.hook pdf*href.mark.idle . pdf*href.mark.flush . \} .. .de pdf*href.mark.flush .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .rr pdf:spg pdf:epg .rr pdf:llx pdf:lly pdf:urx pdf:ury .if dPDFHREF.COLOR .als PDFHREF.COLOUR PDFHREF.COLOR .rr pdf:urx.end pdf:lly.end .. .de pdf*href.mark.end .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- \O1\Z'|'\O2\c .. .\" Macro "pdf*href-I" is used for one time initialisation of special .\" "pdfhref" features; (currently, only the above page trap hook is .\" supported, but it is implemented with one level of indirection, to .\" accommodate possible future expansion). . .de pdf*href-I .\" ---------------------------------------------------------------------- .\" Usage: .\" .pdfhref I -
Back to Table of Contents Next: Bibliographies and references

Tables of contents


Introduction to tables of contents

Want a table of contents for your document? Easy. Just enter
.TOC as the very last macro of your document file. Mom will have picked up all document titles (in collated documents) and headings, as well as the endnotes section and bibliography, if they exist, and assigned them the appropriate page number. Talk about a no-brainer!

That said, tables of contents have even more control macros than endnotes. As always, the reason for so many control macros is so that if you want to change just about any aspect of the table of contents’ typographic appearance, you can.

Tables of contents appearance and behaviour

When you output a table of contents (with .TOC), mom finishes processing the last page of your document, then breaks to a new page for printing the table of contents.

Mom follows standard typesetting conventions for tables of contents. To this end, if HEADERS are enabled for the document, the first page of the table of contents has no page header, but does have a first page number (roman numeral), always “i”, in the bottom margin. If FOOTERS are enabled for the document, the first page has neither a footer, nor a page number in the top margin. (If you absolutely must have a page footer on the first page of the table of contents, simply invoke .FOOTER_ON_FIRST_PAGE immediately before .TOC.) Subsequent table of contents pages have both page headers or footers and a page number.

Entries in a table of contents are hierarchically indented, as you would expect, and if headings are numbered in the body of the document, you can instruct mom to number them in the table of contents as well (see TOC_ENTRY_NUMBERS).

Tables of contents are never set in columns, regardless of whether the rest of the document is. Lastly, if recto/verso printing is enabled, the table of contents respects it. This sometimes leads to tables of contents that begin with the wrong margins, but the margins can be corrected either by outputting a BLANKPAGE or by using the control macro TOC_RV_SWITCH.

The overall table of contents family, point size and lead can be altered with control macros, as can the family, font, point size and indent of each level of entry. Furthermore, the page numbering style can be changed, as can the amount of visual space reserved for entry page numbers.

PDF output

When files containing a table of contents are processed with pdfmom, entries in the table of contents are clickable links when the document is viewed at the screen. The colour of the links is the last .PDF_LINK_COLOR in effect, so if you wish another colour, it should be set just before issuing .TOC.

When preparing files for printing, coloured links in both the table of contents and elsewhere in the document may not be desirable. You can disable the colour by passing pdfmom the -c option, like this:
pdfmom -c doc.mom > doc.pdf

Positioning the Table of Contents

Because a table of contents can’t be generated until the end of a document (hence the last macro in the file), it is also the last page of the document. While this is desirable for some language conventions—French, for example—it is not desirable for others.

Automatic PDF relocation of the Table of Contents

When pdfmom is used to process files with a table of contents, the macro, .AUTO_RELOCATE_TOC, can be used to reposition the table of contents to the top of the output document, with the presence of a cover and/or title page sensibly taken into account. Full AUTO_RELOCATE_TOC usage is described in the manual, Producing PDFs with groff and mom.

In order to take advantage of automatic table of contents repositioning, you must use pdfmom. with groff’s native PDF driver (ie without the -Tps flag). Files that need to be processed with the -Tps flag require you to reposition the table of contents yourself with psselect, described below.

Using psselect to relocate the Table of Contents in PostScript documents

To change the location of the table of contents in files processed with pdfmom -Tps, you have two choices: rearrange the pages by hand (okay for one or two hard copies), or use the psselect programme provided by the psutils suite of tools (which you may have to install as a package from your distribution if it is not already on your system).

The procedure for using psselect to put the table of contents near the beginning of a document begins by you determining how many pages it contains. You can do this by previewing the document with the document viewer of your choice (gv, Okular, Evince, etc).

Once you know the number of pages in the table of contents, you use psselect to place them where you want.

Say, for example, the table of contents runs to just one page. The command to place a one-page table of contents at the start of a document is:
psselect -p _1,1-_2 The -p option instructs psselect that what follows is a comma-separated list of the order in which you want pages of a document rearranged. The underscore character means "counting backwards from the end of the document". Thus, the above says: "Put the last page first (ie the table of contents), followed by all pages from the original first page up to the second to last (ie the last page before the table of contents)."

If your table of contents runs to two pages, the option to psselect would look like this:
psselect -p _1-_2,1-_3 If your table of contents runs to two pages and you have a cover page, the command would look like this:
psselect -p 1,_1-_2,2-_3

Note: psselect outputs to stdout, so you have to redirect the output to a new file.
psselect -p <page list> <file>.ps > <new-file>.ps

The TOC macro

Macro: TOC

If you want a table of contents, just place .TOC at the very end of your document. Mom takes care of the rest.

Tip: If the last line of text in a document, before .TOC, falls too close to the bottom margin, or if the line is followed by a macro likely to cause a linebreak (eg .LIST OFF or .IQ), mom may output a superfluous blank page before the Table of Contents.

In order to avoid this, insert .EL after the last line of text, before .TOC and/or any concluding macros. For example,
some concluding text. .EL .TOC or
some concluding text. .EL .LIST OFF .TOC


Control macros for tables of contents

Aside from allowing you to set the style of table of contents entries on a per-level basis, the control macros let you design the table of contents as if they were a complete document unto themselves (overall family, headers/footers, pagination, etc).

1. General tables of contents style control

Macro: TOC_FAMILY <family>

TOC_FAMILY establishes the default family for every page element in a table of contents, including the table of contents’ header string (by default, “Contents”) and the page number in the top or bottom margin. The default is the prevailing document family.

All page elements in the table of contents also have their own _FAMILY control macros, which can be used on a case-by-case basis to override the default family set with TOC_FAMILY.

Macro: TOC_PT_SIZE <base type size of the toc>

• Does not require a unit of measure; points is assumed

Unlike most other control macros that deal with size of document elements, TOC_PT_SIZE takes as its argument an absolute value, relative to nothing. (Compare this with the _SIZE control macros.) The argument represents the base point size of tables of contents from which the size of all other table of contents elements are calculated.

The default for PRINTSTYLE TYPESET is 12.5 points (the same default size used in the body of the document).

Macro: TOC_LEAD <leading of the toc> [ ADJUST ]

• Does not require a unit of measure; points is assumed

Unlike most other control macros that deal with leading of document elements, TOC_LEAD takes as its argument an absolute value, relative to nothing. Therefore, the argument represents the leading of tables of contents in points unless you append an alternative unit of measure. For example,
.TOC_LEAD 14 sets the base leading of tables of contents to 14 points, whereas
.TOC_LEAD .5i sets the base leading of tables of contents to 1/2 inch.

If you want the leading of tables of contents adjusted to fill the page, pass TOC_LEAD the optional argument ADJUST. (See DOC_LEAD_ADJUST for an explanation of leading adjustment.)

The default for PRINTSTYLE TYPESET is the prevailing document lead (16 by default), adjusted.

Note: Even if you give mom a .DOC_LEAD_ADJUST OFF command, she will still, by default, adjust the leading of the table of contents. You must enter TOC_LEAD <lead> with no ADJUST argument to disable this default behaviour.

Additional note: Tables of contents are always double-spaced in PRINTSTYLE TYPEWRITE, regardless of whether the body of the document is single-spaced.

2. Page numbering

The pagination style of tables of contents is controlled by the same macros that control document page numbering, except PAGENUM (tables of contents always start on page 1). The defaults are the same as for the rest of the document, with the exception that tables of contents, by default, have roman numeral page numbers.

Therefore, if you wish to change some aspect of table of contents pagination style, use the document pagination control macros immediately prior to .TOC.

A special macro, TOC_PAGENUM_STYLE controls the style of table of contents pagination (ie the actual table of contents pages' numbers, not the page number references of entries).

Macro: PAGINATE_TOC <toggle>

By default, mom paginates tables of contents. If you’d like her not to, do
.PAGINATE_TOC OFF (or NO, X, etc).

Note: Simply invoking .PAGINATION OFF or .PAGINATE OFF disables table of contents pagination for the first page of the table of contents only. You must use .PAGINATE_TOC OFF to disable table of contents pagination completely, even if pagination is turned off elsewhere in your document.

Macro: TOC_PAGENUM_STYLE <DIGIT | ROMAN | roman | ALPHA | alpha>

See PAGENUM_STYLE for an explanation of the arguments.

By default, mom uses roman numerals to number table of contents pages. Use TOC_PAGENUM_STYLE if you’d prefer something else. For example, to have standard digits instead of roman numerals, do the following:
.TOC_PAGENUM_STYLE DIGIT

3. Header string and style

The table of contents header string is the title that appears at to top of the table of contents. By default, it’s “Contents”.

Macro: TOC_HEADER_STRING <string>

If you’d like the title of the table of contents to read something other than “Contents”, do, for example
.TOC_HEADER_STRING "Table of Contents"

Header string control macros and defaults

See Arguments to the control macros.

.TOC_HEADER_FAMILY default = prevailing doc family .TOC_HEADER_FONT default = bold .TOC_HEADER_SIZE default = +4 .TOC_HEADER_QUAD default = left

4. Entries and reference page numbers style

“Entries” refers to the hierarchical arrangement of section titles (in collated documents) and headings as they appear in the table of contents: Section title Head level 1 Head level 2 Head level 3 ... The style for title entries (eg chapter numbers or titles) and heading levels is controlled by TOC_TITLE_STYLE and TOC_ENTRY_STYLE respectively.

“Reference page numbers” means the page numbers associated with entries. Macros to control their style take the form .TOC_PN_<SPEC>, and the defaults are listed here.

See Arguments to the control macros.

.TOC_PN_FAMILY default = prevailing doc family .TOC_PN_FONT default = roman .TOC_PN_SIZE default = 0

Macro: TOC_TITLE_STYLE <see below for args>

TOC_TITLE_STYLE allows you to set all the style parameters for title entries in the tables of contents with one macro. The number of arguments can run long, so you may want to break them into several lines with the backslash character (\). The arguments are:
FAMILY <family> FONT <font> SIZE +|-<n> COLOR <color> INDENT <amount> CAPS | NO_CAPS The arguments may be entered in any order.

The family, font, size, and color arguments behave identically to the individual control macros that govern other tags, therefore see Arguments to the control macros for usage. Their defaults are the same as for paragraphs in running text.

INDENT lets you indent title entries by the amount specified, and requires a unit of measure. The default is zero.

CAPS instructs mom to capitalize title entries. Capitalization may be enabled or disabled on a per-title basis.

As an example, if you want title entries bold, slightly larger than other entries and capitalized, you could do either
.TOC_TITLE_ENTRY FONT B SIZE +.5 CAPS or
.TOC_TITLE_ENTRY \ FONT B \ SIZE +.5 \ CAPS

Macro: TOC_ENTRY_STYLE <level> <see below for remaining args>

TOC_ENTRY_STYLE allows you to set individually all the style parameters for any level of entry (beneath titles) in the tables of contents. The number of arguments can run long, so you may want to break them into several lines with the backslash character (\).

<level> corresponds to a HEADING level assigned in the body of the document. The remaining arguments are as follows.
FAMILY <family> FONT <font> SIZE +|-<n> COLOR <color> INDENT <amount> CAPS | NO_CAPS The arguments may be entered in any order.

The family, font, size, and color arguments behave identically to the individual control macros that govern other tags, therefore see Arguments to the control macros for usage. Their defaults are the same as for paragraphs in running text.

INDENT lets you indent entries by the amount specified, and requires a unit of measure. Mom sensibly indents and aligns all levels of entry. If you change the indent for any level, all levels beneath it are still indented according to mom’s normal arrangement, but with the indent assigned to level taken into account. When you use INDENT, the indent is measured from the left margin of the entire text of the previous level, including numbering, if any.

CAPS instructs mom to capitalize title entries. Capitalization may be enabled or disabled on a per-title basis.

As an example, if you want a particular entry level, say “2”, to be in Helvetica, italics, and slightly larger than other entries, you could do either
.TOC_ENTRY_STYLE 2 FAMILY H FONT I SIZE +.25 or
.TOC_ENTRY_STYLE 2 \ FAMILY H FONT I \ SIZE +.25

Macro: TOC_ENTRY_NUMBERS <FULL> <TRUNCATE> <NONE>

If numbering is enabled for any level of HEADING, mom, by default, includes the numbering in that level’s entries in table of contents. If you would prefer that numbering not be included in the table of contents, issue .TOC_ENTRY_NUMBERS NONE. If you’d like to include numbering, but not the full, concatenated numbering used in the body of the document, issue .TOC_ENTRY_NUMBERS TRUNCATE.

Assuming numbering is enabled for HEADINGs 1, 2, and 3, .TOC_ENTRY_NUMBERS FULL (mom’s default), would result in
1. Level-1 entry 1.1. Level-2 entry 1.1.1. Level-3 entry 2. Level-1 entry 2.1. Level-2 entry 2.1.1. Level-3 entry whereas .TOC_ENTRY_NUMBERS TRUNCATE would produce
1. Level-1 entry 1. Level-2 entry 1. Level-3 entry 2. Level-1 entry 1. Level-2 entry 1. Level-3 entry and .TOC_ENTRY_NUMBERS NONE would remove numbering completely.
Level-1 entry Level-2 entry Level-3 entry Level-1 entry Level-2 entry Level-3 entry

Note: .TOC_ENTRY_NUMBER TRUNCATE removes the numbering associated with title entries if PREFIX_CHAPTER_NUMBER is enabled.

5. Additional table of contents control macros

The following five macros allow you to

Macro: TOC_APPENDS_AUTHOR <none> | "<name(s) of authors>"

In certain kinds of collated documents, different authors are responsible for the articles or stories contained within them. In such documents, you may wish to have the author or authors appended to the table of contents’ title entry for each story or article.

If you invoke .TOC_APPENDS_AUTHOR without an argument, mom appends the first argument you passed to AUTHOR to table of contents title entries, separated by a front-slash.

If you invoke .TOC_APPENDS_AUTHOR with an argument (surrounded by double-quotes), mom will append it to the table of contents title entries instead. This is useful if you have multiple authors you wish to identify by last name only. For example, if three authors—Joe Blough, Jane Doe, and John Deere—are responsible for a single article
.TOC_APPENDS_AUTHOR "Blough et al." would be a good way to identify them in the table of contents.

Macro: TOC_TITLE_ENTRY "<alternate wording for a title entry in the toc>"

In collated documents, the title of each chapter appears in the table of contents. It may sometimes happen that you don’t want the title as it appears in the table of contents to be the same as what appears in the docheader. You might, for example, want to shorten it. Or, in the case of chapters where the docheader contains both a chapter number and a chapter title, like this
Chapter 6 Burning Bush — Maybe God Was Right you might want only the chapter title, not the chapter number, to show up in the table of contents. (By default, .TOC generates both.)

If you want to change the wording of a title entry in the table of contents, simply invoke
.TOC_TITLE_ENTRY with the desired wording, enclosed in double-quotes. Using the example, above,
.CHAPTER 6 .CHAPTER_TITLE "Burning Bush — Maybe God Was Right" .TOC_TITLE_ENTRY "Burning Bush" .DOCTYPE CHAPTER would identify chapter 6 in the table of contents simply as “Burning Bush”.

Macro: SPACE_TOC_ITEMS

If you’d like mom to add a small amount of space between table of contents entry levels, use .SPACE_TOC_ITEMS. Mom will visually group entry levels in a way that's pleasing to the eye. The only catch to this macro is that the bottom margins of table of contents pages may not align perfectly.

Macro: TOC_PADDING <number of placeholders to allow for page number listings>

By default, mom allows room for 3 digits in the page number references of table of contents entries. If you’d like some other number of placeholders, say 2 (if your document runs to less than 100 pages), do
.TOC_PADDING 2

Macro: TOC_RV_SWITCH

TOC_RV_SWITCH doesn’t take an argument. It simply instructs mom to switch the left and right margins of the first table of contents page in recto/verso documents should the table of contents happen to begin on an even page when you want an odd, or vice versa.

The same result can be accomplished by outputting a BLANKPAGE.


Back to Table of Contents Top Next: Bibliographies and references

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/docelement.html0000644000000000000000000000013212426110213022410 xustar000000000000000030 mtime=1415090315.613519146 30 atime=1415090315.612519159 30 ctime=1415090315.613519146 groff-1.22.3/contrib/mom/momdoc/docelement.html0000644000175000001440000065574212426110213021271 0ustar00wlusers00000000000000 Mom -- Document processing, element tags
Back to Table of Contents Next: Graphics, floats, preprocessor support

The document element tags


Document element tags table of contents


Introduction to the document element tags

Once you’ve completed the setup for a document (see Setting up a mom document), formatting it is a snap. Simply invoke the appropriate tag for each document element as you need it. The tags are macros that tell mom: “This is a paragraph; this is a heading; this is a footnote,” and so on.

Generally, for each tag, there are control macros for the tag’s family, font and point size. Where appropriate, there are macros to control leading, indents, quad and special features as well. Mom has tasteful defaults for all the tags, hence you only use the control macros when you want to change the way she does things. This is usually done prior to START, but can, in fact, be done at any time in the course of a document. Any change to a tag’s style affects all subsequent invocations of the tag.

Control macros – changing the tag defaults

The control macros for document processing tags let you design the look of all the parts of your documents—should you wish. At a bare minimum, all tags have macros to change mom’s defaults for family, font, point size and colour. Where appropriate, there are macros to control leading, indents and quad as well.

In addition, many tags have special macros to control features that are pertinent to those tags alone. Have a look at the section dealing with any particular tag to find out what macros control the tag, and what mom’s defaults for the tag are.

The control macros may be used at any time during the course of a document (ie before or after START). The changes you make alter all subsequent invocations of the affected tag until you make another change, either by passing new arguments to the tag’s control macro, or toggling a particular feature of the tag on or off.

And don’t forget: the typesetting macros can be used at any time, including inside toggle tags (affecting only that particular invocation of the tag). Equally, inline escapes can be used in tags that take string arguments.

Tip: Get familiar with mom at her default settings before exploring the control macros. Put her through her paces. See how she behaves. Get to know what she feels like and how she looks, both in your text editor and on the printed page. Then, if you don’t like something, use this documentation to find the precise macro you need to change it. There are tons of control macros. Reading up on them and trying to remember them all might lead you to think that mom is complex and unwieldy, which is not only untrue, but would offend her mightily.

Important: The family, font, point size, colour and leading control macros have no effect in PRINTSTYLE TYPEWRITE, except where noted throughout this documentation.

Please also note that the defaults listed with the control macros apply only to PRINTSTYLE TYPESET unless a default for TYPEWRITE is also given.

Arguments to the control macros

Family and font

The arguments to the control macros that end in _FAMILY or _FONT are the same as for FAMILY and FT.

Point size

Control macros that end in _SIZE always take the form +<n> or -<n> where <n> is the number of points larger (+) or smaller (-) than the point size of paragraphs you want the document element to be. For example, to set blockquotes 2 points smaller than the type in paragraphs, do
.BLOCKQUOTE_SIZE -2 There’s no need for a unit of measure with the _SIZE control macros; points is assumed.

Colour

Control macros that end in _COLOR take as their argument a colour name pre-defined (or “initialized”) with NEWCOLOR or XCOLOR. For example, if you want your author linebreaks to be red, once you’ve defined or initialized the colour, red,
.LINEBREAK_COLOR red will turn them red.

Lead/linespacing

Control macros that end in _AUTOLEAD take the same argument as AUTOLEAD, viz. a digit that represents the number of points to add to the tag’s point size to arrive at its leading. For example, to set footnotes solid, do
.FOOTNOTE_AUTOLEAD 0 To set footnotes with a 1-point lead (ie with the line spacing one point greater than the footnote’s point size), do
.FOOTNOTE_AUTOLEAD 1

Note: _AUTOLEAD control macros do not have a FACTOR argument.

Indents

Except for PARA_INDENT, the argument to control macros that end in _INDENT can take either a single numeral (whole numbers only, no decimal fractions) without a unit of measure appended to it, or a digit (including decimal fractions) with a unit of measure appended.

A digit without a unit of measure appended represents by how much you want your paragraph first-line indents (set with PARA_INDENT) multiplied to achieve the correct indent for a particular tag. For example,
.PARA_INDENT 2m .BLOCKQUOTE_INDENT 2 means that blockquotes will be indented from the left and right margins by twice the size of the paragraph indent, or 4 ems.

A digit with a unit of measure appended defines an absolute indent, relative to nothing. In the following, blockquotes will be indented by 3 picas and 6 points, regardless of the paragraph indent.
.PARA_INDENT 2m .BLOCKQUOTE_INDENT 3P+6p

Quad/justification style

Control macros that end in _QUAD take the same arguments as QUAD.

Underline style, rule weight

If mom gives the option to underline a document element, the weight of the underline and its distance from the baseline are controlled by macros that end in _UNDERLINE.

Page elements that are separated from running text by a rule (ie page headers, page footers and footnotes) are controlled by macros that end in _RULE_WEIGHT.

The weight argument to _UNDERLINE macros is the same as the argument to RULE_WEIGHT, as is the argument to _RULE_WEIGHT macros.


Epigraphs

Epigraphs colour, flavour, or comment on the document they precede. Typically, they are centred at the top of a document’s first page (underneath the title) and set in a smaller point size than that of paragraph text.

By default, mom sets epigraphs centred and unfilled; this lets you input them on a line for line basis. This behaviour can be changed to accomodate filled epigraph “blocks.”

EPIGRAPH

Macro: EPIGRAPH <toggle> | [ BLOCK ]

EPIGRAPH is a toggle, used like this:
.EPIGRAPH <text of epigraph> .EPIGRAPH OFF OFF, above, could be anything—say, Q or X—since any argument other than BLOCK turns it off.

If given the argument, BLOCK, EPIGRAPH sets epigraphs filled, justified or quadded in the same direction as paragraphs, indented equally from both the left and right margins.

If a block-style epigraph runs to more than one paragraph (unlikely, but conceivable), you must introduce every paragraph—including the first—with the PP tag.

Note: EPIGRAPH should only be used at the top of a document (ie just after START) or after headings. The latter is not especially recommended, but it does work. In all other places where you want quotes or cited text, use QUOTE or BLOCKQUOTE.

Tip: If you’re setting a document in columns and you’d like to add or subtract space after the epigraph, the place to do it is inside the epigraph, like this:
.EPIGRAPH A notable quote. .SP 1v .EPIGRAPH OFF If you were to add the .SP 1v outside the epigraph, the space would be added to the top of the leftmost column only, resulting in unbalanced columns.

EPIGRAPH control macros and defaults

See Arguments to the control macros.

.EPIGRAPH_FAMILY default = prevailing document family; default is Times Roman .EPIGRAPH_FONT default = roman .EPIGRAPH_SIZE default = -1.5 (points) .EPIGRAPH_COLOR default = black .EPIGRAPH_AUTOLEAD default = 2 points (The next two apply to “block” style epigraphs only) .EPIGRAPH_QUAD default = same as paragraphs .EPIGRAPH_INDENT* (see Note on EPIGRAPH_INDENT, below) *Indent here refers to the indent from both the left and right margins that centres block style epigraphs on the page.

Note on EPIGRAPH_INDENT

If you pass EPIGRAPH_INDENT an integer with no unit of measure appended, the integer represents the amount by which to multiply PARA_INDENT to arrive at an indent for block style epigraphs. If you append a unit of measure to the argument, the indent will be precisely the amount specified.

Please also note that if your PARA_INDENT is 0 (ie no indenting of the first line of paragraphs), you must set an EPIGRAPH_INDENT yourself, with a unit of measure appended to the argument. Mom has no default for EPIGRAPH_INDENT if paragraph first lines are not being indented.

The default value for EPIGRAPH_INDENT is 3 (for PRINTSTYLE TYPESET) and 2 (for PRINTSTYLE TYPEWRITE).


Paragraphs

The paragraph macro is the one you use most often. Consequently, it’s one of most powerful, yet simplest to use—just the letters PP. No arguments, nothing. Just .PP on a line by itself any time, in any document element, tells mom you want to start a new paragraph. The spacing and indent appropriate to where you are in your document are taken care of automatically.

By default, mom does not indent the first paragraph of a document, nor paragraphs that fall immediately after headings. The first paragraphs of blockquotes and block-style epigraphs are also not indented. This behaviour can be changed with the control macro INDENT_FIRST_PARAS.

Mom does not deposit a blank line between paragraphs. If you want her to do so, use the control macro PARA_SPACE. (I don’t recommend using this macro with PRINTSTYLE TYPEWRITE.)

Tip: If you want to add less than a full linespace between paragraphs, you may give the amount of space you’d like as an argument to .PARA_SPACE. Introducing a paragraph with .PP2 will add a space equal to one-quarter of the prevailing linespace before the start of the paragraph. Initial paragraphs, ie those at the start of a document, or after a heading or linebreak, should still be introduced with .PP.

Note that mom does not provide widow or orphan control for paragraphs (ie even if only one line of a paragraph fits at the bottom of a page, she will set it on that page). The reason for this is that writers of fiction often have single-line paragraphs (eg in dialogue). Groff’s simplistic orphan control will break these one-liners—if they fall at the bottom of the page—to a new page, which is not what you want.

Tip: The last thing you want while you’re writing and editing drafts of a document (particularly stories and chapters) is a text file cluttered up with .PP’s. The visual interruption in the flow of text is a serious obstacle to creativity and critiquing.

I use the tab key on my keyboard to indent paragraphs by four spaces when I'm writing, producing a text file that looks pretty much like what you see on a printed page. When it comes time to format and print the file, I run it through a sed script that (amongst other things) converts the intial four spaces into .PP (plus a new line) and pipes the output to groff for processing and printing.

Another solution would be to insert a blank line between paragraphs of your text files. The blank lines can then be sedded out at print time, as above (.PP plus a newline), or, more conveniently, you could use the .blm primitive (blank line macro) to tell groff (and mom) that blank lines should be interpreted as PP’s.
.blm PP tells groff that blank lines are really the macro PP.

PP

Macro: PP

.PP (on a line by itself, of course) tells mom to start a new paragraph. See above for more details. In addition to regular text paragraphs, you can use PP in epigraphs, blockquotes, endnotes and footnotes.

PP control macros and defaults

The PP macro being so important, and representing, as it were, the basis of everything that goes on in a document, its control is managed in a manner somewhat different from other document element tags.

  1. Family control
  2. Font control
  3. Paragraph colour
  4. Leading/linespacing control
  5. Justification/quad control
  6. First-line indent control
  7. Initial paragraphs indent control
  8. Inter-paragraph spacing

1. Family control

The paragraph family is set with FAMILY prior to START, or DOC_FAMILY afterwards. Please note that both globally affect the family of every element in the document.

If you wish to change the family for regular text paragraphs only, invoke .FAMILY immediately after .PP in every paragraph whose family you wish to differ from the prevailing document family. Alternatively, set the family and font for paragraphs with PP_FONT, giving it a complete family+font name, eg
PP_FONT TI which would make the font used in paragraphs Times Roman Italic.

Mom’s default paragraph (and document) family is Times Roman.

Note: Neither FAMILY nor DOC_FAMILY has any effect when the PRINTSTYLE is TYPEWRITE.

2. Font control

To change the font used in regular text paragraphs, use PP_FONT, which takes the same argument as FT. PP_FONT may be used before or after START. Only regular text paragraphs are affected; paragraphs in epigraphs, blockquotes, endnotes, and footnotes remain at their default setting (medium roman) unless you change them with the appropriate control macros.

Mom’s default paragraph font is medium roman.

Note: PP_FONT has no effect when the PRINTSTYLE is TYPEWRITE. If you wish to set whole typewritten paragraphs in italic, invoke invoke .FT I immediately after .PP. Depending on which of UNDERLINE_ITALIC or ITALIC_MEANS_ITALIC is currently enabled, the paragraph will be set underlined or in italic. Neither persists past the end of the paragraph.

3. Paragraph colour

Mom has no special control macro for colourizing paragraphs. If you wish a colourized paragraph, you must use the macro, COLOR, or the inline escape, \*[<colourname>], after .PP. The colour must be one pre-defined (or “initialized”) with NEWCOLOR or XCOLOR.

Please note that unless you change the colour back to it’s default (usually black) at the end of the paragraph, all subsequent paragraphs will be set in the new colour, although most other elements of your document will continue to be set in the default colour (usually black).

For example, assuming you have defined the colour, blue,
.PP .COLOR blue <first paragraph> .HEADING 1 "Monty Python" .HEADING 2 "The Origins of Spam" .PP <second paragraph> the first paragraph will be blue, the head and subhead will be in the document’s default colour (usually black), and the second paragraph will be in blue.

4. Leading

The paragraph leading is set with LS prior to START, or DOC_LEAD afterwards. Please note that either method globally affects the leading and spacing of every document element (except headers and footers).

If you wish to change the leading of regular text paragraphs only, invoke .LS immediately after .PP in every paragraph whose leading you wish to change.

Warning: It is extremely unwise to change a paragraph’s leading with LS as it will, in all cases, screw up mom’s ability to balance the bottom margin of pages. Should you absolutely need to change paragraph leading with LS, and subsequently want mom to get back on the right leading track, use the SHIM macro.

Mom’s default paragraph leading (document leading) is 16 points, adjusted to fill the page.

5. Justification/quad

The justification/quad-direction of regular text paragraphs (ie justified, or filled and quadded left/right/centre) is set with JUSTIFY or QUAD prior to START, and with DOC_QUAD afterwards.

Please note that either method of setting the paragraph justification/quad-direction also affects epigraphs, footnotes, and endnotes, but not blockquotes (whose default is quad left unless you change it with BLOCKQUOTE_QUAD). The justification/quad-direction of epigraphs and footnotes may be changed with their own control macros.

If you wish to change the justification/quad-direction of individual paragraphs, invoke .JUSTIFY or .QUAD on the line immediately after .PP. Only the paragraph in question gets justified or quadded differently; subsequent paragraphs remain unaffected.

Mom’s default justification/quad-direction for paragraphs when the PRINTSTYLE is TYPESET is justified; for PRINTSTYLE TYPEWRITE, the default is quad left.

6. First-line indent

The first-line indent of paragraphs is controlled by PARA_INDENT, which takes one argument: the size of the indent. PARA_INDENT may be used before or after START. A unit of measure is required; fractional sizes are allowed. Thus, to set the paragraph indent to 4-1/2 ems, do
.PARA_INDENT 4.5m In addition to establishing the basic first line-indent of paragraphs, PARA_INDENT also affects epigraphs, quotes and blockquotes, whose overall indenting from the left and (where applicable) right margins is relative to PARA_INDENT if the _INDENT control macro for these tags has no unit of measure appended to it. Furthermore, the first-line indent of paragraphs within these document elements (as well as footnotes) is also relative to PARA_INDENT (always 1/2 of PARA_INDENT), hence they are also affected.

Mom’s default PARA_INDENT is 2 ems for PRINTSTYLE TYPESET and 3 picas (1/2 inch) for PRINTSTYLE TYPEWRITE.

7. Indenting initial paragraphs

By default, mom does not indent the first paragraph of a document, nor the first paragraph after a heading or linebreak, nor the first paragraphs of epigraphs, blockquotes, endnotes or footnotes that run to more than one paragraph.

If you wish to have first paragraphs indented, invoke the macro .INDENT_FIRST_PARAS without an argument, either before or after START. INDENT_FIRST_PARAS is a toggle macro, therefore passing it any argument (OFF, QUIT, Q, X...) cancels its effect, meaning that first paragraphs will once again not be indented.

8. Inter-paragraph spacing

By default, mom does not insert a blank line between paragraphs. If you would like her to do so, invoke the macro, .PARA_SPACE, without an argument, either before or after START. PARA_SPACE is a toggle macro, therefore passing it any argument (OFF, QUIT, Q, X...) cancels its effect, meaning that paragraphs will once again not be separated by a blank line.

If you would like to space paragraphs by less than a full linespace, invoke PARA_SPACE with the amount of space you want as a numeric argument. A unit of measure is required. For example, to space paragraphs by one-quarter linespace .PARA_SPACE .25v is how you’d do it, or, if you want six points between paragraphs .PARA_SPACE 6p

PARA_SPACE is not recommended for use with PRINTSTYLE TYPEWRITE unless you give PRINTSTYLE the SINGLESPACE option.

Note: If PARA_SPACE is on, mom spaces only those paragraphs that come after an initial paragraph. Initial paragraphs are those that come immediately after the docheader (ie the start of a document), epigraphs, headings, and linebreaks. (The first paragraph after these document elements requires no blank line to separate it from other paragraphs.)

Sometimes, you can be fairly deep into a document before using PP for the first time, and when you do, because mom is still waiting for that initial paragraph, she doesn’t space it with a blank line, even though you expect her to. The simple workaround for this is to invoke .PP twice (in succession) at the point you expect the blank line to appear.


Headings

Heads, subheads, and deeper levels of section headings are handled by a single macro, HEADING, to which you pass an argument stating the desired level. .HEADING 1 "<text>", for example, would be a main head; .HEADING 2 "<text>" would be a subhead; etc.

In addition to printing headings in the body of your document, HEADING collects the heading as an entry for the Table of Contents, if the document is to have one, and the PDF outline. With the NAMED argument, it furthermore acts as a bookmark for PDF links.

Headings can also be numbered on a per-heading-level basis, hierarchically and concatenatively, eg
1. 1.1 1.2 1.2.1 2. 2.1 2.2 2.2.1 By default, a blank line precedes headings, regardless of the level. Mom initially sets up a very basic style for nine levels of heading, of which you can have an infinite number, although as has been said, if you need more than four levels of heading, you should consider re-organizing your material. The pared-down style of mom’s defaults is intentional; it is expected that you will design headings to your own specifications with the control macro, HEADING_STYLE.

It is very good practice, and strongly recommended, that you respect the hierarchy of headings, using level-1 for main heads, level-2 for subheads, level-3 for subsubheads, etc. The ease of designing and re-designing the style for each level, plus mom’s very basic defaults, are meant, in part, to prevent the whimsical misuse of a particular heading level just because its style appeals to you.

HEADING

Macro: HEADING <level> [ PARAHEAD ] [ NAMED <pdf-id> ] "<heading text>"

The first argument to HEADING is the level. Level 1 is analogous to a main head; level 2 is analogous to a subhead; level 3 is analogous to a subsubhead; etc.

The second (optional) argument, PARAHEAD, instructs mom that the heading should be treated as a paragraph head. If HEADING is being used to create a parahead, it must come after PP, not before.

The indent applied to a parahead is the same as what would be expected from a paragraph without the parahead (see Indenting initial paragraphs). If you wish that a paragraph introduced by a parahead not be indented, use PARA_INDENT to set the paragraph indent to zero, then reset the indent for subsequent paragraphs.

The optional third argument, NAMED <id>, gives the heading a unique, non-printing identifier that allows it to referenced from anywhere in the final PDF document with the PDF_LINK macro, provided the mom file is processed with pdfmom. PDF_LINK usage is explained in the manual, Producing PDFs with groff and mom.

The final argument is the text of the heading, surrounded by double quotes. Long headings that are likely to exceed the current line length should be broken into chunks, each surrounded by double-quotes, like this:
.HEADING 1 "A needlessly long but instructive" "first level heading"

Note: If a heading falls near the bottom of an output page and mom is unable to fit the heading plus at least one line of text underneath it, she will set the head at the top of the next page.

Spacing of headings

As described above, mom inserts a blank line before each heading. If the leading of your document never changes, and you introduce no additional space into the text—as, for example, between paragraphs—this will result in perfectly equal whitespace before each heading.

If, however, you disrupt the regular placement of text on mom’s baseline grid, HEADING adds as much whitespace to the blank line as is necessary to get things back on track. The extra whitespace is always less than the current leading and therefore usually doesn't draw attention to itself. This, along with a similar strategy for whitespace around quotes and blockquotes, is what allows mom to balance the bottom margins of pages effectively. The manual, Producing PDFs with groff and mom, demonstrates this well: the inter-paragraph spacing is 1/3 of the leading, yet mom is able to produce a document with good page-rhythm and evenly balanced bottom margins.

It occasionally happens that the extra whitespace becomes noticeable, typically when the amount of whitespace approaches the value of the current leading. The result looks like two blank lines instead of one. When this happens, a simple but effective fix is to reduce the space before the heading by backing up one line, either with
.SPACE -1v or
.RLD -1v This results in slightly less whitespace than normal, but the difference is usually not apparent.

If you’d prefer that mom not add flexible whitespace to headings, invoke the macro
.NO_SHIM either in the style sheet section of your document (ie after PRINTSTYLE but before START), which will globally disable whitespace adjustment not only before headings, but around quotes and blockquotes as well, or on a per-instance basis. .NO_SHIM is disabled by issuing
.NO_SHIM OFF Please note that .NO_SHIM also disables mom’s automatic shimming around quotes, blockquotes, after PDF images and floats, and SHIM macro itself.

HEADING control and defaults

By default, mom pre-initializes nine levels of headings to use the bold font of the prevailing document family, with a baseline adjustment of 1/10 of the current leading. In addition, level-1 headings are 3 points larger than running text, level-2 headings 2 points larger, and level 3-headings 1 point larger. The remaining 6 levels are the same size as running text. A single blank line precedes all levels of heading.

The HEADING_STYLE macro

Styling heads is accomplished with a single macro,
.HEADING_STYLE <level> where <level> is the numeric heading level to which the style applies.

HEADING_STYLE takes any or all of the following arguments, which may be given in any order:
FAMILY <family> \ FONT <font> \ SIZE <+|-size> \ QUAD <direction> \ COLOR <colour> \ UNDERSCORE <weight> <gap> | NO_UNDERSCORE \ UNDERSCORE2 <weight> <gap1> <gap2> | NO_UNDERSCORE2 \ CAPS | NO_CAPS \ BASELINE_ADJUST <amount to raise heading from the baseline> \ SPACE_AFTER | NO_SPACE_AFTER \ NUMBER | NO_NUMBER

You may enter your entire argument list on a single line, or, if it is very long, break it into shorter lines with the “line-continued” backslash {\), as shown above.

The arguments to FAMILY, FONT, SIZE, QUAD, and COLOR are the same as those you’d give to the control macros ending in _FAMILY, _FONT, _SIZE, _QUAD, or _COLOR. See Arguments to the control macros.

UNDERSCORE and UNDERSCORE2 require that a weight for the underscore be given, in points (decimal fractions allowed), but without the unit of measure p appended. They also require that the underscore's distance from the baseline be supplied; in the case of UNDERSCORE2, an additional gap argument representing the distance between the two underscores must be provided.

The CAPS argument capitalizes the text of a heading level in the body of a document but not in the Table of Contents, where capitalization of entries is controlled by TOC_ENTRY_STYLE <n>.

BASELINE_ADJUST allows you to raise a heading slightly above the baseline on which it would otherwise sit. For aesthetic reasons, it is often desirable to introduce a small amount of space between a heading and the text following it. Since headings are preceded by a blank line, it is preferable to move the heading upward than to lower the text following it. The argument to BASELINE_ADJUST is the amount by which to raise the heading. It requires no + or - sign, and must have a unit of measure appended to it.

SPACE_AFTER inserts a blank line equal to the current leading after a HEADING. If you'd like a full linespace after a heading level, use SPACE_AFTER. If you'd like additional space before a heading level, you must introduce it yourself with SPACE or ALD.

NUMBER and NO_NUMBER allow you to determine whether mom prepends a hierarchic numbering scheme to a heading level in the body of a document. Numbering of Table of Contents entries is controlled separately with TOC_ENTRY_NUMBERS. Mom also has a special macro to toggle whether to prefix a chapter number to numbered headings and Table of Contents entries, PREFIX_CHAPTER_NUMBER.

The argument list is long, so you may want to break it into several lines by using the backslash character (\). Here's an example of how you might style a level 1 heading:
.HEADING_STYLE 1 \ FONT B \ QUAD C \ UNDERSCORE .5 2p \ BASELINE_ADJUST 3p \ NUMBER This creates a level-1 heading style that's bold, centered, underscored and numbered, raised by 3 points from the baseline.

Prefixing chapter numbers

Macro: PREFIX_CHAPTER_NUMBER <none> | <chapter number as digit> | <anything>

If you’ve requested numbering for any level of heading and you’d like mom, in addition, to prefix a chapter number to the numbering scheme, you can do so with PREFIX_CHAPTER_NUMBER.

After you invoke .PREFIX_CHAPTER_NUMBER, mom will prepend the current chapter number to all headings you have requested be numbered with .HEADING_STYLE <n> NUMBER. Thus, assuming chapter number twelve (12):
1. LEVEL 1 HEADING 1.1. Level 2 heading would become
12.1. LEVEL 1 HEADING 12.1.1. Level 2 heading

When you invoke .PREFIX_CHAPTER_NUMBER without an argument, mom checks to see whether the argument you passed to CHAPTER is a digit. If it is, she immediately starts pre-pending the current chapter number to numbered head elements. If it isn’t (say you’ve called your chapter “One” instead of “1”), mom will abort with a request that you pass PREFIX_CHAPTER_NUMBER a digit representing the current chapter number.

In collated documents, mom automatically increments the digit used by PREFIX_CHAPTER_NUMBER by one (current chapter digit + 1) every time you invoke .COLLATE, even if you’ve (temporarily) turned off the prefixing of chapter numbers. Thus, even if you call your chapters “One”, “Two”, “Three” instead of “1”, “2”, “3”, mom will Do The Right Thing with respect to numbering head elements in all collated chapters following the first invocation of PREFIX_CHAPTER_NUMBER (assuming, of course, that the collated chapters are in incrementing order; if not, you must must put
.PREFIX_CHAPTER_NUMBER <chapter number> somewhere after the invocation of COLLATE and before the first numbered head element of each collated document).

PREFIX_CHAPTER_NUMBER can be disabled by passing it any argument other than a digit (eg OFF, QUIT, END, X, etc), although, as noted above, mom will keep, and—in the case of collated documents—increment the chapter number, allowing you to turn prefixing of chapter numbers to numbered head elements off and on according to your needs or whims.

Note: Because PREFIX_CHAPTER_NUMBER takes an (optional) digit representing the chapter number, it’s use need not be restricted to DOCTYPE CHAPTER. You can use it with any document type. Furthermore, even if your doctype isn’t CHAPTER, you can identify the document as a chapter for the purposes of numbering head elements by invoking the macro, .CHAPTER, with a numeric argument in your document setup.


Oldstyle headings

In versions of mom prior to 2.0, headings were entered by their commonly used names, viz. HEAD, SUBHEAD, and SUBSUBHEAD. The new HEADING scheme allows for greater flexibility, and permits seamless integration with PDF output.

Documents created with pre-2.0 versions may still use the oldstyle heading names, as may new documents, however there are some differences in their behaviour.

Whenever mom encounters an oldstyle heading, she loads the default style formerly associated with the oldstyle name. See below for a description of the default styles in the sections HEAD (now HEADING 1), SUBHEAD (now HEADING 2), and SUBSUBHEAD (now HEADING 3). Mom also emits a message to stderr alerting you to what she's doing.

The control macros formerly associated with oldstyle headings are no longer present in mom's macro file, which means that if you made changes to mom's default for those headings, you must recreate the changes with the HEADING_STYLE macro. The entire style need not be recreated, only those parameters that differed from mom's defaults. Thus, if your HEADs were set flush left, instead of the oldstyle default, centered, but otherwise kept mom's settings, you need only do
.HEADING_STYLE 1 QUAD L

Important: The macro, PARAHEAD, is no longer available. You must create paragraph heads using the HEADING macro. Mom will abort with an informational message whenever she encounters PARAHEAD. Assuming a heading level of 3 for your paraheads, the former defaults for PARAHEAD can be set up like this:
.HEADING STYLE 3 FONT BI SIZE -.25 \" For PRINTSTYLE TYPESET .HEADING STYLE 3 FONT I SIZE +0 \" For PRINTSTYLE TYPEWRITE Equally, the macro NUMBER_PARAHEADS is no longer available. You must enable numbering of the correct level for paraheads with HEADING_STYLE. Again assuming a heading level of 3 for paraheads, it's simply done:
.HEADING_STYLE 3 NUMBER

Correct usage of paraheads

It is tempting to choose an arbitrary heading level for paraheads, since they are sometimes needed out-of-sequence; for example, immediately after a main head (level-1) in a document that subsequently requires subheads (level-2). In such a circumstance, choosing level-3 for all your paraheads might seem to make sense, but in fact doesn’t, since it disrupts the hierarchy of both the Table of Contents (if your document has one) and the PDF outline.

Correct use of the PARAHEAD option to HEADING under such circumstances requires always assigning PARAHEAD to the next logical level in the heading hierarchy. For example, if there are no headings before the parahead, it should be assigned to level-1. If subsequently there is a main head to be followed by more paraheads, the main head should be level-1, and the paraheads level-2. This will almost certainly require assigning new style parameters to level-1 (with HEADING_STYLE) and to the level now being used for paraheads. The following example demonstrates.
.HEADING_STYLE 1 FONT BI SIZE +.25 \" parahead style, level-1 .PP .HEADING 1 PARAHEAD <parahead> <paragraph text> .PP .HEADING 1 PARAHEAD <parahead> <paragraph text> \# main head style, level-1 .HEADING_STYLE 1 FONT B SIZE +3 QUAD CENTER UNDERSCORE .5 2p .HEADING_STYLE 2 FONT BI SIZE +.25 \" parahead style, level-2 .HEADING 1 <main head> .PP <paragraph text> .PP .HEADING 2 PARAHEAD <parahead> <paragraph text>

OLDSTYLE HEADINGS

Macro: OLDSTYLE_HEADINGS

OLDSTYLE_HEADINGS requires no argument. It instructs mom to set the first three levels of heading to the parameters of her old defaults for HEAD, SUBHEAD, and SUBSUBHEAD. Use of OLDSTYLE_HEADINGS will also prevent mom from generating the message she issues the first time she encounters HEAD, SUBHEAD, and SUBSUBHEAD.

When invoked for the first time, with or without OLDSTYLE_HEADINGS, HEAD sets the parameters for level-1 headings to mom’s old HEAD defaults, then prints the head as a level-1 heading. The NAMED <id> optional argument is explained in the description of HEADING.

If, prior to invoking HEAD, you have given any parameters to level-1 heads with HEADING STYLE, they will be preserved; any you give afterwards will be respected.

The former style defaults for HEAD were:
FAMILY = prevailing document family FONT = bold (TYPESET); roman (TYPEWRITE) SIZE = +1 (TYPESET); +0 (TYPEWRITE) QUAD = C UNDERSCORE .5 2p CAPS

Note: The macro, NUMBER_HEADS, from pre-2.0 versions of mom, can still be used, though it is now a wrapper for
.HEADING_STYLE 1 NUMBER Mom will alert you to this on stderr.

Macro: SUBHEAD [ NAMED <id> ] "<text of head>" "<another line>"...

When invoked for the first time, with or without OLDSTYLE_HEADINGS, SUBHEAD sets the parameters for level-2 headings to mom’s old SUBHEAD defaults, then prints the subhead as a level-2 heading. The NAMED <id> optional argument is explained in the description of HEADING.

The former style defaults for SUBHEAD were:
FAMILY = prevailing document family FONT = bold (TYPESET); italic, ie underlined (TYPEWRITE) SIZE = +.5 (TYPESET); +0 (TYPEWRITE) QUAD = L BASELINE_ADJUST = 1/8 the current leading

Note: The macro, NUMBER_SUBHEADS, from pre-2.0 versions of mom, can still be used, though it is now a wrapper for
.HEADING_STYLE 2 NUMBER Mom will alert you to this on stderr.

Macro: SUBSUBHEAD [ NAMED <id> ] "<text of head>" "<another line>"...

When invoked for the first time, with or without OLDSTYLE_HEADINGS, SUBSUBHEAD sets the parameters for level-3 headings to mom’s old SUBSUBHEAD defaults, then prints the subsubhead as a level-3 heading. The NAMED <id> optional argument is explained in the description of HEADING.

The former style defaults for SUBSUBHEAD were:
FAMILY = prevailing document family FONT = italic (TYPESET); roman (TYPEWRITE) SIZE = +.5 (TYPESET); +0 (TYPEWRITE) QUAD = L BASELINE_ADJUST = 1/8 the current leading

Note: The macro, NUMBER_SUBSUBHEADS, from pre-2.0 versions of mom, can still be used, though it is now a wrapper for
.HEADING_STYLE 3 NUMBER Mom will alert you to this on stderr.


Linebreaks (section breaks)

Linebreaks (“author linebreaks”, “section breaks”) are gaps in the vertical flow of running text that indicate a shift in content (eg a scene change in story). They are frequently set off by typographic symbols, sometimes whimsical in nature.

LINEBREAK

Macro: LINEBREAK

Alias: SECTION

LINEBREAK takes no arguments. Simply invoke it (on a line by itself, of course) whenever you want to insert an author linebreak.

LINEBREAK control macros and defaults

By default, mom marks author linebreaks with three centred asterisks (stars) in the prevailing colour of the document (by default, black). You can alter this with the control macros

  1. LINEBREAK_CHAR
  2. LINEBREAK_COLOR

1. Linebreak character

Macro: LINEBREAK_CHAR [ <character> ] [ <iterations> [ <vertical adjustment> ] ]

Alias: SECTION_CHAR

• The third optional argument requires a unit of measure.

LINEBREAK_CHAR determines what mom prints when LINEBREAK is invoked. It takes 3 optional arguments: the character you want deposited at the line break, the number of times you want the character repeated, and a vertical adjustment factor.

The first argument is any valid groff character (eg * [an asterisk], \[dg] [a dagger], \f[ZD]\N'141\fP [an arbitrary character from Zapf Dingbats], \l'4P' [a 4-pica long rule]). Mom sets the character centred on the current line length. (See man groff_char for a list of all valid groff characters.)

The second argument is the number of times to repeat the character.

The third argument is a +|-value by which to raise (+) or lower (-) the character in order to make it appear visually centred between sections of text. This lets you make vertical adjustments to characters that don’t sit on the baseline (such as asterisks). The argument must be preceded by a plus or minus sign, and must include a unit of measure.

If you enter LINEBREAK_CHAR with no arguments, sections of text will be separated by two blank lines when you invoke .LINEBREAK.

Mom’s default for LINEBREAK_CHAR is
.LINEBREAK_CHAR * 3 -3p ie three asterisks, lowered 3 points from their normal vertical position (for PRINTSTYLE TYPESET; the vertical adjustment is -2 points for PRINTSTYLE TYPEWRITE).

2. Linebreak colour

Macro: LINEBREAK_COLOR <colourname>

Alias: SECTION_COLOR

To change the colour of the linebreak character(s), simply invoke .LINEBREAK_COLOR with the name of a colour pre-defined (or “initialized”) with NEWCOLOR or XCOLOR.


Quotes (line for line, poetry or code)

Quotes are always set in nofill mode, flush left. This permits entering quotes on a line for line basis in your text editor and have them come out the same way on output copy. (See Blockquotes for how quotes, in the present sense, differ from longer passages of cited text.)

Since mom originally came into being to serve the needs of creative writers (ie novelists, short story writers, etc.—not to cast aspersions on the creativity of mathematicians and programmers), she sets quotes in italics (PRINTSTYLE TYPESET) or underlined (PRINTSTYLE TYPEWRITE), indented from the left margin. Obviously, she’s thinking “quotes from poetry or song lyrics”, but with the QUOTE control macros you can change her defaults so QUOTE serves other needs, eg entering verbatim snippets of programming code, command line instructions, and so on. (See the CODE for a convenience macro to assist in including code snippets in documents.)

QUOTE spacing

Besides indenting quotes, mom further sets them off from running text with a small amount of vertical whitespace top and bottom. In PRINTSTYLE TYPEWRITE, this is always one full linespace. In PRINTSTYLE TYPESET, it’s 1/2 of the prevailing leading if the quote fits fully on the page (ie with running text above and below it), otherwise it’s a full linespace either above or below as is necessary to balance the page to the bottom margin. This behaviour can be changed with the control macro ALWAYS_FULLSPACE_QUOTES.

Further notes on quote spacing

If your quote (or blockquote) leading differs from the document leading, mom attempts to observe the same rules for vertical whitespace outlined above; however, she will also insert a small, flexible amount of extra whitespace around the quotes to make sure the whitespace is equal, top and bottom. Since she does this on a quote by quote basis, rather than by figuring out how much extra whitespace is needed to adjust all quotes on a page, the spacing around multiple quotes on the same page will differ slightly, although each will be balanced between lines of normal running text, top and bottom. (The inability to scan an entire page and insert equalized whitespace at marked places is a limitation of groff, which, by and large, processes text on a line-per-line basis.)

Disable shimming of quotes and blockquotes

If you don’t want the behaviour described above (ie you don’t want mom shimming quotes and blockquotes), issue the macro
.NO_SHIM in the style sheet section of your document (ie after PRINTSTYLE but before START), which will disable shimming globally, or on a per-instance basis prior to .QUOTE or .BLOCKQUOTE.

If you’ve disabled shimming of quotes and blockquotes with .NO_SHIM and you want mom to return to her default behaviour in this matter, invoke .NO_SHIM OFF (or QUIT, END, X, etc).

Please note that NO_SHIM disables shimming before headings, and the SHIM macro itself.

If you don’t provide mom with a QUOTE_AUTOLEAD, quotes are leaded at the default for normal running text, meaning that multiple quotes on the same page are all spaced identically.

Keeping QUOTEs and BLOCKQUOTEs together as a block

The text of quotes and blockquotes is output immediately, and may therefore start on one page and finish on the next. If you wish to keep the text together as a block, deferred to the following page if the block doesn’t all fit on one page, wrap (BLOCK)QUOTE / (BLOCK)QUOTE OFF inside a float. If you further wish to force a page break before the floated quote or blockquote (leaving whitespace at the bottom of the page, pass FLOAT the FORCE argument. .FLOAT FORCE .QUOTE Fly me to the moon And let me play among the stars Let me see what life is like On Jupiter and Mars .QUOTE END .FLOAT OFF

QUOTE

Macro: QUOTE toggle

QUOTE is a toggle macro. To begin a section of quoted text, invoke it with no argument, then type in your quote. When you’re finished, invoke .QUOTE with any argument (eg OFF, END, X, Q...) to turn it off. Example:
.QUOTE Nymphomaniacal Jill Used a dynamite stick for a thrill They found her vagina In North Carolina And bits of her tits in Brazil. .QUOTE END

1. Family/font/size/colour/indent

See Arguments to the control macros.

.QUOTE_FAMILY default = prevailing document family; default is Times Roman .QUOTE_FONT default = italic; underlined in TYPEWRITE .QUOTE_SIZE default = +0 (ie same size as paragraph text) .QUOTE_AUTOLEAD default = none; leading of quotes is the same as paragraphs .QUOTE_COLOR default = black .QUOTE_INDENT (see below, "Quote indent")

Quote indent

QUOTE_INDENT takes one of two kinds of argument: an integer representing the amount by which to multiply the argument passed to .PARA_INDENT (by default, 2 ems for TYPESET, 3 picas for TYPEWRITE) to arrive at the quote indent, or a distance with a unit of measure appended. Both result in quotes being indented equally from the left and right margins.

The default value for QUOTE_INDENT is 3 (for PRINTSTYLE TYPESET) and 1 (for PRINTSTYLE TYPEWRITE).

Note: If your PARA_INDENT is 0 (ie no indenting of the first line of paragraphs), you must set a QUOTE_INDENT yourself, with a unit of measure appended to the argument. Mom has no default for QUOTE_INDENT if paragraph first lines are not being indented.

Additional note: QUOTE_INDENT also sets the indent for blockquotes.

2. Spacing above and below quotes (typeset only)

If you’d like mom always to put a full linespace above and below quotes, invoke
.ALWAYS_FULLSPACE_QUOTES with no argument. If you wish to restore mom’s default behaviour regarding the spacing of quotes (see above), invoke the macro with any argument (OFF, QUIT, END, X...)

Note: This macro also sets mom’s spacing policy for blockquotes.

3. Underlining quotes (typewrite only)

By default in PRINTSTYLE TYPEWRITE, mom underlines quotes. If you’d rather she didn’t, invoke .UNDERLINE_QUOTES with any argument (OFF, QUIT, END, X...) to disable the feature. Invoke it without an argument to restore mom’s default underlining of quotes.

If you not only wish that mom not underline quotes, but also that she set them in italic, you must follow each instance of QUOTE with the typesetting macro FT I. Furthermore, since mom underlines all instances of italics by default in PRINTSTYLE TYPEWRITE, you must also make sure that ITALIC_MEANS_ITALIC is enabled (see PRINTSTYLE TYPEWRITE control macros).


Blockquotes (cited material)

Blockquotes are used to cite passages from another author’s work. So that they stand out well from running text, mom indents them from both the left and right margins and sets them in a different point size (PRINTSTYLE TYPESET only). Output lines are filled, and, by default, quadded left.

Besides indenting blockquotes, mom further sets them off from running text with a small amount of vertical whitespace top and bottom. (See above for a complete explanation of how this is managed, and how to control it.)

BLOCKQUOTE

Macro: BLOCKQUOTE toggle

Aliases: CITE, CITATION

BLOCKQUOTE is a toggle macro. To begin a cited passage, invoke the tag with no argument, then type in your blockquote. When you’re finished, invoke .BLOCKQUOTE with any argument (eg OFF, END, X, Q...) to turn it off. Example:
.BLOCKQUOTE Redefining the role of the United States from enablers to keep the peace to enablers to keep the peace from peacekeepers is going to be an assignment. .RIGHT \[em]George W. Bush .BLOCKQUOTE END If the cited passage runs to more than one paragraph, you must introduce each paragraph—including the first—with .PP.

Note: The aliases CITE and CITATION may be used in place of the BLOCKQUOTE tag, as well as in any of the control macros that begin or end with BLOCKQUOTE_.

1. Family/font/size/colour/quad/indent

See Arguments to the control macros.

.BLOCKQUOTE_FAMILY default = prevailing document family; default is Times Roman .BLOCKQUOTE_FONT default = roman .BLOCKQUOTE_SIZE default = -1 (point) .BLOCKQUOTE_AUTOLEAD default = none; leading of blockquotes is the same as paragraphs .BLOCKQUOTE_COLOR default = black .BLOCKQUOTE_QUAD default = left .BLOCKQUOTE_INDENT (see below)

Blockquote indent

BLOCKQUOTE_INDENT takes one of two kinds of argument: an integer representing the amount by which to multiply the argument passed to .PARA_INDENT (by default, 2 ems for TYPESET, 3 picas for TYPEWRITE) to arrive at the blockquote indent, or a distance with a unit of measure appended. Both result in blockquotes being indented equally from the left and right margins.

The default value for BLOCKQUOTE_INDENT is 3 (for PRINTSTYLE TYPESET) and 1 (for PRINTSTYLE TYPEWRITE).

Note: If your PARA_INDENT is 0 (ie no indenting of the first line of paragraphs), you must set a BLOCKQUOTE_INDENT yourself, with a unit of measure appended to the argument. Mom has no default for BLOCKQUOTE_INDENT if paragraph first lines are not being indented.

Additional note: BLOCKQUOTE_INDENT also sets the indent for quotes.

2. Spacing above and below blockquotes (typeset only)

If you’d like mom always to put a full linespace above and below blockquotes, invoke
.ALWAYS_FULLSPACE_QUOTES with no argument. If you wish to restore mom’s default behaviour regarding the spacing of blockquotes (see above), invoke the macro with any argument (OFF, QUIT, END, X...).

Note: This macro also sets mom’s spacing policy for quotes.


Inserting code into a document

CODE is a convenience macro that facilitates entering code blocks into documents. Its use is not restricted to documents created using mom’s document processing macros; it can be used for “manually” typeset documents as well.

CODE

Macro: CODE [BR | BREAK | SPREAD] toggle

Inline escape: \*[CODE]

When you invoke the macro, .CODE, or insert \*[CODE] into running text, mom switches to a fixed-width font (Courier, by default) and turns SMARTQUOTES off.

If your code includes the backslash character, which is groff’s escape character, you will have to change the escape character temporarily to something else with the macro, ESC_CHAR. Mom has no way of knowing what special characters you’re going to use in code snippets, therefore she cannot automatically replace the escape character with something else.

The correct order for changing the escape character inside CODE is .CODE .ESC_CHAR character <code> .ESC_CHAR . .CODE OFF

Alternatively, you can enter the backslash character as \e, which tells groff to print a literal backslash.

Note: .CODE does not cause a line break when you’re in a fill mode (ie JUSTIFY or QUAD LEFT, CENTER, or RIGHT). If you want CODE to deposit a break, invoke .CODE with the argument BR (or BREAK). If, in addition to having mom break the line before .CODE, you want her to force justify it as well, invoke .CODE with the argument, SPREAD. If, in addition to breaking the line before CODE you want a break afterwards, you must supply it manually with BR unless what follows immediately is a macro that automatically causes a break (eg PP).

In all likelihood, if you want the situation described above (ie a break before and after CODE), what you probably want is to use QUOTE in conjunction with CODE, like this:
.QUOTE .CODE $ echo "Hello, world" | sed -e 's/Hello,/Goodbye, cruel/' .CODE OFF .QUOTE OFF QUOTE takes care of breaking both the text and the code, as well as indenting the code and offsetting it from running text with vertical whitespace.

Passing any argument other than BR, BREAK or SPREAD to CODE (eg OFF, QUIT, END, X, etc.) turns CODE off and returns the family, font, and smartquotes back to their former state.

Using \*[CODE] inline

\*[CODE] invokes .CODE, allowing you to bracket code snippets inline. It does not accept the BR, BREAK, or SPREAD arguments. It is most useful for short snippets, as in the following example.
\*[CODE]apropos\*[CODE OFF] and \*[CODE]man -k\*[CODE] are identical.

\*[CODE] does not permit changing the escape character, so \e must be used. Furthermore, if your code starts with a period, you must enter it as “\&.”.
Registers are created with the \*[CODE]\&.nr\*[CODE OFF] request.

CODE and punctuation

.CODE OFF automatically inserts a word space into running text. If your CODE block is to be followed by punctuation with the parameters of running text, you must terminate the block with “\c” and enter the punctuation at the beginning of the next input line. If the punctuation mark is a period, you must precede it with “\&”.
...for example, .CODE echo "Hello, world" | sed -e 's/Hello,/Goodbye, cruel/'\c .CODE OFF \&. As this demonstrates... Use of \*[CODE] inline does not require the \c, however periods after \*[CODE OFF] still need to be introduced with \&, as in this example:
...append the unit of measure \*[CODE]p\*[CODE OFF]\&. New sentence...

CODE control macros and defaults

  1. Family/Font/Colour
  2. Size

1. Family/font/colour

See Arguments to the control macros.

.CODE_FAMILY default = Courier .CODE_FONT default = roman; see Note .CODE_COLOR default = black Note: Unlike other control macros, CODE_FONT sets the code font for both PRINTSTYLE TYPESET and PRINTSTYLE TYPEWRITE.

2. Size

CODE_SIZE works a little differently from the other _SIZE macros (see Arguments to the control macros). The argument you pass it is a percentage of the prevailing document point size. It does not require a pre-pended plus (+) or minus (-) sign, nor an appended percent sign (%). Thus, is you want the point size of your CODE font to be 90% of the prevailing document point size, you enter:
.CODE_SIZE 90 Fixed-width fonts have notoriously whimsical x-heights, meaning that they frequently look bigger (or, in some cases, smaller) than the type surrounding them, even if they're technically the same point size. CODE_SIZE lets you choose a percentage of the prevailing point size for your fixed-width CODE font so it doesn't look gangly or miniscule in relation to the type around it. All invocations of .CODE or \*[CODE] will use this size, so that if you decide to change the prevailing point size of your document, the CODE font will be scaled proportionally.


Nested lists

Lists are points or items of interest or importance that are separated from running text by enumerators. Some typical enumerators are en-dashes, bullets, digits and letters.

Setting lists with mom is easy. First, you initialize a list with the LIST macro. Then, for every item in the list, you invoke the macro, .ITEM, followed by the text of the item. When a list is finished, you exit the list with .LIST OFF (or QUIT, END, BACK, etc.)

By default mom starts each list with the enumerator flush with the left margin of running text that comes before it, like this:
My daily schedule needs organizing. I can’t seem to get everything done I want. o an hour’s worth of exercise o time to prepare at least one healthy meal per day o reading time o work on mom o writing - changes from publisher - current novel o a couple of hours at the piano In other words, mom does not, by default, indent entire lists. Indenting a list is controlled by the macro, SHIFT_LIST. (This is a design decision; there are too many instances where a default indent is not desirable.) Equally, mom does not add any extra space above or below lists.

Lists can be nested (as in the example above). In other words, you can set lists within lists, each with an enumerator (and possibly, indent) of your choosing. In nested lists, each invocation of .LIST OFF (you may prefer to use .LIST BACK) takes you back to the previous depth (or level) of list, with that list’s enumerator and indent intact. The final .LIST OFF exits lists completely and returns you to the left margin of running text.

Finally, lists can be used in documents created with either the document processing macros or the typesetting macros.

LIST

Macro: LIST [ BULLET | DASH | DIGIT | ALPHA | alpha | ROMAN<n> | roman<n> | USER <string>] [ <separator> | <user-defined enumerator> ] [ <prefix> ] [ <off> ]

Invoked by itself (ie with no argument), LIST initializes a list (with bullets as the default enumerator). Afterwards, each block of input text preceded by .ITEM, on a line by itself, is treated as a list item.

Note: Every time you invoke .LIST to start a list (as opposed to exiting one), you must supply an enumerator (and optionally, a separator) for the list, unless you want mom’s default enumerator, which is a bullet. Within nested lists, mom stores the enumerator, separator and indent for any list you return backwards to (ie with .LIST OFF), but does not store any information for lists you move forward to.

There are a lot of arguments (be sure to side-scroll through them all, above), so I’ll discuss them one at a time here.

The first argument – enumerator style

The optional arguments BULLET, DASH, DIGIT (for Arabic numerals), ALPHA (for uppercase letters), alpha (for lowercase letters), ROMAN<n> (for uppercase roman numerals), roman<n> (for lowercase roman numerals) tell mom what kind of enumerator to use for a given list.

The arguments, ROMAN<n> and roman<n>, are special. You must append to them a digit (arabic, eg "1" or "9" or "17") saying how many items a particular roman-numeralled LIST is going to have. Mom requires this information in order to align roman numerals sensibly, and will abort—with a message — if you don’t provide it.

A roman-numeralled list containing, say, five items, would be set up like this:
.LIST roman5 producing i) Item 1. .ITEM ii) Item 2. Item 1. iii) Item 3. .ITEM iv) Item 4. Item 2. v) Item 5. .ITEM Item 3 .ITEM Item 4 .ITEM Item 5

The argument, USER, lets you make up your own enumerator, and must be followed by a second argument: what you’d like the enumerator to look like.

For example, if you want a list enumerated with =>,
.LIST USER => .ITEM A list item will produce
=> A list item Some useful special groff characters you might want to pass to USER are: \[sq] - square box \[rh] - pointing hand \[->] - right arrow \[rA] - right double arrow \[OK] - checkmark The size and vertical positioning of special characters may be adjusted with inline escapes in the argument passed to USER. For example, to raise the position of \[sq] slightly, you might do .LIST USER "\*[UP .25p]\[sq]\*[DOWN .25p]" or .LIST USER \v'-.25p]\[sq]\[\v'.25p']

Note: If the argument to USER contains spaces, you must enclose the argument in double quotes.

The second argument – separator style

If you choose DIGIT, ALPHA, alpha, ROMAN<n>, or roman<n>, you may enter the optional argument, separator, to say what kind of separator you want after the enumerator. The separator can be anything you like. The default for DIGIT is a period (dot), like this:
1. A list item The default separator for ALPHA, alpha, ROMAN<n> and roman<n> is a right parenthesis, like this:
a) An alpha-ed list item b) A second alpha-ed list item If you’d prefer, say, digits with right-parenthesis separators instead of the default period, you’d do
.LIST DIGIT ) .ITEM A numbered list item which would produce
1) A numbered list item

Note: BULLET, DASH and USER do not take a separator.

The third argument – prefix style

Additionally, you may give a prefix (ie a character that comes before the enumerator) when your enumerator style for a particular list is DIGIT, ALPHA, alpha, ROMAN<n> or roman<n>. In the arguments to LIST, the prefix comes after the separator, which is counter-intuitive, so please be careful.

A prefix can be anything you like. Most likely, you’ll want some kind of open-bracket, such as a left parenthesis. If, for example, you want a DIGIT list with the numbers enclosed in parentheses, you’d enter
.LIST DIGIT ) ( .ITEM The first item on the list. .ITEM The second item on the list. which would produce
(1) The first item on the list. (2) The second item on the list.

Note: BULLET, DASH and USER do not take a prefix.

Exiting lists – LIST OFF/BACK or QUIT_LISTS

Any single argument to LIST other than BULLET, DASH, DIGIT, ALPHA, alpha, ROMAN<n>, roman<n> or USER (eg LIST OFF or LIST BACK) takes you out of the current list.

If you are at the first list-level (or list-depth), mom returns you to the left margin of running text. Any indents that were in effect prior to setting the list are fully restored.

If you are in a nested list, mom moves you back one list-level (ie does not take you out of the list structure) and restores the enumerator, separator and indent appropriate to that level.

Each invocation of .LIST should thus be be matched by a corresponding .LIST OFF in order to fully exit lists. For example,
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore. o List item in level 1 o List item in level 1 - List item in level 2 - List item in level 2 Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore. is created like this:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore. .LIST BULLET .ITEM List item in level 1 .ITEM List item in level 1 .LIST DASH .ITEM List item in level 2 .ITEM List item in level 2 .LIST OFF \" Turn level 2 list off .LIST OFF \" Turn level 1 list off Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore.

Alternatively, you may use the single-purpose macro, .QUIT_LISTS, to get yourself out of a list structure. In the example above, the two .LIST OFF lines could be replaced with a single .QUIT_LISTS.

ITEM

Macro: ITEM

After you’ve initialized a list with LIST, precede each item you want in the list with .ITEM. Mom takes care of everything else with respect to setting the item appropriate to the list you’re in.

In document processing, it is valid to have list items that contain multiple paragraphs. Simply issue a .PP request for each paragraph following the first item. I.e., don’t do this:
.ITEM .PP Some text... .PP A second paragraph of text but rather
.ITEM Some text... .PP A second paragraph of text

1. Indenting lists – SHIFT_LIST

If you want a list to be indented to the right of running text, or indented to the right of a current list, use the macro SHIFT_LIST immediately after LIST. SHIFT_LIST takes just one argument: the amount by which you want the list shifted to the right. The argument requires a unit of measure.

SHIFT_LIST applies only to the list you just initialized with LIST. It does not carry over from one invocation of LIST to the next. However, the indent remains in effect when you return to a list level in a nested list.

For example, if you want a 2-level list, with each list indented to the right by 18 points,
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore. .LIST \" List 1 .SHIFT_LIST 18p \" Indent 18 points right of running text .ITEM List 1 item .ITEM List 1 item .LIST DASH \" List 2 .SHIFT_LIST 18p \" Indent 18 points right of list 1 .ITEM List 2 item .ITEM List 2 item .LIST OFF \" Move back to list 1 .ITEM List 1 item .ITEM List 1 item .LIST OFF \" Exit lists Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore. produces (approximately)
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore. o List 1 item o List 1 item - List 2 item - List 2 item o List 1 item o List 1 item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore.

2. Resetting an initialized list’s enumerator – RESET_LIST

In nested lists, if your choice of list enumerator for a given level of list is DIGIT, ALPHA, alpha, ROMAN or roman, you may sometimes want to reset the list’s enumerator when you return to that list. Consider the following:
Things to do religiously each and every day: 1. Take care of the dog a) walk every day b) brush once a week - trim around the eyes every fourth brushing - don’t forget to check nails 2. Feed the cat a) soft food on Mon., Wed. and Fri. b) dry food on Tues., Thurs. and Sat. c) canned tuna on Sunday

Normally, within a nested list, when you return to an incrementally-enumerated list, the enumerator continues incrementing from where it left off. That means, in the example above, the normal state of affairs for the alpha'ed list under
2. Feed the cat would be d), e) and f). The solution, in such a case, is simply to reset the enumerator—before .ITEM—with the macro, .RESET_LIST. By default, with no argument, .RESET_LIST resets the enumerator to 1, A, a, I or i depending on the style of enumerator. You may, if you wish, pass .RESET_LIST a numeric argument representing the starting enumerator for the reset (if different from "1"), although I can’t at present think of a use for this feature.

3. Padding digit enumerators – PAD_LIST_DIGITS

Arabic digits

When your choice of enumerators is DIGIT and the number of items in the list exceeds nine (9), you have to make a design decision: should mom leave room for the extra numeral in two-numeral digits to the right or the left of the single-numeral digits?

If you want the extra space to the right, invoke the macro, .PAD_LIST_DIGITS (with no argument), after .LIST and before .ITEM. This will produce something like
8. List item 9. List item 10. List item If you want the extra space to the left, invoke .PAD_LIST_DIGITS with the single argument, LEFT, which will produce
8. List item 9. List item 10. List item

Of course, if the number of items in the list is less than ten (10), there’s no need for PAD_LIST_DIGITS.

Roman numerals

By default, mom sets roman numerals in lists flush left. The <n> argument appended to ROMAN<n> or roman<n> allows her to calculate how much space to put after each numeral in order to ensure that the text of items lines up properly.

If you’d like the roman numerals to line up flush right (ie be padded "left"), simply invoke .PAD_LIST_DIGITS LEFT after .LIST ROMAN<n> or .LIST roman<n> and before .ITEM.


Line numbering – prepend numbers to output lines

When you turn line-numbering on, mom, by default

  • numbers every line of paragraph text; line-numbering is suspended for all other document processing tags (like docheaders, epigraphs, headings, quotes, etc.) and special pages (covers, endotes, bibliographies, etc.); be aware, though, that if you turn docheaders off (with DOCHEADER OFF) and create your own docheader, mom will line-number your custom docheader, so turn line numbering on afterwards
  • doesn’t touch your line length; line numbers are hung outside your current left margin (as set with L_MARGIN, PAGE or DOC_LEFT_MARGIN), regardless of any indents that may be active
  • separates line numbers from running text by two figure spaces.

Mom expects that QUOTEs and BLOCKQUOTEs will not be line-numbered, however control macros are provided to enable line numbering for either. See Line numbering control macros for quotes and blockquotes.

NUMBER_LINES

Macro: NUMBER_LINES <start number> [ <which lines to number> [ <gutter> ] ]
Macro: NUMBER_LINES <anything> | RESUME

NUMBER_LINES does what it says: prints line numbers, to the left of output lines of paragraph text. One of the chief reasons for wanting numbered lines is in order to identify footnotes or endnotes by line number instead of by a marker in the text. (See Footnotes by linenumber for instructions on line-numbered footnotes, and ENDNOTE_MARKER_STYLE LINE for instructions on line-numbered endnotes.)

Note: Do not use NUMBER_LINES inside QUOTE or BLOCKQUOTE. By default, mom expects that quotes and blockquotes will not be line numbered. If you wish to enable line numbering for them, you must invoke NUMBER_QUOTE_LINES or NUMBER_BLOCKQUOTE_LINES.

The first time you invoke NUMBER_LINES you must, at a minimum, tell it what line number you want the next output line to have. The optional arguments which lines to number and gutter allow you to state which lines should be numbered (eg every five or every ten lines), and the gutter to place between line numbers and running text.

For example, if you want mom to number output lines using her defaults, .NUMBER_LINES 1 will prepend the number, 1, to the next output line and number all subsequent output lines sequentially.

If you want only every five lines numbered, pass mom the optional which lines to number argument, like this: .NUMBER_LINES 1 5

GOTCHA! The argument to <which lines to number> instructs mom to number only those lines that are multiples of the argument. Hence, in the above example, line number 1 will not be numbered, since 1 is not a multiple of 5.

If you want line number 1 to be numbered, you have to invoke .NUMBER_LINES 1 1 before the first output line you want numbered, then study your output copy and determine where best to insert the following in your input input text:
.NUMBER_LINES \n[ln] 5 (The escape, \n[ln], ensures that NUMBER_LINES automatically supplies the correct value for the first argument, <start number>.)

Following this recipe, line number 1 will be numbered; subsequently, only line numbers that are multiples of 5 will be numbered. A little experimentation may be required to determine the best place for it in your input text.

The optional argument, <gutter>, tells mom how much space to put between the line numbers and the running text. <gutter> does not require (or even accept) a unit of measure. The argument you pass to it is the number of figure spaces you want between line numbers and running text. Mom’s default gutter is two figure spaces. If you’d like a wider gutter, say, four figures spaces, you’d do
.NUMBER_LINES 1 1 4 | +-- Notice you *must* supply a value for the 2nd argument in order to supply a value for the 3rd.

Note: When giving a value for <gutter>, you cannot skip the <which lines to number> argument. Either fill in the desired value, or use two double-quotes ( "" ) to have mom use the value formerly in effect.

Off/suspend, resume

After initializing line numbering, you can suspend it, with the option to resume, using
.NUMBER_LINES OFF (or END, QUIT, X, etc).

To resume line numbering:
.NUMBER_LINES RESUME When you resume, the line number will be the next in sequence from where you left off. If that is not what you want—say you want to reset the line number to 1—re-invoke .NUMBER_LINES with whatever arguments are needed for the desired result.

Additional notes:

  1. In document processing, you may invoke .NUMBER_LINES either before or after .START. Mom doesn’t care.
  2. If you’re collating documents with COLLATE, you should re-invoke, at a minimum, .NUMBER_LINES 1 for each collated document, in order to ensure that each begins with the number, 1, prepended to the first line.
  3. Occasionally, you may want to change the current gutter between line numbers and running text without knowing what the next output line number should be. Since NUMBER_LINES requires this number as its first argument, in such instances, pass NUMBER_LINES as its first argument the escape \n[ln].
    For example, if you were numbering every 5 lines with a gutter of 2 (figure spaces) and you needed to change the gutter to 4 (figures spaces),
    .NUMBER_LINES \n[ln] 5 4 would do the trick.
  4. If you’re using margin notes in a document, be sure to set the gutter for margin notes wide enough to allow room for the line numbers.
  5. Mom (groff, actually), only numbers lines to the left of running text. For aesthetic reason, therefore, the use of line numbering when setting a document in columns is discouraged. However, should you wish to number lines when setting in columns, make sure the gutter(s) between columns is wide enough to leave room for the numbers.

1. Family/font/size/colour

See Arguments to the control macros.

.LINENUMBER_FAMILY default = prevailing family or document family; default is Times Roman .LINENUMBER_FONT default = prevailing font .LINENUMBER_SIZE default = +0 .LINENUMBER_COLOR default = black

2. Line numbering control macros for QUOTE and BLOCKQUOTE

• Including QUOTEs and BLOCKQUOTEs in the line numbering scheme

If you’d like mom to number lines in a QUOTE or BLOCKQUOTE as part of the same order and sequence as paragraph text, invoke .NUMBER_QUOTE_LINES or .NUMBER_BLOCKQUOTE_LINES either before or after NUMBER_LINES. Both behave identically with respect to the affected macro (ie QUOTE or BLOCKQUOTE).

• Selectively enabling line numbering for QUOTEs and BLOCKQUOTEs

If you’d like to enable line numbering selectively for quotes and blockquotes only, enable NUMBER_QUOTE_LINES or NUMBER_BLOCKQUOTE_LINES first, followed by NUMBER_LINES <n>, where <n> is the first line number of the quote or blockquote. Afterwards, enter your QUOTE or BLOCKQUOTE. When the quote or blockquote is finished (ie after QUOTE OFF or BLOCKQUOTE OFF), turn line numbering off. Each subsequent quote or blockquote you want line numbered requires only NUMBER_LINES <n> (with a corresponding NUMBER_LINES OFF) until you turn NUMBER_QUOTE_LINES or NUMBER_BLOCKQUOTE_LINES off.

Here’s a recipe where the first line number of quotes starts repeatedly at “1”. <running text> .NUMBER_QUOTE_LINES .NUMBER_LINES 1 .QUOTE <text of quote> .QUOTE OFF .NUMBER_LINES OFF <further running text> .NUMBER_LINES 1 .QUOTE <text of quote> .QUOTE OFF .NUMBER_LINES OFF <further running text>

• Changing the line number gutter for QUOTEs and BLOCKQUOTEs

Owing to groff’s restriction on accepting only the figure space as the line number gutter’s unit of measure, it is not possible for line numbers in quotes or blockquotes to hang outside a document’s overall left margin and be reliably flush with the line numbers of paragraph text. Conseqently, line numbers in quotes or blockquotes hang to the left of the quote, separated by the currently active gutter for NUMBER_LINES.

If you’d like to change the line number gutter for quotes or blockquotes, invoke NUMBER_QUOTE_LINES or NUMBER_BLOCKQUOTE_LINES with a digit representing the number of figure spaces you’d like between the line numbers and the quoted text, like this:
.NUMBER_QUOTE_LINES 3 With the above, line numbers in quotes (and only quotes) will have a gutter of 3 figure spaces.

• Silently increment line numbers during QUOTE and BLOCKQUOTE

If you’ve asked mom not to line number quotes or blockquotes, but would like line numbering to continue while they’re being output (as opposed to mom’s default behaviour of suspending incrementing of line numbers during the output of quotes and blockquotes), invoke .NUMBER_QUOTE_LINES SILENT or .NUMBER_BLOCKQUOTE_LINES SILENT With these, mom continues to increment line numbers while quotes or blockquotes are being output, but the line numbers won’t appear in the output copy.

Once having turned NUMBER_QUOTE_LINES or NUMBER_BLOCKQUOTE_LINES on, you may disable them with .NUMBER_QUOTE_LINES OFF or .NUMBER_BLOCKQUOTE_LINES OFF


Footnotes

For something so complex behind the scenes, footnotes are easy to use. You just type, for example,
...the doctrines of Identity as urged by Schelling\c .FOOTNOTE <footnote about who the hell is Schelling> .FOOTNOTE OFF were generally the points of discussion presenting the most of beauty to the imaginative Morella. and be done with it. (Note the obligatory use of the \c inline escape, required whenever your FOOTNOTE_MARKER_STYLE is either STAR [star/dagger footnotes] or NUMBER [superscript numbers].)

After you invoke .FOOTNOTE, mom takes care of everything: putting footnote markers in the body of the document, keeping track of how many footnotes are on the page, identifying the footnotes themselves appropriately, balancing them properly with the bottom margin, deferring footnotes that don’t fit on the page... Even if you’re using COLUMNS, mom knows what to do, and Does The Right Thing.

Note: See refer.html for information on using footnotes with the refer bibliographic database.

Footnote behaviour

Footnotes can be sly little beasts. If you’re writing a document that’s footnote-heavy, you might want to read the following.

By default, mom marks footnotes with alternating stars (asterisks), daggers, and double-daggers. The first footnote gets a star, the second a dagger, the third a double-dagger, the fourth two stars, the fifth two daggers, etc. If you prefer numbered footnotes, rest assured mom is happy to oblige.

A small amount of vertical whitespace and a short horizontal rule separate footnotes from the document body. The amount of whitespace varies slightly from page to page depending on the number of lines in the footnotes. Mom tries for a nice balance between too little whitespace and too much, but when push comes to shove, she’ll usually opt for ample over cramped. The last lines of footnotes are always flush with the document’s bottom margin.

If mom sees that a portion of a footnote cannot be fit on its page, she carries that portion over to the next page. If an entire footnote can’t be fit on its page (ie FOOTNOTE has been called too close to the bottom), she defers the footnote to the next page, but sets it with the appropriate marker from the previous page.

When footnotes occur within cited text, for example a QUOTE or a BLOCKQUOTE, mom will usually opt for deferring the footnote over to the next page if it allows her to complete the cited text on one page.

In the unfortunate happenstance that a deferred footnote is the only footnote on its page (ie it’s marked in the document body with a star) and the page it’s deferred to has its own footnotes, mom separates the deferred footnote from the page’s proper footnote(s) with a blank line. This avoids the confusion that might result from readers seeing two footnote entries on the same page identified by a single star (or the number 1 if you’ve requested numbered footnotes that begin at 1 on every page). The blank line makes it clear that the first footnote entry belongs to the previous page.

In the circumstance where a deferred footnote is not the only one on its page, and is consequently marked by something other than a single star, there’s no confusion and mom doesn’t bother with the blank line. (By convention, the first footnote on a page is always marked with a single star, so if readers see, say, a dagger or double-dagger marking the first footnote entry, they’ll know the entry belongs to the previous page).

Very exceptionally, two footnotes may have to be deferred (eg one occurs on the second to last line of a page, and another on the last line). In such a circumstance, mom does not add a blank after the second deferred footnote. If you’d like a blank line separating both deferred footnotes from any footnotes proper to the page the deferred ones were moved to, add the space manually by putting a .SPACE command at the end of the footnote text, before .FOOTNOTE OFF (or X, QUIT, EXIT, etc).

Obviously, deferred footnotes aren’t an issue if you request numbered footnotes that increase incrementally throughout the whole document—yet another convenience mom has thought of.

While mom’s handling of footnotes is sophisticated, and tries to take nearly every imaginable situation under which they might occur into account, some situations are simply impossible from a typographic standpoint. For example, if you have a HEAD near the bottom of a page and the page has some footnotes on it, mom may simply not have room to set any text under the head (normally, she insists on having room for at least one line of text beneath a head). In such an instance, mom will either set the head, with nothing under it but footnotes, or transfer the head to the next page. Either way, you’ll have a gaping hole at the bottom of the page. It’s a sort of typographic Catch-22, and can only be resolved by you, the writer or formatter of the document, adjusting the type on the offending page so as to circumvent the problem.

Footnote markers and punctuation in the running text

  1. “Fill” modes – JUSTIFY, or QUAD LEFT | CENTER | RIGHT
  2. “No-fill” modes – LEFT, CENTER, RIGHT

1. “Fill” modes – JUSTIFY, or QUAD LEFT | CENTER | RIGHT

In fill modes, the correct way to enter the line after .FOOTNOTE OFF is to input it as if it’s literally a continuation of the input line you were entering before you invoked .FOOTNOTE. Therefore, if necessary, the input line may have to begin with space(s) or a punctuation mark, as in the two following examples.

Example 1
A line of text,\c .FOOTNOTE A footnote line. .FOOTNOTE OFF broken up with a comma. ^ (last line begins with a literal space)
Example 2
A line of text\c .FOOTNOTE A footnote line. .FOOTNOTE OFF , broken up with a comma. ^ (last line begins with a comma and a space)

Example 1 produces, on output
A line of text,* broken up with a comma. Example 2 produces
A line of text*, broken up with a comma. Care must be taken, though, if the punctuation mark that begins the line after .FOOTNOTE OFF is a period (dot). You must begin such lines with \&., like this:
...end of sentence\c .FOOTNOTE A footnote line. .FOOTNOTE OFF \&. A new sentence... If you omit the \&., the line will vanish!

Note: The document element tags, EPIGRAPH and BLOCKQUOTE, imply a fill mode, therefore these instructions also apply when you insert a footnote into epigraphs or blockquotes.

2. “No-fill” modes – LEFT, CENTER, RIGHT

In no-fill modes, you must decide a) whether text on the input line after .FOOTNOTE OFF is to be joined to the output line before .FOOTNOTE was invoked, or b) whether you want the output text to begin on a new line.

In the first instance, simply follow the instructions, above, for fill modes.

In the second instance, you must explicitly tell mom that you want input text after .FOOTNOTE OFF to begin on a new output line. This is accomplished by passing .FOOTNOTE OFF (or QUIT, END, X, etc) an additional argument: BREAK or BR.

Study the two examples below to understand the difference.

Example 1
.LEFT A line of text\c .FOOTNOTE A footnote line .FOOTNOTE OFF that carries on after the footnote.
Example 2
.LEFT A line of text\c .FOOTNOTE A footnote line .FOOTNOTE OFF BREAK that doesn’t carry on after the footnote.

Example 1, on output, produces
A line of text* that carries on after the footnote. whereas Example 2 produces A line of text* that doesn’t carry on after the footnote. The distinction becomes particularly important if you like to see punctuation marks come after footnote markers. In no-fill modes, that’s accomplished like this:
.LEFT A line of text\c .FOOTNOTE A footnote line .FOOTNOTE OFF , broken up with a comma. The output of the above looks like this:
A line of text*, broken up with a comma.

Note: The document element tag, QUOTE, implies a no-fill mode, therefore these instructions also apply when you insert footnotes into quotes.

FOOTNOTE

Tag: FOOTNOTE <toggle> [ BREAK | BR ] | INDENT LEFT | RIGHT | BOTH <indent value>

• <indent value> requires a unit of measure
See HYPER-IMPORTANT NOTE.

FOOTNOTE is a toggle macro, therefore invoking it on a line by itself allows you to enter a footnote in the body of a document. Invoking it with any argument other than INDENT (ie OFF, QUIT, END, X...) tells mom you’re finished.

Footnotes are the only element of running text that are not affected by the typesetting indent macros. In the unlikely event that you want a page’s footnotes to line up with a running indent, invoke .FOOTNOTE with the INDENT argument and pass it an indent direction and indent value. L, R, and B may be used in place of LEFT, RIGHT, and BOTH. FOOTNOTE must be invoked with INDENT for every footnote you want indented; mom does not save any footnote indent information from invocation to invocation.

Note: If a footnote runs to more than one paragraph, do not begin the footnote with the PP tag. Use .PP only to introduce subsequent paragraphs.

HYPER-IMPORTANT NOTE: The final word on the input line that comes immediately before FOOTNOTE must terminate with a \c inline escape if your FOOTNOTE_MARKER_STYLE is either STAR or NUMBER. See the footnote example above.

Additionally, in fill modes (JUSTIFY or QUAD), the line after a .FOOTNOTE OFF should be entered as if there were no interruption in the input text, ie the line should begin with a literal space or punctuation mark (see explanation and examples here).

In no-fill modes, the optional argument BREAK or BR may be used after the OFF (or QUIT, END, X, etc.) argument to instruct mom not to join the next input line to the previous output. See here for a more complete explanation, with examples.

Do not use the \c inline escape if your FOOTNOTE_MARKER_STYLE is LINE, or if you have disabled footnote markers with .FOOTNOTE_MARKERS OFF. In these instances, the line after .FOOTNOTE OFF should be entered normally.

FOOTNOTE control macros macros and defaults

  1. Family/font/size/colour/lead/quad
  2. Footnote markers – on or off
  3. Footnote marker style – star+dagger or numbered
  4. Footnotes by line number
  5. Reset footnote number – set footnote marker number to 1
  6. Inter-footnote spacing
  7. Footnote rule – on or off
  8. Footnote rule length – length of footnote separator rule
  9. Footnote rule weight – weight of footnote separator rule
  10. Adjust vertical position of footnote separator rule

1. Family/font/size/colour/lead/quad

See Arguments to the control macros.

.FOOTNOTE_FAMILY default = prevailing document family; default is Times Roman .FOOTNOTE_FONT default = roman .FOOTNOTE_SIZE default = -2 (points) .FOOTNOTE_COLOR default = black .FOOTNOTE_AUTOLEAD default = 2 points (typeset); single-spaced (typewrite) .FOOTNOTE_QUAD default = same as paragraphs

2. Footnote markers – FOOTNOTE_MARKERS

If you don’t want footnote markers, in either the body of the document or beside footnote entries themselves, toggle them off with .FOOTNOTE_MARKERS OFF (or END, QUIT, X...). This means, of course, that you’ll have to roll your own. If you want them back on, invoke .FOOTNOTE_MARKERS with no argument. Footnote markers are on by default.

If FOOTNOTE_MARKERS are disabled, do not use the \c inline escape to terminate the line before .FOOTNOTE.

3. Footnote marker style – FOOTNOTE_MARKER_STYLE

Mom gives you two choices of footnote marker style: star+dagger (see footnote behaviour above), or numbered.

.FOOTNOTE_MARKER_STYLE STAR gives you star+dagger (the default). There is a limit of 10 footnotes per page with this style.

.FOOTNOTE_MARKER_STYLE NUMBER gives you superscript numbers, both in the document body and in the footnote entries themselves. By default, footnote numbers increase incrementally (prev. footnote number + 1) throughout the whole document. You can ask mom to start each page’s footnote numbers at 1 with .RESET_FOOTNOTE_NUMBER (see below.)

If your PRINTSTYLE is TYPEWRITE and you would prefer that the footnotes themselves not use superscript numbers, you may pass .FOOTNOTE_MARKER_STYLE NUMBER an additional argument: NO_SUPERSCRIPT. While the marker in the text will still be superscript, the footnotes themselves will be identified with normal-sized, base aligned numbers, surrounded by parentheses.

Left padding of footnote numbers

When footnote numbering is enabled, in order to ensure that the left margin of footnote text aligns regardless of the footnote number, you sometimes have to pad the footnote numbers. This will be the case any time the footnote numbers change from 9 to 10 on the same page, or from 99 to 100. Consider this scenario:
9 Footnote text 10 Footnote text 11 Footnote text As you can see, the left margins of the footnotes are not aligned.

In order to correct this, use the macro .FOOTNOTE_NUMBER_PLACEHOLDERS, which takes a single argument: the number of placeholders in the longer digit. For example, placed at an appropriate point in your input file, .FOOTNOTE_NUMBER_PLACEHOLDERS 2 causes the above example to come out like this:
9 Footnote text 10 Footnote text 11 Footnote text Given the impossibility of knowing in advance when the number of placeholders required for footnote numbers will change, you must study your output file to determine where to insert this macro into your input file.

Obviously, mom does not provide a default for .FOOTNOTE_NUMBER_PLACEHOLDERS.

Note: .FOOTNOTE_NUMBER_PLACEHOLDERS affects both superscript footnote numbers, and, in PRINTSTYLE TYPEWRITE, the normal, base-aligned numbers surrounded by parentheses that you get with .FOOTNOTE_MARKER_STYLE NUMBER NO_SUPERSCRIPT.

4. Footnotes by line number – FOOTNOTE_MARKER_STYLE LINE

FOOTNOTE_MARKER_STYLE with the argument, LINE lets you have footnotes which are identified by line number, rather than by a marker in the text. (Note that NUMBER_LINES must be enabled in order to use this marker style.)

With FOOTNOTE_MARKER_STYLE LINE, mom will identify footnotes either by single line numbers, or line ranges. If what you want is a single line number, you need only invoke .FOOTNOTE, without the terminating \c, at the appropriate place in running text. Input lines after the footnote has been terminated (eg with .FOOTNOTE OFF) must begin at the left margin.

If you want a range of line numbers (eg [5-11] ), insert, directly into the first line of the range you want, the inline escape, \*[FN_MARK]. For the terminating line number of the range, you need only invoke .FOOTNOTE (again, without the terminating \c); mom is smart enough to figure out that where .FOOTNOTE was invoked represents the terminating line number. Range-numbered footnotes are always output on the page where .FOOTNOTE was invoked, not the page where \*[FN_MARK] appears (subject, of course, to the rules for footnotes that fall too close to the bottom of a page, as outlined here).

The behaviour of line-numbered footnotes can be controlled with the macros:
FOOTNOTE_LINENUMBER_BRACKETS
FOOTNOTE_LINENUMBER_SEPARATOR
FOOTNOTES_RUN_ON

• FOOTNOTE_LINENUMBER_BRACKETS

Mom, by default, surrounds footnote line numbers with square brackets. The style of the brackets may be changed with the macro,
.FOOTNOTE_LINENUMBER_BRACKETS which takes one of three possible arguments: PARENS (round brackets), SQUARE (the default) or BRACES (curly braces). If you prefer a shortform, the arguments, (, [ or { may be used instead.

Thus, for example, either
.FOOTNOTE_LINENUMBER_BRACKETS PARENS or
.FOOTNOTE_LINENUMBER_BRACKETS ( will surround footnote line numbers with round brackets.

• FOOTNOTE_LINENUMBER_SEPARATOR

If you don’t want the numbers enclosed in brackets, you may tell mom to use a “separator” instead. A common separator would be the colon, but it can be anything you like. The macro to do this is
.FOOTNOTE_LINENUMBER_SEPARATOR which takes, as its single argument, the separator you want. For safety and consistency’s sake, always enclose the argument in double-quotes. The separator can be composed of any valid groff character, or any combination of characters.

A word of caution: when using a separator, mom doesn’t insert any space after the separator. Hence, if you want space (you probably do), you must make the space part of the argument you pass to FOOTNOTE_LINENUMBER_SEPARATOR. For example, to get a colon separator with a space after it, you’d do
.FOOTNOTE_LINENUMBER_SEPARATOR ": "

• FOOTNOTES_RUN_ON

Finally, if your footnote marker style is LINE, you may instruct mom to do “run-on style” footnotes. Run-on footnotes do not treat footnotes as discrete entities, ie each beginning on a new line. Rather, each footnote is separated from the footnote before it by horizontal space in the running line, so that the footnotes on any given page form a continuous block, like lines in a paragraph.

The macro to get mom to run footnotes on is
.FOOTNOTES_RUN_ON Invoked by itself, it turns the feature on. Invoked with any other argument (OFF, NO, etc.), it turns the feature off. It is generally not a good idea to turn the feature on and off during the course of a single document. If you do, mom will issue a warning if there’s going to be a problem. However, it is always perfectly safe to enable/disable the feature after COLLATE.

5. Reset footnote number – RESET_FOOTNOTE_NUMBER

.RESET_FOOTNOTE_NUMBER, by itself, resets footnote numbering so that the next footnote you enter is numbered 1.

.RESET_FOOTNOTE_NUMBER PAGE tells mom to start every page’s footnote numbering at 1.

6. Inter-footnote spacing – FOOTNOTE_SPACING

If you’d like some space between footnotes, you can have mom put it in for you by invoking .FOOTNOTE_SPACING with an argument representing the amount of extra space you’d like. The argument to FOOTNOTE_SPACING requires a unit of measure.

In the following example, footnotes will be separated from each other by 3 points.
.FOOTNOTE_SPACING 3p

Note: If you’re using footnotes for references generated from the refer database (see refer.html), correct MLA style requires a full linespace between footnotes, which you can accomplish with .FOOTNOTE_SPACING 1v.

7. Footnote rule – FOOTNOTE_RULE

If you don’t want a footnote separator rule, toggle it off with .FOOTNOTE_RULE OFF (or END, QUIT, X...). Toggle it back on by invoking .FOOTNOTE_RULE with no argument. The default is to print the rule.

8. Footnote rule length – FOOTNOTE_RULE_LENGTH

If you want to change the length of the footnote separator rule, invoke .FOOTNOTE_RULE_LENGTH with a length, like this,
.FOOTNOTE_RULE_LENGTH 1i which sets the length to 1 inch. Note that a unit of measure is required. The default is 4 picas for both PRINTSTYLES.

9. Footnote rule weight – FOOTNOTE_RULE_WEIGHT

If you want to change the weight (“thickness”) of the footnote separator rule, invoke .FOOTNOTE_RULE_WEIGHT with the desired weight. The weight is measured in points; however, do not append the unit of measure, p, to the argument.

Mom’s default footnote rule weight is 1/2 point. If you’d like a 1-point rule instead,
.FOOTNOTE_RULE_WEIGHT 1 is how you’d get it.

10. Adjust vertical position of footnote separator rule – FOOTNOTE_RULE_ADJ

The footnote separator rule is a rule whose bottom edge falls on the baseline (at the footnote leading) one line above the first line of a page’s footnotes. By default, mom raises the rule 3 points from the baseline so that the separator and the footnotes don’t look jammed together. If you’d prefer a different vertical adjustment, invoke .FOOTNOTE_RULE_ADJ with the amount you’d like. For example
.FOOTNOTE_RULE_ADJ 4.25p raises the rule by 4-1/4 points. Note that you can only raise the rule, not lower it. A unit of measure is required.

Note: If your document leading is 2 points or less (e.g your point size is 10 and your linespacing is 10, 11, or 12), lowering mom’s default footnote rule adjustment will almost certainly give you nicer looking results than leaving the adjustment at the default. Furthermore, you can invoke .FOOTNOTE_RULE_ADJ on any page in which footnotes appear, or in any column, so that the placement of the footnote rule can be changed on-the-fly, should you wish.


Endnotes

Embedding endnotes into mom documents is accomplished the same way as embedding footnotes. The example below is identical to the one shown in the introduction to footnotes, except that .FOOTNOTE has been replaced with .ENDNOTE.

Example
...the doctrines of Identity as urged by Schelling\c .ENDNOTE <endnote about who the hell is Schelling> .ENDNOTE OFF were generally the points of discussion presenting the most of beauty to the imaginative Morella.

As with footnotes, note the obligatory use of the \c inline escape when your ENDNOTE_MARKER_STYLE is NUMBER or SUPERSCRIPT (both of which mark endnotes references in running text with superscript numbers). When the marker style is LINE, you must not use the \c escape.

Endnotes differ from footnotes in two ways (other than the fact that endnotes come at the end of a document whereas footnotes appear in the body of the document):

  1. When your ENDNOTE_MARKER_STYLE is NUMBER or SUPERSCRIPT, endnotes are always numbered incrementally, starting at “1”.
  2. Endnotes must be output explicitly; mom does not output them for you. In collated documents, this allows you to choose whether you want the endnotes to appear at the end of each chapter or article in a document, or grouped together at the very end of the document.

Within endnotes, you may use the document element tags PP, QUOTE and BLOCKQUOTE. This provides the flexibility to create endnotes that run to several paragraphs, as well as to embed cited text within endnotes.

Should you wish to change the appearance of quotes or blockquotes that appear within endnotes, you may do so with the quote control macros or blockquote control macros. However, you must make the changes within each endnote, prior to invoking .QUOTE or .BLOCKQUOTE, and undo them prior to terminating the endnote (ie before .ENDNOTE OFF), otherwise the changes will affect subsequent quotes and blockquotes that appear in the document body as well.

Note: See refer.html for information on using endnotes with the refer bibliographic database.

Endnotes behaviour

When you output endnotes (with .ENDNOTES), mom finishes processing the last page of your document, then breaks to a new page for printing the endnotes. If the document type is CHAPTER, the centre part of the header (or footer), which, by default, contains a chapter number or title, is removed.

By default, mom starts the endnotes page with a bold, centred, double-underscored head, “ENDNOTES”. Subsequently, for each section in a collated document (eg chapters in a book), she identifies the section in bold type, flush left and underscored, followed by one-half linespace. Endnotes pertaining to the section are output underneath, identified by superscript numbers. The text of the endnotes themselves is indented to the right of the numbers.

Note: The one-half linespace between section identifiers and the endnotes themselves, plus the need to group identifiers and endnotes sensibly, means that mom cannot guarantee perfectly aligned bottom margins. This is an unavoidable consequence of the structure of endnotes.

Of course, all the defaults, as well as the overall style of the endnotes pages, can be changed with the endnote control macros. The attentive will notice that endnotes have an awful lot of control macros. This is because endnotes are like a mini-document unto themselves, and therefore need not be bound by the style parameters of the body of the document.

Endnotes and columnar documents

If your document is set in columns (see COLUMNS), mom gives you the option to have endnotes appear in either the column format or set to the full page width. See ENDNOTES_NO_COLUMNS.

ENDNOTE

Macro: ENDNOTE <toggle> [ BREAK | BR ]

See HYPER-IMPORTANT NOTE

ENDNOTE is a toggle macro, therefore invoking it on a line by itself allows you to enter an endnote in the body of a document. Invoking it with any other argument (ie OFF, QUIT, END, X...) tells mom that you’ve finished the endnote.

Note: If an endnote runs to more than one paragraph, do not begin the endnote with the PP tag. Use PP only to introduce subsequent paragraphs.

HYPER-IMPORTANT NOTE: If your ENDNOTE_MARKER_STYLE is NUMBER or SUPERSCRIPT (mom’s default is NUMBER unless you have ENDNOTE_REFS enabled, in which case it’s SUPERSCRIPT), the final word on the input line that comes immediately before .ENDNOTE must terminate with a \c inline escape. See the endnote example above.

Additionally, in fill modes (JUSTIFY or QUAD, the line after .ENDNOTE OFF should be entered as if there were no interruption in the input text, ie the line should begin with a literal space or punctuation mark (see explanation and examples for footnotes, which apply equally to endnotes, here).

In no-fill modes, the optional argument BREAK or BR may be used after the OFF (or QUIT, END, X, etc.) argument to instruct mom not to join the next input line to the previous output. See here for a more complete explanation. The examples are for .FOOTNOTE, but apply equally to .ENDNOTE.

If your ENDNOTE_MARKER_STYLE is LINE, do not use the \c escape, and enter the line after .ENDNOTE OFF normally, ie at your text editor’s left margin.

ENDNOTES

Macro: ENDNOTES

Unlike footnotes, which mom automatically outputs at the bottom of pages, endnotes must be explicitly output by you, the user. ENDNOTES, by itself (ie without any argument), is the macro to do this.

Typically, you’ll use ENDNOTES at the end of a document. If it’s a single (ie not collated) document, mom will print the endnotes pertaining to it. If it’s a collated document, mom will print all the endnotes contained within all sections of the document (typically chapters), appropriately identified and numbered.

Should you wish to output the endnotes for each section of a collated document at the ends of the sections (instead of at the very end of the document), simply invoke .ENDNOTES immediately prior to COLLATE. Mom will print the endnotes, identified and numbered appropriately, on a separate page prior to starting the next section of the document. Each subsequent invocation of .ENDNOTES outputs only those endnotes that mom collected after the previous invocation.

ENDNOTES control macros and defaults

Important: Endnotes control macros must always be invoked prior to the first instance of .ENDNOTE.

When you embed endnotes in the body of a document, mom collects and processes them for later outputting (when you invoke .ENDNOTES). By the time you do invoke .ENDNOTES, it’s much too late to change your mind about how you want them to look.

My advice? If you’re planning to change the default appearance of endnotes pages, set them up prior to START.

  1. General endnotes style control
  2. Pagination of endnotes
  3. Header/footer control
  4. Endnotes' first-page title control
  5. Endnotes document-identification string control
  6. Endnotes referencing style

1. General endnotes page style control

• Base family/font/quad

See Arguments to the control macros.

.ENDNOTE_FAMILY default = prevailing document family; default is Times Roman .ENDNOTE_FONT default = roman .ENDNOTE_QUAD* default = justified *Note: ENDNOTE_QUAD must be set to either L (LEFT) or J (JUSTIFIED); R (RIGHT) and C (CENTER) will not work.
• Base point size
Macro: ENDNOTE_PT_SIZE <base type size of endnotes>

Unlike most other control macros that deal with size of document elements, ENDNOTE_PT_SIZE takes as its argument an absolute value, relative to nothing. Therefore, the argument represents the size of endnote type in points, unless you append an alternative unit of measure. For example,
.ENDNOTE_PT_SIZE 12 sets the base point size of type on the endnotes page to 12 points, whereas
.ENDNOTE_PT_SIZE .6i sets the base point size of type on the endnotes page to 1/6 of an inch.

The type size set with ENDNOTE_PT_SIZE is the size of type used for the text of the endnotes, and forms the basis from which the point size of other endnote page elements is calculated.

The default for PRINTSTYLE TYPESET is 12.5 points (the same default size used in the body of the document).

• Leading
Macro: ENDNOTE_LEAD <base leading of endnotes> [ ADJUST ]

• Does not require a unit of measure; points is assumed

Unlike most other control macros that deal with leading of document elements, ENDNOTE_LEAD takes as its argument an absolute value, relative to nothing. Therefore, the argument represents the leading of endnotes in points unless you append an alternative unit of measure. For example,
.ENDNOTE_LEAD 14 sets the base leading of type on the endnotes page to 14 points, whereas
.ENDNOTE_LEAD .5i sets the base leading of type on the endnotes page to 1/2 inch.

If you want the leading of endnotes adjusted to fill the page, pass ENDNOTE_LEAD the optional argument ADJUST. (See DOC_LEAD_ADJUST for an explanation of leading adjustment.)

The default for PRINTSTYLE TYPESET is the prevailing document leading (16 by default), adjusted.

Note: Even if you give mom a .DOC_LEAD_ADJUST OFF command, she will still, by default, adjust endnote leading. You must enter .ENDNOTE_LEAD <lead> with no ADJUST argument to disable this default behaviour.

• Spacing between endnotes
Macro: ENDNOTE_SPACING <space to insert between endnotes>

• Requires a unit of measure

If you'd like some whitespace between endnotes, just invoke ENDNOTE_SPACING with the amount of space you want, eg
.ENDNOTE_SPACING 6p which inserts 6 points of lead between endnotes. Be aware, though, that inserting space between endnotes means that the bottoms of endnotes pages will most likely not align.

Mom’s default is not to insert any whitespace between endnotes.

• Singlespace endnotes (TYPEWRITE only)
Macro: SINGLESPACE_ENDNOTES <toggle>

If your PRINTSTYLE is TYPEWRITE and you use TYPEWRITE’s default double-spacing, endnotes are double-spaced. If your document is single-spaced, endnotes are single-spaced.

If, for some reason, you’d prefer that endnotes be single-spaced in an otherwise double-spaced document (including double-spaced collated documents), invoke
.SINGLESPACE_ENDNOTES with no argument. And if, god help you, you want to change endnote single-spacing back to double-spacing for different spacing of endnotes output at the ends of separate documents in a collated document, invoke .SINGLESPACE_ENDNOTES with any argument (OFF, QUIT, Q, X...).

• Paragraph indenting
Macro: ENDNOTE_PARA_INDENT <amount to indent first line of paragraphs in endnotes>

• Requires a unit of measure

ENDNOTE_PARA_INDENT works exactly the same way as PARA_INDENT, except that the indent given is the amount by which to indent the first lines of endnote paragraphs, not document body paragraphs.

The default is 1.5 ems for PRINTSTYLE TYPESET; 1/2 inch for PRINTSTYLE TYPEWRITE.

Note: The first line of the first paragraph of endnotes (the one attached immediately to the identifying endnote number) is never indented. Only subsequent paragraphs are affected by ENDNOTE_PARA_INDENT.

• Inter-paragraph spacing
Macro: ENDNOTE_PARA_SPACE <toggle>

ENDNOTE_PARA_SPACE works exactly the same way as PARA_SPACE, except that it inserts a blank line between endnote paragraphs, not document body paragraphs.

The default is not to insert a blank line between paragraphs in endnotes.

• Turning off column mode during endnotes output
Macro: ENDNOTES_NO_COLUMNS <toggle>

By default, if your document is set in columns, mom sets the endnotes in columns, too. However, if your document is set in columns and you’d like the endnotes not to be, just invoke .ENDNOTES_NO_COLUMNS with no argument. The endnotes pages will be set to the full page measure of your document.

If you output endnotes at the end of each document in a collated document set in columns, column mode will automatically be reinstated for each document, even with ENDNOTES_NO_COLUMNS turned on. In such circumstances, you must re-enable ENDNOTES_NO_COLUMNS for each separate collated document.

2. Pagination of endnotes

• Page numbering style
Macro: ENDNOTES_PAGENUM_STYLE DIGIT | ROMAN | roman | ALPHA | alpha

Use this macro to set the page numbering style of endnotes pages. The arguments are identical to those for PAGENUM_STYLE. The default is digit. You may want to change it to, say, alpha, which you would do with
.ENDNOTES_PAGENUM_STYLE alpha

• Setting the first page number of endnotes
Macro: ENDNOTES_FIRST_PAGENUMBER <page # that appears on page 1 of endnotes>

Use this macro with caution. If all endnotes for several collated documents are to be output at once, ie not at the end of each separate doc, ENDNOTES_FIRST_PAGENUMBER tells mom what page number to put on the first page of the endnotes.

However, if you set ENDNOTES_FIRST_PAGENUMBER in collated documents in which the endnotes are output after each section (chapter, article, etc), you have to reset every section’s first page number after COLLATE and before START with PAGENUMBER.

• Omitting a page number on the first page of endnotes
Macro: ENDNOTES_NO_FIRST_PAGENUM <toggle>

This macro is for use only if FOOTERS are on. It tells ENDNOTES not to print a page number on the first endnotes page. Mom’s default is to print the page number.

• Suspending pagination during endnotes output
Macro: SUSPEND_PAGINATION
Macro: RESTORE_PAGINATION

SUSPEND_PAGINATION doesn’t take an argument. Invoked immediately prior to ENDNOTES, it turns off endnotes pages pagination. Mom continues, however to increment page numbers silently.

To restore normal document pagination after endnotes, invoke .RESTORE_PAGINATION (again, with no argument) immediately after .ENDNOTES.

3. Header/footer control

• Modifying what goes in the endnotes header/footer

If you wish to modify what appears in the header/footer that appears on endnotes page(s), make the changes before you invoke .ENDNOTES, not afterwards.

Except in the case of DOCTYPE CHAPTER, mom prints the same header or footer used throughout the document on the endnotes page(s). Chapters get treated differently in that, by default, mom does not print the header/footer centre string (normally the chapter number or chapter title.) In most cases, this is what you want. However, should you not want mom to remove the centre string from the endnotes page(s) headers/footers, invoke .ENDNOTES_HEADER_CENTER with no argument.

An important change you may want to make is to put the word “Endnotes” in the header/footer centre position. To do so, invoke
.HEADER_CENTER "Endnotes" or .FOOTER_CENTER "Endnotes" prior to invoking .ENDNOTES.

Note: If your DOCTYPE is CHAPTER, you must also invoke ENDNOTES_HEADER_CENTER for the ENDNOTES_HEADER_CENTER to appear.

• Header/footer centre string when doctype is CHAPTER
Macro: ENDNOTES_HEADER_CENTER toggle

If your DOCTYPE is CHAPTER and you want mom to include a centre string in the headers/footers that appear on endnotes pages, invoke .ENDNOTES_HEADER_CENTER (or .ENDNOTES_FOOTER_CENTER) with no argument. Mom’s default is not to print the centre string.

If, for some reason, having enabled the header/footer centre string on endnotes pages, you wish to disable it, invoke the same macro with any argument (OFF, QUIT, Q, X...).

• Allow headers on endnotes pages
Macro: ENDNOTES_ALLOWS_HEADERS <none> | ALL

By default, if HEADERS are on, mom prints page headers on all endnotes pages except the first. If you don’t want her to print headers on endnotes pages, do
.ENDNOTES_ALLOWS_HEADERS OFF If you want headers on every page including the first, do
.ENDNOTES_ALLOWS_HEADERS ALL

Note: If FOOTERS are on, mom prints footers on every endnotes page. This is a style convention. In mom, there is no such beast as ENDNOTES_ALLOWS_FOOTERS OFF.

4. Endnotes' first-page title control

• Title string
Macro: ENDNOTE_STRING "<head to print at the top of endnotes>"

By default, mom prints the word “ENDNOTES” as a head at the top of the first page of endnotes. If you want her to print something else, invoke .ENDNOTE_STRING with the endnotes-page head you want, surrounded by double-quotes. If you don’t want a head at the top of the first endnotes-page, invoke .ENDNOTE_STRING with a blank argument (either two double-quotes side by side—""—or no argument at all).

• Title control macros and defaults

See Arguments to the control macros.

.ENDNOTE_STRING_FAMILY default = prevailing document family .ENDNOTE_STRING_FONT default = bold .ENDNOTE_STRING_SIZE* default = +1 .ENDNOTE_STRING_QUAD default = centred .ENDNOTE_STRING_COLOR default = black *Relative to the size of the endnotes text (set with ENDNOTE_PT_SIZE)
• Title string placement
Macro: ENDNOTE_STRING_ADVANCE <distance from top of page>

• Argument requires a unit of measusure

By default, mom places the title (the docheader, as it were) of endnotes pages (typically "ENDNOTES") on the same baseline that is used for the start of running text. If you’d prefer another location, higher or lower on the page (thereby also raising or lowering the starting position of the endnotes themselves), invoke .ENDNOTE_STRING_ADVANCE with an argument stating the distance from the top edge of the page at which you’d like the title placed.

The argument requires a unit of measure, so if you’d like the title to appear 1-1/2 inches from the top edge of the page, you’d tell mom about it like this:
.ENDNOTE_STRING_ADVANCE 1.5i

• Title string underscoring
Macro: ENDNOTE_STRING_UNDERSCORE [DOUBLE] [<underscore weight> [<underscore gap> [<distance between double rules]]] | <none> | <anything>

Alias: ENDNOTE_STRING_UNDERLINE

• The argument <underscore weight> must not have the unit of measure, p, appended to it; all other arguments require a unit of measure

Invoked without an argument, .ENDNOTE_STRING_UNDERSCORE will place a single rule underneath the endnotes page title. Invoked with the argument, DOUBLE, ENDNOTE_STRING_UNDERSCORE will double-underscore the title. Invoked with any other non-numeric argument, (eg OFF, NO, X, etc.) the macro disables underscoring of the title.

In addition, you can use ENDNOTE_STRING_UNDERSCORE to control the weight of the underscore rule(s), the gap between the title and the underscore, and, in the case of double-underscores, the distance between the two rules.

Some examples:
.ENDNOTE_STRING_UNDERSCORE 1 - turn underscoring on; set the rule weight to 1 point .ENDNOTE_STRING_UNDERSCORE 1 3p - turn underscoring on; set the rule weight to 1 point; set the gap between the title and the underscore to 3 points .ENDNOTE_STRING_UNDERSCORE DOUBLE .75 3p - turn double-underscoring on; set the rule weight to 3/4 of a point; set the gap between the title and the upper underscore to 3 points; leave the gap between the upper and the lower underunderscore at the default .ENDNOTE_STRING_UNDERSCORE DOUBLE 1.5 1.5p 1.5p - turn double-underscoring on; set the rule weight to 1-1/2 points; set the gap between the title and the upper underscore to 1-1/2 points; set the gap between the upper and the lower underscore to 1-1/2 points Note, from the above, that in all instances, underscoring (single or double) is enabled whenever ENDNOTE_STRING_UNDERSCORE is used in this way.

Mom’s default is to double-underscore the title with 1/2-point rules placed 2 points apart and 2 points below the baseline of the title.

• Title string capitalization
Macro: ENDNOTE_STRING_CAPS toggle

Invoked by itself, .ENDNOTE_STRING_CAPS will automatically capitalize the endnotes-page title. Invoked with any other argument, the macro disables automatic capitalization of the title.

If you’re generating a table of contents, you may want the endnotes pages title to be in caps, but the toc entry in caps/lower case. If the argument to ENDNOTE_STRING is in caps/lower case and ENDNOTE_STRING_CAPS is on, this is exactly what will happen.

Mom’s default is to capitalize the endnotes pages title string.

5. Endnotes document-identification title control

• Document-identification title string(s)
Macro: ENDNOTE_TITLE "<title to identify a document in endnotes>"

By default, mom identifies the document(s) to which endnotes belong by the document title(s) given to the TITLE macro. If you’d like her to identify the document(s) another way, simply invoke .ENDNOTE_TITLE prior to START with the identifying title you want, surrounded by double-quotes.

If you don’t want any identifying title, invoke .ENDNOTE_TITLE with a blank argument, either two double-quotes side by side ("") or no argument at all. This is particularly useful if you have a single (ie non-collated) document and find having the document’s title included in the endnotes redundant.

• Document-identification string control macros and defaults

See Arguments to the control macros.

.ENDNOTE_TITLE_FAMILY default = prevailing document family; default is Times Roman .ENDNOTE_TITLE_FONT default = bold .ENDNOTE_TITLE_SIZE* default = 0 .ENDNOTE_TITLE_QUAD default = left *Relative to the size of the endnotes text (set with ENDNOTE_PT_SIZE)
• Endnotes document-identification underscoring
Macro: ENDNOTE_TITLE_UNDERSCORE [DOUBLE] [<underline weight> [<underline gap> [<distance between double rules]]] | <none> | <anything>

Alias: ENDNOTE_TITLE_UNDERLINE

• The argument <underscore weight> must not have the unit of measure, p, appended to it; all other arguments require a unit of measure

Invoked without an argument, .ENDNOTE_TITLE_UNDERSCORE will place a single rule underneath the document identification string. Invoked with the argument DOUBLE, ENDNOTE_TITLE_UNDERSCORE will double-underscore the string. Invoked with any other non-numeric argument, (eg OFF, NO, X, etc.) the macro disables underscoring of the string.

In addition, you can use ENDNOTE_TITLE_UNDERSCORE to control the weight of the underscore rule(s), the gap between the title and the underscore, and, in the case of double-underscores, the distance between the two rules.

Some examples:
.ENDNOTE_TITLE_UNDERSCORE 1 - turn underscoring on; set the rule weight to 1 point .ENDNOTE_TITLE_UNDERSCORE 1 3p - turn underscoring on; set the rule weight to 1 point; set the gap between the string and the underscore to 3 points .ENDNOTE_TITLE_UNDERSCORE DOUBLE .75 3p - turn double-underscoring on; set the rule weight to 3 points .ENDNOTE_TITLE_UNDERSCORE DOUBLE 1.5 1.5p 1.5p - turn double-underscoring on; set the rule weight to 1-1/2 points; set the gap between the string and the upper underscore to 1-1/2 points; set the gap between the upper and the lower underscore to 1-1/2 points

Note, from the above, that in all instances, underscoring (single or double) is enabled whenever ENDNOTE_TITLE_UNDERSCORE is used in this way.

Mom’s default is to single-underscore the string with a 1/2-point rule placed 2 points below its baseline.

6. Endnotes referencing style

• Endnote marker style
Macro: ENDNOTE_MARKER_STYLE LINE | NUMBER | SUPERSCRIPT

• Argument: LINE By default, mom places superscript numbers in running text to identify endnotes. However, if you have linenumbering turned on, you may instruct mom not to put superscript numbers in the running text, but rather to reference endnotes by line number. The command to do this is
.ENDNOTE_MARKER_STYLE LINE With ENDNOTE_MARKER_STYLE LINE, mom will identify endnotes either by single line numbers or by line ranges. If what you want is a single line number, you need only invoke .ENDNOTE at the appropriate place in running text without the terminating \c. Input lines after the endnote has been terminated (eg with .ENDNOTE OFF) must begin at the left margin.

(Should you wish to revert to mom’s default behaviour of placing a superscript number in the text to identify an endnote, you can invoke .ENDNOTE_MARKER_STYLE with the argument, NUMBER. It is not advisable to switch marker styles within a single document, for aesthetic reasons, but there is nothing to prevent you from doing so.)

If you want a range of line numbers (eg [5-11] ), insert, directly into the first line of the range you want, the inline escape, \*[EN-MARK]. For the terminating line number of the range, you need only invoke .ENDNOTE (again, without the terminating \c). Mom is smart enough to figure out that where .ENDNOTE is invoked represents the terminating line number.

Note: By default, mom reserves a fixed amount of space, equal to 8 placeholders, for the linenumbers of linenumbered endnotes. Within that space, the numbers are flush right with each other. The reserved space is enough to print a range of linenumbers of the form [nnnn-nnnn], but may be more than you need.

The goal with linenumbered endnotes is to ensure that the longest linenumber or range of lines is flush with the left margin of the page. Adjusting the reserved space is done with the macro ENDNOTE_NUMBERS_ALIGN, and the rules for getting it right are simple.

If your document runs to less than 100 lines, invoke
.ENDNOTE_NUMBERS_ALIGN RIGHT 0 If your document has between 100 and 999 lines
.ENDNOTE_NUMBERS_ALIGN RIGHT 1 If your document has between 1000 and 9999 lines
.ENDNOTE_NUMBERS_ALIGN RIGHT 2 etc.

• Argument: NUMBER With the argument NUMBER, mom places superscript numbers in running text, but identifies endnotes in the endnotes section of your document with normal-sized, base-aligned numbers.

• Argument: SUPERSCRIPT With the argument SUPERSCRIPT, mom places superscript numbers in running text, and identifies endnotes in the endnotes section of your document with superscript numbers as well. This is mom’s default.

Note: By default, mom reserves a fixed amount of space, equal to 2 placeholders, for the superscript numbers identifying endnotes in the endnotes section of your document. Within that space, the numbers are flush right with each other.

If you need less space (the total number of endnotes is less than 10) or more (the total number of endnotes is greater than 99), use the macro, ENDNOTE_NUMBERS_ALIGN, to set the desired amount of reserved space, eg
.ENDNOTE_NUMBERS_ALIGN RIGHT 1 or
.ENDNOTE_NUMBERS_ALIGN RIGHT 3

• Spacing between line-numbered endnotes and the endnote text
Macro: ENDNOTE_LINENUMBER_GAP <size of gap>

• Requires a unit of measure

When your ENDNOTE_MARKER_STYLE is LINE, mom, by default, inserts a space equal to 1/2-en between the linenumber and the text of an endnote. For aesthetic reasons, you may want to change the size of the gap, which is done with the macro, ENDNOTE_LINENUMBER_GAP.

ENDNOTE_LINENUMBER_GAP takes as its single argument the size of the gap. The argument requires a unit of measure, so, for example, to change the gap to 2 picas, you’d do
.ENDNOTE_LINENUMBER_GAP 2P

• Brackets around endnote line numbers
Macro: ENDNOTE_LINENUMBER_BRACKETS PARENS | SQUARE | BRACES | ( | [ | {

By default, mom puts endnote line numbers inside square brackets. The style of the brackets may be changed with the macro, ENDNOTE_LINENUMBER_BRACKETS, which takes one of three possible arguments: PARENS (“round” brackets), SQUARE (the default) or BRACES (curly braces). If you prefer a shortform, the arguments, (, [ or { may be used instead.

• Separator after endnote line numbers instead of brackets
Macro: ENDNOTE_LINENUMBER_SEPARATOR <character>

If you don’t want the numbers enclosed in brackets, you may tell mom to use a separator instead. A common separator would be the colon, but it can be anything you like.

ENDNOTE_LINENUMBER_SEPARATOR takes as its single argument the separator you want. (If the argument contains spaces, don’t forget to enclose the argument in double-quotes.) The separator can be composed of any valid groff character, or any combination of characters. For example, to get a colon separator after the line number in line-numbered endnotes, you’d do
.ENDNOTE_LINENUMBER_SEPARATOR :

• Endnote numbering style control

See Arguments to the control macros.

Please note that the control macros for endnote numbering affect only the numbers that appear on the endnotes pages themselves, not the endnote numbers that appear in the body of a document.

Numbered endnotes .ENDNOTE_NUMBER_FAMILY default = prevailing document family; default Times Roman .ENDNOTE_NUMBER_FONT default = bold .ENDNOTE_NUMBER_SIZE* default = 0 Linenumbered endnotes .ENDNOTE_LINENUMBER_FAMILY default = prevailing document family; default Times Roman .ENDNOTE_LINENUMBER_FONT default = bold .ENDNOTE_LINENUMBER_SIZE* default = 0 *Relative to the size of the endnotes text (set with ENDNOTE_PT_SIZE)
• Endnote numbering alignment

By default, when your ENDNOTE_MARKER_STYLE is NUMBER, mom hangs the numbers on endnotes pages, aligned right to two placeholders, producing this:
9. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 10. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. If you wish to change either the alignment or the number of placeholders, the macro to use is ENDNOTE_NUMBERS_ALIGN.

Macro: ENDNOTE_NUMBERS_ALIGN LEFT | RIGHT <number of placeholders>

ENDNOTE_NUMBERS_ALIGN determines how endnote numbers are aligned. If you invoke
.ENDNOTE_NUMBERS_ALIGN RIGHT 2 the periods (dots) after the numbers will align, like this 9. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 10. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. If you invoke .ENDNOTE_NUMBERS_ALIGN LEFT 2 the first digits of the numbers will line up flush left, like this 9. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 10. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. The argument <number of placeholders> represents the maximum size of the numbers, expressed as the number of digits in the largest number. Numbers in the range 0-9 require 1 placeholder; in the range 10-99, 2 placeholders; in the range 100-999 3 placeholders, and so on.

Therefore, if you have fewer than ten endnotes,
.ENDNOTE_NUMBERS_ALIGN RIGHT 1 would ensure proper right alignment of endnote numbers.

Mom’s default for endnote number alignment is to align the numbers right to two placeholders.

Note: ENDNOTE_NUMBERS_ALIGN can also be used to establish the alignment and number of placeholders when your ENDNOTE_MARKER_STYLE is SUPERSCRIPT. Furthermore, it can be used to establish the number of placeholders to reserve when your ENDNOTE_MARKER_STYLE is LINE, even though, in such an instance, the numbers themselves are always aligned right. See here for examples.


Margin notes

Margin notes are short annotations that appear in either the left or right margin of a document. Sometimes they comment on the text. Sometimes they assist in following the “flow” of a document by summarizing the subject of a portion of text. Sometimes they’re comments to yourself in a draft copy.

The margin notes macros and routines in om.tmac (mom) are “mommified” versions of the margin notes macros and routines written by Werner Lemberg and patched by Gaius Mulley.

Margin notes behaviour

First things first: before you enter your first margin note, you must “initialize” margin notes with MN_INIT. MN_INIT sets up the style parameters for margin notes, including things like font, family and leading. MN_INIT may be called before or after START.

After initializing margin notes, you create margin notes with the MN macro. Based on the argument you pass MN, your margin note will go in either the left or the right margin.

Margin notes are tricky from a typographic standpoint with respect to vertical placement. Since the leading of margin notes may differ from that of running text, it’s impossible for mom to guess whether to align the first lines of margin notes with a document baseline, whether to align the last lines of margin notes with a document baseline, or whether to center them, vertically, so that neither first nor last line aligns with anything!

Given this difficulty, mom always aligns the first line of any margin note with a document baseline. If you want a different behaviour, you must adjust the position(s) of margin notes yourself, on a note by note basis. (See Adjusting the vertical position of margin notes.)

Generally speaking, mom tries to place margin notes at the point where you invoke MN. However, in the event that a margin note runs deep, she may not be able to place a subsequent margin note exactly where you want. In such an instance, mom will “shift” the margin note down on the page, placing it one (margin note) linespace beneath the previous margin note (plus whatever vertical space is required to get the first line to line up with a baseline of running text). A warning will be issued, letting you know this has happened, and where.

Sometimes, if a margin note has to be shifted down, there simply isn’t enough room to start the margin note on the page on which .MN is invoked. In that case, mom ignores the margin note entirely and issues a warning, letting you know what she’s done, and where.

In the event that a margin note, sucessfully begun on a page, runs past your bottom margin (or the last line before footnotes begin), the margin note will “flow” onto the next page. If it is a “left” margin note, it will continue in the left margin. If it is a “right” margin note, it will continue in the right margin.

If your document is being set in two columns, mom will sensibly and automatically set all margin notes pertaining to the left column in the left margin, and all margin notes pertaining to the right column in the right margin, regardless of the “direction” argument you give the MN tag. If you try to use MN in documents of more than two columns, mom will ignore all margin notes, and issue a warning for each.

Adjusting the vertical position of margin notes

When the leading of margin notes differs from the leading used throughout a document, you may want to adjust the vertical position of individual margin notes. This is most often going to be the case with margin notes that end near the bottom of the page, where you want the last line of the margin note to line up with the last line of text on the page.

Adjustments to the vertical position of margin notes must be done inside the margin note (ie after .MN), at the top, before entering text. The commands to use are \!.ALD (to lower the margin note) and \!.RLD (to raise it). The \! must precede the macros, or they won’t have any effect.

MN_INIT

Macro: MN_INIT <arguments> (see list)

Argument list:

RAGGED | SYMMETRIC <L_WIDTH> <value> <R_WIDTH> <value> <GUTTER> <value> <FONTSTYLE> <value> <SIZE> <value> <LEAD> <value> <COLOR> <value> <HY> <value>

Before you enter your first margin note, you must initialize the style parameters associated with margin notes using MN_INIT. If you forget to do so, mom will issue a warning and abort.

The arguments may be entered in any order, and since the list is long, use of the backslash character ( \ ) to put each on a separate line is recommended, eg.
.MN_INIT \ SYMMETRIC \ L_WIDTH 4P \ SIZE 8 \ LEAD 9 \ HY 14 All arguments are optional, but since mom requires you to run MN_INIT before entering margin notes, you should, at a minimum, set the RAGGED or SYMMETRIC parameter. You will almost certainly want to set L_WIDTH, R_WIDTH, SIZE and LEAD as well.

RAGGED | SYMMETRIC

If the argument RAGGED is given, both left and right margin notes will be flush left. If the argument SYMMETRIC is given, left margin notes will be set flush right, and right margin notes flush left. The effect is something like this:
A left This is a meaningless batch A right margin note of text whose sole purpose is margin note with just to demonstrate how the sym- with just a few words metric argument to MN sets left a few words in it. and right margin notes. in it.

If the argument is omitted, both left and right margin notes will be set justified. (Justified is usually not a good idea, since the narrow measure of margin notes makes pleasing justification a near impossibility.)

L_WIDTH <value>

The width of left margin notes. A unit of measure must be appended directly onto the argument. The default is to set left margin notes right out to the edge of the page, which is almost certainly not what you want, so you should give a value for this argument if using left margin notes.

R_WIDTH <value>

The width of right margin notes. A unit of measure must be appended directly onto the argument. The default is to set right margin notes right out to the edge of the page, which is almost certainly not what you want, so you should give a value for this argument if using right margin notes.

GUTTER <value>

The gutter between margin notes and running text. A unit of measure must be appended directly onto the argument. The gutter applies to both left and right margin notes. The default is 1 em.

FONTSTYLE <value>

The family+font for margin notes. Yes, that’s right: the family plus font combo. For example, if you want Times Roman Medium, the argument must be TR. If you want Palatino Medium Italic, the argument must be PI. The default is the same family+font combo used for a document’s paragraph text.

SIZE <value>

The point size of type for margin notes. There is no need to append a unit of measure to the argument; points is assumed (although there’s nothing preventing you from appending an alternative unit of measure directly to the argument). The default is for margin notes to use the same point size of type as is used in document paragraphs.

LEAD <value>

The leading of margin notes. <LEAD> takes points as its unit of measure, so don’t tack a unit of measure onto the end of the argument. The default lead is the same as paragraph text (ie the document’s base leading).

COLOR <value>

The colour of margin notes. The colour must be pre-initialized with NEWCOLOR or XCOLOR. The default is black.

HY <value>

<value> is a digit telling groff how you want margin notes hyphenated.
0 = do not hyphenate 1 = hyphenate without restrictions 2 = do not hyphenate the last word on the page 4 = do not hyphenate the last two characters of a word 8 = do not hyphenate the first two characters of a word The values can be added together, so, for example, if you want neither the first two nor the last two characters of words hyphenated, the hyphenation-flag would be 12. The default value is 14 (ie 2+4+8).

MN

Macro: MN LEFT | RIGHT

Once you’ve initialized margin notes with .MN_INIT, you can enter margin notes any time you like with .MN. An argument of LEFT will set a left margin note. An argument of RIGHT will set a right margin note.

Any argument, such as OFF (or QUIT, END, X, etc) exits the current margin note.


Document termination string

The use of FINIS is optional. If you invoke it at the end of a document (before .ENDNOTES, .BIBLIOGRAPHY or .TOC) mom deposits the word, END, centred after a blank line, beneath the last line of the document. END is enclosed between em-dashes, like this:
...and they all lived happily ever after. — END — If there is insufficient room for FINIS on the last page of a document, mom will alert you on stderr.

If you’re writing in a language other than English, you can change what mom prints for END with the control macro, FINIS_STRING.

FINIS

Macro: FINIS

The use of FINIS is optional, but if you use it, it should be the last macro you invoke in a document before .ENDNOTES, .BIBLIOGRAPHY or .TOC. See above for a description of how FINIS behaves.

Note: If you don’t use FINIS, and you don’t want footers (if they’re on) or a page number at the bottom of the last page of a document, you have to turn them off manually, as the last two lines of your document file, like this:
.FOOTERS OFF .PAGINATE OFF

Finis contol macros

Changing the FINIS string

By default, FINIS prints the word, END, between em-dashes. If you’d like mom to print something else between the dashes, use the FINIS_STRING macro (anywhere in the document prior to FINIS).

For example, if your document’s in French, you’d do
.FINIS_STRING "FIN" Double-quotes must enclose the macro’s argument.

Note: If you pass FINIS_STRING a blank string, ie
.FINIS_STRING "" mom will still print the em-dashes when you invoke .FINIS. This, in effect, produces a short, centred horizontal rule that terminates the document. (In PRINTSTYLE TYPEWRITE, it’s a short, dashed line composed of four hyphens.)

Automatic capitalization of the FINIS string

By default, mom sets the string you pass to FINIS all-caps. If you’d prefer that she not do so, but rather respect the FINIS string exactly as you enter it, invoke the macro, .FINIS_STRING_CAPS with the OFF argument, like this:
.FINIS_STRING_CAPS OFF OFF, above, could be anything, eg NO or X.

Changing the FINIS colour

Invoking the control macro, .FINIS_COLOR, with a pre-defined (or “initalized”) colour changes the colour of both the FINIS string and the em-dashes that surround it. If you use the inline escape, \*[<colourname>], in the argument passed to FINIS, only the text will be in the new colour; the em-dashes will be in the default document colour (usually black).


Back to Table of Contents Top Next: Graphics, floats, and preprocessor support

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/version-2.html0000644000000000000000000000013212426110213022115 xustar000000000000000030 mtime=1415090315.616519109 30 atime=1415090315.616519109 30 ctime=1415090315.616519109 groff-1.22.3/contrib/mom/momdoc/version-2.html0000644000175000001440000003213212426110213020754 0ustar00wlusers00000000000000 Mom -- Version 2.0 notes
Back to Table of Contents Next: Introduction to mom

Version 2.0 notes


1. Prefatory comments

Version 2.0 comes about as a result of Deri James’ contribution of gropdf to groff, and his subsequent work integrating the device with mom.

Whereas the 1.x releases were oriented toward PostScript output, 2.0 focuses on PDF output, a bias reflected throughout this documentation. Users are strongly encouraged to process their files with pdfmom, a wrapper around groff -Tpdf, in order to take full advantage of all PDF has to offer.

While portions of mom have been rewritten, and new features introduced, 2.0 is backwardly compatible with 1.x releases. Changes are either transparent, or accompanied by notifications on stderr.

The implementation of nested heads has been completely rethought, as has the manner of styling of them. There are no limits on how deep the nesting can go. The 1.x macros HEAD, SUBHEAD, and SUBSUHEAD may still be used, but must be re-designed with the new HEADING_STYLE macro if their 1.x defaults are not desired.

In conjunction with the changes to nested heads, Table of Contents generation has also been rethought. Greater flexibility in the inclusion of toc entry numbering been added. Like nested heads, there’s a new macro, TOC_ENTRY_STYLE, that permits styling of each level in the toc hierarchy separately. The default overall layout has also been significantly improved, achieving a level of typographical elegance formerly lacking. Best of all, the Table of Contents can now be repositioned to the correct spot at the top of a document from within the mom source file.

When mom files are processed with pdfmom, a PDF outline for the Contents panel of PDF viewers is automatically generated. In addition, entries in the Table of Contents are clickable links when a document is viewed at the screen. pdfmom also permits setting a document’s papersize within the source file without the corresponding need for -P-p<papersize> on the command line.

Lastly, while not strictly part of mom, a bash script, install-font.sh, has been posted at the mom site. The script significantly eases the installation of new groff families and fonts, with conversion to .pfa and .t42 being performed by fontforge.

2. Differences between v2.0 and v1.x

2.1. PDF support

PDF support has been added, with features including the automatic generation of PDF outlines, embedding of images in PDF format (via the PDF_IMAGE macro) and PDF linking (internal and external).

2.1.1. Producing PDFs with groff and mom

A manual in PDF format, Producing PDFs with groff and mom, has been added to the documentation. The file, mom-pdf.pdf can be found in
/usr/local/share/doc/groff-1.21/pdf/ or
/usr/share/doc/groff-base/pdf/ or at
http://www.schaffter.ca/mom/momdoc/mom-pdf.pdf PDF usage, and all associated macros except PDF_IMAGE, are fully explained in the manual, which should be considered an integral part of the present documentation. In addition, the mom source file for the manual can be found in
/usr/local/share/doc/groff-1.21/examples/mom or
/usr/share/doc/groff-base/examples/mom/ and provides an excellent demonstration of mom usage.

2.1.2. PDF_IMAGE

A new macro for embedding PDF images has been added, PDF_IMAGE.

PDF_IMAGE functions similarly to PSPIC and accepts the same arguments. Differences in implementation are that PDF_IMAGE requires the image dimensions (the bounding box) to be supplied. Instructions for getting the bounding box are included in the documentation entry for PDF_IMAGE. Two additional options, SCALE and ADJUST, allow scaling of the image and optical centering.

2.2. Covers

Arguments to COVER and DOC_COVER may now be given in any order.

2.3. Headings

The 1.x macros
HEAD SUBHEAD SUBSUBHEAD are now deprecated and have been replaced by a single macro,
HEADING <n> where <n> is the heading level. The deprecated macros may still be used, and conform in style to their original defaults; they are, however, wrappers around HEADING levels 1 - 3. Both the wrappers and HEADING itself can take a NAMED <id> argument, specifying a PDF link destination.

Styling of headings is managed by a single macro,
HEADING_STYLE <n> where <n> conforms to a HEADING level. The control macros for HEAD, SUBHEAD and SUBSUBHEAD have been removed. Users wishing to style the wrappers must use HEADING_STYLE.

PARAHEAD is no longer valid. Paragraph heads in 2.0 are created by passing the PARAHEAD argument to .HEADING. Mom will abort with an informational message whenever she encounters .PARAHEAD.

2.4. Margin notes

The macro for setting margin note parameters, MN_INIT, has been re-written such that each parameter now has the form
<PARAMETER> <value> This differs from 1.x where parameters were entered without a preceding <PARAMETER> flag. Parameters may be entered in any order. Any that are skipped are set to default values. Documents created with 1.x will have to have their MN_INIT updated accordingly.

2.5. Floats

A FLOAT macro has been added, which functions similarly to the ms macros’ .KF/.KE, ie the contents of the float are output immediately if there’s room on the page; otherwise, normal text processing continues and the contents are output at the top of the next page. An ADJUST argument to FLOAT allows for optical centering.

2.6. Table of contents

The default look of the Table of Contents has been overhauled to produce a more typographically pleasing result. All control macros for TOC title and entry styles have been removed, replaced by the macros
TOC_TITLE_STYLE and
TOC_ENTRY_STYLE <n> where <n> corresponds to a HEADING level. Both macros permit setting any or all of the style parameters for TOC titles (ie chapters or major sections/divisions of a collated document) and TOC entries (nested heading levels) at once. Documents created with 1.x that contain TOCs will need to have their TOC style updated if the new defaults are unsatisfactory.

Two new TOC control macros have been added,
SPACE_TOC_ITEMS and
AUTO_RELOCATE_TOC SPACE_TOC_ITEMS groups TOC entry levels and separates them with a discrete amount of whitespace. This leads to improved legibility, and is highly recommended even though it is not mom’s default. AUTO_RELOCATE_TOC intelligently repositions the Table of Contents to the top of a document when the mom source file is processed with pdfmom.

3. pdfmom

Deri James has provided pdfmom, a wrapper around groff that processes mom source files with all the PDF bells and whistles. Its use is highly recommended. Usage is explained in the manual, Producing PDFs with groff and mom. A significant convenience of pdfmom is that it can, with the -Tps flag, be used to pass processing over to Keith Marshall’s pdfroff. This is useful when processing files that contain PostScript images embedded with PSPIC. pdfmom, without the flag, uses groff’s PDF device (gropdf), which only recognizes PDF images that have been embedded with PDF_IMAGE.

4. install-font.sh

A bash script, install-font.sh, has been posted at the mom site. There’s nothing mom-specific about the script, and it is not an official part of groff.

Installing groff fonts is a multi-step procedure, which, while not difficult, can be a nuisance. install-font.sh takes care of all the details, including converting fonts to formats acceptable to grops and gropdf, creating and installing the groff fonts in the appropriate directories, updating the download files, and installing the original fonts in a system-wide directory, if desired.


Back to Table of Contents Top Next: Introduction to mom

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/macrolist.html0000644000000000000000000000013212426110213022266 xustar000000000000000030 mtime=1415090315.614519134 30 atime=1415090315.614519134 30 ctime=1415090315.614519134 groff-1.22.3/contrib/mom/momdoc/macrolist.html0000644000175000001440000013176512426110213021141 0ustar00wlusers00000000000000 Mom -- Quick reference guide
Back to Table of Contents Next: Appendices

Quick reference guide

Once you know your way around mom, you may find this guide preferable to using the Table of Contents. It lists mom’s major user-space macros. The links point to references found elsewhere in the documentation.

Quick reference guide

TYPESETTING MACROS
+++ Paper size, margins, line length
PAPER-- set common paper sizes (letter, A4, etc)
PAGEWIDTH-- set a custom page width
PAGELENGTH-- set a custom page length
PAGE-- set explicit page dimensions and margins
T_MARGIN-- set a top margin
B_MARGIN-- set a bottom margin
L_MARGIN-- set a left margin (page offset)
R_MARGIN-- set a right margin
LL-- set a line length
+++ Family, font, point size
FAMILY-- set the family of type
FT-- set the font style (roman, italic, etc)
FALLBACK_FONT-- establish a fallback font (for missing fonts)
PT_SIZE-- set the point size
\*[SIZE n]-- change the point size inline
+++ Font modifications
Pseudo italic
SETSLANT-- set the degree of slant
\*[SLANT]-- invoke pseudo italic inline
\*[SLANTX]-- off pseudo italic inline
Pseudo bold
SETBOLDER-- set the amount of emboldening
\*[BOLDER]-- invoke pseudo bold inline
\*[BOLDERX]-- off pseudo bold inline
Pseudo condensed
CONDENSE-- set the amount to pseudo condense
\*[COND]-- invoke pseudo condensing inline
\*[CONDX]-- off pseudo condensing inlines
Pseudo extended
EXTEND-- set the amount to pseudo extend
\*[EXT]-- invoke pseudo extending inline
\*[EXTX]-- off pseudo condensing inlinee
+++ Linespacing (leading)
LS-- set the linespacing (leading)
AUTOLEAD-- set the linespacing relative to the point size
+++ Justification, quad direction, line-by-line setting, breaking lines
JUSTIFY-- justify text to both margins
QUAD-- "justify" text left, centre, or right
LEFT-- set line-by-line quad left
CENTER-- set line-by-line quad centre
RIGHT-- set line-by-line quad right
BR-- break a justified line
SPREAD-- force justify a line
EL-- break a line without advancing on the page
+++ Hyphenation
HY-- automatic hyphenation on/off
HY_SET-- set automatic hyphenation parameters
+++ Word and sentence spacing
WS-- set the minimum word space size
SS-- set the sentence space size
+++ Kerning, ligatures, smartquotes
KERN-- automatic character pair kerning on/off
\*[BU n]-- move characters pairs closer together inline
\*[FU n]-- move character pairs further apart inline
RW-- uniformly tighten space between characters
EW-- uniformly loosen space between characters
BR_AT_LINE_KERN-- break previous line when RW or EW is invoked
LIGATURES-- automatic generation of ligatures on/off
SMARTQUOTES-- smartquoting on/off
+++ Horizontal and vertical movements, columnar setting
ALD-- move downards on the page
RLD-- move upwards on the page
SPACE-- insert space between lines on a page
\*[DOWN n]-- temporarily move downwards in a line
\*[UP n]-- temporarily move upwards in a line
\*[FWD n]-- move forward in a line
\*[BCK n]-- move backwards in a line
MCO-- multiple columns on
MCR-- recto vertical position of column start
MCX-- multiple columns off, advance past longest column
+++ Indents
IL-- set and turn on a left indent
IR-- set and turn on a right indent
IB-- set and turn on indents both left and right
IQ-- quit (exit) all indents
TI-- set and turn on a temporary (one line) indent
HI-- set and turn on a hanging indent
ILX-- left indents off
IRX-- right indents off
IBX-- both left and right indents off
+++ Tabs
TAB_SET-- set up a typesetting tab
TAB <n>-- call tab <n>
TQ-- quit (exit) tabs
\*[ST<n>]...-- string tabs (mark tab positions inline)
\*[ST<n>X]
TN-- move to tab<n+1> without advancing on the page
ST-- set quad/fill for string tabs
+++ Underscoring, underlining
UNDERSCORE-- underscore
UNDERSCORE2-- double underscore
UNDERLINE-- underline (fixed width fonts only)
\*[UL]...-- invoke underlining inline (fixed width fonts only)
\*[ULX]
+++ Superscipts
\*[SUP]...\*[SUPX]-- superscript
\*[CONDSUP]...\*[CONDSUPX]-- pseudo-condensed superscript
\*[EXTSUP]...\*[EXTSUPX]-- pseudo extended supercript
SUPERSCRIPT_RAISE_AMOUNT-- vertical offset of superscripts
+++ Nested lists
LIST-- begin a list
ITEM-- begin an item in a list
SHIFT_LIST-- change the indent of a list
RESET_LIST-- clear and reset a list’s enumerator
PAD_LIST_DIGITS-- reserve space for digits
+++ Colour
NEWCOLOR-- initialize (define) a colour
COLOR-- begin using an initialized colour
XCOLOR-- initialize a "named" X colour
\*[<colorname>]-- begin using an initialized colour inline
+++ Dropcaps
DROPCAP-- set a dropcap
DROPCAP_FAMILY-- set a dropcap’s family
DROPCAP_FONT-- set a dropcap’s font style
DROPCAP_COLOR-- set a dropcap’s colour
DROPCAP_ADJUST-- adjust size of a dropcap
DROPCAP_GUTTER-- adjust space between a dropcap and regular text
+++ Utilities
ALIAS-- give a macro a new name
CAPS-- set type all caps
COMMENT-- silently embed comments in a document
ESC_CHAR-- change the default escape character
\*[LEADER]-- insert leaders at the end of a line
LEADER_CHARACTER-- change the character used for leaders
NEWPAGE-- break to a new page
PAD-- insert equalized whitespace into a line
PAD_MARKER-- change the pad marker
\*[RULE]-- draw a full measure rule
SIZESPECS-- get cap-height, x-height and descender depth
SILENT-- output processing off or on
TRAP-- enable or disable page position traps
+++ Graphical objects and images
DRH-- draw a horizontal rule
DRV-- draw a vertical rule
DBX-- draw a box
DCL-- draw a circle (ellipse)
RULE_WEIGHT-- set weight of rules drawn with \*[RULE]
PDF_IMAGE-- insert a PDF image
PSPIC-- insert a PostScript image
DOCUMENT PROCESSING MACROS
+++ Reference macros
TITLE-- document title
DOCTITLE-- overall document title (if different from TITLE)
ENDNOTE_TITLE-- document/chapter id string for endnotes
CHAPTER-- chapter number
CHAPTER_TITLE-- chapter title
CHAPTER_STRING-- what to use in place of “Chapter”
SUBTITLE-- document subtitle
AUTHOR-- document author(s)
DOC_COVERTITLE-- document title cover
COVERTITLE-- section cover title
COPYRIGHT-- copyright
MISC-- miscellaneous cover information
DRAFT-- document’s draft number
DRAFT_STRING-- what to use in place of “Draft”
REVISION-- document’s revision number
REVISION_STRING-- what to use in place of “Revision”
+++ General document formatting directives
DOCTYPE-- general document type
COPYSTYLE-- draft or final copy
PRINTSTYLE-- typeset or “typewritten”
+++ Line numbering
NUMBER_LINES-- automatic line numbering on/off
NUMBER_QUOTE_LINES-- numbering of QUOTE lines on/off
NUMBER_BLOCKQUOTE_LINES-- numbering of BLOCKQUOTE lines on/off
+++ Set documents in columns
COLUMNS
COL_NEXT
COL_BREAK
+++ TYPEWRITE control macros
UNDERLINE_ITALIC-- underlining of italics on
UNDERLINE_QUOTES-- underlining of QUOTEs on/off
ITALIC_MEANS_ITALIC-- use real italics (not underlining)
UNDERLINE_SLANT-- underlining of pseudo-italics on
SLANT_MEANS_SLANT-- use pseudo italics (not underlining)
+++ Initiate document processing
START-- begin document processing
+++ Epigraphs
EPIGRAPH-- set an epigraph underneath the docheader
Control macros-- change default style of epigraphs
+++ HEADINGS
HEADING-- hierarchical headings
Control macros-- style heading levels
 HEADING_STYLE-- set style parameters for heading levels
 PREFIX_CHAPTER_NUMBER-- add chapter number to heading numbering
+++ Paragraphs
PP-- set a paragraph
Control macros-- managing paragraph style concerns
 PP_FONT-- globally change font of regular paragraphs
 PARA_INDENT-- set the paragraph first-line indent
 INDENT_FIRST_PARAS-- indenting of paragraph first-lines on/off
 PARA_SPACE-- linespace between paragraphs on/off
+++ Quotes (line for line verbatim quotes)
QUOTE-- set quoted text line for line
Control macros-- change default style of quotes
 ALWAYS_FULLSPACE_QUOTES-- control vertical space around quotes
+++ Blockquotes (cited passages of text)
BLOCKQUOTE-- set longer passages of cited text
Control macros-- change default blockquote style
 ALWAYS_FULLSPACE_BLOCKQUOTES-- control vertical spacing
+++Floats
FLOAT-- keep blocks of input together, output on next page
   if necessary
+++Images and graphics
PDF_IMAGE-- inserting pdf images
 PDF_IMAGE_FRAME-- set parameters for pdf image frames
PSPIC-- inserting PostScript images
+++eqn support
EQ-- begin an eqn block
EN-- end an eqn block
+++pic support
PS-- begin a pic block
PE-- end a pic block
PIC_TEXT_STYLE-- set style for pic text
+++tbl support
TS-- begin a tbl block
TH-- running table header (after TS H)
TE-- end tbl block
+++ Captions and labels
AUTOLABEL-- auto-label figures, tables, equations
CAPTION_AFTER_LABEL-- place captions after labels
MLA-- MLA-style labelling and captioning
CAPTIONS-- set style for captions
LABELS-- set style for labels
SOURCES-- set style for sources (tbl only)
+++Lists of Figures, Tables, and Equations
LIST_OF_FIGURES-- generate a List of Figures
LIST_OF_TABLES-- generate a List of Tables
LIST_OF_EQUATIONS-- generate a List of Equations
LISTS_STYLE-- set style parameters for Lists
+++ Code snippets
CODE-- set a code snippet
Control macros-- change default style of code snippets
 General-- family, font, and colour
 CODE_SIZE-- code size as a percentage of prevailing text
+++ Author linebreaks (section breaks)
LINEBREAK-- insert an author linebreak (section break)
Control macros-- change default style of linebreaks
 LINEBREAK_CHAR-- character to use for author linebreaks
 LINEBREAK_COLOR-- colour of author linebreak character
+++ Document termination string
FINIS-- insert a document termination string
Control macros-- change default style finis string
 FINIS_STRING-- set the document termination string
 FINIS_STRING_CAPS-- capitalization of termination string
 FINIS_COLOR-- set the document termination string colour
+++ Footnotes
FOOTNOTE-- set a footnote
Control macros-- change default style of footnotes
 FOOTNOTE_MARKERS-- footnote markers on/off
 FOOTNOTE_MARKER_STYLE-- type of footnote marker to use
 RESET_FOOTNOTE_NUMBER-- reset footnote numbering
 FOOTNOTE_RULE-- footnote separator rule on/off
 FOOTNOTE_RULE_ADJ-- adjust position of footnote rule
 FOOTNOTE_RULE_LENGTH-- adjust length of footnote rule
 FOOTNOTES_RUN_ON -- instruct footnotes to be continuous
+++ Endnotes
ENDNOTE-- set an endnote
\*[EN-MARK] -- mark initial line of a range of line numbers
   (for use with line numbered endnotes)
ENDNOTES-- output endnotes
Control macros
General style control
Pagination
Header/footer control
Title control
Document/section identification control
Identification style
+++ Margin notes
MN_INIT-- initialize margin notes
MN-- set a margin note
+++ Bibliographic references
REF-- begin a reference
FOOTNOTE_REFS-- place references in footnotes
ENDNOTE_REFS-- place references in endnotes
REF( / REF)-- put parentheses around embedded references
REF[ / REF]-- put square brackets around embedded references
REF{ / REF}-- put curly braces around mbedded references
BIBLIOGRAPHY-- output a bibliography
Control macros
BIBLIOGRAPHY_TYPE -- "plain" or enumerated list
General style control
Header/footer control
Main head control
+++ Tables of contents
TOC-- output a table of contents
Control macros
General style control
Page numbering
Header string control
Entries and reference page numbers style control
TOC_TITLE_STYLE
TOC_ENTRY_STYLE
Additional table of contents control macros
+++ Letter (correspondence) macros
DATE-- letter’s date
FROM-- letter’s addresser
TO-- letter’s addressee
GREETING-- letter’s salutation
CLOSING-- letter’s closing salutation
CLOSING_INDENT-- indentation of the closing salutation
SIGNATURE_SPACE-- room to leave for the signature
NO_SUITE-- printing of "next page number" off or on
+++ Changing global print style parameters after START
DOC_LEFT_MARGIN-- left margin of everything on the page
DOC_RIGHT_MARGIN-- right margin of everything on the page
DOC_LINE_LENGTH-- document’s base line length
DOC_FAMILY-- document’s base family
DOC_PT_SIZE-- document’s base point size
DOC_LEAD-- document’s base lead
DOC_QUAD-- document’s base quad directions
+++ Managing a document’s first-page header
DOCHEADER-- document first-page header on/off
Control macros-- change default style of docheader elements
+++ Managing page headers and footers
HEADERS-- page headers on/off
FOOTERS-- page footers on/off
HEADERS_AND_FOOTERS-- enable generation of both headers and
   footers
Control macros
Strings-- left-right-center strings
Style-- change defaults for headers and/or footers
Global-- global style changes
Part-by-part-- part-by-part style changes
Vertical placement-- adjust position of headers and/or footers
Separator rule-- manage the header/footer separator rule
+++ Recto/verso page headers and footers
RECTO_VERSO-- recto/verso headers and/or footers on/off
SWITCH_HEADERS-- switch recto or verso header
SWITCH_FOOTERS-- switch recto or verso footer
HEADER_RECTO-- string that constitutes a recto header
HEADER_VERSO-- string that constitutes a verso header
FOOTER_RECTO-- string that constitutes a recto footer
FOOTER_VERSO-- string that constitutes a recto footer
+++ Pagination
PAGINATE-- pagination on/off
Control macros-- change default style for pagination
 PAGENUMBER-- user-defined (starting) page number
 PAGENUM_STYLE-- digits, roman numerals, etc
 PAGENUM_ON_FIRST_PAGE-- when footers are enabled
 DRAFT_WITH_PAGENUMBER-- attach draft/revision to page number
+++ Document and section cover (title) pages
COVER-- information to include in a section cover
DOC_COVER-- information to include in a document cover
COVERS-- printing of section covers on/off
DOC_COVERS-- printing of document covers on/off
Control macros-- change style defaults for covers
+++ Utilities
ADD_SPACE-- add space to the top of a page
BLANKPAGE-- output one or more blank pages
DOC_LEAD_ADJUST-- adjust leading to fill pages
COLLATE-- join documents (chapters/sections) together
SHIM-- move vertical position to next valid baseline

Back to Table of Contents Top Next: Appendices

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/reserved.html0000644000000000000000000000013212426110213022110 xustar000000000000000030 mtime=1415090315.615519121 30 atime=1415090315.615519121 30 ctime=1415090315.615519121 groff-1.22.3/contrib/mom/momdoc/reserved.html0000644000175000001440000045025212426110213020756 0ustar00wlusers00000000000000 Mom -- Reserved words (macros, strings, registers)
Back to Table of Contents

List of reserved words (macros, strings, registers)

The following is a list of reserved words used by mom. Before changing the name of any macro or document element tag with ALIAS, I strongly recommend doing a search of this page for your proposed new name. If you find it in the left hand column, choose something else instead.

Anyone interested in hacking/patching mom’s macro file (om.tmac) will also find this list useful since it lists most of the macros, strings, diversions, aliases, and number registers mom uses, along with brief descriptions of their functions.

The list is not exhaustive. PDF-related macros, strings, registers, and diversions, as well as those associated with preprocessor support and “Lists of” are not included.


TYPESETTING +++MACROS+++ *Page layout PAGELENGTH Page width PAGE Page width/length; left, right, top, bottom margins PAGEWIDTH Page width PAPER Letter, legal, or A4 B_MARGIN Space to leave at page bottom L_MARGIN Page offset R_MARGIN Line length as a function of pagewidth minus pageoffset minus rightmargin T_MARGIN Advance lead from page top *Page control DO_B_MARGIN Margin at bottom of page; trap-invoked DO_T_MARGIN Margin at top of page; trap-invoked *Style COLOR Change color of text to predefined value CONDENSE Set percentage of pseudo-condense (alias of CONDENSE_OR_EXTEND) EXTEND Set percentage of pseudo-extend (alias of CONDENSE_OR_EXTEND) FAMILY Family FT Font FALLBACK_FONT Font to use whenever FAMILY or FT errors occur LL Line length LS Leading (.vs) NEWCOLOR Define a text color PT_SIZE Point size SETBOLDER Set degree of emboldening (pseudo-bold) in units SETSLANT Set degree of pseudo-italic XCOLOR Initialize a color from rgb.txt *Autolead AUTOLEAD Always lead n points more than .PT_SIZE *Quad, fill, justification JUSTIFY Justified text QUAD Filled text, left, right, or centre *Quad, no-fill CENTER Line-for-line, non-filled text, centre LEFT Line-for-line, non-filled text, left RIGHT Line-for-line, non-filled text, right *Hyphenation HY Turn hyphenation on/off, or set LINES, MARGIN, SPACE HY_SET Set LINES, MARGIN, SPACE in a single command *Advanced style KERN Turn automatic kerning on or off LIGATURES Turn ligatures on or off SS Sentence space control WS Word space control *Line breaks BR Alias of br EL Breaks line but doesn't advance SPACE Alias of sp SPREAD Alias of brp *Vertical motions ALD Advance lead RLD Reverse lead *Indents HI Indent hang IB Indent both IBX Indent both off IL Indent left ILX Indent left off IQ Indents off IR Indent right IRX Indent right off IX Indents off -- deprecated TI Indent temporary *Tabs ST String tab TAB_SET Tab Set TN Tab Next TQ Tab Quit *Columnar tabs MCO Turn on multi-column mode MCR Return to top of column MCX Turn off multi-column mode *Underscore UNDERSCORE Underscores words or phrases UNDERSCORE2 Double underscores words or phrases *Underline UNDERLINE Underlines whole passages (Courier only) *Smart Quotes SMARTQUOTES Turns smart quotes on or off *Graphical objects RULE_WEIGHT Weight of rules drawn with \*[RULE] DBX Draw box DCL Draw circle (ellipse) DRH Draw horizontal rule DRV Draw vertical rule *Misc + Support BR_AT_LINE_KERN Deposit a break before RW and WE CAPS Convert u/lc to UC COMMENT Don't print lines till COMMENT OFF (alias of SILENT) DROPCAP_ADJUST Points (poss. fractional) to add/subtract from drop caps DROPCAP Create drop cap DROPCAP_FAMILY Drop cap family DROPCAP_FONT Drop cap font DROPCAP_GUTTER Drop cap gutter DROPCAP_OFF Support only; restores .in if there was one ESC_CHAR Alias for .ec EW Extra white -- loosen overall line kern (character spacing) LEADER_CHARACTER Sets leader character PAD Insert padding spaces at marked places PADMARKER Sets character to use instead of # in PAD PRINT Simply prints args passed to it; keeps my code indented nicely RW Reduce white -- tighten overall line kern (character spacing) SILENT Don't print lines till SILENT OFF SIZESPECS Get cap-height, x-height and descender depth for current point size SUPERSCRIPT_RAISE_AMOUNT Change default vertical displacement of superscripts TRAP Turn traps off or on +++DIVERSIONS+++ NO_FLASH Diverts output of SILENT or COMMENT so they don't print NULL Diverts SIZESPECS in PRINT_HDRFTR so it doesn't screw up FOOTER and FOOTNOTE processing when FOOTERS are on PAD_STRING Diverts $PAD_STRING for processing TYPESIZE Diverts SIZESPECS routine so it doesn't print +++NUMBER REGISTERS+++ #ABORT_FT_ERRORS Abort on FT errors? (boolean) #ALD ALD value #ARGS_TO_LIST Tells LIST whether LIST was invoked with a valid arg; controls LIST OFF processing #ARGS_TO_SQ Tells SMARTQUOTES whether it was invoked with a valid arg; controls SMARTQUOTES OFF processing #AUTOLEAD_FACTOR Using FACTOR arg to AUTOLEAD? (boolean) #AUTO_LEAD Using autolead? (boolean) #AUTOLEAD_VALUE Auto leading value #BL_INDENT Value of left indent when IB #B_MARGIN Bottom margin #B_MARGIN_SET Has a bottom margin been set with B_MARGIN? (boolean) #BOLDER_UNITS Number of units to embolden type #BR_AT_LINE_KERN Break when EW/RW are invoked? (boolean) #BR_INDENT Value of right indent when IB #BX_SOLID Draw box filled? (boolean) c column mark #CAPS_ON Is CAPS enabled? (boolean) #CL_SOLID Draw cirlce filled? (boolean) #CODE_FAM Use different family from Courier for CODE? (boolean) #CODE_FT Use different font from roman for CODE? (boolean) #CONDENSE Are we in pseudo-condense mode? (boolean) #CONDENSE_WAS_ON For restoring \*[COND] in DROPCAP #COND_WIDTH Width of pseudo-condensed type (pointsize x $COND_PERCENT) #CURRENT_HY \\n[.hy] when ref*normal-print called #CURRENT_L_LENGTH Current line length at first invocation of LIST; like #ORIG_L_LENGTH #CURRENT_TAB Current tab number #DC_COLOR Colorize dropcap? (boolean) #DC_GUT Width of dropcap gutter #DC_HEIGHT Dropcap height #DC_LINES Number of lines for dropcap #DEGREES # of degrees slant for pseudo-italic #ENUMERATOR<n> Number register enumerator for depth <n> in lists #EW Is EW in effect? (boolean) #EXT_WIDTH Width of pseudo-extended type (pointsize x $EXT_PERCENT) #EXTEND Are we in pseudo-extend mode? (boolean) #EXTEND_WAS_ON For restoring \*[EXT] in DROPCAP #FILL_MODE Which fill mode are we in? ( \n[.j] ) #FILLED Are we in a fill mode? (boolean) #H_INDENT Value of left indent when IH #HL_INDENT<n> Hanging indent for LIST depth <n> #HL_INDENT Value of the hang when IH #HY_SET Did we manually set hyphenation parameters? (boolean) #HYPHEN_ADJ Amount by which to raise hyphens surrounding page numbers #HYPHENATE Hyphenation on? (boolean) #IN_ITEM Are we in a list item? (boolean) #IN_ITEM_L_INDENT Value passed to IL if #IN_ITEM=1 #IN_TAB Are we in a tab? (boolean) Set in macro TAB; used in ST to determine whether to add #ST_OFFSET to #ST<n>_OFFSET #INDENT_ACTIVE Indicates whether an indent is active (boolean) #INDENT_BOTH_ACTIVE Toggle #INDENT_LEFT_ACTIVE Toggle #INDENT_RIGHT_ACTIVE Toggle #INDENT_STYLE_BOTH Indicates IB when #INDENT_ACTIVE=1 (boolean) #INDENT_STYLE_HANG Indicates IH when #INDENT_ACTIVE=1 (boolean) #INDENT_STYLE_LEFT Indicates IL when #INDENT_ACTIVE=1 (boolean) #INDENT_STYLE_RIGHT Indicates IR when #INDENT_ACTIVE=1 (boolean) #INDENT_STYLE_TEMP Indicates IT when #INDENT_ACTIVE=1 (boolean) #IGNORE_COLUMNS Don't set document in columns (boolean) #IN_DIVER Are we in a diversion? (boolean) #IX_WARN Toggles to 1 the first time IX is user-invoked #JUSTIFY In EW/RW, when BR_AT_LINE_KERN, whether to break or break-spread preceding line (boolean) #KERN Kern on? (boolean) #KERN_UNIT Size of kern units (1/36 of current point size) #KERN_WAS_ON Indicates kerning was on; used in list ITEMs (boolean) #LAST_TAB Last tab number set in multi-columns #LAST_FN_COUNT_FOR_COLS #FN_COUNT_FOR_COLS at top of HEADER #LEAD Leading (alias) #LIGATURES Ligatures on? (boolean) #LIST_INDENT<n> Left indent of list <n> #L_INDENT Value of left indent #L_LENGTH Line length #L_MARGIN Page offset if set with LMARGIN; if .po used, \n[.o] returns page offset #LOOP In EPIGRAPH, #LOOP=1 if a while loop executes; otherwise 0. Elsewhere, an arbitrary incrementing register used to read in strings #MCX_ALD Amount to advance past end of longest column #NEWPAGE Was NEWPAGE just invoked? (boolean) #NEXT_DEPTH_BACK Next list level back in lists #NEXT_TAB Current tab number + 1 (used in TN) #NEXT_TAB Next tab in an n+1 sequence #NOFILL Are we in a nofill mode? (boolean) #NOFILL_MODE Nofill mode #OLD_LEAD Lead in effect prior to changing it with .vs in .LS or .AUTOLEAD #OPEN_CLOSE Manipulates character " to print `` or '' #ORIGINAL_L_LENGTH Used in LIST for IB processing; holds \n[.l] p Output line horiz position at end of $PAD_STRING #PAD_COUNT Number of times # was included in arg to PAD #PAD_LIST_DIGITS Pad list digits to the left? (boolean) #PAD_SPACE Size of padding space #PAGE_LENGTH Page length (alias) #PAGE_WIDTH Page width #PP_ACTIVE Are we in the context of a para? (boolean) #PRINT_FOOTER_ON_PAGE_1 (boolean) #PSEUDO_FILL Signals that LEFT, RIGHT or CENTER is in effect (booleand off, i.e. to 0, when QUAD <arg> or JUSTIFY is called) #PT_SIZE Point size (fractional) in units (alias) #Q_AT_TOP Does a quote start at the top of a new page? (boolean) #QUAD In autoquad mode? (boolean) #QUIT Tells LIST whether to exit lists completely (boolean) #REMOVE Used in LIST OFF cleanup #RESTORE_FILL Used to restore \[.u] state if temporarily changed #RESTORE_LEAD Lead value in effect prior to AUTOLEAD #RESTORE_LINE_LENGTH Restores actual line length in RULE #RESTORE_LN_NUMBER Start linenumbering again with stored #NEXT_LN? (boolean) #RESTORE_PT_SIZE Stores current point size (in units) prior to underscore #R_INDENT Value of right indent #R_MARGIN Right margin #RESTORE_PREV_INDENT Tells LIST OFF what kind of indent was active prior to first invocation of LIST #RESTORE_TRAP Did we have to disable traps? Used in graphical object macros (boolean) #RESTORE_SQ Instructs SMARTQUOTES to restore smartquotes if SMARTQUOTES invoked without an arg #RLD RLD value #RULE_WEIGHT Weight given to RULE_WEIGHT #RULE_WEIGHT_ADJ RULE_WEIGHT/2 #RW Is RW in effect? (boolean) #SHIFT_LIST<n> Value to add to #LIST_INDENT<n> for shifted lists #SILENT Is silent on? (boolean) #SIZE_FOR_PAD Used to ensure that the size in effect prior to PAD is restored at the start of every iteration of $PAD_STRING #SLANT_ON Is SLANT on? (boolean) #SPACE_TO_END Whitespace at end of string passed to PAD #SQ_WAS_ON Instructs CODE OFF to restore smartquotes if they were on prior to CODE #ST<n>_LENGTH Length of ST<n>; calculated during ST <n> #ST<n>_MARK Page offset of autotab <n> at ST<n>X #ST_NUM Incrementing counter for autotab identification #ST<n>_OFFSET Offset (from current tab) to add to #ST<n>_OFFSET when calculating string indents set from within tabs #ST<n>_OFFSET Indent of autotab <n> (page offset) #STORED_L_INDENT Current left indent at first invocation of LIST #STORED_R_INDENT Current right indent at first invocation of LIST #STORED_BL_INDENT Current "both, left" indent at first invocation of LIST #STORED_BR_INDENT Current "both, right" indent at first invocation of LIST #STORED_HL_INDENT Current hanging indent at first invocation of LIST #STORED_T_INDENT Current temporary indent at first invocation of LIST #STR_LENGTH Holds string length derived from .length request tbl Are we in a tbl? (boolean) #T_INDENT Value of temporary indent #T_MARGIN Top margin #TAB_ACTIVE Are we in a tab? (boolean) #TAB_NUMBER Tab number given to TAB_SET #TAB_LENGTH Tab length given to TAB_SET #TAB_OFFSET Tab indent given to TAB_SET #TEXT_WIDTH Width of string to underscore #TN Was TN (or \*[T+] called? (boolean) #TOP Set to 1 in T_MARGIN, DO_T_MARGIN and ALD; tells the first LS or AUTOLEAD on a page to maintain the baseline position prior to the LS call #TOP_BASELINE_ADJ Amount by which to adjust the baseline position of the first line on the page if an LS or AUTOLEAD request differs from the lead current at the end of the previous page #TOTAL_LISTS Total number of lists in a nest #UNDERSCORE_WEIGHT Weight of underscores #UNDERSCORE_WEIGHT_ADJ UNDERSCORE_WEIGHT/2 #USER_SET_L_LENGTH Did user invoke LL? (boolean) #USER_SET_TITLE_ITEM Did user invoke TOC_TITLE_ENTRY? #WEIGHT Weight given to #RULE_WEIGHT #WEIGHT_ADJ RULE_WEIGHT/2 u Horiz position of start of underscore +++STRINGS+++ $ARG String holding substrings derived from .substring request $COND_PERCENT Percentage by which to pseudo-condense type $COLOR_SCHEME Color scheme used in NEWCOLOR $<colorname>_FILL XCOLOR "alias" with _FILL attached; used to determine if the alias exists when the alias is passed to DBX SOLID or DCL SOLID $CURRENT_QUAD Restores current quad value in RULE $CURRENT_TAB Current tab number $DC_ADJUST +|- # of points to subtract from dropcap $DC_FAM Drop cap family $DC_FT Drop cap font $DROPCAP The dropcap letter $ENUMERATOR<n> String enumerator for depth <n> in lists $ENUMERATOR_TYPE<n> Type of enumerator used in LIST<n> $EW Value passed to EW $EXT_PERCENT Percentage by which to pseudo-extend type $FAMILY Family $FAMILY_FOR_PAD Used to ensure that the family in effect prior to PAD is restored at the start of every iteration of $PAD_STRING $FONT Font $FONT_FOR_PAD Used to ensure that the font in effect prior to PAD is restored at the start of every iteration of $PAD_STRING $PAD_MARKER Character to mark off padding in PAD $PAD_STRING Arg passed to PAD $PREFIX<n> Prefix for enumerator of LIST<n> $QUAD_VALUE Quad value (left, right, centre, justify) $QUOTE0 Open quotation marks $QUOTE1 Close quotation marks $RESTORE_COND Restores the pseudo-condense value in effect prior to DROPCAP $RESTORE_EXT Restores the pseudo-extend value in effect prior to DROPCAP $RESTORE_FAM Used to restore the family in effect prior to DROPCAP $RESTORE_FT Used to restore the font/fontstyle in effect prior to DROPCAP $RESTORE_PT_SIZE Used to restore the point size of normal running text after a dropcap $RESTORE_QUAD_VALUE Quad value for use in restoring L, R, C, J (after tabs) $RESTORE_SQ The smartquoting string last passed to SMARTQUOTES $RULE_GAP Distance between underscore rules $RW Value passed to RW $SAVED_STYLE Current style, if there is one (used in FAMILY) $SAVED_UNDERSCORE_GAP Temporarily holds string in $UNDERSCORE_GAP $SEPARATOR<n> Separator for depth <n> in lists $SS_VAR Holds + or - sentence space value $ST<n>_FILL Always QUAD if QUAD passed to ST <n> ST\n[#LOOP] Used to initialize string tab markers (1-19) ST\n[#LOOP]X Used to initialize string tab markers (1-19) $ST<n>_QUAD_DIR Quad direction supplied to ST for <n> $SUP_LOWER Vertical displacement amount of superscripts $SUP_RAISE Vertical displacement amount of superscripts $SUP_RAISE_AMOUNT Argument passed to SUPERSCRIPT_RAISE_AMOUNT $TAB_NUMBER Argument passed to TAB macro to call TAB# macro created in TAB_SET $UNDERSCORE_GAP Distance between text and underscore rule $WS_CONSTANT 12; used to hold groff default wordspace $WS Holds WS value; concatenation of WS_CONSTANT and WS_VAR $WS_VAR + or - value to add to $WS_CONSTANT BLACK Pre-defined black color black Pre-defined black color WHITE Pre-defined white color white Pre-defined white color +++ALIASES+++ ALIAS als ALIASN aln BR br CENTRE CENTER COLOUR COLOR COMMENT SILENT CONDENSE CONDENSE_OR_EXTEND EXTEND CONDENSE_OR_EXTEND FAM FAMILY FT FONT HYPHENATE HY HYPHENATION HY INCLUDE so LIG LIGATURES LL LINE_LENGTH MAC de NEW_PAGE bp NEWCOLOUR NEWCOLOR NEWPAGE NEW_PAGE PAGELENGTH PAGE_LENGTH PAGE_LENGTH pl PAGEWIDTH PAGE_WIDTH SPREAD brp SP sp STRING ds TABSET TAB_SET TB TAB TI IT UNDERSCORE_2 UNDERSCORE2 XCOLOUR XCOLOR +++ALIASES FOR NUMBER REGISTERS+++ #DIVER_DEPTH dn -- diversion depth #DIVER_WIDTH dl -- diversion width #INDENT .i -- value of current indent #LEAD .v -- line space (.vs, not .ls) #L_LENGTH .l -- line length #NUM_ARGS .$ -- number of arguments passed to a macro #PAGE_LENGTH .p -- page length #PT_SIZE .ps -- current point size (fractional) in units #TRAP_DISTANCE .t -- distance to next trap +++INLINE ESCAPES+++ ALD<n> Move down inline by <n> (between .25 and 12.75) B Inline equivalent to .EL BCK Inline backward horizontal movement BD Bold font BDI Bold italic font BLACK Color black color BOLDER Pseudo-bold on BOLDERX Pseudo-bold off BP Back points (horizontal movement) BP<n> Back points by <n> (between .25 and 12.75) BU Back units (inline pairwise kerning) BU<n> Back units by <n> (between 1 and 36) COND Pseudo-condense type COND_FOR_SUP Pseudo-condense string for use with superscripts (called with CONDSUP) COND_FOR_SUP Pseudo-extend string for use with superscripts (called with EXTSUP) CONDSUP Pseudo-condensed superscript (using value set with CONDENSE) CONDSUPX Pseudo-condensed superscript off CONDX Pseudo-condense off DOWN Inline downward vertical movement EN-MARK Inline escape to indicate the beginning of a range of lines used to identify an endnote EXT Pseudo-extend type EXTX Pseudo-extend off EXTSUP Pseudo-extended superscript EXTSUPX Pseudo-extended superscript off FN-MARK Inline escape to indicate the beginning of a range of lines used to identify a footnote FP<n> Forward points by <n> (between .25 and 12.75) FP Forward points (horizontal movement) FU Forward units (inline pairwise kerning) FU<n> Forward units by <n> (between 1 and 36) FWD Inline forward horizontal movement PREV Return to previous font in effect RLD<n> Move up, inline, by <n> (between .25 and 12.75) ROM Roman (medium) font S Same \s SLANT Slant (pseudo-italic on SLANTX Slant off ST<n> String tab end marker ST<n> String tab start marker SUP Superscript SUPX Superscript off TB+ Move to next tab number (n+1) without advancing on the page UP Inline upward vertical movement WHITE Color white Color +++SPECIAL CHARACTERS+++ FOOT The foot character \(fm INCH The inch character \(fm\(fm LEADER Deposit leader to end of current LL or TAB RULE Draw a rule to the full measure of the current line or tab length DOCUMENT PROCESSING +++MACROS+++ *Document info (reference macros) AUTHOR Author CHAPTER Chapter number CHAPTER_TITLE Chapter title COPYRIGHT Copyright info (covers only) DOCTITLE Overall doc title (for collated docs) DRAFT Draft number MISC Misc info (covers only) REVISION Revision number SUBTITLE Doc subtitle TITLE Doc title *Covers COVER What goes on cover COVERS Whether covers get printed (boolean) COVER_ADVANCE Set vertical start position of cover material COVER_LEAD Overall leading of covers COVERTITLE User-defined cover title string DOC_COVER What goes on doc cover DOC_COVERS Whether doc covers get printed DOC_COVER_ADVANCE Set vertical start position of doc cover material DOC_COVER_LEAD Overall leading of doc covers DOC_COVERTITLE User-defined doc cover title string *Document style COPYSTYLE Output style (DRAFT or FINAL) DEFAULTS In START, sets defaults DOCTYPE Kind of doc (DEFAULT, CHAPTER, NAMED, LETTER) PAGENUMBER Page number that appears on 1st page of doc PAPER Paper size (LETTER, LEGAL, A4) PRINTSTYLE Print style (TYPEWRITE or TYPESET) NUMBER_LINES Number output lines in the left margin *Document tags and macros ADD_SPACE Special macro to add space to the top of a pages after page 1; must be preceded by NEWPAGE BIBLIOGRAPHY Begin a bibliography page BIBLIOGRAPHY_TYPE LIST or PLAIN BLOCKQUOTE Block-indented, quoted text COL_BREAK Breaks and spreads line before invocation; moves to next column on page or 1st col of next page. An alias of COL_NEXT. COL_NEXT Moves to next column on page or 1st col of next page ENDNOTE Endnote ENDNOTE_REFS Send REFs to endnotes ENDNOTES Output endnotes EPIGRAPH Epigraph before 1st para EQ/EN eqn block FINIS Prints --END-- FLOAT Keep material together as a block; defer output to following page if not enough room to print FOOTNOTE Collects footnotes in text for printing at bottom of page FOOTNOTE_REFS Send REFs to footnotes HEAD Section title (main heads) HYPHENATE_REFS Turn on/off hyphenation of REF references ITEM Begin a list item LINEBREAK Break between narrative sections LIST Initialize a list MN Margin note MN_INIT Initialize parameters for margin notes NUMBER_LINES Number text lines NUMBER_BLOCKQUOTE_LINES Number blockquote lines NUMBER_QUOTE_LINES Number quote lines PAD_LIST_DIGITS Leave space for two-numeral digit enumerators in a list PARAHEAD Paragraph head PP Paragraph QUOTE Poetic or line for line quotes REF Wrapper around FOOTNOTE or ENDNOTE, depending on FOOTNOTE_REFS or ENDNOTE_REFS REF( Begin embedded reference, parens REF) End embedded reference, parens REF[ Begin embedded reference, square brackets REF] End embedded reference, square brackets REF{ Begin embedded reference, braces REF} End embedded reference, braces REF_INDENT Amount of 2nd line indent of references for footnote, endnote or bibliography refs RESET_LIST Reset digit or alpha list enumerator SHIFT_LIST Move a list over to the right START Sets doc defaults and prints info collected with doc info macros SUBHEAD Subheads SUBSUBHEAD Subsubheads TH Running tbl header TS/TE Begin/end a tbl block *Headers/footers BREAK_QUOTE Manually break a footnoted quote that crosses a page/column DO_FOOTER Prints footer (after footnote processing, if any) FOOTER_ON_FIRST_PAGE Print footer on first page? (boolean) FOOTER Trap-invoked footer macro HEADER Trap-invoked header macro PAGINATE Turns page numbering on or off (doc default=on) PAGINATE_TOC Turns pagination of toc on or off (default=on) RECTO_VERSO Enables switch HEADER_LEFT and HEADER_RIGHT on alternate pages *Control macros -General- ALWAYS_FULLSPACE_QUOTES Fullspace quotes instead of default 1/2 spacing them. ATTRIBUTE_STRING What to print before author (default is "by") CHAPTER_STRING What to print whenever the word "chapter" is required COLUMNS Print in columns DOC_FAMILY Overall doc family DOCHEADER Print doc header? DOCHEADER_ADVANCE Start position of docheader (relative to top of page) DOCHEADER_LEAD +|- value applied to #DOC_LEAD to in/decrease leading of doc header DOC_LEAD_ADJUST Adjust #DOC_LEAD to fill page to #B_MARGIN DOC_LEAD Overall doc leading DOC_LEFT_MARGIN Doc left margin DOC_LINE_LENGTH Doc line length DOC_PT_SIZE Overall doc point size DOC_RIGHT_MARGIN Doc right margin DOC_TITLE Overall doc title that gets printed in headers/footers (mostly for use with collated docs where each doc is an article with a different title DRAFT_STRING What to print whenever the word "draft" is required DRAFT_WITH_PAGENUMBER Attach draft/revision info to page number (instead of putting it HEADER centre) REVISION_STRING What to print whenever the word "revision" is required -Covers- COVER_ADVANCE Vertical place on page to start outputting cover material COVER_LEAD Lead in/decrease for cover pages COVERS_COUNT_PAGES Whether to include cover pages in pagination scheme DOC_COVER_ADVANCE Vertical place on page to start outputting doc cover material DOC_COVER_LEAD Lead in/decrease for doc cover pages DOC_COVERS_COUNT_PAGES Whether to include doc cover pages in pagination scheme -Epigraphs and finis- EPIGRAPH_AUTOLEAD Autolead value for epigraphs EPIGRAPH_INDENT Value by which to multiply PP_INDENT for block epigraphs FINIS_STRING What to print when FINIS is invoked FINIS_STRING_CAPS Whether to capitalize the finis string -eqn- EQ_INDENT Indent value if 'EQ I' -Footnotes- FOOTNOTE_AUTOLEAD Autolead to use in footnotes FOOTNOTE_LINENUMBER_BRACKETS Brackets for footnote linenumbers FOOTNOTE_LINENUMBER_SEPARATOR Separator for footnote linenumbers FOOTNOTE_MARKERS Turns footnote markers on or off FOOTNOTE_MARKER_STYLE STAR or NUMBER; default=STAR FOOTNOTE_RULE_ADJ # of points to raise footnote rule from its baseline FOOTNOTE_RULE_LENGTH Length of footnote separator rule FOOTNOTE_RULE Turns printing of fn separator rule on or off; default is on FOOTNOTE_SPACING Post footnote item spacing FOOTNOTES_RUN_ON Run footnotes on (line numbering mode only) RESET_FOOTNOTE_NUMBER Reset fn# to 1, or, if arg PAGE, reset automatically to 1 on every page RUNON_WARNING Utility macro; warns if FOOTNOTES_RUN_ON was called when fn marker style is STAR or NUMBER -Endnotes- ENDNOTE_LEAD Leading for endnotes page ENDNOTE_LINENUMBER_BRACKETS Brackets around line numbers identifying endnotes and text ENDNOTE_LINENUMBER_GAP Amount of space to leave between line ENDNOTE_LINENUMBER_SEPARATOR Separator between line numbers identifying endnotes and the endnote item text endnotes and text ENDNOTE_MARKER_STYLE NUMBER or LINE ENDNOTE_NUMBERS_ALIGN_RIGHT Hang endnote numbers and align right ENDNOTE_NUMBERS_ALIGN_LEFT Don't hang endnote numbers and align left ENDNOTE_PARA_INDENT First line indent of paras in multi-para endnotes ENDNOTE_PARA_SPACE Whether to space paras in multi-para endnotes ENDNOTE_PT_SIZE Base point size for endnotes page FOOTNOTE_SPACING Post endnotenote item spacing ENDNOTE_STRING Endnotes page head ENDNOTE_STRING_ADVANCE Distance of title string "ENDNOTES" from top edge of page ENDNOTE_STRING_CAPS Capitalize the endnotes string ENDNOTE_STRING_UNDERLINE Underscoring of endnotes page head ENDNOTE_TITLE Endnotes identifying title ENDNOTE_TITLE_SPACE Distance from top of page to endnotest title ENDNOTE_TITLE_UNDERLINE Underscoring of endnotes identifying title ENDNOTES_ALLOWS_HEADERS Page headers on endnotes pages? (boolean) ENDNOTES_FIRST_PAGENUMBER Page number to appear on page 1 of endnotes pages ENDNOTES_HDRFTR_CENTER Print header/footer centre string on endnotes pages? ENDNOTES_HEADER_CENTER Print header centre string on endnotes pages? ENDNOTES_FOOTER_CENTER Print footer centre string on endnotes pages? ENDNOTES_NO_COLUMNS Turn columnar mode off for endnotes pages ENDNOTES_NO_FIRST_PAGENUM Don't print a pagenumber on page 1 of endnotes. ENDNOTES_PAGENUM_STYLE Set numbering style for endnotes pages page numbers SINGLESPACE_ENDNOTES Single space TYPEWRITE endnotes -Bibliographies- BIBLIOGRAPHY_ALLOWS_HEADERS Allow headers on bib pages BIBLIOGRAPHY_FIRST_PAGENUMBER Starting page number for bibliographies BIBLIOGRAPHY_HDRFTR_CENTER Header/footer center string for bib pages BIBLIOGRAPHY_LEAD Base lead of bib pages BIBLIOGRAPHY_NO_COLUMNS De-columnize bibliographies BIBLIOGRAPHY_NO_FIRST_PAGENUM Don't print a page number on the first page of bibliographies BIBLIOGRAPHY_PAGENUM_STYLE Format for bib pages page numbering BIBLIOGRAPHY_PT_SIZE Base point size for bib pages BIBLIOGRAPHY_SPACING Post bib entry space BIBLIOGRAPHY_STRING String for bib title BIBLIOGRAPHY_STRING_ADVANCE Distance of title string "BIBLIOGRAPHY" from top edge of page BIBLIOGRAPHY_STRING_CAPS Capitalize bib title string BIBLIOGRAPHY_STRING_UNDERLINE Underscore bib title string SINGLESPACE_BIBLIOGRAPHY Singlespace bibs if PRINTSTYLE TYPEWRITE -Headers and footers- FOOTER_COLOR Footer color FOOTER_GAP Distance between running text and footer FOOTER_MARGIN Distance from footer to bottom of page FOOTERS Turns footers on or off HDRFTR_CENTER String to go in centre part of header/footer; default doctype HDRFTR_CENTER_CAPS Centre part of header/footer in caps? (boolean) HDRFTR_CENTER_PAD Pad hdrftr CENTER left or right by specified amount HDRFTR_GAP Distance from header/footer to running text HDRFTR_LEFT_CAPS Left part of header/footer in caps? (boolean) HDRFTR_LEFT String to go in left part of header/footer; default is AUTHOR_1 HDRFTR_LEFT The header/footer left string HDRFTR_MARGIN Distance from top of page to header HDRFTR_PLAIN Header/footer fam/ft/ps all same as running text HDRFTR_RECTO User-defined, single string recto header/footer HDRFTR_RIGHT_CAPS Right part of header/footer in caps? (boolean) HDRFTR_RIGHT The header/footer right string HDRFTR_RULE_GAP Space between header/footer and header/footer rule HDRFTR_RULE_INTERNAL Prints the header/footer rule HDRFTR_RULE Turns header/footer rule on or off When invoked internally, prints the rule. HDRFTR_VERSO User-defined, single string verso header/footer HEADERS Turns headers on or off HEADER_GAP Space between header and running text HEADER_MARGIN Space from top of page to header HEADERS_AND_FOOTERS Enables and permits the creation of headers and footers that appear on the same page SWITCH_HDRFTR Switch HDRFTR_LEFT and HDRFTR_RIGHT -Page numbering- PAGENUM_HYPHENS Turns on/off hyphens surrounding page numbers PAGENUM_ON_FIRST_PAGE Print page number on first page when footers are on (boolean) PAGENUM_POS Controls placement of page numbers; default=bottom/centred PAGENUM_SIZE How much to in/decrease point size of page numbers PAGENUM_STYLE Page # in roman, Arabic, or alphabetic RESTORE_PAGINATION Restore pagination after outputting non- paginated endnotes. SUSPEND_PAGINATION Suspend pagination prior to outputting endnotes -Heads- HEAD_CAPS Print section titles in caps? (boolean) HEAD_SPACE Give HEADs 2 line-spaces before. If OFF, only 1. Default is on. HEAD_UNDERLINE Underline section titles? (boolean) NUMBER_HEADS Print head numbers RESET_HEAD_NUMBER Reset head number HEAD_BASELINE_ADJUST Amount to raise head above baseline -Subheads- NUMBER_SUBHEADS Print subhead numbers RESET_SUBHEAD_NUMBER Reset subhead number SUBHEAD_BASELINE_ADJUST Amount to raise subhead above baseline -Subsubheads- NUMBER_SUBSUBHEADS Print subhead numbers RESET_SUBSUBHEAD_NUMBER Reset subhead number SUBSUBHEAD_BASELINE_ADJUST Amount to raise subhead above baseline -Para heads- NUMBER_PARAHEADS Print parahead numbers PARAHEAD_INDENT How much to indent paraheads RESET_PARAHEAD_NUMBER Reset parahead number PREFIX_CH_NUM_WARNING Macro to abort PREFIX_CHAPTER_NUMBER with a warning if the arg to CHAPTER isn't a digit, and user hasn't supplied a digit to PREFIX_CHAPTER_NUMBER PREFIX_CHAPTER_NUMBER Prefix the chapter number to numbered heads, subheads and paraheads -Paragraphs- INDENT_FIRST_PARAS Indent 1st paras? (doc default=not indented) PARA_INDENT Size of para indent PARA_SPACE Put a line space before paras PP_FONT Overall doc font -Quotes- Q_FITS Utility macro for DO_QUOTE Q_NOFIT Utility macro for DO_QUOTE QUOTE_AUTOLEAD Leading of (block)quotes -Line/section breaks- LINEBREAK_CHAR Linebreak character, iterations and positioning -Printstyle TYPEWRITE- ITALIC_MEANS_ITALIC For TYPEWRITE; render .FT I in italic. SLANT_MEANS_SLANT In TYPEWRITE, render \*[SLANT] as slant UNDERLINE_ITALIC In TYPEWRITE, render .FT I as underlined UNDERLINE_QUOTES In TYPEWRITE, underline quotes? (boolean) UNDERLINE_SLANT In TYPEWRITE, render \*[SLANT] as underlined -Table of contents- TOC_APPENDS_AUTHORS Appends author(s) to toc doc title entries TOC_LEAD Leading of toc pages TOC_PADDING Number of placeholders for toc entries page numbers TOC_HEAD_INDENT Indent of toc head entries TOC_HEADER_STRING TOC header string (default=Contents) TOC_PAGENUM_STYLE Page numbering style (hdrftr nums) of toc pages TOC_RV_SWITCH Switch L/R margins of toc pages TOC_PARAHEAD_INDENT Indent of toc parahead entries TOC_SUBHEAD_INDENT Indent of toc subhead entries TOC_TITLE_ENTRY User supplied toc doc title entry TOC_TITLE_INDENT Indent of toc doc title entries *Aliases for header/footer control macros HEADER_SIZE HDRFTR_SIZE HEADER_RIGHT_PS HDRFTR_RIGHT_SIZE HEADER_RIGHT_SIZE HDRFTR_RIGHT_SIZE HEADER_RIGHT_FAM HDRFTR_RIGHT_FAMILY HEADER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY HEADER_RIGHT_FONT HDRFTR_RIGHT_FONT HEADER_RIGHT_FT HDRFTR_RIGHT_FONT HEADER_LEFT_PS HDRFTR_LEFT_SIZE HEADER_LEFT_SIZE HDRFTR_LEFT_SIZE HEADER_LEFT_FAM HDRFTR_LEFT_FAMILY HEADER_LEFT_FAMILY HDRFTR_LEFT_FAMILY HEADER_LEFT_FONT HDRFTR_LEFT_FONT HEADER_LEFT_FT HDRFTR_LEFT_FONT HEADER_CENTRE_PS HDRFTR_CENTER_SIZE HEADER_CENTRE_SIZE HDRFTR_CENTER_SIZE HEADER_FAM HDRFTR_FAMILY HEADER_FAMILY HDRFTR_FAMILY HEADER_CENTRE_FAM HDRFTR_CENTER_FAMILY HEADER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY HEADER_CENTRE_FONT HDRFTR_CENTER_FONT HEADER_CENTRE_FT HDRFTR_CENTER_FONT HEADER_CENTER_PS HDRFTR_CENTER_SIZE HEADER_CENTER_SIZE HDRFTR_CENTER_SIZE HEADER_CENTER_FAM HDRFTR_CENTER_FAMILY HEADER_CENTER_FAMILY HDRFTR_CENTER_FAMILY HEADER_CENTER_FONT HDRFTR_CENTER_FONT HEADER_CENTER_FT HDRFTR_CENTER_FONT FOOTER_SIZE HDRFTR_SIZE FOOTER_RIGHT_PS HDRFTR_RIGHT_SIZE FOOTER_RIGHT_SIZE HDRFTR_RIGHT_SIZE FOOTER_RIGHT_FAM HDRFTR_RIGHT_FAMILY FOOTER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY FOOTER_RIGHT_FONT HDRFTR_RIGHT_FONT FOOTER_RIGHT_FT HDRFTR_RIGHT_FONT FOOTER_LEFT_PS HDRFTR_LEFT_SIZE FOOTER_LEFT_SIZE HDRFTR_LEFT_SIZE FOOTER_LEFT_FAM HDRFTR_LEFT_FAMILY FOOTER_LEFT_FAMILY HDRFTR_LEFT_FAMILY FOOTER_LEFT_FONT HDRFTR_LEFT_FONT FOOTER_LEFT_FT HDRFTR_LEFT_FONT FOOTER_CENTRE_PS HDRFTR_CENTER_SIZE FOOTER_CENTRE_SIZE HDRFTR_CENTER_SIZE FOOTER_FAM HDRFTR_FAMILY FOOTER_FAMILY HDRFTR_FAMILY FOOTER_CENTRE_FAM HDRFTR_CENTER_FAMILY FOOTER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY FOOTER_CENTRE_FT HDRFTR_CENTER_FONT FOOTER_CENTER_PS HDRFTR_CENTER_SIZE FOOTER_CENTER_SIZE HDRFTR_CENTER_SIZE FOOTER_CENTER_FAM HDRFTR_CENTER_FAMILY FOOTER_CENTER_FAMILY HDRFTR_CENTER_FAMILY FOOTER_CENTER_FONT HDRFTR_CENTER_FONT FOOTER_CENTER_FT HDRFTR_CENTER_FONT +++LETTER MACROS+++ CLOSING Closing (i.e. Yours truly,) CLOSING_INDENT Left indent of CLOSING DATE Date for letters FROM Addresser's name and address GREETING Full salutation (e.g. Dear John Smith,) NO_SUITE Remove suite page numbers from bottom of letter pages SIGNATURE_SPACE Amount of room to leave for signature TO Addressee's name and address ALL_DONE .em (the "end macro") for letters +++SUPPORT+++ CHECK_INDENT Applies indents to doc elements inside ev's (head, subhead, etc) CLEANUP_DEFAULTS Removes selected rregisters and strings from DEFAULTS after START DO_COVER Formats and outputs covers DO_DOC_COVER Formats and outputs doc covers D0_QUOTE Outputs quotes with space adjustments before and after DIVER_FN_1_PRE -+ DIVER_FN_2_PRE | Manage footnotes called inside diversions | QUOTE, BLOCKQUOTE and EPIGRAPH DIVER_FN_2_POST -+ DIVERT_FN_LEFTOVER Diverts excess fn stored in FN_OVERFLOW into FOOTNOTE DIVERT_FN_OVERFLOW Diverts excess fn stored in FN_OVERFLOW when FN_DEFER into FOOTNOTE DO_EPIGRAPH Outputs epigraphs with space adjustments before and after FN_OVERFLOW_TRAP Fixed at B_MARGIN; if footnotes run longer than B_MARGIN, diverts excess into FN_OVERFLOW GET_ROMAN_INDENT Figures out amount of space to reserve for roman numerals in lists HDRFTR_RULE Prints rule under header or over footer MN_OVERFLOW_TRAP Trap-invoked macro to collect margin note overflows NO_SHIM Disable SHIM PRINT_FOOTNOTE_RULE An alias of PRINT_FOOTNOTE; prints footnote separator rule PRINT_HDRFTR Prints header/footer (trap invoked) PRINT_PAGE_NUMBER Invoked in HEADER or FOOTER PRINT_USERDEF_HDRFTR Prints user defined, single string recto/verso header/footer PROCESS_SHIM Calculates #SHIM when \n[.d] is lower on the page than #T_MARGIN PROCESS_FN_IN_DIVER Processes footnotes gathered in a diversion (called at page/column breaks) REMOVE_INDENT Removes indents set with CHECK_INDENT Q_FITS Handles spacing of quotes when quote fits on the page Q_NOFIT Handles spacing of quotes when quote does not fit on the page QUIT_LISTS Exit lists cleanly and completely SET_LIST_INDENT Restore indent of a prev. level of list SHIM Advance to next "valid" baseline TBL*CLEANUP Remove selected registers and strings created by TS/TH/TE TBL*GET_QUAD Establish quad of tbl caption tbl*float-warning If tbl in a float exceeds page limits tbl*print-header Administrivia for printing tbl headers tbl@top-hook Trap-invoked (HEADER); prints running tbl header and moves FOOTER/FN_OVERFLOW_TRAP_POS traps to accommodate tbl TERMINATE .em that ensures deferred footnotes get output on final pages TRAPS Sets hdrftr traps; optionally adjusts #DOC_LEAD to fill page to #B_MARGIN TYPEWRITER Sets family (C), font (R) and point size (12) for PRINTSTYLE TYPEWRITE VFP_CHECK Trap-sprung macro, 1 valid baseline higher than where FOOTER will be sprung; checks whether there is, in fact, just enough room for another line of running text to be added to the page without jamming footnotes too close to running text. +++DIVERSIONS+++ B_QUOTE Block (indented) quote text CLOSING_TEXT Closing (i.e. Yours truly,) EPI_TEXT Epigraph text END_NOTES Endnotes text FLOAT*DIV Float content FN_IN_DIVER Footnotes gathered from inside a diversion FN_OVERFLOW Excess footnotes when B_MARGIN is reached FOOTNOTES Text of footnotes GREETING Full salutation (e.g. Dear John Smith,) LETTERHEAD<n> Date, addresser, addressee or greeting; <n> is from 1 to 4, supplied by #FIELD P_QUOTE Line for line (poetic) quote text RUNON_FOOTNOTES Special diversion for run-on footnotes RUNON_FN_IN_DIVER Special diversion for run-on footnotes inside (block)quotes tbl*header-div Running tbl header TOC_ENTRIES TOC entries +++NUMBER REGISTERS+++ #ADJ_BIB_LEAD Adjust BIB_LEAD? (boolean) #ADJ_DOC_LEAD Adjust DOC_LEAD? (boolean) #ADJ_EN_LEAD Adjust EN_LEAD? (boolean) #ADJ_TOC_LEAD Adjust TOC_LEAD? (boolean) #ADVANCE_FROM_TOP Distance from page top to start of running text if no docheader #ARG_NUM Keeps track of number of args passed to a macro #ARGS_TO_LIST Was LIST passed some args? (boolean) #ATTRIBUTE_COLOR Colorize attribute string? (boolean) #AUTHOR_<n> Strings passed to AUTHOR #AUTHOR_COLOR Colorize author(s)? (boolean) #AUTHOR_COVER_NUM Incrementing register used in definining $AUTHOR_COVER_<n> strings #AUTHOR_DOCCOVER_NUM Incrementing register used in definining $AUTHOR_COVER_<n> strings #AUTHOR_NUM Keeps track of user-defined string AUTHOR_<n> in AUTHOR #AUTHORS Equals final value of AUTHOR_NUM; used for authors in doc header #BASELINE_MARK In PP, the vertical position on the page (when paragraph spacing is on) after a quote or blockquote has been output and the post-quote space has been added. #BMARG Position of unvarying bottom margin during doc processing; required for collecting footnotes inside diversions #BIB_ALLOWS_HEADERS Put headers on bib pages? (boolean) #BIB_ALLOWS_HEADERS_ALL Put headers on all bib pages? (boolean) #BIB_FIRST_PAGE Tells PRINT_PAGE_NUMBER about bibliography first page number #BIB_FIRST_PN Starting pagenumber for bibliographies #BIB_HDRFTR_CENTER Put a center string in bib page headers? (boolean) #BIB_LEAD Bibliography lead, expressed in points #BIB_LIST Output bibs in list style? (boolean) #BIB_NO_COLS De-columnize bibliographies? (boolean) #BIB_NO_FIRST_PN Put a page number on the first page of bibliographies? (boolean) #BIB_SINGLESPACE Single-space TYPEWRITE bibliographies? (boolean) #BIB_SPACE Post item space for bibliography pages #BIB_STRING_ADVANCE Vertical position of "BIBLIOGRAPHY" string (relative to the top edge of the page) #BIB_STRING_CAPS Capitalize bib title? (boolean) #BIB_STRING_UNDERLINE Underscore bib title? 0=no; 1=yes; 2=double #BIB_STRING_UNDERLINE_WEIGHT Underline weight in units #BIB_STRING_UNDERLINE_WEIGHT_ADJ Underline weight/2 #BIB_PS Base point size for bibliography pages expressed in points #BIBLIOGRAPHY Are we doing a bib page? (boolean) #BQ_AUTOLEAD Register created by BLOCKQUOTE_AUTOLEAD #BQ_LEAD Leading of blockquotes #BQUOTE_COLOR Colorize blockquotes? (boolean) #BQUOTE_LN Number blockquotes? (boolean) #BROKEN_QUOTE Did we invoke BREAK_QUOTE? (boolean) #CAP_HEIGHT_ADJUST Tallest cap height of strings LEFT, CENTER, and RIGHT in footers; used to place rule over footer #CAPS_WAS_ON In HDRFTR, to re-enable running text CAPS (boolean) #CENTER_CAP_HEIGHT Cap height of CENTER string in headers/footers #CH_NUM The chapter number obtained by PREFIX_CHAPTER_NUMBER #CHAPTER_CALLED Has CHAPTER been invoked? (boolean); used by PREFIX_CHAPTER_NUMBER to see whether to try to get the chapter number from the arg passed to CHAPTER #CHAPTER_TITLE_NUM Incrementing register used to define strings $CHAPTER_TITLE_<n> #CHAPTER_TITLE_COLOR Colorize chapter title? (boolean) #CLOSING Is there a closing (for letters)? (boolean) #CODE_COLOR Colorize CODE? (boolean) #CODE_SIZE_ADJ Percentage by which to scale CODE font #COL_L_LENGTH Line length of columns #COL_<n>_L_MARGIN Left margin of column <n> #COL_NEXT Was COL_NEXT invoked? (boolean; used in FOOTER) #COL_NUM Incrementing counter of num of columns; for use with #COL_<n>_L_MARGIN #COL_TOTAL #COL_L_LENGTH + #GUTTER; used to calculate #COL_<n>_L_MARGIN #COLLATE Are we performing a COLLATE? (boolean) #COLLATED_DOC If 1, instructs TOC that this is a collated doc #COLUMNS Are columns turned on? (boolean) #COLUMNS_WERE_ON Stores columnar state prior to outputting endnotes in no-columns mode #COPY_STYLE 1=draft, 2=final #COUNTERS_RESET Tells FOOTNOTE if fn counters have been reset because of footnotes gathered inside a diversion #COVER Print a COVER? (boolean) #COVER_ATTRIBUTE_COLOR Colorize cover attribution string? (boolean) #COVER_AUTHOR Put AUTHOR(s) on COVER? (boolean) #COVER_AUTHOR_COLOR Colorize cover author(s)? (boolean) #COVER_BLANKPAGE Output blankpage after COVER? (boolean) #COVER_COLOR Colorize COVER? (boolean) #COVER_COPYRIGHT Put copyright on COVER? (boolean) #COVER_COPYRIGHT_COLOR Colorize cover copyright line? (boolean) #COVER_DOCTYPE Put doctype on COVER? (boolean) #COVER_DOCTYPE_COLOR Colorize cover doctype? (boolean) #COVER_END Are we ending a COVER? (boolean) #COVER_LEAD Cover leading #COVER_MISC Put misc on COVER? (boolean) #COVER_MISC_COLOR Colorize cover misc line? (boolean) #COVER_RULE_WEIGHT Doctype underline weight on COVER #COVER_RULE_WEIGHT_ADJ COVER_RULE_WEIGHT/2 #COVER_START_POS Vertical starting pos of cover material #COVER_SUBTITLE Put subtitle on COVER? (boolean) #COVER_TITLE Put title on COVER? (boolean) #COVER_TITLE_NUM Number of cover title items #COVER_TITLE_COLOR Colorize cover title? (boolean) #COVER_SUBTITLE_COLOR Colorize cover subtitle? (boolean) #COVER_UNDERLINE Underline doctype on COVER? (boolean) #COVER_UNDERLINE_WEIGHT Doctype underline weight on COVER #COVER_UNDERLINE_WEIGHT_ADJ COVER_UNDERLINE_WEIGHT/2 #CURRENT_V_POS \n[.d] ; used in SHIM #COVERS Print covers? (boolean) #COVERS_COUNT Include COVER in pagination scheme? (boolean) #COVERS_OFF Don't print COVERs (boolean) #DATE_FIRST Was .DATE invoked as first letter header after .START? (boolean) dc "mark" register for document columns DD Vert. space before and after eqn blocks defer / new-defer Appended to FLOAT*DIV: if float deferred #DEFER_BIB_SPACING Tells DEFAULTS to do BIBLIOGRAPHY_SPACING if it was called before START #DEFER_PAGINATION Tells COLLATE to restore pagination (from RESTORE_PAGINATION #DEFER_SPACE_ADDED Was space added between two "first" footnotes that appear on the same page? (boolean) #DELAY_SHIM Instructs DO_QUOTE to delay SHIM when quote falls at the top of a page #DEPTH LIST depth #DEPTH_1 Doc header depth with lead adjustment (#DOCHEADER_LINES * #DOCHEADER_LEAD) #DEPTH_2 Doc header depth without lead adjustment (#DOCHEADER_LINES * #DOC_LEAD) #DEPTH_TO_B_MARGIN Page length minus #B_MARGIN D-float Depth of float containing/ending with DRH, DRV, DBX, or DCL DI eqn indent if EQ I #DIVER_FN Register that tells FOOTNOTE whether to "move" or "defer" a footnote collected inside a diversion #DIVERSIONS_HY_MARGIN A reasonable value for .hym applied to QUOTE, BLOCKQUOTE and EPIGRAPH to avoid excessive hyphenation if these are set quad left #DIVERTED Set to 1 in DIVERT_FN_OVERFLOW; reset subsequently in FOOTNOTES when called by PROCESS_FN_LEFTOVER to 2 or 3 for use by FOOTER to decide whether to in/decrease #FN_DEPTH when outputting footnotes #DOC_COVER Are we doing a DOC_COVER? (boolean) #DOC_COVER_AUTHOR Put AUTHOR(s) on DOC_COVER? (boolean) #DOCCOVER_BLANKPAGE Output blank page after DOC_COVER? (boolean) #DOC_COVER_CHAPTER_TITLE_COLOR Colorize CHAPTER_TITLE on DOC_COVER? (boolean) #DOC_COVER_COPYRIGHT Put copyright on DOC_COVER? (boolean) #DOC_COVER_DOCTYPE Put doctype on DOC_COVER? (boolean) #DOCCOVER_END Are we finishing a DOC_COVER? (boolean) #DOC_COVER_LEAD Doc cover leading #DOC_COVER_MISC Put misc on DOC_COVER? (boolean) #DOC_COVER_START_POS Vertical starting pos of doc cover material #DOC_COVER_COLOR Colorize cover? (boolean) #DOC_COVER_START_POS Vertical starting pos of cover material #DOC_COVER_TITLE_COLOR Colorize doc cover title? (boolean) #DOC_COVER_SUBTITLE_COLOR Colorize doc cover subtitle? (boolean) #DOC_COVER_ATTRIBUTE_COLOR Colorize doc cover attribution string? (boolean) #DOC_COVER_AUTHOR_COLOR Colorize doc cover author(s)? (boolean) #DOC_COVER_DOCTYPE_COLOR Colorize doc cover doctype? (boolean) #DOC_COVER_COPYRIGHT_COLOR Colorize doc cover copyright line? (boolean) #DOC_COVER_MISC_COLOR Colorize doc cover misc line? (boolean) #DOC_COVER_SUBTITLE Put subtitle on DOC_COVER? (boolean) #DOC_COVER_TITLE Put title on DOC_COVER? (boolean) #DOC_COVER_TITLE_NUM Number of doc cover title items #DOC_COVERS Print doc covers? (boolean) #DOC_COVERS_OFF Don't print DOC_COVERs (boolean) #DOCCOVER_RULE_WEIGHT Doctype underline weight on DOC_COVER #DOCCOVER_RULE_WEIGHT_ADJ DOCCOVER_RULE_WEIGHT/2 #DOCCOVER_UNDERLINE Underline doctype on DOC_COVER? (boolean) #DOCCOVER_UNDERLINE_WEIGHT Doctype underline weight on DOC_COVER #DOCCOVER_UNDERLINE_WEIGHT_ADJ DOCCOVER_UNDERLINE_WEIGHT/2 #DOCCOVERS_COUNT Include DOC_COVER in pagination scheme? (boolean) #DOC_HEADER Whether to print a doc header (boolean) #DOC_LEAD_ADJ Incrementing value (in units) added to #DOC_LEAD to fill page to #B_MARGIN #DOC_LEAD Leading used in body #DOC_L_LENGTH Global L_LENGTH #DOC_L_MARGIN Global L_MARGIN #DOC_LR_MARGIN_TMP In HEADER, if RECTO_VERSO=1, temporarily holds DOC_L_MARGIN during page margin switch #DOC_PT_SIZE Point size used for body text #DOC_R_MARGIN Global R_MARGIN #DOC_TYPE 1=default, 2=chapter, 3=named, 4=letter #DOCHEADER_ADVANCE Distance from top-of-page to baseline of docheader #DOCHEADER_COLOR Colorize docheader? (boolean) #DOCHEADER_DEPTH Depth of docheader #DOCHEADER_LEAD Lead of doc header (#DOC_LEAD + #DOCHEADER_LEAD_ADJ) #DOC_LEAD_ADJUST_OFF Don't adjust DOC_LEAD (boolean) #DOCS Always 1 after START #DOCTITLE_NUM Number of doctitle items #DOCTYPE_COLOR Colorize doctype? (boolean) #DOCTYPE_RULE_WEIGHT Doctype underline weight #DOCTYPE_RULE_WEIGHT_ADJ DOCTYPE_RULE_WEIGHT/2 #DOCTYPE_UNDERLINE Underline doctype? (boolean) #DOCTYPE_UNDERLINE_WEIGHT Weight of doctype underline #DOCTYPE_UNDERLINE_WEIGHT_ADJ DOCTYPE_UNDERLINE_WEIGHT/2 #DOING_COVER Tells PRINT_AUTHORS that it's printing the authors for a cover or doc cover #DONE_ONCE Keeps track of how many times footnotes have been collected inside the same diversion #DONT_RULE_ME Rule this (apparent) first footnote? (boolean) #DIVER_LN_OFF Turn linenumbering off in (block)quotes? (boolean) #DRAFT_WITH_PAGENUM Are we attaching draft/revision info to page number? (boolean) #EM_ADJUST Amount to raise \(em at END #EN_ALLOWS_HEADERS Put page headers on endnotes pages? (boolean) #EN_ALLOWS_HEADERS_ALL Put page headers on all endnotes pages? (boolean) #EN_BQ_AUTOLEAD Register created by EN_BLOCKQUOTE_AUTOLEAD #EN_BQ_LEAD Leading of blockquotes on endnotes pages #EN_FIGURE_SPACE Width of \0, for use with formatting endnotes #EN_FIRST_PAGE Tells PRINT_PAGE_NUMBER about endnotes first page number #EN_FIRST_PN Page number that appears on page 1 of endnotes pages. #EN_HDRFTR_CENTER Should we print centre string of headers/footers on endnotes pages? (boolean) #EN_LEAD Lead of endnotes #EN_LN_BRACKETS Are we using brackets for line-numbered endnotes (boolean) #EN_LN_SEP Are we using a separator for line-numbered endnotes (boolean) #EN_MARK \n[ln] when \*[EN-MARK] is called #EN_MARK_2 \n[ln] when ENDNOTE is called #EN_MARKER_STYLE 1=NUMBER; 2=LINE #EN_NO_COLS Do not set endnotes in columns? (boolean) #EN_NO_FIRST_PN Put pagenumber on 1st page of endnotes? (boolean) #EN_NUMBER Number of current endnote #EN_NUMBER_PLACEHOLDERS Number of placeholders to reserve for endnotes numbers #EN_NUMBERS_ALIGN_RIGHT Hang and align endnote numbers right? (boolean) #EN_NUMBERS_ALIGN_LEFT Align endnote numbers with left margin? (boolean) #EN_NUMBERS_PLACEHOLDERS Number of placeholders when endnote numbers hang and align right #EN_NUMBER_L_LENGTH Line length for endnote numbers when they're right aligned #EN_PP_INDENT First line indent of paras in multi-para endnotes #EN_PP_SPACE Space multi-paras in endnotes? (boolean) #EN_PS ps of endnotes #EN_Q_AUTOLEAD Register created by EN_QUOTE_AUTOLEAD #EN_Q_LEAD Leading of quotes on endnotes pages #EN_REF Put REFs in endnotes? (boolean) #EN_SINGLESPACE Single space endnotes pages? (boolean) #EN_STRING_ADVANCE Vertical position of "ENDNOTES" string (relative to the top edge of the page) #EN_STRING_CAPS Should ENDNOTES capitalize the endnotes string? (boolean) #EN_STRING_UNDERLINE Underscore endnotes page head? (boolean) #EN_STRING_UNDERLINE_WEIGHT Weight of endnotes page title underscore #EN_STRING_UNDERLINE_WEIGHT_ADJ EN_STRING_UNDERLINE_WEIGHT_ADJ/2 #EN_TEXT_INDENT Page offset for text of endnotes when numbers right align #EN_TITLE_UNDERLINE Underscore endnotes document identifier? (boolean) #EN_TITLE_UNDERLINE_WEIGHT Weight of endnotes document identification underscore #EN_TITLE_UNDERLINE_WEIGHT_ADJ #EN_STRING_UNDERLINE_WEIGHT_ADJ/2 #END_QUOTE For PP=0 indenting; did we just end a quote? (boolean) #ENDNOTE Are we in an endnote? (boolean) #ENDNOTE_REFS Are REFs going to endnotes? (boolean) #ENDNOTES Are we in an endnote (for FOOTERs; boolean) #EPI_ACTIVE Are we in an epigraph? (boolean) #EPI_AUTOLEAD Autolead value for epigraphs #EPI_COLOR Colorize epigraphs? (boolean) #EPI_DEPTH Depth of epigraph from first baseline to last #EPI_FITS Does epigraph fit on page/column? (boolean) #EPIGRAPH Did we have an epigraph? (boolean) #EPI_LEAD_DIFF Difference between #DOC_LEAD and #EPI_LEAD #EPI_LEAD Leading of epigraph; set by AUTOLEAD #EPI_LINES_EVEN Even # of lines at end of epi crossing page in TYPEWRITE (d-spaced)? #EPI_LINES Number of lines in the epigraph #EPI_LINES_TO_END Number of epigraph lines remaining after footer trap is sprung #EPI_LINES_TO_TRAP Number of epigraph lines till footer trap is sprung #EPI_L_LENGTH Epigraph line length #EPI_OFFSET Left margin of epigraphs #EPI_OFFSET_VALUE Epigraph indent as a function of page offset #EPI_ON Are we in an epigraph? (boolean) #EPI_WHITESPACE Space after epigraph to compensate for epigraph leading #FIELD Incrementing register tacked onto LETTERHEAD #FINIS Was FINIS invoked? (boolean) #FINIS_STRING_CAPS Capitalize finis string? (boolean) #FINIS_COLOR Colorize FINIS? (boolean) #FIRST_DOC_TITLE_PN Page number of 1st (collated) doc (for TOC) #FIRST_DOC_TOC_PN_PADDING Padding for 1st page number of 1st (collated) doc (for TOC) float*after-shim / \n[nl]; tests if SHIM has stayed on the same float*before-shim baseline float-span Float can run to multiple pages? (boolean) float*with-tbl Float contains a tbl block #FN_AUTOLEAD Autolead value of footnotes #FN_BL_INDENT Left indent of INDENT BOTH in footnotes #FN_BR_INDENT Right indent of INDENT BOTH in footnotes #FN_COUNT Which fn marker to print; also to tell mom to reserve space for and print the rule above footnotes #FN_COUNT_AT_FOOTER The FN_COUNT after FOOTNOTES has been output in FOOTER #FN_COUNT_FOR_COLS Holds a separate footnote count for columns (so they don't reset to 0 1 until page break) #FN_DEFER Defer footnote to next page/column? (boolean) If 0, don't defer. #FN_DEFER_SPACE Whether to deposit space before footnote 1 because there's a deferred footnote on the page #FN_DEPTH Depth of footnote diversion(s) #FN_FOR_EPI Signals to epigraph that a footnote is being processed #FN_GAP When there are footnotes on a page, the difference between where FOOTER will be sprung and the next valid baseline. Used in VFP_CHECK. #FN_LEAD Lead in footnotes after FN_AUTOLEAD is applied #FN_L_INDENT Left indent of INDENT LEFT in footnotes #FN_LINES Number of lines in fn; used to calculate fn depth #FN_LN_BRACKETS Are footnote linenumber brackets being used? (boolean) #FN_LN_SEP Is a footnote linenumber separator being used? (boolean) #FN_MARK \n[ln] when \*[FN-MARK] is called #FN_MARK_2 \n[nl] when FOOTNOTE is called #FN_MARKER_STYLE 1=STAR; 2=NUMBER #FN_MARKERS Print footnote markers? (boolean) #FN_NUMBER The footnote number attached to running text (and fns) when numbers instead of star/dagger is being used for footnootes numbers #FN_OVERFLOW_DEPTH Depth of leftover from footnote processing #FN_OVERFLOW_TRAP_POS The register that sets the position of trap FN_OVERFLOW_TRAP. #FN_R_INDENT Right indent of INDENT RIGHT in footnotes #FN_REF Put REFs in footnotes? (boolean) #FN_RULE Print fn rule? (boolean) #FN_RULE_ADJ # of points to raise footnote separator from its baseline #FN_RULE_LENGTH Length of footnote separator rule #FN_RULE_WEIGHT Weight of the footnote separator rule #FN_RULE_WEIGHT_ADJ FN_RULE_WEIGHT/2 #FN_WAS_DEFERED Tells HEADER about a deferred footnote #FOOTER_DIFF In TRAPS, the difference between the original #B_MARGIN and #VISUAL_B_MARGIN #FOOTER_GAP Amount of space between end of text and page # #FOOTER_MARGIN Amount of space between page # and bottom of page #FOOTER_POS Position of footer trap (required for collecting footnotes inside a diversion) #FOOTER_RULE Print footer rule? (boolean) #FOOTER_RULE_GAP Gap between footer and separator rule above #FOOTER_RULE_WEIGHT Weight of footer rule #FOOTER_RULE_WEIGHT_ADJ #FOOTER_RULE_WEIGHT/2 #FOOTERS_ON Are we using footers? (boolean) #FOOTERS_WERE_ON Were footers on? - used in FINIS and BLANKPAGE (boolean) #FOOTNOTE_COLOR Colorize footnotes? (boolean) #FORCE Force float? (boolean) #FROM_BIB_STRING Tells UNDERSCORE it's underscoring $BIB_STRING #FROM_COVER Tells UNDERSCORE it's underscoring on a cover #FROM_DOC_COVER Tells UNDERSCORE it's underscoring on a doccover #FROM_DOCTYPE Tells UNDERSCORE it's underscoring the doctype #FROM_EN_STRING Tells UNDERSCORE it's underscoring $EN_STRING #FROM_EN_TITLE Tells UNDERSCORE it's underscoring $EN_TITLE #FROM_HEAD Tells UNDERSCORE it's underscoring a head #FROM_DIVERT_FN Signals to FOOTNOTE, when run from within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total area allowable for running text #FROM_FOOTER In col to col footnote processing, tells FOOTNOTE that FOOTNOTES was output from FOOTER. #FROM_HEADER In col to col footnote processing, tells FOOTNOTE that FOOTNOTES was output from HEADER. #FULLSPACE_QUOTES Should we fullspace quotes? (boolean) #GET_DC_HEIGHT Used in routine to get the correct point size for dropcaps #GET_DEPTH Signals to FOOTNOTE that it should measure the depth of current footnotes plus the most recently added one, except where the footnote is to be deferred to the next page or column #GUTTER Width of gutter between columns #H_BASELINE_ADJ Vertical spacing adjustment for heads (default=0) #HDRFTR_BOTH Are we setting both headers and footers? (boolean) #HDRFTR_CENTER_CAPS CENTER part of header/footer in caps? (boolean; default=off) #HDRFTR_CENTER_COLOR Colorize header/footer center? (boolean) #HDRFTR_COLOR Colorize headers/footers? (boolean) #HDRFTR_CTR_PAD_LEFT Amount of hdrftr CENTER padding on the left #HDRFTR_CTR_PAD_RIGHT Amount of hdrftr CENTER padding on the right #HDRFTR_CTR_PAD_TMP Temp storage of left hdrftr CENTER padding (for recto/verso switch) #HDRFTR_HEIGHT Cap height of $HDRFTR_RECTO/$HDRFTR_VERSO strings #HDRFTR_LEFT_CAPS Left part of header/footer in caps? (boolean; default=off) #HDRFTR_LEFT_COLOR Colorize header/footer left? (boolean) #HDRFTR_PT_SIZE Initial point size of headers/footers #HDRFTR_RECTO_CAPS Header/footer recto caps? (boolean) #HDRFTR_RIGHT_CAPS Right part of header/footer in caps? (boolean; default=on) #HDRFTR_RIGHT_COLOR Colorize header/footer right? (boolean) #HDRFTR_RULE Print head/footer rule? (boolean) #HDRFTR_RULE_COLOR Colorize header/footer rule? (boolean) #HDRFTR_RULE_GAP Space between header/footer and header/footer rule #HDRFTR_RULE_WEIGHT Weight of header/footer rule #HDRFTR_RULE_WEIGHT_ADJ HDRFTR_RULE_WEIGHT/2 #HDRFTR_TMP_CAPS_SWITCH Temporarily holds HDRFTR_LEFT_CAPS value if #SWITCH_HDRFTR=1 #HDRFTR_VERSO_CAPS Header/footer verso caps? (boolean) #HEAD 1=main/section head 2=subhead #HEAD_CAPS Print section titles in caps? (boolean) #HEAD_COLOR Colorize heads? (boolean) #HEADER_GAP Distance from header to running text #HEAD_NUM Head number #HEAD_SPACE 2 line spaces before heads? (boolean) #HEAD_UNDERLINE Underline heads? (boolean) #HEAD_UNDERLINE_WEIGHT Head underline weight #HEAD_UNDERLINE_WEIGHT_ADJ HEAD_UNDERLINE_WEIGHT/2 #HEADER_MARGIN Distance from top of page to header #HEADER_RULE Print header rule? (boolean) #HEADER_RULE_GAP Gap between header and header rule #HEADER_RULE_WEIGHT Header rule weight #HEADER_RULE_WEIGHT_ADJ HEADER_RULE_WEIGHT/2 #HEADERS_ON Headers on? (boolean) #HEADER_STATE Saves header state in COLLATE for use in START after COLLATE #HEADERS_WERE_ON Were headers on? - used in BLANKPAGE (boolean) #HF_OFF Has HEADERS_AND_FOOTERS been turned off? (boolean) #HORIZ_MARK Horizontal #HOW_MANY Number of blank pages to output #IGNORE Should we ignore this macro? Set to 1 in TYPEWRITE. #IN_BIB_LIST Tells ITEM we're doing a bibliography in list style #INDENT_FIRST_PARAS Indent first paras? (boolean) #INDENT_FIRSTS Tells footnotes to leave INDENT_FIRST_PARAS alone if it's on for running text. #ITALIC_MEANS_ITALIC For TYPEWRITE. (boolean) #ITEM Counter for removing _1, _2, _3... strings in TITLE, CHAPTER_TITLE, etc. #L_LENGTH_FOR_EPI Stores line length at top of doc for use with EPIGRAPH when columns are on #L_MARGIN_DIFF Difference between DOC_L_MARGIN and L_MARGIN #LB_CHAR_ITERATIONS Number of linebreak character iterations #LEFT_CAP_HEIGHT Cap height of left string in headers/footers #VALID_BASELINE Calculates vert. position of next valid baseline in SHIM #LETTER_STYLE 1=BUSINESS 2=PERSONAL #LINEBREAK Did we have a linebreak? (boolean) #LINEBREAK_COLOR Colorize linebreak? (boolean) #LINENUMBER_COLOR Colorize linenumbers? (boolean) #LINENUMBERS Holds various states of line-numbering when line numbering is enabled #LINES_PER_PAGE # of lines (at DOC_LEAD) that fit on page after #B_MARGIN is set #LN Test 1st arg to NUMBER_LINES for digit or string MN-active Are we doing a margin note? (boolean) MN-curr Current margin note MN-div-<n>-depth Depth of margin note <n> MN-hy Hyphenation flag of margin notes #MNinit Have margin notes been initialized? (boolean) #MNinit_DEFERRED Did we have to defer a margin note? (boolean) MN-last-pos Baseline of previous margin note MN-lead-adj Difference between the current DOC_LEAD and the leading used in margin notes MN-left Number of current left margin note MN-left-start Horizontal start position of left margin note MN-left-width Width of left margin note MN-right Number of current right margin note MN-right-start Horizontal start position of right margin note MN-right-width Width of right margin note MN-sep Gutter between margin notes and running text MN-shifted Did we have to shift a margin note down? (boolean) MN-size Point size of margin notes MN-spacing Leading of margin notes #MISC_<n> Used to print "next" misc lines in DO_COVER #MISC_COVER_NUM Number of cover misc items #MISC_DOCCOVER_NUM Number od doc cover misc items #MISC_NUM Number of MISC items #MISCS =#MISC_NUM in DO_COVER #MN_OVERFLOW_LEFT If 1, left margin note text overflows #MN_OVERFLOW_RIGHT If 1, right margin note text overflows #n%_AT_PAGENUM_SET Page # from n% when PAGENUMBER invoked #NEEDS_SPACE Instruct FOOTNOTE, when called by PROCESS_FN_IN_DIVER, that if the footnote had to be deferred, the VFP must be raised by 1v (set in DIVER_FN_2_PRE) #NEITHER Should we print no covers? (boolean) #NEXT_AUTHOR Supplies correct digit to AUTHOR_<n> when printing authors in doc header #NEXT_LN Next linenumber when \n[ln] has to be stored because linenumbering suspended #NEXT_MISC Incrementing counter for misc lines in DO_COVER #NEXT_SUBTITLE Incrementing register used to print subtitles #no-repeat-MN-left Don't repeat left margin note (boolean) #no-repeat-MN-right Don't repeat right margin note (boolean) #NO_BACK_UP Instructs FN_OVERFLOW_TRAP not to subtract 1 line of footnote lead from FN_OVERFLOW in a PREV_FN_DEFERRED situation. #NO_BREAK Set to 1 in COLLATE if last line of text before COLLATE falls at the bottom of the page; instructs NEWPAGE to use 'br instead of .br #NO_COLUMNS Don't print document in columns (boolean) #NO_FN_MARKER Don't print footnote markers (boolean) #NO_SHIM Should SHIM shim? (boolean) #NO_SPACE When para spacing is active, instructs PP not to add space after a quote or blockquote #NO_TRAP_RESET Should we reset page traps? (boolean) #NOT_YET_ADJUSTED Line on which a footnote was called has not yet been adjusted by groff (boolean) #NUM_AUTHORS # of authors mod 2 to test if odd or even # of authors #NUM_MISCS Number of args passed to MISC #NUM_MISCS_COVER Number of args passed to MISC COVER #NUM_MISCS_DOCCOVER Number of args passed to MISC DOC_COVER #NUMBER_HEAD Are heads numbered? (boolean) #NUMBER_PH Are paraheads numbered? (boolean) #NUMBER_SH Are subheads numbered? (boolean) #NUMBER_SSH Are subsubheads numbered? (boolean) #NUM_COLS Number of columns per page #NUMBERED If set to 1, lets PARAHEAD know that main-, sub-, and subsubhead numbers have already been prefixed to the parahead string #NUM_FIELDS Incrementing register used to match #TOTAL_FIELDS #OK_PROCESS_LEAD Initial processing of TOC and endnote leading is deferred until OK_PROCESS_LEAD=1 #ORIGINAL_B_MARGIN The value for #B_MARGIN as set by the macro B_MARGIN #ORIG_DOC_LEAD DOC_LEAD before endnotes, bibliographies, tocs #ORIG_L_LENGTH \\n[.l] before starting LISTs #ORIGINAL_DOC_LEAD The lead for PRINT_STYLE 1 as set in PRINTSTYLE; required so that PRINT_STYLE 1 footnotes have an unadjusted lead of 12 points #OVERFLOW Signals to FOOTNOTE that some of the footnote text won't fit on the page #OVERFLOW_LEFT Does left margin note overflow? (boolean) #OVERFLOW_RIGHT Does right margin note overflow? (boolean) #P Page number for margin notes #PAD_LIST_DIGITS<n> Pad LIST digits for LIST <n>? (boolean) #PAGE_NUM_ADJ What to add to n% to get #PAGENUMBER #PAGE_NUM_H_POS 1=left 2=CENTER 3=right; default=2 #PAGE_NUM_COLOR Colorize pagenumbers? (boolean) #PAGE_NUM_HYPHENS Print hyphens surrounding page numbers? (boolean) #PAGE_NUM_HYPHENS_SET Did user set (or unset) hyphens around page numbers? (boolean) #PAGE_NUM_POS_SET Did user set page number position? (boolean) #PAGE_NUM_SET Test if PAGE_1_NUM was used to set 1st page number #PAGE_NUM_V_POS 1=top 2=bottom; default=2 #PAGE_NUMS Print page numbers? (boolean) #PAGE_POS Exact position on page during a diversion (required for collecting footnotes inside a diversion) #PAGE_TOP \n[nl] after HEADER completes itself #PAGENUM_STYLE_SET Did we set pagenumber style? (boolean) #PAGENUMBER The page number #PAGES Number of blank pages to output #PAGINATE Are we paginating? (boolean) #PAGINATE_TOC Is toc pagination on? (boolean) #PAGINATE_WAS_ON Keeps track of pagination state while outputting blank pages #PAGINATION_STATE Saves pagination state in COLLATE for use in START after a COLLATE #PAGINATION_WAS_ON Was pagination on? - used in FINIS (boolean) #PH_COLOR Colorize paraheads? (boolean) #PH_INDENT Size of parahead indent #PH_NUM Parahead number #PP 0 at first para; auto-increments #PP_AT_PAGE_BREAK # of last (incl. partial) para on page #PP_INDENT How much to indent paras #PP_SPACE Put space before paras? (boolean) #PP_SPACE_SUSPEND Suspend para spacing for blockquotes and epigraphs #PP_STYLE_PREV In footnotes, stores PP style in effect prior to invoking FOOTNOTE #PP_STYLE Regular para=1; quote or epi para=2 #PRE_COLLATE Set to 1 in COLLATE; prevents FAMILY from clobbering a user-set DOC_FAMILY #PREFIX_CH_NUM Prefix the chapter number to numbered heads, subheads and/or paraheads? (boolean) #PREV_FN_DEFERRED Was previous footnote deferred? (boolean) #PRINT_PAGENUM_ON_PAGE_1 Should we print the page number on first page of doc when footers are on? (boolean) #PRINT_STYLE Typewrite=1, typeset=2 #PT_SIZE_IN_UNITS Stored value of \n[.ps] from last time PT_SIZE was called #Q_AUTOLEAD Register created by QUOTE_AUTOLEAD #Q_DEPTH Depth of quote #Q_FITS Does this quote fit on one page/column? (boolean) #Q_LEAD Leading of quotes #Q_LEAD_DIFF Difference between leading of running text and the leading used in quotes/blockquotes #Q_LEAD_REAL Leading of quotes and blockquotes saved at the ends of their respective diversions #Q_L_LENGTH Line length of quotes #Q_OFFSET Page offset for quotes #Q_OFFSET_VALUE Factor by which to multiply PP_INDENT to offset quotes #Q_PARTIAL_DEPTH The amount of a quote/blockquote that fits at the bottom of a page when a quote/blockquote spans pages #Q_PP In PP, stores para # in QUOTE. Removed in ENDQUOTE. #Q_SPACE_ADJ The flexible amount of whitespace to add before and after a quote/blockquote #Q_TOP Vertical place on page that a quote starts #QUOTE 1=PQUOTE, 2=BQUOTE #QUOTE_COLOR Colorize quotes (poetic)? (boolean) #QUOTE_LN Linenumber quotes? (boolean) #RECTO_VERSO Switch HEADER_LEFT and HEADER_RIGHT on alternate pages? (boolean) ref*suppress-period Suppress period at end of ref field? (boolean) ref*type Kind of reference we're building #REF Was REF called? (boolean) #REF_HY Hyphenate REFs? (boolean) #REF_WARNING Have we issued a ref warning? (boolean) #REPEAT Number of times to repeat linebreak character #RERUN_TRAPS Should we invoke TRAPS? (boolean) #RESERVED_SPACE Just enough room to put 1 more line of footnotes on the page #RESET_EN_PP Holds value of register #EN_PP_INDENT #RESET_EN_PP_INDENT Holds value of register #EN_PP_INDENT #RESET_FN_COUNTERS 1 = "moved" footnote collected in a diversion 2 = "deferred" fn collected in a diversion #RESET_FN_NUMBER Should fn# start at 1 on every page? (boolean) #RESET_L_LENGTH Stores current line length when necessary #RESET_PARA_SPACE Holds current value of boolean register #PP_SPACE #RESET_PP_INDENT Stores value of PP_INDENT when needed #RESET_QUOTE_SPACING Stores value of boolean register #FULLSPACE_QUOTES (used in endnotes) #RESTORE_ADJ_DOC_LEAD Stores value of #ADJ_DOC_LEAD whenever needed #RESTORE_B_MARGIN Stores #B_MARGIN whenever needed #RESTORE_DOC_LEAD Stores value of current doc lead (used in endnotes) #RESTORE_HY Restore hyphenation after .][? (boolean) #RESTORE_INDENT Store \n[.i] whenever needed #RESTORE_L_LENGTH Stores \n[.l] whenever needed #RESTORE_LN_NUM Should we restore line numbering? (boolean) #RESTORE_OFFSET Page offset at moment footer trap is sprung; not currently used #RESTORE_UNDERLINE Instructs CODE OFF to restore underlining of italics (TYPEWRITE) if underlining was formerly on #RIGHT_CAP_HEIGHT Cap height of right string in headers/footers #RULED Tells FOOTNOTE if a rule (or space has been put above the first footnote on the page #RUNON_FN_IN_DIVER If #LN=1, if we're in a (block)quote, instructs FOOTNOTE to unformat diversion RUNON_FN_IN_DIVER #RUNON_FOOTNOTES If #LN=1, instructs FOOTNOTE to unformat diversion RUNON_FOOTNOTES #RUN_ON Are we using run-on footnotes? (boolean) #SAVED_DIVER_FN_COUNT In the case of a footnote inside a diversion that should be treated as a "normal" footnote, FOOTNOTE needs to distinguish between a "normal" deferred footnote (always the 1st footnote on the page) and one that only looks as if it should be deferred, when, in fact, it's an overflow; this register lets FOOTNOTE know whether the diversion footnote is, in fact, the first on the page. #SAVED_DOC_LEAD Stored value of #DOC_LEAD (used in DEFAULTS after a COLLATE) #SAVED_FN_COUNT #FN_COUNT+1 prior to +#FN_COUNT; used in FOOTNOTES while gathering fns inside diversions #SAVED_FN_COUNT_FOR_COLS #FN_COUNT_FOR_COLS+1 prior to +#FN_COUNT_FOR_COLS; used in FOOTNOTES while gathering fns inside diversions #SAVED_FN_DEPTH_1 Footnote depth prior to adding footnote diversion depth to FN_DEPTH; used when footnote text will overflow #SAVED_FN_DEPTH_2 Footnote depth after to adding footnote diversion depth to FN_DEPTH; used when footnote text will overflow #SAVED_FN_NUMBER Stores current FN_NUMBER whenever needed #SAVED_FOOTER_POS Position of FOOTER in DO_QUOTE (hack) #SAVED_LEAD In FOOTER and DO_FOOTER, stores the lead in effect prior to outputting FOOTNOTES or performing either PROCESS_FN_LEFTOVER or PROCESS_FN_IN_DIVERSION; both the diversion FOOTNOTES and the two macros have, for PRINT_STYLE 2, an AUTOLEAD call, which requires that an LS be performed with the #SAVED_LEAD in order to remove register #AUTO_LEAD or #AUTO_LEAD_FACTOR. #SAVED_UNDERSCORE_WEIGHT Stores underscore weight whenever needed #SAVED_UNDERSCORE_WEIGHT_ADJ SAVED_UNDERSCORE_WEIGHT/2 #SAVED_VFP Store variable footer position whenever needed #SAVED_WEIGHT Stores weight given to RULE_WEIGHT whenever needed #SAVED_WEIGHT_ADJ SAVED_UNDERSCORE_WEIGHT/2 #SEP_TYPE Set to 1 if LIST separator is ( or [ or { #SH_COLOR Colorize subheads? (boolean) #SH_BASELINE_ADJ #DOC_LEAD/8 (TYPESET) or /5 (TYPEWRITE) (used for subhead vertical spacing) #SH_NUM Subhead number #SHIM Amount of lead required to advance to next valid baseline #SILENT_BQUOTE_LN "Silently" linenumber blockquotes? (boolean) #SILENT_QUOTE_LN "Silently" linenumber quotes? (boolean) #SINGLE_SPACE Is TYPEWRITE in single space mode? (boolean) #SKIP ENTRY If one, don't print the first entry (the document title) in the TOC of uncollated docs. #SKIP_FOOTER If 1, instructs DO_FOOTER to do nothing if B_MARGIN falls below FOOTER_MARGIN #SLANT_MEANS_SLANT For TYPEWRITE. (boolean) #SLANT_WAS_ON Keeps track of SLANT when it needs to go off for a while #SPACE_REMAINING Space remaining to footer trap; used to decide whether or not to defer a footnote #SPACE_TO_FOOTER Distance to FOOTER trap; used to calculate available space when FOOTNOTE is called inside a diversion #SR_ADJ_FACTOR An adjustment factor that compensates for the fact that #SPACE_REMAINING sometimes reports a fractionally larger space than is actually available for footnote text. #SSH_BASELINE_ADJ #DOC_LEAD/8 (TYPESET) or /5 (TYPEWRITE) (used for subsubhead vertical spacing) #START If 1, signals completion of START #START_FOR_FOOTERS Toggle set in START; signals to PRINT_HDRFTR that START has been invoked, allowing PRINT_HDRFTR to decide whether or not to print a footer on page 1 #START_FOR_MNinit If 1, defer processing MN_INIT until #START #STORED_PP_INDENT Temporarily holds value of #PP_INDENT #SUBHEAD Was subhead the last macro invoked? (boolean) Controls vert. space between SUBHEAD and SUBSUBHEAD #SUBTITLE_COLOR Colorize subtitle? (boolean) #SUBTITLE_COVER_NUM Incrementing register used to define strings $SUBTITLE_COVER_<n> #SUBTITLE_DOCCOVER_NUM Incrementing register used to define strings $SUBTITLE_DOCCOVER_<n> #SUBTITLE_NUM Incrementing register used to define strings $SUBTITLE_<n> #SUBTITLES Holds number of subtitle items #SUITE Current page number (for letters) #SUP_PT_SIZE Point size of superscript #SUSPEND_PAGINATION Suspend pagination prior to endnotes? #SWITCH_HDRFTR Switch HDRFTR_LEFT and HDRFTR_RIGHT? (boolean) tbl*boxed tbl has box or allbox (boolean) tbl*center-label-on-table Is tbl caption centered? (boolean) tbl*have-header tbl has a running header (boolean) tbl*header-ht Depth of tbl*header-div tbl*left-label-on-table Is tbl caption quad left? (boolean) tbl*move-fn-overflow-trap Whether to move FN_OVERFLOW_TRAP_POS to accommodate tbl tbl*move-fn-overflow Amount by which to change FN_OVERFLOW_TRAP_POS to accommodate tbl tbl*move-footer Amount by which to change FOOTER trap to accommodate tbl tbl*move-footer-trap Whether to move FOOTER trap to accommodate tbl tbl*no-shim Whether to SHIM tbl (boolean) tbl*right-label-on-table Is tbl caption quad right? (boolean) #T_MARGIN_LEAD_ADJ \n[.v]-12000; ensures critically accurate placement of first lines on pages when doc processing is not being used and a T_MARGIN has been set #TAB_OFFSET# "#" at the end is from $CURRENT_TAB #TERMINATE Has TERMINATE been called? (boolean) #TITLE_COLOR Colorize title? (boolean) #TITLE_NUM Number of title items #TOC_AUTHORS Whether to append author(s) to toc doc title entries (boolean) #TOC_ENTRY_PN Current page number when a toc entry is collected #TOC_FIRST_PAGE If 1, tells PRINT_PAGE_NUMBER that this is the first page of the toc #TOC_LEAD Leading of toc pages #TOC_PN_PADDING Max. # of placeholders for toc entries page numbers #TOC_PS Point size of toc pages #TOC_RV_SWITCH Switch L/R margins of toc pages #TOC_HEAD_INDENT Indent of toc head entries #TOC_HEAD_SIZE_CHANGE ps in/decrease of toc head entries #TOC_PH_INDENT Indent of toc parahead entries #TOC_PH_SIZE_CHANGE ps in/decrease of toc parahead entries #TOC_SH_INDENT Indent of toc subhead entries #TOC_SH_SIZE_CHANGE ps in/decrease of toc subhead entries #TOC_TITLE_INDENT Indent of toc doc title entries #TOC_TITLE_SIZE_CHANGE ps in/decrease of toc doc title entries @TOP Controls .ns at page top; trap-invoked (FOOTER); mostly trap-removed (RR_@TOP) #TOTAL_FIELDS Total number of letter header fields #TRAP \n[.t]-1 (used in DO_QUOTE) #TW Width of tbl block #UNADJUSTED_DOC_LEAD Argument passed to DOC_LEAD prior to adjusting (set in TRAPS) #UNDERLINE_ITALIC For TYPEWRITE. (boolean) #UNDERLINE_ON Was UNDERLINE called? (boolean) #UNDERLINE_QUOTES Was UNDERLINE_QUOTES called? (boolean) #UNDERLINE_QUOTE Underline pquotes? (boolean) #UNDERLINE_SLANT For TYPEWRITE. (boolean) #UNDERLINE_WAS_ON Was underlining on prior to the invocation of current macro? (boolean) #UNDERLINE_WAS_ON_FN As above, but for footnotes only #USER_DEF_HDRFTR_CENTER Has user defined hdrftr center? (boolean) #USER_DEF_HDRFTR_LEFT Has user defined hdrftr left? (boolean) #USER_DEF_HDRFTR_RIGHT Has user defined hdrftr right? (boolean) #USER_DEF_HEADER_CENTER User defined CENTER title? (boolean); used in COPYSTYLE #USER_DEF_HEADER_LEFT User defined CENTER title? (boolean); used in COPYSTYLE #USER_DEF_HEADER_RIGHT User defined CENTER title? (boolean) used in COPYSTYLE #USERDEF_HDRFTR User defined single string recto/verso header/footer? (boolean) #USERDEF_HDRFTR_RECTO_QUAD 1=left, 2=CENTER, 3=right #USERDEF_HDRFTR_VERSO_QUAD 1=left, 2=CENTER, 3=right #VARIABLE_FOOTER_POS Wandering trap position for processing footnotes and footers; pos depends on number of footnotes #VISUAL_B_MARGIN Set in TRAPS, what \n[nl] would report on the last line of running text before FOOTER is sprung. #VFP_DIFF #FN_DEPTH minus #SAVED_FN_DEPTH; the number of footnote lines that will fit on the page when there will be over, and therefore the amount by which to raise the VFP for footnotes with overflow after the 1st footnote. y Vertical position stored with mk in hdrftrs. +++STRINGS+++ $1ST_LETTER First letter of first arg to LIST $ADJUST_BIB_LEAD 2nd arg to BIBLIOGRAPHY_LEAD; if not blank adjust bib leading $ADJUST_EN_LEAD 2nd arg to ENDNOTE_LEAD; if not blank adjust endnote leading $ADJUST_TOC_LEAD 2nd arg to TOC_LEAD; if not blank adjust toc leading $ATTRIBUTE_COLOR Attribution string color $ATTRIBUTE_STRING Attribution string in doc header $ATTRIBUTE_STRING_COVER Attribution string on cover $ATTRIBUTE_STRING_DOCCOVER Attribution string on doc cover $AUTHOR_<n> Document author(s) $AUTHOR The author, or the first argument passed to .AUTHOR ($AUTHOR_1) $AUTHOR_COLOR Author color $AUTHOR_COVER_<n> Author(s) on cover $AUTHOR_DOCCOVER_<n> Author(s) on doc cover $AUTHOR_FAM Family to use for author in doc header $AUTHOR_FT Font to use for author in doc header $AUTHOR_SIZE_CHANGE ps in/decrease of author in doc header $AUTHOR_PT_SIZE Absolute ps of authors $AUTHORS Comma-separated concatenated string of all args passed to .AUTHOR $BIB_FAM Bibliography page family $BIB_FT Bibliography page font $BIB_LEAD Base leading for bibliographies $BIB_LIST_SEPARATOR Separator between enumerator and text when outputting bibliographies in LIST style $BIB_LIST_PREFIX Prefix before enumerator when outputting bibliographies in LIST style $BIB_PN_STYLE Format of bibliography page numbers $BIB_QUAD $BIB_SPACE Post entry space for bibliographies $BIB_STRING Bibliography title string $BIB_STRING_FAM Bib title family $BIB_STRING_FT Bib title font $BIB_STRING_QUAD Bib title quad $BIB_STRING_RULE_GAP Distance between the underscores when BIB_STRING (bib first-page header) is double-underlined $BIB_STRING_SIZE_CHANGE Bib title size (+ or -) $BIB_STRING_UNDERLINE_GAP Distance between BIB_STRING text and (first) underline rule $BQ_LN_GUTTER Gutter between line numbers and bquotes in bquotes $BQUOTE_COLOR Blockquote color $BQUOTE_FAM Family to use for blockquotes $BQUOTE_FT Font to use for blockquotes $BQUOTE_QUAD Quad value for blockquotes $BQUOTE_SIZE_CHANGE ps in/decrease of blockquotes $BX_COLOR Box color $BX_DEPTH Box depth $BX_INDENT Box left margin starting position $BX_WEIGHT Box rule weight $BX_WIDTH Box width $CENTER_TITLE What to put in the middle of header title $CH_NUM Chapter number (as a string) $CHAPTER The chapter number $CHAPTER_STRING What to print whenever the word "chapter" is required $CHAPTER_TITLE Concatenated args passed to CHAPTER_TITLE $CHAPTER_TITLE_<n> Chapter title items $CHAPTER_TITLE_FAM Family of chapter title $CHAPTER_TITLE_FT Font of chapter title $CHAPTER_TITLE_SIZE_CHANGE ps in/decrease of chapter title $CHAPTER_TITLE_PT_SIZE Absolute ps of chapter title $CHAPTER_TITLE_COLOR Color of chapter title $CL_COLOR Circle (ellipse) color $CL_DEPTH Circle (ellipse) depth $CL_INDENT Circle (ellipse) left margin starting position $CL_WEIGHT Circle (ellipse) rule weight $CL_WIDTH Circle (ellipse) width $CLOSE_INDENT Argument passed to CLOSING_INDENT $CODE_FAM Family to use with CODE $CODE_FT Font to use with CODE $CODE_COLOR Color of CODE $COLOR_SCHEME Color scheme arg passed to NEWCOLOR $COPY_STYLE DRAFT or FINAL $COPYRIGHT Copyright info $COPYRIGHT_COVER Copyright info for cover $COPYRIGHT_DOCCOVER Copyright info for doc cover $COPYRIGHT_FAM Copyright line family $COPYRIGHT_FT Copyright line font $COPYRIGHT_PT_SIZE Base string to which $COPYRIGHT_SIZE_CHANGE is appended $COPYRIGHT_SIZE_CHANGE Copyright line size $COPYRIGHT_COLOR Copyright line color $COPYRIGHT_QUAD Copyright line quad direction $COVER_ATTRIBUTE_COLOR Cover attribution string color $COVER_AUTHOR_COLOR Cover author(s) color $COVER_AUTHOR_FAM Cover author(s) family $COVER_AUTHOR_FT Cover author(s) font $COVER_AUTHOR_PT_SIZE Author point size on cover $COVER_AUTHOR_SIZE_CHANGE Cover author(s) size $COVER_CHAPTER_TITLE_COLOR Color of chapter title on cover $COVER_CHAPTER_TITLE_PT_SIZE Size of chapter title on cover $COVER_COLOR Overall cover color $COVER_COPYRIGHT_PT_SIZE Size of copyright info on cover $COVER_DOCTYPE_PT_SIZE Size of doctype on cover $COVER_FAM Overall cover family $COVER_LEAD_ADJ String appended to DOC_LEAD to arrive at base leading of covers $COVER_SUBTITLE_PT_SIZE Size of subtitle on cover $COVER_TITLE_PT_SIZE Size of title on cover $COVER_TITLE User-defined cover title string $COVER_TITLE_<n> Cover title items $COVER_TITLE_FAM Cover title family $COVER_TITLE_FT Cover title font $COVER_TITLE_SIZE_CHANGE Cover title size $COVER_TITLE_COLOR Cover title color $COVER_UNDERLINE_GAP Distance between baseline of the doctype on covers and the underline $COVER_SUBTITLE_FAM Cover subtitle family $COVER_SUBTITLE_FT Cover subtitle font $COVER_SUBTITLE_SIZE_CHANGE Cover subtitle size $COVER_SUBTITLE_COLOR Cover subtitle color $COVER_DOCTYPE_FAM Cover doctype family $COVER_DOCTYPE_FT Cover doctype font $COVER_DOCTYPE_SIZE_CHANGE Cover doctype size $COVER_DOCTYPE_COLOR Cover doctype color $COVER_COPYRIGHT_FAM Cover copyright family $COVER_COPYRIGHT_FT Cover copyright font $COVER_COPYRIGHT_SIZE_CHANGE Cover copyright size $COVER_COPYRIGHT_COLOR Cover copyright color $COVER_MISC_FAM Cover misc family $COVER_MISC_FT Cover misc font $COVER_MISC_SIZE_CHANGE Cover misc size $COVER_MISC_COLOR Cover misc color $CURRENT_EV \n[.ev] at REF_BRACKETS_START $DC_COLOR Dropcap color $DOC_COVER_ATTRIBUTE_COLOR Doc cover attribution string color $DOC_COVER_AUTHOR_COLOR Doc cover author(s) color $DOC_COVER_AUTHOR_FAM Doc cover author(s) family $DOC_COVER_AUTHOR_FT Doc cover author(s) font $DOC_COVER_AUTHOR_PT_SIZE Size of author on doc cover $DOC_COVER_AUTHOR_SIZE_CHANGE Doc cover author(s) size $DOC_COVER_CHAPTER_TITLE_COLOR Color of chapter title on doc cover $DOC_COVER_CHAPTER_TITLE_PT_SIZE Size of chapter title on doc cover $DOC_COVER_COLOR Overall doc cover color $DOC_COVER_COPYRIGHT_COLOR Doc cover copyright color $DOC_COVER_COPYRIGHT_FAM Doc cover copyright family $DOC_COVER_COPYRIGHT_FT Doc cover copyright font $DOC_COVER_COPYRIGHT_PT_SIZE Size of copyright info on doc cover $DOC_COVER_COPYRIGHT_SIZE_CHANGE Doc cover copyright size $DOC_COVER_DOCTYPE_COLOR Doc cover doctype color $DOC_COVER_DOCTYPE_FAM Doc cover doctype family $DOC_COVER_DOCTYPE_FT Doc cover doctype font $DOC_COVER_DOCTYPE_PT_SIZE Size of doctype on doc cover $DOC_COVER_DOCTYPE_SIZE_CHANGE Doc cover doctype size $DOC_COVER_MISC_COLOR Doc cover misc color $DOC_COVER_MISC_FAM Doc cover misc family $DOC_COVER_MISC_FT Doc cover misc font $DOC_COVER_MISC_SIZE_CHANGE Doc cover misc size $DOC_COVER_FAM Overall doc cover family $DOC_COVER_LEAD_ADJ String appended to DOC_LEAD to arrive at base leading of doc covers $DOC_COVER_SUBTITLE_FAM Doc cover subtitle family $DOC_COVER_SUBTITLE_FT Doc cover subtitle font $DOC_COVER_SUBTITLE_PT_SIZE Size of subtitle on doc cover $DOC_COVER_SUBTITLE_SIZE_CHANGE Doc cover subtitle size $DOC_COVER_SUBTITLE_COLOR Doc cover subtitle color $DOC_COVER_TITLE User-defined doc cover title string $DOC_COVER_TITLE_<n> Doc cover title items $DOC_COVER_TITLE_COLOR Doc cover title color $DOC_COVER_TITLE_FAM Doc cover title family $DOC_COVER_TITLE_FT Doc cover title font $DOC_COVER_TITLE_PT_SIZE Size of title on doc cover $DOC_COVER_TITLE_SIZE_CHANGE Doc cover title size $DOC_FAM Predominant font family used in the document $DOC_QUAD Quad used for body text (justified or left) $DOC_TITLE Concatenated args passed to DOCTITLE $DOC_TITLE_<n> DOCTITLE items $DOC_TYPE Document type (default, chapter, named, letter) $DOCCOVER_UNDERLINE_GAP Distance between baseline of doctype and the underline on covers $DOCHEADER_COLOR Color of docheader $DOCHEADER_FAM Family used for all parts of the docheader $DOCHEADER_QUAD Quad direction (LRC) of docheader $DOCHEADER_LEAD_ADJ +|- value applied to #DOC_LEAD to in/decrease leading of doc header $DOCTYPE_COLOR Color of DOCTYPE string in doc header $DOCTYPE_FAM Family to use for DOCTYPE string in doc header $DOCTYPE_FT Font to use for DOCTYPE string in doc header $DOCTYPE_SIZE_CHANGE ps in/decrease of DOCTYPE string in doc header $DOCTYPE_PT_SIZE Absolute ps of DOCTYPE $DOCTYPE_UNDERLINE_GAP Distance between baseline of DOCTYPE and the underline in doc header $DRAFT The draft number (string valued) $DRAFT_STRING What to print whenever the word "draft" is required EN_MARK Inline, gets #EN_MARK (\(ln) $EN_CLOSE_BRACKET Close bracket for line-number enumerated endnotes $EN_FAMILY Family for endnotes $EN_FT Font for endnotes $EN_LEAD Leading of endnotes pages $EN_LINENUMBER String to print for line-number enumerators in line-numbered endnotes $EN_LN_FAM Family for line-numbers in line-number identified endnotes $EN_LN_FT Font for line-numbers in line-number identified endnotes $EN_LN_GAP Gap to leave in initial endnote lines between line-number identifies and text $EN_LN_SEP User-defined separator to use between line number(s) and endnotes when endnotes are identified by line number $EN_LN_SIZE_CHANGE Size change (+ or -) for line-numbers in line-number identified endnotes $EN_OPEN_BRACKET Open bracket for line-number enumerated endnotes $EN_PN_STYLE Pagenumbering style for endnotes pages $EN_QUAD Quad for endnotes $EN_STRING Endnotes page head $EN_STRING_FAM Endnotes page head family $EN_STRING_FT Endnotes page head font $EN_STRING_QUAD Endnotes page head quad direction $EN_STRING_RULE_GAP Distance between rules when EN_STRING is double-underlined $EN_STRING_UNDERLINE_GAP Distance between baseline of EN_STRING and underline rule $EN_STRING_SIZE_CHANGE Endnotes page head size $EN_TITLE Endnote document identifier $EN_TITLE_FAM Endnote document identifier family $EN_TITLE_FT Endnote document identifier font $EN_TITLE_QUAD Endnote document identifier quad direction $EN_TITLE_SIZE_CHANGE Endnote document identifier size $EN_TITLE_UNDERLINE_GAP Distance between baseline of EN_TITLE and underline rule $EN_NUMBER_FAM Endnote numbering family $EN_NUMBER_FT Endnote numbering font $EN_NUMBER_SIZE_CHANGE Endnote numbering size $EPI_AUTOLEAD Autolead value (decimals ok) of epigraphs $EPI_COLOR Color of epigraphs $EPI_FAM Family to use in epigraphs $EPI_FT Font to use in epigraphs $EPI_OFFSET_VALUE Arg passed to EPIGRAPH_INDENT if the arg has a unit of measure appended to it $EPI_QUAD Quad in block-style epigraphs (justified or left) $EPI_SIZE_CHANGE ps in/decrease of epigraphs $EVAL_BIB_SPACE Temporary string to find out if the arg to BIBLIOGRAPHY_SPACING ended in "v" $EVAL_EI_ARG Temporary string to find out whether the arg to EPIGRAPH_INDENT ended with a unit of measure $EVAL_QI_ARG Temporary string to find out whether the arg to QUOTE_INDENT ended with a unit of measure eval*[B Used to get substring of \*([B eval*[S Used to get substring of \*([S eval*[s Used to get substring of \*([s $FINIS_COLOR Color of FINIS string $FINIS_STRING What to print when FINIS macro is invoked float-adj:bottom A + or - sign float-adj:top A + or - sign float*type Used with tbl; 'boxed' or 'table' FN_MARK Inline, gets #FN_MARK ( \n[ln] ) $FN_CLOSE_BRACKET Close bracket for line-number identified footnotes $FN_FAM Family used in footnotes $FN_FT Font used in footnotes $FN_LINENUMBER String to print before footnotes when line-numbering enabled for footnotes $FN_LN_SEP Separator after line-number identified footnotes $FN_OPEN_BRACKET Open bracket for line-number identified footnotes $FN_QUAD Quad used in footnotes $FN_SIZE_CHANGE ps in/decrease of footnotes $FN_SPACE Post footnote space $FOOTNOTE_COLOR Footnote color $FTR_RECTO_QUAD Quad direction of footer recto $FTR_RECTO_STRING String for footer recto $FTR_VERSO_QUAD Quad direction of footer verso $FTR_VERSO_STRING String for footer verso $HDR_RECTO_QUAD Quad of header recto $HDR_RECTO_STRING String for header recto $HDR_VERSO_QUAD Quad of header verso $HDR_VERSO_STRING String for header verso **Note: "header", in the descriptions below, means either headers or footers $HDRFTR_CENTER What to put in CENTER part of headers; default doctype $HDRFTR_CENTER_COLOR Color of CENTER part of headers $HDRFTR_CENTER_FAM Family of CENTER part of headers $HDRFTR_CENTER_FT Font of centre part of headers $HDRFTR_CENTER_NEW HDRFTR_CENTER after the start of TOC; defined in HDRFTR_CENTER if HDRFTR_CENTER is called as FOOTER_CENTER $HDRFTR_CENTER_OLD HDRFTR_CENTER just prior to start of TOC; defined in HDRFTR_CENTER if HDRFTR_CENTER is called as FOOTER_CENTER $HDRFTR_CENTER_SIZE_CHANGE ps in/decrease of centre title in headers $HDRFTR_COLOR Color of headers/footers $HDRFTR_FAM Family to use in headers $HDRFTR_LEFT_COLOR Color of LEFT part of headers $HDRFTR_LEFT_FAM Family of left part of headers $HDRFTR_LEFT_FT Font of left part of headers $HDRFTR_LEFT_SIZE_CHANGE ps in/decrease of author in headers $HDRFTR_LEFT What to put in left part of headers; default author $HDRFTR_RIGHT_COLOR Color of RIGHT part of headers $HDRFTR_RIGHT_FAM Family of right part of headers $HDRFTR_RIGHT_FT Font of right part of headers $HDRFTR_RIGHT_SIZE_CHANGE ps in/decrease of right part of headers $HDRFTR_RIGHT What to put in right part of headers; default title $HDRFTR_RULE_COLOR Color of header rule $HDRFTR_SIZE_CHANGE ps in/decrease of headers $HDRFTR_TMP_SIZE_CHANGE_SWITCH Temporarily holds HDRFTR_LEFT_SIZE_CHANGE if #SWITCH_HDRFTRS=1 $HDRFTR_TMP_SWITCH Temporarily holds HDRFTR_LEFT if #SWITCH_HDRFTRS=1 $HDRFTR_TMP_COLOR_SWITCH Temporarily holds HDRFTR_LEFT_COLOR if #SWITCH_HDRFTRS=1 $HEAD_COLOR Head color $HEAD_FAM Family to use for section titles $HEAD_FT Font to use for section titles $HEAD_QUAD Quad value of section titles $HEAD_SIZE_CHANGE ps in/decrease of section titles $HEAD_UNDERLINE_GAP Distance between a head and the underline $HYPHEN Vertically adjusted hyphen used around page numbers $LHS Holds digits on the left side of the decimal in weight arg passed to RULE_WEIGHT $LINEBREAK_CHAR Character that marks line breaks $LINEBREAK_CHAR_V_ADJ +|- amount by which to raise/lower linebreak character $LAST_CHAR Temporary string used to discover whether user has remembered to put a digit after ROMAN or roman in arg to LIST $LINEBREAK_COLOR Linebreak color $LIST_ARG_1 The first arg to LIST (minus digits if ROMAN or roman $LN_COLOR Linenumber color $LN_FAMILY Linenumber family $LN_FONT Linenumber font $LN_GUTTER Gutter to leave between line numbers and text $LN_INC 2nd arg to NUMBER_LINES as a string $LN_NUM 1st arg to NUMBER_LINES as a string $LN_SIZE_CHANGE ps in/decrease of linenumbers $MISC_<n> Position of args pass to MISC $MISC_COLOR Misc color $MISC_COVER_<n> Misc items for cover $MISC_DOCCOVER_<n> Misc items for doc cover $MISC_QUAD Misc quad direction $MN-arg<n> Sequentially numbered args passed to MNinit MN-color Color of margin note MN-curr Number of current margin note MN-dir Left or right margin note MN-font Font of margin note MN-left-ad Fill mode of margin note PAGE# For use in hdrftr strings where page # is needed; \*[PAGE] $PAGENUM_COLOR Page number color $PAGENUM_STYLE String passed to PAGENUM_STYLE $PAGE_NUM_FAM Family of page numbers $PAGE_NUM_FT Font of page numbers $PAGE_NUM_SIZE_CHANGE ps in/decrease of page numbers $PAPER Paper size (LETTER, A4, LEGAL); default=LETTER $PH_COLOR Parahead color $PH_FAM Parahead family $PH_FT Parahead font $PH_SIZE_CHANGE ps in/decrease of paraheads $PH_SPACE Amount of horizontal space between a parahead and the start of paragraph text $PP_FT Font used in paragraphs $RESTORE_PAGENUM_STYLE Hold previous page numbering style $ROMAN_WIDTH<n> The digit(s) appended by user to ROMAN or roman when LIST is invoked $Q_LN_GUTTER Gutter between linenumbers and quotes in quotes $Q_OFFSET_VALUE Arg passed to QUOTE_INDENT if the arg has a unit of measure appended to it $QUOTE_COLOR Quote (poetic) color $QUOTE_FAM Family to use for pquotes $QUOTE_FT Font to use for pquotes $QUOTE_SIZE_CHANGE ps in/decrease of pquotes ref*post-punct Final punctuation mark of references ref*spec!<n> Holds fields required by differing reference types ref*string The data passed to a reference $REF_BIB_INDENT 2nd line indent value for references in bibliographies $REF_EN_INDENT 2nd line indent value for references in endnotes $REF_FN_INDENT 2nd line indent value for references in footnotes $REF_STYLE MLA bibliography-style or footnote/endnote style; used in ref*add-<x> $RESTORE_SS_VAR Saves \*[$SS_VAR] for use with ref*build #REVISION The revision number (string valued) $REVISION_STRING What to print whenever the word "revision" is required $RHS Holds digits on the right side of the decimal in weight arg passed to RULE_WEIGHT $RL_COLOR Rule color (DRH/DRV) $RL_DEPTH Rule depth (DRH/DRV) $RL_INDENT Left start position of rule (DRH/DRV) $RL_LENGTH Rule length (DRH/DRV) $RL_WEIGHT Rule weight (DRH/DRV) $SAVED_COPYRIGHT Temporarily holds string in $COPYRIGHT $SAVED_RULE_GAP Temporarily holds string in $RULE_GAP $SAVED_DOC_FAM Document family in effect before COLLATE $SAVED_PP_FT $PP_FT in effect at start of .COLLATE; tested for and removed in .PP $SH_FAM Family to use in subheads $SH_FT Font to use in subheads $SH_SIZE_CHANGE ps in/decrease of subheads $SH_COLOR Subhead color $SIG_SPACE Arg passed to macro, SIGNATURE_SPACE $SUBTITLE Concatenated args passed to SUBTITLE $SUBTITLE_<n> Subtitle items for doc header $SUBTITLE_COLOR Color of subtitle $SUBTITLE_COVER_<n> Subtitle items for cover $SUBTITLE_DOCCOVER_<n> Subtitle items for doc cover $SUBTITLE_FAM Family to use for subtitle in doc header $SUBTITLE_FT Font to use for subtitle in doc header $SUBTITLE_SIZE_CHANGE ps in/decrease of subtitle $SUBTITLE_PT_SIZE Absolute ps of subtitle $SUITE The #SUITE number register tbl*center 'C' if set tbl*label Text of tbl caption tbl*needs # of rows of tbl data required to print tbl near bottom of page tbl*user-add-space User-added space before a tbl caption $TITLE Concatenated args pass to TITLE $TITLE_<n> Title items $TITLE_COLOR Color of title $TITLE_FAM Family to use for title in doc header $TITLE_FT Font to use for title in doc header $TITLE_PT_SIZE Absolute point size of title in docheader $TITLE_SIZE_CHANGE ps in/decrease of title in doc header $TOC_AUTHORS What to print after toc doc title entry if #TOC_AUTHORS=1 $TOC_FAM Family to use on toc pages $TOC_HEAD_FAM Family of toc head entries $TOC_HEAD_FT Font of toc head entries $TOC_HEAD_ITEM A head as collected for TOC_ENTRIES $TOC_HEADER_FAM Family to use for "Contents" $TOC_HEADER_FT Font to use for "Contents" $TOC_HEADER_QUAD Quad direction of "Contents" $TOC_HEADER_SIZE ps in/decrease of "Contents"**** $TOC_HEADER_STRING Header string of first toc page $TOC_LEAD Leading of toc pages $TOC_PH_ITEM Toc parahead entry $TOC_PN Sets up toc leaders + entry pn (typeset) $TOC_PN_FAM Family for toc entries page numbers $TOC_PN_FT Font for toc entries page numbers $TOC_PN_SIZE_CHANGE ps in/decrease of toc entries page numbers $TOC_PN_STYLE Page-numbering style of toc pages $TOC_PN_TYPEWRITE Sets up toc leaders + entry pn (typewrite) $TOC_PH_FAM Family of toc parahead entries $TOC_PH_FT Font of toc parahead entries $TOC_PARAHEAD_ITEM A parahead collected for TOC_ENTRIES $TOC_SH_FAM Family of toc subhead entries $TOC_SH_FT Font of toc subhead entries $TOC_SH_ITEM A subhead collected for TOC_ENTRIES $TOC_TITLE_FAM Family of toc doc title entries $TOC_TITLE_FT Font of toc doc title entries $TOC_TITLE_ITEM Toc document title item $USER_SET_TITLE_ITEM User defined toc doc title entry as set by TOC_TITLE_ENTRY $UR_PAGINATION_STYLE Pagination style prior to endnotes $USERDEF_HDRFTR_RECTO User defined header/footer recto string $USERDEF_HDRFTR_VERSO User defined header/footer verso string +++PREPROCESSOR KEYWORDS+++ (eqn) EQ EN (grn) GS GE GF (pic) PS PE (refer) R1 R2 [ ] (tbl) TS TE TH (grap) G1 G2 (ideal) IS IE (chem) cstart cend +++ALIASES+++ Please note: Prior to version 1.1.9, all macros that included the word COLOR had aliases that used COLOUR instead. This convenience has now been removed, in an effort to reduce the size of the om.tmac file. Furthermore, if you want the convenience, you'll have to edit the om.tmac file. Simply aliasing, say, HEAD_COLOR as HEAD_COLOUR will not work, owing to significant changes in the handling of docelement control macros that end in _COLOR. +++These aliases are for convenience, and header/footer management+++ BIBLIOGRAPHY_STRING_UNDERSCORE BIBLIOGRAPHY_STRING_UNDERLINE BREAK_BLOCKQUOTE BREAK_QUOTE BREAK_CITATION BREAK_QUOTE BREAK_CITE BREAK_QUOTE CITATION BLOCKQUOTE CITE BLOCKQUOTE COL_BREAK COL_NEXT DOC_FAM DOC_FAMILY DOC_L_LENGTH DOC_LINE_LENGTH DOC_L_LENGTH DOC_LINE_LENGTH DOC_L_MARGIN DOC_LEFT_MARGIN DOC_L_MARGIN DOC_LEFT_MARGIN DOC_LS DOC_LEAD DOC_PS DOC_PT_SIZE DOC_R_MARGIN DOC_RIGHT_MARGIN DOC_R_MARGIN DOC_RIGHT_MARGIN ENDNOTE_STRING_UNDERSCORE ENDNOTE_STRING_UNDERLINE ENDNOTE_TITLE_UNDERSCORE ENDNOTE_TITLE_UNDERLINE FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS FOOTER_CENTER HDRFTR_CENTER FOOTER_CENTRE_CAPS HDRFTR_CENTER_CAPS FOOTER_CENTRE HDRFTR_CENTER FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS FOOTER_LEFT HDRFTR_LEFT FOOTER_PLAIN HDRFTR_PLAIN FOOTER_RECTO HDRFTR_RECTO FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS FOOTER_RIGHT HDRFTR_RIGHT FOOTER_RULE_GAP HDRFTR_RULE_GAP FOOTER_RULE HDRFTR_RULE FOOTER_VERSO HDRFTR_VERSO HDRFTR_RULE_INTERNAL HDRFTR_RULE HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS HEADER_CENTER HDRFTR_CENTER HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS HEADER_CENTRE HDRFTR_CENTER HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS HEADER_LEFT HDRFTR_LEFT HEADER_PLAIN HDRFTR_PLAIN HEADER_RECTO HDRFTR_RECTO HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS HEADER_RIGHT HDRFTR_RIGHT HEADER_RULE_GAP HDRFTR_RULE_GAP HEADER_RULE HDRFTR_RULE HEADER_VERSO HDRFTR_VERSO PAGENUM PAGENUMBER PAGINATION PAGINATE PP_FT PP_FONT PRINT_FOOTNOTE_RULE FOOTNOTE_RULE SWITCH_FOOTERS SWITCH_HDRFTR SWITCH_HEADERS SWITCH_HDRFTR TOC_LS TOC_LEAD TOC_PS TOC_PT_SIZE +++These aliases are used for docelement type-style control+++ AUTHOR_FAMILY _FAMILY AUTHOR_FONT _FONT AUTHOR_SIZE _SIZE BIBLIOGRAPHY_FAMILY _FAMILY BIBLIOGRAPHY_FONT _FONT BIBLIOGRAPHY_FOOTER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER BIBLIOGRAPHY_FOOTER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE BIBLIOGRAPHY_HEADER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER BIBLIOGRAPHY_HEADER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE BIBLIOGRAPHY_QUAD _QUAD BIBLIOGRAPHY_STRING_FAMILY _FAMILY BIBLIOGRAPHY_STRING_FONT _FONT BIBLIOGRAPHY_STRING_QUAD _QUAD BIBLIOGRAPHY_STRING_SIZE _SIZE BLOCKQUOTE_AUTOLEAD Q_AUTOLEAD BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD BLOCKQUOTE_COLOR _COLOR BLOCKQUOTE_FAMILY _FAMILY BLOCKQUOTE_FONT _FONT BLOCKQUOTE_QUAD _QUAD BLOCKQUOTE_SIZE _SIZE CHAPTER_TITLE_COLOR _COLOR CHAPTER_TITLE_FAMILY _FAMILY CHAPTER_TITLE_FONT _FONT CHAPTER_TITLE_SIZE _SIZE COVER_ATTRIBUTE_COLOR _COLOR COVER_AUTHOR_COLOR _COLOR COVER_AUTHOR_FAMILY _FAMILY COVER_AUTHOR_FONT _FONT COVER_AUTHOR_SIZE _SIZE COVER_COLOR _COLOR COVER_COPYRIGHT_COLOR _COLOR COVER_COPYRIGHT_FAMILY _FAMILY COVER_COPYRIGHT_FONT _FONT COVER_COPYRIGHT_QUAD _QUAD COVER_COPYRIGHT_SIZE _SIZE COVER_DOCTYPE_COLOR _COLOR COVER_DOCTYPE_FAMILY _FAMILY COVER_DOCTYPE_FONT _FONT COVER_DOCTYPE_SIZE _SIZE COVER_FAMILY _FAMILY COVER_MISC_COLOR _COLOR COVER_MISC_QUAD _QUAD COVER_SUBTITLE_COLOR _COLOR COVER_SUBTITLE_FAMILY _FAMILY COVER_SUBTITLE_FONT _FONT COVER_SUBTITLE_SIZE _SIZE COVER_TITLE_COLOR _COLOR COVER_TITLE_FAMILY _FAMILY COVER_TITLE_FONT _FONT COVER_TITLE_SIZE _SIZE DOC_COVER_ATTRIBUTE_COLOR _COLOR DOC_COVER_AUTHOR_COLOR _COLOR DOC_COVER_AUTHOR_FAMILY _FAMILY DOC_COVER_AUTHOR_FONT _FONT DOC_COVER_AUTHOR_SIZE _SIZE DOC_COVER_COLOR _COLOR DOC_COVER_COPYRIGHT_COLOR _COLOR DOC_COVER_COPYRIGHT_FAMILY _FAMILY DOC_COVER_COPYRIGHT_FONT _FONT DOC_COVER_COPYRIGHT_QUAD _QUAD DOC_COVER_COPYRIGHT_SIZE _SIZE DOC_COVER_DOCTYPE_COLOR _COLOR DOC_COVER_DOCTYPE_FAMILY _FAMILY DOC_COVER_DOCTYPE_FONT _FONT DOC_COVER_DOCTYPE_SIZE _SIZE DOC_COVER_FAMILY _FAMILY DOC_COVER_MISC_COLOR _COLOR DOC_COVER_MISC_QUAD _QUAD DOC_COVER_SUBTITLE_COLOR _COLOR DOC_COVER_SUBTITLE_FAMILY _FAMILY DOC_COVER_SUBTITLE_FONT _FONT DOC_COVER_SUBTITLE_SIZE _SIZE DOC_COVER_TITLE_COLOR _COLOR DOC_COVER_TITLE_FAMILY _FAMILY DOC_COVER_TITLE_FONT _FONT DOC_COVER_TITLE_SIZE _SIZE DOCHEADER_COLOR _COLOR DOCHEADER_FAMILY _FAMILY DOCHEADER_QUAD _QUAD DOC_QUAD _QUAD DOCTYPE_FAMILY _FAMILY DOCTYPE_FONT _FONT DOCTYPE_SIZE _SIZE ENDNOTE_BLOCKQUOTE_AUTOLEAD Q_AUTOLEAD ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD ENDNOTE_FAMILY _FAMILY ENDNOTE_FONT _FONT ENDNOTE_LINENUMBER_FAMILY _FAMILY ENDNOTE_LINENUMBER_FONT _FONT ENDNOTE_LINENUMBER_SIZE _SIZE ENDNOTE_NUMBER_FAMILY _FAMILY ENDNOTE_NUMBER_FONT _FONT ENDNOTE_NUMBER_SIZE _SIZE ENDNOTE_QUAD _QUAD ENDNOTE_QUOTE_AUTLOEAD Q_AUTOLEAD ENDNOTE_QUOTE_AUTOLEAD QUOTE_AUTOLEAD ENDNOTE_STRING_FAMILY _FAMILY ENDNOTE_STRING_FONT _FONT ENDNOTE_STRING_QUAD _QUAD ENDNOTE_STRING_SIZE _SIZE ENDNOTE_TITLE_FAMILY _FAMILY ENDNOTE_TITLE_FONT _FONT ENDNOTE_TITLE_QUAD _QUAD ENDNOTE_TITLE_SIZE _SIZE EPIGRAPH_COLOR _COLOR EPIGRAPH_FAMILY _FAMILY EPIGRAPH_FONT _FONT EPIGRAPH_QUAD _QUAD EPIGRAPH_SIZE _SIZE FINIS_COLOR _COLOR FOOTNOTE_COLOR _COLOR FOOTNOTE_FAMILY _FAMILY FOOTNOTE_FONT _FONT FOOTNOTE_QUAD _QUAD FOOTNOTE_SIZE _SIZE HDRFTR_CENTER_FAMILY _FAMILY HDRFTR_CENTER_FONT _FONT HDRFTR_CENTER_SIZE _SIZE HDRFTR_COLOR _COLOR HDRFTR_FAMILY _FAMILY HDRFTR_LEFT_FAMILY _FAMILY HDRFTR_LEFT_FONT _FONT HDRFTR_LEFT_SIZE _SIZE HDRFTR_RIGHT_FAMILY _FAMILY HDRFTR_RIGHT_FONT _FONT HDRFTR_RIGHT_SIZE _SIZE HDRFTR_RULE_COLOR _COLOR HDRFTR_SIZE _SIZE HEAD_COLOR _COLOR HEAD_FAMILY _FAMILY HEAD_FONT _FONT HEAD_QUAD _QUAD HEAD_SIZE _SIZE LINEBREAK_COLOR _COLOR LINENUMBER_FAMILY _COLOR LINENUMBER_FONT _COLOR LINENUMBER_SIZE _COLOR LINENUMBER_COLOR _COLOR MISC_COLOR _COLOR MISC_QUAD _QUAD PAGENUM_COLOR _COLOR PAGENUM_FAMILY _FAMILY PAGENUM_FONT _FONT PARAHEAD_COLOR _COLOR PARAHEAD_FAMILY _FAMILY PARAHEAD_FONT _FONT PARAHEAD_SIZE _SIZE QUOTE_COLOR _COLOR QUOTE_FAMILY _FAMILY QUOTE_FONT _FONT QUOTE_INDENT _INDENT QUOTE_SIZE _SIZE REF_INDENT INDENT_REFS REF) REF_BRACKETS_END REF] REF_BRACKETS_END REF} REF_BRACKETS_END REF( REF_BRACKETS_START REF[ REF_BRACKETS_START REF{ REF_BRACKETS_START SUBHEAD_COLOR _COLOR SUBHEAD_FAMILY _FAMILY SUBHEAD_FONT _FONT SUBHEAD_SIZE _SIZE SUBTITLE_COLOR _COLOR SUBTITLE_FAMILY _FAMILY SUBTITLE_FONT _FONT SUBTITLE_SIZE _SIZE TITLE_COLOR _COLOR TITLE_FAMILY _FAMILY TITLE_FONT _FONT TITLE_SIZE _SIZE TOC_FAM _FAMILY TOC_FAMILY _FAMILY TOC_HEADER_FAMILY _FAMILY TOC_HEADER_FONT _FONT TOC_HEADER_QUAD _QUAD TOC_HEADER_SIZE _SIZE TOC_HEAD_FAMILY _FAMILY TOC_HEAD_FONT _FONT TOC_HEAD_SIZE _SIZE TOC_PARAHEAD_FAMILY _FAMILY TOC_PARAHEAD_FONT _FONT TOC_PARAHEAD_SIZE _SIZE TOC_PN_FAMILY _FAMILY TOC_PN_FONT _FONT TOC_PN_SIZE _SIZE TOC_PT_SIZE _SIZE TOC_SUBHEAD_FAMILY _FAMILY TOC_SUBHEAD_FONT _FONT TOC_SUBHEAD_SIZE _SIZE TOC_TITLE_FAMILY _FAMILY TOC_TITLE_FONT _FONT TOC_TITLE_SIZE _SIZE +++These aliases are used to control underlining/underscoring weights+++ UNDERSCORE_WEIGHT RULE_WEIGHT HEAD_UNDERLINE_WEIGHT RULE_WEIGHT HEADER_RULE_WEIGHT RULE_WEIGHT FOOTER_RULE_WEIGHT RULE_WEIGHT FOOTNOTE_RULE_WEIGHT RULE_WEIGHT COVER_UNDERLINE_WEIGHT RULE_WEIGHT DOC_COVER_UNDERLINE_WEIGHT RULE_WEIGHT ENDNOTE_STRING UNDERLINE_WEIGHT RULE_WEIGHT ENDNOTE_TITLE UNDERLINE_WEIGHT RULE_WEIGHT BIBLIOGRAPHY_STRING UNDERLINE_WEIGHT RULE_WEIGHT

Back to Table of Contents Top

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/typesetting.html0000644000000000000000000000013212426110213022650 xustar000000000000000030 mtime=1415090315.616519109 30 atime=1415090315.616519109 30 ctime=1415090315.616519109 groff-1.22.3/contrib/mom/momdoc/typesetting.html0000644000175000001440000043662712426110213021530 0ustar00wlusers00000000000000 Mom -- Typesetting Macros
Back to Table of Contents Next: Goodies

The typesetting macros


Introduction

Mom’s typesetting macros provide access to groff’s typesetting capabilities. Aside from controlling basic type parameters (family, font, line length, point size, leading), mom’s macros fine-tune wordspacing, letterspacing, kerning, hyphenation, and so on. In addition, mom has true typesetting tabs, string tabs, multiple indent styles, line padding, and a batch of other goodies.

In some cases, mom’s typesetting macros merely imitate groff primitives. In others, they approach typesetting concerns in conceptually new ways (for groff, at least). This should present no problem for newcomers to groff who are learning mom. Old groff hands should be careful. Just because it looks like a duck and walks like a duck does not, in this instance, mean that it is a duck. When using mom, stay away from groff primitives if mom provides a macro that accomplishes the same thing.

Mom’s typesetting macros can be used as a standalone package, independent of the document processing macros. With them, you can typeset on-the-fly. Book covers, your best friend’s résumé, a poster for a lost dog—none of these requires structured document processing (page headers, paragraphs, headings, footnotes, etc). What they do demand is precise control over every element on the page. The typesetting macros give you that control.


Paper and page setup: paper size & page margins

The page setup macros establish the physical dimensions of your page and the margins you want it to have. Groff has defaults for these, but I recommend setting them at the top of your files anyway.

If you’re using mom’s document processing macros, these macros must come after PRINTSTYLE.

The PAPER macro provides a shortcut for setting the page to the correct dimensions for a number of common paper sizes. The PAGE macro provides a convenient way of setting the page dimensions and some or all of the page margins with a single macro.

Important note on page dimensions and papersize

When mom files are processed with pdfmom, which is recommended (see Producing PDFs with groff and mom), page dimensions are automatically passed to groff, and you don't have to worry about them.

Mom documents processed directly with groff, or with pdfroff, or with pdfmom -Tps, require that the papersize be given on the command line as well if the papersize is different from the default on your system. You can verify—or change—the default papersize by inspecting the files
<path to groff>/font/devps/DESC and
<path to groff>/font/devpdf/DESC (See man papersize for list of valid papersize names, as well as for instructions on how to enter a non-standard size.)

If you occasionally need to print on sheets that do not conform to your default papersize, you must, in addition to setting the page dimensions in your mom file, pass the -P-p<papersize> option to groff, pdfroff, or pdfmom -Tps.

For example, suppose your routine papersize is “letter”, and you need to print something on a legal-sized sheet. After telling mom about the legal-size sheet (with either PAGELENGTH and PAGEWIDTH or PAPER, or PAGE), you must include -P-p<papersize> on whichever command line you use, eg
pdfmom -Tps -mom -P-plegal Remember, though, that pdfmom, with no -Tps option, is smart enough to know the papersize from the dimensions provided in your mom file.

Consult man groff, man grops and man groff_font for additional information concerning papersizes, as well as information on printing in “landscape” orientation.

Paper and page setup macros

Page width

Macro: PAGEWIDTH <width of printer sheet>

• Requires a unit of measure

The argument to PAGEWIDTH is the width of your printer sheet. PAGEWIDTH requires a unit of measure. Decimal fractions are allowed. Hence, to tell mom that the width of your printer sheet is 8-1/2 inches, you enter
.PAGEWIDTH 8.5i Please read the Important note on page dimensions and papersize for information on ensuring groff respects your PAGEWIDTH.

Important: PAGEWIDTH, when you need it, should be placed at the top of your files.

Page length

Macro: PAGELENGTH <length of printer sheet>

• Requires a unit of measure

PAGELENGTH tells mom how long your printer sheet is. It works just like PAGEWIDTH. Therefore, to tell mom your printer sheet is 11 inches long, you enter
.PAGELENGTH 11i Please read the Important note on page dimensions and papersize for information on ensuring groff respects your PAGELENGTH.

Important: PAGELENGTH, when you need it, should be placed at the top of your files.

Paper

Macro: PAPER <paper type> [ LANDSCAPE ]

PAPER provides a convenient way to set the dimensions for some common printer sheet sizes. <paper type> can be one of:
LETTER EXECUTIVE LEGAL 10x14 STATEMENT A3 TABLOID A4 LEDGER A5 FOLIO B4 QUARTO B5 Say, for example, you have A4-sized sheets in your printer. It’s shorter (and easier) to enter
.PAPER A4 than to remember the correct dimensions and enter
.PAGEWIDTH 595p .PAGELENGTH 842p If you’d like landscape orientation for your paper type, pass PAPER the LANDSCAPE argument.

Please read the Important note on page dimensions and papersize for information on ensuring groff respects your PAPER size.

Important: PAPER when you need it, should be placed at the top of your files.

Left margin

Macro: L_MARGIN <left margin>

• Requires a unit of measure

L_MARGIN establishes the distance from the left edge of the printer sheet at which you want your type to start. It may be used any time, and remains in effect until you enter a new value.

Left indents and tabs are calculated from the value you pass to L_MARGIN, hence it’s always a good idea to invoke it before starting any serious typesetting. A unit of measure is required. Decimal fractions are allowed. Therefore, to set the left margin at 3 picas (1/2 inch), you’d enter either
.L_MARGIN 3P or .L_MARGIN .5i If you use the macros PAGE, PAGEWIDTH or PAPER without invoking L_MARGIN (either before or afterwards), mom automatically sets L_MARGIN to 1 inch.

Note: L_MARGIN behaves in a special way when you’re using the document processing macros. See Typesetting macros during document processing for an explanation.

Right margin

Macro: R_MARGIN <right margin>

• Requires a unit of measure

IMPORTANT: R_MARGIN, if used, must come after PAPER, PAGEWIDTH, L_MARGIN and/or PAGE (if a right margin isn’t given to PAGE). The reason is that R_MARGIN calculates line length from the overall page dimensions and the left margin. Obviously, it can’t make the calculation if it doesn’t know the page width and the left margin.

R_MARGIN establishes the amount of space you want between the end of typeset lines and the right hand edge of the printer sheet. In other words, it sets the line length. R_MARGIN requires a unit of measure. Decimal fractions are allowed.

The line length macro (LL) can be used in place of R_MARGIN. In either case, the last one invoked sets the line length. The choice of which to use is up to you. In some instances, you may find it easier to think of a section of type as having a right margin. In others, giving a line length may make more sense.

For example, if you’re setting a page of type you know should have 6-pica margins left and right, it makes sense to enter a left and right margin, like this:
.L_MARGIN 6P .R_MARGIN 6P That way, you don’t have to worry about calculating the line length. On the other hand, if you know the line length for a patch of type should be 17 picas and 3 points, entering the line length with LL is much easier than calculating the right margin, eg
.LL 17P+3p If you use the macros PAGE, PAGEWIDTH or PAPER without invoking .R_MARGIN afterwards, mom automatically sets R_MARGIN to 1 inch. If you set a line length after these macros (with LL), the line length calculated by R_MARGIN is, of course, overridden.

Note: R_MARGIN behaves in a special way when you’re using the document processing macros. See Typesetting macros during document processing for an explanation.

Top margin

Macro: T_MARGIN <top margin>

• Requires a unit of measure

T_MARGIN establishes the distance from the top of the printer sheet at which you want your type to start. It requires a unit of measure, and decimal fractions are allowed. To set a top margin of 2-1/2 centimetres, you’d enter
.T_MARGIN 2.5c T_MARGIN calculates the vertical position of the first line of type on a page by treating the top edge of the printer sheet as a baseline. Therefore,
.T_MARGIN 1.5i puts the baseline of the first line of type 1-1/2 inches beneath the top of the page.

Note: T_MARGIN means something slightly different when you’re using the document processing macros. See Top and bottom margins in document processing for an explanation.

IMPORTANT: T_MARGIN does two things: it establishes the top margin for pages that come after it and it moves to that position on the current page. Therefore, T_MARGIN should only be used at the top of a file (prior to entering text) or after NEWPAGE, like this:
.NEWPAGE .T_MARGIN 6P <text>

Bottom margin

Macro: B_MARGIN <bottom margin>

• Requires a unit of measure

B_MARGIN sets a nominal position at the bottom of the page beyond which you don’t want your type to go. When the bottom margin is reached, mom starts a new page. B_MARGIN requires a unit of measure. Decimal fractions are allowed. To set a nominal bottom margin of 3/4 inch, enter
.B_MARGIN .75i Obviously, if you haven’t spaced the type on your pages so that the last lines fall perfectly at the bottom margin, the margin will vary from page to page. Usually, but not always, the last line of type that fits on a page before the bottom margin causes mom to start a new page.

Occasionally, owing to a peculiarity in groff, an extra line will fall below the nominal bottom margin. If you’re using the document processing macros, this is unlikely to happen; the document processing macros are very hard-nosed about aligning bottom margins.

Note: The meaning of B_MARGIN is slightly different when you’re using the document processing macros. See Top and bottom margins in document processing for an explanation.

Page

Macro: PAGE <width> [ <length> [ <lm> [ <rm> [ <tm> [ <bm> ] ] ] ] ]

• All arguments require a unit of measure

IMPORTANT: If you’re using the document processing macros, PAGE must come after PRINTSTYLE. Otherwise, it should go at the top of a document, prior to any text. And remember, when you’re using the document processing macros, top margin and bottom margin mean something slightly different than when you’re using just the typesetting macros (see Top and bottom margins in document processing).

PAGE lets you establish paper dimensions and page margins with a single macro. The only required argument is page width. The rest are optional, but they must appear in order and you can’t skip over any. <lm>, <rm>, <tm> and <bm> refer to the left, right, top and bottom margins respectively.

Assuming your page dimensions are 11 inches by 17 inches, and that’s all you want to set, enter
.PAGE 11i 17i If you want to set the left margin as well, say, at 1 inch, PAGE would look like this:
.PAGE 11i 17i 1i Now suppose you also want to set the top margin, say, at 1-1/2 inches. <tm> comes after <rm> in the optional arguments, but you can’t skip over any arguments, therefore to set the top margin, you must also give a right margin. The PAGE macro would look like this:
.PAGE 11i 17i 1i 1i 1.5i | | required right---+ +---top margin margin Clearly, PAGE is best used when you want a convenient way to tell mom just the dimensions of your printer sheet (width and length), or when you want to tell her everything about the page (dimensions and all the margins), for example
.PAGE 8.5i 11i 45p 45p 45p 45p This sets up an 8-1/2 by 11 inch page with margins of 45 points (5/8-inch) all around.

Additionally, if you invoke .PAGE with a top margin argument, any macros you invoke after .PAGE will almost certainly move the baseline of the first line of text down by one linespace. To compensate, do
.RLD 1v immediately before entering any text, or, if it’s feasible, make PAGE the last macro you invoke prior to entering text.

Please read the Important note on page dimensions and papersize for information on ensuring groff respects your PAGE dimensions and margins.

Start a new page

Macro: NEWPAGE

Whenever you want to start a new page, use NEWPAGE, by itself with no argument. Mom will finish up processing the current page and move you to the top of a new one (subject to the top margin set with T_MARGIN).


Basic typesetting parameters

The basic typesetting parameter macros deal with fundamental requirements for setting type: family, font, point size, leading and line length.

If you’re using the typesetting macros only, the arguments passed to the basic parameter macros remain in effect until you change them. The document processing macros handle things differently. See Typesetting macros during document processing for an explanation.

Basic parameter macros

Type family

Macro: FAMILY <family>

Alias: FAM

FAMILY takes one argument: the name of the family you want. Groff comes with a small set of basic families, each identified by a 1-, 2-or 3-letter mnemonic. The standard families are:
A = Avant Garde BM = Bookman H = Helvetica HN = Helvetica Narrow N = New Century Schoolbook P = Palatino T = Times Roman ZCM = Zapf Chancery The argument you pass to FAMILY is the identifier at left, above. For example, if you want Helvetica, enter
.FAMILY H

Note: The font macro (FT) lets you specify both the type family and the desired font with a single macro. While this saves a few keystrokes, I recommend using FAMILY for family, and FT for font, except where doing so is genuinely inconvenient. ZCM, for example, only exists in one style: Italic (I). Therefore, .FT ZCMI makes more sense than setting the family to ZCM, then setting the font to I.

Additional note: If you are running a version of groff lower than 1.19.2, you must follow all FAMILY requests with a FT request, otherwise mom will set all type up to the next FT request in the fallback font.

If you are running a version of groff greater than or equal to 1.19.2, when you invoke the FAMILY macro, mom “remembers” the font style (Roman, Italic, etc) currently in use (if the font style exists in the new family) and will continue to use the same font style in the new family. For example:
.FAMILY BM \" Bookman family .FT I \" Medium Italic <some text> \" Bookman Medium Italic .FAMILY H \" Helvetica family <more text> \" Helvetica Medium Italic However, if the font style does not exist in the new family, mom will set all subsequent type in the fallback font (by default, Courier Medium Roman) until she encounters a .FT request that’s valid for the family. For example, assuming you don’t have the font “Medium Condensed Roman” (mom extension “CD”) in the Helvetica family:
.FAMILY UN \" Univers family .FT CD \" Medium Condensed <some text> \" Univers Medium Condensed .FAMILY H \" Helvetica family <more text> \" Courier Medium Roman! In the above example, you must follow .FAMILY H with a FT request that’s valid for Helvetica.

Please see the Appendices, Adding fonts to groff, for information on adding fonts and families to groff, as well as to see a list of the extensions mom provides to groff’s basic R, I, B, BI styles.

Suggestion: When adding families to groff, I recommend following the established standard for the naming families and fonts. For example, if you add the Garamond family, name the font files
GARAMONDR GARAMONDI GARAMONDB GARAMONDBI GARAMOND then becomes a valid family name you can pass to FAMILY. (You could, of course, shorten GARAMOND to just G, or GD.) R, I, B, and BI after GARAMOND are the roman, italic, bold and bold-italic fonts respectively.

FT

Macro: FT R | I | B | BI | <any other valid font style>

Alias: FONT

By default, groff permits FT to take one of four possible arguments specifying the desired font:
R = (Medium) Roman I = (Medium) Italic B = Bold (Roman) BI = Bold Italic For example, if your family is Helvetica, entering
.FT B will give you the Helvetica bold font. If your family were Palatino, you’d get the Palatino bold font.

Mom considerably extends the range of arguments you can pass to FT, making it more convenient to add and access fonts of differing weights and shapes within the same family. Have a look here for a list of the weight/style arguments mom allows. Be aware, though, that you must have the fonts, correctly installed and named, in order to use the arguments. (See Adding fonts to groff for instructions and information.) Please also read the ADDITIONAL NOTE found in the description of the FAMILY macro.

How mom reacts to an invalid argument to FT depends on which version of groff you’re using. If your groff version is greater than or equal to 1.19.2, mom will issue a warning and, depending on how you’ve set up the fallback font, either continue processing using the fallback font, or abort (allowing you to correct the problem). If your groff version is less than 1.19.2, mom will silently continue processing, using either the fallback font or the font that was in effect prior to the invalid FT call.

FT will also accept, as an argument, a full family+font name. For example,
.FT HB will set subsequent type in Helvetica Bold. However, I strongly recommend keeping family and font separate except where doing so is genuinely inconvenient.

For inline control of fonts, see Inline Escapes, font control.

Fallback font

Macro: FALLBACK_FONT <fallback font> [ ABORT | WARN ]

In the event that you pass an invalid argument to .FAMILY (ie a non-existent family), mom, by default, uses the fallback font, Courier Medium Roman (CR), in order to continue processing your file.

If you’d prefer another fallback font, pass FALLBACK_FONT the full family+font name of the font you’d like. For example, if you’d rather the fallback font were Times Roman Medium Roman,
.FALLBACK_FONT TR would do the trick.

Mom issues a warning whenever a font style set with FT does not exist, either because you haven’t registered the style (see here for instructions on registering styles), or because the font style does not exist in the current family set with FAMILY. By default, mom then aborts, which allows you to correct the problem.

If you’d prefer that mom not abort on non-existent fonts, but rather continue processing using a fallback font, you can pass FALLBACK_FONT the argument WARN, either by itself, or in conjunction with your chosen fallback font.

Some examples of invoking FALLBACK_FONT:

  • .FALLBACK_FONT WARN
    mom will issue a warning whenever you try to access a non-existent font but will continue processing your file with the default fallback font, Courier Medium Roman.
  • .FALLBACK_FONT TR WARN
    mom will issue a warning whenever you try to access a non-existent font but will continue processing your file with a fallback font of Times Roman Medium Roman; additionally, “TR” will be the fallback font whenever you try to access a family that does not exist.
  • .FALLBACK_FONT TR ABORT
    mom will abort whenever you try to access a non-existent font, and will use the fallback font “TR” whenever you try to access a family that does not exist.

If, for some reason, you want to revert to ABORT, just enter .FALLBACK_FONT ABORT and mom will once again abort on font errors.

Point size of type

Macro: PT_SIZE <size of type in points>

• Does not require a unit of measure

PT_SIZE (Point Size) takes one argument: the size of type in points. Unlike most other macros that establish the size or measure of something, PT_SIZE does not require that you supply a unit of measure since it’s a near universal convention that type size is measured in points. Therefore, to change the type size to, say, 11 points, enter
.PT_SIZE 11 Point sizes may be fractional (eg 10.25 or 12.5).

If you invoke PT_SIZE without an argument, it reverts to its former value. For example, if your point size is 10 and you change it to 12 with .PT_SIZE 12, entering .PT_SIZE (i.e. without an argument) resets the point size to 10.

You can prepend a plus or a minus sign to the argument to PT_SIZE, in which case the point size will be changed by + or - the original value. For example, if the point size is 12, and you want 14, you can do
.PT_SIZE +2 then later reset it to 12 with .PT_SIZE -2 or, more simply, just .PT_SIZE The size of type can also be changed inline. See Inline Escapes, changing point size.

Note: It is unfortunate that the pic preprocessor has already taken the name, PS, and thus mom’s macro for setting point sizes can’t use it. However, if you aren’t using pic, you might want to alias PT_SIZE as PS, since there’d be no conflict. For example
.ALIAS PS PT_SIZE would allow you to set point sizes with .PS.

Line spacing/leading

Macro: LS <distance between lines>

• Does not require a unit of measure

LS (Line Space) takes one argument: the distance you want, typically in points, from baseline to baseline of type. The argument may be fractional (eg 12.25 or 14.5). Like PT_SIZE, LS does not require a unit of measure, since leading is most often given in points. Therefore, to set the linespace to 14 points, you would enter
.LS 14 However, if you wish, you may specify a unit of measure by appending it directly to the argument passed to LS. For example, if you want a linespace of 1/4 of an inch, enter
.LS .25i You can prepend a plus or a minus sign to the argument to LS, in which case the line spacing will be changed by + or - the original value. For example, if the line spacing is 14 points, and you want 17 points, you can do
.LS +3 then later reset it to 14 points with
.LS -3

Experts: LS should not be confused with the groff primitive .ls. LS acts like .vs. mom does not provide a macro analogous to .ls.

Automatic line spacing

Macro: AUTOLEAD <amount of automatic leading> [FACTOR]

• Does not require a unit of measure
(Please see here for information on using AUTOLEAD during document processing.)

Without the FACTOR argument, AUTOLEAD calculates the linespace for you by adding its argument to the current point size of type. All subsequent PT_SIZE requests automatically update the linespacing by the autolead amount.

Used in this way, AUTOLEAD does not require a unit of measure; points is assumed. However, you may use an alternate unit of measure by appending it to the argument. The argument may be a decimal fraction (eg .5 or 2.75).

As an example, if your current point size of type is 12, entering
.AUTOLEAD 2 changes the linespace to 14 points, regardless any linespacing already in effect. From here on, every change to the size of type (with PT_SIZE, not inline) changes the linespace as well. If you decrease the type size to 9 points, the leading decreases to 11 points. If you increase the type size to 16 points, the leading increases to 18 points.

Automatic updating of the linespacing continues until you enter a “manual” line space value with LS.

Experts: Please note that the groff primitives, .vs and .ps, are unaffected by, and have no effect, on AUTOLEAD.

If you give AUTOLEAD the optional FACTOR argument, AUTOLEAD calculates the line space as a factor of the numeric argument you gave AUTOLEAD. For example, if your point size is 12,
.AUTOLEAD 1.125 FACTOR sets the leading at 13.5 points. If you change the point size to 14, the leading automatically changes to 15.75 (14 x 1.125).

Note: There’s no need to prepend a plus sign (+) to AUTOLEAD’s argument, although you may do so if you wish.

Line length

Macro: LL <line length>

• Requires a unit of measure

LL (Line Length) takes one argument: the distance from the left margin of the page to the maximum allowable point on the right at which groff should place type. The line length, in other words, as the macro suggests.

LL requires a unit of measure. Therefore, to set the line length to 39 picas, you would enter
.LL 39P As with other macros that require a unit of measure, the argument to LL may be fractional. For example,
.LL 4.5i sets the line length to 4-1/2 inches.

Additionally, you may express a new line length relative to the current line length by prepending a plus or minus sign to the argument. Thus, if you wanted to increase the line length by 3 points, you could do
.LL +3p This is especially handy when you want to “hang” punctuation outside the right margin since you can pass groff’s \w escape as the argument to LL, like this:
.LL +\w'.'u The above example increases the current line length by the width of a period. Notice that you must append the unit of measure, u, to the escape since LL requires a unit of measure.

Note: The right margin macro, (R_MARGIN), can also be used to set line length.


Justification and quadding/breaking and joining lines

The justification and quadding macros deal with how type aligns along the left and right margins. In a nutshell, type either aligns at the left margin, at the right margin, at both margins, or at neither margin (centred).

These macros also determine whether or not input lines are joined and filled during output.

Additionally, macros that deal with how to break output lines are covered in this section, as is the inline escape for joining input lines.

You may encounter some words here that are unfamiliar. Refer to Typesetting terms and Groff terms for an explanation.

Justification and quadding/breaking and joining lines macros

  • Fill modes
    • JUSTIFY – set lines justified
    • QUAD – set filled lines flush left, right or centred
  • Nofill modes
    • LEFT – set non-filled lines flush left
    • RIGHT – set non-filled lines flush right
    • CENTER – set non-filled lines centred
  • Breaking lines
    • BR – manually break an output line
    • EL – break a line without advancing to the next output line
    • SPACE – break a line and add space before the next output line
    • SPREAD – break and force-justify an output line
  • Joining input lines in nofill mode
    • \c inline escape

Justify lines

Macro: JUSTIFY

(See fill mode for a definition of the difference between “fill” and “no-fill” modes.)

JUSTIFY doesn’t take an argument. Input lines after JUSTIFY are filled and justified upon output.

To break lines and prevent them from being filled and justified, use the BR macro.

Quad lines left, right, or centre

Macro: QUAD L | LEFT | R | RIGHT | C | CENTER | J | JUSTIFY

Alias: FILL

(See fill mode for a definition of the difference between “fill” and “no-fill” modes.)

QUAD takes one argument: the direction in which lines should be quadded. Input lines after QUAD are filled upon output.

If L or LEFT, type is set flush along the left margin.

If R or RIGHT, type is set flush along the right margin.

If C or CENTER type is set centred on the current line length.

J and JUSTIFY justify text, and are included as a convenience only. Obviously, if text is justified, it isn’t quadded. .QUAD J and .QUAD JUSTIFY have exactly the same effect as JUSTIFY.

To break lines and prevent them from being filled, use the BR macro.

Set lines flush left, right or centered in no-fill mode

Macro: LEFT
Macro: RIGHT
Macro: CENTER  (alias CENTRE)

(See no-fill mode for a definition of the difference between “fill” and “no-fill” modes.)

LEFT, RIGHT and CENTER let you enter text on a line for line basis without having to use the BR macro after each line. Consider the following:
.QUAD LEFT So runs my dream, but what am I? .BR An infant crying in the night .BR An infant crying for the light .BR And with no language but a cry. .BR Because text after .QUAD LEFT is filled, you have to use the BR macro to prevent the lines from running together. Not only is this annoying to type, it’s awkward to read in a text editor. Much better to do
.LEFT So runs my dream, but what am I? An infant crying in the night An infant crying for the light And with no language but a cry.

IMPORTANT: Because LEFT, RIGHT and CENTER are nofill modes, groff does not always respect the current line length. Input lines that run long may exceed it, or get broken in undesirable ways. Therefore, when using these three macros, you should preview your work to ensure that all lines fit as expected.

Manually break lines

Macro: BR

When using JUSTIFY or QUAD, BR tells mom about partial lines that you want broken (as opposed to filled). Any partial output line that immediately precedes BR will be quadded in the direction of the current quad, or set flush left if text is justified.

Most of the time, you won’t need the BR macro. In fill modes, mom tries to be sensible about where breaks are needed. If the nature of a macro is such that under most circumstances you’d expect a break, mom puts it in herself. Equally, in macros where a break isn’t normally desirable, no break occurs. This means text files don’t get cluttered with annoying BR’s.

Note: Lines of text in nofill mode never require a BR. Furthermore, in nofill mode, ALL macros cause a break. If a break is not desired, use the \c inline escape.

Experts: BR is an alias for .br. You can use either, or mix ’n’ match with impunity.

Manually break a line without advancing on the page

Macro: EL

In nofill modes (LEFT, RIGHT, CENTER) you must terminate the line input preceding EL with the \c inline escape. See NOTES, below.

Suggestion: If you find remembering whether to put in the \c bothersome, you may prefer to use the inline escape alternative to EL, \*[B], which works consistently regardless of the fill mode. EL does not work after the PAD macro. See .PAD NOBREAK for the way around this.

EL ("End Line") is conceptually equivalent to the notion of a carriage return with no linefeed. Its function is simple: it breaks a line without advancing on the page. As an example of where you might use it, imagine that you’re working from marked-up copy. The markup indicates 24 points of space between two given lines, but the prevailing line spacing is 12.5 points. You may find it more convenient to break the first line with EL and instruct mom to advance 24 points to the next line instead of calculating the lead that needs to be added to 12.5 to get 24. To demonstrate:
.LEFT .LS 12.5 A line of text.\c .EL .ALD 24p The next line of text. may be more intuitive than
.LEFT .LS 12.5 A line of text. .ALD 11.5p The next line of text. The first example has the further advantage that should you wish to change the prevailing line space but keep the 24 points lead, you don’t have to recalculate the extra space.

ALD in the above examples stands for “Advance LeaD”, which is covered in the section Vertical movements.

Break lines and add space between

Macro: SPACE <space to add between lines>

Alias: SP

SPACE breaks a line, just like BR, then adds space after the line. With no argument, it adds an extra line space of a value equal to the current leading. If you pass it a numeric argument without supplying a unit of measure, it advances that number of extra line spaces. For example:
.SPACE breaks the line then adds an extra linespace, whereas
.SPACE 2 breaks the line and adds two extra linespaces.

If you supply a unit of measure, SPACE breaks the line then advances one linespace (at the current leading) PLUS the specified amount of extra space given to SPACE, as in
.SPACE 6p which breaks the line and advances one full linespace plus six points.

Tip: SPACE and ALD can be used interchangeably (.SPACE 6p and .ALD 6p are equivalent). However, ALD without an argument does nothing, whereas SPACE without an argument adds an extra line space. I recommend using SPACE when you want an extra line space (or multiple thereof), and ALD whenever you want some other value of space after a line.

Experts: SPACE is an alias of .sp. You can use either, or mix ’n’ match with impunity.

Break and force justify (spread) lines

Macro: SPREAD

Sometimes, you need to break a line of justified text and have it come out fully justified, not quadded left the way it would be with the BR macro. An example of where you’d do this would be when you want to prevent a word at the end of a line from being hyphenated (say, a proper name). SPREAD is the macro that lets you break the line and have it came out fully justified.

Experts: SPREAD is an alias for .brp You can use either, or mix ’n’ match with impunity.

Join input lines

Inline: \c

Sometimes, especially when in one of the nofill modes, a macro will cause a break where you don’t want one. In order to prevent this from happening (in other words, to join input lines together, forming one output line), use the groff inline escape \c at the end of each input line to be joined to another, like this:
.LEFT .FAMILY T .FT R Some lines of text to be \c .FAMILY H .FT B joined \c .FAMILY T .FT R together. Upon output, the lines will be joined together to read
Some lines of text to be joined together. with the word “joined” in Helvetica bold. Note the spaces before \c. Without them, the last three words of the output line would read
bejoinedtogether Please also note that had the example been in one of the fill modes, there’d have been no need for the \c.

Addendum: The example, above, is designed to demonstrate the use of \c. An easier and more intuitive way to accomplish the family/font change in the example would be with the groff inline escape, \f, like this:
Some lines of text to be \f[HB]joined\*[PREV] together.


Typographic refinements

The macros in this section help you tweak groff’s behaviour, ensuring that your documents look typographically professional.

Typographic refinements macros

  • Word and sentence spacing
    • WS – word spacing
    • SS – sentence space
  • Letter spacing (track kerning)
  • Hyphenation
    • HY – turn auto hyphenation on/off, or set specific hyphenation parameters
    • HY_SET – set all hyphenation parameters
  • Automatic kerning and ligatures
    • KERN – turn automatic pairwise kerning on or off
    • LIGATURES – turn automatic generation of ligatures on or off

Word spacing

Macro: WS <+|-wordspace> | DEFAULT

WS (Word Space) increases or decreases the amount of space between words. In nofill modes, or if QUAD is in effect, the space between words is fixed. Therefore, if you change the word spacing with WS, the change applies uniformly to the space between every word on every line. However, when text is justified, the space between words varies from line to line (in order to justify the text). Consequently, the change you make with WS represents the minimum (and ideal) space groff will try to put between words before deciding whether to hyphenate a final word or to stretch the word spacing.

Word space is relative to point size. Generally, in/decreasing the word space by a value of 1 or 2 produces a difference that in many cases is scarcely visible; in/decreasing by a value between 3 and 5 produces a subtle but noticeable difference; and in/decreasing by a value greater than 6 is almost always apparent. You should preview your work to assess the effect of WS.

WS takes as its argument a whole number preceded by a plus or minus sign. Therefore, to decrease the word space slightly, you might enter
.WS -2 To increase it by a noticeable amount, you might enter
.WS +6 You can reset the word spacing to its previous value by switching the plus or minus sign, like this:
.WS +2 A line of text .WS -2 The .WS -2 undoes the effect of .WS +2. You can also reset WS to its groff default by entering
.WS DEFAULT This can be particularly useful if you’ve been playing around with plus and minus values, and can’t remember by how much to in/decrease the word space to get it back to normal.

Sentence space

Macro: SS <+sentence space> | 0 | DEFAULT

SS (Sentence Space) tells groff how to treat double spaces it encounters between sentences in input lines. If you use SS, input sentences with two spaces after them and input sentences that fall at the end of input lines all receive a normal word space plus an additional amount of space whose size is determined by the + value passed as an argument to SS. Thus,
.SS +2 means that input sentences with two spaces after them receive a normal word space PLUS the +2 value passed to SS.

Like WS, increasing the sentence space by a value of 1 or 2 produces a difference that in many cases is scarcely visible; increasing by a value of 5 or so produces a subtle but noticeable difference (ie the space between double-spaced input sentences will be slightly but visibly greater than the space between words); and increasing by a value greater than 10 is always apparent. You should preview your work to assess the effect of SS.

There’s an additional argument you can pass SS: the number zero (without the + sign). It’s the argument you’ll use most often. Typeset copy should never have two spaces between sentences, and the "zero" argument tells groff to give the extra spaces no space at all (effectively removing them). Therefore, if you double-space your sentences (as you should when writing in a text editor), get in the habit of putting
.SS 0 at the top of your files.

If you do use SS for something other than ensuring that you don’t get unwanted sentence spaces in output copy, you can set or reset the sentence space to the groff default (the same width as a word space, ie double-spaced input sentences will appear double-spaced on output as well) with
.SS DEFAULT If you’re using the document processing macros and your PRINTSTYLE is TYPEWRITE, .SS DEFAULT is the default, because you do want double spaces between sentences in copy that imitates the look of a typewritten document.

IMPORTANT: SS with an argument other than 0 (zero) should only be used if you’re of the old (and wise) school of typists that puts two spaces between sentences. If you ignore this advice and use SS when you habitually put only one space between sentences, you risk producing output where the space between sentences is not equal.

Automatic hyphenation control

Macro: HY LINES <max. number of consecutive hyphenated lines>
Macro: HY MARGIN <size of hyphenation margin>
Macro: HY SPACE <extra interword spacing to prevent hyphenation>
Macro: HY DEFAULT
Macro: HY toggle

Aliases: HYPHENATE, HYPHENATION

HY, as you can see, can be invoked with a number of arguments. In all cases, the aliases HYPHENATE or HYPHENATION can be used in place of HY. To aid in understanding the various arguments you can pass to HY, I’ve broken them down into separate sections.

1.  HY

HY by itself (ie with no argument) simply turns automatic hyphenation on. Any argument other than LINES, MARGIN, SPACE or DEFAULT, turns automatic hyphenation off. For example, as explained in How to read macro arguments, you could turn HY off by entering
.HY OFF or .HY X or .HY END A subsequent call to HY restores hyphenation with the parameters for LINES, MARGIN, or SPACE that were formerly in effect (see below).

HY observes the following default hyphenation rules:

  • Last lines (ie ones that will spring a trap—typically the last line on a page) will not be hyphenated.
  • The first and last two characters of a word are never split off.

2.  HY LINES

HY LINES sets the maximum number of consecutive hyphenated lines that will appear in output copy. 2 is a very good choice, and you’d set it with
.HY LINES 2 By default, when you turn automatic hyphenation on, there is no limit to the number of consecutive hyphenated lines.

Note: Discretionary hyphens count when groff is figuring out how many lines to hyphenate; explicit hyphens (ie the actual hyphen character) do not.

3.  HY MARGIN

HY MARGIN sets the amount of room allowed at the end of a line before hyphenation is tripped (eg if there’s only 6 points left at the end of a line, groff won’t try to hyphenate the next word). HY MARGIN only applies if you’re using QUAD, and is really only useful if you’re using QUAD LEFT.

As an example, if you don’t want groff to hyphenate words when there’s only 18 points of space left at the end of a left-quadded line, you’d enter
.HY MARGIN 18p

Note: The numeric argument after HY MARGIN requires a unit of measure.

4.  HY SPACE

HY SPACE sets an amount of extra interword space that groff will try to put between words on a line in order to PREVENT hyphenation. HY SPACE applies only to justified lines. Generally speaking, you’ll want this value to be quite small, since too big a value will result in lines with gaping holes between the words. A reasonable value might be half a point, or one point, which you’d set with
.HY SPACE .5p or .HY SPACE 1p

Note: The numeric argument after HY SPACE requires a unit of measure.

5.  HY DEFAULT

HY DEFAULT resets automatic hyphenation to its default behaviour, cancelling any changes made with HY LINES, HY MARGIN, and/or HY SPACE.

Thoughts on hyphenation in general

Hyphenation is a necessary evil. If it can be avoided, it should be. If it can’t be, it should occur infrequently. That’s the reason for the number of parameters you can set with HY.

Furthermore, hyphenation in rag copy requires a great deal of attention. At best, it should be avoided completely by individually adjusting the number of words on consecutive lines to achieve a pleasing, natural-looking rag. Since such adjustments are often too fussy for document processing, I recommend playing around with HY MARGIN a bit if your copy looks hyphen-heavy.

Set hyphenation parameters all at once

Macro: HY_SET <lines> [ <margin> [ <space> ] ]

Alias: HYSET

HY_SET lets you set the parameters for hyphenation with a single macro. <lines>, <margin> and <space> correspond to the numeric values required by LINES, MARGIN and SPACE as described above.

To set just the maximum number of consecutive hyphenated lines, you’d enter
.HY_SET 2 If you wanted the same number of maximum consecutive hyphenated lines and a hyphenation margin for use with rag copy,
.HY_SET 2 36p would set the hyphenation margin to 36 points.

If you wanted the same number of maximum consecutive hyphenated lines and a hyphenation space of 2 points for use with justified copy,
.HYSET 2 0 2p is how you’d do it.

Reduce whitespace

Macro: RW <amount of whitespace reduction between letters>

RW (Reduce Whitespace) and its corresponding macro, EW (Expand Whitespace), allow you to tighten (or loosen) output lines by uniformly reducing or expanding the space between characters. This is particularly useful when you want to squeeze or stretch lines on a narrow measure.

The value passed to RW may be a whole number or a decimal fraction. Since a value of 1 produces a noticeable reduction in the space between letters at text sizes, you’ll most likely use small decimal values when tightening lines. For example,
.RW .1 or .RW .2 may be just enough to squeeze an extra character or two on a line without the change in letter spacing being obvious. I highly recommend previewing your work to assess the effect of RW.

Note: By default, RW does not deposit a break when it’s invoked if you’re in one of the fill modes (ie QUAD L, R, C, J or JUSTIFY). If you want RW to break at the ends of the previous input lines while you’re in a fill mode, tell mom that’s what you want by invoking .BR_AT_LINE_KERN.

IMPORTANT: RW (and its complement, EW; see below) only affects the current font, and remains in effect for that font every time it’s called, hence it must be reset to zero to cancel its effect (.RW 0).

Expand whitespace

Macro: EW <amount of whitespace expansion between letters>

EW (Expand Whitespace) expands the amount of whitespace between letters, effectively “loosening” lines of type.

The value passed to EW may be a whole number or a decimal fraction. Since a value of 1 produces a noticeable expansion in the space between letters at text sizes, you’ll most likely use small decimal values when loosening lines. For example,
.EW .1 or .EW .2 may be just enough to open up a line without the change in letter spacing being obvious. I highly recommend previewing your work to assess the effect of EW.

Note: By default, EW does not deposit a break when it’s invoked if you’re in one of the fill modes (ie QUAD L, R, C, J or JUSTIFY). If you want EW to break at the ends of the previous input lines while you’re in a fill mode, tell mom that’s what you want by invoking the .BR_AT_LINE_KERN toggle macro.

IMPORTANT: EW (and its complement, RW; see above) only affects the current font, and remains in effect for that font every time it’s called, hence it must be reset to zero to cancel its effect (.RW 0).

Break before line kerning

Macro: BR_AT_LINE_KERN toggle

By default, in fill modes (ie QUAD L, R, C, J or JUSTIFY) mom does not break input lines when you invoke RW or EW. If you’d like her to break input lines prior to RW or EW, invoke .BR_AT_INPUT_LINE without any argument. To disable the breaks, invoke .BR_AT_INPUT_LINE with any argument (OFF, QUIT, Q, X...), like this
.BR_AT_LINE_KERN OFF or .BR_AT_LINE_KERN X With QUAD L, R or C, mom simply breaks the line. With QUAD J (or just JUSTIFY, which is the same thing), she breaks and force justifies the line prior to .EW or .RW.

Automatic kerning

Macro: KERN toggle

By itself (ie with no argument), KERN turns automatic pairwise kerning on. With any argument (eg OFF, Q, X), pairwise kerning is turned off.

Kerning of individual character pairs can be controlled with the inline escapes \*[BU <n>] and \*[FU <n>]. See Inline Escapes, kerning.

Automatic ligature generation

Macro: LIGATURES toggle

Alias: LIG

Provided your current font has ligatures, LIGATURES, by itself, turns on automatic generation of ligatures. When automatic ligature generation is on, simply typing the letters of a ligature combination will produce the correct ligature upon output. For example, if you type the word “finally”, the fi combination will be output as an fi ligature. Generally speaking, ligatures are A Good Thing, hence mom has them on by default.

LIGATURES with any argument turns automatic ligature generation off.

Note: Not all fonts support ligatures.


Type modifications (pseudo font styles)

It sometimes happens that a family doesn’t contain all the fonts you need. You might, for example, be missing an italic font, or a bold font. Or you might not be able to get your hands on the condensed version. That’s where these macros and inline escapes come in. With them, you can fake the fonts you’re missing. A word of caution, though: “faked” fonts are just that—faked. You should only use them as a last resort, and then only sparingly. A word or two or a line or two in a faked font will pass unnoticed; large patches of type in a faked font look typographically cheap.

Type modifications macros

  • Pseudo italic
    • SETSLANT – degree of pseudo-italicizing
    • \*[SLANT] – inline escape for pseudo-italicizing type
  • Pseudo bold
  • Pseudo condensed
    • CONDENSE – percentage for pseudo-condensed type
    • \*[COND] – inline escape for pseudo-condensed type
  • Pseudo extended
    • EXTEND – percentage for pseudo-extended type
    • \*[EXT] – inline escape for pseudo-extending

Set degree of slant for pseudo-italicizing

Macro: SETSLANT <degrees to slant type> | RESET

Pseudo-italicizing of type is accomplished by slanting a roman font a certain number of degrees to the right. SETSLANT lets you fix the number of degrees. Mom’s default is 15, which produces an acceptable approximation of an italic font. If you want another value—say, 13 degrees—you’d set it by entering
.SETSLANT 13 If you change the degree of slant and later want to set it back to the mom default, do
.SETSLANT RESET

Note: By itself, SETSLANT will not start pseudo-italicizing type; it merely tells mom what degree of slant you want. To start pseudo-italicizing, use the inline escape \*[SLANT].

Pseudo italic on/off

Inline: \*[SLANT]
Inline: \*[SLANTX]

\*[SLANT] begins pseudo-italicizing type. \*[SLANTX] turns the feature off. Both are inline escapes, therefore they should not appear as separate lines, but rather be embedded in text lines, like this:
Not \*[SLANT]everything\*[SLANTX] is as it seems. Alternatively, if you wanted the whole line pseudo-italicized, you’d do
\*[SLANT]Not everything is as it seems.\*[SLANTX] Once \*[SLANT] is invoked, it remains in effect until turned off.

Note: If you’re using the document processing macros with PRINTSTYLE TYPEWRITE, mom underlines pseudo-italics by default. To change this behaviour, use the special macro SLANT_MEANS_SLANT.

Set amount of emboldening

Macro: SETBOLDER <amount of emboldening, in machine units> | RESET

Emboldening of type is accomplished by printing characters twice; the second printing is slightly offset from the first, effectively “thickening” the character. SETBOLDER lets you set the number of machine units for the offset. Mom’s default is 700 units, which produces an acceptable approximation of a bold font. If you want another value—say, 500 units—you’d set it by entering
.SETBOLDER 500 If you change the emboldening offset and later want to set it back to the mom default, do
.SETBOLDER RESET

Note: By itself, SETBOLDER will not start emboldening type; it merely tells mom what you want the emboldening offset to be. To start emboldening, use the inline escape \*[BOLDER].

Emboldening on/off

Inline: \*[BOLDER]
Inline: \*[BOLDERX]

\*[BOLDER] begins emboldening type. \*[BOLDERX] turns the feature off. Both are inline escapes, therefore they should not appear as separate lines, but rather be embedded in text lines, like this:
Not \*[BOLDER]everything\*[BOLDERX] is as it seems. Alternatively, if you wanted the whole line emboldened, you’d do
\*[BOLDER]Not everything is as it seems.\*[BOLDERX] Once \*[BOLDER] is invoked, it remains in effect until turned off.

Note: If you’re using the document processing macros with PRINTSTYLE TYPEWRITE, mom ignores \*[BOLDER] requests.

Set percentage for pseudo-condensed type

Macro: CONDENSE <pseudo-condense percentage>

Pseudo-condensing of type is accomplished by reducing the width of characters at a given point size without reducing their height, effectively narrowing them so they look like condensed type. CONDENSE tells mom what percentage of the normal character width you want the characters to be condensed.

Mom has no default value for CONDENSE, therefore you must set it before using the inline escape \*[COND]. 80 percent of the normal character width is a good value, and you’d set it like this:
.CONDENSE 80

Note: By itself, CONDENSE will not start pseudo-condensing type; it merely tells mom what percentage of the normal character width you want characters to be condensed. To start pseudo-condensing, use the inline escape \*[COND].

Additional note: Make sure that pseudo-condensing is off (with \*[CONDX]) before before making any changes to the pseudo-condense percentage with CONDENSE.

Pseudo-condensing on/off

Inline: \*[COND]
Inline: \*[CONDX]

\*[COND] begins pseudo-condensing type. \*[CONDX] turns the feature off. Both are inline escapes, therefore they should not appear as separate lines, but rather be embedded in text lines, like this:
\*[COND]Not everything is as it seems.\*[CONDX] \*[COND] remains in effect until you turn it off with \*[CONDX].

IMPORTANT: You must turn \*[COND] off before making any changes to the point size of your type, either via the PT_SIZE macro or with the \s inline escape. If you wish the new point size to be pseudo-condensed, simply reinvoke \*[COND] afterwards. Equally, \*[COND] must be turned off before changing the condense percentage with .CONDENSE.

Note: If you’re using the document processing macros with PRINTSTYLE TYPEWRITE, mom ignores \*[COND] requests.

Set percentage for pseudo-extended type

Macro: EXTEND <pseudo-extend percentage>

Pseudo-extending of type is accomplished by increasing the width of characters at a given point size without increasing their height, effectively widening them so they look like extended type. EXTEND tells mom what percentage of the normal character width you want the characters to be extended.

Mom has no default value for EXTEND, therefore you must set it before using the inline escape \*[EXT]. 120% of the normal character width is a good value, and you’d set it like this:
.EXTEND 120

Note: By itself, EXTEND will not start pseudo-extending type; it merely tells mom what percentage of the normal character width you want characters to be extended. To start pseudo-extending, use the inline escape \*[EXT].

Additional note: Make sure that pseudo-extending is off (with \*[EXTX]) before before making any changes to the pseudo-extend percentage with EXTEND.

Pseudo-extending on/off

Inline: \*[EXT]
Inline: \*[EXTX]

\*[EXT] begins pseudo-extending type. \*[EXTX] turns the feature off. Both are inline escapes, therefore they should not appear as separate lines, but rather be embedded in text lines, like this:
\*[EXT]Not everything is as it seems.\*[EXTX] \*[EXT] remains in effect until you turn it off with \*[EXTX].

IMPORTANT: You must turn \*[EXT] off before making any changes to the point size of your type, either via the PT_SIZE macro or with the \s inline escape. If you wish the new point size to be pseudo-extended, simply reinvoke \*[EXT] afterwards. Equally, \*[EXT] must be turned off before changing the extend percentage with EXTEND.

Note: If you’re using the document processing macros with PRINTSTYLE TYPEWRITE, mom ignores \*[EXT] requests.


Vertical movements

The two macros in this section allow you to move down or up on the page relative to the current baseline.

Vertical movements macros

  • ALD – Advance Lead
  • RLD – Reverse Lead

Advance Lead (move downward)

Macro: ALD <distance to move downward>

• Requires a unit of measure

ALD takes one argument: the distance to move downward on the page relative to the current vertical position.

Used by itself, or preceded by BR, ALD will advance by one line space plus the distance you specify. Preceded by EL, it will advance by exactly the distance you specify.

ALD requires a unit of measure. Decimal fractions are allowed, and values may be combined. Therefore, to move down on the page by 1/4 of an inch, you could enter either
.ALD .25i or
.ALD 1P+6p As the mnemonic (Advance LeaD) suggests, you’ll most often use ALD with points of lead.

Note: if you want to use ALD at the top of a page (ie to advance to the starting position of type on a page), combine the value you want with -1v (minus one line space), like this:
.ALD 1i-1v At the top of a page, this will advance one inch from the top edge of the paper. Without the -1v, the same command would advance one inch from the top of the page plus the distance of one line space.

Reverse Lead (move upward)

Macro: RLD <distance to move upward>

• Requires a unit of measure

RLD takes one argument: the distance to move upward on the page relative to the current vertical position.

Used by itself, or preceded by BR, RLD will advance by one line space, then reverse by the distance you specify. Preceded by EL, it will reverse by exactly the distance you specify.

RLD requires a unit of measure. Decimal fractions are allowed, and values may be combined. Therefore, to move up on the page by 1/4 of an inch, you could enter either
.RLD .25i or .RLD 1P+6p As the mnemonic (Reverse LeaD) suggests, you’ll most often use RLD with points of lead.


Tabs

Mom provides two different kinds of tab setup: typesetting tabs and string tabs. Neither one has anything to do with the tab key on your keyboard, and both are utterly divorced from groff’s notion of tabs. I recommend reading this section carefully in order to understand how mom handles tabs.

Note: see the section Typesetting macros during document processing for reassuring information on the use of tabs during document processing.

Typesetting tabs

Typesetting tabs are defined by both an indent from the left margin and a line length. This is quite different from typewriter-style tab stops (the groff norm) that only define the left indent. In conjunction with the multi-column macros, typesetting tabs significantly facilitate tabular and columnar work.

Typesetting tabs are created with the TAB_SET macro. TAB_SET identifies the tab (by number), establishes its left indent and line length, and optionally sets a quad direction and fill mode. After tabs have been created with TAB_SET, they can be called at any time with the TAB macro.

Quickie tutorial on typesetting tabs

Say you want to set up three tabs to produce an employee evaluation that looks something like this:

CRITERION EVALUATION COMMENTS Service Good Many clients specifically request support from Joe by name. Punctuality Satisfactory Tends to arrive after 8:00am, but often works through lunch hour. Team spirit Needs work Persistently gives higher priority to helping clients than respecting organizational hierarchy.

You want the first tab, CRITERION,

  • to begin at the left margin of the page – ie no indent
  • to have a line length of 5 picas
  • to be set flush left

Tabs must be numbered, and each has to be set up with a separate TAB_SET line. Therefore, to set up tab 1, you enter
.TAB_SET 1 0 5P L | | | | tab #--+ | | +--direction | | indent--+ +--length You want the second tab, EVALUATION,

  • to begin 8 picas from the left margin
  • to have a length of 9 picas
  • to be set centered

You set it up like this:
.TAB_SET 2 8P 9P C | | | | tab #--+ | | +--direction | | indent--+ +--length You want the third tab, COMMENTS,

  • to begin 19 picas from the left margin
  • to have a length of 17 picas
  • to be set flush left, filled

The setup looks like this:
.TAB_SET 3 19P 17P L QUAD | | | | | | | | | +--fill output lines | | | | tab #--+ | | +--direction | | indent--+ +--length Once the tabs are set up, you can call them in one of two ways:

  • with .TAB (passing the tab number as an argument), which breaks the current line, advances one linespace and calls the tab.
  • with .TN (Tab Next), which keeps you on the current line and moves over to the next tab in sequence (ie from 1 to 2, 2 to 3, etc.), or, more conveniently, with the \*[TB+] inline escape

To exit from tabs and restore your original left margin, line length, quad direction and fill mode, use .TQ (Tab Quit).

Here’s how the input for our sample employee evaluation looks (with some introductory parameters):

Code:
.PAGE 8.5i 11i 1i 1i 1i .FAMILY T .FT R .PT_SIZE 14 .LS 16 .QUAD LEFT .KERN .HY OFF .SS 0 .TAB_SET 1 0 5P L .TAB_SET 2 8P 9P C .TAB_SET 3 19P 17P L QUAD .TAB 1 CRITERION\*[TB+] EVALUATION\*[TB+] COMMENTS .SP .TAB 1 Service\*[TB+] Good\*[TB+] Many clients specifically request support from Joe by name. .SP .TAB 1 Punctuality\*[TB+] Satisfactory\*[TB+] Tends to arrive after 8:00am, but often works through lunch hour. .SP .TAB 1 Team spirit\*[TB+] Needs work\*[TB+] Persistently gives higher priority to helping clients than respecting organizational hierarchy. .TQ

Try setting this up and processing it it with
pdfmom filename.mom > filename.pdf then previewing the .pdf file. Notice how .TN simply moves over to the next tab, while the combination .SP/.TAB 1 breaks the line, advances by one extra linespace, and calls the first tab.

Notice, too, how the QUAD argument passed to tab 3 means you don’t have to worry about the length of input lines; mom fills the tab and sets the type flush left.

String tabs (autotabs)

String tabs let you mark off tab positions with inline escapes embedded in input lines. Left indents and line lengths are calculated from the beginning and end positions of the marks. This is especially useful when tab indents and lengths need to be determined from the text that goes in each tab.

Setting up string tabs is a two-step procedure. First, you enter an input line in which you mark off where you want tabs to begin and end. (This is often best done in conjunction with the SILENT macro.)

Next, you invoke the ST macro for every string tab you defined, and optionally pass quad and fill information to it. That done, string tabs are called with the TAB macro, just like typesetting tabs.

In combination with the PAD macro and the groff inline escape \h (move horizontally across the page) or mom’s \*[FWD <distance>] (move forward) inline, string tabs provide tremendous flexibility in setting up complex tab structures.

Quickie tutorial on string tabs

Say you want to set up tabs for the employee evaluation form used as an example in the typesetting tabs tutorial. This time, though, you want to play around with the point size of type, so you can’t know exactly how long the tabs will be or where they should start. All you know is

  • CRITERION is the longest line in tab 1
  • EVALUATION is the longest line in tab 2
  • tab 3 should extend to the current right margin
  • you want a 1 pica gutter between each tab

This is an ideal job for string tabs.

The first thing you need for string tabs is an input line with tab positions marked on it. Tabs are marked with the inline escapes \*[ST<n>] and \*[ST<n>X], where <n> is the number you want the tab to have. (In this example, we enclose the input line with the SILENT macro so the line doesn’t print. We also use the PAD macro to permit defining tab 3 as simply “the amount of space remaining on the input line.”)

The setup looks like this:

Code:
.SILENT .PAD "\*[ST1]CRITERION\*[ST1X]\*[FWD 12p]\*[ST2]EVALUATION\*[ST2X]\*[FWD 12p]\*[ST3]#\*[ST3X]" .SILENT OFF

The long line after .PAD looks scary, but it isn’t really. Here’s what it means when broken down into its component parts:

  • The longest line in tab 1 is “CRITERION”, so we enclose CRITERION with begin/end markers for string tab 1:
    \*[ST1]CRITERION\*[ST1X]
  • We want a 1 pica (12 points) gutter between tab 1 and 2, so we insert 12 points of space with \*[FWD 12p]:
    \*[FWD 12p]
  • The longest line in tab 2 is “EVALUATION”, so we enclose EVALUATION with begin/end markers for string tab 2: \*[ST2]EVALUATION\*[ST2X]
  • We want 1 pica (12 points) between tab 2 and 3, so we insert it with:
    \*[FWD 12p]
  • We want tab 3 to be as long as whatever space remains on the current line length, so we enclose the pad marker (#) with begin/end markers for string tab 3: \*[ST3]#\*[ST3X]

The tabs are now defined, but they require quad direction and fill information. For each string tab defined above, enter a separate .ST line, like this:
.ST 1 L .ST 2 L .ST 3 L QUAD | | | | | +--fill output lines | | tab #--+ +--direction From here on in, you call the tabs with .TAB, .TN, or \*[TB+] just like typesetting tabs (see typesetting tabs tutorial).

Here’s the complete setup and entry for the sample employee evaluation form utilizing string tabs.

Code:
.PAGE 8.5i 11i 1i 1i 1i .FAMILY T .FT R .PT_SIZE 14 .LS 16 .QUAD LEFT .KERN .HY OFF .SS 0 .SILENT .PAD "\*[ST1]CRITERION\*[ST1X]\*[FWD 12p]\*[ST2]EVALUATION\*[ST2X]\*[FWD 12p]\*[ST3]#\*[ST3X]" .SILENT OFF .ST 1 L .ST 2 L .ST 3 L QUAD .TAB 1 CRITERION\*[TB+] EVALUATION\*[TB+] COMMENTS .SP .TAB 1 Service\*[TB+] Good\*[TB+] Many clients specifically request support from Joe by name. .SP .TAB 1 Punctuality\*[TB+] Satisfactory\*[TB+] Tends to arrive after 8:00am, but often works through lunch hour. .SP .TAB 1 Team spirit\*[TB+] Needs work\*[TB+] Persistently gives higher priority to helping clients than respecting organizational hierarchy. .TQ

Try setting this up and processing it with
pdfmom filename.mom > filename.pdf and previewing the .pdf file.

Now, change the point size of the above sample to 12 and preview it again. You’ll see that the tab structure remains identical (tab 1=CRITERION, tab 2=EVALUATION, tab 3=space remaining, and the gutter between tabs is still 1 pica), while the position and length of the tabs have altered because of the new point size.

Now try increasing the gutters to 2 picas (\*[FWD 24p] or \*[FWD 2P] instead of \*[FWD 12p]). Preview the file again, and notice how the tab structure remains the same, but the gutters are wider.

Tabs macros

  • TAB_SET – create typesetting tabs
  • \*[ST]...\*[STX] – inline escapes for marking String Tabs
  • ST – set String Tabs
  • TAB – call tabs
  • TN – Tab Next; call next tab in sequence
  • \*[TB+] – inline escape to call next tab in sequence
  • TQ – Tab Quit

Set up typesetting tabs

Macro: TAB_SET <tab number> <indent> <length> L | R | C | J [ QUAD ]

• <indent> and <length> require a unit of measure

TAB_SET creates typesetting tabs that later can be called with .TAB. Typesetting tabs are numbered, and defined by an indent, a length, and a quad direction, hence TAB_SET has four required arguments:

  • a tab number
  • an indent (measured from the left margin of the page, or, if you’re already in a tab, from the left margin of the tab)
  • a length
  • a direction

To set up a centred tab 6 picas long and 9 points from the left margin, you’d enter
.TAB_SET 1 9p 6P C The tab number in the above (”1”) is simply an identifier. It could have been 4, or 17, or 296. There’s no need to set up tabs in numerical sequence.

By default, tabs are in nofill mode, meaning you can enter text in tabs on a line-for-line basis without having to use the BR macro. If you want a tab to be filled, pass the optional argument QUAD, which will make the tab behave as if you’d entered .QUAD L | R | C.

For justified tabs, simply pass the argument J (without the QUAD argument), like this:
.TAB 1 9p 6P J Once tabs are set, they can be called at any time with the TAB <n> macro, where <n> is the number of the desired tab.

You can set up any number of typesetting tabs. However, be aware that string tabs are also called with TAB <n>, so be careful that you don’t set up a typesetting tab numbered, say, 4, when you already have a string tab numbered 4. Every tab, typesetting or string, must have a unique numeric identifier.

Note: If you use TAB_SET while you’re currently inside a tab, the indent argument is the distance from the tab’s left margin, not the left margin of the page. Therefore, you should exit tabs (with .TQ) before creating new tabs (unless, of course, you want to set up a tab structure within the confines of an existing tab).

IMPORTANT: Turn all indents off (see Indents) before setting up tabs with TAB_SET, or mom may get confused.

Mark positions of string tabs

Inlines: \*[ST<number>]...\*[ST<number>X]

The quad direction must be LEFT or JUSTIFY (see QUAD and JUSTIFY) or the no-fill mode set to LEFT in order for these inlines to function properly. Please see IMPORTANT, below.

String tabs need to be marked off with inline escapes before being set up with the ST macro. Any input line may contain string tab markers. <number>, above, means the numeric identifier of the tab. The following shows a sample input line with string tab markers.
\*[ST1]Now is the time\*[ST1X] for all \*[ST2]good men\*ST2X] to come to the aid of the party. String tab 1 begins at the start of the line and ends after the word “time”. String tab 2 starts at “good” and ends after “men”. Inline escapes (eg font or point size changes, or horizontal movements, including padding) are taken into account when mom determines the position and length of string tabs.

Up to nineteen string tabs may be marked (not necessarily all on the same line, of course), and they must be numbered between 1 and 19.

Once string tabs have been marked in input lines, they have to be “set” with .ST, after which they may be called, by number, with .TAB.

Note: Lines with string tabs marked off in them are normal input lines, ie they get printed, just like any input line. If you want to set up string tabs without the line printing, use the SILENT macro.

IMPORTANT: Owing to the way groff processes input lines and turns them into output lines, it is not possible for mom to “guess” the correct starting position of string tabs marked off in lines that are centered or set flush right.

Equally, she cannot guess the starting position if a line is fully justified and broken with SPREAD.

In other words, in order to use string tabs, LEFT must be active, or, if QUAD LEFT or JUSTIFY are active, the line on which the string tabs are marked must be broken “manually” with .BR (but not .SPREAD).

To circumvent this behaviour, I recommend using the PAD to set up string tabs in centered or flush right lines. Say, for example, you want to use a string tab to underscore the text of a centered line with a rule. Rather than this,
.CENTER \*[ST1]A line of text\*[ST1X]\c .EL .ST 1 .TAB 1 .PT_SIZE 24 .ALD 3p \*[RULE] .RLD 3p .TQ you should do:
.QUAD CENTER .PAD "#\*[ST1]A line of text\*[ST1X]#" .EL .ST 1 .TAB 1 .PT_SIZE 24 .ALD 3p \*[RULE] \" Note that you can’t use \*[UP ] or \*[DOWN] with \*[RULE] .RLD 3p .TQ

Set string tabs

Macro: ST <tab number> L | R | C | J [ QUAD ]

After string tabs have been marked off on an input line (see \*[ST]...\*[STX]), you need to “set” them by giving them a direction and, optionally, the QUAD argument. In this respect, ST is like TAB_SET except that you don’t have to give ST an indent or a line length (that’s already taken care of, inline, by \*[ST]...\*[STX]). If you want string tab 1 to be left, enter
.ST 1 L If you want it to be left and filled, enter
.ST 1 L QUAD If you want it to be justified, enter
.ST 1 J See the Quickie tutorial on string tabs for a full explanation of setting up string tabs.

Call tabs

Macro: TAB <tab number>

Alias: TB

After tabs have been defined (either with TAB_SET or ST), TAB moves to whatever tab number you pass it as an argument. For example,
.TAB 3 moves you to tab 3.

Note: TAB breaks the line preceding it and advances 1 linespace. Hence,
.TAB 1 A line of text in tab 1. .TAB 2 A line of text in tab 2. produces, on output
A line of text in tab 1. A line of text in tab 2. If you want the tabs to line up, use TN (Tab Next) or, more conveniently, the inline escape \*[TB+]:
.TAB 1 A line of text in tab 1.\*[TB+] A line of text in tab 2. which produces
A line of text in tab 1. A line of text in tab 2. If the text in your tabs runs to several lines, and you want the first lines of each tab to align, you must use the multi-column macros.

Additional note: Any indents in effect prior to calling a tab are automatically turned off by TAB. If you were happily zipping down the page with a left indent of 2 picas turned on, and you call a tab whose indent from the left margin is 6 picas, your new distance from the left margin will be 6 picas, not 6 picas plus the 2 pica indent.

Tab Next

Macro: TN
Inline escape: \*[TB+]

TN moves over to the next tab in numeric sequence (tab n+1) without advancing on the page. See the NOTE in the description of the TAB macro for an example of how TN works.

In tabs that aren’t given the QUAD argument when they’re set up with TAB_SET or ST, you must terminate the line preceding .TN with the \c inline escape. Conversely, if you did give a QUAD argument to TAB_SET or ST, the \c must not be used.

If you find remembering whether to put in the \c bothersome, you may prefer to use the inline escape alternative to .TN, \*[TB+], which works consistently regardless of the fill mode.

Note: You must put text in the input line immediately after TN. Stacking of TN’s is not allowed. In other words, you cannot do
.TAB 1 Some text\c .TN Some more text\c .TN .TN Yet more text The above example, assuming tabs numbered from 1 to 4, should be entered
.TAB 1 Some text\c .TN Some more text\c .TN \&\c .TN Yet more text \& is a zero-width, non-printing character that groff recognizes as valid input, hence meets the requirement for input text following .TN.

Tab Quit

Macro: TQ

TQ takes you out of whatever tab you were in, advances 1 linespace, and restores the left margin, line length, quad direction and fill mode that were in effect prior to invoking any tabs.


Multiple columns

Tabs are not by nature columnar, which is to say that if the text inside a tab runs to several lines, calling another tab does not automatically move to the baseline of the first line in the previous tab. To demonstrate:
.TAB 1 Carrots Potatoes Broccoli .TAB 2 $1.99/5 lbs $0.25/lb $0.99/bunch produces, on output
Carrots Potatoes Broccoli $1.99/5 lbs $0.25/lb $0.99/bunch The multi-column macros allow you to set tabs in columnar fashion, rather than line by line. When you invoke multi-column mode (with .MCOMulti-Column On), mom saves the position of the current baseline. .MCR (Multi-Column Return) at any point while multi-columns are on returns you to the saved position. Exiting multi-columns (.MCXMulti-Column eXit) quits the current tab (if you’re in one) and moves you to the bottom of the longest column. (Note that you do not have to use multi-columns in conjunction with tabs.)

Using our example above, but setting it in multi-column mode,
.MCO .TAB 1 Carrots Potatoes Broccoli .MCR .TAB 2 $1.99/5 lbs $0.25/lb $0.99/bunch .MCX produces
Carrots $1.99/5 lbs Potatoes $0.25/lb Broccoli $0.99/bunch

Note: Do not confuse MCO with the COLUMNS macro in the document processing macros.

Multi-columns macros

  • MCO – begin multi-column setting
  • MCR – return to top of column
  • MCX – exit multi-columns

Begin multi-column setting

Macro: MCO

MCO (Multi-Column On) is the macro you use to begin multi-column setting. It marks the current baseline as the top of your columns, for use later with MCR. See the introduction to columns for an explanation of multi-columns and some sample input.

Note: Do not confuse MCO with the COLUMNS macro in the document processing macros.

Return to top of column

Macro: MCR

Once you’ve turned multi-columns on (with .MCO), .MCR, at any time, returns you to the top of your columns.

Exit multi-columns

Macro: MCX [ <distance to advance below longest column> ]

• Optional argument requires a unit of measure

MCX takes you out of any tab you were in (by silently invoking .TQ) and advances to the bottom of the longest column.

Without an argument, MCX advances 1 linespace below the longest column. Linespace, in this instance, is the leading in effect at the moment MCX is invoked.

If you pass the <distance> argument to MCX, it advances 1 linespace below the longest column (see above) PLUS the distance specified by the argument. The argument requires a unit of measure; therefore, to advance an extra 6 points below where MCX would normally place you, you’d enter
.MCX 6p

Note: If you wish to advance a precise distance below the baseline of the longest column, use MCX with an argument of 0 (zero; no unit of measure required) in conjunction with the ALD macro, like this:
.MCX 0 .ALD 24p

The above advances to precisely 24 points below the baseline of the longest column.


Indents

With mom’s indents, you can indent from the left, the right, or both margins. In addition, mom provides temporary left indents (ie only one line is indented, as at the start of a paragraph) and “hanging” left indents (the reverse of a temporary indent; the first line isn’t indented, subsequent lines are).

How mom handles indents

Mom provides five kinds of indents: left, right, both, temporary, and hanging. Each is invoked by its own name:

  • IL – Indent Left
  • IR – Indent Right
  • IB – Indent Both
  • HI – Hanging Indent
  • TI – Temporary Indent

In addition, there are four macros to control exiting from indents:

  • IQ – quit all active indents
  • ILX – exit indent style left
  • IRX – exit indent style right
  • IBX – exit indent style both

This section deals exclusively with IL, IR and IB. For an explanation of hanging and temporary indents—how they work and how to use them—see Hanging indents and Temporary indents.

The first time you invoke any of mom’s indents, you must supply a measure. For example,
.IL 2P indents text 2 picas from the left margin (or current tab indent).

When you want to exit the above indent, use either
.IQ or .ILX The next time you want the same indent, invoke it without the argument, like this:
.IL As you can see, once you’ve supplied a measure to an indent macro, mom stores the value, obviating the need to repeat it on subsequent invocations. And mom doesn’t just store the measure—she hangs on to it tenaciously. Arguments passed to IL, IR and IB are additive. Consider the following:
.LL 20P .IR 2P \"Indent right by 2 picas A first block of text... ... ... .IQ \"Turn indent off A second block of text... ... ... .IR 2P \"Indent right by an additional 2 picas (ie 4 picas) A third block of text... ... ... The first block of text is right indented by 2 picas (ie the line length is shortened by 2 picas to 18 picas). The second block of text, after IQ, is, as you’d expect, set to the full measure. The third block of text—the one to pay attention to—is not right indented by 2 picas, but rather by 4 picas. Mom adds the value of arguments to IL, IR and IB to whatever value is already in effect.

If you wanted the third block of text in the example above to be right indented by just 2 picas (the original measure given to IR), you would enter .IR without an argument.

Because indent arguments are additive, putting a minus sign in front of the argument can be used to subtract from the current value. In the following example, the first line is indented 18 points, the second is indented 36 points (18 + 18), and the third is again indented 18 points (36 - 18).
.IL 18p \"Indent left by 18 points = 18 points Now is the time .IL 18p \"Indent left by 18 points more = 36 points for all good men to come .IL -18p \"Indent left by 18 points less = 18 points to the aid of the party. Sometimes, you may want to clear out the stored indent values—let mom start indenting with a clean slate, as it were. Giving the optional argument CLEAR to any of the “indent quit” macros resets them to zero.

  • IQ CLEAR – quit and clear all indents
  • ILX CLEAR – quit and clear indent style left
  • IRX CLEAR – quit and clear indent style right
  • IBX CLEAR – quit and clear indent style both

Indent styles may be combined and manipulated separately. You could, for example, have a left indent of 4 picas and a right indent of 6 picas and control each separately, as in the following example.
.IL 4P \"Indent left 4 picas .IR 6P \"Indent right 6 picas Some text .IRX \"Turn off the right indent only More text \"Text is still indented 4 picas left If, at .IRX, you wanted the text afterwards to have no indents (either left or right), you would enter .IQ, which exits all indent styles at once.

A word of advice: Indents are best used only when you have a compelling reason not to change the current left margin or line length. In many instances where indents might seem expedient, it’s better to use tabs, or actually change the left margin or the line length. Mom’s indenting macros are flexible and powerful, but easy to get tangled up in.

Note: see the section Typesetting macros during document processing for information and advice on using indents with the document processing macros.

Indents macros

Indent left

Macro: IL [ <measure> ]

• The optional argument requires a unit of measure

IL indents text from the left margin of the page, or if you’re in a tab, from the left edge of the tab. Once IL is on, the left indent is applied uniformly to every subsequent line of text, even if you change the line length.

The first time you invoke .IL, you must give it a measure. Subsequent invocations with a measure add to the previous measure. A minus sign may be prepended to the argument to subtract from the current measure. The \w inline escape may be used to specify a text-dependent measure, in which case no unit of measure is required. For example,
.IL \w'margarine' indents text by the width of the word “margarine”.

With no argument, IL indents by its last active value. See the brief explanation of how mom handles indents for more details.

Note: Calling a tab (with .TAB <n>) automatically cancels any active indents.

Additional note: Invoking IL automatically turns off IB.

Indent right

Macro: IR [ <measure> ]

• The optional argument requires a unit of measure

IR indents text from the right margin of the page, or if you’re in a tab, from the end of the tab.

The first time you invoke .IR, you must give it a measure. Subsequent invocations with a measure add to the previous indent measure. A minus sign may be prepended to the argument to subtract from the current indent measure. The \w inline escape may be used to specify a text-dependent measure, in which case no unit of measure is required. For example,
.IR \w'jello' indents text by the width of the word “jello”.

With no argument, IR indents by its last active value. See the brief explanation of how mom handles indents for more details.

Note: Calling a tab (with .TAB <n>) automatically cancels any active indents.

Additional note: Invoking IR automatically turns off IB.

Indent both

Macro: IB [ <left measure> <right measure> ]

• The optional arguments require a unit of measure

IB allows you to set or invoke a left and a right indent at the same time.

At its first invocation, you must supply a measure for both indents; at subsequent invocations when you wish to supply a measure, both must be given again. As with IL and IR, the measures are added to the values previously passed to the macro. Hence, if you wish to change just one of the values, you must give an argument of zero to the other.

A word of advice: If you need to manipulate left and right indents separately, use a combination of IL and IR instead of IB. You’ll save yourself a lot of grief.

A minus sign may be prepended to the arguments to subtract from their current values. The \w inline escape may be used to specify text-dependent measures, in which case no unit of measure is required. For example,
.IB \w’margarine’ \w'jello' left indents text by the width of the word “margarine” and right indents by the width of “jello”.

Like IL and IR, IB with no argument indents by its last active values. See the brief explanation of how mom handles indents for more details.

Note: Calling a tab (with .TAB <n>) automatically cancels any active indents.

Additional note: Invoking IB automatically turns off IL and IR.

Temporary (left) indent

Macro: TI [ <measure> ]

• The optional argument requires a unit of measure

A temporary indent is one that applies only to the first line of text that comes after it. Its chief use is indenting the first line of paragraphs. (Mom’s PP macro, for example, uses a temporary indent.)

The first time you invoke .TI, you must give it a measure. If you want to indent the first line of a paragraph by, say, 2 ems, do
.TI 2m Subsequent invocations of TI do not require you to supply a measure; mom keeps track of the last measure you gave it.

Because temporary indents are temporary, there’s no need to turn them off.

IMPORTANT: Unlike IL, IR and IB, measures given to TI are NOT additive. In the following example, the second .TI 2P is exactly 2 picas.
.TI 1P The beginning of a paragraph... .TI 2P The beginning of another paragraph...

Hanging indent

Macro: HI [ <measure> ]

• The optional argument requires a unit of measure

A hanging indent looks like this:
The thousand injuries of Fortunato I had borne as best I could, but when he ventured upon insult, I vowed revenge. You who so well know the nature of my soul will not suppose, however, that I gave utterance to a threat, at length I would be avenged... The first line of text “hangs” outside the left margin.

In order to use hanging indents, you must first have a left indent active (set with either .IL or .IB). Mom will not hang text outside the left margin set with .L_MARGIN or outside the left margin of a tab.

The first time you invoke .HI, you must give it a measure. If you want the first line of a paragraph to hang by, say, 1 pica, do
.IL 1P .HI 1P Subsequent invocations of HI do not require you to supply a measure; mom keeps track of the last measure you gave it.

Generally speaking, you should invoke HI immediately prior to the line you want hung (ie without any intervening control lines). And because hanging indents affect only one line, there’s no need to turn them off.

IMPORTANT: Unlike IL, IR and IB, measures given to HI are NOT additive. Each time you pass a measure to HI, the measure is treated literally.

Recipe: A numbered list using hanging indents

Note: mom has macros for setting lists (see Nested lists). This recipe exists to demonstrate the use of hanging indents only.

.PAGE 8.5i 11i 1i 1i 1i 1i .FAMILY T .FT R .PT_SIZE 12 .LS 14 .JUSTIFY .KERN .SS 0 .IL \w'\0\0.' .HI \w'\0\0.' 1.\0The most important point to be considered is whether the answer to the meaning of Life, the Universe, and Everything really is 42. We have no-one’s word on the subject except Mr. Adams’. .HI 2.\0If the answer to the meaning of Life, the Universe, and Everything is indeed 42, what impact does this have on the politics of representation? 42 is, after all not a prime number. Are we to infer that prime numbers don’t deserve equal rights and equal access in the universe? .HI 3.\0If 42 is deemed non-exclusionary, how do we present it as the answer and, at the same time, forestall debate on its exclusionary implications? First, we invoke a left indent with a measure equal to the width of 2 figures spaces plus a period (using the \w inline escape). At this point, the left indent is active; text afterwards would normally be indented. However, we invoke a hanging indent of exactly the same width, which hangs the first line (and first line only!) to the left of the indent by the same distance (in this case, that means “out to the left margin”). Because we begin the first line with a number, a period, and a figure space, the actual text (“The most important point...”) starts at exactly the same spot as the indented lines that follow.

Notice that subsequent invocations of .HI don’t require a measure to be given.

Paste the example above into a file and preview it with
pdfmom filename.mom > filename.pdf to see hanging indents in action.

Quitting indents

Macro: IQ [ CLEAR ] (quit any/all indents — see IMPORTANT NOTE)

Macro: ILX [ CLEAR ] (exit Indent Left)
Macro: IRX [ CLEAR ] (exit Indent Right)
Macro: IBX [ CLEAR ] (exit Indent Both)

IMPORTANT NOTE: The original macro for quitting all indents was IX. This usage has been deprecated in favour of IQ. IX will continue to behave as before, but mom will issue a warning to stderr indicating that you should update your documents.

As a consequence of this change, ILX, IRX and IBX may now also be invoked as ILQ, IRQ and IBQ. Both forms are acceptable.

Without an argument, the macros to quit indents merely restore your original margins and line length. The measures stored in the indent macros themselves are saved so you can call them again without having to supply a measure.

If you pass these macros the optional argument CLEAR, they not only restore your original left margin and line length, but also clear any values associated with a particular indent style. The next time you need an indent of the same style, you have to supply a measure again.

.IQ CLEAR, as you’d suspect, quits and clears the values for all indent styles at once.


Back to Table of Contents Top Next: Goodies

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/using.html0000644000000000000000000000013212426110213021416 xustar000000000000000030 mtime=1415090315.616519109 30 atime=1415090315.616519109 30 ctime=1415090315.616519109 groff-1.22.3/contrib/mom/momdoc/using.html0000644000175000001440000002525212426110213020262 0ustar00wlusers00000000000000 Using mom
Back to Table of Contents Next: The typesetting macros

Using mom


Introduction

As explained in the section What is mom?, mom can be used in two ways: for straightforward typesetting or for document processing. The difference between the two is that in straightforward typesetting, every macro is a literal instruction that determines precisely how text following it will look. Document processing, on the other hand, uses markup tags (e.g. .PP for paragraphs, .HEADING for different levels of heads, .FOOTNOTE for footnotes, etc.) that perform typesetting operations automatically.

You tell mom that you want to use the document processing macros with the START macro. After START, mom determines the appearance of text following the markup tags automatically, although you, the user, can easily change how the tags are interpreted.

How to input mom’s macros

Regardless of whether you’re preparing a term paper or making a flyer for your lost dog, the following apply.

  1. You need a good text editor for inputting mom files.
    I cannot recommend highly enough that you use an editor that lets you write syntax highlighting rules for mom’s macros and inline escapes. Simply colourizing macros and inlines to half-intensity can be enough to make text stand out clearly from formatting commands. Mom herself comes with a complete set of syntax highlighting rules for the vim editor.
  2. Macros begin with a period (dot) at the left margin of your text editor's screen, and must be entered in upper case (capital) letters.
  3. Macro arguments are separated from the macro itself by spaces. Multiple arguments to the same macro are separated from each other by spaces. Any number of spaces may be used.
  4. Arguments to a macro must appear on the same line as the macro.
    If the argument list is very long, you may use the backslash character (\) to break the line visually. From groff’s point of view, the backslash and newline are invisible. Thus, for example, .HEADING_STYLE 1 FAMILY Garamond FONT B SIZE +2 and .HEADING_STYLE 1 \ FAMILY Garamond \ FONT B \ SIZE +2 are exactly equivalent.
  5. Any argument (except a string argument) that is not a digit must be entered in upper case (capital) letters.
  6. Any argument that requires a plus or minus sign must have the plus or minus sign prepended to the argument with no intervening space (e.g. +2).
  7. Any argument that requires a unit of measure must have the unit appended directly to the argument, with no intervening space (e.g. .5i).
  8. String arguments, in the sense of this manual, must be surrounded by double-quotes (eg "text"). Multiple string arguments are separated from each other by spaces (with each argument surrounded by double-quotes).
    If a string argument becomes uncomfortably long, you may break it into two or more lines with the backslash character. .SUBTITLE "An In-Depth Consideration of the \ Implications of Forty-Two as the Answer to Life, \ The Universe, and Everything"

Tip: It’s important that your documents be easy to read and understand in a text editor. One way to achieve this is to group macros that serve a similar purpose together, and separate them from other groups of macros with a comment line. In groff, that’s done with \# (backslash-pound) or .\" (period-backslash-doublequote) on a line by itself. Either instructs groff to ignore the remainder of the line, which may or may not contain text. Consider the following, which is a template for starting the chapter of a book.
\# Reference/meta-data .TITLE "My Pulitzer Novel" .AUTHOR "Joe Blow" .CHAPTER 1 \# Template .DOCTYPE CHAPTER .PRINTSTYLE TYPESET \# Type style .FAM P .PT_SIZE 10 .LS 12 \# .START You may also, if you wish, add a comment to the end of a line with \" (no period), like this:
.FAMILY P \" Maybe Garamond instead?

Processing and viewing documents

The most basic command line usage for processing a file formatted with the mom macros is
groff -mom filename.mom > filename.ps which processes the .mom file and dumps the output into a viewable/printable PostScript file.

Mom and PDF

Adobe's Portable Document Format (PDF) has largely supplanted PostScript, of which it is a subset, as the standard for typeset documents. While printed versions of documents in either format will be identical, PDF documents, when viewed at the screen, may also contain clickable links and a number of other special features.

As of version 2.0, mom supports full PDF integration. The creation and processing of mom files into PostScript documents remains unchanged from 1.x, but the expected and recommended format of final documents is now PDF.

The manual, Producing PDFs with groff and mom, explains and demonstrates the PDF-specific macros that are available in mom, as well as the use of pdfmom, the recommended way to process mom files.

pdfmom

Groff provides more than one way to generate PDF documents, but when processing files formatted with the mom macros, pdfmom is the recommended and most robust way to do it:
pdfmom filename.mom > filename.pdf pdfmom is a wrapper around groff, and accepts all groff's command line options as listed in the groff manpage. Full usage is explained in the manual, Producing PDFs with groff and mom.

PDF links in a document, including linked entries in the Table of Contents, are identified by colour. When printing documents with links, you will most likely not want the link text coloured. The groff option, -c, disables colour throughout a document; thus, when preparing a document for printing, you should use:
pdfmom -c filename.mom > filename.pdf pdfmom tends to produce large files. You may reduce their size by piping them through ps2pdf:
pdfmom -c filename.mom | ps2pdf - filename.pdf Be aware, though, that files piped through ps2pdf will lose some pdf metadata, notably the document window title set with PDF_TITLE.

Automatic previewing of documents

Most PDF viewers have a “Watch File” option, which automaticaly updates a displayed document whenever there's a change. This is useful when preparing documents that require judgment calls. I recommend creating a keymapping in your text editor that both saves the mom file and processes it with pdfmom. The displayed PDF then automatically reflects whatever changes you save to the mom file.


Back to Table of Contents Top Next: The typesetting macros

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/docprocessing.html0000644000000000000000000000013212426110213023133 xustar000000000000000030 mtime=1415090315.613519146 30 atime=1415090315.613519146 30 ctime=1415090315.613519146 groff-1.22.3/contrib/mom/momdoc/docprocessing.html0000644000175000001440000037414712426110213022011 0ustar00wlusers00000000000000 Mom -- Document Processing, Introduction and Setup
Back to Table of Contents Next: The document element tags

Document processing with mom


Table of contents



Introduction to document processing

Document processing with mom uses markup tags to identify document elements such as headings, paragraphs, blockquotes, and so on. The tags are, of course, macros, but with sensible, readable names that make them easy to grasp and easy to remember. (And don’t forget: if you don’t like the “official” name of a tag — too long, cumbersome to type in, not “intuitive” enough — you can change it with the ALIAS macro.)

In addition to the tags themselves, mom has an extensive array of macros that control how they look and behave.

Setting up a mom doc is a simple, four-part procedure. You begin by entering metadata about the document itself (title, subtitle, author, etc.). Next, you tell mom what kind of document you’re creating (eg chapter, letter, abstract, etc...) and what kind of output you want (typeset, typewritten, draft-style, etc) — essentially, templates. Thirdly, you make as many or as few changes to the templates as you wish; in other words, create a style sheet. Lastly, you invoke the START macro. Voilà! You’re ready to write.

Document defaults

As is to be expected, mom has defaults for everything. If you want to know a particular default, read about it in the description of the pertinent tag.

I fear the following may not be adequately covered in the documentation, so just in case:

  • the paper size is 8.5x11 inches
  • the left and right margins are 1-inch
  • the top and bottom margins for document text are plus/minus visually 1-inch
  • pages are numbered; the number appears centred, at the bottom, surrounded by hyphens ( eg -6- )
  • the first page of a document begins with a document header
  • subsequent pages have page headers with a rule underneath

Important note on leading/spacing and bottom margins

Mom takes evenly-aligned bottom margins in running text very seriously. Only under a very few (exceptional) circumstances will she allow a bottom margin to “hang” (ie to fall short).

In order to ensure even bottom margins, mom uses the “base” document leading in effect at the start of running text on each page (ie the leading used in paragraphs) to calculate the spacing of every document element. Prior to invoking START, this is set with the typesetting macro LS, afterwards with the document control macro DOC_LEAD.

Because mom relies so heavily on the base document leading, any change to the leading or spacing on a page will almost certainly have undesirable consequences on that page’s bottom margin unless the change is fully compensated for elsewhere on the page.

In other words, if you add a few points of space somewhere on a page, you must subtract the same number of points somewhere else on that same page, and vice versa.

If it’s a question of adding or subtracting full line spaces between or within document elements, you can do so by using the “vunit of measure with whatever spacing macro you choose — ALD, RLD, SPACE — and mom won’t object. “v” means “the current leading”, so she isn’t confused by it. And since “v” accepts decimal fractions, you can add/subtract half linespaces and quarter linespaces with “v” as well, provided you compensate for the fractional linespace somewhere else on the page.

If all this seems like too much work, mom provides a special macro to get you out of trouble if you’ve played around with leading and/or spacing. The macro is called SHIM (like those little pieces of wood carpenters use to get their work even, level and snug), and it’s described below.

SHIM

Macro: SHIM

SHIM doesn’t take any argument. Use it whenever you’ve played around with the leading or spacing on a page and you need to get mom’s document leading back on track.

For example, say you want to insert an image into a document with PSPIC. Images and graphics aren’t usually conveniently sized in multiples of the document leading, which means that when you insert the picture, you disrupt mom’s ordered placement of baselines on the page. This will certainly result in a bottom margin that doesn’t match the bottom margins of your document’s other pages.

The solution is to insert SHIM after the image, like this:
<text> .PSPIC <args> .SHIM <text>

SHIM instructs mom to insert as much or a little space after the picture as is needed to ensure that the baseline of the next output line falls where mom would have put it had you not disrupted the normal flow of output lines with the picture.

And say, on previewing the above example, you find the image doesn’t centre nicely between the lines of text, you can adjust the image position by using ALD or RLD before PSPIC. To demonstrate,
<text> .RLD 3p .PSPIC <args> .SHIM <text> which raises the image slightly and thereby balances the whitespace around it.

You may sometimes find the amount of space generated by SHIM looks too big, whether inserted manually into a document or as a result of automatic shimming (see immediately below). The situation occurs when the amount of shimming applied comes close to the leading currently in effect, making it seem as if there’s one linespace too much whitespace. The solution is simply to add .SPACE -1v or .RLD 1v to the document immediately after .SHIM. (Both .SPACE -1v and .RLD 1v back up by one linespace.)

Automatic shimming of headings, quotes, blockquotes, PDF images, and floats

By default, mom automatically applies shimming

  • before headings
  • around quotes and blockquotes
  • after PDF images, floats, and tables

In documents where paragraphs are not spaced, automatic shimming is almost always desirable. In documents where paragraphs are spaced by an amount less than the document leading, or which have numerous graphics, headings, and quotes, you may want to disable shimming, either globally or on a tag-by-tag basis.

To disable automatic shimming, invoke the macro, .NO_SHIM, either in the style sheet section of your document (ie after PRINTSTYLE and before START), or just before HEADING, QUOTE, BLOCKQUOTE, PDF_IMAGE FLOAT. or TS.

Note: .NO_SHIM also disables the SHIM macro itself.

To re-enable automatic shimming and the SHIM macro itself, use .NO_SHIM OFF (or QUIT, END, X, etc).


Preliminary document setup

Tutorial – Setting up a mom document

There are four parts to setting up a mom doc (three, actually, with one optional). Before we proceed, though, be reassured that something as simple as
.TITLE "By the Shores of Lake Attica" .AUTHOR "Rosemary Winspeare" .PRINTSTYLE TYPESET .START produces a beautifully typeset 8.5x11 document, with a docheader at the top of page 1, page headers with the title and author on subsequent pages, and page numbers at the bottom of each page. In the course of the document, headings, citations, quotes, epigraphs, and so on, all come out looking neat, trim, and professional.

For the purposes of this tutorial, we’re going to set up a short story—My Pulitzer Winner—by Joe Blow. Thankfully, we don’t have to look at story itself, just the setup. Joe wants the document

  • to be draft 7, revision 39;
  • to use the DEFAULT template;
  • to print as draft-style output (instead of final-copy output);
  • to be typeset, in Helvetica, 12 on 14, rag-right;
  • to have footers instead of headers;
  • to use a single asterisk for author linebreaks.

Joe Blow has no taste in typography. His draft won’t look pretty, but this is, after all, a tutorial; we’re after examples, not beauty.

Step 1

The first step in setting up any document is giving mom some reference information (metadata). The reference macros are:

  • TITLE
  • SUBTITLE
  • AUTHOR
  • CHAPTER – chapter number
  • CHAPTER_TITLE – chapter name
  • DRAFT – the draft number
  • REVISION – the revision number
  • COPYRIGHT – only used on cover pages
  • MISC – only used on cover pages
  • DOCTITLE
  • COVERTITLE
  • DOC_COVERTITLE
  • PDF_TITLE

You can use as many or as few as you wish, although at a minimum, you’ll probably fill in TITLE (unless the document’s a letter) and AUTHOR. Order doesn’t matter. You can separate the arguments from the macros by any number of spaces. The following are what you’d need to start Joe Blow’s story.
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39

Step 2

Once you’ve given mom the reference information she needs, you tell her how you want your document formatted. What kind of document is it? Should it be typeset or typewritten? Is this a final copy (for the world to see) or just a draft? Mom calls the macros that answer these questions “the docstyle macros.”, and they're essentially templates.

  • PRINTSTYLE—typeset or typewritten
  • DOCTYPE—the type of document (default, chapter, user-defined, letter)
  • COPYSTYLE —draft or final copy

Mom has defaults for DOCTYPE and COPYSTYLE; if they’re what you want, you don’t need to include them. However, PRINTSTYLE has no default and must be present in every formatted document. If you omit it, mom won’t process the document AND she’ll complain (both to stderr and as a single printed sheet with a warning). Moms—they can be so annoying sometimes. <sigh>

Adding to what we already have, the next bit of setup for Joe Blow’s story looks like this:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .DOCTYPE DEFAULT \"Superfluous; mom uses DOCTYPE DEFAULT by default .PRINTSTYLE TYPESET .COPYSTYLE DRAFT Notice the use of the comment line ( \# ), a handy way to keep groups of macros visually separated for easy reading in a text editor.

Step 3

This step—completely optional—is where you, the user, take charge. Mom has reasonable defaults for every document element and tag, but who’s ever satisfied with defaults? Use any of the typesetting macros here to change mom’s document defaults (paper size, margins, family, point size, line space, rag, etc), or use any of the document processing control macros. This is the style-sheet section of a document, and must come after the PRINTSTYLE directive. Failure to observe this condition will result in PRINTSTYLE overriding your changes.

Joe Blow wants his story printed in Helvetica, 12 on 14, rag right, with page footers instead of page headers and a single asterisk for the linebreak character. None of these requirements conforms to mom’s defaults for the chosen PRINTSTYLE (TYPESET), so we change them here. The setup for Joe Blow’s story now looks like this:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .DOCTYPE DEFAULT .PRINTSTYLE TYPESET .COPYSTYLE DRAFT \# .FAMILY H .PT_SIZE 12 .LS 14 .QUAD LEFT \"ie rag right .FOOTERS .LINEBREAK_CHAR *

Step 4

The final step in setting up a document is telling mom to start document processing. It’s a no-brainer, just the single macro, START. Other than PRINTSTYLE, it’s the only macro required for document processing.

Here’s the complete setup for My Pulitzer Winner:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .DOCTYPE DEFAULT .PRINTSTYLE TYPESET .COPYSTYLE DRAFT \# .FAMILY H .PT_SIZE 12 .LS 14 .QUAD LEFT \"ie rag right .FOOTERS .LINEBREAK_CHAR * \# .START As pointed out earlier, Joe Blow is no typographer. Given that all he needs is a printed draft of his work, a simpler setup would have been:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .PRINTSTYLE TYPEWRITE .COPYSTYLE DRAFT \# .START .PRINTSTYLE TYPEWRITE, above, means that Joe’s work will come out “typewritten, double-spaced”, making the blue-pencilling he (or someone else) is sure to do much easier (which is why many publishers and agents still insist on typewritten, double-spaced copy).

When J. Blow stops re-writing and decides to print off a final, typeset copy of his work for the world to see, he need only make two changes to the (simplified) setup:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .PRINTSTYLE TYPESET \"first change .COPYSTYLE FINAL \"second change \# .START In the above, .DRAFT 7, .REVISION 39, and .COPYSTYLE FINAL are actually superfluous. The draft and revision numbers aren’t used when COPYSTYLE is FINAL, and COPYSTYLE FINAL is mom’s default unless you tell her otherwise.

But... to judge from the number of drafts already, J. Blow may very well decide his “final” version still isn’t up to snuff. Hence, he might as well leave in the superfluous macros. That way, when draft 7, rev. 62 becomes draft 8, rev. 1, he’ll be ready to tackle his Pulitzer winner again.


The reference macros (metadata)

The reference macros give mom the metadata she needs to generate docheaders, page headers, and covers. They must go at the top of any file that uses mom’s document processing macros.

Reference macros

TITLE

Macro: TITLE "<title string>" ["<2nd line>" ["<3rd line>" ... ] ]

• Arguments must be enclosed in double-quotes

The title string can be caps or caps/lower-case; it’s up to you. In PRINTSTYLE TYPESET, the title will appear in the docheader exactly as you typed it. However, mom converts the title to all caps in page headers unless you turn that feature off (see HEADER_<POSITION>_CAPS). In PRINTSTYLE TYPEWRITE, the title always gets converted to caps.

TITLE accepts multiple arguments, each surrounded by double-quotes. Each argument is printed on a separate line, permitting you to create multi-line titles in your docheaders.

Note: If your DOCTYPE is CHAPTER, TITLE should be the title of the opus, not “CHAPTER whatever”.

DOCUMENT TITLE

Macro: DOCTITLE "<overall document title>" ["<2nd line>" ["<3rd line>" ... ] ]

• Arguments must be enclosed in double-quotes

Note: This macro should be used only if your DOCTYPE is DEFAULT (which is mom’s default). If your DOCTYPE is CHAPTER, use TITLE to set the overall document title for cover pages, document cover pages, and page headers or footers.

When you’re creating a single document, say, an essay or a short story, you have no need of this macro. TITLE takes care of all your title needs.

However if you’re collating a bunch of documents together, say, to print out a report containing many articles with different titles, or a book of short stories with different authors, you need DOCTITLE.

DOCTITLE tells mom the title of the complete document (as opposed to the title of each article or entitled section), and appears

  1. as the window title in PDF viewers (eg Okular or Evince)
  2. in the initial rightmost position of page headers in the document

Moreover, DOCTITLE does not appear in the PDF outline , as its presence in window title would make it redundant.

The doctitle string can be caps or caps/lower-case; it’s up to you. In PRINTSTYLE TYPESET, by default, the doctitle in page headers is all in caps, unless you turn that feature off (see HEADER_<POSITION>_CAPS). In PRINTSTYLE TYPEWRITE, the doctitle always gets converted to caps.

DOCTITLE accepts multiple arguments, each surrounded by double-quotes. Each argument is printed on a separate line, permitting you to create multi-line document titles for use on Covers and/or Doc covers.

Note: If your DOCTYPE is CHAPTER, you don’t need DOCTITLE. TITLE takes care of everything.

SUBTITLE

Macro: SUBTITLE [COVER | DOC_COVER] "<subtitle>" ["<2nd line>" ["<3rd line>" ... ] ]

• String arguments must be enclosed in double-quotes

The subtitle string can be caps or caps/lower-case. I recommend caps/lower case.

SUBTITLE accepts multiple arguments, each surrounded by double-quotes. Each argument is printed on a separate line, permitting you to create multi-line subtitles.

If the optional argument, COVER or DOC_COVER, is given to SUBTITLE, the remaining string arguments represent the subtitle that will appear on cover or document cover pages (see the Introduction to cover pages for a description of the difference between “document covers” and “covers”). Thus, it is possible to have differing subtitles appear on the document cover, the cover (“title”) page, and in the document header. An extreme example would be:
.SUBTITLE "The Docheader Subtitle" .SUBTITLE DOC_COVER "The Document Cover Subtitle" .SUBTITLE COVER "The Cover Subtitle" The first invocation of .SUBTITLE establishes the subtitle that appears in the docheader at the top of the first page of a document. The second invocation establishes the subtitle that appears on the document cover; the third establishes the subtitle that appears on the cover (“title”) page.

If you don’t require differing subtitles for doc cover and cover pages, .SUBTITLE, without the optional first argument, is sufficient, provided you give the word, SUBTITLE, as an argument to the macro DOC_COVER or COVER

AUTHOR

Macro: AUTHOR [COVER | DOC_COVER] "<author>" [ "<author2>" ["<author3>" ... ] ]

Alias: EDITOR

• String arguments must be enclosed in double-quotes

Each author string can hold as many names as you like, eg
.AUTHOR "Joe Blow" or
.AUTHOR "Joe Blow, Jane Doe" "John Hancock" Mom prints each string that’s enclosed in double-quotes on a separate line in the docheader, however only the first string appears in page headers. If you want mom to put something else in the author part of page headers (say, just the last names of a document’s two authors), redefine the appropriate part of the header (see header/footer control).

The strings can be caps or caps/lower-case. I recommend caps/lower case.

If the optional argument, COVER or DOC_COVER, is given to AUTHOR, the remaining string arguments represent the author(s) that will appear on cover or document cover pages (see the Introduction to cover pages for a description of the difference between “document covers” and “covers”). Thus, it is possible to have differing authors on the document cover, the cover (“title”) page, in the document first-page header and subsequent page headers/footers. An example might be:
.AUTHOR "Joe Blow" .EDITOR DOC_COVER "John Smith" "and" "Jane Doe" \" EDITOR is an alias for AUTHOR .AUTHOR COVER "Joe Blow" "(assisted by Jane Doe)" The first invocation of .AUTHOR establishes the author that appears in the docheader at the top of the first page of a document and in subsequent page headers/footers. The second invocation establishes the authors (editors, in this instance) that appear on the document cover; the third establishes the author(s) that appear(s) on the cover (“title”) page.

If you don’t require differing authors for doc cover and cover pages, .AUTHOR, without the optional first argument, is sufficient, provided you give the word, AUTHOR as an argument to the macro DOC_COVER or COVER

CHAPTER

Macro: CHAPTER <chapter number>

The chapter number can be in any form you like—a digit, a roman numeral, a word. If you choose DOCTYPE CHAPTER, mom prints whatever argument you pass CHAPTER beside the word, “Chapter”, as a single line docheader. She also puts the same thing in the middle of page headers.

Please note that if your argument to CHAPTER runs to more than one word, you must enclose the argument in double-quotes.

If you’re not using DOCTYPE CHAPTER, the macro can be used to identify any document as a chapter for the purpose of prepending a chapter number to numbered head elements, provided you pass it a numeric argument. See PREFIX_CHAPTER_NUMBER.

Chapter string

If you’re not writing in English, you can ask mom to use the word for “chapter” in your own language by telling her what it is with the CHAPTER_STRING macro, like this:
.CHAPTER_STRING "Chapître"

You can also use CHAPTER_STRING if you want “CHAPTER” (all caps) instead of “Chapter” (caps/lowercase) in the doc- and page-headers.

CHAPTER_TITLE

Macro: CHAPTER_TITLE "<chapter title>" ["<2nd line>" ["<3rd line>" ... ] ]

• Arguments must be enclosed in double-quotes

If, either in addition to or instead of “Chapter <n>” appearing at the top of chapters, you want your chapter to have a title, use CHAPTER_TITLE, with your title enclosed in double-quotes, like this:
.CHAPTER_TITLE "The DMCA Nazis"

CHAPTER_TITLE accepts multiple arguments, each surrounded by double-quotes. Each argument is printed on a separate line, permitting you to create multi-line chapter titles in your docheaders.

If you’ve used CHAPTER to give the chapter a number, both “Chapter <n>” and the chapter title will appear at the top of the chapter, like this:
Chapter 1 The DMCA Nazis In such a case, by default, only the chapter’s title will appear in the page headers, not “Chapter <n>”.

If you omit CHAPTER when setting up your reference macros, only the title will appear, both at the top of page one and in subsequent page headers.

The style of the chapter title can be altered by control macros, eg CHAPTER_TITLE_FAMILY, CHAPTER_TITLE_FONT, etc. The default family, font and point size are Times Roman, Bold Italic, 4 points larger than running text.

DRAFT

Macro: DRAFT <draft number>

DRAFT only gets used with COPYSTYLE DRAFT. If the COPYSTYLE is FINAL (the default), mom ignores DRAFT. DRAFT accepts both alphabetic and numeric arguments, hence it’s possible to do either
.DRAFT 2 or .DRAFT Two

Mom prints the argument to .DRAFT (ie the draft number) beside the word “Draft” in the middle part of page headers.

A small word of caution: If your argument to .DRAFT is more than one word long, you must enclose the argument in double-quotes.

You may, if you wish, invoke .DRAFT without an argument, in which case, no draft number will be printed beside “Draft” in headers or footers.

The draft string

If you’re not writing in English, you can ask mom to use the word for “draft” in your own language by telling her what it is with the DRAFT_STRING macro, like this:
.DRAFT_STRING "Jet"

Equally, DRAFT_STRING can be used to roll your own solution to something other than the word “Draft.” For example, you might want “Trial run alpha-three” to appear in the headers of a draft version. You’d accomplish this by doing
.DRAFT alpha-three .DRAFT_STRING "Trial run"

If you wanted only “Trial run” to appear, entering .DRAFT without an argument as well as .DRAFT_STRING "Trial run" is how you’d do it.

Note: If you define both a blank .DRAFT and a blank .DRAFT_STRING, mom skips the draft field in headers entirely. If this is what you want, this is also the only way to do it. Simply omitting invocations of .DRAFT and .DRAFT_STRING will result in mom using her default, which is to print “Draft <number>”.

REVISION

Macro: REVISION <revision number>

REVISION only gets used with COPYSTYLE DRAFT. If the COPYSTYLE is FINAL (the default), mom ignores the REVISION macro. REVISION accepts both alphabetic and numeric arguments, hence it’s possible to do either
.REVISION 2 or .REVISION Two

Mom prints the revision number beside the shortform “Rev.” in the middle part of page headers.

A small word of caution: If your argument to .REVISION is more than one word long, you must enclose the argument in double-quotes.

You may, if you wish, invoke .REVISION without an argument, in which case, no revision number will be printed beside "Rev." in headers or footers.

The revision string

If you’re not writing in English, you can ask mom to use the word for “revision,” or a shortform thereof, in your own language by telling her what it is with the REVISION_STRING macro, like this:
.REVISION_STRING "Rév."

Additionally, you may sometimes want to make use of mom’s COPYSTYLE DRAFT but not actually require any draft information. For example, you might like mom to indicate only the revision number of your document. The way to do that is to define an empty .DRAFT and .DRAFT_STRING in addition to .REVISION, like this:
.DRAFT .DRAFT_STRING .REVISION 2

Equally, if you want to roll your own solution to what revision information appears in headers, you could do something like this:
.DRAFT .DRAFT_STRING .REVISION "two-twenty-two" .REVISION_STRING "Revision"

The above, naturally, has no draft information. If you want to roll your own .DRAFT and/or .DRAFT_STRING as well, simply supply arguments to either or both.

Macro: COPYRIGHT [COVER | DOC_COVER] "<copyright info>"

• Argument must be enclosed in double-quotes

The argument passed to COPYRIGHT is only used on cover or doc cover pages, and then only if the argument COPYRIGHT is passed to COVER or DOC_COVER. Do not include the copyright symbol in the argument passed to COPYRIGHT; mom puts it in for you.

If the optional argument, COVER or DOC_COVER, is given to COPYRIGHT, the string argument represents the copyright information that will appear on cover or document cover pages (see the Introduction to cover pages for a description of the difference between “document covers” and “covers”). Thus, it is possible to have differing copyright information on the document cover and on the cover (“title”) page. An example might be:
.COPYRIGHT DOC_COVER "2010 John Smith and Jane Doe" .COPYRIGHT COVER "2008 Joe Blow" The first invocation of .COPYRIGHT establishes the copyright information that appears on the document cover; the second establishes the copyright information that appears on the cover (“title”) page.

If you don’t require differing copyright information for doc cover and cover pages, .COPYRIGHT, without the optional first argument, is sufficient, provided you give the word, COPYRIGHT, as an argument to the macro DOC_COVER or COVER

MISC

Macro: MISC [COVER | DOC_COVER] "<argument 1>" ["<argument 2>" "<argument 3>" ...]

• String arguments must be enclosed in double-quotes

The argument(s) passed to MISC are only used on cover or doc cover pages, and then only if the argument MISC is passed to COVER or DOC_COVER. MISC can contain any information you like. Each argument appears on a separate line at the bottom of the cover or doc cover page.

For example, if you’re submitting an essay where the prof has requested that you include the course number, his name and the date, you could do
.MISC "Music History 101" "Professor Hasbeen" "Dec. 24, 2010" and the information would appear on the essay’s cover page.

If the optional argument, COVER or DOC_COVER, is given to MISC, the string arguments represent the miscellaneous information that will appear on cover or document cover pages (see the Introduction to cover pages for a description of the difference between “document covers” and “covers”). Thus, it is possible to have differing miscellaneous information on the document cover and on the cover (“title”) page. An example might be:
.MISC DOC_COVER "Music History 101" "Professor Hasbeen" .MISC COVER "Spring Term Paper"

The first invocation of .MISC establishes the miscellaneous information that appears on the document cover; the second establishes the miscellaneous information that appears on the cover (“title”) page.

If you don’t require differing miscellaneous information for doc cover and cover pages, .MISC, without the optional first argument, is sufficient, provided you give the word “MISC” as an argument to the macro DOC_COVER or COVER

COVERTITLE & DOC_COVERTITLE

Macro: COVERTITLE "<user defined cover page title>" ["<2nd line>" ["<3rd line>" ... ] ]

• Arguments must be enclosed in double-quotes

Macro: DOC_COVERTITLE "<user defined document cover page title>" ["<2nd line>" ["<3rd line>" ... ] ]

• Arguments must be enclosed in double-quotes

The arguments passed to COVERTITLE or DOC_COVERTITLE are only used on cover or doc cover pages, and then only if the argument COVERTITLE or DOC_COVERTITLE is passed to COVER or DOC_COVER.

The only time you require a COVERTITLE or DOC_COVERTITLE is when none of the required first arguments to COVER or DOC_COVER fits your needs for the title you want to appear on cover (or doc cover) pages.

COVERTITLE and DOC_COVERTITLE accept multiple arguments, each surrounded by double-quotes. Each argument is printed on a separate line, permitting you to create multi-line titles on your cover and/or doc cover pages.

PDF Title

Macro: PDF_TITLE "<pdf viewer window title>"

• Arguments must be enclosed in double-quotes

Except for DOCTITLE, mom does not, by default, provide PDF viewers with a document title. You may set one, if you like, with PDF_TITLE.


The docstyle macros

The docstyle macros tell mom what type of document you’re writing, whether you want the output typeset or “typewritten, double-spaced”, and whether you want a draft copy (with draft and revision information in the headers) or a final copy.

Docstyle macros

DOCTYPE

Macro: DOCTYPE DEFAULT | CHAPTER | NAMED "<name>" | LETTER

The arguments DEFAULT, CHAPTER and NAMED tell mom what to put in the docheader and page headers. LETTER tells her that you want to write a letter.

Mom’s default DOCTYPE is DEFAULT. If that’s what you want, you don’t have to give a DOCTYPE command.

DEFAULT prints a docheader containing the title, subtitle and author information given to the reference macros, and page headers with the author and title. (See Default specs for headers for how mom outputs each part of the page header.)

CHAPTER prints “Chapter <n>” in place of a docheader (<n> is what you gave to the reference macro, CHAPTER). If you give the chapter a title with CHAPTER TITLE, mom prints “Chapter <n>” and the title underneath. If you omit the CHAPTER reference macro but supply a CHAPTER_TITLE, mom prints only the chapter title.

The page headers in DOCTYPE CHAPTER contain the author, the title of the book (which you gave with TITLE), and “Chapter <n>” (or the chapter title). See Default Specs for Headers for mom’s default type parameters for each part of the page header.

NAMED takes an additional argument: a name for this particular kind of document (eg outline, synopsis, abstract, memorandum), enclosed in double-quotes. NAMED is identical to DEFAULT except that mom prints the argument to NAMED beneath the docheader, as well as in page headers. (See Default specs for headers for how mom outputs each part of the page header.)

Additionally, if you wish the name of this particular kind of document to be coloured, you can pass DOCTYPE NAMED a third (optional) argument: the name of a colour pre-defined (or “initialized”) with NEWCOLOR or XCOLOR. For example, if you have a doctype named “Warning”, and you’d like “Warning” to be in red, assuming you’ve pre-defined (or “initialized”) the color, red, this is what the DOCTYPE entry would look like:
.DOCTYPE NAMED "Warning" red

How to control DOCTYPE NAMED underlining

By default, the string passed to DOCTYPE NAMED is underlined in the docheader, and on document-cover pages and cover (“title”) pages. (See the Introduction to covers for the difference between “doc cover” and “cover” pages.)

You can use the macro DOCTYPE_UNDERLINE to set the weight of the underline and its distance from where the doctype-name appears in the docheader (doc covers and covers handle underlining of the doctype-name differently; see COVER_UNDERLINE), or simply toggle doctype underlining on or off. Mom’s default is to underline the doctype-name.

The order of arguments is weight, optionally followed by gap, where “gap” is the distance from the baseline of the doctype-name to the underline.

The weight argument is given in points, or fractions thereof, and must not have the unit of measure, p, appended. Like RULE_WEIGHT, weights must be greater than 0 and less than 100. Mom’s default for DOCTYPE NAMED underlining is 1/2 point.

The gap argument can be given using any unit of measure, and must have the unit of measure appended to the argument. The distance of the gap is measured from the baseline of the DOCTYPE NAMED name to the upper edge of the underline. Mom’s default gap for named-doctype underlining is 2 points.

As an example, suppose you want the doctype-name underlined in the docheader with a 2-point rule separated from the doctype-name by 3 points. The way to accomplish it is:
.DOCTYPE_UNDERLINE 2 3p If you wanted the same thing, but were content with mom’s default gap of 2 points,
.DOCTYPE_UNDERLINE 2 would do the trick.

If you merely want to toggle the underlining of the doctype-name in docheaders on or off, invoke .DOCTYPE_UNDERLINE by itself to turn the underlining on, or .DOCTYPE_UNDERLINE OFF (or NO, X, etc.)

Please note that if you supply a weight to DOCTYPE_UNDERLINE, and optionally a gap, you also turn the underlining of the doctype-name in docheaders on; if this is not what you want, you must turn the underlining off manually afterwards.

LETTER tells mom you’re writing a letter. See the section Writing Letters for instructions on using mom to format letters.

PRINTSTYLE

Macro: PRINTSTYLE TYPESET | TYPEWRITE [ SINGLESPACE ]

• Required for document processing
Must come before any changes to default document style

PRINTSTYLE tells mom whether to typeset a document, or to print it out “typewritten, doubled-spaced”.

Important: This macro may not be omitted. In order for document processing to take place, mom requires a PRINTSTYLE. If you don’t give one, mom will warn you on stderr and print a single page with a nasty message.

Just as important: PRINTSTYLE must precede any and all page and style parameters associated with a document with the exception of PAPER, PAGEWIDTH, and/or PAGELENGTH, which should be placed at the top of your file. PRINTSTYLE sets up complete templates that include default margins, family, fonts, point sizes, and so on. Therefore, changes to any aspect of document style must come afterwards. For example,
.PAPER A4 .LS 14 .QUAD LEFT .PRINTSTYLE TYPESET will not change mom’s default document leading to 14 points, nor the default justification style (fully justified) to left justified, whereas
.PAPER A4 .PRINTSTYLE TYPESET .LS 14 .QUAD LEFT will.

TYPESET, as the argument implies, typesets documents (by default in Times Roman; see TYPESET defaults). You have full access to all the typesetting macros as well as the style control macros of document processing.

With TYPEWRITE, mom does her best to reproduce the look and feel of typewritten, double-spaced copy (see TYPEWRITE defaults). Control macros and typesetting macros that alter family, font, point size, and leading are (mostly) ignored. An important exception is HEADER_SIZE (and, by extension, FOOTER_SIZE), which allows you to reduce the point size of headers/footers should they become too crowded. Most of mom’s inlines affecting the appearance of type are also ignored (\*S[<size>] is an exception; there may be a few others).

In short, TYPEWRITE never produces effects other than those available on a typewriter. Don’t be fooled by how brainless this sounds; mom is remarkably sophisticated when it comes to conveying the typographic sense of a document within the confines of TYPEWRITE.

The primary uses of TYPEWRITE are: outputting hard copy drafts of your work (for editing) and producing documents for submission to publishers and agents who (wisely) insist on typewritten, double-spaced copy. To get a nicely typeset version of work that’s in the submission phase of its life (say, to show fellow writers for critiquing), simply change TYPEWRITE to TYPESET and print out a copy.

If, for some reason, you would prefer the output of TYPEWRITE single-spaced, pass PRINTSTYLE TYPEWRITE the optional argument, SINGLESPACE.

PRINTSTYLE TYPESET defaults

Family = Times Roman Point size = 12.5 Paragraph leading = 16 points, adjusted Fill mode = justified Hyphenation = enabled max. lines = 2 margin = 36 points interword adjustment = 1 point Kerning = enabled Ligatures = enabled Smartquotes = enabled Word space = groff default Sentence space = 0

PRINTSTYLE TYPEWRITE defaults

Family = Courier Italics = underlined Point size = 12 Paragraph leading = 24 points, adjusted; 12 points for SINGLESPACE Fill mode = left Hyphenation = disabled Kerning = disabled Ligatures = disabled Smartquotes = disabled Word space = groff default Sentence space = groff default Columns = ignored

PRINTSTYLE TYPEWRITE control macros

Family

If you’d prefer a monospace family for PRINTSTYLE TYPEWRITE other than than mom's default, Courier, you can change it with .TYPEWRITER_FAMILY <family> (or .TYPEWRITER_FAM). Since groff ships with only the Courier family, you will have to install any other monospace family yourself. See Adding fonts to groff.

Point size

If you’d like a smaller or larger point size for for PRINTSTYLE TYPEWRITE (mom’s default is 12-point), you can change it with .TYPEWRITER_SIZE <size>. There’s no need to add a unit of measure to the <size> argument; points is assumed. Be aware, however, that regardless of point size, mom’s leading/linespacing for TYPEWRITE is fixed at 24-point for double-spaced, and 12-point for single-spaced.

Underlining of italics

In PRINTSTYLE TYPEWRITE, mom, by default, underlines anything that looks like italics. This includes the \*[SLANT] inline escape for pseudo-italics.

If you’d prefer that mom were less bloody-minded about pretending to be a typewriter (ie you’d like italics and pseudo-italics to come out as italics), use the control macros
.ITALIC_MEANS_ITALIC and .SLANT_MEANS_SLANT Neither requires an argument.

Although it’s unlikely, should you wish to reverse the sense of these macros in the midst of a document, .UNDERLINE_ITALIC and .UNDERLINE_SLANT restore underlining of italics and pseudo-italics.

Additionally, by default, mom underlines quotes (but not blockquotes) in PRINTSTYLE TYPEWRITE. If you don’t like this behaviour, turn it off with
.UNDERLINE_QUOTES OFF

To turn underlining of quotes back on, use UNDERLINE_QUOTES without an argument.

While most of the control macros have no effect on PRINTSTYLE TYPEWRITE, there is an important exception: HEADER_SIZE (and by extension, FOOTER_SIZE). This is particularly useful for reducing the point size of headers/footers should they become crowded (quite likely to happen if the title of your document is long and your COPYSTYLE is DRAFT).

COPYSTYLE

Macro: COPYSTYLE DRAFT | FINAL

Mom’s default COPYSTYLE is FINAL, so you don’t have to use this macro unless you want to.

COPYSTYLE DRAFT exhibits the following behaviour:

  1. Documents start on page 1, whether or not you request a different starting page number with PAGENUMBER.
  2. Page numbers are set in lower case roman numerals.
  3. The draft number supplied by DRAFT and a revision number, if supplied with REVISION (see reference macros), appear in the centre part of page headers (or footers, depending on which you’ve selected) along with any other information that normally appears there.

Important: If you define your own centre part for page headers with HEADER_CENTER, no draft and/or revision number will appear there. If you want draft and revision information in this circumstance, use DRAFT_WITH_PAGENUMBER.

COPYSTYLE FINAL differs from DRAFT in that:

  1. It respects the starting page number you give the document.
  2. Page numbers are set in normal (Arabic) digits.
  3. No draft or revision number appears in the page headers.

Note: The centre part of page headers can get crowded, especially with DOCTYPE CHAPTER and DOCTYPE NAMED, when the COPYSTYLE is DRAFT. Three mechanisms are available to overcome this problem. One is to reduce the overall size of headers (with HEADER_SIZE). Another, which only works with PRINTSTYLE TYPESET, is to reduce the size of the header’s centre part only (with HEADER_CENTER_SIZE). And finally, you can elect to have the draft/revision information attached to page numbers instead of having it appear in the centre of page headers (see DRAFT_WITH_PAGENUMBER).


Initiate document processing

In order to use mom’s document element macros (tags), you have to tell her you want them. The macro to do this is START.

START collects the information you gave mom in the setup section at the top of your file (see Tutorial – Setting up a mom document), merges it with her defaults, sets up headers and page numbering, and prepares mom to process your document using the document element tags. No document processing takes place until you invoke .START.

START

Macro: START

• Required for document processing

START takes no arguments. It simply instructs mom to begin document processing. If you don’t want document processing (ie you only want the typesetting macros), don’t use START.

At a barest minimum before START, you must enter a PRINTSTYLE command.


Establishing typestyle and formatting parameters before START

In the third (optional) part of setting up a document (the stylesheet; see Tutorial – Setting up a mom document), you can use the typesetting macros to change mom’s document-wide defaults for margins, line length, family, base point size, leading, and justification style.

Two additional style concerns have to be addressed here (ie in macros before START): changes to the docheader, and whether you want you want the document’s nominal leading adjusted to fill pages fully to the bottom margin.

Behaviour of the typesetting macros before START

From time to time (or maybe frequently), you’ll want the overall look of a document to differ from mom’s defaults. Perhaps you’d like her to use a different family, or a different overall leading, or have different left and/or right page margins.

To accomplish such alterations, use the appropriate typesetting macros (listed below) after PRINTSTYLE and before START.

More than one user has, quite understandably, not fully grasped the significance of the preceding sentence. The part they’ve missed is after PRINTSTYLE.

Changes to any aspect of the default look and/or formatting of a mom document must come after PRINTSTYLE. For example, it might seem natural to set up page margins at the very top of a document with
.L_MARGIN 1i .R_MARGIN 1.5i However, when you invoke .PRINTSTYLE, those margins will be overridden. The correct place to set margins—and all other changes to the look of a document—is after PRINTSTYLE.

Important: Do not use the macros listed in Changing document-wide typesetting parameters after START prior to START; they are exclusively for use afterwards.

Meanings

When used before START, the typesetting macros, below have the following meanings:
L_MARGIN Left margin of pages, including headers/footers R_MARGIN Right margin of pages, including headers/footers T_MARGIN The point at which running text (ie not headers/footers or page numbers) starts on each page B_MARGIN* The point at which running text (ie not (see note) headers/footers or page numbers) ends on each page PAGE If you use PAGE, its final four arguments have the same meaning as L_ R_ T_ and B_MARGIN (above). LL The line length for everything on the page; equivalent to setting the right margin with R_MARGIN FAMILY The family of all type in the document PT_SIZE The point size of type in paragraphs; mom uses this to calculate automatic point size changes (eg for heads, footnotes, quotes, headers, etc) LS/AUTOLEAD** The leading used in paragraphs; all leading and spacing of running text is calculated from this QUAD/JUSTIFY Affects paragraphs only LEFT*** No effect RIGHT*** No effect CENTER*** No effect ------ *See FOOTER MARGIN AND BOTTOM MARGIN for an important warning **See DOC_LEAD_ADJUST ***See Special note

Other macros that deal with type style, or refinements thereof (KERN, LIGATURES, HY, WS, SS, etc.), behave normally. It is not recommended that you set up tabs or indents prior to START.

If you want to change any of the basic parameters (above) after START and have them affect a document globally (as if you’d entered them before START), you must use the macros listed in Changing document-wide style parameters after START.

Special note on LEFT, RIGHT and CENTER prior to START

In a word, these three macros have no effect on document processing when invoked prior to START.

All mom’s document element tags (PP, HEAD, BLOCKQUOTE, FOOTNOTE, etc.) except QUOTE set a fill mode as soon as they’re invoked. If you wish to turn fill mode off for the duration of any tag (with LEFT, RIGHT or CENTER) you must do so immediately after invoking the tag. Furthermore, the change affects only the current invocation of the tag. Subsequent invocations of the same tag for which you want the same change require that you invoke .LEFT, .RIGHT or .CENTER immediately after every invocation of the tag.

Including (sourcing) style sheets and files

If you routinely make the same changes to mom’s defaults in order to create similar documents in a similar style—in other words, you need a template— you can create style-sheet files and include, or "source", them into your mom documents with the macro, INCLUDE. The right place for such style sheets is after PRINTSTYLE and before START.

Say, for example, in a particular kind of document, you always want main heads set in Helvetica Bold Italic, flush left, with no underscore. You’d create a file, let’s call it head-template, in which you’d place the pertinent HEAD control macros.
.HEADING_STYLE 1 \ FAMILY H \ FONT BI \ QUAD L \ NO_UNDERSCORE Then, in the preliminary document set-up section of your main file, you’d include the style sheet, or template, like this:
.TITLE "Sample Document .AUTHOR "Joe Blow .PRINTSTYLE TYPESET \# .INCLUDE head-template \# .START The blank comment lines ( \# ) aren’t required, but they do make your file(s) easier to read.

If the file to be included is in the same directory as the file you’re working, you simply enter the filename after .INCLUDE. If the file’s in another directory, you must provide a full path name to it. For example, if you’re working in a directory called /home/joe/stories and your style-sheet is in /home/joe/style-sheets, the above example would have to look like this:
.TITLE "Sample Document .AUTHOR "Joe Blow .PRINTSTYLE TYPESET \# .INCLUDE /home/joe/style-sheets/head-template \# .START

INCLUDE is not restricted to style sheets or templates. You can include any file at any point into a document, provided the file contains only text and valid groff or mom formatting commands. Neither is INCLUDE restricted to use with mom’s document processing macros. You can use it in plain typeset documents as well.

Experts: INCLUDE is an alias for the groff request, .so. Mix 'n' match with impunity.

Initializing colours

Although it doesn’t really matter where you define/initialize colours for use in document processing (see NEWCOLOR and XCOLOR in the section Coloured text), I recommend doing so before you begin document processing with START.

The macro, COLOR, and the inline escape, \[<colorname>], can be used at any time during document processing for occasional colour effects. However, consistent and reliable colourizing of various document elements (the docheader, heads, linebreaks, footnotes, pagenumbers, and so on) must be managed through the use of the document element control macros.

Note: If you plan to have mom generate a table of contents, do not embed colour inline escapes (\[<colorname>]) in the string arguments given to any of the reference macros, nor in the string arguments given to HEAD, SUBHEAD or PARAHEAD. Use, rather, the control macros mom provides to automatically colourize these elements.

Adjust linespacing to fill pages and align bottom margins

Macro: DOC_LEAD_ADJUST toggle

• Must come after LS or AUTOLEAD and before START

DOC_LEAD_ADJUST is a special macro to adjust document leading so that bottom margins fall precisely where you expect.

When you invoke .DOC_LEAD_ADJUST, mom takes the number of lines that fit on the page at your requested leading, then incrementally adds machine units to the leading until the maximum number of lines at the new leading that fit on the page coincides perfectly with the bottom margin of running text.

In most instances, the difference between the requested lead and the adjusted lead is unnoticeable, and since in almost all cases adjusted leading is what you want, it’s mom’s default and you don't have to invoke it explicitly.

However, should you not want adjusted document leading, you must turn it off manually, like this:
.DOC_LEAD_ADJUST OFF

If you set the document leading prior to START with LS or AUTOLEAD, DOC_LEAD_ADJUST OFF must come afterwards, like this:
.LS 12 .DOC_LEAD_ADJUST OFF In this scenario, the maximum number of lines that fit on a page at a leading of 12 points determine where mom ends a page. The effect will be that last lines usually fall (slightly) short of the “official” bottom margin.

In PRINTSTYLE TYPEWRITE, the leading is always adjusted and can’t be turned off.

Note: DOC_LEAD_ADJUST, if used, must be invoked after LS or AUTOLEAD and before START.

Additional note: Even if you disable DOC_LEAD_ADJUST, mom will still adjust the leading of endnotes pages and toc pages. See ENDNOTE_LEAD and TOC_LEAD for an explanation of how to disable this default behaviour.

Managing the docheader

Macro: DOCHEADER <toggle> [ distance to advance from top of page ]

• Must come before START; distance requires a unit of measure

By default, mom prints a docheader on the first page of any document (see below for a description of the docheader). If you don’t want a docheader, turn it off with
.DOCHEADER OFF DOCHEADER is a toggle macro, so the argument doesn’t have to be OFF; it can be anything you like.

If you turn the docheader off, mom, by default, starts the running text of your document on the same top baseline as all subsequent pages. If you’d like her to start at a different vertical position, give her the distance you’d like as a second argument.
.DOCHEADER OFF 1.5i This starts the document 1.5 inches from the top of the page PLUS whatever spacing adjustment mom has to make in order to ensure that the first baseline of running text falls on a “valid” baseline (ie one that ensures that the bottom margin of the first page falls where it should). The distance is measured from the top edge of the paper to the baseline of the first line of type.

Tip: Since no document processing happens until you invoke .START—including anything to do with docheaders—you can typeset your own docheader prior to START (if you don’t like the way mom does things) and use .DOCHEADER OFF with its optional distance argument to ensure that the body of your document starts where you want. You can even insert a PDF or PostScript image file (see PSPIC). and PDF_IMAGE).

Docheader control: How to change the look of docheaders

In PRINTSTYLE TYPEWRITE, the look of docheaders is carved in stone. In PRINTSTYLE TYPESET, however, you can make a lot of changes. Macros that alter docheaders must come before START.

Docheader description

A typeset docheader has the following characteristics:

TITLE bold, 3.5 points larger than running text (not necessarily caps) Subtitle medium, same size as running text by medium italic, same size as running text Author(s) medium italic, same size as running text (Document type) bold italic, underscored, 3 points larger than running text

Or, if the DOCTYPE is CHAPTER,

Chapter <n> bold, 4 points larger than running text Chapter Title bold italic, 4 points larger than running text

The family is the prevailing family of the whole document. Title, subtitle, author and document type are what you supply with the reference macros. Any you leave out will not appear; mom will compensate:

Note: If your DOCTYPE is CHAPTER and you have both “Chapter <n>” and a “Chapter Title” (as above), mom inserts a small amount of whitespace between them, equal to one-quarter of the leading in effect. If this doesn’t suit you, you can alter the space by including the inline escapes, \*[UP] or \*[DOWN], in the argument you pass to CHAPTER_TITLE, like this:
.CHAPTER_TITLE "\*[DOWN 2p]Why Not Patent Calculus?" or .CHAPTER_TITLE "\*[UP 2p]Why Not Patent Calculus?"

1. Change the starting position of the docheader

By default, a docheader starts on the same baseline as running text. If you’d like it to start somewhere else, use the macro, DOCHEADER_ADVANCE, and give it the distance you want (measured from the top edge of the paper to the first baseline of the docheader), like this:
.DOCHEADER_ADVANCE 4P A unit of measure is required.

Note: If HEADERS are OFF, mom’s normal top margin for running text (7.5 picas) changes to 6 picas (visually approx. 1 inch). Since the first baseline of the docheader falls on the same baseline as the first line of running text (on pages after page 1), you might find the docheaders a bit high when headers are off. Use DOCHEADER_ADVANCE to place them where you want.

2. Change the quad direction of the docheader

By default, mom centers the docheader. If you’d prefer to have your docheaders set flush left or right, or need to restore the default centering, invoke .DOCHEADER_QUAD with the quad direction you want, either LEFT (or L), RIGHT (or R) or CENTER (or C).

3. Change the family of the entire docheader

By default, mom sets the docheader in the same family used for running text. If you’d prefer to have your docheaders set in a different family, invoke .DOCHEADER_FAMILY with the family you want. The argument to DOCHEADER_FAMILY is the same as for FAMILY.

For example, mom’s default family for running text is Times Roman. If you’d like to keep that default, but have the docheaders set entirely in Helvetica,
.DOCHEADER_FAMILY H is how you’d do it.

Please note that if you use DOCHEADER_FAMILY, you can still alter the family of individual parts of the docheader with the macros listed here.

4. Change the family of individual docheader elements

The following macros let you change the family of each docheader element separately:

  • Macro: TITLE_FAMILY <family>
  • Macro: CHAPTER_TITLE_FAMILY <family>
  • Macro: SUBTITLE_FAMILY <family>
  • Macro: AUTHOR_FAMILY <family>
  • Macro: DOCTYPE_FAMILY <family> (if DOCTYPE is NAMED)

Simply pass the appropriate macro the family you want, just as you would with FAMILY.

5. Change the font of individual docheader elements

The following macros let you change the font of each docheader element separately:

  • Macro: TITLE_FONT R | B | I | BI
  • Macro: CHAPTER_TITLE_FONT R | B | I | BI
  • Macro: SUBTITLE_FONT R | B | I | BI
  • Macro: AUTHOR_FONT R | B | I | BI
  • Macro: DOCTYPE_FONT R | B | I | BI (if DOCTYPE is NAMED)

Simply pass the appropriate macro the font you want. R, B, I and BI have the same meaning as they do for FT. You may also use any of the style extensions provided by mom.

6. Adjust the size of individual docheader elements

The following macros let you adjust the point size of each docheader element separately.

Mom calculates the point size of docheader elements from the point size of paragraphs in running text, so you must prepend a + or - sign to the argument. Points is assumed as the unit of measure, so there’s no need to append a unit to the argument. Fractional point sizes are allowed.

  • Macro: TITLE_SIZE <+/-points>
       default = +3.5 (+4 if docheader title is "Chapter <n>")
  • Macro: CHAPTER_TITLE_SIZE <+/-points>
       default = +4
  • Macro: SUBTITLE_SIZE <+/-points>
       default = +0
  • Macro: AUTHOR_SIZE <+/-points>
       default = +0
  • Macro: DOCTYPE_SIZE <+/-points> (if DOCTYPE is NAMED)
       default = +3

Simply pass the appropriate macro the size adjustment you want.

7. Adjust the docheader leading

The leading of docheaders is the same as running text. If you’d like your docheaders to have a different leading, say, 2 points more than the lead of running text, use:
.DOCHEADER_LEAD +2 Since the leading of docheaders is calculated from the lead of running text, a + or - sign is required before the argument (how much to add or subtract from the lead of running text). No unit of measure is required; points is assumed.

8. Change the colour of the entire docheader

If you want to colourize the entire docheader:
.DOCHEADER_COLOR <color name> You must pre-define (or “initialize”) the colour with NEWCOLOR or XCOLOR.

9. Change the colour of the docheader elements individually

The following macros let you change the colour of each docheader element separately. You must pre-define (or “initialize”) the colour with NEWCOLOR or XCOLOR.

  • Macro: TITLE_COLOR <colorname>
  • Macro: CHAPTER_TITLE_COLOR <colorname>
    • Note: CHAPTER_TITLE_COLOR is needed only if you supply both a CHAPTER reference macro and a CHAPTER_TITLE macro. Otherwise, TITLE_COLOR takes care of colorizing the chapter header.
  • Macro: SUBTITLE_COLOR <colorname>
  • Macro: ATTRIBUTE_COLOR <colorname> (the “by” string preceding author[s] name[s])
  • Macro: AUTHOR_COLOR <colorname>
  • Macro: DOCTYPE_COLOR <colorname> (if DOCTYPE is NAMED)

It is not recommended that you embed colour (with the inline escape, \*[<colorname>]) in the strings passed to TITLE, CHAPTER_TITLE, SUBTITLE, AUTHOR or the name you give DOCTYPE NAMED. The strings passed to these macros are used to generate page headers and footers, with the result that an embedded colour will cause the string to be colourized in headers and/or footers as well. (If you want headers or footers colourized, or parts thereof, use the header/footer control macros.)

10. Change the attribution string (“by”)

If you’re not writing in English, you can change what mom prints where “by” appears in docheaders. For example,
.ATTRIBUTE_STRING "par" changes “by” to “par”. ATTRIBUTE_STRING can also be used, for example, to make the attribution read "Edited by".

If you don’t want an attribution string at all, simply pass ATTRIBUTE_STRING an empty argument, like this:
.ATTRIBUTE_STRING "" Mom will deposit a blank line where the attribution string normally appears.

If the optional argument, COVER or DOC_COVER, is given to ATTRIBUTE_STRING, the string argument represents the attribution string that will appear on cover or document cover pages (see the Introduction to cover pages for a description of the difference between “document covers” and “covers”). Thus, it is possible to have different attribution strings on the document cover page, the cover (“title”) page, and in the first-page docheader. An extreme example would be:
.ATTRIBUTE_STRING "" .ATTRIBUTE_STRING DOC_COVER "Edited by" .ATTRIBUTE_STRING COVER "by" The first invocation of .ATTRIBUTE_STRING establishes a blank attribution string that will be incorporated in the first-page docheader. The second will print “Edited by” on the document cover; the third will print “by” on the cover (“title”) page.

If you don’t require differing attribute strings for doc cover pages, cover pages, or the first-page docheader, .ATTRIBUTE_STRING, without either of the optional first arguments, is sufficient.

Note: The type specs for the attribution line in docheaders are the same as for the author line. Although it’s highly unlikely you’ll want the attribution line in a different family, font, or point size, you can make such changes using inline escapes in the argument to ATTRIBUTE_STRING. For example,
.ATTRIBUTE_STRING "\f[HBI]\*[SIZE -2p] by \*[SIZE +2p]\*[PREV]" would set “by” in Helvetica bold italic, 2 points smaller than normal.


Setting documents in columns

Setting documents in columns is easy with mom. All you have to do is is say how many columns you want and how much space you want between them (the gutters). That’s it. Mom takes care of everything else, from soup to nuts.

Some words of advice

If you want your type to achieve a pleasing justification or rag in columns, reduce the point size of type (and probably the leading as well). Mom’s default document point size is 12.5, which works well across her default 39 pica full page line length, but with even just two columns on a page, the default point size is awkward to work with.

Furthermore, you’ll absolutely need to reduce the indents for epigraphs, quotes, and blockquotes (and probably the paragraph first-line indent as well).

COLUMNS

Macro: COLUMNS <number of columns> <width of gutters>

• Should be the last macro before START
The second argument requires a unit of measure

COLUMNS takes two arguments: the number of columns you want on document pages, and the width of the gutter between them. For example, to set up a page with two columns separated by an 18 point gutter, you’d do
.COLUMNS 2 18p Nothing to it, really. However, as noted above, COLUMNS should always be the last document setup macro prior to START.

Note: Mom ignores columns completely when the PRINTSTYLE is TYPEWRITE. The notion of typewriter-style output in columns is just too ghastly for her to bear.

Marking the first page column start position

If you insert or remove space after the docheader, i.e. immediately after START in your input file, mom needs to know where your first column begins in order to align subsequent columns on the first page.

Macro: COL_MARK

COL_MARK tells mom where the first column after the docheader begins, in order for the top of subsequent columns on the first page to be aligned. Note that if you do not manually add or remove space after the docheader, there is no need to invoke COL_MARK.

Note: If you add or subtract space after the docheader, e.g. with ALD or SP, and your unit of measure is something other than “v”, be sure to follow the spacing command with .SHIM unless shimming has been disabled with NO_SHIM.

Using tabs when COLUMNS are enabled

Mom’s tabs (both typesetting tabs and string tabs) behave as you’d expect during document processing, even when COLUMNS are enabled. Tab structures set up during document processing carry over from page to page and column to column.

Breaking columns manually

Mom takes care of breaking columns when they reach the bottom margin of a page. However, there may be times you want to break the columns yourself. There are two macros for breaking columns manually: COL_NEXT and COL_BREAK.

Macro: COL_NEXT

.COL_NEXT breaks the line just before it, quads it left (assuming the type is justified or quad left), and moves over to the top of the next column. If the column happens to be the last (rightmost) one on the page, mom starts a new page at the "column 1" position. This is the macro to use when you want to start a new column after the end of a paragraph.

Macro: COL_BREAK

.COL_BREAK is almost the same as .COL_NEXT, except that instead of breaking and quadding the line preceding it, mom breaks and spreads it (see SPREAD). Use this macro whenever you need to start a new column in the middle of a paragraph.

Warning: If you need COL_BREAK in the middle of a blockquote or (god help you) an epigraph, you must do the following in order for COL_BREAK to work:
.SPREAD \!.COL_BREAK


Changing basic type and formatting parameters after START


Behaviour of the typesetting macros during document processing

During document processing, most of the typesetting macros affect type in the document globally. For example, if you turn kerning off, pairwise kerning is disabled not only in paragraphs, but also in headers, footers, quotes, and so on.

Typesetting macros that alter margins and line lengths affect running text globally (or at least try to), but leave headers/footers and footnotes alone. (To indent footnotes, see the full explanation of the FOOTNOTE macro.)

Mom’s tabs (both typesetting tabs and string tabs) behave as expected in running text during document processing. Tab structures that do not exceed the line length of running text are preserved sensibly from page to page, and, if COLUMNS are enabled, from column to column.

Some typesetting macros, however, when used during document processing, behave in special ways. These are the macros that deal with the basic parameters of type style: horizontal and vertical margins, line length, family, font, point size, leading, and quad.

Mom assumes that any changes to these parameters stem from a temporary need to set type in a style different from that provided by mom’s document element tags. In other words, you need to do a bit of creative typesetting in the middle of a document.

The following lists those typesetting macros whose behaviour during document processing requires some explanation. (Please refer to Top and bottom margins in document processing for information on how mom interprets T_MARGIN and B_MARGIN in document processing. Additionally, see ADD_SPACE if you encounter the problem of trying to get mom to put space at the tops of pages after the first.)

MACRO EFFECT DURING DOCUMENT PROCESSING ----- --------------------------------- L_MARGIN •The left margin of all running text assumes the new value. •The line length remains unaltered. •The header and footer left margin remain at the current document default. (You won’t use this often by itself. Most likely, you’ll use it in combination with R_MARGIN or LL.) R_MARGIN •The right margin of all running text assumes the new value. In other words, the line length is altered. •The header and footer right margin remain at the current document default. LL •The line length of all running text is set to the new value. •The header and footer line length remain at the current document default. FAMILY •Changes family for the duration of the current tag only. As soon as another document element tag is invoked, the family reverts to the current default for the new tag. FT •Changes font for the duration of the current tag only. As soon as another document element tag is entered, the font reverts to the current default for the new tag. N.B. — \•[SLANT] and \•[BOLDER] affect paragraph text, and remain in effect for all paragraphs until turned off. If you want to use them in a macro that takes a string argument, include the escape in the string. \•[COND] and \•[EXT] behave similarly. PT_SIZE •Changes point size for the duration of the current tag only. As soon as another document element tag is entered, the point size reverts to the current document default for the new tag. LS •Changes line space for the duration of the current tag only. As soon as another document element tag is entered, the line space reverts to the current document default for the new tag. Using LS to temporarily change leading within a document will almost certainly result in a bottom margin that doesn’t align with the bottom margin of subsequent pages. You’ll need to use the SHIM macro to get mom back on track when you’re ready to return to the document’s default leading. AUTOLEAD •Invoked before START, sets the overall document leading as a function of the overall document point size (ie the point size used in paragraphs); subsequently disabled after START, except for calls to DOC_PT_SIZE •DOC_LEAD before DOC_PT_SIZE cancels the AUTOLEAD set before START •Invoked after START, remains in effect for all subsequent point size changes made with PT_SIZE, but does not affect the leading of the document element tags (eg HEADING, PP, QUOTE...), or calls to DOC_PT_SIZE QUAD •Changes quad for the duration of the current tag only. As soon as another document element tag is entered, the quad reverts to the current document default for the new tag. N.B. — Line-for-line quadding macros (LEFT, CENTER, RIGHT) are also temporary, overridden by the QUAD value of any subsequent document element tag.

Top and bottom margins in document processing

Normally, mom establishes the top and bottom margins of running text in documents from the values of HEADER_MARGIN + HEADER_GAP and FOOTER_MARGIN + FOOTER_GAP respectively. However, if you invoke T_MARGIN or B_MARGIN either before or after START, they set the top and bottom margins of running text irrespective of HEADER_GAP and FOOTER_GAP.

Put another way, in document processing, T_MARGIN and B_MARGIN set the top and bottom margins of running text, but have no effect on the placement of headers, footers, or page numbers.

Inserting space at the top of a new page

Occasionally, you may want to insert space before the start of running text on pages after the first.

You might have tried using ALD or SPACE and found it did nothing. This is because mom normally inhibits any extra space before the start of running text on pages after the first.

If you need the space, you must use the macro, ADD_SPACE, in conjunction with NEWPAGE.

ADD_SPACE

Macro: ADD_SPACE <amount of space>

• Requires a unit of measure

ADD_SPACE takes as its single argument the distance you want mom to advance from the normal baseline position at the top of any page after the first (ie the one on which the docheader is normally printed). A unit of measure is required.

For example, say you wanted to insert 2 inches of space before the start of running text on a page other than the first. You’d accomplish it with
.NEWPAGE .ADD_SPACE 2i which would terminate your current page, break to a new page, print the header (assuming headers are on) and insert 2 inches of space before the start of running text.

Since adding space in this way is almost sure to disrupt mom’s ability to guarantee perfectly flush bottom margins, I highly recommend using the SHIM macro immediately after ADD_SPACE.

Changing document-wide style parameters after START

In the normal course of things, you establish the basic type style parameters of a document prior to invoking START, using the typesetting macros (L_MARGIN, FAMILY, PT_SIZE, LS, etc). After START, you must use the following macros if you wish to make global changes to the basic type style parameters, for example changing the overall leading or the justification style.

Important: Because these macros globally update the chosen parameter, they should only be used immediately prior to COLLATE or, if an occasional effect is desired, NEWPAGE. DOC_PT_SIZE, for example, updates the point size of every page element, including headers, footers, page numbers, and so on, which is almost certainly not what you want in the middle of a page.

DOC_LEFT_MARGIN

Macro: DOC_LEFT_MARGIN <left margin>

• Requires a unit of measure

Arguments and behaviour

  • the argument is the same as for L_MARGIN
  • changes all left margins, including headers, footers, and page numbers to the new value
  • any document elements that use a left indent calculate the indent from the new value
  • the line length remains the same (ie the right margin shifts when you change the left margin)

DOC_RIGHT_MARGIN

Macro: DOC_RIGHT_MARGIN <right margin>

• Requires a unit of measure

Arguments and behaviour

  • the argument is the same as for R_MARGIN
  • changes all right margins, including headers, footers, and page numbers to the new value;
  • any document elements that use a right indent calculate the indent from the new value

DOC_LINE_LENGTH

Macro: DOC_LINE_LENGTH <length>

• Requires a unit of measure

Arguments and behaviour

  • the argument is the same as for LL
  • exactly equivalent to changing the right margin with DOC_RIGHT_MARGIN (see above);

DOC_FAMILY

Macro: DOC_FAMILY <family>

Arguments and behaviour

DOC_PT_SIZE

Macro: DOC_PT_SIZE <point size>

• Does not require a unit of measure; points is assumed

Arguments and behaviour

  • the argument is the same as for PT_SIZE, and refers to the point size of type in paragraphs
  • all automatic point size changes (heads, quotes, footnotes, headers, etc.) are affected by the new size; anything you do not want affected must be reset to its former value (see the Control Macros section of the pertinent document element for instructions on how to do this)
  • if AUTOLEAD was invoked before START; the value of AUTOLEAD will be used to update the leading of all document element tags except FOOTNOTE and EPIGRAPH

DOC_LEAD

Macro: DOC_LEAD <points> [ ADJUST ]

• Does not require a unit of measure; points is assumed

Arguments and behaviour

  • the argument is the same as for LS, and refers to the leading of paragraphs
  • because paragraphs will have a new leading, the leading and spacing of most running text is influenced by the new value
  • epigraphs and footnotes remain unaffected; if you wish to change their leading, use EPIGRAPH_AUTOLEAD and FOOTNOTE_AUTOLEAD.
  • the optional argument ADJUST performs leading adjustment as explained in DOC_LEAD_ADJUST
  • if AUTOLEAD was invoked before START; the value of that AUTOLEAD will be cancelled

Note: Even if you don’t pass DOC_LEAD the optional argument ADJUST, mom will still adjust the leading of endnotes pages and toc pages. See ENDNOTE_LEAD and TOC_LEAD for an explanation of how to disable this default behaviour.

DOC_QUAD

Macro: DOC_QUAD L | R | C | J

Arguments and behaviour

  • the arguments are the same as for QUAD
  • affects paragraphs, epigraphs and footnotes; does not affect blockquotes

Terminating a document

You need do nothing special to terminate a document. When groff finishes processing the last input line of a file, the page is ejected, subject to whatever routines are needed to complete it (eg printing footnotes or adding the page number).

It happens sometimes, however, that a last line of running text, falling on or very near the bottom of the page, tricks groff into breaking to a new page before terminating. The result is a blank page at the end of the formatted document.

The situation is rare, generally occurring only when some additional macro is required after the input text, eg to exit a list or terminate a quote. To prevent it from ever happening, I recommend getting into the habit of following the final input line of all your mom files with .EL. Depending on the fill mode in effect, you may also have to append the “join line” escape, \c, to the final line.

Thus, for normal text at the end of a paragraph, which is in fill mode,
and they all lived happily ever after. .EL or for ending a LIST (also in fill mode) .ITEM peaches, pears, plums .EL .LIST OFF whereas, at the end of a QUOTE (which is in nofill mode), Shall be lifted\[em]nevermore!\c .EL .QUOTE OFF Notice that the .EL comes after the last line of input text, not any macros following.

Note: \*[B] cannot be used as a replacement for .EL when terminating a document.


Back to Table of Contents Top Next: The document element tags

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/letters.html0000644000000000000000000000013212426110213021753 xustar000000000000000030 mtime=1415090315.614519134 30 atime=1415090315.614519134 30 ctime=1415090315.614519134 groff-1.22.3/contrib/mom/momdoc/letters.html0000644000175000001440000004171212426110213020616 0ustar00wlusers00000000000000 Mom -- Writing letters
Back to Table of Contents Next: Quick reference guide

Writing letters


Introduction

Mom’s simple but effective letter-writing macros are a subset of the document processing macros, designed to ease the creation of correspondence.

Because the letter macros are a subset of the document processing macros, you can use control macros to design correspondence to your own specifications. However, mom makes no pretence of providing complete design flexibility in the matter of letters, which are, after all, simple communicative documents whose only real style requirements are that they be neat and professional-looking.

Tutorial – writing letters

Mom letters begin, like all mom-processed documents, with reference macros (in this case, AUTHOR), a DOCTYPE (LETTER, obviously), the essential PRINTSTYLE macro, and START, like this:
.AUTHOR "Yannick P. Guique" .DOCTYPE LETTER .PRINTSTYLE TYPESET .START PRINTSTYLE, above, could also be TYPEWRITE. Mom has no objection to creating letters that look like they were typed on an Underwood by a shapely secretary with 1940s gams.

Please note that if you choose PRINTSTYLE TYPEWRITE, there's no need to give the SINGLESPACE option, as this is the unalterable default for letters.

After the START macro, you enter headers pertinent to your letter: the date, the addressee (in business correspondence, typically both name and address), the addresser (that’s you; in business correspondence, typically both name and address), and a greeting (in full, eg “Dear Mr. Smith,” or “Dear Mr. Smith:”).

The macros for entering the headers are simple (they’re not even toggles):
.DATE .TO .FROM .GREETING You may enter them in any order you like, except for GREETING, which must come last. Mom ignores any headers you omit and spaces the letter’s opening according to what you do include. See Default for letters to find out how mom formats the headers.

Once you’ve filled in what you need to get a letter started, simply type the letter, introducing each and every paragraph, including the first, with the PP macro.

At the end of the letter, should you wish a closing (“Yours truly,” “Sincerely,” “Hugs and kisses”), invoke the macro, .CLOSING, on a line by itself, and follow it with the text of the closing. N.B. Don’t put your name here; mom supplies it automatically from AUTHOR), with enough space to leave room for your signature. If you omit the closing, mom simply adds your name (from AUTHOR), again with enough space for your signature.

Assuming our tutorial letter is for business correspondence, here’s what the complete letter looks like.
.AUTHOR "Yannick P. Guique" .DOCTYPE LETTER .PRINTSTYLE TYPESET .START .DATE August 25, 2010 .TO GUILLAUME BARRIÈRES Minidoux Corporation 5000 Pannes Drive Redmond, Virginia .FROM Y.P. GUIQUE 022 Umask Road St-Sauveur-en-dehors-de-la-mappe, Québec .GREETING Dear Mr. Barrières, .PP It has come to my attention that you have once again been lobbying the US government to prohibit the use of open source software by endeavouring to outlaw so-called "warranty free" applications. .PP I feel it is my duty to inform you that the success of your operating system relies heavily on open source programs and protocols, notably TCP/IP. .PP Therefore, in the interests of your corporation’s fiscal health, I strongly advise that you withdraw support for any US legislation that would cripple or render illegal open source development. .CLOSING Sincerely, This produces a letter with headers that follow the North American standard for business correspondence. If you’d prefer another style of correspondence, for example, British, you’d set up the same letter like this:
.AUTHOR "Yannick P. Guique" .DOCTYPE LETTER .PRINTSTYLE TYPESET .START .FROM .RIGHT Y.P. GUIQUE 022 Umask Road St-Sauveur-en-dehors-de-la-mappe, Québec .TO GUILLAUME BARRIÈRES Minidoux Corporation 5000 Pannes Drive Redmond, Virginia .DATE .RIGHT August 25, 2004 .GREETING Dear Mr. Barrières, Notice the use of .RIGHT after .FROM and .DATE in this example, used to change the default quad for these macros.

Default letter style

In letters, if the order of header macros is

  1. .DATE
  2. .TO  (the addressee)
  3. .FROM  (the addresser)
  4. .GREETING  (“Dear Whoever,” “To Whom It May Concern,” etc.)

mom sets

  • the date flush right, page right, at the top of page one, with a gap of two linespaces underneath
  • the addressee (.TO) in a block flush left, page left, with a gap of one linespace underneath
  • the addresser (.FROM) in a block flush left, page left, with a gap of one linespace underneath
  • the greeting flush left, with a gap of one linespace underneath

which is the standard for North American business correspondence.

If you switch the order of .DATE, .TO and/or .FROM, mom sets all the headers flush left, with a gap of one linespace underneath each. (The default left quad of any header can be changed by invoking the .RIGHT macro, on a line by itself, immediately before inputting the text of the header.)

Following the headers, mom sets

  • the body of the letter justified
  • in multi-page letters:
    • a footer indicating there’s a next page (of the form .../#)
    • the page number at the top of every page after page one
  • the closing/signature lines flush left, indented halfway across the page

Other important style defaults are listed below, and may be changed via the typesetting macros or the document processing control macros prior to START. Assume that any style parameter not listed below is the same as for any document processed with PRINTSTYLE TYPESET or PRINTSTYLE TYPEWRITE.

PARAMETER PRINTSTYLE TYPESET PRINTSTYLE TYPEWRITE Paper size 8.5 x 11 inches 8.5 x 11 inches Left/right margins 1.125 inches 1.125 inches Header margin 3.5 picas 3.5 picas (for page numbers) Header gap 3 picas 3 picas (for page numbers) Family Times Roman Courier Font roman roman Point size 12 12 Line space 13.5 12 (ie singlespaced) Paragraph indent 3 ems 3 picas Spaced paragraphs yes no Footers* yes yes Footer margin 3 picas 3 picas Footer gap 3 picas 3 picas Page numbers top, centred top, centred *Footers contain a "next page" number of the form .../#

The letter macros

All letter macros must come after START, except NO_SUITE, which must come after PRINTSTYLE and before START.

Macro: DATE

Invoke .DATE on a line by itself, with the date underneath, like this:
.DATE October 31, 2012 If you wish to change the default quad direction for the date, enter .LEFT or .RIGHT, on a line by itself, immediately after .DATE.

If you wish to insert additional space between the date and any letter header that comes after it, do so after inputting the date, not at the top of the next header macro, like this:
.DATE October 31, 2012 .SPACE \"Or, more simply, .SP If you wish to remove the default space,
.SPACE -1v \"Or, more simply, .SP -1v will do the trick.

Macro: TO

Invoke .TO on a line by itself, with the name and address of the addressee underneath, like this:
.TO JOHN SMITH 10 Roberts Crescent Bramladesh, Ont. If you wish to change the default quad direction for the address, enter .LEFT or .RIGHT, on a line by itself, immediately after .TO.

If you wish to insert additional space between the address and any letter header that comes after it, do so after inputting the address, not at the top of the next header macro, like this:
.TO JOHN SMITH 10 Roberts Crescent Bramladesh, Ont. .SPACE \"Or, more simply, .SP If you wish to remove the default space,
.SPACE -1v \"Or, more simply, .SP -1v will do the trick.

Macro: FROM

Invoke .FROM on a line by itself, with the name and address of the addresser underneath, like this:
.FROM JOE BLOW 15 Brunette Road Ste-Vieille-Andouille, Québec If you wish to change the default quad direction for the address, enter .LEFT or .RIGHT, on a line by itself, immediately after .FROM.

If you wish to insert additional space between the address and any letter header that comes after it, do so after inputting the address, not at the top of the next header macro, like this:
.FROM JOE BLOW 15 Brunette Road Ste-Vieille-Andouille, Québec .SPACE \"Or, more simply, .SP If you wish to remove the default space,
.SPACE -1v \"Or, more simply, .SP -1v will do the trick.

Macro: GREETING

Invoke .GREETING on a line by itself, with the full salutation you want for the letter underneath, like this:
.GREETING Dear Mr. Smith,

Macro: CLOSING

Invoke .CLOSING on a line by itself after the body of the letter, with the closing you’d like (eg “Yours truly,”) underneath, like this:
.CLOSING Yours truly,

CLOSING control macros and defaults
Two macros control the behaviour of .CLOSING:

  • CLOSING_INDENT
  • SIGNATURE_SPACE

The first, CLOSING_INDENT, indicates the distance from the left margin you’d like to have your closing indented. It takes a single numeric argument and must have a unit of measure appended to it, unless you want an indent of 0 (zero). Mom’s default is one half the width of the letter’s line length (ie halfway across the page). If you wanted, instead, an indent of 6 picas, you’d do it like this:
.CLOSING_INDENT 6P Or, if you wanted to have no indent at all:
.CLOSING_INDENT 0

The second, SIGNATURE_SPACE, controls how much room to leave for the signature. It takes a single numeric argument and must have a unit of measure appended to it. Mom’s default is 3 line spaces, but if you wanted to change that to, say, 2 line spaces, you’d do:
.SIGNATURE_SPACE 2v

Macro: NO_SUITE

If you don’t want mom to print a “next page” number at the bottom of multi-page letters, invoke .NO_SUITE, on a line by itself, prior to START.


Back to Table of Contents Top Next: Quick reference guide

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/rectoverso.html0000644000000000000000000000013212426110213022464 xustar000000000000000030 mtime=1415090315.614519134 30 atime=1415090315.614519134 30 ctime=1415090315.614519134 groff-1.22.3/contrib/mom/momdoc/rectoverso.html0000644000175000001440000002452212426110213021327 0ustar00wlusers00000000000000 Mom -- Recto/verso printing, collating
Back to Table of Contents Next: Cover pages

Recto/verso printing, collating


Introduction to recto/verso printing

Recto/verso printing allows you to set up a mom document in such a way that it can be printed on both sides of a printer sheet and subsequently bound.

With recto/verso, mom automatically takes control of the following aspects of alternating page layout:

  • switching left and right margins (if they’re not equal)
  • switching the left and right parts of the default 3-part headers or footers (see the General description of headers)
  • switching HEADER_RECTO and HEADER_VERSO if user-defined, single string recto/verso headers or footers are used in place of the default 3-part headers or footers
  • switching the page number position (if page numbers are not centred)

Recto/verso macros

Macro: RECTO_VERSO

If you want mom to set up alternating pages for recto/verso printing, simply invoke RECTO_VERSO, with no argument, anywhere in your document (most likely before START).

Note: Recto/verso always switches the left and right parts of headers or footers on odd/even pages. However, it only switches the left and right margins if the margins aren’t equal. Consequently, it is your responsibility to set the appropriate differing left and right margins with L_MARGIN and R_MARGIN (prior to START) or with DOC_LEFT_MARGIN and DOC_RIGHT_MARGIN (before or after START).

Equally, recto/verso only switches the page number position if page numbers aren’t centred, which means you have to set the page number position with PAGENUM_POS (before or after START).

Macro: SWITCH_HEADERS

SWITCH_HEADERS switches the location of the header left string (by default, the author) and the header right string (by default, the document title). If you don’t like mom’s default placement of author and title, use SWITCH_HEADERS to reverse it.

SWITCH_HEADERS can also be useful in conjunction with RECTO_VERSO. The assumption of RECTO_VERSO is that the first page of a document (ie recto/odd) represents the norm for header-left and header-right, meaning that the second (and all subsequent verso/even) pages of the document will reverse the order of header-left and header-right.

If mom’s behaviour in this matter is not what you want, simply invoke SWITCH_HEADERS on the first page of your recto/verso document to reverse her default treatment of header parts. The remainder of your document (with respect to headers) will come out as you want.


Introduction to collating

Many people wisely keep chapters of a long work in separate files, previewing or printing them as needed during the draft phase. However, when it comes to the final version, mom requires a single, collated file in order to keep track of page numbering and recto/verso administration, generating tables of contents and endnotes, ensuring that docheaders get printed correctly, and a host of other details.

The COLLATE macro, which can be used with any DOCTYPE except LETTER, lets you glue mom-formatted text files together. You need only concatenate chapters into a single file (most likely with the cat command), put .COLLATE at the end of each concatenated chapter, follow it with the reference macros (metadata) needed for the new chapter, eg CHAPTER or CHAPTER_STRING, make any pertinent style changes to the upcoming chapter (unlikely, but possible), and re-invoke the START macro. (Most likely, the metadata and .START are already there.) Each chapter will begin on a fresh page and behave as expected.

Even if you always work with monolithic, multi-chapter files, every chapter and its associated metadata plus .START still needs to be preceded by a .COLLATE command.

Note: COLLATE assumes you are collating documents/files with similar type-style parameters hence there’s no need for PRINTSTYLE to appear after COLLATE, although if you’re collating documents that were created as separate files, chances are the PRINTSTYLE’s already there.

Two words of caution:

  1. Do not collate documents of differing PRINTSTYLES (ie don’t try to collate a TYPESET document and TYPEWRITE document).
  2. Use .DOC_FAMILY instead of .FAMILY if, for some reason, you want to change the family of all the document elements after .COLLATE. .FAMILY, by itself, will change the family of paragraph text only.

collate

Macro: COLLATE

The most basic (and most likely) collating situation looks like this:
.COLLATE .CHAPTER 17 .START

A slightly more complex version of the same thing, for chapters that require their own titles, looks like this:
.COLLATE .CHAPTER_TITLE "Geek Fatigue: Symptoms and Causes" .START

Tip: If the last line of text before .COLLATE falls too close to the bottom margin, or if the line is followed by a macro likely to cause a linebreak (eg .LIST OFF or .IQ), mom may output a superfluous blank page before the start of the following document.

In order to avoid this, insert .EL after the last line of text, before .COLLATE and/or any concluding macros. For example,
some concluding text. .EL .COLLATE or
some concluding text. .EL .LIST OFF .COLLATE

Note: See the two words of caution, above.


Back to Table of Contents Top Next: Cover pages

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/definitions.html0000644000000000000000000000013212426110213022604 xustar000000000000000030 mtime=1415090315.612519159 30 atime=1415090315.612519159 30 ctime=1415090315.612519159 groff-1.22.3/contrib/mom/momdoc/definitions.html0000644000175000001440000007777412426110213021470 0ustar00wlusers00000000000000 Mom -- Definitions and Terms
Back to Table of Contents Next: Using mom

Definitions of terms used in this manual

I use a number of typesetting-specific and groff-specific terms throughout this documentation, as well as a few terms that apply to mom herself. To make life easier, I’ll explain them here. Refer back to this section should you encounter a word or concept you’re not familiar with.


Typesetting terms

Ascender
The portion of a letter that extends above the bowl. For example, the letters a, c, and e have no ascenders. The letters b, d, and h do.
Baseline
The imaginary line on which the bottoms of capital letters and the bowls of lower case letters rest.
Ballot box
An unfilled square, usually cap-height in size, typically placed beside items in a checklist.
Bullet
A small, filled circle typically found beside items or points in a list.
Cap-height
The height of the tallest capital letter in a given font at the current point size.
Descender
The portion of a letter that extends beneath the baseline (j, q, y are letters with descenders).
Discretionary hyphen
A symbol inserted between two syllables of a word that indicates to a typesetting program the valid hyphenation points in the word. Normally, if hyphenation is turned on, groff knows where to hyphenate words. However, hyphenation being what it is (in English, at any rate), groff doesn’t always get it right. Discretionary hyphens make sure it does. In the event that the word doesn’t need to be hyphenated at all, groff leaves them alone. In groff, the discretionary hyphen is entered with \% (ie, a backslash followed by the percent sign).
Drop cap
A large, usually upper-case letter that introduces the first paragraph of a document or section thereof. The top of the drop cap usually lines up with the top of the first line of the paragraph, and typically “drops” several lines lower. Text adjacent to the drop cap is indented to the right of the letter until the bottom of the drop cap is reached, at which point text reverts to the left margin.
Em/en
An em is a relative measurement equal to the width of the letter M at a given point size in a given font. Since most Ms are designed square, an em is usually (but sometimes erroneously) considered to be the same size as the current point size (ie if the point size of the type is 12, one em equals 12 points). An en is equal to the width of a letter N (historically 2/3 of an em, although groff treats an en as 1/2 of an em). Typically, ems and ens are used to measure indents, or to define the length of dashes (long hyphens).
Family
The collective name by which a collection of fonts are known, eg Helvetica, Times Roman, Garamond.
Figure space/Digit space
A fixed width space that has the width of one digit. Used for aligning numerals in, say, columns or numbered lists. In groff, the figure space is entered with \0 (ie a backslash followed by a zero)
Fixed width font
A family or font in which every character occupies exactly the same amount of vertical space on the line. Courier is the best-known, if not the most elegant, fixed-width font.
Fixed width space
Equal to word space, but does not expand or contract when text is justified. In groff, fixed width space is entered with \<space> (ie a backslash followed by a space)
Font
The specific weight and shape of type within a family, eg light, medium, bold (which are weights), and roman, italic, condensed (which are shapes). By default, groff knows of four fonts within its default set of families: R (medium roman), I (medium italic), B (bold roman) and BI (bold italic). Mom considerably extends this very basic list.
Force justify
Sometimes, in justified text, a line needs to be broken short of the right margin. Force justifying means telling a typesetting program (like groff) that you want the line broken early AND that you want the line’s word spacing stretched to force the line flush with the right margin.
Gutter
The vertical whitespace separating columns of type.
Justify/justification
Lines of type are justified when they’re flush at both the left and right margins. Justification is the act of making both margins flush. Some people use the terms "left justified" and "right justified" to mean type where only the left (or right) margins align. I don’t. See quad.
Kerning
Moving pairs of letters closer together to remove excess whitespace between them. In the days before phototypesetting, type was set from small, rectangular blocks of wood or metal, each block having exactly one letter. Because the edge of each block determined the edge of each letter, certain letter combinations (TA, for example) didn’t fit together well and had to be mortised by hand to bring them visually closer. Modern typesetting systems usually take care of kerning automatically, but they’re far from perfect. Professional typesetters still devote a lot of time to fitting letters and punctuation together properly.
Kern Units
A relative distance, which, by default, is equal to 1/36 of the current point size. Used between individual letters for kerning. Different typesetting systems use different values (1/54 is popular), and sometimes call kern units by a different name. It is possible to change the default size of the kern unit with the KERN_UNIT macro.
Lead/leading
The distance from the baseline of one line of type to the line of type immediately beneath it. Pronounced "ledding." Also called line spacing. Usually measured in points.

In case you’re interested... In previous centuries, lines of type were separated by thin strips of—you guessed it—lead. Lines of type that had no lead between them were said to be “set solid.” Once you began separating them with strips of lead, they were said to be “leaded”, and the spacing was expressed in terms of the number of points of lead. For this reason, “leading” and “line spacing” aren’t, historically speaking, synonymous. If type was set 10 on 12, for example, the leading was 2 points, not 12. Nowadays, however, the two terms are used interchangeably to mean the distance from baseline to baseline.

Leaders
Single characters used to fill lines, usually to their end. So called because they “lead” the eye from one element of the page to another. For example, in the following (brief) Table of Contents, the periods (dots) are leaders. Foreword............... 2 Chapter 1.............. 5 Chapter 2.............. 38 Chapter 3.............. 60
Ligature
Ligatures are letters joined together to form a single character. The commonest are fi, fl, ff, ffi and ffl. Others are ae and oe. Occasionally, one sees an st ligature, but this is archaic and quite rare.
Picas/Points
There are twelve points in a pica, and six picas in an inch (hence 72 points to the inch). In the same way that gem-dealers have always used their own system of measurement for weight (carats), typographers have always used their own system of measurement for type.
Point Size
The nominal size of type, measured in points from the bottom of the longest descender to the top of the highest ascender. In reality, type is always fractionally smaller than its point size.
Quad
When only one margin of type is flush, lines of type are quadded in the direction of the flush margin. Therefore, quad left means the left margin is flush, the right isn’t. Quad right means the right margin is flush, the left isn’t. Quad centre means neither the left nor the right margin is flush; rather, lines of type are quadded on both sides so that type appears centred on the page.
Rag
Describes a margin that isn’t flush. Rag right means the right margin isn’t flush. Rag left means the left margin isn’t flush. The expression "flush left/rag right" is sometimes used to describe type that is quadded left.
Shape
The degree of slant and/or the width of characters. (Technically speaking, this is not a proper typesetting term; however, it may help clarify some concepts presented in these documents.)

Some typical shapes are:

  • Roman, which has no slant, and has letterforms of average width
  • Italic, which is slanted, and has letterforms of average width
  • Condensed, which has no slant, but has letterforms narrower than the average represented by Roman
  • Condensed Italic, which is slanted, with letterforms narrower than average

The term font, as it is used in these documents, refers to a combination of weight and shape.

Solid/set solid
When no lead is added between lines of type (ie the point size and linespacing are the same), the lines are said to be “set solid.”
Track kerning/Line kerning
Sometimes, it’s advantageous to increase or decrease the amount of space between every letter in a line by an equal (usually small) amount, in order to fit more (or fewer) characters on the line. The correct term is letter spacing, but track kerning and line kerning (and sometimes, just "kerning") have come to mean the same thing.
Unbreakable space
Equal to word space, however words separated by an unbreakable space will always be kept together on the same line. Expands and contracts like word space. Useful for proper names, which one should, whenever possible, avoid splitting onto two lines. In groff, unbreakable space is entered with \~ (ie a backslash followed by a tilde)
Weight
The thickness of the strokes of letterforms. Medium and Book have average thicknesses and are the weights used for most of the text in books, magazines, newspapers, etc. Light has strokes slightly thinner than Medium or Book, but is still acceptable for most text. Semibold, Bold, Heavy and Black all have strokes of increasing thickness, making them suitable for headings and the like.
Word space
The amount of whitespace between words. When text is justified, word space expands or contracts to make the margins flush.
x-height
The height of a lower case letter x in a given font at a given point size. Generally used to mean the average height of the bowl of lower case letters.

Groff terms

Alias
A macro invoked by a name different from its “official” name. For example, the official name of the macro to change family is FAMILY. Its alias is FAM. Aliases may be created for any macro (via the ALIAS macro) provided the alias uses a name not already taken by the mom macros or one of the groff primitives. For a complete list of words or names you must not use, see the list of reserved words.
Arguments
Parameters or information needed by a macro to do its job. For example, in the macro .PT_SIZE 12 12 is the argument. In the macro .QUAD LEFT LEFT is the argument. Arguments are separated from macros by spaces. Some macros require several arguments; each is separated by a space.
Comment Lines
Input lines introduced with the comment character \# (ie a backslash followed by the pound sign). When processing output, groff silently ignores everything on a line that begins with the comment character.
Control Lines
Instructions to groff that appear on a line by themselves, which means that “control lines” are either macros or groff primitives. Control lines begin with a period or, occasionally, an apostrophe.
Filled lines/fill mode
Automatic justification or quadding. In fill mode, the ends of lines as they appear in your text editor are ignored. Instead, words from adjoining input lines are added one at a time to the output line until no more words fit. Then, depending whether text is to be justified or quadded (left, right, or centre), and depending on whether automatic hyphenation is turned on, groff attempts to hyphenate the last word, or, barring that, spreads and breaks the line (when justification is turned on) or breaks and quads the line (when quadding is turned on).

Nofill mode (non-filled text) means that groff respects the ends of lines exactly as they appear in your text editor.

Inline escapes
Instructions issued to groff that appear as part of an input line (as opposed to macros, which must appear on a line by themselves). Inline escapes are always introduced by the backslash character. For example, A line of text with the word T\*[BU 2]oronto in it contains the inline escape \*[BU 2] (which means “move the letter ‘o’ 2 kern units closer to the letter ‘T’”).

Mom’s inline escapes always take the form \*[<ESCAPE>], where ESCAPE is composed of capital letters, sometimes followed immediately by a digit, sometimes followed by a space and a numeric argument. Groff’s escapes begin with the backslash character but typically have no star and are in lower case. For example, the mom escapes to move forward 6 points on a line are either \*[FP6]  or  \*[FWD 6p] while the groff escape for the same thing is \h’6p’

Input line
A line of text as it appears in your text editor.
Macros
Instructions embedded in a document that determine how groff processes the text for output. mom’s macros always begin with a period, on a line by themselves, and must be typed in capital letters. Typically, macros contain complex commands issued to groff—behind the scenes—via groff primitives.
Machine units
A machine unit is 1/1000 of a point when the groff device is ps. (“ps” means “PostScript”—the default device for which groff prepares output, and the device for which mom was specifically designed.)
Numeric argument
An argument that has the form of a digit. Numeric arguments can be built out of arithmetic expressions using +, -, *, and / for plus, minus, times, and divided-by respectively. If a numeric argument requires a unit of measure, a unit of measure must be appended to every digit in the argument. For example: .ALD 1i-1v

IMPORTANT: groff does not respect the order of operations, but rather evaluates arithmetic expressions from left to right. Parentheses must be used to circumvent this peculiarity. Not to worry, though. The likelihood of more than just the occasional plus or minus sign when using mom’s macros is slim.

Output line
A line of text as it appears in output copy.
Primitives
The lowercase instructions, introduced with a period, that groff uses as its native command language, and out of which macros are built. The majority of groff’s primitive requests are two letters long.
String Argument
Technically, any argument that is not numeric. In this documentation, string argument means an argument that requires the user to input text. For example, in the macro .TITLE "My Pulitzer Novel" "My Pulitzer Novel" is a string argument.

Because string arguments must be enclosed by double-quotes, you can’t use double-quotes as part of the string argument. If you need double-quotes to be part of a string argument, use the inline escapes \(lq and \(rq (leftquote and rightquote respectively) in place of the double-quote character (").

Unit of measure
The single letter after a numeric argument that tells mom what measurement scale the argument should use. Common valid units are: i (inches) p (points) P (Picas) c (centimetres) m (ems) n (ens) u (machine units) v (the current leading [line space])

Units of measure must come immediately after the numeric argument (ie with no space between the argument and the unit of measure), like this: .ALD 2v .LL 39P .IL 1i The above example advances 2 line spaces and sets the line length to 39 picas with a left indent of 1 inch.

IMPORTANT: Most mom macros that set the size or measure of something must be given a unit of measure since most of the macros do not have default units of measure. There are a couple of exceptions, the most notable of which are PT_SIZE and LS. Both use points as the default unit of measure, which means you don’t have to append “p” to their argument.

You can enter decimal values for any unit of measure. Different units may be combined by adding them together (eg 1.5i+2m, which gives a measure of 1-1/2 inches plus 2 ems).

Note: a pica is composed of 12 points, therefore 12.5 picas is 12 picas and 6 points, not 12 picas and 5 points. If you want 12 picas and 5 points, you have to enter the measure as 12P+5p.

Zero-width character
The inline escape that allows you to print a literal period, apostrophe and, if output lines are filled, a space that falls at the beginning of an input line. It looks like this: \& (ie a backslash followed by an ampersand) Normally, groff interprets a period (or an apostrophe) at the beginning of an input line as meaning that what follows is a control line. In fill modes, groff treats a space at the beginning of an input line as meaning “start a new line and put a space at the beginning of it.” If you want groff to interpret periods and apostrophes at the beginning of input lines literally (ie print them), or spaces at the beginning of input lines as just garden variety word spaces, you must start the line with the zero-width character.

Mom terms

Blockquote
Cited material other than quotes. Typically set at a smaller point size than paragraph text, indented from the left and right margins. Blockquotes are filled.
Control macro
Macros used in document processing to control/alter the appearance of document elements (eg headings, quotes, footnotes, headers, etc.).
Document header/docheader
Document information (title, subtitle, author, etc) output at the top of page one.
Epigraph
A short, usually cited passage that appears at the beginning of a chapter, story, or other document.
Document information (frequently author and title) output in the bottom margin of pages after page one. Not to be confused with footnotes, which are considered part of running text.
The title used to identify a section of a document. Headings are hierarchic, corresponding to the notion of head, subhead, subsubhead, etc.
Document information (frequently author and title) output in the top margin of pages after page one.

Note: In terms of content and style, headers and footers are the same; they differ only in their placement on the page. In most places in this documentation, references to the content or style of headers applies equally to footers.

Linebreak/author linebreak
A gap in the vertical flow of running text, frequently set off by typographic symbols such as asterisks or daggers. Used to indicate a shift in the content of a document (eg a scene change in a short story). Also commonly called a scene break or a section break.
Paragraph head
A heading joined to the body of a paragraph.
A portion of text that, when clicked on in a PDF viewer, navigates to a bookmarked location in a document, generally but not exclusively a heading. PDF links are usually coloured to make them stand out from the surrounding text.
PDF outline
The hierarchically-arranged navigation outline provided by most PDF viewers (eg Okular, Evince), typically in a panel to the left of the document window, and usually labeled “Contents”.
Quote
A quote, to mom, is a line-for-line setting of quoted material (eg poetry, song lyrics, or a snippet of programming code). You don’t have to use BR with quotes.
Running text
In a document formatted with mom, running text means text that forms the body of the document, including elements such as headings. Docheaders, headers, footers and page numbers are not part of running text.
Toggle
A macro or tag that, when invoked without an argument, begins something or turns a feature on, and, when invoked with ANY argument, ends something or turns a feature off. See Example 3 of the section How to read macro arguments.

Back to Table of Contents Top Next: Using mom

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/headfootpage.html0000644000000000000000000000013212426110213022717 xustar000000000000000030 mtime=1415090315.613519146 30 atime=1415090315.613519146 30 ctime=1415090315.613519146 groff-1.22.3/contrib/mom/momdoc/headfootpage.html0000644000175000001440000023366612426110213021575 0ustar00wlusers00000000000000 Mom -- Document processing, page headers/footers and pagination
Back to Table of Contents Next: Recto/verso printing, collating

Page headers/footers, pagination


Table of contents

Managing page headers and footers

Control macros for headers/footers

User-defined, single string recto/verso headers/footers

Headers and footers on the same page

Pagination

Inserting blank pages into a document


Managing page headers and footers

Note: Because headers and footers are virtually identical, this documentation addresses itself only to headers. In all cases, unless otherwise noted, descriptions of headers describe footers as well.

Furthermore, any control macro that begins with HEADER_ may be used to control footers, simply by replacing HEADER_ with FOOTER_.

Headers and footers, as defined in the section Mom’s Document Processing Terms, are those parts of a document that contain information about the document itself which appear in the margins either above or below running text. They are, in all respects but two, identical. The differences are:

  1. headers appear in the margin above running text while footers appear in the margin beneath running text;
  2. the (optional) rule that separates headers from running text appears below the header while the (optional) rule that separates footers from running text appears above the footer.

Note: While the single page number that mom generates in either the top or bottom margin above or below running text is technically a kind of header/footer, mom and this documentation treat it as a separate page element.

Author's note: Left to their own devices (ie if you’re happy with the way mom does things by default), headers are something you never have to worry about. You can skip reading this section entirely. But if you want to change them, be advised that headers have more macros to control their appearance than any other document element. The text of this documentation becomes correspondingly dense at this point.

General description of headers/footers

Headers comprise three distinct parts: a left part, a centre part, and a right part. Each part contains text (a “string”) that identifies some aspect of the document as a whole.

The left part (“header-left”) lines up with the document’s left margin. The centre part (“header centre”) is centred on the document’s line length. The right part (“header-right”) lines up with the document’s right margin. Not all parts need contain a string, and if you don’t want headers at all, you can turn them off completely.

Note to groff experts: Although mom’s headers resemble the three-part titles generated by .tl, they’re in no way related to it, nor based upon it. .tl is not used at all in mom.

Normally, mom fills headers with strings appropriate to the document type selected with DOCTYPE. You can, however, supply whatever strings you like—including page numbers—to go in any part of headers. What’s more, you can set the family, font, size, colour and capitalization style (caps or caps/lower-case) for each header part individually.

By default, mom prints a horizontal rule beneath headers to separate them visually from running text. In the case of footers, the rule is above. You can increase or decrease the space between the header and the rule if you like (with HEADER_RULE_GAP), or remove it completely.

Default specs for headers/footers

Mom makes small type adjustments to each part of the header (left, centre, right) to achieve an aesthetically pleasing result. The defaults are listed below. (The strings mom puts by default in each part are explained in DOCTYPE.)

Note: Except for capitalization (all caps or caps/lower-case), these defaults apply only to PRINTSTYLE TYPESET.

TYPE SPEC HEADER LEFT HEADER CENTER HEADER RIGHT --------- ----------- ------------- ------------ Family document default document default document default Font roman italic roman Colour (black) (black) (black) All caps no no yes Size* -.5 (points) -.5 (points) -2 (points) (-2 if all caps) (-2 if all caps) (-.5 if not all caps) *Relative to the point size of type in paragraphs

You can, of course, change any of the defaults using the appropriate control macros. And should you wish to design headers from the ground up, mom has a special macro, HEADER_PLAIN, that removes all type adjustments to headers. The straightforward type specs for paragraphs are used instead, providing a simple reference point for any alterations you want to make to the family, font, size and capitalization style of any header part.

Vertical placement and spacing of headers/footers

As explained in the section, Typesetting macros during document processing, the top and bottom margins of a mom document are the vertical start and end positions of running text, not the vertical positions of headers or footers, which, by definition, appear in the margins above (or below) running text.

The vertical placement of headers is controlled by the macro HEADER_MARGIN, which establishes the baseline position of headers relative to the top edge of the page. The header rule, whose position is relative to the header itself, is controlled by a separate macro.

FOOTER_MARGIN is the counterpart to HEADER_MARGIN, and establishes the baseline position of footers relative to the bottom edge of the page.

The distance between headers and the start of running text can be controlled with the macro, HEADER_GAP (effectively making HEADER_MARGIN + HEADER_GAP the top margin of running text unless you give mom a literal top margin (with T_MARGIN), in which case she ignores HEADER_GAP and begins the running text at whatever top margin you give.

FOOTER_GAP and B_MARGIN work similarly, except they determine where running text ends on the page. (See Important – footer margin and bottom margins for a warning about possible conflicts between the footer margin and the bottom margin.)

Confused? Mom apologizes. It’s really quite simple. By default, mom sets headers 4-1/2 picas down from the top of the page and begins the running text 3 picas (the HEADER_GAP) beneath that, which means the effective top margin of the running text is 7-1/2 picas (visually approx. 1 inch). However, if you give mom a literal top margin (with T_MARGIN), she ignores the HEADER_GAP and starts the running text at whatever top margin you give.

Footers are treated similarly. Mom sets footers 3 picas up from the bottom of the page, and interrupts the processing of running text 3 picas (the FOOTER_GAP) above that (again, visually approx. 1 inch). However, if you give mom a literal bottom margin (with B_MARGIN), she ignores the FOOTER_GAP and interrupts the processing of running text at whatever bottom margin you give.

If mom is paginating your document (she does, by default, at the bottom of each page), the vertical spacing and placement of page numbers, whether at the top or the bottom of the page, is managed exactly as if the page numbers were headers (or footers), and are controlled by the same macros. See Pagination control.


Managing headers/footers

The following are the basic macros for turning headers or footers on or off. They should be invoked prior to START.

By default, mom prints page headers. If you turn them off, she will begin the running text on each page with a default top margin of 6 picas unless you have requested a different top margin (with T_MARGIN) prior to START.

Note: HEADERS and FOOTERS are mutually exclusive. If headers are on, footers (but not bottom-of-page numbering) are automatically turned off. Equally, if footers are on, headers (but not top-of-page numbering) are automatically turned off. Thus, if you’d prefer footers in a document, you need only invoke .FOOTERS; there’s no need to turn headers off first.

If you need both headers and footers, there’s a special macro, HEADERS_AND_FOOTERS, that allows you to set it up.

Headers

Macro: HEADERS toggle

Page headers are on by default. If you don’t want them, turn them off by invoking .HEADERS with any argument (OFF, QUIT, END, X...), eg
.HEADERS OFF

NOTE: HEADERS automatically disables footers (you can’t have both), but not the page numbers that normally appear at the bottom of the page.

ADDITIONAL NOTE: If HEADERS are OFF, mom’s normal top margin for running text (7.5 picas) changes to 6 picas (visually approx. 1 inch). This does NOT apply to the situation where footers have been explicitly turned on (with FOOTERS). Explicitly invoking footers moves page numbering to the top of the page, where its placement and spacing are the same as for headers (i.e. the top margin of running text remains 7.5 picas.)

Footers

Macro: FOOTERS toggle

Page footers are off by default. If you want them instead of headers (you can’t have both), turn them on by invoking .FOOTERS without an argument, eg
.FOOTERS

FOOTERS automatically disables headers, and mom shifts the placement of page numbers from their normal position at page bottom to the top of the page.

NOTE: By default, when footers are on, mom does not print a page number on the first page of a document, nor on first pages after COLLATE. If you don’t want this behaviour, you can change it with PAGENUM_ON_FIRST_PAGE.

Macro: FOOTER_ON_FIRST_PAGE toggle

If you invoke .FOOTERS, mom, by default, does not print a footer on the first page of the document. (The docheader on page 1 makes it redundant.) However, should you wish a footer on page 1, invoke .FOOTER_ON_FIRST_PAGE without any argument.


Control macros for headers/footers

Virtually every part of headers (and footers; see the note on how “headers” means “footers” in the Introduction to headers/footers) can be designed to your own specifications.

Header/footer control macros and defaults

  1. Header/footer strings
  2. Header/footer style
  3. Header/footer vertical placement and spacing
  4. Header/footer separator rule

1. Header/footer strings

”Macro: HEADER_LEFT “<text of header-left> | #
”Macro: HEADER_CENTER “<text of header-centre> | #
”Macro: HEADER_RIGHT “<text of header-right> | #

To change the text (the “string”) of the left, centre, or right part of headers, invoke the appropriate macro, above, with the string you want. For example, mom, by default, prints the document’s author in the header-left position. If your document has, say, two authors, and you want both their names to appear header-left, change HEADER_LEFT like this:
.HEADER_LEFT "R. Stallman, E. Raymond"

Because the arguments to HEADER_LEFT, _CENTER, and _RIGHT are string arguments, they must be enclosed in double-quotes.

Note: Replace HEADER_, above, with FOOTER_ to change the strings in footers.

Padding the header/footer centre string

Macro: HEADER_CENTER_PAD LEFT | RIGHT <amount of space by which to pad centre string left or right>

• Requires a unit of measure

By default, mom centres the header-centre string on the line length in effect for page headers.

In some cases, notably when the header-left or header-right strings are particularly long, the effect isn’t pretty. The offendingly long header-left or right crowds, or even overprints, the header-centre. That’s where HEADER_CENTER_PAD comes in. With a bit of experimentation (yes, you have to preview the document), you can use HEADER_CENTER_PAD to move the header-centre string left or right until it looks acceptably centred between the two other strings.

For example, say your document is an outline for a novel called By the Shores of Lake Attica. You’ve told mom you want
.DOCTYPE NAMED "Outline" but when you preview your work, you see that “Outline”, in the centre of the page header, is uncomfortably close to the title, which is to the right. By invoking
.HEADER_CENTER_PAD RIGHT 3P you can scoot the word "Outline" over three picas to the left (because the padding is added onto the right of the string) so that your head looks nicely spaced out. Invoking .HEADER_CENTER_PAD with the LEFT argument puts the padding on the left side of the string so that it scoots right.

Most reassuring of all is that if you use HEADER_CENTER_PAD conjunction with RECTO_VERSO, mom will pad the centre string appropriately left OR right, depending on which page you’re on, without you having to tell her to do so.

Using mom’s reserved strings in header/footer definitions

As pointed out in the Author’s note in the introduction to headers/footers, headers and footers are something you don’t normally have to worry much about. Mom usually knows what to do.

However, situations do arise where you need to manipulate what goes in the header/footer strings, setting and resetting them as you go along.

A case where you might want to do this would be if you want to output endnotes at the end of each document in a series of collated documents, and you want the word "Endnotes" to go in the header centre position of the endnotes, but want, say, the TITLE to go back into the centre position for the next output document.

In scenarios like the above, mom has a number of reserved strings you can plug into the HEADER_LEFT, _CENTER and _RIGHT macros. They are:
\E*[$TITLE] —the current argument passed to .TITLE \E*[$DOCTITLE] —the current argument passed to .DOCTITLE \E*[$DOC_TYPE] —the NAMED argument passed to .DOCTYPE \E*[$AUTHOR] —the current first argument passed to .AUTHOR \E*[$AUTHOR_1...9] —the current arguments passed to .AUTHOR \E*[$AUTHORS] —a comma-separated concatenated string of all the current arguments passed to .AUTHOR (ie a list of authors) \E*[$CHAPTER_STRING] —the current argument passed to .CHAPTER_STRING, if invoked, otherwise, "Chapter" \E*[$CHAPTER] —the current argument (typically a number) passed to .CHAPTER \E*[$CHAPTER_TITLE] —the current argument passed to .CHAPTER_TITLE Returning to the scenario above, first, you’d define a centre string for the endnotes page:
.HEADER_CENTER "Endnotes" Then, you’d output the endnotes:
.ENDNOTES Then, you’d prepare mom for the next document:
.COLLATE .TITLE "New Doc Title" .AUTHOR "Josephine Blough" Then, you’d redefine the header-centre string using the reserved string \*[$TITLE], like this:
.HEADER_CENTER "\E*[$TITLE]" And last, you’d do:
.START Voilà! Any argument you pass to TITLE from here on in (say, for subsequent documents) is back in the header-centre position. Here’s the whole routine again:
.HEADER_CENTER "Endnotes" .ENDNOTES .COLLATE .TITLE "New Doc Title" .AUTHOR "Josephine Blough" .HEADER_CENTER "\E*[$TITLE]" .START

If need be, you can concatenate the strings, as in the following example.
.HEADER_CENTER "\E*[$CHAPTER_STRING] \E*[$CHAPTER]" which, assuming a .CHAPTER_STRING of "Chapter" and a .CHAPTER of "2", would put “Chapter 2” in the header-centre position.

Replacing header-left, -centre or -right with the page number

If you would like to have the current page number appear in the header-left, -centre, or -right position instead of a text string, invoke the appropriate macro, above, with the single argument # (the “number” or “pound” sign). Do not surround the pound size with double-quotes, as you would normally do if the argument to .HEADER_CENTER were a string. For example,
.HEADER_CENTER # (notice, no double-quotes) will print the current page number in the centre part of headers.

Including the page number in header-left, -CENTER or -right

If you would like to include the current page number in the string you pass to HEADER_LEFT, _CENTER, or _RIGHT, (as opposed to replacing the string with the page number), use the special inline escape \*[PAGE#] in the string argument.

For example, say you have a document that’s ten pages long, and you want header-right to say “page <whichever> of 10”, invoke .HEADER_RIGHT as follows:
.HEADER_RIGHT "page \*[PAGE#] of 10" The header-right of page two will read “page 2 of 10”, the header-right of page three will read “page 3 of 10”, and so on.

2. Header/footer style

Global changes

The following macros allow you to make changes that affect all parts of the header at once.

Macro: HEADER_FAMILY <family>

By default, mom uses the default document family for headers. If you would like her to use another family in headers, invoke .HEADER_FAMILY with the identifier for the family you want. The argument is the same as for the typesetting macro FAMILY.

Replace HEADER_, above, with FOOTER_ to change the footer family.

Macro: HEADER_SIZE <+|-number of points>

• Argument is relative to the point size of type in paragraphs. See Arguments to the control macros for an explanation of how control macros ending in _SIZE work.

By default, mom makes small adjustments to the size of each part of a header to achieve an aesthetically pleasing result. If you’d like her to continue to do so, but would like the overall appearance of headers to be a little smaller or a little larger, invoke .HEADER_SIZE with + or - the number of points (fractions allowed) by which you want her to in/decrease the size of headers. For example,
.HEADER_SIZE +.75 increases the size of every part of a header by 3/4 of a point while respecting mom’s own little size changes.

Replace HEADER_, above, with FOOTER_ to change the footer size.

Note: Normally, macros that control headers have no effect on PRINTSTYLE TYPEWRITE. HEADER_SIZE is an exception. While all parts of a header in PRINTSTYLE TYPEWRITE are always the same size, you can use HEADER_SIZE with PRINTSTYLE TYPEWRITE to reduce the header’s overall point size. You’ll most likely require this when the COPYSTYLE is DRAFT, since portions of the header may overprint if, say, the title of your document is very long.

Macro: HEADER_COLOR <colorname>

If you want your headers in a colour different from the document default (usually black), invoke .HEADER_COLOR with the name of a colour pre-defined (or “initialized”) with NEWCOLOR or XCOLOR.

HEADER_COLOR will set all the parts of the header plus the header rule in the colour you give it as an argument. If you wish finer control over colour in headers, you can use HEADER_<POSITION>_COLOR to colourize each part of the header separately, as well as HEADER_RULE_COLOR to change the colour of the header rule.

Replace HEADER_, above, with FOOTER_ to colourize footers.

Macro: HEADER_PLAIN

By default, mom makes adjustments to the font, size, and capitalization style of each part of headers to achieve an aesthetically pleasing look. Should you wish to design your own headers from the ground up without worrying how changes to the various elements of header style interact with mom’s defaults, invoke .HEADER_PLAIN by itself, with no argument. Mom will disable her default behaviour for headers, and reset all elements of header style to the same family, font, point size and colour as she uses in paragraphs.

Replace HEADER_, above, with FOOTER_ to disable mom’s default behaviour for the various elements of footer style.

3. Part by part changes

When using the following control ”macros, replace “<POSITION> by LEFT, CENTER, or RIGHT as appropriate.

Macro: HEADER_<POSITION>_FAMILY <family>

Use HEADER_<POSITION>_FAMILY to change the family of any part of headers. See Arguments to the control macros for an explanation of how control macros ending in _FAMILY work.

Replace HEADER_, above, with FOOTER_ to change a footer part’s family.

Macro: HEADER_<POSITION>_FONT <font>

Use HEADER_<POSITION>_FONT to change the font of any part of headers. See Arguments to the control macros for an explanation of how control macros ending in _FONT work.

Replace HEADER_, above, with FOOTER_ to change a footer part’s font.

Macro: HEADER_<POSITION>_SIZE <+|-number of points>

Use HEADER_<POSITION>_SIZE to change the size of any part of headers (relative to the point size of type in paragraphs). See Arguments to the control macros for an explanation of how control macros ending in _SIZE work.

Replace HEADER_, above, with FOOTER_ to change a footer part’s size.

Macro: HEADER_<POSITION>_CAPS toggle

HEADER_<POSITION>_CAPS is a toggle macro. If you want any part of headers to be set in all caps, regardless of the capitalization of that part’s string as given to the reference macros or as defined by you with the header string control macros, simply invoke this macro (using the appropriate position) with no argument. If you wish to turn capitalization off (say, for the header-right string that mom capitalizes by default), invoke the macro with any argument (eg OFF, QUIT, END, X...).

Replace HEADER_, above, with FOOTER_ to change a footer part’s capitalization style.

Macro: HEADER_<POSITION>_COLOR <colorname>

HEADER_<POSITION>_COLOR allows you to set a colour for each of the three possible parts of a page header separately. For example, say you want the right part of the header (by default, the document title) in red, this is how you’d get it:
.HEADER_RIGHT_COLOR red The other parts of the header will be in the default header colour (usually black, but that can be changed with HEADER_COLOR).

Remember that you have to define (or “initialize”) a colour with NEWCOLOR or XCOLOR before you can use the colour.

If you create a user-defined header with HEADER_RECTO or HEADER_VERSO, and you want various elements within the header to be colourized, embed the colours in the string passed to HEADER_RECTO or HEADER_VERSO with the \*[<colorname>] inline escape.

Replace HEADER_, above, with FOOTER_ to set the colours for the various elements of footers.

3. Header/footer vertical placement and spacing

See Vertical placement and spacing of headers/footers for an explanation of how mom deals with headers, footers, and top/bottom page margins.

Macro: HEADER_MARGIN <distance to baseline of header>

• Requires a unit of measure

Use HEADER_MARGIN to set the distance from the top edge of the page to the baseline of type in headers. A unit of measure is required, and decimal fractions are allowed.

Mom’s default header margin is 4-1/2 picas, but if you want a different margin, say, 1/2-inch, do
.HEADER_MARGIN .5i If your document uses footers, replace HEADER_, above, with FOOTER_. The argument to FOOTER_MARGIN is the distance from the bottom edge of the page to the baseline of type in footers. Mom’s default footer margin is 3 picas.

Header/footer margins and page numbering

Mom uses HEADER_MARGIN and FOOTER_MARGIN to establish the baseline position of page numbers in addition to the baseline position of headers and footers proper.

By default, page numbers appear at the bottom of the page, therefore if you want the default position (bottom), but want to change the baseline placement, use FOOTER_MARGIN. Conversely, if page numbers are at the top of the page, either because you turned FOOTERS on or because you instructed mom to put them there with PAGENUM_POS, you’d use HEADER_MARGIN to change their baseline placement.

Macro: HEADER_GAP <distance from header to start of running text>

• Requires a unit of measure

Use HEADER_GAP to set the distance from the baseline of type in headers to the start of running text. A unit of measure is required, and decimal fractions are allowed.

As explained in Vertical placement and spacing of headers/footers, HEADER_MARGIN + HEADER_GAP determine the default vertical starting position of running text on the page unless you have given mom your own top margin (with T_MARGIN). If you give a top margin, mom ignores HEADER_GAP; running text starts at your stated top margin.

Mom’s default header gap is 3 picas, but if you want a different gap, say, 2 centimetres, do
.HEADER_GAP 2c

If your document uses footers, replace HEADER_, above, with FOOTER_. The argument to FOOTER_GAP is the distance from the baseline of type in footers to the last baseline of running text on the page.

As explained in Vertical placement and spacing of headers/footers, FOOTER_MARGIN + FOOTER_GAP determine the default vertical end position of running text on the page unless you have given mom a bottom margin (with B_MARGIN). If you give a bottom margin, mom ignores FOOTER_GAP; running text ends at your stated bottom margin, subject to the restriction outlined here.

Mom’s default footer gap is 3 picas.

Note: Mom uses HEADER_GAP and FOOTER_GAP to establish the start and end baseline positions of running text with respect to both headers and footers AND page numbers. If you wish to change the gap between the last line of running text and a bottom page number, use FOOTER_GAP. If page numbers are at the top of the page, change the gap between the number and the first line of running text with HEADER_GAP.

4. Header/footer separator rule

The header/footer separator rule is a modest horizontal rule, set slightly below the header (or above the footer), that runs the length of the header and helps separate it visually from running text. If you don’t want the rule, you can turn it off. If you want it, but at a different vertical position relative to the header (or footer), you can alter its placement.

Macro: HEADER_RULE toggle

By default, mom prints a header separator rule underneath headers (or above footers). If you don’t want the rule, turn it off by invoking .HEADER_RULE with any argument (OFF, QUIT, END, X...), eg
.HEADER_RULE OFF To turn the rule (back) on, invoke .HEADER_RULE without any argument.

Note: Replace HEADER_, above, with FOOTER_ to enable/disable the printing of the footer separator rule. (Most likely, if you’re using FOOTERS, you’ll want it off.)

Macro: HEADER_RULE_WEIGHT <weight in points>

• Argument must NOT have a unit of measure appended

HEADER_RULE_WEIGHT controls the weight (“thickness”) of the header rule. Like RULE_WEIGHT, it takes a single argument: the weight of the header rule expressed in points but without the unit of measure, p, appended. The argument to HEADER_RULE_WEIGHT must be greater than 0 and less than 100; decimal fractions are allowed.

Say, for example, you want a really strong header separator rule.
.HEADER_RULE_WEIGHT 4 which sets the separator rule weight to 4 points, is how you’d do it.

Mom’s default header rule weight is 1/2 point.

Note: Replace HEADER_, above, with FOOTER_ to set the weight of the footer separator rule.

Macro: HEADER_RULE_GAP <distance of rule beneath header>

• Requires a unit of measure

HEADER_RULE_GAP is the distance from the baseline of type in headers to the top edge of the rule underneath. (If FOOTER_RULE_GAP, the gap is the distance from the top of the highest ascender to the bottom edge of the rule.) A unit of measure is required, and decimal fractions are allowed. Please note that HEADER_RULE_GAP has no effect on HEADER_GAP (ie HEADER_RULE_GAP is NOT added to HEADER_GAP when mom calculates the space between headers and the start of running text).

By default, the header rule gap is 4 points. If you’d like to change it to, say, 1/4 em, do
.HEADER_RULE_GAP .25m

Note: Replace HEADER_, above, with FOOTER_ if you’re using footers and want to change the separator rule gap. In footers, the gap is measured from the top of the tallest ascender in the footer.

Additional note: When using FOOTER_RECTO and FOOTER_VERSO, make sure that the default size for footers (FOOTER_SIZE) is set to the largest size of type that will be used in the footer or mom may not get the rule gap right. Inline changes to the size of type in FOOTER_RECTO and FOOTER_VERSO should always be negative (smaller) than the default.

Macro: HEADER_RULE_COLOR <colorname>

If you wish to change the colour of the header rule, invoke .HEADER_RULE_COLOR with the name of a colour pre-defined (or “initialized”) with NEWCOLOR or XCOLOR.

HEADER_RULE_COLOR overrides the colour set with HDRFTR_COLOR, so it’s possible to have the heads entirely in, say, blue (set with HEADER_COLOR), and the header rule in, say, red.

Note: Replace HEADER_, above, with FOOTER_ to change the colour of the footer rule.


User-defined, single string recto/verso headers/footers

Sometimes, you’ll find you can’t get mom’s handling of 3-part headers or footers to do exactly what you want in the order you want. This is most likely happen when you want the information contained in the headers/footers split over two pages, as is often the case with recto/verso documents.

Say, for example, you want recto page headers to contain a document’s author, centred, and verso page headers to contain the document’s title, also centred, like this:
+------------------------+ +------------------------+ | Author | | Title | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +------------------------+ +------------------------+ With mom’s standard 3-part headers, this isn’t possible, even when RECTO_VERSO is enabled. RECTO_VERSO switches the left and right parts of headers on alternate pages, but the centre part remains unchanged.

Any time you need distinctly different headers on alternate pages, mom has macros that let you manually design and determine what goes into headers on recto pages, and what goes into headers on verso pages. The macros are HEADER_RECTO and HEADER_VERSO. Both allow you to state whether the header is flush left, centred, or flush right, and both take a single string argument with which, by combining text and inline escapes, you can make the headers come out just about any way you want. Use of the \*[PAGE#] escape is permitted in the string argument (see Including the page number in header-left, -centre or -right), and, as an added bonus, mom provides a special mechanism whereby it’s possible to pad the string as well. The padding mechanism lets you create headers that contain left, centre and right parts like mom's defaults but entirely of your own design.

Macro: HEADER_RECTO LEFT | CENTER | RIGHT [ CAPS ] "<header recto string>"
Macro: HEADER_VERSO LEFT | CENTER | RIGHT [ CAPS ] "<header verso string>"

User-defined single string headers/footers (no recto/verso)
HEADER_RECTO may be used to create user-defined, single string headers (or footers, with FOOTER_RECTO), even when recto/verso is not enabled (with RECTO_VERSO). In such cases, the header/footer you create is the one used on every page, making HEADER_RECTO your “I need to design my own headers from scratch” solution.

HEADER_RECTO and HEADER_VERSO behave identically, hence all references to HEADER_RECTO in this section also refer to HEADER_VERSO. Furthermore, FOOTER_ can be used instead of HEADER_ to set up recto/verso footers.

The first argument to HEADER_RECTO is the direction in which you want the header quadded. L, C and R may be used in place of LEFT, CENTER and RIGHT.

The second argument (optional) tells mom to capitalize the text of the header. Please note: Do not use \*[UC]...\*[LC] inside the string passed to HEADER_RECTO.

The final argument is a string, surrounded by double-quotes, containing what you want in the header. HEADER_RECTO disables mom’s normal 3-part headers, therefore anything you want in the headers must be entered by hand in the string, including colours (via the inline escape \*[<colorname>]).

By default, HEADER_RECTO is set at the same size, and in the same family and font, as paragraph text. The control macros HEADER_FAMILY and HEADER_SIZE may be used to change the default family and size. Changes to the font(s) within the string must be accomplished with the inline escapes \*[ROM], \*[IT], \*[BD], \*[BDI] and \*[PREV] (see Changing fonts). Additional refinements to the style of the header-recto string, including horizontal spacing and/or positioning, can also be made with inline escapes.

To include the current page number in the string, use the \*[PAGE#] inline escape.

Padding the header-recto/header-verso string

You can “pad” the header-recto string, a convenience you’ll appreciate in circumstances such as the following.
VERSO RECTO +------------------------+ +------------------------+ | Author Page# | | Page# Title | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +------------------------+ +------------------------+

There are two steps to padding the string argument passed to HEADER_RECTO (if you’re unsure what padding is, see Insert space into lines).

  1. Begin and end the string (inside the double-quotes) with the caret character (^).
  2. Enter the pound sign (#) at any point in the string where you want an equalized amount of whitespace inserted.

The situation depicted above is accomplished like this:
.HEADER_RECTO LEFT "^\*[PAGE#]#\E*[$TITLE]^" .HEADER_VERSO LEFT "^\E*[$AUTHOR]#\*[PAGE#]^" Notice that the quad argument, LEFT, is used in both cases. When padding a header, it doesn’t matter which quad argument you use, although you must be sure to supply one. Also note that mom does not interpret the # in \*[PAGE#] as a padding marker (ie as a place to insert whitespace).

Important: The PAD_MARKER macro, which changes the default pad marker (#) used by PAD, has no effect on the pad marker used in the HEADER_RECTO string. If you absolutely must have a literal pound sign in your HEADER_RECTO string, use the escape sequence for the pound sign ( \[sh] ) where you want the pound sign to go.

Headers and footers on the same page

Normally, mom prints either a header or a footer, but not both, depending on whether HEADERS or FOOTERS is enabled. (Page numbering, whether in the top margin or the bottom, is not considered a header or a footer.) Should you need both headers and footers on the same page, the single macro, HEADERS_AND_FOOTERS, is the way to set it up.

Macro: HEADERS_AND_FOOTERS (see Invocation)

Invocation:
.HEADERS_AND_FOOTERS \ <L | C | R> "<header-recto string>" \ <L | C | R> "<footer-recto string>" \ <L | C | R> "<header-verso string>" \ <L | C | R> "<header-verso string>" or .HEADERS_AND_FOOTERS <anything>

Unlike the macros, HEADERS and FOOTERS, which are toggle macros, HEADERS_AND_FOOTERS requires that you supply the information you want in the headers and footers yourself. Mom does no automatic generation of things like the title and the author in headers and footers when you’re using HEADERS_AND_FOOTERS. Furthermore, style changes—family, font, pointsize, colour, capitalization, etc —are entirely your responsibility and must be made with inline escapes in the arguments passed to “<recto ”header string>“, <recto footer string>“, etc. By default, mom sets the headers and footers created with HEADERS_AND_FOOTERS in the same family, font, point size, capitalization style and colour as running text.

The manner of entering what you want is identical to the way you input single string headers and footers. I suggest reading up on them, as well as looking at the entries, HEADER_RECTO and Using mom’s reserved strings in header/footer definitions.

The same padding mechanism used in HEADER_RECTO and HEADER_VERSO is available in the string arguments passed to HEADERS_AND_FOOTERS, allowing you to simulate two- and three-part headers and footers.

L | C | R in the arguments to HEADERS_AND_FOOTERS refers to whether you want the specific header or footer part on the left, in the middle, or on the right. (You can also use the longer forms, LEFT, CENTER and RIGHT.) The string you give afterwards is whatever text you want, including mom’s reserved strings, and whatever inline escapes you need to change things like family and font, pointsize, colour, etc. as you go along.

Note the backslashes in the invocation, above. Every set of arguments given this way to HEADERS_AND_FOOTERS except the last requires a backslash after it. The use of backslashes isn’t required if you want to put the entire argument list on the same (very long!) line as the macro itself; I recommend sticking to the style shown above to keep things manageable.

If you want to disable having both headers and footers on the same page, invoke .HEADERS_AND_FOOTERS with any argument you want (eg OFF, QUIT, END, X...). Mom will restore her default behaviour of setting automatically generated page headers, with the page number, centered, at the bottom of the page. If you would prefer footers instead of headers after turning HEADERS_AND_FOOTERS off, invoke .FOOTERS afterwards.

Examples of HEADERS_AND_FOOTERS usage

Example 1: Header and footer the same on every page
.HEADERS_AND_FOOTERS \ +-----------------------+ C "\E*[$TITLE]" \ | Title | L "^\E*[$AUTHOR]#\*[PAGE#]^" | | | | | | | | | | | | | | | | | | | | | | | | | Author Pg. # | +-----------------------+

\E*[$TITLE] and \E*[$AUTHOR] will print the strings you pass to TITLE and AUTHOR; \*[PAGE#] is how you include the page number in a header or footer string. (For a list of special strings you can use in headers and footers, see here.)

You don’t have to use these special strings. You can type in anything you like. I’ve only used them here to show that they’re available.

Example 2: Different headers and footers on recto/verso pages
.HEADERS_AND_FOOTERS \ C "BOOK TITLE" \ L "^\*[PAGE#]#\E*[$AUTHOR]^" \ C "Story Title" \ L "^\E*[$AUTHOR]#\*[PAGE#]^" +-----------------------+ +------------------------+ | BOOK TITLE | | Story Title | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pg. # Author | | Author Pg.# | +-----------------------+ +------------------------+

Pagination

By default, mom paginates documents. Page numbers appear in the bottom margin of the page, centred between two hyphens. As with all elements of mom’s document processing, most aspects of pagination style can be altered to suit your taste with control macros.

Pagination macros

Macro: PAGINATE toggle

Alias: PAGINATION

By default, mom paginates documents (in the bottom margin). If you’d prefer she not paginate, turn pagination off by invoking .PAGINATE with any argument (OFF, NO, QUIT, END, X...), eg
.PAGINATE NO To (re)start pagination, invoke .PAGINATE without any argument.

Macro: PAGENUMBER <number>

As is to be expected, pagination of documents begins at page 1. If you’d prefer that mom begin with a different number on the first page of a document, invoke .PAGENUMBER with the number you want.

PAGENUMBER need not be used only to give mom a "first page" number. It can be used at any time to tell mom what number you want a page to have. Subsequent page numbers will, of course, be incremented by 1 from that number.

Macro: PAGENUM_STYLE DIGIT | ROMAN | roman | ALPHA | alpha

PAGENUM_STYLE lets you tell mom what kind of page numbering you want.
DIGIT Arabic digits (1, 2, 3...) ROMAN upper case roman numerals (I, II, III...) roman lower case roman numerals (i, ii, iii...) ALPHA upper case letters (A, B, C...) alpha lower case letters (a, b, c...)

Macro: PAGENUM_ON_FIRST_PAGE toggle

This macro applies only if you’ve enabled FOOTERS. If FOOTERS are on, mom automatically places page numbers at the tops of pages except on the first page of a document (or on first pages after COLLATE). If you’d like the page number to appear on “first” pages when footers are on, invoke
.PAGENUM_ON_FIRST_PAGE with no argument. Any other argument turns the feature off (OFF, QUIT, END, X, etc).

As with most of the control macros, PAGENUM_ON_FIRST_PAGE can be invoked at any time, meaning that if you don’t want a page number on the very first page of a document, but do want one on pages that appear after COLLATE, omit it before the first START of the document, then invoke it either just before or after your first COLLATE.

Macro: DRAFT_WITH_PAGENUMBER

Sometimes, in COPYSTYLE DRAFT, the CENTER part of page headers gets overcrowded because of the draft and revision information that go there by default. DRAFT_WITH_PAGENUMBER is one way to fix the problem.

Invoked without an argument, .DRAFT_WITH_PAGENUMBER removes draft/revision information from the page headers and attaches it instead to the document’s page numbering, in the form
Draft #, Rev. # / <pagenumber> If you have not supplied mom with a draft number (with DRAFT) DRAFT_WITH_PAGENUMBER will assume “Draft 1“, and will print it before the page number.

See the note in COPYSTYLE DRAFT for other ways of dealing with crowded page headers when formatting draft-style copy.

1. Page number family/font/size/colour

See Arguments to the control macros.

.PAGENUM_FAMILY default = prevailing document family; default is Times Roman .PAGENUM_FONT default = roman .PAGENUM_SIZE default = 0 (ie same size as paragraph text) .PAGENUM_COLOR default = black

2. Page number position

Macro: PAGENUM_POS TOP | BOTTOM  LEFT | CENTER | RIGHT

Use PAGENUM_POS to change the default position of automatic page numbering. PAGENUM_POS requires two arguments: a vertical position (TOP or BOTTOM) and a horizontal position (LEFT or CENTER or RIGHT).

For example, if you turn both headers and footers off (with .HEADERS OFF and .FOOTERS OFF) and you want mom to number your pages at the top right position, enter
.PAGENUM_POS TOP RIGHT

Note: HEADERS must be OFF for PAGENUM_POS TOP to work.

3. Enclose page numbers with hyphens (on or off)

Macro: PAGENUM_HYPHENS toggle

By default, mom encloses page numbers between hyphens. If you don’t want this behaviour, invoke the macro PAGENUM_HYPHENS with any argument (OFF, QUIT, END, X, etc), like this:
.PAGENUM_HYPHENS OFF If, for some reason, you want to turn page number hyphens back on, invoke the macro without an argument.

Inserting blank pages into a document

Macro: BLANKPAGE <# of blank pages to insert> [DIVIDER [NULL]]

This one does exactly what you’d expect—inserts a blank page (or pages) into a document. Unless you give the optional argument, NULL, mom silently increments the page number of every blank page and keeps track of recto/verso stuff, but otherwise does nothing. This is useful for forcing new sections of a document onto recto pages, but may have other applications as well.

The required argument to BLANK_PAGE is the number of blank pages to insert. The argument is not optional, hence even if you only want one blank page, you have to tell mom:
.BLANKPAGE 1 The optional argument, DIVIDER, must be given if you’re inserting a blank page before the start of any new document section (ie a new chapter, or endnotes, a bibliography, or table of contents). Without the DIVIDER argument, mom simply inserts the blank pages and prepares the next page to receive running text.

NULL, which is also optional, allows you to output the specified number of pages without mom incrementing the page number for each blank page. She will, however, continue to keep track of which pages are recto/verso if recto/verso printing has been enabled.


Back to Table of Contents Top Next: Recto/verso printing, collating

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/cover.html0000644000000000000000000000013212426110213021407 xustar000000000000000030 mtime=1415090315.612519159 30 atime=1415090315.612519159 30 ctime=1415090315.612519159 groff-1.22.3/contrib/mom/momdoc/cover.html0000644000175000001440000005552212426110213020256 0ustar00wlusers00000000000000 Mom -- Document processing, creating cover pages
Back to Table of Contents Next: Tables of contents

Creating cover pages


Introduction to cover pages

Though identical in treatment, mom provides two kinds of cover pages: document cover pages (”doc covers”), and section cover pages (which I shall refer to simply as cover pages).

A doc cover is what you’d most likely use at the start of a collated document, where you might want the name of the complete document, the author(s) and the copyright line to appear. Another place you might use a doc cover is for a novel, where you want the title of the novel, not the chapter title or chapter number, as the first cover page.

A cover is what you’d use for pages that separate sections of a collated document, ie title pages. A cover page (but not a doc cover) in a collated document could, for example, simply read: ”PART 1”.

In non-collated documents (say, an essay) you can use either a cover or doc cover to generate the cover sheet.

In addition, nothing prevents you from generating both a doc cover and a cover for every document in a collated document. Or you can selectively disable the automatic generation of either doc covers or covers in a collated document on-the-fly.

Important note: Automatic generation of covers or doc covers after the first one(s) only takes place if you are working with collated documents. Mom provides no mechanism for saying ”print a section cover here even though I'm still working on the same (non-collated) document.”

Description of cover pages

By default, mom typesets covers and doc covers identically to docheaders (see How to change the look of docheaders for a description of what a docheader looks like). The only differences are

  • the position on the page where the information is output
  • the (optional) addition of copyright and miscellaneous information
  • there’s no running text underneath

You tell mom what you want to appear on cover pages through the arguments you pass to COVER and/or DOC_COVER. Provided you have already given mom the appropriate reference macros (eg TITLE or AUTHOR), she will output covers and doc covers identically to how she would output docheaders containing the same information.

By default, mom starts covers and doc covers one-third of the way down the page. This can be changed through the use of the control macros COVER_ADVANCE / DOC_COVER_ADVANCE.

If you request copyright information (and have already given mom the reference macro, COPYRIGHT), she sets it, by default, in a smaller point size in the bottom right hand corner of the cover or doc cover. The position, as well as all of the standard typesetting parameters, can be altered via control macros.

Similarly, if you request miscellaneous information (and have already given mom the reference macro, MISC), she sets it, by default, in a smaller point size in the bottom left hand corner of the cover or doc cover. As with the copyright, the position and type specs can be altered via control macros.

Headers/footers/pagination and cover pages

Mom does not set any headers or footers on cover pages. Neither does she set any page numbers. From the point of view of pagination, covers and doc covers are by default considered ”null” pages. If you wish them to be included in the pagination scheme (even though no page numbers appear), you must tell mom that’s what you want with the macros DOC_COVERS_COUNT_PAGES and/or COVERS_COUNT_PAGES.

Designing your own cover pages

Finally, if you want to design your own cover page(s), you can always typeset them (using the typesetting macros), invoke .NEWPAGE, set up your document (see Tutorial – Setting up a mom document), and lastly invoke .START. The cover page, and any typesetting commands on it, will have no effect on mom’s processing of the document after you invoke .START.

COVER and DOC_COVER

Macro: COVER (see required and optional arguments, below)
Macro: DOC_COVER (see required and optional arguments, below)
Required argument: TITLE | DOCTITLE | COVERTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE
Optional arguments: [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC BLANKPAGE PDF_OUTLINE_LABEL <label> ]

Note: These macros should be placed in the style sheet section of your document setup (see Tutorial – Setting up a mom document), ie after PRINTSTYLE (and/or DOCTYPE and/or COPYSTYLE), but before START.

COVER and DOC_COVER behave identically. The reason mom provides two macros for cover page generation is so that you can have two different kinds of covers with different information on each.

Imagine, for a moment, you’ve written a document comprised of three sections. When you COLLATE the document for output, you could use DOC_COVER to generate a cover page that contained the name of the entire document, your (the author’s) name, and perhaps the copyright date. Subsequently, you could use COVER, after each .COLLATE but before each .START, to generate a cover page (or cover ”sheet”, if you prefer) containing just the name of the section.

The required argument

Both COVER and DOC_COVER, whenever invoked, require a first argument, as listed above. This first argument will become the first bit of information mom prints on the cover or doc cover (ie the title).

In order for the information to appear, you must, of course, have given mom the appropriate reference macro. A list of first arguments with their equivalent reference macros follows.

TITLE
– means the argument you gave to TITLE
DOCTITLE
– means the argument you gave to DOCTITLE
COVERTITLE
– means the argument you gave to COVERTITLE or DOC_COVERTITLE
CHAPTER, CHAPTER_TITLE, CHAPTER+TITLE
– see below, How the CHAPTER argument and friends work
How the CHAPTER argument and friends work

• CHAPTER
The CHAPTER argument will print the CHAPTER_STRING concatenated with the chapter number you gave to CHAPTER. For example, assuming a vanilla setup for your chapter:
.CHAPTER 1 .CHAPTER_TITLE "The Bonny Blue Yonder" .COVER CHAPTER \"(or .DOC_COVER CHAPTER) will print (and only print)
Chapter 1

• CHAPTER_TITLE
The CHAPTER_TITLE argument will print the chapter title you gave to CHAPTER_TITLE. For example, assuming a vanilla setup for your chapter:
.CHAPTER 1 .CHAPTER_TITLE "The Bonny Blue Yonder" .COVER CHAPTER_TITLE \"(or .DOC_COVER CHAPTER_TITLE) will print (and only print)
The Bonny Blue Yonder

• CHAPTER+TITLE
The CHAPTER+TITLE argument will print both the concatenated chapter string+number and the chapter title. For example, assuming a vanilla setup for your chapter:
.CHAPTER 1 .CHAPTER_TITLE "The Bonny Blue Yonder" .COVER CHAPTER+TITLE \"(or .DOC_COVER CHAPTER+TITLE) will print
Chapter 1 The Bonny Blue Yonder

The optional arguments

The remainder of the arguments to COVER and DOC_COVER are optional. They refer specifically to the information you gave the reference macros bearing the same name as the arguments. You may enter as many or as few as you like, in any order.

What the DOCTYPE argument means

When you pass COVER or DOC_COVER the argument, DOCTYPE, it refers to the argument you gave to DOCTYPE NAMED. For example, if, in your docstyle macros you gave a
.DOCTYPE NAMED "Abstract" the argument, DOCTYPE, given to the COVER or DOC_COVER macros, would mean that you wanted the word, Abstract, to appear on the cover or doc cover underneath the title and/or author(s), just as it would in the docheader.

What the BLANKPAGE argument means

If the final argument to DOC_COVER or COVER is BLANKPAGE, mom will insert a blank page after the doc cover or cover. This is particularly useful if you intend to print your document two-sided, since, in two-sided printing, there may be instances where you do not want text on the reverse side of cover or title pages.

If you enable DOC_COVERS_COUNT_PAGES and/or COVERS_COUNT_PAGES, the blank page will be taken into account in the pagination scheme, though no page number appears on it. Otherwise, blank pages are invisible to mom's pagination.

What the PDF_OUTLINE_LABEL argument means

By default, mom identifies doccovers in the outline panel of PDF viewers with the prepended string, “Cover:”, and covers with the string “Title Page:”. If you would like to change the strings, pass the PDF_OUTLINE_LABEL argument to COVER or DOCCOVER, along with the new string.

Enabling/disabling automatic generation of cover pages

Macro: COVERS <toggle>
Macro: DOC_COVERS <toggle>

By default, if you give mom a COVER or DOC_COVER directive, she will print the cover or doc cover. In a document that contains sections, articles or chapters formerly treated as ”one-off’s” but now being collated, such behaviour may not be desirable.

Mom lets you selectively enable or disable the generation of covers and/or doc covers with the toggle macros, COVERS and DOC_COVERS. Because they’re toggle macros, simply invoking them by themselves enables automatic cover or doc cover generation, while invoking them with any argument at all (OFF, QUIT, X, etc) disables cover or doc cover generation.

Note: You must place these macros prior to any instance of START. Since they’re ”on” by default, there’s no need to use them if you want covers. However, if you don’t, especially in the kind of scenario described above, the best place to put them (most likely with an OFF, NO, X, etc. argument), is immediately after the first invocation of START. By doing so, you ensure they meet the requirement of preceding all subsequent instances of START.


Control macros for covers and doc covers

The default typographic appearance of the items on a cover or doc cover is identical to that of the items in a docheader. (See Docheader description for a description of the defaults.)

COPYRIGHT and MISC, which do not appear in docheaders, have the following default characteristics:

  • the COPYRIGHT line is set in the bottom right hand corner of the page, 2 point sizes smaller than the size of running text
  • MISC lines are set in the bottom left hand corner of the page, in the same family, font and point size as the copyright line.

The defaults for the entirety of covers and doc covers, and all the elements thereon, can be changed with control macros whose defaults and arguments are identical to the corresponding control macros governing docheaders. The only difference is the name by which you invoke them.

A complete list of cover and doc cover control macros follows. Please refer to docheader control in order to get the defaults and any special instructions for usage.

Cover / doc cover control macros and defaults

COVER_ADVANCE DOC_COVER_ADVANCE -+ COVER_FAMILY DOC_COVER_FAMILY | like COVER_LEAD DOC_COVER_LEAD | DOCHEADER_<spec> COVER_QUAD DOC_COVER_QUAD -+ COVER_TITLE_FAMILY DOC_COVER_TITLE_FAMILY -+ COVER_TITLE_FONT DOC_COVER_TITLE_FONT | like COVER_TITLE_COLOR DOC_COVER_TITLE_COLOR | TITLE_<spec> COVER_TITLE_SIZE DOC_COVER_TITLE_SIZE -+ COVER_CHAPTER_TITLE_FAMILY DOC_COVER_CHAPTER_TITLE_FAMILY -+ COVER_CHAPTER_TITLE_FONT DOC_COVER_CHAPTER_TITLE_FONT | like COVER_CHAPTER_TITLE_COLOR DOC_COVER_CHAPTER_TITLE_COLOR | CHAPTER_TITLE_<spec> COVER_CHAPTER_TITLE_SIZE DOC_COVER_CHAPTER_TITLE_SIZE -+ COVER_SUBTITLE_FAMILY DOC_COVER_SUBTITLE_FAMILY -+ COVER_SUBTITLE_FONT DOC_COVER_SUBTITLE_FONT | like COVER_SUBTITLE_COLOR DOC_COVER_SUBTITLE_COLOR | SUBTITLE_<spec> COVER_SUBTITLE_SIZE DOC_COVER_AUTHOR_SIZE -+ COVER_ATTRIBUTE_COLOR DOC_COVER_ATTRIBUTE_COLOR - like ATTRIBUTE_COLOR - the macro, ATTRIBUTE_STRING, controls the attribution string for both docheaders and cover pages; cover pages have no separate ATTRIBUTE_STRING macro COVER_AUTHOR_FAMILY DOC_COVER_AUTHOR_FAMILY -+ COVER_AUTHOR_FONT DOC_COVER_AUTHOR_FONT | like COVER_AUTHOR_COLOR DOC_COVER_AUTHOR_COLOR | AUTHOR_<spec> COVER_AUTHOR_SIZE DOC_COVER_AUTHOR_SIZE -+ COVER_DOCTYPE_FAMILY DOC_COVER_DOCTYPE_FAMILY -+ COVER_DOCTYPE_FONT DOC_COVER_DOCTYPE_FONT | like COVER_DOCTYPE_COLOR DOC_COVER_DOCTYPE_COLOR | DOCTYPE_<spec> COVER_DOCTYPE_SIZE DOC_COVER_DOCTYPE_SIZE -+ COVER_COPYRIGHT_FAMILY DOC_COVER_COPYRIGHT_FAMILY -+ COVER_COPYRIGHT_FONT DOC_COVER_COPYRIGHT_FONT | COVER_COPYRIGHT_COLOR DOC_COVER_COPYRIGHT_COLOR | like any of the above COVER_COPYRIGHT_SIZE DOC_COVER_COPYRIGHT_SIZE | COVER_COPYRIGHT_QUAD DOC_COVER_COPYRIGHT_QUAD -+ - copyright quad sets both the position on the page and the quad direction and can be either L (left) or R (right); default is right COVER_MISC_FAMILY DOC_COVER_MISC_FAMILY -+ COVER_MISC_FONT DOC_COVER_MISC_FONT | COVER_MISC_COLOR DOC_COVER_MISC_COLOR | like any of the above COVER_MISC_SIZE DOC_COVER_MISC_SIZE | COVER_MISC_QUAD DOC_COVER_MISC_QUAD -+ - misc quad sets both the position on the page and the quad direction and can be either L (left) or R (right); default is left COVER_UNDERLINE DOC_COVER_UNDERLINE - like DOCTYPE_UNDERLINE - cover underline controls underlining of the argument given to DOCTYPE NAMED "<name>" only COVER_COUNTS_PAGES DOC_COVER_COUNTS_PAGES - whether to consider cover pages in the pagination scheme; the default is to ignore them - see Note

Note:
COVER_COUNTS_PAGES and DOC_COVER_COUNTS_PAGES are toggle macros, hence invoking them by themselves means that mom will consider covers and doc covers in the pagination scheme; invoking them with any argument (OFF, NO, X, etc.) means they are ignored. The default is to ignore them.


Back to Table of Contents Top Next: Tables of contents

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/inlines.html0000644000000000000000000000013212426110213021732 xustar000000000000000030 mtime=1415090315.614519134 30 atime=1415090315.614519134 30 ctime=1415090315.614519134 groff-1.22.3/contrib/mom/momdoc/inlines.html0000644000175000001440000010755212426110213020602 0ustar00wlusers00000000000000 Mom -- Inline escapes
Back to Table of Contents Next: Coloured text

Inline escapes


Introduction

Inline escapes, as described in the groff terms section of this manual, are typesetting commands that appear in text input lines, as opposed to macros and other control lines that must appear on lines by themselves.

Aside from altering type parameters within a line, inlines also tell groff about special characters—em-dashes, bullets, figure/digit-width spaces, and so on. It is beyond the scope of this manual to provide a complete list of groff’s inline functions and special characters. I recommend having a look at the canonical reference materials should you need more information than is contained herein.

In groff, the escape character is the backslash (\). Groff interprets everything following the backslash as instructions, not literal text, until the escape sequence is complete. Should you need the actual backslash character as part of a line of text, simply enter it twice (\\). Groff understands that this means "please print a backslash character."

You can also use \e to print a literal backslash, or use ESC_CHAR to change the escape character to something other than the backslash, which lets you use a single backslash as a literal backslash.

Groff has a number of ways of recognizing what constitutes a complete escape sequence. This is both a boon and a curse; some escape sequences have no terminating delimiter and consequently become difficult to distinguish from real input text. Others require the use of an opening parenthesis with no corresponding closing parenthesis. Still others need to be enclosed in square brackets.

Mom recognizes that certain escapes get used more often than others. For these, she has a consistent input style that takes the form \*[...], which makes them stand out well from the text of your documents. These escapes are the ones listed under Mom’s personal inline escapes.

Despite mom’s best intentions, there are still a number of typesetting functions that can only be accomplished with groff’s native inline escapes. I've listed the ones that strike me as essential, but there are many others. If you want to know what they are, please read the canonical reference materials pertaining to groff.

Helpful bit of information: Inline escapes can be used in document processing macros that take string arguments.


Mom’s personal inline escapes

Changing fonts

Mom provides five escapes for changing fonts inline:
\*[ROM] Change to the medium roman font \*[IT] Change to the medium italic font \*[BD] Change to the bold roman font \*[BDI] Change to the bold italic font \*[PREV] Revert to the previous font (once only)*

Note: \*[PREV] does not operate "stack style". It returns to the previous font once only, and afterwards has no effect. In other words, in the case of \*[PREV]\*[PREV], only the first \*[PREV] is respected; the second one is silently ignored.

These escapes are provided for merely for convenience, legibility, and consistency when typesetting with mom. For more complete and flexible inline font control, please see font control with \f.

Notes concerning document processing

If you’re using the document processing macros, inline font changes remain in effect only for the duration of the current document element tag.

Additionally, if you’re designing your own HEADERS or FOOTERS and want to use mom’s inline escapes for changing fonts as part of the the left, centre and/or right strings, or in the strings for recto and/or verso HEADERS or FOOTERS, or in the strings passed to HEADERS_AND_FOOTERS, you must enter the inlines beginning with \E* rather than just \*, eg \E*[BD].

Changing point size

Mom has two inline escapes for changing point size:
\*[SIZE <size>] and
\*S[<size>] where “size” is the new size you want. You can use either; they behave exactly the same way. For example, to change the point size of type inline to 12 points, you could enter either
\*[SIZE 12] or
\*S[12] Entering either \*[SIZE] or \*S[] with no argument reverts to the former point size.

The advantage of the first form is that it’s easy to remember, and follows mom’s usual inline syntax. The advantage of the second is that it’s more concise.

Notice that in both cases, the new size does not require a unit of measure; points is assumed. However, a unit of measure may be appended to the size if that’s what you wish. Fractional sizes are, of course, allowed.

The size given to \*[SIZE <size>] or \*S[<size>] may be expressed in plus or minus terms, which can be very useful. In the following examples, the word “mom” will be output 2 points larger than the point size of the rest of the line.
While she isn't perfect, \*S[+2]mom\*S[-2] isn't half bad. While she isn't perfect, \*[SIZE +2]mom\*[SIZE -2] isn't half bad. Please note that inline size changes do not update the leading if AUTOLEAD is enabled.

NOTE CONCERNING DOCUMENT PROCESSING

If you’re using the document processing macros and wish to design your own HEADERS or FOOTERS using mom’s inline escape for changing point size as part of the left, centre and/or right strings, or in the strings for recto and/or verso HEADERS or FOOTERS, or in the strings passed to HEADERS_AND_FOOTERS, you must use the form \*S[<n>] and enter the inline beginning with \E*, like this: \E*S[<+|-><n>].

Additional note: If you’re accustomed to groff’s usual way of handling inline size requests (\sN, \s±N, \s(NN, \s±(NN, \s[NNN], \s±[NNN]), feel free to continue with your old habits. Mom doesn’t care.

Capitalise a section of type

If you need to capitalise a region of type inline, bracket the region of type with the inline escapes, \*[UC] (Upper Case) and \*[LC] (Lower Case), like this:
All work \*[UC]and\*[LC] no play makes Jack a dull boy. The above produces, on output
All work AND no play makes Jack a dull boy.

Note: \*[UC] and \*[LC] must not be used inside the string arguments passed to the HEADER_<POSITION> macro. Instead, use the control macro HEADER_<POSITION>_CAPS. For HEADER_RECTO (or _VERSO) or FOOTER_RECTO (or _VERSO), supply the CAPS option to the appropriate macro.

Pairwise kerning

Pairwise kerning means moving specific letter pairs closer together or further apart (see Typesetting terms, kerning for more details).

Mom permits inline pairwise kerning through the use of the inline escapes
\*[BU <n>] Closes the space between letters (Back Units). \*[FU <n>] Opens the space between letters (Forward Units). <n> is the number of kern units by which to close or open the space between letters.

For example,
THE HUMAN COST OF COMMODIF\*[FU 1]YING FRESH W\*[BU 4]A\*[BU 5]TER moves the letter Y in “COMMODIFYING” one kern unit away from the letter F, and the letter A in “WATER” four kern units closer to the letter W. Additionally, the letter T in “WATER” is moved five kern units closer to the letter A.

For backward compatibility, the forms
\*[BU1]...\*[BU36] Move backward 1...36 kern units \*[FU1]...\*[FU36] Move forward 1...36 kern units also exist (ie with no space before the number of kern units desired, up to a limit of 36).

The default size of a kern unit is 1/36 of the current point size; this may be changed by invoking the macro, .KERN_UNIT, with the desired value, which represents a fraction of the current point size. For example, to change the kern unit to 1/54 of the current point size,
.KERN_UNIT 54 To restore the kern unit to its default, invoke .KERN_UNIT with an argument of DEFAULT.

Notes concerning document processing

If you’re using the document processing macros and wish to design your own HEADERS or FOOTERS using mom’s inline escapes for kerning as part of the left, centre and/or right strings, or in the strings for recto and/or verso HEADERS or FOOTERS, or in the strings passed to HEADERS_AND_FOOTERS, you must use the forms \E*[BU<n>] and \E*[FU<n>] (ie with no space), and enter the inline beginning with \E* rather than just \*, eg \E*[BU4].

Additional note: Using the BU or FU escapes between characters pairs that are already automatically kerned (see KERN) disables the automatic kerning and uses the value you give to BU or FU instead.

Horizontal inline movement

Sometimes, you may need to insert a specified amount amount of white space into an output line, or—occasionally—back up to a previous position on an output line in order to create special typographic effects.

Mom’s inline escapes for these horizontal movements are
\*[BCK <n unit>]  Move backward inline the specified number of units of measure; decimal fractions are allowed. and \*[FWD <n unit>]  Move forward inline the specified number of units of measure; decimal fractions are allowed.

For example,
1.\*[FWD 12p]The Free Trade Play-Offs: WalMart 100, Mexico 0 puts 12 points of space between 1. and The.

Note: For backward compatibility, the forms
\*[BP.25]...\*[BP12.75] Move backward .25...12.75 points \*[FP.25]...\*[FP12.75] Move forward .25...12.75 points also exist (ie with no space before the digit and points being the unit of measure, hence no unit of measure required). Both accept quarter points, so it’s possible to do, for example, \*[FP.5] or \*[BP1.25] up to a limit of 12.75 points.

Note concerning document processing

If you’re using the document processing macros and wish to design your own HEADERS or FOOTERS using mom’s inline escapes for horizontal movements as part of the left, centre and/or right strings, or in the strings for recto and/or verso HEADERS or FOOTERS, or in the strings passed to HEADERS_AND_FOOTERS, you must use the forms \E*[BP<n>] and \E*[FP<n>] (ie with no space), and enter the inline beginning with \E* rather than just \*, eg \E*[BP.755].

Vertical inline movement

If you need to move portions of type up or down on a line, mom provides the following inline escapes:
\*[DOWN <n unit>] Move down inline the specified number of units of measure \*[UP <n unit>] Move up inline the specified number of units of measure For example,
Tel: 905\*[UP 1p]-\*[DOWN 1p]4072 moves the hyphen in the telephone number up by 1 point, then moves back down by the same amount.

Note: \*[UP] and \*[DOWN] do not work in conjunction with the inline escape, \*[RULE].

Additional note: For backward compatibility, the following are also available:
\*[ALD.25]...\*[ALD12.75] Advance lead .25...12.75 points (move downward) \*[RLD.25]...\*[RLD12.75] Reverse lead .25...12.75 points (move upward)

Both \*[ALD] and \*[RLD] work in points, hence you mustn’t use a unit of measure.

Note concerning document processing

If you’re using the document processing macros and wish to design your own HEADERS or FOOTERS using mom’s inline escapes for vertical movements as part of the left, centre and/or right strings, or in the strings for recto and/or verso HEADERS or FOOTERS, or in the strings passed to HEADERS_AND_FOOTERS, you must use the forms \E*[ALD<n>] and \E*[RLD<n>] (ie with no space), and enter the inline beginning with \E* rather than just \*, eg \E*[ALD.5].

Terminate a line without advancing on the page

Sometimes, you want mom to break a line but not advance on the page. This can be accomplished with the macro, EL or with the escape, \*[B]. Simply attach \*[B] to the end of any input line. Using the example given in the document entry for EL, you'd use \*[B] like this:
.LEFT .LS 12.5 A line of text.\*[B] .ALD 24p The next line of text. \*[B] works reliably regardless of the current fill mode.

Call the next sequential tab without advancing on the page

Sometimes, you want mom to move to the next tab in sequence (eg from TAB 1 to TAB 2, or TAB 8 to TAB 9) without mom advancing on the page. (See the NOTE here if you’re not clear how mom manages tabs and linebreaks.) To do so, simply attach the escape \*[TB+] to the end of the input line in previous tab, like this:
.TAB 1 Some text\*[TB+] \" In tab 1 Some more text \" In tab 2, same baseline. \*[TB+] works reliably regardless of the current fill mode.

Full measure rules

I find I often need rules drawn to the full measure of the current line or tab length. The official way to do this is \l'\n[.lu]', which is annoying to type, and doesn’t mean a whole heck of a lot if you’re new to groff. The inline, \*[RULE], is a simple replacement for \l'\n[.lu]'. Use it whenever you need a rule drawn to the full measure of the current line or tab length, for example:
.LL 6P \*[RULE] The above draws a rule the full measure of the 6-pica line length. For another way to draw full measure rules, see the macro, DRH.

\*[RULE] must appear on an input line by itself, and always causes a break when entered after a normal input line of text. It does not, however, deposit a break when used immediately after a macro.

The weight of the rule drawn with \*[RULE] is controlled with the macro RULE_WEIGHT. Mom’s default is 1/2 point.

Note: \*[RULE] draws the rule to the full measure, hence it cannot be used to fill the remainder of a partial line with a rule in this way:
Signature__________________________________________ If you wish to accomplish this effect, you have to use \*[RULE] in conjunction with the PAD macro and string tabs. (See the example provided with PAD.)

Please also note that the inline escapes \*[UP] and \*[DOWN] cannot be used in conjunction with \*[RULE].

This doesn’t work:
\*[DOWN 2p]\*[RULE]\*[UP 2p] whereas this does:
.ALD 2p \*[RULE] .RLD 2p

See groff’s Horizontal line drawing function for more information on drawing horizontal rules.

Macro: RULE_WEIGHT <weight in points>

• Must not have a unit of measure appended.
  Argument must be greater than 0 and less than 100; decimal fractions are allowed.

RULE_WEIGHT allows you to tell mom how heavy (in other words, how “thick”) you want the rules drawn with the inline escape, \*[RULE]. It takes a single argument: the weight of the rule in points but without the unit of measure p attached. Thus, to set the weight of rules drawn with \*[RULE] to 1-1/4 points, you'd do
.RULE_WEIGHT 1.25

RULE_WEIGHT also sets the weight of rules drawn with .DRH when DRH is not given any arguments.


Commonly-used groff inline escapes

Font control (\f)

Groff’s basic mechanism for inline font control is the escape \f[<font>].
\f[R] Change to the medium roman font (equivalent to mom's \*[ROM]) \f[I] Change to the medium italic font (equivalent to mom's \*[IT]) \f[B] Change to the bold roman font (equivalent to mom's \*[BD]) \f[BI] Change to the bold italic font (equivalent to mom's \*[BDI]) \f[P] Revert to the previous font (equivalent to mom's \*[PREV])

\f[<font>] can be used with any valid font style registered with groff. (See here for a list of pre-registered font styles provided by mom).

\f[<font>] can also take a complete valid family+font name combo. This is especially useful should you need to change both family and font inline. For example, if your prevailing family and font are Times Roman and you want a few words in Courier Bold Italic, you could do this:
.FAM T .FT R The command \f[CBI]ls -l\f[P] gives a "long" directory listing. The Unix command ls -l will appear in Courier Bold Italic in a line that is otherwise in Times Roman.

Inline horizontal motions (\h)

Whenever you need to move forward or backward on a line, use the inline
\h'<distance>' In order to avoid unpleasant surprises, always append a unit of measure to <distance>. For example,
\h'1.25i' moves you 1.25 inches to the right (forward) of the horizontal position on the current output line.

Note: \h'<distance>' is exactly equivalent to \*[FWD n<unit>].

To move backwards by the same amount, do
\h'-1.25i'

Note: \h'-<distance>' is exactly equivalent to \*[BCK n<unit>].

Inline vertical motions (\v)

If you need to raise or lower type on a line (say, for sub- or superscripts, or any other special effect), use
\v'<distance>' In order to avoid unpleasant surprises, always append a unit of measure to <distance>. For example,
\v'.6m' moves you (approx.) 2/3 of an em downward on the current output line.

Note: \v'<distance>' is exactly equivalent to \*[DOWN n<unit>].

To move upward an equivalent amount, do
\v'-.6m'

Note: \v'<-distance>' is exactly equivalent to \*[UP n<unit>].

Important: The vertical motion of \v affects ONLY type on the current output line. When groff breaks the output line, the effect of \v is cancelled; the baseline of the next output line is where it would be if you hadn’t used \v.

Tip: When using \v for occasional effects in a line, don’t forget to reverse it when you've done what you want to do. Otherwise, the remaining type will be set too high (if you used \v with the minus sign) or too low (if you used \v without the minus sign).

String width function (\w)

In the context of mom, the string width inline \w'<string>' primarily serves to let you establish the horizontal measure of something (eg indents) based on the length of a bit of text. For example, if you want a left indent the length of the word “Examples:” plus a space, you can set it with the \w inline escape:
.IL "\w'Examples: '"

Note: Whenever you pass \w'string' to a macro that normally requires a unit of measure, do NOT add a unit of measure to the \w'string' argument.

Furthermore, if the string is composed of several words separated by spaces, you MUST surround the whole escape with double quotes, as in the example above.

Horizontal line drawing function (\l)

The \l'distance' inline allows you to draw a horizontal rule of the specified distance. You must supply a unit of measure. Therefore, to set a 3-pica rule into a line of text, you'd do
A line of text with a superfluous \l'3P' 3-pica rule in it. \l'3P', above, not only draws the rule, but advances 3 picas horizontally as well, just as you'd expect.

For an easy way of drawing rules to the full measure of the current line or tab length, see Full measure rules.

The weight (thickness) of rules varies according to the point size in effect when you invoke \l, but you can’t fix the weight with any real precision. A point size of 12 produces a tastefully moderate rule weight of between one-half and one point (depending on your printer).

Note: Besides \l, groff provides a number of more sophisticated “drawing” escapes. It is well beyond the scope of this documentation to demonstrate their usage; see
info groff => Escape index => \D for directions concerning their use. The drawing escapes can be a bit unwieldy, so mom provides “user-friendly” macros for the graphical objects most commonly enountered in typesetting: horizontal and vertical rules, boxes, and circles (ellipses).

Additionally, groff comes with two “preprocessors” that let you create ruled tables and vector diagrams (line drawings): tbl and pic. The documentation for tbl can be downloaded from
http://cm.bell-labs.com/cm/cs/doc/76/tbl.ps.gz
and pic from
http://www.kohala.com/start/troff/gpic.raymond.ps
Both are powerful tools, but they can be nasty to learn—at first, anyway. You may prefer to use a vector drawing program to create diagrams and tables; inserting the results into a document is easy enough with PDF_IMAGE or PSPIC.

Special characters and symbols

Here follows a short list of commonly-used special characters available via inline escapes. If you’re not sure of the meaning of some of these characters, consult the Definitions of Terms.

For a complete list of special characters and glyphs (ie just about anything you'd ever want to appear on the printed page, including mathematical symbols, accented characters, unusual ligatures and letters unique to various European languages), consult man groff-char.

CHARACTER ESCAPE SEQUENCE --------- --------------- Comment line \# or .\" Fixed-width space \<space> (ie backslash followed by a space) Unbreakable space \~ Digit-width (figure) space \0 Zero-width character \& Discretionary hyphen \% Backslash \\ or \e Plus/minus (arithmetic) \[+-] Subtract (arithmetic) \[mi] Multiply (arithmetic) \[mu] Divide (arithmetic) \[di] Em-dash \[em] En-dash \[en] Left double-quote \[lq] Right double-quote \[rq] Open (left) single-quote \[oq] Close (right) single-quote \[oq] Bullet \[bu] Ballot box \[sq] One-quarter \[14] One-half \[12] Three-quarters \[34] Degree sign \[de] Dagger \[dg] Foot mark \[fm] Cent sign \[ct] Registered trademark \[rg] Copyright \[co] Section symbol \[se]

Back to Table of Contents Top Next: Coloured text

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/refer.html0000644000000000000000000000013212426110213021374 xustar000000000000000030 mtime=1415090315.615519121 30 atime=1415090315.614519134 30 ctime=1415090315.615519121 groff-1.22.3/contrib/mom/momdoc/refer.html0000644000175000001440000022000312426110213020227 0ustar00wlusers00000000000000 Mom -- Document processing, bibliographies and references
Back to Table of Contents Next: Writing letters

Bibliographies and references


Introduction to bibliographies and references

Mom provides the ability to format and generate bibliographies, as well as footnote or endnote references, in MLA (Modern Language Association) style. She accomplishes this by working in conjunction with a special groff program called refer.

Refer requires first that you create a database of works that will be cited in your documents. Once that’s done, special macros let you briefly key in references to entries in the database and have mom format them with respect to order, punctuation and italicization in footnotes, endnotes, or a full bibliography.

Refer has been around for a long time. It’s powerful and has many, many features. Unfortunately, the manpage (man refer), while complete and accurate, is dense and not a good introduction. (It’s a classic manpage Catch-22: the manpage is useful only after you know how to use the program.)

In order to get mom users up and running with refer, this section of mom’s documentation focuses exclusively, in a recipe-like manner, on what you need to know to use refer satisfactorily in conjunction with mom. The instructions are not to be taken as a manual on full refer usage.

If you’re already a refer user, the information herein will be useful for adapting your current refer usage to mom’s way of doing things. If you’ve never used refer, the information is essential, and, in many cases, may be all you need.

I encourage anyone interested in what MLA style looks like—and, by extension, how your bibliographies and references will look after mom formats them—to check out
http://www.aresearchguide.com/12biblio.html or any other website or reference book on MLA style.


Tutorial on refer usage with mom

  1. Create a refer database
  2. Insert a refer block
  3. Tell mom where you want your references (if footnotes or endnotes)
  4. Accessing references in the database
  5. Entering footnote/endnote references
  6. Parenthetical insertions
  7. Generating a bibliography from parenthetical insertions
  8. Generating a comprehensive bibliography
  9. Invoking groff with mom and refer

1. Create a refer database

The first step in using refer with mom is creating a database. The database is a text file containing entries for the works you will be citing. You may set up separate databases for individual documents, or create a large database that can be accessed by many documents.

Entries (“records” in refer-speak) in the database are separated from each other by a single, blank line. The records themselves are composed of single lines (“fields”) with no blank lines between them. Each field begins with a percent sign and a single letter (the "field identifier") eg %A or %T. The letter identifies what part of a bibliographic entry the field refers to: Author, Title, Publisher, Date, etc. After the field identifier comes a single space, followed by the information appropriate to field.

Here’s an example database containing two records so you can visualize what the above paragraph says.

Example refer database
%A Terry Pratchett %A Neil Gaiman %T Good Omens %C London %I Gollancz %D 1990 %A Peter Schaffter %T The Schumann Proof %C Toronto %I RendezVous Press %D 2004

The order in which you enter fields doesn’t matter. Refer will re-arrange them for you.

2. Insert a refer block

Having set up your database, you now need to put some refer-specific commands in your mom file.

Refer commands are introduced by a single line containing .R1, and concluded with a single line containing .R2. What goes between the .R1 and .R2 lines is called a “refer block”. Refer commands in a refer block should be entered one per line, in lowercase letters, with no initial period (dot). The actual commands depend on whether you want your references

  • in footnotes/endnotes
  • parenthetically inserted (in abbreviated form) into running text, referring to a works-cited list (bibliography)
  • to generate a comprehensive bibliography (a reading list)
Refer block for footnotes/endnotes

If you want footnote or endnote references, place this block at the top of your mom file.

.R1 no-label-in-text no-label-in-reference join-authors " and " ", " ", and " database <full path to database> .R2

<full path to the database> means the full path including the filename, eg /home/user/refer/my-database-file.

Refer block for parenthetical insertions into running text

If you want short, parenthetical insertions into running text, referring to works cited in a bibliography, place this block at the top of your mom file.

.R1 label "(A.n|Q)" bracket-label " (" ")" ", " join-authors ", and " ", " ", and " move-punctuation reverse A1 sort A1Q1T1B1E1 database <full path to database> .R2

<full path to the database> means the full path including the filename, eg /home/user/refer/my-database-file.

Refer block for comprehensive bibliographies

If you want to output an entire refer database, or generate a comprehensive bibliography (a reading list) from a database, place this block at the bottom of your mom file, either prior to or immediately after invoking BIBLIOGRAPHY.

.R1 no-label-in-text no-label-in-reference join-authors ", and " ", " ", and " sort A1Q1T1B1E1 reverse A1 database <full path to database> .R2

<full path to the database> means the full path including the filename, eg /home/user/refer/my-database.

3. Tell mom where you want your references

If you want references in footnotes, issue the instruction
.FOOTNOTE_REFS anywhere before the first citation in your file. Footnote markers will be inserted into the text, and the bibliographic information for the citation will appear as a footnote.

If you want references in endnotes, issue the instruction
.ENDNOTE_REFS anywhere before the first citation in your file. Endnote markers will be inserted into the text, and the bibliographic information for the citation will appear as an endnote entry.

Note that if you want references parenthetically inserted into running text, referring to entries in a works-cited list (bibliography) that mom and refer assemble automatically, no special instructions are required. See Generating a bibliography from parenthetical insertions for how to output the collected references.

For outputting an entire refer database, or generating a comprehensive reading list from a database, see the macro, BIBLIOGRAPHY.

4. Accessing references in the database

References are accessed by putting keywords from the desired database record between two special refer commands:
.[ and
.] Keywords are any word, or set of words, that identify a database record unambiguously. Thus, if you have only one database record for the author Ray Bradbury,
.[ bradbury .] is sufficient. However, if your database contains several records for books by Bradbury, say, Fahrenheit 451 and The Martian Chronicles, “bradbury 451” and “bradbury martian” would identify the two records unambiguously.

A special database field identifier, %K, lets you create unique keywords for database records to help clear up any ambiguity.

Notice that you don’t have to worry about capitalization when entering keywords.

5. Entering footnote/endnote references

Depending on which you have issued, a .FOOTNOTE_REFS or an .ENDNOTE_REFS command, entering references is done like this:
.REF .[ keyword(s) .] .REF If FOOTNOTE_REFS is in effect, the reference between the first and second .REF will be treated as a footnote. If ENDNOTE_REFS, it will be treated as an endnote. Endnote references must be explicitly output with ENDNOTES at the end of your file, before TOC.

Important: REF behaves identically to FOOTNOTE and ENDNOTE with respect to the use of the \c inline escape. Please read the HYPER IMPORTANT NOTE found in the document entry for FOOTNOTE (which also applies to ENDNOTE).

6. Parenthetical insertions

See Inserting parenthetical references into text.

7. Generating a bibliography from parenthetical insertions

To generate a bibliography from works cited by parenthetical insertions in the text, put this at the end of your document, before .TOC.
.BIBLIOGRAPHY .[ $LIST$ .] .BIBLIOGRAPHY OFF

8. Generating a comprehensive bibliography

You can also generate a comprehensive bibliography, which is to say a bibliography containing more works than are actually cited (a “reading list”), by placing references between .BIBLIOGRAPHY and .BIBLIOGRAPHY OFF. Once you have input the desired references, insert
.[ $LIST$ .] and follow it with .BIBLIOGRAPHY OFF. Study the example below if you’re having trouble visualizing this.

Example bibliography
.BIBLIOGRAPHY .R1 no-label-in-text no-label-in-reference join-authors ", and " ", " ", and " sort A1Q1T1B1E1 reverse A1 database <full path to database> .R2 .[ bradbury .] .[ pratchett .] .[ $LIST$ .] .BIBLIOGRAPHY OFF

Alternatively, you can output an entire database as a bibliography. Do the following at the end of your document, before .TOC.
.BIBLIOGRAPHY .R1 no-label-in-text no-label-in-reference join-authors ", and " ", " ", and " sort A1Q1T1B1E1 reverse A1 bibliography <full path to database> .R2 .BIBLIOGRAPHY OFF

9. Invoking groff with mom and refer

So, now you’ve got a document formatted properly to use references processed with refer, what do you do to output the document?

It’s simple. Instead of invoking groff with just the -mom option, as explained here, invoke groff with the -R option as well, like this:
groff -R -mom <filename> ...


MLA (Modern Language Association) style

Types of references (endnote, footnote, or embedded in text)

MLA allows for three types of references, or referencing styles:

  • short, parenthetical references in the text, linked to a works-cited list (bibliography) at the end of the document
  • footnote references
  • endnote references

There are significant differences between the way footnote/endnote references should be formatted, and the formatting style of bibliographies. One example is that footnote/endnote references should have their first lines indented, whereas bibliographic references should have their second lines indented. Fortunately, with mom, there’s no need to concern yourself with the differences; they’re taken care of automatically.

In terms of inserting references into your documents, footnote/endnote references are input in a manner similar to entering any other kind of footnote or endnote. Parenthetical references, however, need to be handled differently. See the next section.

Inserting parenthetical references into the text

MLA style prefers restricting the information in parenthetical references to the barest minimum needed to identify works in the works-cited list (the bibliography). Typically, a parenthetical insertion is just the author’s last name followed by the page number of the cited work (if only one work by that author is cited), or by the author, a shortened title of the work, and the page number (if more than one work is cited).

This necessitates a slightly fiddly way of entering parenthetical references, though not by any means difficult or hard to make sense of.

The refer block suggested here for parenthetical references prints only the author’s last name from the database record identified by your keywords (the label command), surrounded by parentheses (the bracket-label command). Therefore, assuming you are citing Ray Bradbury’s The Martian Chronicles, and it is the only work by Bradbury mentioned in the text,
...end of sentence. .[ martian chronicles .] A new sentence... will insert “...end of sentence (Bradbury). A new sentence...” into the text. The Martian Chronicles will be added to the works-cited list generated at the end of the document if it is not already present as the result of an earlier reference.

If you need a page number to identify where in The Martian Chronicles to find a specific quote
"...aluminum roaches and iron crickets." .[ [ martian chronicles .] 168) A new sentence... results in ““...aluminum roaches and iron crickets.” (Bradbury 168) A new sentence...” (which is excruciatingly correct MLA style). The “[” before martian chronicles tells refer to print the opening parenthesis; any text immediately following the “.]”, including spaces, replaces the closing parenthesis. (Notice that you have to add the closing parenthesis yourself after the page number.)

If your document cites more than one work by Bradbury and you need a title and page number in addition to the author's name in the inline reference,
"...aluminum roaches and iron crickets." .[ [ bradbury martian .], \fIChronicles\fP 168) A new sentence... will produce ““...aluminum roaches and iron crickets.” (Bradbury, Chronicles 168) A new sentence...”.

The ‘label’ and ‘bracket-label’ commands

The label and bracket-label commands in the refer block allow you to customize what information goes into parenthetical references, and how they should be formatted. label dictates which fields from the database record to print and how to punctuate them. bracket-label controls the bracketing style. Users are encouraged to consult man refer for usage.

Here’s an example of how to set up APA-style references, which require the author and date of publication, optionally with a page number or range of pages.
.R1 label "(A.n|Q) ', ' D.y" bracket-label " (" ")" ", " join-authors ", and " ", " ", and " move-punctuation reverse A1 sort A1Q1T1B1E1 database /home/peter/Groff-mom/Testing/Refer/refer-database .R2 Assuming a reference to a work by Ursula Leguin published in 1980
.[ leguin .] produces (Leguin, 1980) . If a page number is also required
.[ [ leguin .], p. 73) produces (Leguin, 1980, p. 73).


The refer database

Introduction

The heart and soul of refer is the bibliographic database. Knowing how to create records (ie. the entries for works cited in a document) is largely a question matching data (author, title, publisher, etc) with the correct field identifier. For example, if you’re citing from a scholarly journal, you need to know that %J is the field identifier for journal names and %N is the field identifier for the journal number. Use the Quick list of field identifiers as your guide.

The rules

Entering the data correctly is also important. Fortunately, there are very few rules, and those there are make sense. In a nutshell:

  • enter the data in each field in natural order; author John Smith is “John Smith”, editor Jane Doe is “Jane Doe”
  • capitalize all proper nouns and words in titles as you expect to see them; otherwise, use lowercase
  • use no terminating punctuation unless required; typically, required punctuation is the period after a shortform (“ed.” or “eds.”, “Jr.”, etc) or a question mark or exclamation mark at the end of a title
  • if part of a field needs to be set off in single-quotes, use \[oq] and \[cq] (openquote, closequote) rather than the single-quote (or apostrophe) character on your keyboard
  • if part of a field needs to be forced into italics, use the escapes \*[IT] and \*[PREV]; if the italicized portion concludes the field, omit \*[PREV]
  • if you require characters with accents, ligatures or special symbols, use groff’s “named” glyphs (eg. \['e] for é); a full list can be found in man groff_char

Quick guide to field identifiers (click on any that are links for more information)

%A author – records may contain multiple authors, one per line %Q non-human author – corporate author, eg. National Geographic; may also be used for exceptional reference types %m multiple authors – whenever "et al." is desirable %i idem – multiple works by the same author %p post-author – post-author information (eg appendix, foreword, letter) %T title – primary title (of a book) or the title of an article (within a scholarly journal or a magazine) %B book title – when %T contains the title of an article; %q force quote – force a title into double-quotes %t reprint title – if different from a work's original title %b main author – when citing a preface, foreword, introduction, or afterword, the author of the complete original work %E editor – records may contain multiple editors, one per line %l translator – if more than one translator, all the names %r translator – if tr. and ed. are one in the same and editor %M magazine or – when %T contains the title of an article newspaper %J journal – when %T contains the title of an article %e edition – number or name of an edition (eg Second, 2nd, Collector's, etc.) %S series – series name of books or journals %V volume – volume number (of books) %N journal number – journal or magazine number %R report number – technical report number %G gov’t. – government ordering number %O other – information or which there is no appropriate field letter %C city – city of publication %I publisher – publisher %D date – publication date %d original publication date – if different from date of publication %P page(s) – page number or range %n annotation – annotation to the reference %s site name – for internet references, the website name %c content – for internet references, the source of the material (eg. Web or Email); for websites, the content, if unclear %o organization – for internet sites, the organization, group or sponsor of the site %a access date – for internet sites, the date of access %u URL – for internet sites, the full URL %K keywords – words that help clear up ambiguities in the database

Field identifiers: specifics, usage and examples

%A – author field

For multiple authors, enter each in a separate %A field in the order in which they should appear. If the author on the title page is the editor (say, a book of short stories edited by Ray Bradbury), add , ed. to the end of the %A field, like this:
%A Ray Bradbury, ed. Do not use the %E field in these instances. If the work has several such editors, enter each in a separate %A field, as for multiple authors, and add , eds. to the last one, like this:
%A Jane Dearborne %A Bill Parsons, eds.

%Q – exceptional entries

Sometimes, a work has no author or title information, for example a book review in a newspaper. In such cases, use %Q, like this:
%Q Rev. of \*[IT]Mean Streets Omnibus\*[PREV], ed. Raymond Hammett %M Times Literary Supplement %D 7 July 1972

%m – multiple authors (et al.)

Whenever it’s desirable to abbreviate a list of authors with “et al.” enter it in the %m field, like this:
%A Paul Lauter %A Doug Scofield %m et al.

%i – idem

Whenever there are several works by the same author, fill out the %A field with the author’s name and follow it with the %i idem, like this:
%A Jonathon Schmidt %i idem Per MLA style, the author’s name will be replaced by a long dash.

If it’s necessary to state the role the author served (say, editor or translator), fill out the %i field with the information minus idem, like this:
%A Ray Bradbury %i ed. %T Timeless Stories for Today and Tomorrow

%p – post-author information

When citing from a preface, foreword, introduction, afterword or appendix, MLA requires that the information come between the author’s name and the work’s title, like this:
%A Martin Packham, Jr. %p appendix %T Why the West was Won Do not capitalize the first word in the %p field unless it is a proper noun.

%q – force title into double-quotes

Occasionally, you may not be able to use %T for the title because doing so will cause it to come out in italics when double-quotes are called for. An example of this is when citing from a dissertation. Use %q to get around the problem, like this:
%A Carol Sakala %q Maternity Care Policy in the United States %O diss., Boston U, 1993

%E – editor

Use this only if the author and the editor are not one in the same, eg
%A Geoffrey Chaucer %T The Works of Geoffrey Chaucer %E F. W. Robinson

%l – translator

If there is more than one translator, enter all the names, with appropriate conjunctions and punctuation, like this:
%A Feodor Dostoevsky %T Crime and Punishment %l Jessie Coulson, Marjorie Benton, and George Bigian

%O – other

Occasionally, MLA requires additional information after the title but before the publication data (city/publisher/date), for instance, the number of volumes in a series, or the fact that the work cited is a dissertation. Here are two examples:
%A Arthur M. Schlesinger %T History of U.S. Political Parties %O 4 vols. %C New York %I Chelsea %D 1973 %A Carol Sakala %q Maternity Care Policy in the United States %O diss., Boston U, 1993 Do not capitalize the first word of the %O field unless it is a proper noun.

Generally, consider %O a catch-all for information that does not match the criterion of any existing field identifier.

%C – city

Normally, %C takes the name of the city of publication, and that’s all. In the case of a republished book, if new material has been added, put such information in the %C field, like this:
%A Theodore Dreiser %T Sister Carrie %d 1900 %C Introd. E. L. Doctorow, New York

%d – original date of publication

Normally, all that is required in the %d field is the original date of publication. However, if supplementary original publication data is desired, include it in the field, like this:
%A Kazuo Ishiguro %T The Remains of the Day %d London: Faber, 1989 %D New York %I Knopf %D 1990

%K – keywords

Refer hates ambiguity, and complains when encountering it. Ambiguities result from the duplication of any word in more than one database record when that word is used to identify a reference in your input file. Use %K to create unique keywords found nowhere else in the database.

Imagine, for example, that your database contains records for Ray Bradbury’s The Illustrated Man, another record for The Illustrated Bradbury and a third for Bradbury, Illustrated. %K can be used to clear up any ambiguities by assigning a unique word to each record, for example %K ill-man for the first, %K ill-brad for the second, and %K brad-ill for the third.

%P – pages

When citing page numbers, which is often the case with footnotes and endnotes, it is not necessary to put the numbers in the database records. The %P field can be added underneath the keyword(s) in the .[ / .] entries in your input file, allowing you to recycle database records. For example,
%A Frye %T Anatomy %K frye-anat could be your short record for Northrop Frye’s The Anatomy of Criticism. Any time you wanted to cite a particular page or range of pages from that work in a footnote or endnote, you can put
.REF .[ frye-anat %P 67-8 .] .REF in your input file, and have it show up with the correct page(s).

%n – annotations

Annotations come at the very end of references. Capitalize all words that require it, including, for bibliographic references (but not for footnotes/endnotes) the first.


The bibliography and reference macros

Begin/end a reference that goes in a footnote or endnote

Macro: REF

The macro, REF, tells mom that what follows is refer-specific, a keyword-identified reference to a refer database record. Depending on whether you’ve issued a .FOOTNOTE_REFS or .ENDNOTE_REFS instruction, the reference will be formatted and placed in a footnote, or collected for output in the endnotes. Parenthetical insertion of references into the text do not require .REF (see Inserting parenthetical references into the text.)

Before you use REF, you must create a refer block containing refer commands (see Required refer commands in the tutorial, above).

REF usage always looks like this:
.REF .[ keyword(s) .] .REF Notice that REF “brackets” the refer instructions, and never takes an argument.

What REF really is is a convenience. One could, for example, put a reference in a footnote by doing
.FOOTNOTE .[ keyword(s) .] .FOOTNOTE OFF However, if you have a lot of references going into footnotes (or endnotes), it’s much shorter to type .REF/.REF than .FOOTNOTE/.FOOTNOTE OFF. It also helps you distinguish—visually, in your input file—between footnotes (or endnotes) which are references, and footnotes (or endnotes) which are explanatory, or expand on the text.

Note: If you’re using REF to put references in footnotes and your footnotes need to be indented, you may (indeed, should) pass REF the same arguments used to indent footnotes. See FOOTNOTE.

Additional note: REF behaves identically to FOOTNOTE or ENDNOTE, so please read the HYPER IMPORTANT NOTE found in the document entry for FOOTNOTE and/or ENDNOTE for instructions on correct entry of text preceding and following REF.

Instruct mom to put references in footnotes

Macro: FOOTNOTE_REFS

FOOTNOTE_REFS is an instruction to REF, saying, “put all subsequent references bracketed by the REF macro into footnotes.” You invoke it by itself, with no argument.

When FOOTNOTE_REFS is in effect, regular footnotes, (ie those introduced with .FOOTNOTE and terminated with .FOOTNOTE OFF) continue to behave normally.

You may switch between FOOTNOTE_REFS and ENDNOTE_REFS at any time.

By default, FOOTNOTE_REFS sets the FOOTNOTE_MARKER_STYLE to NUMBER (ie superscript numbers). You may change change that if you wish by invoking FOOTNOTE_MARKER_STYLE, with the argument you want after FOOTNOTE_REFS.

If you have a lot of footnote references, and are identifying footnotes by line number rather than by markers in the text, you may want to enable FOOTNOTES_RUN_ON in conjunctions with FOOTNOTE_REFS.

Instruct mom to put references in endnotes

Macro: ENDNOTE_REFS

ENDNOTE_REFS is an instruction to REF, saying, “add all subsequent references bracketed by the REF macro to endnotes.” You invoke it by itself, with no argument.

When ENDNOTE_REFS is in effect, mom continues to format regular endnotes, (ie those introduced with .ENDNOTE and terminated with .ENDNOTE OFF) in the normal way.

You may switch between ENDNOTE_REFS and FOOTNOTE_REFS at any time.

Manage indenting of references, per MLA standards

Macro: INDENT_REFS FOOTNOTE | ENDNOTE | BIBLIO <indent>

• <indent> requires a unit of measure

MLA-style requires that footnote or endnote references should have their first lines indented, whereas bibliographic references should have their second and subsequent lines indented. Thus, if you invoke INDENT_REFS with a first argument of FOOTNOTE or ENDNOTE, the value you give to <indent> sets the indent of the first line for those types of references; if you invoke it with BIBLIO, the value you give <indent> sets the indent of second and subsequent lines in bibliographies.

By default, the indent for all three types of references is 1/2-inch for PRINTSTYLE TYPEWRITE and 2 ems for PRINTSTYLE TYPESET.

If you’d like to change the indent for footnote, endnote or bibliography references, just invoke .INDENT_REFS with a first argument saying which one you want the indent changed for, and a second argument saying what you’d like the indent to be. For example, if you want the second-line indent of references on a bibliography page to be 3 picas,
.INDENT_REFS BIBLIO 3P is how you’d set it up.

Tip: If you are identifying endnotes by line number (ENDNOTE_MARKER_STYLE LINE) and have instructed mom to put references bracketed by .REF into endnotes (with ENDNOTE_REFS), you will almost certainly want to adjust the second-line indent for references in endnotes, owing to the way mom formats line-numbered endnotes. Study the output of such documents to see whether an indent adjustment is required.

The same advice applies to references in endnotes when you have enabled
.ENDNOTE_NUMBERS_ALIGN_LEFT in favour of mom’s default, which is to align them right. Study the output to determine what size of second-line indent works best.

(Frankly, endnote references formatted in MLA-style combined with left-aligned endnote numbers is a no-win situation, and so is best avoided. Wherever you set the indent, you’ll end up with the endnote numbers appearing to hang into the left margin, so you might as well have them hang, as is the case with .ENDNOTE_NUMBERS_ALIGN_RIGHT.  – Ed.)

Enable/disable hyphenation of references

Macro: HYPHENATE_REFS <toggle>

If you have hyphenation turned on for a document (see HY), and in most cases you probably do, mom will hyphenate references bracketed by the REF macro. Since references typically contain quite a lot of proper names, which shouldn’t be hyphenated, you may want to disable hyphenation for references.

HYPHENATE_REFS is a toggle macro; invoking it by itself will turn automatic hyphenation of REF-bracketed references on (the default). Invoking it with any other argument (OFF, NO, X, etc.) will disable automatic hyphenation for references bracketed by REF.

An alternative to turning reference hyphenation off is to prepend to selected proper names in your refer database the groff discretionary hyphen character, \%. (See here in the tutorial for an example.)

Note: References embedded in the body of a document are considered part of running text, and are hyphenated (or not) according to whether hyphenation is turned on or off for running text. Therefore, if you want to disable hyphenation for such references, you must do so temporarily, with HY, like this:
.HY OFF .[ keyword(s) .] .HY Alternatively, sprinkle your database fields liberally with \%.

Begin a bibliography

Macro: BIBLIOGRAPHY toggle

To append a bibliography to your document, whether of references inserted parenthetically into text or a comprehensive reading list derived from a large refer database, all you need do is invoke .BIBLIOGRAPHY. .BIBLIOGRAPHY breaks to a new page, prints the title (BIBLIOGRAPHY by default, but that can be changed), and awaits refer instructions. How to create bibliographies is covered in the tutorial section, Generating a bibliography from parenthetical insertions and Generating a comprehensive bibliography. When all the required data has been entered, type
.BIBLIOGRAPHY OFF to complete the bibliography.

See the Bibliography control macros and defaults for macros to tweak, design and control the appearance of bibliography pages.

Plain, or numbered list bibliography

Macro: BIBLIOGRAPHY_TYPE PLAIN | LIST [ <list separator> ] [ <list prefix> ]

Mom offers two styles of bibliography output: plain, or numbered list style. With the argument, PLAIN, bibliography entries are output with no enumerators. With the argument, LIST, each entry is numbered.

The two optional arguments, <list separator> and <list prefix> have the same meaning as the equivalent arguments to LIST (ie <separator> and <prefix>).

You may enter the BIBLIOGRAPHY_TYPE either before or after .BIBLIOGRAPHY. It must, however, always come before the any refer commands. See Generating a bibliography from parenthetical insertions and Generating a comprehensive bibliography.

Mom’s default BIBLIOGRAPHY_TYPE is PLAIN.

1. General bibliography page style control

• Base family/font/quad

See Arguments to the control macros.

.BIBLIOGRAPHY_FAMILY default = prevailing document family; default is Times Roman .BIBLIOGRAPHY_FONT default = roman .BIBLIOGRAPHY_QUAD* default = justified *Note: BIBLIOGRAPHY_QUAD must be set to either L (LEFT) or J (JUSTIFIED); R (RIGHT) and C (CENTER) will not work.
• Base point size
Macro: BIBLIOGRAPHY_PT_SIZE <base type size of bibliography>

Unlike most other control macros that deal with size of document elements, BIBLIOGRAPHY_PT_SIZE takes as its argument an absolute value, relative to nothing. Therefore, the argument represents the size of bibliography type in points, unless you append an alternative unit of measure. For example,
.BIBLIOGRAPHY_PT_SIZE 12 sets the base point size of type on the bibliography page to 12 points, whereas
.BIBLIOGRAPHY_PT_SIZE .6i sets the base point size of type on the bibliography page to 1/6 of an inch.

The type size set with BIBLIOGRAPHY_PT_SIZE is the size of type used for the text of the bibliographies, and forms the basis from which the point size of other bibliography page elements is calculated.

The default for PRINTSTYLE TYPESET is 12.5 points (the same default size used in the body of the document).

• Leading
Macro: BIBLIOGRAPHY_LEAD <base leading of bibliographies> [ ADJUST ]

• Does not require a unit of measure; points is assumed

Unlike most other control macros that deal with leading of document elements, BIBLIOGRAPHY_LEAD takes as its argument an absolute value, relative to nothing. Therefore, the argument represents the leading of bibliographies in points unless you append an alternative unit of measure. For example,
.BIBLIOGRAPHY_LEAD 14 sets the base leading of type on the bibliography page to 14 points, whereas
.BIBLIOGRAPHY_LEAD .5i sets the base leading of type on the bibliography page to 1/2 inch.

If you want the leading of bibliographies adjusted to fill the page, pass BIBLIOGRAPHY_LEAD the optional argument, ADJUST. (See DOC_LEAD_ADJUST for an explanation of leading adjustment.)

The default for PRINTSTYLE TYPESET is the prevailing document lead (16 by default), adjusted.

Note: Even if you give mom a .DOC_LEAD_ADJUST OFF command, she will still, by default, adjust bibliography leading. You must enter BIBLIOGRAPHY_LEAD <lead> with no ADJUST argument to disable this default behaviour.

• Adjust the space between bibliography entries
Macro: BIBLIOGRAPHY_SPACING <amount of space>

• Requires a unit of measure

By default, mom inserts no space between bibliography entries. If you’d prefer she add some, instruct her to do so with BIBLIOGRAPHY_SPACING. Say, for example, you want a half a linespace between entries,
.BIBLIOGRAPHY_SPACING .5v would do the trick.

Note: As with endnotes pages, inserting space between bibliography entries will most likely result in hanging bottom margins.

• Singlespace bibliography (TYPEWRITE only)
Macro: SINGLESPACE_BIBLIOGRAPHY <toggle>

If your PRINTSTYLE is TYPEWRITE and you use TYPEWRITE’s default double-spacing, bibliographies are double-spaced. If your document is single-spaced, bibliographies are single-spaced.

If, for some reason, you’d prefer that bibliographies be single-spaced in an otherwise double-spaced document (including double-spaced collated documents), invoke .SINGLESPACE_BIBLIOGRAPHY with with no argument.

• Turning off column mode during bibliography output
Macro: BIBLIOGRAPHY_NO_COLUMNS <toggle>

By default, if your document is set in columns, mom sets the bibliographies in columns, too. However, if your document is set in columns and you’d like the bibliographies not to be, just invoke .BIBLIOGRAPHY_NO_COLUMNS with no argument. The bibliography pages will be set to the full page measure of your document.

If you output bibliographies at the end of each document in a collated document set in columns, column mode will automatically be reinstated for each document, even with BIBLIOGRAPHY_NO_COLUMNS turned on. In such circumstances, you must re-enable ENDNOTES_NO_COLUMNS for each separate collated document.

2. Pagination of bibliographies

• Page numbering style
Macro: BIBLIOGRAPHY_PAGENUM_STYLE DIGIT | ROMAN | roman | ALPHA | alpha

Use this macro to set the page numbering style of bibliography pages. The arguments are identical to those for PAGENUM_STYLE. The default is digit. You may want to change it to, say, alpha, which you would do with
.BIBLIOGRAPHY_PAGENUM_STYLE alpha

• Setting the first page number of bibliographies
Macro: BIBILOGRAPHY_FIRST_PAGENUMBER <page # that appears on page 1 of bibliographies>

Use this macro with caution. If the bibliography for a collated document is to be output at the document’s end, BIBLIOGRAPHY_FIRST_PAGENUMBER tells mom what page number to put on the first page of the bibliography.

However, if you’re outputting a bibliography at the end of each section (chapter, article, etc) of a collated document, you have to reset every section’s first page number after COLLATE and before START.

• Omitting a page number on the first page of bibliographies
Macro: BIBLIOGRAPHY_NO_FIRST_PAGENUM <toggle>

This macro is for use only if FOOTERS are on. It tells BIBLIOGRAPHY not to print a page number on the first bibliography page. Mom’s default is to print the page number.

• Suspending pagination during bibliography output
Macro: SUSPEND_PAGINATION
Macro: RESTORE_PAGINATION

SUSPEND_PAGINATION doesn’t take an argument. Invoked immediately prior to BIBLIOGRAPHY, it turns off pagination for the duration of the bibliography. Mom continues, however to increment page numbers silently.

To restore normal document pagination after bibliographies, invoke .RESTORE_PAGINATION (again, with no argument) immediately after you’ve finished with your bibliography.

3. Header/footer control

• Modifying what goes in the bibliography header/footer

If you wish to modify what appears in the header/footer that appears on bibliography pages, make the changes before you invoke .BIBLIOGRAPHY, not afterwards.

Except in the case of DOCTYPE CHAPTER, mom prints the same header or footer used throughout the document on bibliography pages. Chapters get treated differently in that, by default, mom does not print the header/footer centre string (normally the chapter number or chapter title.) In most cases, this is what you want. However, should you not want mom to remove the centre string from the bibliography pages headers/footers, invoke .BIBLIOGRAPHY_HEADER_CENTER with no argument.

An important change you may want to make is to put the word “Bibliography” in the header/footer centre position. To do so, invoke
.HEADER_CENTER "Bibliography" or .FOOTER_CENTER "Bibliography" prior to invoking .BIBLIOGRAPHY.

Note: If your DOCTYPE is CHAPTER, you must also invoke BIBLIOGRAPHY_HEADER_CENTER for the BIBLIOGRAPHY_HEADER_CENTER to appear.

• Header/footer centre string when doctype is CHAPTER
Macro: BIBLIOGRAPHY_HEADER_CENTER toggle

If your DOCTYPE is CHAPTER and you want mom to include a centre string in the headers/footers that appear on bibliography pages, invoke .BIBLIOGRAPHY_HEADER_CENTER (or .BIBLIOGRAPHY_FOOTER_CENTER) with no argument. Mom’s default is NOT to print the centre string.

If, for some reason, having enabled the header/footer centre string on bibliography pages, you wish to disable it, invoke the same macro with any argument (OFF, QUIT, Q, X...).

• Allow headers on bibliography pages
Macro: BIBLIOGRAPHY_ALLOWS_HEADERS <none> | ALL

By default, if HEADERS are on, mom prints page headers on all bibliography pages except the first. If you don’t want her to print headers on bibliography pages, do
.BIBLIOGRAPHY_ALLOWS_HEADERS OFF If you want headers on every page including the first, do
.BIBLIOGRAPHY_ALLOWS_HEADERS ALL

Note: If FOOTERS are on, mom prints footers on every bibliography page. This is a style convention. In mom, there is no such beast as BIBLIOGRAPHY_ALLOWS_FOOTERS OFF.

4. Bibliography first-page title control

• Title string
Macro: BIBLIOGRAPHY_STRING "<title to print at the top of bibliography pages>"

By default, mom prints the word “BIBLIOGRAPHY” as a title at the top of the first page of a bibliography. If you want her to print something else, invoke .BIBLIOGRAPHY_STRING with the title you want, surrounded by double-quotes.

If you don’t want a title at the top of the first bibliography page, invoke .BIBLIOGRAPHY_STRING with a blank argument (either two double-quotes side by side—""—or no argument at all).

• Title string control macros and defaults

See Arguments to the control macros.

.BIBLIOGRAPHY_STRING_FAMILY default = prevailing document family; default is Times Roman .BIBLIOGRAPHY_STRING_FONT default = bold .BIBLIOGRAPHY_STRING_SIZE* default = +1 .BIBLIOGRAPHY_STRING_QUAD default = centred *Relative to the size of the bibliography text (set with BIBLIOGRAPHY_PT_SIZE)
• Title string placement
Macro: BIBLIOGRAPHY_STRING_ADVANCE <distance from top of page>

• Argument requires a unit of measure

By default, mom places the title (the docheader, as it were) of bibliographies (typically "BIBLIOGRAPHY") on the same baseline that is used for the start of running text. If you’d prefer another location, higher or lower on the page (thereby also raising or lowering the starting position of the bibliography itself), invoke .BIBLIOGRAPHY_STRING_ADVANCE with an argument stating the distance from the top edge of the page at which you’d like the title placed.

The argument requires a unit of measure, so if you’d like the title to appear 1-1/2 inches from the top edge of the page, you’d tell mom about it like this:
.BIBLIOGRAPHY_STRING_ADVANCE 1.5i

• Title string underscoring
Macro: BIBLIOGRAPHY_STRING_UNDERSCORE [DOUBLE] [<underline weight> [<underline gap> [<distance between double rules]]] | <none> | <anything>

Alias: BIBLIOGRAPHY_STRING_UNDERLINE

• The argument <underscore weight> must not have the unit of measure, p, appended to it

Invoked without an argument, .BIBLIOGRAPHY_STRING_UNDERSCORE will place a single rule underneath the bibliography’s first-page title. Invoked with the argument, DOUBLE, BIBLIOGRAPHY_STRING_UNDERSCORE will double-underscore the title. Invoked with any other non-numeric argument, (eg OFF, NO, X, etc.) the macro disables underlining of the title.

In addition, you can use BIBLIOGRAPHY_STRING_UNDERSCORE to control the weight of the underscore rule(s), the gap between the title and the underscore, and, in the case of double-underscores, the distance between the two rules.

Some examples:
.BIBLIOGRAPHY_STRING_UNDERLINE 1 - turn underlining on; set the rule weight to 1 point .BIBLIOGRAPHY_STRING_UNDERLINE 1 3p - turn underlining on; set the rule weight to 1 point; set the gap between the string and the underline to 3 points .BIBLIOGRAPHY_STRING_UNDERLINE DOUBLE .75 3p - turn double-underlining on; set the rule weight to 3/4 of a point; set the gap between the string and the upper underline to 3 points; leave the gap between the upper and the lower underline at the default .BIBLIOGRAPHY_STRING_UNDERLINE DOUBLE 1.5 1.5p 1.5p - turn double-underlining on; set the rule weight to 1-1/2 points; set the gap between the string and the upper underline to 1-1/2 points; set the gap between the upper and the lower underline to 1-1/2 points Note, from the above, that in all instances, underscoring (single or double) is enabled whenever BIBLIOGRAPHY_STRING_UNDERSCORE is used in this way.

Mom’s default is to double-underscore the title with 1/2-point rules placed 2 points apart and 2 points below the baseline of the title.

• Title string capitalization
Macro: BIBLIOGRAPHY_STRING_CAPS toggle

Invoked by itself, .BIBLIOGRAPHY_STRING_CAPS will automatically capitalize the bibliography first-page title. Invoked with any other argument, the macro disables automatic capitalization of the title.

If you’re generating a table of contents, you may want the bibliography first-page title to be in caps, but the toc entry in caps/lower case. If the argument to BIBLIOGRAPHY_STRING is in caps/lower case and BIBLIOGRAPHY_STRING_CAPS is on, this is exactly what will happen.

Mom’s default is to capitalize the bibliography first-page title.


Back to Table of Contents Top Next: Writing letters

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/graphical.html0000644000000000000000000000013212426110213022223 xustar000000000000000030 mtime=1415090315.613519146 30 atime=1415090315.613519146 30 ctime=1415090315.613519146 groff-1.22.3/contrib/mom/momdoc/graphical.html0000644000175000001440000004675212426110213021077 0ustar00wlusers00000000000000 Mom -- Graphical Objects
Back to Table of Contents Next: Document processing

Graphical objects


Introduction to graphical objects

Groff has a number of inline escapes for drawing rules, polygons, ellipses and splines. All begin with \D (presumably for “Draw”) and are documented in the groff info manual:
info groff => Escape index => \D The escapes allow you to draw just about any simple graphical object you can think of, but owing to their syntax, they’re not always easy to read, which can make tweaking them difficult. Additionally, while they perform in a consistent manner, they don’t always perform in an expected manner.

Experience shows that the most common graphical elements typesetters need are rules (horizontal and vertical), boxes, and circles (or ellipses). For this reason, mom provides macros to draw these objects in an easy-to-understand way; the results are predictable, and mom’s syntax makes fixes or tweaks painless.

For example, if you want to draw a 2-inch square outline box at the left margin using groff’s \D escapes, it looks like this:
back up by weight +-------+ | | \D't 500'\h'-500u'\D'p 2i 0 0 2i -2i 0 0 -2i' | | | | +-------+ +------------------------+ set rule draw box, 1 line at a time weight Obviously, this isn’t very efficient for something as simple as a box.

Here’s the same box, drawn with mom’s box drawing macro, DBX:
left margin indent--+ +--box width | | .DBX .5 0 2i 2i | | rule weight--+ +--box depth (in points)

Mom’s graphical object macros allow—in fact, require—giving the rule weight (“thickness”) for the object (or saying that you want it filled), an indent from the left margin where the object begins, the dimensions of the object, and optionally a colour for the object.

There are no defaults for the arguments to mom'a graphical object macros, which means you must supply the arguments every time you invoke them.

Note: As stated above, mom only provides macros for commonly-used graphical objects (rules, boxes, circles). More complex objects (polygons, non-straight lines, splines) must be drawn using groff’s \D escapes.

Graphical object behaviour

Mom’s graphical object macros all behave in the following, carved-in-stone ways:

  1. Objects are drawn from the baseline down, including horizontal rules.
  2. Objects begin precisely at the left indent supplied as an argument to the macro.
  3. Objects are drawn from left to right.
  4. Enclosed objects (boxes, circles) are drawn from the perimeter inward.
  5. Objects return to their horizontal/vertical point of origin.

The consistency means that once you've mastered the very simple order of arguments that applies to invoking graphical object macros, you can draw objects with full confidence that you know exactly where they’re placed and how much room they occupy. Furthermore, because all return to their point of origin, you’ll know exactly where you are on the page.

Order of arguments

The order of arguments to the graphical object macros is the same for every macro:

  • the Weight of the rule
    • if the object is enclosed (i.e. is a box or circle), the weight of the rule if you want the object outlined
    • the single word, SOLID, may be used in place of the weight argument if you want the object filled
  • the Indent from the current left margin at which to begin the object
  • the Length of the object, if applicable
  • the Depth of the object, if applicable
  • the Colour of the object (optional)

A simple mnemonic for the order of arguments is “WILD Card”. If you fix the mnemonic in your brain and apply a little judicious reasoning, you’ll always remember how to draw graphical objects. The “judicious reasoning” means that, for example, horizontal rules don’t require a depth and vertical rules don’t require a length. Thus, in the case of drawing a horizontal rule, you supply the macro, DRH, with only the arguments (from the mnemonic) that apply: W-I-L (and possibly C).

Graphical objects macros

  • DRH – horizontal rules
  • DRV – vertical rules
  • DBX – box
  • DCL – circles or ellipses

Drawing horizontal rules

Macro: DRH <none> | <weight> <indent> <length> [<colour>]

•  the argument to <weight> is in points, but do NOT append the unit of measure, p
•  <indent> and <length> require a unit of measure
•  arithmetic expressions to <indent> and <length> must be surrounded by parentheses

If all you want is to draw a rule from your current left margin to your current right margin (in other words, a "full measure" rule), you may invoke .DRH without any arguments.

Note: DRH is the only graphical object macro that may be invoked without arguments. The weight (“thickness”) of the rule is determined by the argument you last gave the macro, RULE_WEIGHT. DRH, used this way, is exactly equivalent to entering the inline escape, \*[RULE].

To draw horizontal rules of a specified length, you must, at a minimum, supply DRH with the arguments weight, indent (measured from the current left margin) and length.

Optionally, you may give a colour argument. The colour may be either one defined with NEWCOLOR, or a named X-colour inititialized with XCOLOR, or an X-colour alias (again, initialized with XCOLOR).

Say, for example, you want to draw a 1-1/4 point horizontal rule that starts 2 picas from the current left margin and runs for 3 inches. To do so, you'd invoke .DRH like this:
weight length | | .DRH 1.25 2P 3i | indent (Note that the rule weight argument, which is expressed in points, must NOT have the unit of measure p appended to it.)

If, in addition, you want the rule blue:
.DRH 1.25 2P 3i blue

How mom handles the positioning of horizontal rules

Horizontal rules are drawn from left to right, and from the baseline down. “From the baseline down” means that if you request a rule with a weight of four points, the four points of rule fall entirely below the baseline.

Furthermore, after the rule is drawn, mom returns you to the current left margin, at the same vertical position on the page as when DRH was invoked. In other words, DRH causes no movement on the page, either horizontal or vertical.

Drawing vertical rules

Macro: DRV <weight> <indent> <depth> [<colour>]

•  the argument to <weight> is in points, but do NOT append the unit of measure, p
•  <indent> and <depth> require a unit of measure
•  arithmetic expressions to <indent> and <depth> must be surrounded by parentheses

To draw vertical rules of a specified length, you must, at a minimum, supply DRV with the arguments weight, indent (measured from the current left margin) and depth.

Optionally, you may give a colour argument. The colour may be either one defined with NEWCOLOR, or a named X-colour inititialized with XCOLOR, or an X-colour alias (again, initialized with XCOLOR).

Say, for example, you want to draw a 3/4-point vertical rule that starts 19-1/2 picas from the current left margin and has a depth of 6 centimeters. To do so, you'd invoke .DRV like this:
weight depth | | .DRV .75 19P+6p 6c | indent (Note that the rule weight argument, which is expressed in points, must NOT have the unit of measure p appended to it.)

If, in addition, you want the rule red:
.DRV .75 19P+6p 6c red

How mom handles the positioning of vertical rules

Vertical rules are drawn from the baseline down, and from left to right. "Left to right" means that if you request a rule with a weight of four points, the four points of rule fall entirely to the left of the indent given to DRV.

Furthermore, after the rule is drawn, mom returns you to the current left margin, at the same vertical position on the page as when DRV was invoked. In other words, DRV causes no movement on the page, either horizontal or vertical.

Drawing boxes

Macro: DBX < <weight> | SOLID > <indent> <length> <depth> [<colour>]

•  the argument to <weight> is in points, but do NOT append the unit of measure p
• <indent>, <length>, and <depth> require a unit of measure
•  arithmetic expressions to <indent>, <length>, and <depth> must be surrounded by parentheses

To draw boxes of specified dimensions, you must, at a minimum, supply DBX with the arguments weight or SOLID, indent (measured from the current left margin), length and depth.

Optionally, you may give a colour argument. The colour may be either one defined with NEWCOLOR, or a named X-colour inititialized with XCOLOR, or an X-colour alias (again, initialized with XCOLOR).

Say, for example, you want to draw a 1/2 point outline box that starts one inch from the current left margin and has the dimensions 12 picas x 6 picas. To do so, you'd invoke .DBX like this:
indent depth | | .DBX .5 1i 12P 6P | | weight length (Note that the box weight argument, which is expressed in points, must NOT have the unit of measure p appended to it.)

If you want the same box, but solid (“filled”) rather than drawn as an outline:
.DBX SOLID 1i 12P 6P Additionally, if you want the box green:
.DBX .5 1i 12P 6P green or .DBX SOLID 1i 12P 6P green

How mom handles the positioning of boxes

Boxes are drawn from the baseline down, from left to right, and from the perimeter inward. “From the perimeter inward” means that if you request a box weight of six points, the 6-point rules used to draw the outline of the box fall entirely within the dimensions of the box.

Furthermore, after the box is drawn, mom returns you to the current left margin, at the same vertical position on the page as when DBX was invoked. In other words, DBX causes no movement on the page, either horizontal or vertical.

Drawing circles (ellipses)

Macro: DCL < <weight> | SOLID > <indent> <length> <depth> [<colour>]

• the argument to <weight> is in points, but do NOT append the unit of measure, p
•  the arguments <indent>, <length> and <depth> require a unit of measure
•  arithmetic expressions to <indent>, <length> and <depth> must be surrounded by parentheses

To draw circles of specified dimensions, you must, at a minimum, supply DCL with the arguments weight or SOLID, indent (measured from the current left margin), length and depth.

Optionally, you may give a colour argument. The colour may be either one defined with NEWCOLOR, or a named X-colour inititialized with XCOLOR, or an X-colour alias (again, initialized with XCOLOR).

Say, for example, you want to draw a 1/2 point outline circle (ellipse, actually, in this case) that starts one inch from the current left margin and has the dimensions 6 centimeters x 3 centimeters. To do so, you'd invoke .DCL like this:
indent depth | | .DCL .5 1i 6c 3c | | weight length (Note that the box weight argument, which is expressed in points, must NOT have the unit of measure p appended to it.)

If you want the same box, but solid (“filled”) rather than drawn as an outline:
.DCL SOLID 1i 6c 3c Additionally, if you want the circle yellow:
.DCL .5 1i 6c 3c yellow or .DCL SOLID 1i 6c 3c yellow

How mom handles the positioning of circles (ellipses)

Circles (ellipses) are drawn from the baseline down, from left to right, and from the perimeter inward. “From the perimeter inward” means that if you request a circle weight of six points, the 6-point rule used to draw the outline of the circle or ellipse falls entirely within the dimensions of the circle or ellipse.

Furthermore, after the circle is drawn, mom returns you to the current left margin, at the same vertical position on the page as when DCL was invoked. In other words, DCL causes no movement on the page, either horizontal or vertical.


Back to Table of Contents Top Next: Document processing

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/intro.html0000644000000000000000000000013212426110213021424 xustar000000000000000030 mtime=1415090315.614519134 30 atime=1415090315.614519134 30 ctime=1415090315.614519134 groff-1.22.3/contrib/mom/momdoc/intro.html0000644000175000001440000004543412426110213020274 0ustar00wlusers00000000000000 What is mom?
Back to Table of Contents Next: Definitions

What is mom?


Who is mom meant for?

Mom (“my own macros”, “my other macros”, “maximum overdrive macros”...) is a macro set for groff, designed to format documents in Portable Document Format (.pdf) and PostScript (.ps). She’s aimed at three kinds of users:

  1. Typesetters who suspect groff might be “the right tool for the job” but who are frustrated, intimidated, or puzzled by groff’s terse, not-always-typographically-intuitive primitives;
  2. Non-technical writers who need to format their work easily, with a minimum of clutter;
  3. Newcomers to groff, typesetting, or document processing who need a well-documented macro set to get them started.

Mom is actually two macro packages in one: a very complete set of typesetting macros, and an equally thorough set of document formatting macros. The typesetting macros afford fine-grained control over all visible aspects of page layout and design (margins, fonts, sizes, kerning, etc), while the document formatting macros focus on the logical structure of a document (titles, headings, paragraphs, lists, etc) and call on groff to render logical structure into pleasing type.

Typesetting with mom

Mom’s typesetting macros control the basic parameters of type: margins, line lengths, type family, font, point size, linespacing, and so on. In addition, they allow you to move around on the page horizontally and vertically, and to set up tabs, indents, and columns. Finally, they let you adjust such typographic details as justification style, letter spacing, word spacing, hyphenation, and kerning.

The typesetting macros also provide the means to create horizontal and vertical rules, rectangles (boxes, frames), and ellipses (circles).

In terms of typographic control, the typesetting macros provide access to groff’s primitives in a way that’s consistent, sensible, and easy to use. With them, you can create individual pages designed from the ground up. Provided you have not signalled to mom that you want document processing (via the START macro; see below), every typesetting macro is a literal command that remains in effect until you modify it or turn it off. This means that if you want to create flyers, surveys, tabulated forms, curricula vitae and so on, you may do so in the good old-fashioned way: one step at a time with complete control over every element on the page.

Years of experience have convinced me that no program can ever replace the human eye and human input when it comes to high quality typesetting. Words and punctuation on the printed page are too variable, too fluid, to be rendered flawlessly by any algorithm, no matter how clever.

Mom, therefore, does not try to guess solutions for issues like hanging punctuation, or left-margin adjustments for troublesome letters like T, V and W. Rather, she provides tools that allow knowledgeable typesetters to handle these typographic challenges in ways that are easier and more intuitive than manipulating groff at the primitive level.

Document processing with mom

Mom’s document processing macros let you format documents without having to worry about the typographic details. In this respect, mom is similar to other groff macro packages, as well as to html and LaTeX. Where mom differs is in the degree of control you have over the look and placement of the various elements of a document. For example, if you’d like your headings underlined, or in caps, or centred rather than flush left, you can make the changes easily and have them apply to the whole document. Temporary and one-off changes are easy, too.

Mom has some features other macro sets don’t provide. For example, you can switch between draft-style and final-copy output. If you regularly make submissions to publishers and editors who insist on "typewritten, double-spaced," there’s a special macro— PRINTSTYLE TYPEWRITE— that changes typeset documents into ones that would make an old-school typing teacher proud. Footnotes, endnotes, tables of contents, multiple columns, nested lists, recto/verso printing and user designable headers and footers are also part of the fun.

Mom’s philosophy

Formatting documents should be easy, from soup to nuts. Writers need to focus on what they’re writing, not on how it looks. From the moment you fire up an editor to the moment you add "FINIS" to your opus, nothing should interfere with the flow of your words. The commands needed to format your work should be easy to remember, comprehensible, and stand out well from the text. There shouldn’t be too much clutter. Your documents should be as readable inside a text editor as they are on the printed page.

Unfortunately, in computerland, “easy,” “comprehensible,” and “readable” often mean “you’re stuck with what you get.” No document formatting system can give you exactly what you want all the time, every time. Documents always need to be tweaked, either to satisfy a typographic whim or to clarify some aspect of their content.

Groff has traditionally solved the problem of formatting vs. tweaking by requiring users of the common macro packages (mm, ms, me and their offspring) to resort to groff primitives and inline escapes for their special typesetting needs. Not to put too fine a point on it, groff primitives tend toward the abstruse, and most inline escapes are about as readable as an encrypted password. This does not make for happy-camper writers, who either find themselves stuck with a formatting style they don’t like, or are forced to learn groff from the ground up—a daunting task, to say the least.

Mom aims to make creating documents a simple matter, but with no corresponding loss of user control. The document processing macros provide an initial set of reasonable defaults, but anything that is not to your liking can be changed. In combination with the typesetting macros, you have all the tools you need to massage passages and tweak pages until they look utterly professional.

One rarely hears the term “user interface” in conjunction with document processing. Since formatting takes place inside a text editor, little thought is given to the look and feel of the formatting commands. Mom attempts to rectify this by providing users with a consistent, readable “coding” style. Most of the macros (especially in the document processing set) have humanly-readable names. Not only does this speed up learning the macros, it makes the sense of what’s going on in a document easier to decipher, typographically and structurally.

Mom does not try to be all things to all people. In contrast to the normal groff philosophy, she does not try to produce output that looks good no matter where it’s displayed. She’s designed for primarily for PDF or PostScript output, although with PRINTSTYLE TYPEWRITE she produces acceptable terminal copy. No attempt is made to be compatible with older versions of troff.

One special feature in mom’s design is the attention she pays to aligning the bottom margins of every page. Nothing screams shoddy in typeset documents louder than bottom margins that wander, or, in typesetter jargon, “hang.” There are, of course, situations where whitespace at the bottom of a page may be unavoidable (for example, you wouldn’t want a head to appear at the bottom of the page without some text underneath it), but in all cases where hanging bottom margins can be avoided, mom does avoid them, by clever adjustments to leading (“line spacing”) and the spacing between different elements on the page.

A note on mom’s documentation

Writing documentation is tough, no doubt about it. One is never quite sure of the user’s level of expertise. Is s/he new to the application, new to its underlying protocols and programs, new to the operating system? At some point, one has to decide for whom the documentation is intended. Making the wrong choice can mean the difference between a program that gets used and a program that gets tossed.

Mom’s documentation assumes users know their way around their own operating system (basic file management, how to use the command line, how to use a text editor, etc). I run GNU/Linux, and while the documentation may exhibit a GNU/Linux bias, mom and groff can, in fact, be run on other platforms.

The documentation further assumes users at least know what groff is, even if they don’t know much about it. Lastly, it assumes that everyone—groff newbies and experts alike—learns faster from a few well-placed examples than from manpage-style reference docs. What mom’s documentation doesn’t assume is that you know everything—not about groff, not about typesetting, not about document processing. Even experts have odd lacunae in their knowledge base. Therefore, whenever I suspect that a term or procedure will cause head scratching, I offer an explanation. And when explanations aren’t enough, I offer examples.

Canonical reference materials

The canonical reference materials for groff are cstr54 (a downloadable PostScript copy of which is available here) and the troff and groff_diff manpages. The most complete and up-to-date source of information is the groff info pages, available by typing info groff at the command line (assuming you have the TeXinfo standalone browser installed on your system, which is standard for most GNU/Linux distributions). And for inputting special characters, see man groff_char.

I’ve tried to avoid reiterating the information contained in these documents; however, in a few places, this has proved impossible. But be forewarned: I have no qualms about sidestepping excruciating completeness concerning groff usage; I’m more interested in getting mom users up and running. Mea culpa.

Groff has ancillary programmes (pre-processors) for generating tables (tbl), diagrams (pic), and equations (eqn), which may be used in conjuction with mom. The manuals describing their usage are found at:
  tbl http://www.kohala.com/start/troff/v7man/tbl/tbl.ps
  pic http://www.kohala.com/start/troff/gpic.raymond.ps
  eqn http://www.kohala.com/start/troff/v7man/eqn/eqn2e.ps

Note: Mom’s macro file (om.tmac) is heavily commented. Each macro is preceded by a description of its arguments, function and usage, which may give you information in addition to what’s contained in this documentation.

Addendum: The main macro file, om.tmac, is stripped of comments when groff is built from sources. om.tmac in the sources themselves still contains the comments, as do the tarballs posted on mom’s homepage.


How to read macro arguments

The concise descriptions of macros in this documentation typically look like this:

Macro: MACRO_NAME arguments

arguments lists the macro’s arguments using conventions that should be familiar to anyone who has ever read a manpage. Briefly:

  1. Macro arguments are separated from each other by spaces.
  2. If an argument is surrounded by chevrons (< >), it’s a description of the argument, not the argument itself.
  3. If an argument begins with or is surrounded by double-quotes, the double quotes must be included in the argument.
  4. If the user has a choice between several arguments, each of the choices is separated by the pipe character (|), which means “or.”
  5. Arguments that are optional are surrounded by square brackets.
  6. <off> or <anything> in an argument list means that any argument other than those in the argument list turns the macro off.

Toggle macros

Some macros don’t require an argument. They simply start something. When you need to turn them off, the same macro with any argument will do the trick. That’s right: any argument (in caps, lowercase or a mixture thereof). This permits choosing whatever works for you: OFF, end, Quit, Q, X, and so on.

Since these macros toggle things on and off, the argument list simply reads toggle.

Examples

Example 1: An argument requiring double-quotes
Macro: TITLE "<title of document>"

The required argument to TITLE is the title of your document. Since it’s surrounded by double-quotes, you must include them in the argument, like this:
.TITLE "My Pulitzer Novel"

Example 2: A macro with required and optional arguments
Macro: TAB_SET <tab number> <indent> <length> [ L | R | C | J [ QUAD ] ] 

The first required argument is a number that identifies the tab (say, "3"). The second required argument is an indent from the left margin (say, 6 picas). The third required argument is the length of the tab (say, 3 picas). Therefore, at a minimum, when using this macro, you would enter:
.TAB_SET 3 6P 3P The remaining two arguments are optional. The first is a single letter, either L, R, C or J. The second, which is itself optional after L, R, C or J, is the word QUAD. Therefore, depending on what additional information you wish to pass to the macro, you could enter:
.TAB_SET 3 6P 3P L or
.TAB_SET 3 6P 3P L QUAD

Example 3: A sample toggle macro:
Macro: QUOTE toggle

QUOTE begins a section of quoted text in a document and doesn’t require an argument. When the quote’s finished, you have to tell mom it’s done. .QUOTE So runs my dream, but what am I? An infant crying in the night An infant crying for the light And with no language but a cry. .QUOTE OFF

Alternatively, you could have turned the quote off with END, or X, or something else.

Back to Table of Contents Top Next: Definitions

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/appendices.html0000644000000000000000000000013212426110213022404 xustar000000000000000030 mtime=1415090315.612519159 30 atime=1415090315.611519171 30 ctime=1415090315.612519159 groff-1.22.3/contrib/mom/momdoc/appendices.html0000644000175000001440000007255312426110213021256 0ustar00wlusers00000000000000 Mom -- Appendices
Back to Table of Contents

Appendices


Adding fonts to groff

<prefix>, in this section, refers to the directory in which groff is installed, typically
/usr/share/groff/ (for distro-specific, pre-compiled groff packages) or
/usr/local/share/groff/ (if you’ve built groff from source).

<version> refers to the groff version number, which can be found, if necessary, by typing
groff -v at the command line.

Groff comes with a small library of families (see the FAMILY macro for a list). The families have four fonts associated with them. These fonts are a combination of weight and shape:
R (Roman, usually Medium weight), I (Italic, usually Medium weight), B (Bold, usually Roman shape) and BI (Bold Italic) If you work with mom a lot, sooner or later you’ll find that these families and their associated fonts aren’t sufficient. You’ll want to supplement them, either with more fonts for the families already provided—Damn! I need Helvetica Bold Condensed Italic—or with entire new families.

Extending groff families / adding new families and fonts

The traditional approach

The traditional approach to extending groff families has been to create new families for non-default weights and shapes (e.g. Light, which is a weight, or Condensed, which is a shape), then to associate them with groff’s predefined R, I, B and BI font styles. An example of this can be seen in the groff PostScript font library itself, which is found in
<prefix>/<version>/font/devps/ There’s one “family” for Helvetica (HR, HI, HB, HBI) and another for Helvetica Narrow (HNR, HNI, HNB, HNBI).

The difficulty with this approach is that typographers tend to think of families as referring to the entire set of font weights and shapes associated with a family name. For example, when a typesetter says “the Helvetica family”, s/he is including the weights Helvetica Thin, Helvetica Light, Helvetica Regular, Helvetica Bold, Helvetica Heavy, etc, and all their associated shapes (Roman, Italic, Condensed, Narrow, Extended, Outline, etc).

Thus, intuitively, when a typesetter gives mom a .FAMILY H directive, s/he reasonably expects that any subsequent .FT directive will access the desired font from the Helvetica family—without the need to state explicitly both family and font to .FT, as it is explained one can do in the FAMILY and FT sections of these documents.

If one had, say, Helvetica Light Roman and Helvetica Light Italic as well as Helvetica Light Condensed Roman and Helvetica Light Condensed Italic, the established groff approach would require two “partial” families, HL (for Helvetica Light) and HLCD (for Helvetica Light Condensed), with R and I fonts for both:
HLR HLI HLCDR HLCDI Accessing these family/font combos routinely throughout a document would then require changing the family (with .FAMILY) and selecting the desired font (with .FT R or .FT I), or passing .FT the lengthy family+fontname (.e.g. .FT HLCDI).

The simpler way with mom

Fortunately, groff provides a mechanism whereby it’s possible to extend the basic R, I, B and BI fonts (“styles” in groff-speak) so that one can, in fact, create extensive type families, and access all the fonts in them with .ft (groff) or .FT (mom).

Mom uses this mechanism to offer, in addition to groff’s default font styles, the following:

UL = Ultra Light ULI = Ultra Light Italic ULCD = Ultra Light Condensed ULCDI = Ultra Light Condensed Italic ULEX = Ultra Light Extended ULEXI = Ultra Light Extended Italic XL = Extra Light XLI = Extra Light Italic XLCD = Extra Light Condensed XLCDI = Extra Light Condensed Italic XLEX = Extra Light Extended XLEXI = Extra Light Extended Italic TH = Thin THI = Thin Italic THCD = Thin Condensed THCDI = Thin Condensed Italic THEX = Thin Extended THEXI = Thin Extended Italic L = Light Roman LI = Light Italic LCD = Light Condensed LCDI = Light Condensed Italic LEX = Light Extended LEXI = Light Extended Italic BK = Book Roman BKI = Book Italic BKCD = Book Condensed BKCDI = Book Condensed Italic BKEX = Book Extended BKEXI = Book Extended Italic CD = Medium Condensed CDI = Medium Condensed Italic EX = Medium Extended EXI = Medium Extended Italic DB = DemiBold Roman DBI = DemiBold Italic DBCD = DemiBold Condensed DBCDI = DemiBold Condensed Italic DBEX = DemiBold Extended DBEXI = DemiBold Extended Italic SB = SemiBold Roman SBI = SemiBold Italic SBCD = SemiBold Condensed SBCDI = SemiBold Condensed Italic SBEX = SemiBold Extended SBEXI = SemiBold Extended Italic
BCD = Bold Condensed BCDI = Bold Condensed Italic BEX = Bold Extended BEXI = Bold Extended Italic BO = Bold Outline XB = Extra Bold XBI = Extra Bold Italic XBCD = Extra Bold Condensed XBCDI = Extra Bold Condensed Italic XBEX = Extra Bold Extended XBEXI = Extra Bold Extended Italic UB = Ultra Bold UBI = Ultra Bold Italic UBCD = Ultra Bold Condensed UBCDI = Ultra Bold Condensed Italic UBEX = Ultra Bold Extended UBEXI = Ultra Bold Extended Italic HV = Heavy HVI = Heavy Italic HVCD = Heavy Condensed HVCDI = Heavy Condensed Italic HVEX = Heavy Extended HVEXI = Heavy Extended Italic BL = Black BLI = Black Italic BLCD = Black Condensed BLCDI = Black Condensed Italic BLEX = Black Extended BLEXI = Black Extended Italic BLO = Black Outline XBL = Extra Black XBLI = Extra Black Italic XBLCD = Extra Black XBLCDI = Extra Black XBLEX = Extra Black Italic XBLEXI = Extra Black Italic UBL = Ultra Black UBLI = Ultra Black Italic UBLCD = Ultra Black Condensed UBLCDI = Ultra Black Condensed Italic UBLEX = Ultra Black Exteneded UBLEXI = Ultra Black Extended Italic SC = Small Caps Roman SCI = Small Caps Italic SCDB = Small Caps Demibold SCDBI = Small Caps Demibold Italic SCSB = Small Caps Semibold SCSBI = Small Caps Semibold Italic

Thus, with mom, if you’ve installed some extra Helvetica fonts and named them according to the convention <F><S> (where <F> means family and <S> means font style), once having entered
.FAMILY H you can access any of the extra Helvetica fonts simply by passing the correct argument to FT from the list, above. For example, if you were working in Medium Roman (.FT R) and you needed Medium Condensed Italic for a while (assuming it’s installed), you’d just type
.FT CDI to access the Medium Condensed Italic font from the Helvetica family.

Mom’s list of font styles doesn’t pretend to be exhaustive. The extension names are arbitrary and can be used in a flexible manner. For example, if you create a family that has a Demibold font (DB) but no Bold font (B), you might find it more convenient to give the Demibold font the extension “B”.

You may, at needs, want to add to mom’s list of font styles. You can do this by editing the file, om.tmac (typical location: <prefix>/<version>/tmac/om.tmac). Near the top, you’ll see lines of the form
.sty \n[.fp] XL \" Extra Light .sty \n[.fp] L \" Light Roman .sty \n[.fp] LI \" Light Italic .sty \n[.fp] LCD \" Light Condensed Roman Simply add your new font style by imitating what you see, above, and plugging in your new font style (having, of course, added the font to groff, correctly named). directory; see Step-by-step instructions).

For example, if you already have some fonts from the Univers family installed and have called the family Univers, you might decide at some point to add the Bold Outline font (UniversBO). In which case, you’d add
.sty \n[.fp] BO \" Bold Outline to the .sty \n[.fp]  <font style> list in om.tmac.

Note: Mom’s font extensions are not “user-space” controllable via a macro. If you’ve been using groff for a long time, and have already rolled your own solution to adding families and fonts to groff, you may find that mom’s font extensions conflict with your own scheme. Should that be the case, comment out the .sty \n[.fp] <font style> lines found near the top of the om.tmac file.

Important: Be careful that any styles you add do not conflict with family names that already exist. “C”, for example, conflicts with the Courier family (CR, CI, CB, CI). Were you to create a font style “C”, thinking that .FT C would give you access to font style once you’d given a .FAMILY directive, you’d get a nasty surprise: your type would come out in Courier Roman!


Step-by-step instructions

There are a number of ways to approach making fonts available to groff. These instructions aren’t meant to cover all possibilities, merely one.

GNU/Linux distributions being what they are, directory locations may differ and the presence of some executables can’t be guaranteed. I run a Debian-based system. The instructions reflect that. Users of other distros may have to interpret them according to the way their distro operates.

What you need before you start

  • groff, version 1.18 or higher
    (Debian package: groff)
  • ghostscript
    (Debian package: ghostscript or ghostscript-x)
  • fontforge
    (Debian package: fontforge)

Initial preparation (you only need do this once)

  1. Locate the groff directory, site-font. The exact location is difficult to predict, owing to differences between distros and whether you’re using a pre-packaged groff or have built it from source. Some typical locations are:
    /usr/share/groff/ /usr/local/share/groff/ /etc/groff/ If you can’t find the site-font directory, locate groff’s site-tmac directory, and, as root, create site-font in the same directory. Eg, if you find site-tmac in /usr/share/groff/, create site-font in /usr/share/groff/
    sudo mkdir site-font
  2. Create two files, generate-t42.pe and generate-pfa.pe, as you see them below. Place them in a convenient and easily-remembered location, like your home directory.
    generate-t42.pe
    # generate-t42.pe Open($1); Generate($fontname + ".pfa"); Generate($fontname + ".t42");

    generate-pfa.pe
    # generate-pfa.pe Open($1); Generate($fontname + ".pfa");

Step 1: Acquire the font

The two most commonly available types of fonts are PostScript Type1 (extension .pfb) and TrueType (extension .ttf). Either can be made available to groff. There are many websites holding collections of both.

Step 2: Prepare to convert the font to the correct format

Change into the directory holding the new font.

For convenience in the next step, make a symbolic link to the file 'textmap':
ln -s <prefix>/<version>/font/devps/generate/textmap . See here for an explanation of <prefix> and <version>.

In addition, unless you're installing fonts from your home directory, make links to the files 'generate-t42.pe' and 'generate-pfa.pe'.
ln -s $HOME/generate-t42.pe . ln -s $HOME/generate-pfa.pe .

Step 3: Convert the font and put it in the right place

TrueType fonts (.ttf) need to be converted to .t42. Type 1 fonts (.pfb) need to be converted to .pfa.

 • TTF Fonts

For .ttf fonts, run
fontforge -script generate-t42.pe <file>.ttf This will create three new files with the extensions .t42, .pfa, and .afm. Next, run
afmtodit <afm file> textmap <groff font> This will create a groff font with the name you give. (See here for advice on naming groff fonts.)

Move the .t42 and groff font files to <prefix>/site-font/devps/.

If you're running a recent version of groff that includes the native pdf device (gropdf), move the .pfa file to <prefix>/<version>/font/devpdf/. If not, you may safely remove it. You may also safely remove the .afm file.

 • Type1 Fonts

For .pfb fonts, run
fontforge -script generate-pfa.pe <file>.ttf This will create two new files with the extensions .pfa, and .afm. Next, run
afmtodit <afm file> textmap <groff font> Move the .pfa and groff font files to <prefix>/<site-font>/devps/. (See here for advice on naming groff fonts.)

If you're running a recent version of groff that includes the native pdf device (gropdf), link the .pfa and groff font files, now in <prefix>/<site-font>/devps/, to the devpdf directory. Start by changing into the <prefix>/<version>/font/devpdf/ directory, then:
ln -s <prefix>/<version>/font/devps/<file>.pfa . ln -s <prefix>/<version>/font/devps/<groff font> . You may safely remove the .afm file.

Step 4: Update the download file

 • Get the internal font name

Inspect your new groff font file. Near the top, you will see a line of the form
internalname <name> Usually, the internal name is helpfully descriptive, eg,
internalname Optima-Bold Make a note of the internal name.

 • Add the font to the download file

Open the file <prefix>/<version>/font/devps/download. In it you will see lines of the form
Symbol-Slanted symbolsl.pfa ZapfDingbats-Reverse zapfdr.pfa FreeEuro freeeuro.pfa where the spaces are the tab character from the keyboard, not literal spaces. Thus,
Symbol-Slanted symbolsl.pfa is really
Symbol-Slanted<tab>symbolsl.pfa

The download file maps the internal names used by groff to the actual fonts. To add your new font to the download file, append a line containing the internal name, followed by a tab (make sure your text editor is inserting the tab character, not spaces), followed by the .t42 or .pfa font to which the internal name refers.

For example, if the internal name is Optima-Bold and the font is a .pfa file called Optima-Bold.pfa, your updated download file will contain
Optima-Bold<tab>Optima-Bold.pfa

 • Updating the gropdf download file

If you're running a recent version of groff that includes the native pdf device (gropdf), you must update its download file as well, which is found in <prefix>/<version>/font/devpdf/. The instructions are identical to those above, but with one important difference: all lines must begin with a tab character. Thus, using our Optima example, your devpdf download line for the same font is
<tab>Optima-Bold<tab>Optima-Bold.pfa

Naming groff fonts

For convenience when using mom, and to keep your font collection organized, choose meaningful groff font names following the scheme <Family><FONT>, where Family is something like Optima or Univers or Clarendon, and FONT is either
R  (roman/regular)
I  (italic)
B  (bold)
BI (bold italic)
or one of the 1–5 character fontstyles listed here. Thus, for the fonts Optima Light Italic and Optima Extra Black, your font names would be
OptimaLI OptimaXBL This scheme allows you to enter .FAMILY Optima to make Optima the current family, and .FT LI or .FT XBL when you need the fonts Light Italic or Extra Black.

Groff font names are, in fact, arbitrary; you can call your fonts anything you like, provided the internal name in the download file matches the internal name found in the groff font file. When calling a font that does not follow the recommended naming convention, you must pass the full font name to .FT whenever you wish to use it.

For example, the font, Goudy Stout, isn't really part of the Goudy family, and while "stout" describes it, Stout is not a recognized font style. Therefore, its groff name could simply be GoudyStout, and whenever you needed it, you could call it with .FT GoudyStout.

Automate the whole process – the install-font script

A bash script to make the entire process of installing fonts a painless no-brainer has been posted online at http://www.schaffter.ca/mom/install-font. Be sure to make the script executable (chmod 755 install-font) after you download it, then type ./install-font -H for usage.


Some reflections on mom

If, as Eric Raymond asserts, open source begins with a programmer scratching a personal itch, then mom can truly be called open source.

Mom had her origins in a library of groff routines I wrote over the years to handle various aspects of typesetting and document processing that weren’t adequately covered by ms, me, mm, and friends. Typically, I’d use the library to cobble together macro sets for new challenges as they came my way.

As a writer living in a perpetual state of penury, all the computers I’ve ever owned have been hand-me-downs—several generations out-of-date and resource challenged. Disk space has always been an issue, as has processor speed and available RAM. One of the reasons I run GNU/Linux rather than the offering from Redmond is that it has helped enormously to get the most out of my poor little boxes.

In Linux-land (all Unix variants, in fact), the choice of typesetting systems basically comes down to groff or TeX. Both are wonderful—monumental achievements if you ask me—and both have their own particular strengths. However, for people in my financial position (and there are millions of us around the globe, in both developed and developing countries), TeX and groff have one big difference: size. TeX is huge. Even its most ardent supporters agree it suffers from bloat, on top of being complex and unwieldy to manage. Groff is tiny by comparison, occupying minimal disk space and having only a small memory footprint while at the same time being flexible and powerful, typographically speaking. Back in the Jurassic Period, I ran it successfully on a 386 with 8 megs of RAM and a 250 meg hard disk.

However, groff has always had a liability: it’s incredibly geeky. Owing to its very long history, it—and its power users —seem to have remained stuck in a time warp. The canonical macro packages still look as they did back in those decades when memory was exorbitantly expensive and every byte mattered.

For some time now, groff users and macro writers have had the option to use “long” names for macros (i.e. longer than two letters, the original limit), yet have mostly chosen not to. With long names, it’s possible to create macro sets that are humanly readable and easy to interpret, encouraging development and evolution. What’s more, the macros themselves need not be terse, intimidating, and easily forgotten 1- or 2-letter commands inserted in the body of a document. They can be sensible and helpful to everyone, groff newbies and old hands alike.

Mom’s macro file, om.tmac, uses long names, aliases, and a host of other groff goodies that have become part of the whole groff picture under the unflagging guidance of groff’s current maintainer, Werner Lemberg. The function of nearly every macro, number register and string can be infered simply from its name. The file is heavily commented. A consistent, if idiosyncratic, indenting style is used as well, significantly improving readability. Anyone wanting to futz around with mom’s macros should be able to do so with a minimum of head scratching.

Note: The main macro file, om.tmac, is stripped of comments when groff is built from sources. om.tmac, in the sources themselves, still contains the comments, as do the tarballs posted on mom’s homepage.


Contact the author

If you have any questions or comments about mom, suggestions to make, criticisms to offer, or bugs to report, use the groff mailing list (subscription information available here) or contact me, Peter Schaffter, directly at the following address:
peter@schaffter.ca Please include the word “mom” or “groff” in the Subject line of any message sent to my personal address or you risk the wrath of my implacable spam filters.

If you want to visit mom’s website, you’ll find a link to it at
http://www.schaffter.ca The site contains links to some of my fiction, all of which was typeset with mom and groff.


Back to Table of Contents Top

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/goodies.html0000644000000000000000000000013212426110213021722 xustar000000000000000030 mtime=1415090315.613519146 30 atime=1415090315.613519146 30 ctime=1415090315.613519146 groff-1.22.3/contrib/mom/momdoc/goodies.html0000644000175000001440000014014512426110213020565 0ustar00wlusers00000000000000 Mom -- Goodies
Back to Table of Contents Next: Inline escapes

Goodies

The macros in this section are a collection of useful (and sometimes nearly indispensable) routines to simplify typesetting.


Rename macros

Macro: ALIAS <new name> <old name>

The ALIAS macro may well be your best friend. With it, you can change the name of a macro to anything you like (provided the new name is not already being used by mom; see the list of reserved words).

Groff has always been a bit intimidating for new users because its standard macro packages use very terse macro names. Mom doesn’t like people to feel intimidated; she wants them to feel welcome. Consequently, she tries for easy-to-grasp, self-explanatory macro names. However, mom knows that people have their own ways of thinking, their own preferences, their own habits. Some of her macro names may not suit you; they might be too long, or aren’t what you automatically think of when you want to do a particular thing, or might conflict with habits you’ve developed over the years.

If you don’t like one of mom’s macro names, say, PAGEWIDTH, change it, like this:
.ALIAS PW PAGEWIDTH | | new--+ +--official name name The first argument to ALIAS is the new name you want for a macro. The second is the “official” name by which the macro is normally invoked. After ALIAS, either can be used.

Note that in ALIAS, you do NOT include the period (dot) that precedes the macro when it’s a control line.

Tip: A particularly good candidate for ALIAS is the macro, PT_SIZE. A more natural name for it would simply be PS, but PS conflicts with the eqn equation preprocessor and thus mom uses the longer form. However, if you’re not using eqn, you can happily rename PT_SIZE to PS:
.ALIAS PS PT_SIZE

Note: If you use ALIAS a lot, and always for the same things, consider creating an aliases file of the form
.ALIAS <new name> <old name> .ALIAS <new name> <old name> .ALIAS <new name> <old name> ...etc Put the file someplace convenient and source it (include it) at the beginning of your documents with the INCLUDE macro. Assuming that you’ve created an aliases file called mom-aliases in your home directory under a directory called Mom, you’d source it by placing
.INCLUDE /home/<username>/Mom/mom-aliases at the top of your documents.

If you share documents that make use of an alias file, remember that other people don’t have the file. Paste the whole thing at the top of your documents, please.

Experts: ALIAS is an alias of .als. You can use either, or mix 'n' match with impunity.

Hide input lines from output

Macro: SILENT toggle

Alias: COMMENT

Sometimes, you want to “hide” input lines from final output. This is most likely to be the case when setting up string tabs (see the quickie tutorial on string tabs for an example), but there are other places where you might want input lines to be invisible as well. Any place you don’t want input lines to appear in the output, use the SILENT macro.

SILENT is a toggle. Invoking it without an argument turns it on; any argument turns it off. E.g.,
.SILENT A line of text .SILENT OFF The line “A line of text” will not appear in the output copy.

SILENT is aliased as COMMENT. If you want to insert non-printing comments into your documents, you may prefer this.

Tip: SILENT does not automatically break an input line (see BR) when you’re in one of the fill modes (JUSTIFY or QUAD L | R | C | J). The same applies to tabs (typesetting or string) to which you’ve passed the J or QUAD argument. You must insert .BR yourself, or risk a portion of your text disappearing into a black hole.

Suspend/re-invoke traps

Macro: TRAP toggle

Traps are vertical positions on the output page at which you or mom have instructed groff to start doing something automatically. Commonly, this is near the bottom of the page, where behind-the-scenes processing is needed in order for one page to finish and another to start.

Sometimes, traps get sprung when you don’t want them. If this happens, surround just the offending macros and input lines with
.TRAP OFF ... .TRAP TRAP is a toggle, therefore any argument turns it off (ie suspends the trap), and no argument turns it (back) on.

Convert typewriter doublequotes to proper doublequotes

Macro: SMARTQUOTES [<off>] [ ,, | >> | << ]
or
Macro: SMARTQUOTES DA | DE | ES | FR | IT | NL | NO | PT | SV

If you invoke SMARTQUOTES without an argument, mom converts all instances of the inch-mark, ("), also called a doublequote, into the appropriate instances of true Anglo-American open-and close-doublequotes. (See Internationalization for how to get SMARTQUOTES to behave correctly for non-English quoting styles.)

Typographically, there is a difference between the inch-mark and quotation marks—a BIG difference. Sadly, typewriters and computer keyboards supply only one: the inch-mark. While using inches for doublequotes is, and always has been, acceptable in typewriter-style copy, it has never been, and, God willing, never will be acceptable in typeset copy. Failure to turn inches into quotes is the first thing a professional typesetter notices in documents prepared by amateurs. And you don’t want to look like an amateur, do you?

Internationalization

If you invoke SMARTQUOTES with one of the optional arguments (,, or >> or <<) you can use " (ie the inch-mark/doublequotes key) as “cheap” open-and close-quotes when inputting text in a language other than English, and have mom convert them, on output, into the chosen open-and close-quote style.

,, opens quotes with “lowered doublequotes” and closes them with “raised doublequotes”, as in this ascii approximation:
,,Hilfe !`` >> opens quotes with guillemets pointing to the right, and closes them with guillemets pointing to the left, as in this ascii approximation:
>>Zurück !<< << opens quotes with guillemets pointing to the left, and closes them with guillemets pointing to the right, as in this ascii approximation:
<<Mais monsieur! Je ne suis pas ce genre de fille!>> Please note: the above arguments to SMARTQUOTES are literal ASCII characters. ,, is two commas; << is two less-than signs; >> is two greater-than signs.

Alternatively, you can pass SMARTQUOTES the two-letter, ISO 639 abbreviation for the language you’re writing in, and mom will output the correct quotes.
.SMARTQUOTES DA = Danish >>text<< .SMARTQUOTES DE = German ,,text`` .SMARTQUOTES ES = Spanish ``text´´ .SMARTQUOTES FR = French << text >> .SMARTQUOTES IT = Italian << text >> .SMARTQUOTES NL = Dutch ´´text´´ .SMARTQUOTES NO = Norwegian <<text>> .SMARTQUOTES PT = Portuguese <<text>> .SMARTQUOTES SV = Swedish >>text>>

Turn SMARTQUOTES off by passing it any argument not in the argument list (e.g. OFF, QUIT, X, etc.)

If you’re using the document processing macros with PRINTSTYLE TYPESET, SMARTQUOTES is on by default (in the Anglo-American style); with PRINTSTYLE TYPEWRITE, it’s off by default (and should probably stay that way).

Finally, if you’re fussy about the kerning of quote marks in relation to the text they surround, or have special quoting needs, you have to enter quote marks by hand using groff’s native inline escapes for special characters (see man groff-char for a complete list of special characters). Entering quote marks this way allows you to use mom’s inline kerning escapes to fine-tune the look of quotes.

Note: SMARTQUOTES does not work on single quotes, which most people input with the apostrophe (found at the right-hand end of the “home row” on a QWERTY keyboard). Groff will interpret all instances of the apostrophe as an apostrophe, making the symbol useless as an open-single-quote. For open single quotes, input the backtick character typically found under the tilde on most keyboards. Here’s an example of correct input copy with single quotes:
"But she said, `I don’t want to!'"

Additional note: Whether or not you have SMARTQUOTES turned on, get into the habit of entering the foot-and inch-marks, when you need them, with the inline escapes \*[FOOT] and \*[INCH], instead of ' and ".

Convert to upper case

Macro: CAPS toggle

CAPS converts all lower case letters to upper case. Primarily, it’s a support macro used by the document processing macros, but you may find it helpful on occasion. CAPS is a toggle, therefore no argument turns it on, any argument (OFF, QUIT, X, etc.) turns it off.
.CAPS All work and no play makes Jack a dull boy. .CAPS OFF produces, on output
ALL WORK AND NO PLAY MAKES JACK A DULL BOY. If you wish to capitalise a section of type inline, use the inline escapes, \*[UC]...\*[LC] like this:
All work \*[UC]and\*[LC] no play makes Jack a dull boy. The above produces, on output
All work AND no play makes Jack a dull boy.

User-defined strings

Macro: STRING <name> <what you want in the string>

You may find sometimes that you have to type out portions of text repeatedly. If you’d like not to wear out your fingers, you can define a string that, whenever you call it by name, outputs whatever you put into it.

For example, say you’re creating a document that repeatedly uses the phrase “the Montreal/Windsor corridor”. Instead of typing all that out every time, you could define a string, like this:
.STRING mw the Montreal/Windsor corridor Once a string is defined, you can call it any time with the inline escape \*[<stringname>]. Using the example string above
The schedule for trains along \*[mw]: produces, on output
The schedule for trains along the Montreal/Windsor corridor:

Note: Be very careful not to put any spaces at the ends of strings you’re defining, unless you want them. Everything after the name argument you pass to STRING goes into the string, including trailing spaces. It’s a good idea to get into the habit of using groff’s native commenting mechanism, \", immediately following any string definition in order to avoid spaces you can’t see, like this
.STRING mw the Montreal/Windsor corridor\"

Experts: STRING is an alias for ds. You can use either, or mix 'n' match with impunity.

Change the escape character

Macro: ESC_CHAR <new character> | <anything>

Groff’s and mom’s default escape character is the backslash. Sometimes, you may want to include a literal backslash in your document. There are two ways to accomplish this. One is simply to double the backslash character (\\), which is convenient if you don’t have a lot of backslashes to input. If you need to input a whole batch of backslashes (say, when including code snippets in your document), you can use ESC_CHAR to make the change permanent (until you decide to restore the escape character to its default, the backslash).

ESC_CHAR with a single character argument changes the escape character to whatever the argument is. ESC_CHAR with no argument restores the escape character to the backslash.

Experts: ESC_CHAR is an alias of .ec. Mix 'n' match the two with impunity.

Get cap-height, x-height and descender depth of a font

Macro: SIZESPECS

Whenever you need to get the cap-height, x-height or descender depth of type at the current point size, invoke .SIZESPECS, which takes no argument. The dimensions are stored in the string registers \*[$CAP_HEIGHT], \*[$X_HEIGHT] and \*[$DESCENDER], respectively, in machine units to which the unit of measure, u, is already appended.

Thus, if you wanted to advance 2 inches from your current position on the page plus the cap-height of the current point size of type
.PT_SIZE <n> .SIZESPECS .ALD 2i+\*[$CAP_HEIGHT] would do the trick.

Single underscore

Macro: UNDERSCORE [ <distance below baseline> ] "<string>"

• Optional argument requires a unit of measure

By default, UNDERSCORE places an underscore 2 points beneath the required string argument. The string must be enclosed in double-quotes, like this:
.UNDERSCORE "Unmonitored monopolies breed high prices and poor products."  If you wish to change the distance of the rule from the baseline, use the optional argument <distance below baseline> (with a unit of measure).
.UNDERSCORE 3p "Unmonitored monopolies breed high prices and poor products."  The above places upper edge of the underscore 3 points below the baseline.

Note: UNDERSCORE does not work across line breaks in output copy, which is to say that you can’t underscore a multi-line passage simply by putting the text of the whole thing in the string you pass to UNDERSCORE. If you need to underscore several lines of type, use UNDERLINE.

Controlling the weight of underscores

The weight (thickness) of underscores may be controlled with the macro, UNDERSCORE_WEIGHT. Thus, if you want underscores with a weight of 1-1/2 points, you’d invoke:
.UNDERSCORE_WEIGHT 1.5 prior to invoking .UNDERSCORE. Every subsequent instance of .UNDERSCORE will use this weight.

Mom’s default underscore weight is 1/2 point.

Note: UNDERSCORE_WEIGHT also sets the weight of double underscores.

Colorizing underscored text

If you want underscored text to be in a different colour from the text around it, use the COLOR macro, rather than the inline escape for changing color. In other words, assuming your prevailing text color is black and you want underscored text in red
.COLOR red .UNDERSCORE "text to underscore" .COLOR black rather than
.UNDERSCORE "\*[red]text to underscore\*[black]" The latter will render the text in red, and the underscore in black. You can use this to create truly rainbow effects if you want, e.g. text in red, underscore in blue, and prevailing type in black:
.UNDERSCORE "\*[red]text to underscore\*[blue]" .COLOR black

Double underscore

Macro: UNDERSCORE2 [ <distance below baseline> [ <distance between rules> ] ] "<string>"

• Optional arguments require a unit of measure

By default, UNDERSCORE2 places a double underscore 2 points beneath the required string argument. The string must be enclosed in double-quotes, like this:
.UNDERSCORE2 "Unmonitored monopolies breed high prices and poor products." The default distance between the two rules is 2 points, measured from the bottom edge of the upper rule to the top edge of the lower one.

If you wish to change the distance of the double underscore from the baseline, use the optional argument <distance below baseline> (with a unit of measure), e.g.,
.UNDERSCORE2 3p "Unmonitored monopolies breed high prices and poor products." which places the upper edge of the first rule of the double underscore 3 points below the baseline.

If you wish to change the distance between the two rules as well, use the second optional argument <distance between rules> (with a unit of measure). Be aware that you must give a value for the first optional argument if you want to use the second. The distance between the two rules is measured from the bottom edge of the upper rule to the top edge of the lower one.

The weight (thickness) of double underscores may be controlled with the macro UNDERSCORE_WEIGHT (q.v).

Underline

Macro: UNDERLINE toggle

The distinction between underscoring and underlining is that underscoring is suitable for occasional effects (a word here, a word there), whereas underlining underlines whole passages of type. Furthermore, you cannot colorize underlining, and there’s a special macro, UNDERLINE_SPECS, to control the weight and distance from the baseline of the underline. Lastly, files that use UNDERLINE must be processed with
pdfmom -Tps filename.mom | ps2pdf - filename.pdf since groff's native pdf driver does not recognize UNDERLINE.

UNDERLINE is a toggle macro, therefore you invoke it by itself (ie with no argument) to initiate underlining, and with any argument (OFF, QUIT, X, etc) to turn it off.

Note: Underlining may also be turned on and off inline with the escapes \*[UL]...\*[ULX].

Additional note: In document processing, neither .UNDERLINE nor \*[UL] persist past the current document element tag. For example, if you turn underlining on in a paragraph (.PP), your next paragraph will not be underlined.

UNDERLINE_SPECS

The weight of underlining and the distance from the baseline is set with
.UNDERLINE_SPECS <weight> <distance> The <weight> argument can be expressed in any unit of measure you like, but points is the most usual. Mom’s default is 1/2 point (.5p). The same holds for the <distance> argument; mom’s default is 1-1/4 points (1.25p).

INLINE ESCAPE FOR UNDERLINING

The macro pair, .UNDERLINE / .UNDERLINE OFF, and the inline escapes, \*[UL] / \*[ULX], are functionally identical, hence, in fill modes
Which should I heed? .UNDERLINE Just do it .UNDERLINE OFF or .UNDERLINE just say no? .UNDERLINE OFF produces the same result as
Which should I heed? \*[UL]Just do it\*[ULX] or \*[UL]just say no?\*[ULX] In either case, this is a misuse of UNDERLINE. UNDERSCORE is preferable.

Insert equalized whitespace into lines

Macro: PAD "<string with pad markers inserted>" [ NOBREAK ]

With PAD, you can insert proportional amounts of whitespace into a line. The optional NOBREAK argument tells mom not to advance on the page after the PAD macro has been invoked.

PAD calculates the difference between the length of text on the line and the distance remaining to its end, then inserts the difference (as whitespace) at the place(s) you specify.

Take, for example, the following relatively common typesetting situation, found at the bottom of legal agreements:
Date Signature |

The person signing the agreement is supposed to fill in the date as well as a signature. Space needs to be left for both, but the exact amount is neither known, nor important. All that matters is that there be a little space after Date, and rather more space after Signature. (In the above, | represents the end of the line at the prevailing line length.)

The pad marker (see below) is # (the pound or number sign on your keyboard) and can be used multiple times in a line. With that in mind, here’s how you’d input the Date/Signature line (assuming a length of 30 picas):
.LL 30P .PAD "Date#Signature###"

When the line is output, the space remaining on the line, after "Date" and "Signature" have been taken into account, is split into four (because there are four # signs). One quarter of the space is inserted between Date and Signature, the remainder is inserted after Signature.

Example of PAD usage

One rarely wants merely to insert space in a line; one usually wants to fill it with something, hence PAD is particularly useful in conjunction with string tabs. The following uses the Date/Signature example, above, but adds rules into the whitespace through the use of string tabs and mom’s inline escape \*[RULE].
.LL 30P .PAD "Date \*[ST1]#\*[ST1X] Signature \*[ST2]###\*[ST2X]" NOBREAK .ST 1 J .ST 2 J .TAB 1 \*[RULE] .TN \*[RULE] .TQ

Here’s what the example does:

  1. Pads the Date/Signature line with a shorter space for Date (#) and a longer space for Signature (###), encloses the padded space with string tabs markers, and outputs the line without advancing on the page.
  2. Sets the quad for the two string tabs (in this instance, justified).
  3. Calls the first string tab and draws a rule to its full length.
  4. Calls the second tab with TN (which moves to tab 2 and stays on the same baseline) then draws a rule to the full length of string tab 2.

Often, when setting up string tabs this way, you don’t want the padded line to print immediately. To accomplish this, use SILENT. See the quickie tutorial on string tabs for an example.

Note: Because the pound sign (#) is used as the pad marker, you can’t use it as a literal part of the pad string. If you need the sign to appear in the text of a padded line, change the pad marker with PAD_MARKER. Also, be aware that # as a pad marker only applies within the PAD macro; at all other times it prints literally, just as you’d expect.

Another important consideration when using PAD is that because the string must be enclosed in double-quotes, you can’t use the double-quote (") as part of the string. The way to circumvent this is to use the groff inline escapes \(lq and \(rq (leftquote and rightquote respectively) whenever double-quotes are required in the string passed to PAD.

Change/set the marker used with PAD

Macro: PAD_MARKER "<character to use as the pad marker>

If you need to change mom’s default pad marker (#), either because you want a literal # in the padded line, or simply because you want to use another character instead, use PAD_MARKER, whose argument is the new pad marker character you want.
.PAD_MARKER @ changes the pad marker to @.

Once you’ve changed the pad marker, the new marker remains in effect for every instance of PAD until you change it again (say, back to the pound sign).

Inline escape to add leaders to a line

Inline: \*[LEADER]

Whenever you want to fill a line or tab with leaders, use the inline escape \*[LEADER]. The remainder of the line or tab will be filled with the leader character. Mom’s default leader character is a period (dot), but you can change it to any character you like with LEADER_CHARACTER.

Note: \*[LEADER] fills lines or tabs right to their end. You cannot insert leaders into a line or tab and have text following the leader on the same line or in the same tab. Should you wish to achieve such an effect typographically, create tabs for each element of the line and fill them appropriately with the text and leaders you need. String tabs are perfect for this. An example follows.
.LL 30P .PAD "Date\*[ST1]#\*[ST1X] Signature\*[ST2]###\*[ST2X]" NOBREAK .EL .ST 1 J .ST 2 J .TAB 1 \*[LEADER] .TN \*[LEADER] .TQ

The PAD line sets the words Date and Signature, and marks string tabs around the pad space inserted in the line. The string tabs are then "set", called, and filled with leaders. The result looks like this:
Date.............Signature.....................................

Change/set the leader character

Macro: LEADER_CHARACTER <character>

LEADER_CHARACTER takes one argument: a single character you would like to be used for leaders. (See \*[LEADER] for an explanation of how to fill lines with leaders.)

For example, to change the leader character from mom’s default (a period) to the underscore character, enter
.LEADER_CHARACTER _

Tip: A particularly useful function of LEADER_CHARACTER is that it can be used to increase the spacing of mom’s default leaders. This is done by assigning to LEADER_CHARACTER both the period (dot) and a space. The technique requires a little low-level groffing:
.char \[leader] . \" .LEADER_CHARACTER \[leader] The .char primitive allows you to define a character called leader, to which you assign a period and a space. The \", which, in groff, is used to add non-printing comments to a line, is not strictly necessary. Its presence here lets you see that there’s a space after the period.

Drop caps

Macro: DROPCAP <dropcap letter> <number of lines to drop> [ COND <percentage> | EXT <percentage> ]

The first two arguments to DROPCAP are the letter you want to be the drop cap and the number of lines you want it to drop. By default, mom uses the current family and font for the drop cap.

The optional argument (COND or EXT) indicates that you want the drop cap condensed (narrower) or extended (wider). If you use COND or EXT, you must follow the argument with the percentage of the letter’s normal width you want it condensed or extended. No percent sign (%) is required.

Mom will do her very best to get the drop cap to line up with the first line of text indented beside it, then set the correct number of indented lines, and restore your left margin when the number of drop cap lines has been reached.

Beginning a paragraph with a drop cap “T” looks like this:
.DROPCAP T 3 COND 90 he thousand injuries of Fortunato I had borne as best I could, but when he ventured upon insult, I vowed revenge. You who so well know the nature of my soul will not suppose, however, that I gave utterance to a threat...

The drop cap, slightly condensed but in the current family and font, will be three lines tall, with whatever text fills those three lines indented to the right of the letter. The remainder of the paragraph’s text will revert to the left margin.

Note: When using the document processing macro PP, DROPCAP only works

  • with initial paragraphs (ie at the start of the document, or after HEAD),
  • when .DROPCAP comes immediately after .PP,
  • the PRINTSTYLE is TYPESET.

If these conditions aren’t met, DROPCAP is silently ignored.

Warning: DROPCAP puts a bit of a strain on resource-challenged systems. If you have such a system and use drop caps extensively in a document, be prepared for a wait while mom does her thing.

Support macros for DROPCAP

Drop caps are the bane of most typesetters’ existence. It’s very difficult to get the size of the drop cap right for the number of drop lines, especially if the drop cap is in a different family from the prevailing family of running text. Not only that, but there’s the gutter around the drop cap to take into account, plus the fact that the letter may be too wide or too narrow to look anything but odd or misplaced.

Mom solves the last of these problems with the COND and EXT arguments. The rest she solves with macros that change the default behaviour of DROPCAP, namely

These macros must, of course, come before you invoke DROPCAP.

• DROPCAP_FAMILY

Set the drop cap family by giving DROPCAP_FAMILY the name of the family you want, e.g.
.DROPCAP_FAMILY H which will set the family to Helvetica for the drop cap only.

• DROPCAP_FONT

Set the drop cap font by giving DROPCAP_FONT the name of the font you want, e.g.
.DROPCAP_FONT I which will set the font to italic for the drop cap only.

• DROPCAP_ADJUST

If the size mom calculates for the drop cap isn’t precisely what you want, you can increase or decrease it with DROPCAP_ADJUST, like this: e.g.
.DROPCAP_ADJUST +1 or
.DROPCAP_ADJUST -.75

DROPCAP_ADJUST only understands points, therefore do not append any unit of measure to the argument. And always be sure to prepend the plus or minus sign, depending on whether you want the drop cap larger or smaller.

• DROPCAP_COLOR

If you’d like your drop cap colourized, simply invoke .DROPCAP_COLOR <color> with the name of a colour you’ve already created (“initialized”) with NEWCOLOR or XCOLOR. Only the drop cap will be colourized; all other text will remain at the current colour default (usually black).

• DROPCAP_GUTTER

By default, mom puts three points of space between the drop cap and the text indented beside it. If you want another value, use DROPCAP_GUTTER (with a unit of measure), like this:
.DROPCAP_GUTTER 6p

Superscript

Inlines: \*[SUP]...\*[SUPX]

Superscripts are accomplished inline. Whenever you need one, typically for numerals, all you need to do is surround the superscript with the inlines above. \*[SUP] begins superscripting; \*[SUPX] turns it off.

If your running type is pseudo-condensed or pseudo-extended and you want your superscripts to be equivalently pseudo-condensed or -extended, use \*[CONDSUP]...\*[CONDSUPX] or \*[EXTSUP]...\*[EXTSUPX].

The superscript inlines are primarily used by the document processing macros for automatic generation of numbered footnotes. However, you may find them useful for other purposes.

Note: Mom does a pretty fine job of making superscripts look good in any font and at any size. If you’re fussy, though (and I am), about precise vertical placement, kerning, weight, size, and so on, you may want to roll your own solution.

SUPERSCRIPT RAISE AMOUNT

By default, mom raises superscripts 1/3 of an em above the baseline. If you’re not happy with this default, you can change it by invoking SUPERSCRIPT_RAISE_AMOUNT with the amount you want them raised. A unit of measure must be appended directly to the amount. Thus, you want superscripts raised by 3 points instead of 1/3 em, you’d do
.SUPERSCRIPT_RAISE_AMOUNT 3p and all subsequent superscripts would be raised by 3 points.


Back to Table of Contents Top Next: Inline escapes

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/toc.html0000644000000000000000000000013212426110213021056 xustar000000000000000030 mtime=1415090315.615519121 30 atime=1415090315.615519121 30 ctime=1415090315.615519121 groff-1.22.3/contrib/mom/momdoc/toc.html0000644000175000001440000006345112426110213017725 0ustar00wlusers00000000000000 Mom, version 2.1-c_1 -- Table of Contents
mom, version 2.1-c_1

Table of Contents

The table of contents is large. To ease navigation, click on any link in the
Quick Table of Contents
which will take you to the corresponding entry in the
Full Table of Contents.
If you've been using mom for a while, you may prefer the Quick Reference Guide.


Quick Table of Contents


Full Table of Contents

VERSION 2.0 NOTES

1. WHAT IS MOM?

2. DEFINITIONS OF TERMS USED IN THIS MANUAL

3. USING MOM

4. TYPESETTING WITH MOM

5. DOCUMENT PROCESSING WITH MOM

6. QUICK REFERENCE GUIDE

7. APPENDICES


groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/images.html0000644000000000000000000000013212426110213021536 xustar000000000000000030 mtime=1415090315.614519134 30 atime=1415090315.614519134 30 ctime=1415090315.614519134 groff-1.22.3/contrib/mom/momdoc/images.html0000644000175000001440000021724412426110213020406 0ustar00wlusers00000000000000 Mom -- Graphics, floats, and preprocessor support
Back to Table of Contents Next: Page headers/footers, pagination

Graphics, floats, and preprocessor support


Inserting images and graphics

In order to include images in mom documents, the images must be in either PDF (.pdf) or EPS (.eps) format. Each format requires its own macro, but both take the same arguments, and in the same order.

Please note that there are differences in the way the files containing PDF and EPS images must be processed, hence documents may not contain a mix.

Image conversion and file processing

When your image files are not in PDF or EPS format—jpgs, for example—you must convert them before including them in a mom document. Any utility for converting images may used. The ImageMagick suite of programmes, present on most GNU/Linux systems, contains convert, which is simple and effective.

PDF

Assuming a jpg image, conversion to PDF is done like this:
convert <image>.jpg <image>.pdf Any image type supported by convert may be converted this way.

Mom files containing PDF images must be processed using groff’s pdf driver. Use of pdfmom is strongly recommended, which natively invokes the pdf driver.
pdfmom doc.mom > doc.pdf

EPS

Assuming a jpg image, conversion to EPS is done like this:
convert <image>.jpg <image>.eps Any image type supported by convert may be converted this way. There have been reports of trouble with PostScript level 2 images, so don’t save your images in this format.

Mom files containing EPS images must be processed using groff’s postscript driver. Use of pdfmom, which can be told to use the postscript driver, is strongly recommended.
pdfmom -Tps doc.mom > doc.pdf

PDF_IMAGE

Macro: PDF_IMAGE [ -L | -C | -R | -I <indent> ] \
<image-file.pdf> <width> <height> [ SCALE <factor> ] \
[ ADJUST +|-<vertical adjustment> ] [ NO_SHIM ] \
[ FRAME ] \
[ CAPTION "<caption>" ] [ SHORT_CAPTION "<short caption>" ] \
[ LABEL "<label>" ]

•  <indent>, <width>, <height> and <vertical adjustment> require a unit of measure

Note: Arguments may be broken into several lines using the “line-continued” backslash (\), as shown above.

Unlike PSPIC, which it resembles, PDF_IMAGE requires that the pdf image’s dimensions (the bounding box, see below) be supplied each time it’s called.

The first optional argument tells mom how to align the image horizontally, with -L, -C, and -R standing for left, centre and right respectively. If you need more precise placement, the -I argument allows you to give an indent from the left margin. Thus, to indent a PDF image 6 picas from the left margin
.PDF_IMAGE -I 6P <remaining arguments> If you omit the first argument, the image will be centred.

<pdf image> must be in PDF format, with a .pdf extension. If it is not, mom will abort with a message. See here for instructions on converting image formats to PDF.

<width> and <height> are the dimensions of the image’s bounding box. The most reliable way of getting the bounding box is with the utility, pdfinfo:
pdfinfo <image.pdf> | grep "Page *size" This will spit out a line that looks like this:
Page size: width x height pts pts means points, therefore the unit of measure appended to <width> and <height> must be p.

The remaining arguments are optional and may be entered in any order, although it’s best to put CAPTION, SHORT_CAPTION, and LABEL last.

'SCALE'

SCALE allows you to scale the image by <factor>. The factor is a percentage of the image’s original dimensions, thus SCALE 50 scales the image to 50 percent of its original size. No percent sign or unit of measure should be appended.

'ADJUST'

ADJUST lets you raise (+) or lower (-) the image within the space allotted for it by the amount you specify. This is useful for achieving good optical centering between surrounding blocks of type. A unit of measure is required.

'NO_SHIM'

NO_SHIM instructs mom not to apply shimming after the image, which she does by default. Shimming ensures that running text after the image falls properly on the page’s baseline grid, but usually results in slightly unequal spacing above and below, which must be corrected with the ADJUST argument. Mom’s default shimming is generally a good idea since it ensures properly aligned bottom margins for running text, however if you have several images on the page, there may be visible differences in the spacing beneath images. NO_SHIM corrects the problem, but will result in running text that does not completely fill the page unless shimming is applied manually elsewhere on the same page.

'FRAME'

FRAME instructs mom to put a frame around the image. Parameters for the frame are set with PDF_IMAGE_FRAME.

'CAPTION'

CAPTION allows you to give the image a caption. By default, the caption appears above the image, but may be attached to the label that appears beneath the image. See CAPTION_AFTER_LABEL in Captions and labels. The text of the caption must be surrounded by double-quotes.

'SHORT_CAPTION'

SHORT_CAPTION allows you to trim long captions for inclusion in the List of Figures. The text you supply, surrounded by double-quotes, is what will appear in the List.

'LABEL'

LABEL, if given, appears beneath the image. The text you supply, surrounded by double-quotes, is how the image is labelled in both the document proper and the List of Figures. Mom provides an auto-labelling facility for images (see AUTOLABEL), which, if enabled, overrides the LABEL argument.

Remember that mom files with embedded PDF images must be processed with
pdfmom doc.mom > doc.pdf

Note: Version 2.0-c change
Mom now treats all pdf images identically to floats, which is to say that if an image doesn’t fit on the output page, she will defer it to the top of the next page while continuing to process running text. ADJUST is ignored whenever an image is deferred, except when moving from column to column on the same page, when the image may need to be optically adjusted. Subsequent images that do not fit, if any, are output in order immediately after the first.

Prior to 2.0-c, it was recommended that images be wrapped inside FLOAT, but this is now no longer required, and should, in fact, be avoided.

PDF_IMAGE_FRAME

Macro: PDF_IMAGE_FRAME <inset amount> <rule weight> <color>

• <inset amount> requires a unit of measure; conversely, <rule weight> must not have a unit of measure appended

PDF_IMAGE_FRAME establishes the parameters for subsequent invocations of PDF_IMAGE when the FRAME argument is given. Arguments must appear in order, and any you wish left at the current value should be entered as two adjacent double-quotes. So, for example, .PDF_IMAGE_FRAME "" "" blue leaves the inset value and rule weight at their current value and changes the frame colour to blue.

Frames are drawn outside the image at its requested dimensions inclusive of scaling. Colours must be pre-initialized with XCOLOR or NEWCOLOR.

The default inset is 6 points, the default rule weight is .5 (points), and the default colour is black.

PSPIC

Macro: PSPIC [ -L | -R | -I <n> ] <file> [ width [ height ] ]

PSPIC is not actually part of mom, but rather a macro included with every groff installation. man groff_tmac contains the documentation for PSPIC, but I’ll repeat it here with a few modifications for clarity.

From groff_tmac

<file> is the name of the file containing the image; width and height give the desired width and height of the image as you wish it to appear within the document. The width and height arguments may have units of measure attached; the default unit of measure is i. PSPIC will scale the graphic uniformly in the x and y directions so that it is no more than width wide and height high. By default, the graphic will be horizontally centred. The -L and -R options cause the graphic to be left-aligned and right-aligned, respectively. The -I option causes the graphic to be indented by <n>; the default unit of measure is m (ems).

It is not necessary to pass PSPIC the <width> and <height> arguments unless you are scaling the image, in which case you will most likely need the original dimensions of the EPS image’s bounding box. These can be found with gs -q -dBATCH -dNOPAUSE -sDEVICE=bbox <image file>.pdf 2>&1 \ | grep "%%BoundingBox" | cut -d " " -f4,5 The two digits returned are in points, therefore the unit of measure p must be appended to them.

Because PSPIC lacks the ADJUST option offered by PDF_IMAGE a certain amount of manual tweaking of the vertical placement of the image will probably be required, typically by using the ALD and RLD macros. Wrapping the image in a float and using FLOAT’s ADJUST option can also be used to correct optical centering.

Additionally, non-floated EPS images inserted into running text will almost certainly disrupt the baseline placement of running text. In order to get mom back on track after inserting a non-floated .PSPIC image, I strongly recommend using the SHIM macro so that the bottom margin of running text falls where it should.

Remember that mom files with embedded EPS images must be processed with
pdfmom -Tps doc.mom > doc.pdf

Please note: PSPIC does not support autolabelling, labels, captions, or inclusion in the List of Figures. If you wish this functionality, convert your images to pdf and use PDF_IMAGE instead, then process the file with pdfmom (without the -Tps option).


Introduction to floats

Non-textual insertions in a document (tables, for example) sometimes do not fit on the output page of a PDF or PostScript document at the place they’re inserted in the input file. It’s necessary, therefore, to defer them to the next page while carrying on with running text.

Whenever you need this functionality, mom provides the FLOAT macro.

Floats are usually used for images and graphics, but can contain anything you like, including text. Whatever’s in the float will be kept together as a block, output immediately if there’s room, or deferred to the top of the next output page when there isn’t; running text continues to the bottom of the previous page without interruption.

In the case of a float that doesn’t fit being followed by one that does, the second is output in position and the first is deferred. In the case of two or more that don’t fit, they are output in order on the next page.

A key distinction between a float and a QUOTE or BLOCKQUOTE is that while a float keeps everything together and defers output if necessary, quotes and blockquotes are output immediately, and may start on one page and finish on the next.

Floats always deposit a break before they begin, which means the line beforehand will not be filled. Floats, therefore, cannot be inserted in the middle of a paragraph without studying the output file and determining where to break or spread the line before the float. Furthermore, if you want a float between paragraphs, the float should come before .PP, like this:
.FLOAT ... .FLOAT OFF .PP not
.PP .FLOAT ... .FLOAT OFF

Floats begin on the baseline immediately below the running text preceding them. No additional whitespace surrounds them, above or below. Running text below a float is, however, shimmed, unless shimming has been disabled with .NO_SHIM or the NO_SHIM argument is given to FLOAT. Shimming generally results in a small amount of extra whitespace after the float, which can be equalized with the whitespace beforehand using the ADJUST argument to FLOAT.

If you’d like more space around a float, you must add it manually, for example with ALD or SPACE.

FLOAT

Macro: FLOAT [ ADJUST +|-<amount> ] [ FORCE ] [ SPAN ] [ NO_SHIM] | <anything>

Note: FLOAT is intended for use with the document processing macros only.

To begin a float, simply invoke .FLOAT and follow it with whatever you want the float to contain. When you’re done, invoke .FLOAT OFF (or QUIT, END, X, etc).

The optional ADJUST argument tells mom to raise (+) or lower (-) the float within the space allotted to it by the specified amount. <amount> must have a unit of measure appended. ADJUST gives you precise control over the vertical centering of floats, allowing you to compensate for unequal spacing that may result of from the automatic shimming of floats (or the absence thereof). See SHIM for a discussion of automatic shimming.

The FORCE argument instructs mom to output the float exactly where it occurs in the input file. With FORCE, mom immediately breaks to a new page to output the float if it does not fit on the current page. While this is somewhat contrary to the notion of floats (ie that running text should continue to fill the page), there are circumstances where it may be desirable.

ADJUST is ignored whenever a float is deferred to the following page.

The SPAN argument tells mom that a float, if deferred, may carry onto multiple pages. Please note that SPAN may not be used for floats containing a boxed table; mom will abort with a warning should this occur. Unboxed tables, on the other hand, are acceptable within floats that are given the SPAN argument.

NO_SHIM instructs mom not to apply shimming after the float, which she does by default. Shimming ensures that running text after the float falls properly on the page’s baseline grid, but usually results in slightly unequal spacing above and below, which must be corrected with the ADJUST argument. Mom’s default shimming is generally a good idea since it ensures properly aligned bottom margins for running text, however if you have several floats on the page, there may be visible differences in the spacing beneath them. NO_SHIM corrects the problem, but will result in running text that does not completely fill the page unless shimming is applied manually elsewhere on the same page.

Note: Floats use no-fill mode, with each input line beginning at the left margin. If this is not what you want, you must specify the preferred horizontal alignment within the float (eg CENTER or RIGHT).

Furthermore, if you want text filled, you must specify .QUAD L|R|C or .JUSTIFY—again, within the float.


Preprocessor support

Mom offers full support for the eqn (equations), pic (diagrams), tbl (tables), and refer (bibliographies/citations) preprocessors, including captions, labelling, autolabelling, and inclusion in the Lists of Equations, Figures, and Tables.

Other than refer, which is discussed at length in the Bibliographies and references section, it is beyond the scope of this documentation to cover full preprocessor usage. Consult the manpages eqn(1), pic(1), and tbl(1) for instructions.

Version 2.0-c changes
Preprocessor support has been revised and expanded as of version 2.0-c. Please read the following sections thoroughly and update any documents created with versions prior to 2.0-c as necessary.

tbl support

Mom documents can include tables generated with the groff preprocessor, tbl. If you are unfamiliar with tbl, I recommend downloading a copy of Tbl - A Program to Format Tables, which, in addition to providing a thorough introduction, contains some fine examples.

Tables formatted with tbl begin with the macro .TS (Table Start) and end with .TE (Table End). Depending on where you want your tables output in a document, you may need to wrap your tbl code inside a float, or pass the H argument to .TS.

If you put tbl code inside a float, the table will be output immediately if it fits on the page, or deferred to the top of the next page if it doesn’t. If you prefer a table to begin where you say and span over to the next page, or if you know for certain a boxed table will run to multiple pages, simply pass the H argument to .TS, along with a corresponding TH and do not wrap the table inside a float.

Note: If you use .TS H to create a boxed table that spans multiple pages, do not attempt to wrap the table inside a float. For the purposes of boxed, multipage tables, .TS H and .FLOAT should be considered mutually exclusive. This restriction is imposed by the tbl preprocessor itself, not groff or mom.

tbl placement in mom docs

If you use .TS without the H argument (and therefore no .TH), tables that fit on the page are output in position. If there is not enough room to output the table, tbl will abort with message instructing you to use .TS H/.TH. Given that .TS without TH may sometimes fail, it is advisable to begin all tbl blocks with .TS H.

If you give .TS the H argument (with a corresponding .TH), tables will be output in position and span as many pages as necessary to complete output. A table header will be printed at the top of each page’s table output. In the event that there is not enough room to print the table header and at least one row of table data near the bottom of a page, mom will break to a new page before beginning table output, leaving a blank in running text.

Boxed tables inside floats are output in position if they fit on the page. If not, they are deferred to the top of the next page without a break in running text. Boxed tables within floats may not, however, span multiple pages; mom will abort with a message should a boxed table in a float run longer than the page.

Unboxed tables inside floats may span multiple pages provided the SPAN argument has been given to FLOAT.

Note: The vertical spacing around unfloated tables may appear slightly unequal, especially if there are several tables on the page. This is a result of shimming that mom applies automatically after each table. You may disable shimming with .NO_SHIM, or by giving the NO_SHIM argument to .TS. In either case, you will still likely want to adjust the spacing around with table with the AJUST argument to .TS. Tables inside floats should be adjusted with the ADJUST argument to FLOAT, not the ADJUST argument to .TS.

.TS / .TH / .TE

Macro: TS
Arguments:
  [ H ]
  [ BOXED ]
  [ CENTER ]
  [ NEEDS ]
  [ ADJUST +|-<vertical adjustment>]
(unit of measure required)
  [ NO_SHIM ]
  [ CAPTION "<caption>" ]
  [ SHORT_CAPTION "<short caption>" ]
  [ LABEL "<label>" ]

Macro: TH (optional, only if .TS H)
Macro: TE [ SOURCE "<text of table source>" ]

Tables to be formatted with tbl begin with the macro .TS and end with .TE. Global tbl options (“flags”), formatting, and data (per tbl(1)) come between the two macros.
.TS <tbl options, formatting, and data> .TE Tables may be wrapped inside a float, in which case, the entire table will be output on the current page if it fits, or deferred to the next page if it doesn’t.
.FLOAT .TS <tbl options, formatting, and data> .TE .FLOAT OFF

The .TS macro

Note: Version 2.0-c change
2.0-c introduces revisions to the handling of labels and/or captions, which, along with NO_SHIM, must now be given as arguments to .TS rather than .TE, as was the case formerly. Please read this section carefully if you have documents containing tables as they may need to be updated.

IMPORTANT: All arguments to TS must appear on the same line as .TS. Do not attempt to break them up with the “line-continued” backslash. You may want to set your text editor to “wrap” mode in order to see all your arguments. This annoyance stems from the preprocessor mechanism itself, not groff or mom.

The TS macro must be invoked before entering a tbl block. You may give as many or as few of its arguments as required, in any order, although it is advisable to put CAPTION, SHORT_CAPTION, and/or LABEL last.

'H'

With the H argument, a table will span as many pages as necessary, with or without a running header. The placement of the corresponding .TH, which is required whenever the H argument is given, determines what, if anything, goes in the header. Compare the following: .TS H .TS H c s s c s s c s s c s s c c c c c c n n n. n n n. Percent Increase .TH 2002-2012 Percent Increase .TH 2002-2012 <tbl data> <tbl data> .TE .TE The first example will create a table that spans multiple pages if necessary, with a running header (“Percent Increase / 2002-2012”) for that table appearing at the top of each page until the table ends. The second example, equally, may run to several pages, but without the running header. See TH for an explanation of .TH placement.

Tip: Generally speaking, it’s a good idea to get into the habit of using .TS H all the time, since there are no circumstances under which it fails, whereas .TS without H will fail on tables that exceed the page length.

'BOXED'

If a table is to be boxed (ie tbl is given the flags 'box' or 'allbox') you must pass the argument BOXED to .TS, as in this example:
.TS BOXED allbox; c s s c c c n n n. <tbl data> .TE

'CENTER'

If a table is to be centered on the page, (ie tbl is given the 'center' flag), you must pass the argument CENTER to .TS, as in this example, which creates a (possibly) multipage boxed table, centered on the page, with a running header. .TS H BOXED CENTER allbox center; c s s c s s c c c n n n. Percent Increase 2002-2012 .TH <tbl data> .TE

'NEEDS'

If a table is not inside a float and you pass .TS the H argument (which you should; see the tip here), mom begins output immediately where the table occurs in the input file if there is enough room on the output page for the table header plus at least one row of table data. If there isn't enough room, mom breaks to a new page before beginning the table, leaving a gap in running text at the bottom of the previous page. If, for aesthetic reasons, you would prefer that mom require more than one row of table data beneath the header near the bottom of a page, you may increase the number with the NEEDS argument, followed by the desired number of rows.

'ADJUST'

ADJUST lets you raise (+) or lower (-) the image within the space allotted for it by the amount you specify. This is useful for achieving good optical centering between surrounding blocks of type. A unit of measure is required.

'NO_SHIM'

NO_SHIM instructs mom not to apply shimming after the image, which she does by default. Shimming ensures that running text after the image falls properly on the page’s baseline grid, but usually results in slightly unequal spacing above and below, which must be corrected with the ADJUST argument. Mom’s default shimming is generally a good idea since it ensures properly aligned bottom margins for running text, however if you have several images on the page, there may be visible differences in the spacing beneath images. NO_SHIM corrects the problem, but will result in running text that does not completely fill the page unless shimming is applied manually elsewhere on the same page.

'CAPTION'

CAPTION allows you to give the table a caption. By default, the caption appears above the table, but may be attached to the label that appears beneath the table. See CAPTION_AFTER_LABEL in Captions and labels. The text of the caption must be surrounded by double-quotes.

Please note that if your table has a caption, you must invoke TS with the H flag, which also entails the use of TH.

'SHORT_CAPTION'

SHORT_CAPTION allows you to trim long captions for inclusion in the List of Tables. The text you supply, surrounded by double-quotes, is what will appear in the List.

'LABEL'

LABEL, if given, appears beneath the table. The text you supply, surrounded by double-quotes, is how the table is labelled in both the document proper and the List of Tables. Mom provides an auto-labelling facility for tables (see AUTOLABEL), which, if enabled, overrides the LABEL argument.

The .TH macro

The TH macro (Table Header), which is required when you begin a table with .TS H, allows you to determine what goes in a table’s running header if it spans multiple pages. Placing .TH under the first row of tbl data makes the first row the header. If placed under the second row, the first and second rows form the header, and so on.

As there are sometimes reasons to run .TS H when you don’t, in fact, want a running header (e.g. when your table has a caption), you can suppress it by placing .TH immediately underneath your tbl formatting specifications, the last line of which always ends with a period (see tbl(1)).

See the H argument to .TS for examples demonstrating .TH placement.

The .TE macro

tbl blocks must be terminated with .TE, which, as of version 2.0-c, takes a single, optional argument, SOURCE. (Formerly, TE took a label/caption argument along with arguments controlling placement.) The argument is followed by the text of the table’s source, surrounded by double-quotes. The source will appear immediately beneath the label and/or caption underneath the table, or, if MLA (Modern Language Association) is enabled, immediately below the table.


pic support

Mom documents can include diagrams generated with the groff preprocessor, pic. If you are unfamiliar with pic, I recommend downloading a copy of Making Pictures with GNU PIC which provides a thorough introduction and contains many examples.

Diagrams created with pic begin with the macro .PS (Pic Start) and end with .PE (Pic End). Everything between them is intrepreted by the preprocessor as pic instructions.

Pic diagrams are always centered. Note that this represents a change from version 2.0-b of mom, where centering diagrams required passing -mpic to groff or pdfmom on the command line.

In addition, mom treats pic diagrams identically to floats, which is to say that if a diagram doesn’t fit on the output page, she will defer it to the top of the next page while continuing to process running text. ADJUST is ignored whenever a diagram is deferred, except when moving from column to column on the same page, when the diagram may need to be optically adjusted. Subsequent diagrams that do not fit, if any, are output in order immediately after the first.

Lastly, if your diagrams contain text, you may set all the type parameters for the text (family, font, size, leading) separately from the pic block with the macro, PIC_TEXT_STYLE. If you need to change the type parameters within the block on-the-fly, you must use pic’s native facilities for doing so.

.PS / .PE

Macro: PS
Arguments:
  [ width ]
(in inches; no unit of measure required)
  [ height ]
(in inches; no unit of measure required)
  [ ADJUST +|-<vertical adjustment>]
(unit of measure required)
  [ NO_SHIM ]
  [ CAPTION "<caption>" ]
  [ SHORT_CAPTION "<short caption>" ]
  [ LABEL "<label>" ]

Macro: PE (no arguments; ends the pic block)

IMPORTANT: All arguments to PS must appear on the same line as .PS. Do not attempt to break them up with the “line-continued” backslash. You may want to set your text editor to “wrap” mode in order to see all your arguments. This annoyance stems from the preprocessor mechanism itself, not groff or mom.

'width' and 'height'

The width and height arguments to .PS are idiosyncratic owing to the preprocessor itself. If a width argument is supplied, the diagram, but not any text it contains, is scaled to the given width. If a literal width argument of 0 (zero) is given and a height argument is supplied, the diagram, but not any text it contains, will be scaled to the requested height. In the case of two non-zero arguments being given, only the height scaling is applied.

'ADJUST'

ADJUST lets you raise (+) or lower (-) a diagram within the space allotted for it by the amount you specify. This is useful for achieving good optical centering between surrounding blocks of type. A unit of measure is required.

'NO_SHIM'

NO_SHIM instructs mom not to apply shimming after the diagram, which she does by default. Shimming ensures that running text after the diagram falls properly on the page’s baseline grid, but usually results in slightly unequal spacing above and below, which must be corrected with the ADJUST argument. Mom’s default shimming is generally a good idea since it ensures properly aligned bottom margins for running text, however if you have several diagrams on the page, there may be visible differences in the spacing beneath them. NO_SHIM corrects the problem, but will result in running text that does not completely fill the page unless shimming is applied manually elsewhere on the same page.

'CAPTION'

CAPTION allows you to give the diagram a caption. By default, the caption appears above the diagram, but may be attached to the label that appears beneath it. See CAPTION_AFTER_LABEL in Captions and labels. The text of the caption must be surrounded by double-quotes.

'SHORT_CAPTION'

SHORT_CAPTION allows you to trim long captions for inclusion in the List of Figures. The text you supply, surrounded by double-quotes, is what will appear in the List.

'LABEL'

LABEL, if given, appears beneath the diagram. The text you supply, surrounded by double-quotes, is how the diagram is labelled in both the document proper and the List of Figures. Mom provides an auto-labelling facility for diagrams (see AUTOLABEL), which, if enabled, overrides the LABEL argument.

PIC_TEXT_STYLE

Macro: PIC_TEXT_STYLE \
  [ FAMILY ] "<family>" \
  [ FONT ] "<font>" \
  [ SIZE ] "+|-<size>" \
  [ AUTOLEAD ] "<value>"

Diagrams drawn with pic may contain text, and groff inline escapes may be used to alter the text parameters. A problem that arises from so doing is that, in many cases, it clutters up the pic code unnecessarily.

PIC_TEXT_STYLE lets you establish the type parameters for text inside a pic block all at once in cases where so doing improves the readability of your mom source files.

The arguments to PIC_TEXT_STYLE behave identically to the arguments to other control macros, explained here. They may be given in any order, and you may use as many or as few as you like.

Note: Text within pic diagrams does not scale when you provide a scaling argument to .PS. This is a limitation of the preprocessor itself, not groff or mom.


eqn support

Support for eqn is provided via extensions to the standard .EQ/.EN macros. eqn usage itself is beyond the scope of this documentation, but is covered in the manpage eqn(1). You can also download a copy of Ted Harding’s A Guide to Typesetting Mathematics Using GNU eqn, which contains useful examples.

.EQ / .EN

Macro: EQ
Arguments:
  [ -L | -C | -I <ident> ]
(unit of measure required)
  [ ADJUST +|-<vertical adjustment>]
(unit of measure required)
  [ CAPTION "<caption>" ]
  [ LABEL "<label>" ]
  [ SHIFT_LABEL +|-<vertical adjustment> ]
  [ SHORT_CAPTION "<short caption>" ]
Macro: EN [ CONTINUED | CONT | ... ]

Note: Version 2.0-c change
2.0-c introduces revisions to EQ, including the addition of a dash (-) to the positioning arguments (-L, -C, and -I) and the removal of a default value for -I. Other changes include passing all options to .EQ (including the label) such that .EN takes only a single, optional argument saying whether the equation is to be continued at the next invocation of .EQ. Please read this section carefully if you have documents containing equations as they may need to be updated.

IMPORTANT: All arguments to EQ must appear on the same line as .EQ. Do not attempt to break them up with the “line-continued” backslash. You may want to set your text editor to “wrap” mode in order to see all your arguments. This annoyance stems from the preprocessor mechanism itself, not groff or mom.

The .EQ macro

Equations to be set with eqn begin with .EQ, followed by eqn code. Equations are centered by default, but may be set flush left or indented from the left margin if -L or -I are passed as arguments to .EQ.

'ADJUST'

ADJUST lets you raise (+) or lower (-) an equation within the space allotted for it by the amount you specify. This is useful for achieving good optical centering between surrounding blocks of type. A unit of measure is required.

'NO_SHIM'

NO_SHIM instructs mom not to apply shimming after the equation, which she does by default. Shimming ensures that running text after the equation falls properly on the page’s baseline grid, but usually results in slightly unequal spacing above and below, which must be corrected with the ADJUST argument. Mom’s default shimming is generally a good idea since it ensures properly aligned bottom margins for running text, however if you have several equations on the page, there may be visible differences in the spacing beneath them. NO_SHIM corrects the problem, but will result in running text that does not completely fill the page unless shimming is applied manually elsewhere on the same page.

'CAPTION'

CAPTION allows you to give the equation a caption. Equation captions always appear beneath the equation.

'SHORT_CAPTION'

SHORT_CAPTION allows you to trim long captions for inclusion in the List of Equations. The text you supply, surrounded by double-quotes, is what will appear in the List.

'LABEL'

LABEL, if given, appears on the same baseline as the last line of the equation, flush with the left or right margin, depending on the equation’s horizontal position. The text you supply, surrounded by double-quotes, is how the equation is labelled in both the document proper and the List of Equations. Mom provides an auto-labelling facility for equations (see AUTOLABEL), which, if enabled, overrides the LABEL argument.

'SHIFT_LABEL'

SHIFT_LABEL allows you to raise (-) or lower (+) the equation label. It’s primary use is to center equation labels vertically on the equation rather than flush with the last line. Assuming a three-line equation, .EQ SHIFT_LABEL -1v would raise the label by one line, thus centering it vertically on the equation.

The .EN macro

A block of eqn code is terminated with .EN.

If an equation needs to span multiple lines, possibly aligned with eqn’s 'mark' and 'lineup' directives, separate invocations of .EQ/.EN are required for each line, and the optional argument, CONTINUED (or CONT, or ... [three dots, an ellipsis]), must be passed to .EN.

If -L or -I is given to the first .EQ of a multi-line equation, they remain in effect until the final .EN, which does not have the CONTINUED argument.

Mom does not treat equations as floats, therefore it is possible to begin an equation on one page and terminate it on the next. If you wish to keep all lines of an equation together, you must wrap the equation, including all invocations of .EQ/.EN, inside a float.


refer support

refer support is covered in the section Bibliographies and references.


Captions and labels

Mom includes facilities for adding captions and labels to figures, tables, equations, and pdf images, including auto-labelling. If Lists of Figures, Tables, and Equations are desired, captions (if any) and labels (if any) are collected and output in the Lists with the appropriate page number.

The distinction between a caption and a label is that labels are identifiers, e.g. “Fig. 1” or “Table 3”, while captions are descriptive or informative. For most types of writing, it is usual to provide both.

By default, mom sets captions above figures (i.e. pic output and pdf images) and tables. This behaviour may be modified with the macro CAPTION_AFTER_LABEL. Equations always have their captions set underneath. All aspects of the text style for captions may be set with the macro, CAPTIONS.

Labels for tables are set underneath the table unless the MLA macro has been invoked, in which case the label and caption appear above the table, per MLA style, and the source for the table, if any, appears underneath. Labels for figures are set underneath. Equation labels, by default, are set on the same baseline as the last line of the equation. Like captions, all aspects of text style for labels may be established with a single macro, LABELS. Furthermore, mom can autolabel figures, tables, and equations, with or without a prefixed chapter number.

Autolabel

Macro: AUTOLABEL_EQUATIONS
Macro: AUTOLABEL_IMAGES
Macro: AUTOLABEL_PIC
Macro: AUTOLABEL_TABLES
Arguments:
[ PREFIX "<string>"] [ SUFFIX "<string>"] [ PREFIX_CHAPTER [ <n> ] ]

AUTOLABEL_<type> takes care of labelling <type> by identifying each with a separate, incrementing numeric scheme, which is also collected for output in Lists of Figures, Equations, and Tables. By default, the label numbers are prefixed, and, in the case of equations, suffixed, with strings such that they appear for tables as “Table <n>”, for pic diagrams and pdf images as “Fig. <n>”, and for equations as “(<n>)”.

Use PREFIX <"string"> to change what comes before the automatic numbering. For example, if you are including musical excerpts in your document, MLA style requires that they be labelled “Ex. <n>”. Since musical excerpts are likely to be scanned images (in pdf format, don’t forget), you have to change the prefix string for pdf images:
.AUTOLABEL_IMAGES PREFIX "Ex. " If you need a suffix after the automatic numbering, use SUFFIX <"string">, like this:
.AUTOLABEL_IMAGES PREFIX "(Fig. " SUFFIX ")" Note that the double-quotes around the single-character SUFFIX string are optional.

Prefixing chapter numbers

If you would like mom to prefix chapter numbers to the label, pass AUTOLABEL_<type> the argument PREFIX_CHAPTER.

If you have not given mom a CHAPTER <n> prior to invoking AUTOLABEL_<type> PREFIX_CHAPTER, you must give the chapter number after PREFIX_CHAPTER. Once done, all subsequent chapters or collated document sections will increment the chapter number by one automatically. Failure to provide a chapter number after PREFIX_CHAPTER when it is required will result in mom aborting with a reminder to do so.

Captions after labels

Macro: CAPTION_AFTER_LABEL IMG | PIC | TBL | ALL [ <anything> ]

By default, mom sets captions above figures (pic output and pdf images) and tables; labels are always underneath.

.CAPTION_AFTER_LABEL, with one of the required arguments, instructs mom to attach captions directly to the appropriate labels, beginning on the same line. Any argument after the first disables this behaviour, restoring caption placement to mom’s default. For example,
.CAPTION_AFTER_LABEL ALL would enable captions after labels globally, while a subsequent
.CAPTION_AFTER_LABEL IMG OFF would disable captions after labels for pdf images only. OFF can be anything you like (X, NO, etc).

If MLA is enabled, there's no need to invoke CAPTION_AFTER_LABEL as this is implied.

Note: A separate invocation of .CAPTION_AFTER_LABEL is required for each one of the required first arguments. You cannot, for example, do
.CAPTION_AFTER_LABEL IMG TBL Rather, you must do
.CAPTION_AFTER_LABEL IMG .CAPTION_AFTER_LABEL TBL

MLA-style captioning and labelling

Macro: MLA [ <anything> ]

Modern Language Association style dictates that captions should always go after labels. Furthermore, labels and captions for tables should go above the tables, with the source for the table, if any, underneath.

Invoking .MLA by itself takes care of these details. If you need to disable MLA-style captioning and labelling mid-document, .MLA OFF does the trick. OFF can be anything you like (X, NO, etc).

Style parameters for captions, labels and sources

Macro: CAPTIONS EQN | IMG | PIC | TBL | ALL
Macro: LABELS EQN | IMG | PIC | TBL | ALL
Macro: SOURCES TBL
Style arguments:
  FAMILY <family> \
  FONT <font> \
  SIZE "+|-<size>" \
  AUTOLEAD "<value>" \
  COLOR "<color>" \
  QUAD LEFT | CENTER | RIGHT [ ON_LL ] \
  ADJUST +|-<vertical adjustment>

Note: Arguments may be broken into several lines using the “line-continued” backslash (\), as shown above.

Additional note: Mom’s default style for labels, captions, and sources is the same as the style used for running text, with two exceptions: labels are set in bold, except for eqn which is roman medium, and the autolead value for all three is “2”, effectively tightening the lead. Furthermore, they are quadded left (except eqn, which is quadded right.)

With the exception of ADJUST and QUAD (which requires a bit of explanation), the style arguments to CAPTIONS, LABELS, and SOURCES (which is only available for tables) behave identically to the arguments to control macros.

The first, required argument after CAPTIONS, LABELS, and SOURCES indicates the preprocessor type for which you are setting the parameters. (For convenience PDF_IMAGE—argument IMG—is here treated as a preprocessor.) An argument of ALL sets a unified style for every preprocessor. If the ALL argument is given, arguments to subsequent invocations of CAPTIONS, LABELS, or SOURCES overwrite only the explicitly named style parameters.

QUAD — quadding of labels, captions, and sources

By default, figures (pic output and pdf images) and tables have their captions and labels set quad left. Sources (for tables) are also set quad left. Equations have their labels set quad right, and their captions centered. Regardless of the quad direction, captions, labels, and sources are quadded over the width of figures and tables unless you pass the optional ON_LL argument to QUAD <direction>.

Equations behave differently. By default, equation labels are set flush right with the page’s right margin regardless of equation positioning, which is, again by default, centered. If the equation is positioned left, the label will appear at the right margin regardless of the direction you give to QUAD. If the equation is indented with the -I <indent> option, a quad direction of LEFT is observed, but may overprint the last line of the equation. Note that there is no CENTER option for equation labels, and that captions are always quadded over the full line length.

ADJUST

The ADJUST argument allows you to add(+) or subtract (-) vertical space between labels and captions and the output to which they are attached. The argument requires a unit of measure. For example, if you find that table labels are a bit too close to the table itself,
.LABELS TBL ADJUST +3p would put three extra points of space between the bottoms of tables and the labels that appear beneath them.

Lists of Figures, Tables, and Equations

Besides a Table of Contents, mom can generate Lists of Figures, Tables, and Equations. Labels and captions are collected and concatenated, and output in lists with the appropriate page number, just like a Table of Contents. Including such lists in a document is as simple as adding whichever you need of
.LIST_OF_FIGURES .LIST_OF_EQUATIONS .LIST_OF_TABLES to the end of your input file.

Also like the Table of Contents, entries in the Lists' output are clickable PDF links when a document is viewed at the screen.

Placement of Lists

Lists normally appear after the Table of Contents, and continue the page numbering scheme used for it. By default, the Table of Contents begins on roman-numeral page “i”.

If you are using mom’s AUTO_RELOCATE_TOC feature, you have two options for placement of the Lists within the document. If you want the Lists shifted to the top of the document along with the Table of Contents, invoke the Lists macros after .TOC. If you prefer to have the Lists at the end of the document, invoke the Lists macros before .TOC.

Lists shifted with the Table of Contents do not appear in the Table of Contents itself, but do appear as clickable links in the PDF outline typically available in the left panel of most PDF viewers. Lists that are not shifted with the Table of Contents appear in both the Table of Contents itself and the PDF outline.

Macros to generate Lists

Macro: LIST_OF_EQUATIONS
Macro: LIST_OF_FIGURES
Macro: LIST_OF_TABLES
Arguments:
  [ TITLE_STRING "<string>" ] [ START_PAGENUM <page number> ]

The first optional argument to the LIST_OF_<type> macros allows you to change the title that appears at the top of the page. This is useful not only for internationalization, or to meet the requirements of various style guides, but is also useful for, say, documents containing musical examples, which, per MLA-style, should be labelled “Example ” or “Ex. ”. When it comes time to output the List of Figures (to which musical examples, usually scanned pdf images, belong),
LIST_OF_FIGURES TITLE_STRING "List of Examples" ensures that the title of the List is correct.

The second optional argument allows you to give a starting page number for a list in cases where mom’s pagination scheme does not provide the List with the starting page number you want.

Formatting and style parameters for Lists

Like the Table of Contents, nearly every aspect of Lists can be designed independently of a document’s overall style. By default, Lists follow the formatting and style parameters of the Table of Contents, both mom’s defaults and any changes you may have made to the Table of Contents.

If you wish to make changes to any aspect of Lists formatting or styling, the macro LISTS_STYLE provides all the tools necessary. It is unlikely that you’ll want the formatting of the various list types to differ one from the other, so LISTS_STYLE applies to all Lists. In the event that you do need to change some aspect of the formatting for different list types, simply invoke LISTS_STYLE immediately prior to each list whose formatting needs to be changed.

Lists style

Macro: LISTS_STYLE
Arguments:
  FAMILY <family> \
  FONT <font> \
  PT_SIZE <size> \
  LEAD <leading> \
  TITLE_FAMILY <family> \
  TITLE_FONT <font> \
  TITLE_SIZE +|-<size> \
  TITLE_QUAD LEFT | CENTER | RIGHT \
  TITLE_COLOR <color> \
  PN_FAMILY <family> \
  PN_FONT <font> \
  PN_SIZE +|-<size> \
  EQN_PN_PADDING <placeholders> \
  FIG_PN_PADDING <placeholders> \
  TBL_PN_PADDING <placeholders> \
  PAGENUM_STYLE DIGIT | ROMAN | roman | ALPHA | alpha \
  NO_PAGINATION

Note: Arguments may be broken into several lines using the “line-continued” backslash (\), as shown above.

FAMILY is the family for the entirety of Lists pages.

FONT is the font for the entirety of Lists pages.

PT_SIZE is the base point size for the entirety of Lists pages.

LEAD is the base leading for the entirety of Lists pages.

TITLE_FAMILY is the family for the Lists titles if you want it different from the family otherwise used for the Lists pages.

TITLE_FONT is the font for the Lists titles if you want it different from the font otherwise used for the Lists pages.

TITLE_SIZE tells mom by how much to increase (+) or decrease (-) the point size of the titles relative to the overall point size of Lists pages.

TITLE_QUAD tells mom how to position the title horizontally.

TITLE_COLOR sets the colour for the titles. The colour must be pre-initialized with NEWCOLOR or XCOLOR.

PN_FAMILY sets the family for entry pagenumbers.

PN_FONT sets the font for entry pagenumbers.

PN_SIZE tells mom by how much to increase (+) or decrease (-) the point size of entry pagenumbers relative to the overall point size of Lists pages.

EQN_PN_PADDING, FIG_PN_PADDING, and TBL_PN_PADDING tells mom how many placeholders to reserve for the entry pagenumbers in their respective Lists. If, for example, a document with both tables and figures runs to over a hundred pages, but there are no tables after page 99,
LISTS_STYLE FIG_PN_PADDING 3 LISTS_STYLE TBL_PN_PADDING 2 would prevent an unneeded, reserved placeholder from putting too much space between the leader and the entry pagenumber in the List of Tables.

The padding in effect, unless you change it, is whatever was set for the Tables of Contents; mom’s default is “3”.

PAGENUM_STYLE tells mom which pagination format to use for the page numbers of the Lists pages themselves. By default, since Lists observe what is in effect for the Table of Contents, the pagination format is “roman”. Please note that the starting page number for any of the Lists is given as an argument to the LISTS_0F_<type> macro.

NO_PAGINATION disables pagination of Lists pages.


Back to Table of Contents Top Next: Page headers/footers, pagination

groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/stylesheet.css0000644000000000000000000000013212426110213022306 xustar000000000000000030 mtime=1415090315.615519121 30 atime=1415090315.615519121 30 ctime=1415090315.615519121 groff-1.22.3/contrib/mom/momdoc/stylesheet.css0000644000175000001440000002521612426110213021152 0ustar00wlusers00000000000000/* Copyright (C) 2004-2014 Free Software Foundation, Inc. */ /* This file is part of mom, which is part of groff, a free software */ /* project. */ /* You can redistribute it and/or modify it under the terms of the */ /* "GNU General Public License" as published by the "Free Software */ /* Foundation", version 2. /* The license text is available in the internet at */ /* */ /* stylesheet for the mom macros documentation */ a:link { color: blue; text-decoration: none; } a:hover { color: red; text-decoration: underline; } a:visited { color: purple; text-decoration: none; } a:visited:hover { color: purple; text-decoration: underline; } a.header-link:visited { color: #6e70cc ; } a.header-link:visited:hover { color: #6e70cc ; } a:link.quick { text-decoration: underline; } .version /* version number for top of toc.html */ { font-size: 90% ; text-align: center ; } .page /* Page setup: page color, size and border */ { width: 760px ; position: relative ; top: 12px ; bottom: 12px ; margin: auto ; padding: 12px ; border: solid 1px #ceac8d ; color: #302419 ; background-color: #ffffeb ; font: 1em/1.5em arial,sans-serif ; } /* Heads */ h1.docs { font-family: arial,sans-serif ; font-size: 125% ; text-align: center ; color: #002b56 ; background-color: #e2f1ff ; outline: solid 1px #99cccc ; padding: 6px ; } h2.docs { margin-bottom: -.25em ; font-size: 105% ; color: #000056 ; } h2.macro-group /* ie "Page setup" or "Indents" or "Multi-columns" */ { margin-top: 1em ; font-size: 120% ; color: #000056 ; background-color: #dfccad ; padding: 6px ; } h3.docs { margin-bottom: -.5em ; font-size: 95% ; color: #000056 ; text-transform: uppercase ; } h3.appendices { font-size: 100% ; text-transform: none ; } h3.notes { display: inline-block ; margin-top: .5em ; } h3.control { padding-top: .5em ; font-size: 100% ; text-transform: none ; } h3.numbered { font-size: 100% ; margin-bottom: -.5em ; } h3.macro-id { font-size: 105% ; color: #000056 ; text-transform: uppercase ; margin-top: 3px ; margin-bottom: 0px ; } h4.docs { font-size: 95% ; margin-bottom: -.5em ; color: #000056 ; } h4.doc-param-macros { margin-top: -.5em ; } h4.arg-list { margin-top: -.5em ; } h4.fields { color: #302419 ; } h5.docs { margin-bottom: -.5em ; font-size: 95% ; color: #000056 ; text-transform: uppercase ; } ul.doc-param-macros { margin-top: .75em ; margin-left: -.5em ; } .control-macros-header { display: inline-block ; margin-bottom: -.25em ; padding: 2px 6px 0 6px ; outline: 1px solid #000058 ; font-size: 100% ; background-color: #e2f1ff ; } .control-macro { font-size: 100% ; margin-bottom: -.75em ; color: #2f2f71 ; } .macro-id-overline { display: inline-block ; border-top: solid 2px #8d8775 ; margin-bottom: .5em ; } /* Paragraphs */ p.no-indent { text-indent: 0px ; } p.requires { font-family: arial,sans-serif ; font-style: italic ; text-indent: 0px ; margin-top: .25em ; } p.alias { font-family: arial,sans-serif ; font-style: normal ; text-indent: 0px ; margin-top: .25em ; } /* Horizontal rules */ hr /* horizontal rules need a border to be colorized) */ { border: solid 1px #8d8775 ; } div.rule-short /* for section breaks; top/bottom margins set manually */ { display: block ; width: 25% ; margin: auto; clear: both ; } div.rule-medium /* underneath mini-tocs; top/bottom margins set manually */ { display: block ; width: 40% ; margin: auto; clear: both ; } div.rule-long /* precedes nav bar at bottom of page */ { display: block ; width: 90% ; margin: auto; } /* Boxed text */ .box-macro-args /* Macro name+args */ { display: block ; width: 736px ; max-width: 736px ; border: solid 1px #302419 ; padding-top: 5px ; padding-bottom: 3px ; padding-left: 12px ; padding-right: 12px ; background-color: #ffffff ; white-space: nowrap ; overflow: auto ; } .box-code { display: block ; width: 679px ; max-width: 679px ; border: solid 1px #302419 ; padding-top: 5px ; padding-bottom: 18px ; padding-left: 15px ; padding-right: 15px ; color: #6f614a ; background-color: #ffffff ; white-space: nowrap ; } .box-tip { outline: solid 1px #ceac8d ; padding-left: 15px ; padding-right: 15px ; text-align: justify ; background-color: #f9f9d9 ; margin-bottom: 1.5em ; } .box-example-layout { outline: solid 1px #ceac8d ; padding-left: 15px ; padding-right: 15px ; text-align: justify ; background-color: #f9f9d9 ; margin-bottom: 2.5em ; } .box-notes { outline: solid 1px #ceac8d ; padding-left: 15px ; padding-right: 15px ; text-align: justify ; background-color: #f9f9d9 ; margin-bottom: 1.5em ; } .box-important { outline: solid 1px #ce7a65 ; padding-left: 15px ; padding-right: 15px ; text-align: justify ; background-color: #f9f9d9 ; margin-bottom: 1.5em ; } p.tip { padding-top: 9px ; padding-bottom: 9px ; text-indent: 0px ; } p.tip-top { padding-top: 9px ; text-indent: 0px ; } p.tip-bottom { padding-bottom: 9px ; text-indent: 0px ; } /* Pre-formatted code */ span.pre /* pre-formatted multi-line blocks; indent must be exactly 2 spaces */ { display: block ; position: relative ; top: -1em ; margin-bottom: -1.5em ; font-family: "Lucida Console",monospace ; font-weight: bolder ; font-size: 95% ; white-space: pre ; overflow: auto ; } span.defaults { margin-left: 6px ; padding-bottom: 1em ; font-size: 95% ; } span.pre-in-pp { display: block ; position: relative ; top: -1em ; margin-bottom: -.5em ; font-family: "Lucida Console",monospace ; font-weight: bolder ; font-size: 95% ; white-space: pre ; overflow: auto ; } span.important { font-family: arial,sans-serif ; font-weight: bolder ; color: #8b0000 ; } span.note { font-family: arial,sans-serif ; font-weight: bolder ; color: #443526 ; } span.additional-note { font-family: arial,sans-serif ; font-weight: bolder ; font-style: italic ; color: #443526 ; } span.tip { font-family: arial,sans-serif ; font-weight: bolder ; color: #443526 ; } span.experts { font-family: arial,sans-serif ; font-weight: bolder ; color: #443526 ; } /* Mini-tocs (usually at top of page) */ /* 1-column, centered mini-toc */ ul.mini-toc-centered { text-align: center ; list-style-type: none ; margin-left: -40px ; } /* 2-column mini-toc column defs*/ .mini-toc-col-1 { float: left ; width: 50% ; margin-left: -6px ; } .mini-toc-col-2 { float: left ; width: 50% ; clear: right ; } /* 3-column mini-toc column defs */ .col-1-definitions { float: left ; width: 32% ; height: 52em ; padding-bottom: 9px; background-color: #ded4bd ; margin-right: 2% ; } .col-2-definitions { float: left ; width: 32% ; height: 52em ; padding-bottom: 9px; background-color: #ded4bd ; margin-right: 2% ; } .col-3-definitions { float: left ; width: 32% ; height: 52em ; padding-bottom: 9px; background-color: #ded4bd ; margin-bottom: 24px ; } /* List styles */ ul.toc { margin-top: .5em ; } ul.no-enumerator { list-style-type: none ; } .list-head { font-family: arial,sans-serif ; font-weight: bolder ; font-size: 110% ; color: #000056 ; } .list-head-goodies { font-family: arial,sans-serif ; font-weight: normal ; font-size: 110% ; color: #000056 ; } .no-anchor { color: #302419 ; font-weight: bold ; } .text-color { color: #302419 ; } li.item { font-family: arial,sans-serif ; font-weight: normal ; font-size: 100% ; margin-left: -10px ; list-style-type: disc ; } .mini-toc { margin-top: -1em ; font-size: 90% ; } .sublist { margin-left: -1em ; font-size: 90% ; color: #302419 ; list-style-type: disc ; } .sub { list-style-type: circle ; } .normal { font-style: normal ; font-size: 100% ; } .normal-smaller { font-weight: normal ; color: #302419 ; font-size: 90% ; } .normal-sub-sub { font-weight: normal ; color: #302419 ; font-size: 90% ; } /* Macro lists / defaults */ div.macro-list-container { background-color: #ded4bd ; margin-bottom: 1.5em ; } h3.macro-list { font-size: 100% ; color: #000056 ; text-transform: uppercase ; padding: 9px ; } ul.macro-list { margin-left: -21px ; list-style-type: none ; font-family: arial,sans-serif ; margin-top: -1.25em ; padding-bottom: 6px ; } ol.macro-list { font-family: arial,sans-serif ; margin-top: -1.25em ; padding-bottom: 6px ; } .defaults-container { background-color: #e3d2b1 ; border: 1px solid #3f2c00 ; margin-bottom: 2.5em ; } h3.defaults { font-size: 100% ; color: #000056 ; text-transform: uppercase ; padding: 9px ; } p.defaults { margin-top: .25em ; margin-left: 6px ; margin-right: 12px ; margin-bottom: 0 ; } #toc-title, #toc-head, #toc-subhead, #toc-parahead { display: block ; margin-top: -1em ; margin-bottom: -1em ; } /* Bottom of page spacer */ div.bottom-spacer { display: block ; height: 24px ; } /* General markup */ kbd { font-family: "Lucida Console",monospace ; font-weight: bold ; font-size: 95% ; } kbd.macro-args { margin-right: .5em ; color: #6f614a ; white-space: nowrap ; overflow: auto ; } /* tocs */ h1.toc { font-family: arial,sans-serif ; font-size: 175% ; text-align: center ; color: #002b56 ; background-color: #e2f1ff ; outline: solid 1px #99cccc ; padding: 6px ; } h2.toc { font-size: 120% ; color: #000056 ; } h3.toc { margin-top: -.5em ; margin-bottom: -.5em ; font-size: 100% ; color: #6e70cc ; } .highlight { font-weight: bold ; } .fourth-level { margin-left: -1.25em ; list-style-type: none ; } ul.toc-docproc { margin-left: -1em ; } .toc-docproc-header { margin-top: -.5em ; text-transform: uppercase ; } a.header-link { color: #6e70cc ; font-size: 95% ; } /* Examples */ .examples-container { border: solid 1px #917963 ; background-color: #f9f9d9 ; padding-left: 24px ; padding-right: 24px ; padding-top: 3px ; padding-bottom: 3px ; } .examples { font-weight: bolder ; font-size: 98% ; color: #524b3f ; margin-top: 12px ; margin-bottom: 3px ; } /* definitions.html */ table.definitions /* mini-toc is set up as a table */ { margin-top: 12px ; text-align: left ; margin-left: 12px ; } th.definitions { padding-bottom: 6px ; font-size: 120% ; color: #000056 ; } dt /* definition terms in italic*/ { font-style: italic ; } dt.no-italic { font-style: normal ; } /* Tables */ table.quick-ref { margin-top: .25em ; } table.quick-ref, th.quick-ref { padding-bottom: .25em ; font-family: "Lucida Console",monospace ; font-weight: bold ; text-align: left ; } td { padding: 0 ; padding-left: .5em ; } /* Misc */ span.book-title { font-style: italic ; } groff-1.22.3/contrib/mom/momdoc/PaxHeaders.22577/color.html0000644000000000000000000000013212426110213021407 xustar000000000000000030 mtime=1415090315.612519159 30 atime=1415090315.612519159 30 ctime=1415090315.612519159 groff-1.22.3/contrib/mom/momdoc/color.html0000644000175000001440000004126312426110213020253 0ustar00wlusers00000000000000 Mom -- Colour
Back to Table of Contents Next: Graphical objects

Coloured text


Introduction

Mom’s support for coloured text is straightforward. You begin by telling mom about the colours you want with NEWCOLOR or XCOLOR. Afterward, any time you want text to be coloured, you either colour it with an inline escape that contains the colour name (e.g. \*[red] or \*[blue]) or invoke the macro, COLOR, with the name of the colour you want.

For example, say you want to have the name “Jack” in the sentence “All work and no play makes Jack a dull boy” appear in yellow. You'd begin by telling mom about the colour, yellow. There are two ways of doing this; see NEWCOLOR and XCOLOR for a full explanation of the difference between the two.

If you use XCOLOR, you'd enter this:
.XCOLOR yellow If you use NEWCOLOR, you might enter:
.NEWCOLOR yellow RGB #FFFF00

After “defining” (or “initializing”) the colour “yellow”, you'd colourize the name, Jack, either with an inline escape
All work and no play makes \*[yellow]Jack\*[black] a dull boy. or with the COLOR macro
All work and no play makes .COLOR yellow Jack .COLOR black a dull boy. Notice, in both examples, that a) you have to set the colour back to black after “Jack”, and b) you don’t have to define or intialize the colour, black. Mom predefines it for you.

For information on using colour during document processing, see Colour support in document processing.

Note: Mom’s colour support is for text only. She doesn’t support “fill” (or “background”) colour for solid, enclosed graphical objects (polygons, ellipses) drawn with groff’s \D inline escapes, although you may give a colour as one of the arguments to mom’s “box” and “circle” macros, DBX and DCL when the first argument to these macros is SOLID.

Experts: If you’re accustomed to using groff’s .defcolor to define colours, and groff’s inline \m[<colorname>] to call them, you may continue to do so without confusing mom.

Coloured text macros


Creating (initializing) a colour with NEWCOLOR

Macro: NEWCOLOR <colour name> [<colour scheme>] <colour components>

NEWCOLOR lets you create a colour, rather like an artist mixing paint on a palette. The colour isn’t used immediately; NEWCOLOR merely tells mom how to mix the colour when you need it. If you haven’t invoked .NEWCOLOR (or .XCOLOR), mom doesn’t have a clue what you mean when you reference a colour (with COLOR or \*[<color name>]).

The first argument to NEWCOLOR is a name for your colour. It can be anything you like—provided it’s just one word long—and can be caps, lower case, or any combination of the two.

The second argument, which is entirely optional, is the “colour scheme” you want mom to use when mixing the colour. Valid arguments are
RBG (3 components: red green blue) CYM (3 components: cyan yellow magenta) CMYK (4 components: cyan magenta yellow black) GRAY (1 component) If you omit the second argument, mom assumes you want RGB.

The final argument is the components of your colour. This can be hexadecimal string starting with a pound sign (#) (for colour values in the 0-255 range) or two pound signs (##) (for colour values in the 0-65535 range), or it can be a series of decimal digits, separated by spaces, one digit per component, with the argument enclosed in double quotes. (If this is all gibberish to you, see Tips for newbies.)

Thus, to tell mom about a colour named “YELLOW”, you could enter one of the following:
.NEWCOLOR YELLOW #FFFF00 \"or ##FFFFFFFF0000 or "1 1 0" .NEWCOLOR YELLOW RGB #FFFF00 \"or ##FFFFFFFF0000 or "1 1 0" .NEWCOLOR YELLOW CYM #00FF00 \"or ##0000FFFF0000 or "0 1 0" .NEWCOLOR YELLOW CYMK #00FF0000 \"or ##0000FFFF00000000 or "1 1 0" After you've told mom about a colour, you can then get her to set text in that colour either with the inline escape, \*[<colorname>], or the macro, COLOR. (See the example, above.)

Note: The colorname you give to NEWCOLOR may be used with groff’s \m[<colorname>] inline escape (the \m escape is used to set text and rule colours). Thus, assuming a colorname “blueblack” set with NEWCOLOR, \*[blueblack] and \m[blueblack] are equivalent. Furthermore, the colorname can be given as an argument to groff’s primitive request, .gcolor (which does the same thing as \m[<colorname>]).

Equally, the colorname may be used with \M[<colorname>] and .fcolor, which set the “fill” colour for solid graphical objects.

Tips for newbies: Colour manipulation can be tremendously confusing if you don’t have a background in graphic arts or computing. My advice, if color intimidates you, is to stick to using mom’s default RGB colour scheme, and to fire up a color chooser that gives you the RGB values you want for the colour you select. Plug those values into the components argument to NEWCOLOR, and you’ll get the colour you want. Both the KDE and gnome desktops have colour selectors that provide you with the shorter RGB hexadecimal string. If you’re not running KDE or gnome, the X utility, xcolorsel, provides you with a similar functionality, although it only provides RGB values for 256 pre-defined colours. If you use xcolorsel, be sure to click the button “Display format” and select “8 bit truncated rgb”.

Alternatively, you can use mom’s simpler XCOLOR macro to initialize one of the 256 pre-defined X colours by supplying the name of the color as an argument.

Initializing a colour with XCOLOR

Macro: XCOLOR <X colorname> [<alias>]

<X colorname> must be all one word, all lower case.
(See Finding X color names for how to get a list of valid colour names.)

XCOLOR is similar to NEWCOLOR in that it tells mom to initialize a colour, but it’s easier to use. All you have to do is pass it, as an argument, the valid name of one of the 256 pre-defined X colours. The name must be all one word, and, breaking with mom policy, it must be entered in lower case.

For example, if you want to intialize the X colour, coral, all you have to do is enter
.XCOLOR coral Afterwards
.COLOR coral will colourize subsequent text coral until you instruct mom to return to black, or some other pre-defined, initialized colour. (The inline escape \*[coral] will equally colourize text coral after you've initialized the colour with XCOLOR.)

The downside of XCOLOR is that you can’t create custom colours. This restriction, however, is mitigated by the fact that for many users, 256 colours is more than enough to play around with.

While some X colours have fanciful names (peachpuff, papayawhip, thistle, snow), many are self-explanatory and self-descriptive in ordinary colour terms. “blue” is pure (rgb) blue, “green” is pure (rgb) green, and so on. Furthermore, for many X colors, there exist four variants, each representing increasingly darker shades of the same colour. For example, “blue1” is a relatively bright blue; “blue2”, “blue3” and “blue4” are increasingly darker shades. For that reason, you may find XCOLOR is a better choice than NEWCOLOR when it comes to initializing common colors.

The whimsical nature of X colour names sometimes makes for names that are long to type in, e.g. “mediumspringgreen”. The optional second argument to XCOLOR allows you to come up with more convenient name by which to reference the colour. For example, you could enter
.XCOLOR mediumspringgreen mygreen or .XCOLOR mediumspringgreen MYGREEN so that whenever you want text mediumspringgreen-ed, you can use either .COLOR mygreen (or .COLOR MYGREEN) or the inline escape \*[mygreen] (or \*[MYGREEN].)

Finding X color names

There are two ways of finding the names of the pre-defined X colours. One is to consult the file, rgb.txt, included with all X11 installations. The location of the file on a Debian GNU/Linux distribution is typically /etc/X11/rgb.txt. Other distributions and other X installations may have the file in another location. The file lists the colour names, but doesn’t show you what the colours actually look like.

A better way to get the colour names, as well as to see what the colours look like, is to fire up a colour chooser (like xcolorsel) that both lists the colour names and shows a swatch of the colour as well.

Whichever method you use to find X color names, remember that the names, passed as arguments to XCOLOR, must be all one word, all in lower case.

Note: Both the colorname and the alias you give to XCOLOR may be used with groff’s \m[<colorname>] inline escape (the \m escape is used to set text and rule colours). Thus, assuming an X-colorname “mediumspringgreen” set with XCOLOR, and an alias, “mygreen”, \*[mediumspringgreen], \m[mediumspringgreen], \*[mygreen] and \m[mygreen] are all equivalent. Furthermore, both the colorname and the alias can be given as an argument to groff’s primitive request, .gcolor (which does the same thing as \m[<colorname>]).

The colorname initialized with XCOLOR but not the alias may also be used with groff’s inline escape, \M[<colorname>], and the corresponding primitive, .fcolor, both of which set the “fill” colour for solid graphical objects. If you need a colour initialized with XCOLOR for \M or .fcolor, you MUST give the full colorname; the alias won’t work.

Invoking a color

Macro: COLOR <colorname>

Inline: \*[<colorname>]

Once you've told mom about a colour (via NEWCOLOR or XCOLOR, you use either the macro, COLOR, or the inline escape, \*[<colorname>], to cause mom to set subsequent text in that colour. See the example, above, which shows both in action.

Note: You can use the \*[<colorname>] inline escape in any document processing macro that takes a string argument. However, you must remember to reset the colour at the end of the argument (typically with \*[black]) unless you want all subsequent invocations of that particular macro to be colourized.

Furthermore, if you use \*[<colorname>] in the string argument passed to HEAD, SUBHEAD or PARAHEAD, and you've requested that any of these types of heads be numbered, the numbers themselves will not be coloured, only the text you passed the macro. If you wish the numbers to be colourized as well, you must explicitly tell mom that you wish all of the head(s), subhead(s) or parahead(s), including the numbers, colourized by invoking the appropriate control macro.

For colorizing underscored text, see Colorizing underscored text in the notes at the end of UNDERSCORE.


Back to Table of Contents Top Next: Graphical objects

groff-1.22.3/contrib/mom/PaxHeaders.22577/NEWS0000644000000000000000000000013212426110213016624 xustar000000000000000030 mtime=1415090315.503520521 30 atime=1415090315.503520521 30 ctime=1415090315.503520521 groff-1.22.3/contrib/mom/NEWS0000644000175000001440000005373412426110213015476 0ustar00wlusers00000000000000 -*- text -*- Copyright (C) 2004-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Release 2.0-c ------------- Mom now has full support for eqn, pic, and tbl, as well as captioning and labelling of pdf images and preprocessor output. Lists of Figures, Equations, and Tables can now be autogenerated. PDF_IMAGE has a new FRAME option. Release 2.0-b ------------- Improved and expanded float and tbl support. Release 2.0-a ------------- FORCE argument added to FLOAT; immediately breaks to a new page to output the float if it does not fit on current the page. Release 2.0 ----------- Full integration with gropdf. Mom's focus now is on the generation of PDF output. PDF outlines and PDF links (internal and external) fully supported. New management of nested heading levels via HEADING , replacing HEAD, SUBHEAD, SUBSUBHEAD and PARAHEAD. "NAMED " argument to HEADING creates PDF target at the heading. Use of "oldstyle" headings preserved, allowing the continued use of HEAD, SUBHEAD, etc. PARAHEAD removed; replaced by HEADING PARAHEAD. New management of head styling. New management of TOC, mostly transparent to user. New management of TOC title and entry styling. Overhaul of TOC default style; greater flexibility in numbering entries, improved indenting, improved spacing. FLOAT macro added. MN_INIT wrapper re-written such that each argument must be preceded by a flag. New perl script, pdfmom, to facilitate generation of PDF output. Additional documentation in the form of a PDF manual, which covers mom/PDF/groff usage. ==================================================================== Release 1.6-a ------------- Support for sub-subheads added. Release 1.6 ----------- Complete overhaul of refer handling. If you've been using mom and refer, the changes may affect documents you've already created. Please read refer.html. Improved underlining thanks to Tadziu Hoffman. Increased flexibility of PRINTSTYLE TYPEWRITE, which now allows user to choose the monospace family and point size. Release 1.5-e ------------- Complete overhaul of documentation Release 1.5-d ------------- Control macros added to various miscellaneous docprocessing functions Release 1.5-c ------------- Bugfix release (see BUGS, Version 1.5-b). Release 1.5-b ------------- Bugfix release (see BUGS, Version 1.5-a). Release 1.5-a ------------- Bugfix release (see BUGS, Version 1.5). Release 1.5 ----------- Macros have been added to facilitate the drawing of common graphical objects: rules (horizontal and vertical), boxes (solid or filled) and circles (ellipses; also solid or filled). The behaviour of \*[RULE] has changed so that it always deposits a break when it's called, bringing it (somewhat) into line with the new macro for drawing rules precisely, DRH. Additionally, a new macro, RULE_WEIGHT, can be used to control the weight of rules drawn with \*[RULE]. Overall, the handling of underscoring and underlining--wherever it occurs--has been overhauled so that users can control both the weight and the placement of underscore/underline rules. New macros have been created to control, for example, the weight and placement of the rule under a HEAD, or the weight of a FOOTNOTE separator rule, etc. Anything that can be underscored or underlined (except the pseudo-underlining of italic passages in PRINTSTYLE TYPEWRITE) has a "rule" control macro. See the document sections pertinent to the macro in question. The creation and management of covers and doc covers has been overhauled for greater flexibility, including the ability to generate differing titles, subtitles, attribution strings, authors, doctypes, miscellaneous lines and copyright information for the same document's doc cover and cover (title) pages, without affecting the default docheader that appears on page one. Additionally, you can now get mom to output a blank page after a cover or doc cover, as well as tell her whether to include covers and doc covers in the pagination scheme. The convenience macro, CODE, has been made more convenient. A new control macro allows setting users' prefered fixed-width fonts. Additionally, CODE can now be called inline. New inline escapes, \*[UC] and \*[LC], have been added to allow inline capitalization. This is particularly useful when users want to pass a header/footer left-center-right part one of mom's "reserved" strings and want the string capitalized (or not) in the header/footer. For more details, see ChangeLog as well as the documentation. Release 1.4-b ------------- It is now possible to pass an absolute value to QUOTE_INDENT, BLOCKQUOTE_INDENT and EPIGRAPH_INDENT. If an absolute value is desired, the user simply appends a unit of measure (scaling indicator) to the argument. If no unit of measure is appended, the old behaviour is still observed (i.e. the numeric argument represents the amount by which to multiply the paragraph indent to arrive at the desired indent value). The main macro file, om.tmac, is now stripped of comments when groff is built from sources. om.tmac in the sources themselves still contains the comments, as do the tarballs posted on the mom homepage. Release 1.4-a ------------- Added a new macro, HEADERS_AND_FOOTERS, to allow having both headers and footers on a page. Release 1.4 ----------- DOCTITLE, TITLE, CHAPTER_TITLE, SUBTITLE, COVERTITLE and DOC_COVERTITLE now accept multiple arguments; each is printed on a separate line. New macro, CODE, to facilitate setting programming code snippets. Release 1.3-e_<#> ----------------- New macro, PREFIX_CHAPTER_NUMBER, to allow users to prepend chapter numbers to the numbering scheme used in head element numbering. Indented TOC entries now line up better. Line numbering now has control macros for family, font, point size and color. A new macro, NO_SHIM, to disable the automatic shimming of (possibly irregularly linespaced) quotes and blockquotes. Release 1.3-d ------------- Bug fix release (FONT--removed superfluous "if" that was breaking fallback font logic; FOOTNOTE--no longer adding a linebreak after footnote marker in footnote text in nofill modes). Fixed indent problem with LIST when both PAD_LIST_DIGITS LEFT and SHIFT_LIST used concurrently. Release 1.3-c ------------- Bug fix release (margin notes, TYPEWRITE--spacing, underlining and italicizing Release 1.3-b ------------- Bug fix release. SMARTQUOTES has been smartened; miscellaneous glitches in PRINTSTYLE TYPEWRITE fixed (see BUGS). Primarily corrects inconsistencies and bugs with the margin notes routines. Release 1.3-a ------------- Bug fixes: First baseline of type wasn't going where it was supposed to when the docheader was turned off; fixes to errors in html formattting of docs. Release 1.3 ----------- Added line numbering capabilities, with controls. Footnotes and endnotes can now be referenced by line number. Added ability to adjust vertical position of the title that appears on the first endnotes page. Footnotes can run on when being referenced by line number. Footnotes now have a post-footnote spacing option, for adding a little space between footnotes. Extended LIST so it accepts alpha, ROMAN and roman enumerators. Added margin notes capability. Added refer support. Added bibliography page support. Added QUOTE_AUTOLEAD and BLOCKQUOTE_AUTOLEAD, so user can have quotes and blockquotes leaded differently from running text. Change: the input line immediately after FOOTNOTE OFF must be entered as a literal continuation of the line prior to FOOTNOTE, including any initial spaces or punctuation marks. This allows for hassle-free placing of footnote markers in running text either before or after punctuation marks. Release 1.2-f ------------- Added ADD_SPACE, to permit users to insert space at the top of running text (after the first page) when using the docprocessing macros. Releases 1.2-a and 1.2-b ------------------------ My personal email address has changed. 1.2-a and -b have been updated to reflect that. Additionally, I made some small changes to the documentation. Release 1.2 ----------- As of 1.2, the recommended version of groff to use with mom has been bumped up from groff, 1.18 to groff, 1.19.2. Although mom will continue to work with groff, 1.18, her handling of .FAM(ILY) and .FT is now slightly different, therefore users of groff 1.18 may have to update documents created with mom so that every .FAM(ILY) request is followed by a .FT request before any text is input, otherwise mom will set the text after .FAM(ILY) in Courier (until she encounters a .FT request). People running groff, >= 1.19.2 don't have to worry about this, but I recommend that, regardless of which version you're running, you have a look at the document entries for FAMILY and FT in order to see how mom will be handling .FAMILY and .FT from now on. When used with groff >=1.19.2, mom now emits warnings if a style hasn't been registered, or if a font style doesn't exist in the current family. Invalid .FAM(ILY) calls now use a "fallback" font" (although no warning is issued). The fallback is user-settable. Mom's macro file, om.tmac, now sets up a fairly extensive list of font "styles," thus expanding the range of arguments that can be passed to .FT (formerly, just R, I, B and BI, unless users had already rolled their own solution to the problem of extensive type families containing fonts like condensed, demibold, black, light, etc). Users are advised to read the documentation sections on FAM(ILY), FT and FALLBACK_FONT, as well as the new appendix section, "Adding PostScript fonts to groff", for information on using mom's style extensions (and how to disable them, should they conflict with a user's present groff site-font/devps setup). A new macro, FALLBACK_FONT, has been added. It controls not only the fallback font for invalid .FAMILY calls, but also whether mom aborts on invalid .FT calls after issuing a warning, or continues processing using the fallback. Release 1.1.9 ------------- Added the (optional) generation of cover pages and document cover pages, plus a full suite of control macros for all cover page elements. Added new reference macros that apply to covers: COVERTITLE, DOC_COVERTITLE, COPYRIGHT and MISC. The need for TRAP OFF/TRAP to deal with ELs and TNs that fall at the bottom page has been obsoleted. However, both EL and TN, when invoked in any "nofill" mode (LEFT, RIGHT, CENTER, or the L | R | C arguments to TAB_SET or ST when no QUAD argument is given), must now have the input line preceding the EL or TN terminated by \c. Fill modes do not have this requirement, i.e. no \c is required. Footnotes that occur inside quotes, blockquotes and epigraphs now work just like regular footnotes, with no user intervention required. This obsoletes the macro BREAK_QUOTE. Removed all aliases that used the word COLOUR. Users must use COLOR wherever COLOR is needed. COLOUR, as a replacement/alias, is no longer supported. NEWPAGE, which used to be an alias of .bp, is now its own macro. Release 1.1.8 ------------- Added text color support. Users can now define or initialize a color, and afterwards change text color with an inline of the form \*[], or with the macro .COLOR. In document processing, the docelement tag control macros have been expanded to include _COLOR, e.g. .HEAD_COLOR will colorize heads, PAGENUM_COLOR ]. This brings mom's inline size change syntax into line with her other inlines. \*S[] can still be used for the same thing. The file elvis_syntax (for elvis prior to 2.2h) is no longer being maintained. It was getting messy and long in the tooth. The official elvis syntax file is elvis_syntax.new, which works for 2.2h of elvis (and higher, one hopes). elvis users are encouraged to update to 2.2h or higher. Release 1.1.6-e --------------- Extended handling of draft and revision numbers and strings in headers/footers for increased flexibility. It's possible now to have just about any combo of DRAFT_STRING, DRAFT, REVISION_STRING and REVISION, and have them come out in headers/footers as one intuitively expects/wants. Also added a new set of syntax highlighting rules for the vi clone, elvis. Version 2-2h-beta of elvis finally made possible the highlighting of \*[...] inline escapes, whether or not they're separated from surrounding text by spaces. This is a terrific improvement in elvis, and makes for greatly improved readability of mom files. Release 1.1.6-b - 1.1.6d ------------------------ Trivial changes to documentation and some cleanups of the main om.tmac file, including: Added a .bp after .if \\n[#START]=1 in FOOTER. Without it, in document processing mode, documents that use *none* of the docprocessing tags (yes, there are times when users want to do this) ignored the footer trap. Changed register #DOCHEADER_LEAD_ADJ to string $DOCHEADER_LEAD_ADJ. This means that .DOCHEADER_LEAD no longer requires a unit of measure; points is assumed. Release 1.1.6-b --------------- Added a SHIM macro that calculates and moves to the next "valid" baseline during document processing (useful if user starts playing around with spacing/leading on a page and needs to get the leading back on track). Fixed handling of DOCHEADER OFF so that the first line of running text falls on a "valid" baseline when is given. Release 1.1.6-a --------------- Problem with groff 1.19.1 fixed by Werner (.return handled arguments incorrectly). Fixed handling of page numbering style restoration in endnotes, so that (collated) docs have the correct page numbering style when the style has been changed for endnotes (with ENDNOTES_PAGENUM_STYLE). DOC_TITLE has been made for use exclusively with DOCTYPE DEFAULT. Fixed handling of headers/footers with respect to endnotes. Now, when either headers or footers are on, mom picks up the correct page header/footer on the last page prior to ENDNOTES, gets the pageheaders correct for endnotes pages *including the last one*, and picks up correct page headers/footers for the subsequent docs after COLLATE. Release 1.1.6 ------------- BAD NEWS: mom appears to be crippled in some areas when run with groff 1.19.1. Pending a solution, mom must be run with groff 1.18 ***NEW*** Added TOC capabilities. Extended range of endnotes control macros. See the documentation on endnotes control macros. Added a new DOC_TITLE macro, to deal with collated documents that have an overall title, while each doc has its own separate doc title (from TITLE). Release 1.1.5 ------------- ***NEW*** Added James Ramsey's CHAPTER_TITLE macro as well as control macros to go with it. Thanks James. Also from James came a patch to handle START differenty which has been incorporated into om.tmac. Thanks again, James. Some bits and pieces of the docs have been tweaked, but nothing changed. Hopefully, the changes will make parts of the docs easier to read and navigate. ***FIXES*** o \*[RULE] o broken draft and revision in docheaders o post-epigraph spacing in TYPEWRITE o header spacing in TYPEWRITE ------------------------------------------------------------------------ Release 1.1.4 ------------- ***SIGNIFICANT CHANGE*** .IX is now deprecated, although it will continue to work as before. The new form is .IQ (Indent Quit). Groff will emit a message advising users to update their docs. ***NEW*** Four new inlines to deal with horizontal and vertical movements: o \*[FWD n] o \*[BCK n] o \*[UP n] o \*[DOWN n] All four require a unit of measure after n. These inlines are similar to the older \*[FPn], \*[BPn], \*[ALDn] and \*[RLDn], however they're not restricted to points, and any value can be entered for n (the older forms -- which still work -- were restricted to 1 - 36). ***CHANGED*** Inline kerning can now be accomplished with \*[BU n] and \*[FU n], where n, after the space, is the desired number of kern units. The older forms \*[BUn] and \*[FUn] still work, up to 36 units. ------------------------------------------------------------------------ Release 1.1.3c -------------- ***NEW*** A new macro -- ENDNOTES_HDRFTR_CENTER -- added so that mom's default behaviour of not printing the header center string when DOCTYPE is CHAPTER can be disabled (i.e. she will print the center string). The macro is user-called with ENDNOTES_HEADER_CENTER or ENDNOTES_FOOTER_CENTER. ***FIXES*** PAD now works as advertised when fill mode is on. ENDNOTES no longer disables printing of footnotes on last page of document body. Release 1.1.3 ------------- ***SIGNIFICANT CHANGE -- PLEASE TAKE NOTE*** As of 1.1.3, groff must be >= 1.18. ***NEW*** Added endnotes functionality to mom, along with a slew of macros to control how mom prints endnotes pages. See the html documentation. ***NEW*** Added inline \*[RULE], which draws a rule to the full measure of the current line length ( to be used in place of \h'\n(.lu' ). Weight of the rule is dependent on the point size of type when \#[RULE] is called. ***FIXES*** PAD -- works more intuitively now when the pad string contains inline escapes for font, point size, etc. UNDERLINE -- fixed character translations of digraphs so they get underlined properly. Also fixed a bug that was causing some footnotes to get underlined when UNDERLINE was on in the body of the document. ***UPDATES*** Html documentation elvis_syn Release 1.1.2a -------------- ***SIGNIFICANT CHANGE -- PLEASE TAKE NOTE*** In order to help mom toward full groffship, the macro .PS has been renamed to .PT_SIZE, and the alias .TS (for .TAB_SET) has been removed. .PS and .TS are keywords used by pic and tbl respectively, and the mom macros of the same name were in conflict. Release 1.1.2 ------------- ***IT'S OFFICIAL!*** mom is now an official part of the groff. New releases will be incorporated into the groff package. I'll still be posting each new release on the mom homepage, so there's no need to download all of the most recent version of groff just to get a newer mom. :) ***CHANGES*** Fixed default footer separator rule adjustment so that it's closer to the advertised "4 points above the tallest ascender in the footer." Added more stuff to the elvis_syn file. Still wouldn't mind someone contributing some vim/emacs syntax highlighting. Added .cflags 4 /\(em to om.tmac. By default, mom now obligingly breaks after / and \(en. ***NEW*** Macro(s): HEADER_RECTO HEADER_VERSO With these macros, users can now define single-string recto/verso headers/footers. HEADER_RECTO (or FOOTER_RECTO) can be used to create a one-part header/footer (instead of mom's default three-parters) that appears on every page if RECTO_VERSO is OFF or, if RECTO_VERSO is on, if no HEADER_VERSO (or FOOTER_VERSO) has been defined. If a HEADER_VERSO (or FOOTER_VERSO) is defined and RECTO_VERSO is on, _RECTO prints on even pages and _VERSO on odd pages. Added macro DRAFT_WITH_PAGENUMBER so user can have draft/revision info attached to the pagenumber in COPYSTYLE DRAFT, instead of having it HEADER center. Always having it HEADER center was creating problems with long doc titles, esp. with PRINTSTYLE TYPEWRITE (which is when COPYSTYLE DRAFT is most likely to be used). ***FIXES*** No more "can't break line" warnings in DOCTYPE LETTER. If no REVISION number is given, Rev. 0 no longer appears HEADER_CENTER in COPYSTYLE DRAFT PAGENUM_STYLE now works as advertised. Release 1.1.1 ------------- ***CHANGES*** Main macro file renamed to om.tmac, in keeping with current groff policy. Now okay to use groff mailing list for mom-related posts ***NEW*** Toggle macro -- BR_AT_LINE_KERN. When on, automatically deposits a break whenever .RW or .EW are invoked. Very useful when kerning whole lines of rag copy. ***NEW*** Toggle macro -- PAGENUM_ON_FIRST_PAGE. Normally, when FOOTERS are being used instead of HEADERS, mom doesn't print the page number at the top of the first page of a doc, or the first page of collated docs. PAGENUM_ON_FIRST_PAGE allows user to get mom to put the page number on "first" pages if that's desired. ***NEW*** Macro -- BREAK_QUOTE -- to deal with problem of footnoted quotes and blockquotes that cross a page or column. ***NEW*** New argument to AUTOLEAD -- FACTOR. With FACTOR, you can, if you wish, enter a factor by which AUTOLEAD multiplies the point size when calculating lead automatically. Improvements ------------ PAPER now has a much larger selection of common paper sizes. \*[ALD], \*[RLD], \*[FP] and \*[BP] now accept increments of quarter points (expressed as decimal fractions). \*[RLD1.75], for example, reverses 1-3/4 points up on the line. HEADER_SIZE now available to PRINTSTYLE TYPEWRITE. This was necessary to deal with the problem of excessively long HEADER_LEFT, _CENTER or _RIGHT strings. Fixes ----- T_MARGIN -- can be set before or after LS or AUTOLEAD SS -- remains constant regardless of WS WS -- no longer affects SS TI -- now works as expected even when called while another indent type is in effect COLLATE -- small fixes Broken .RW and .EW fixed. String tabs now behave properly when set from within tabs. UNDERLINE_QUOTES (for PRINTSTYLE TYPEWRITE) are now, in fact, on by default as the docs state. groff-1.22.3/contrib/mom/PaxHeaders.22577/BUGS0000644000000000000000000000013212426110213016610 xustar000000000000000030 mtime=1415090315.502520534 30 atime=1415090315.502520534 30 ctime=1415090315.502520534 groff-1.22.3/contrib/mom/BUGS0000644000175000001440000004612012426110213015451 0ustar00wlusers00000000000000 -*- text -*- Copyright 2004-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Assume that anything that doesn't work or behaves oddly is a bug. The documentation should be taken as the authoritative source for how things ought to be. Post to the groff mailing list with bug reports, questions and suggestions, or contact me directly at: peter@schaffter.ca If writing me directly, please include the word "groff" or "mom" in the Subject line or you risk my spam filters nuking your message. Also, please--no html email. That, too, gets nuked. --Peter Schaffter ==================================================================== Version 2.0-c ============= Endnotes page offset wrong if (BLOCK)QUOTE last macro before ENDNOTES. ---Fixed--- Character translation of diacritics from lowercase to caps broken. ---Fixed--- Spacing not being restored (.ns/.rs) after a HEADING that falls at the top of the page. ---Fixed--- Version 2.0-b ============= When line numbering is enabled, line numbers after QUOTE being reset to '0'. ---Fixed--- When line numbering is enabled for QUOTE and BLOCKQUOTE, style params for line numbers not being applied. ---Fixed--- TOC overprinting footer when it comes immediately after BIBLIOGRAPHY. ---Fixed--- TOC page numbers not printing when positioned at top of page. ---Fixed--- TOC page numbers not always incrementing properly. ---Fixed--- Version 2.0-a_1 =============== QUOTE_INDENT not being respected in FLOAT. ---Fixed--- SMARTQUOTES OFF broken. ---Fixed--- DOCHEADER_LEAD being reset to default after first chapter. ---Fixed--- Forced floats that fit on the page causing floats on the next page to be treated as forced. ---Fixed--- Forced floats not advancing on the page after output if the float is forced to the next page, causing running text to overprint. ---Fixed--- Text after defered floats not being shimmed properly. ---Fixed--- Tables that span pages overprinting first two lines of table on new pages. ---Fixed--- PDF_IMAGE not respecting .IL, .IR, or .IB. ---Fixed--- AUTOLEAD not sticking after .START. ---Fixed--- Version 2.0-a ============= Footer not printing on first page when HEADERS_AND_FOOTERS enabled. ---Fixed--- $AUTHOR string missing. ---Fixed--- Version 2.0 =========== tbl macros .TS/.TE not working unless inside a float. ---Fixed--- Terminal period after page number(s) in refer items not always printing. ---Fixed--- ==================================================================== Version 1.6-a =========== Footnotes on last page of columnar docs before a TOC getting printed at bottom of last column, not current column. --Fixed--- HEADER_RULE OFF turning off headers completely. ---Fixed--- FINIS depositing a blank final page when invoked too close to the bottom margin. ---Fixed--- Version 1-6 =========== ENDNOTE_STRING_CAPS not disabling caps when arg given. ---Fixed--- Superfluous blank line before paragraphs with paraheads. ---Fixed--- Paraheads causing line numbering to overprint two line numbers. ---Fixed--- Endless loop when DOC_LEAD_ADJUST is disabled. ---Fixed--- In the case where the list doesn't fit the page, -mom inserts an extra page with one word and a warning about "environment stack underflow" and then continues on the following page. --Fixed-- PRINTSTYLE TYPEWRITE not respecting TYPEWRITER_FAMILY when DOCTYPE is LETTER. ---Fixed--- Version 1.5-d ============= ILX not quitting left indents set within ITEM. ---Fixed---- Version 1.5-c ============= COVER_COUNTS_PAGES incrementing pagenum by 1 too many. ---Fixed--- HEADER/FOOTER_RECTO strings vanishing when the default CAPS option is turned off. ---Fixed--- TQ not removing QUAD arg from cleared tabs. ---Fixed--- DROPCAP_OFF trap remaining in effect after dropcap has been processed. ---Fixed--- PARAHEAD_SIZE 0 resulting in 0-sized type! ---Fixed--- When DOC_LEAD is called to change document leading in collated docs, document leading steadily increases by small amounts at each subsequent call to COLLATE. ---Fixed--- (DOC_)COVER requests annihilating families used in various document elements if those families differ from the document's overall family. ---Fixed--- Covers and doccovers not always respecting null pagenumbering. --Fixed--- Version 1.5-b ============= Use of \E*[UC] and \E*[LC] inside strings for HDRFTR_RECTO and HDRFTR_VERSO breaking headers. ---Not fixable. CAPS option added to HDRFTR_RECTO/VERSO to accomodate situations where capitalized reserved strings(\*[$TITLE], \*[$AUTHOR], etc) are desired.--- COLLATE depositing a blank page if last output line before it falls at the bottom of running text. ---Fixed--- PRINTSTYLE TYPEWRITE not setting $FAMILY or $FONT or $PP_FT, with consequences for COLLATE. ---Fixed--- FOOTNOTE_MARKERS OFF not disabling footnote markers if used before START. ---Fixed--- 1st footnotes with overflow vanishing altogether with an "automatically ending diversion `FN_OVERFLOW' on exit" warning. ---Fixed--- Right hand margin notes vanishing when an RH margin note overflows to the next output page. ---Fixed (I think)--- Doc bug; \*[S] escape incorrectly typed as \*S[] in the section on mom's inlines. ---Fixed--- Paragraphs inside blockquotes not being spaced when .PARA_SPACE is active. ---Fixed--- Version 1.5-a ============= Indenting of references (collected with .REF) on endnotes pages when endnote numbers are right-aligned appears to be backwards; the first line of the reference is indented more than the second. ---Fixed--- Version 1.5 =========== DROPCAP not printing the dropcap letter at all in PRINTSTYLE TYPEWRITE, nor when DROPCAP is used (accidentally?) after a valid "first" paragraph. ---FIXED--- DROPCAP going into an infinite loop when groff called with the -Tascii switch. ---FIXED--- SHIFT_LIST, when used anywhere but with a top-level list, is killing list indents for every list level *returned to* afterward. ---Fixed--- TOC page number for heads and subheads that get bumped to next page (because of .ne) off by 1. ---Fixed--- Moving backwards in nested lists not setting the proper indent. ---Fixed--- Default linebreak color missing in om.tmac. ---Fixed--- Some links in macrolist.html not pointing to html "name" owing to missing # in link names. ---Fixed--- Version 1.4-b ============= Line lengths and indents not always being respected in LIST. ---Fixed--- CAPS OFF, called inline with \*[CAPS OFF] not working. (Added two new inlines, \*[UC] and \*[LC], to do the job.) ---Fixed--- When type is set after START but no docelement tag given, the expected family ($DOC_FAMILY) and font (R) are not in effect. ---Fixed--- When DOCTYPE is CHAPTER and .TITLE is omitted after .COLLATE, the title vanishes from page headers/footers. ---Fixed--- Version 1.4-a ============= In collated documents, when using a different HEADER_FAMILY, if BLANKPAGE is given after COLLATE (but before START) all subsequent text is set in the HEADER_FAMILY face rather than the standard text face. ---Fixed--- Document title identification string missing on endnotes pages when the endnote marker style is LINE. ---Fixed--- Space between endnote items on endnotes output pages not being inserted. ---Fixed--- Version 1.4 =========== Invoking .FOOTERS isn't automatically putting pagination in the top margin. ---Fixed--- .PP_FONT after .COLLATE not being respected. ---Fixed--- $SAVED_PP_FT not being fed to .FT in .PP after .COLLATE ---Fixed--- .CODE OFF not always restoring previous family and font. ---Fixed--- .ITEM, when not in a list, should do nothing. ---Fixed--- Version 1.3-e_3 =============== ENDNOTES is not, by default, printing headers on endnotes pages. ---Fixed--- Processing of the "Endnotes" title for the TOC is putting the page number 1 line too high and not inserting leader. ---Fixed--- Collated docs not respecting $PP_FT (it's picking up the font from the pagenumber font) ---Fixed--- Docheader spacing sometimes depositing too much space between various docheader elements in TYPEWRITE when DOCTYPE is DEFAULT or NAMED. ---Fixed--- When COLUMNS are on, subheads that are deferred to the next column/page because there isn't enough room for the s/h and one line of text are causing columns to overprint. ---Fixed--- HDRFTR_LEFT printing one line too high when .HEADER_COLOR is used. ---Fixed--- DOCTITLE link broken in the docs. ---Fixed--- Version 1.3-e_2 =============== TOC formatting incorrect when the pound/number sign (#) is used in head elements. ---Fixed--- [Documentation]: The docs erroneously state that TOC control macros can be entered anywhere in a file prior to invoking TOC (they should be entered before START). ---Fixed--- Page numbers in the bottom margin being printed too low on output pages preceding an invocation of COLLATE or macros that call it. ---Fixed--- A superfluous blank, numbered page is being generated by COLLATE (and macros that call it, namely TOC and ENDNOTES) when the last line of output text before it falls on the last valid baseline of an output page. Same thing happening occasionally with normal document termination. ---Fixed--- SHIFT_LIST not being observed when moving *back* to a shifted list; the list is reverting to the left margin. ---Fixed--- NUMBER_SUBHEADS not working with TYPESET when PARA_SPACE is on. ---Fixed--- Version 1.3-e_1 =============== Missing #COLLATE register (accidentally wiped out) creating various problems with .COLLATE (missing headers, leading increasing slightly each time .COLLATE invoked, etc). ---Fixed--- Version 1.3-e ============= mom failing during groff build while processing examples/typesetting.mom ---Fixed--- Windows user reports COLLATE fails with a bottom margin error (generated by mom). ---Fixed--- Version 1.3-d ============= Small error in the examples of output in the "Footnotes and Punctuation" documentation section. ---Fixed---- PAD_LIST_DIGITS/SHIFT_LIST broken when the enumerator type is roman or ROMAN. ---Fixed--- COLLATE wiping out _FAMILY settings. ---Fixed--- DOC_LEAD_ADJUST OFF not being observed when COLLATE is invoked. ---Fixed--- DROPCAP setting the dropcap too high in initial paragraph after a COLLATE. ---Fixed--- Version 1.3-c ============= Owing to a superfluous "if" in the FONT macro, the "missing font" routine is being silently ignored. ---Fixed--- FOOTNOTE, used in nofill mode, adds a linebreak between the marker and the text of the footnote. ---Fixed--- Version 1.3-b ============= ITALIC_MEANS_ITALIC not being respected when DOCTYPE LETTER. ---Fixed--- Underlining of italic passages in PRINTSTYLE TYEPWRITE not spanning pages. ---Fixed--- PRINTSTYLE TYPEWRITE depositing extra space on new pages above quotes that span pages. ---Fixed--- MN doesn't accept OFF, QUIT, END, X, etc. ---Fixed--- Margin notes that begin flush with the last line of text on a page are running down the same page, instead of the remainder being collected and output on the next. ---Fixed--- MN sometimes erroneously dropping margin notes near the bottom of a page, even when they'd fit. (MN-shifted not being removed by MN-top.) ---Fixed--- MN_INIT not accepting "" args for default values. ---Fixed--- Documentation for margin notes erroneously states that the first (optional) argument can be either "ragged" or "symmetric". S/b "RAGGED" or "SYMMETRIC". ---Fixed--- Use of "" to tell MN_INIT to use the default for any specific argument in the arg list broken. ---Fixed--- Paragraphs that begin with a "smart" double quote when the preceding paragraph has no corresponding close quote (i.e. dialogue passages containing multiple paragraphs) are starting off with a close quote. ---Fixed--- Version 1.3-a ============= First baseline of type isn't going where it's supposed to when the docheader is turned off. ---Fixed--- Version 1.3 =========== Persistent error in html coding of docs ( tag). ---Fixed--- Version 1.2-f ============ Multiple line subheads near page bottom sometimes printing one line of subhead at page bottom, and subsequent lines on next page. ---Fixed--- Post-quote spacing still wonky when paragraph spacing is turned on. ---Fixed--- (for good would be nice) RULE not always resetting quad and quad value. ---Fixed--- Version 1.2-e ============= Some string definitions in om.tmac had superfluous spaces after them (e.g. $COVERTITLE). ---Fixed--- Spacing under quotes not correct when paragraph spacing is turned on. ---Fixed--- First word of last line before footnotes is getting chopped. ---Fixed--- Version 1.2-d ============= HEADER_FAMILY not changing header family. ---Fixed--- FAMILY, after COLLATE, not changing the family of all and every page element or tag. ---Fixed--- Heads and subheads at the start of docs are printing one line lower than they should. ---Fixed--- Gaps are appearing at the bottom of pages when there's a linebreak followed by a subhead. ---Fixed--- When LS is invoked after a single text line at the top of a page containing a T_MARGIN (set with T_MARGIN or PAGE), mom is performing spacing adjustments as if the first line doesn't exist. ---Fixed--- Changes made to ALD and LS in version 1.2-c should not apply when the document processing macros are used. There is a significant conflict with the internal use of ALD when the docheader is only one line long (as, for example, when DOCTYPE is CHAPTER). ---Fixed, pending discovery of further conflicts--- Version 1.2-c ============= Deferred footnotes not always being output, and groff complains "ending diversion FN_OVERFLOW on exit." ---Fixed--- First .LS call after a top margin has been set (with .T_MARGIN or .PAGE) causing mom to move off the top margin baseline. Also, there are conflicts between ALD, LS and T_MARGIN. ---Fixed--- DROPCAP not properly restoring a running \*[COND] or \*[EXT] after COND or EXT are given as arguments to DROPCAP. ---Fixed--- Version 1.2 =========== .PAD not co-operating with mom's fontstyles, esp. when a full family+fontstyle is given to .FT. ---Fixed--- .DROPCAP -- ditto the above. ---Fixed--- Version 1.1.9 ============= Footnote markers not resetting properly on new pages when COLUMNS is enabled. ---Fixed--- When overflowed footnote material is the only footnote material on the page or in the column, no footnotes are output. ---Fixed--- The AUTOLEAD used in FOOTNOTE not being disabled after FOOTNOTES are output, or after PROCESS_FN_LEFTOVER/PROCESS_FN_IN_DIVER. ---Fixed--- COL_NEXT and COL_BREAK, when invoked during the last column on a page, are overprinting the last column instead of breaking to a new page when there are footnotes in the column. ---Fixed--- BR_AT_LINE_KERN not "break-and-spreading" text when used in justified copy. ---Fixed--- Version 1.1.8 ============= BLOCKQUOTE_FAMILY not changing blockquote family. ---Fixed--- FOOTNOTE, whether in column mode or not, was using #FN_COUNT_FOR_COLS for all footnote markers and handling. ---Fixed--- Deferred footnotes that occured on the second to last page of documents not printing. ---Fixed--- Version 1.1.7-a =============== Suite number in DOCTYPE LETTER not printing. ---Fixed--- Footer elements not always vertically aligning. ---Fixed--- Footer rule gap not always correctly observed. ---Fixed--- Page numbering, when at top of page, not always falling on HDRFTR_MARGIN. ---Fixed--- Default page numbering style for COPYSTYLE draft is DIGIT instead of roman. ---Fixed--- Hyphens around page numbering when style is DIGIT, ROMAN or ALPHA not vertically centered. ---Fixed--- EXT arg not working with DROPCAP. ---Fixed--- DOC_QUAD not automatically set immediately after START ---Fixed-- Tabs behaving erratically during document processing. ---Fixed--- Version 1.1.7 ============= When DOCHEADER OFF is given, if falls short of the top margin of running text, is not respected and bottom margin falls low. ---Fixed--- Version 1.1.6-e =============== The " mark (doublequote), when entered while not in document processing mode (i.e. just straightforward typesetting), outputs nothing unless SMARQUOTES is invoked explicitly. ---Fixed--- Version 1.1.6-c =============== In document processing mode, docs that use *none* of the docprocessing tags being ignored. ---Fixed--- Version 1.1.6-b =============== String tabs not picking up #L_MARGIN when #L_MARGIN not explicitly set with L_MARGIN, PAPER or PAGE. ---Fixed--- Infinite loop when B_MARGIN is set lower than FOOTER_MARGIN during doc processing. ---Fixed--- Version 1.1.6-a =============== Mom partially broken when run with groff 1.19.1. Don't know yet what this is, whether bad coding in mom, or a problem with 1.19.1. Only solution for now: run mom 1.1.6 with groff 1.18. ----Fixed--- Top margin of endnotes pages after the first endnotes page when PRINTSTYLE is TYPEWRITE and endnotes single-spacing is turned on falling one line too high. ---Fixed--- Version 1.1.6 ============= DOCHEADER OFF (distance) not being respected. ---Fixed--- FINIS killing ENDNOTES page numbering and heads. ---Fixed--- Version 1.1.5 ============= Draft and revision not appearing in page headers. ---Fixed--- \*[RULE] not working properly with indents and justified copy. ---Fixed--- Post-epigraph spacing in TYPEWRITE causing some first pages to run too deep. ---Fixed--- Spacing of docheaders in TYPEWRITE not always consistent. ---Fixed--- Version 1.1.4 ============= Blockquotes that span pages running too deep. ---Fixed--- Version 1.1.3 ============= Footnotes not outputting on final page of document body when ENDNOTES is invoked. ---Fixed--- Pad not working properly and/or spitting out warnings when fill mode is on. ---Fixed--- Version 1.1.2 ============= PAGENUM_STYLE being ignored unless entered after START. ---Fixed--- Version 1.1 =========== String tabs not working as advertised when set from within other tabs. ---Fixed--- .COLLATE sometimes depositing a header on the first page of a subsequent doc. ---Fixed with workaround BREAK_QUOTE--- .UNDERLINE_QUOTES in PRINTSTYLE TYPEWRITE not on by default as advertised. ---Fixed--- .TI not cooperating with other indent styles. ---Fixed--- .WS and .SS not cooperating. ---Fixed--- .RW and .EW not working. ---Fixed--- ======================================================================== KNOWN PROBLEMS -------------- The indent macros from the typesetting macro set may not always perform well in conjunction with the document processing macros, especially when documents are set in columns. Mostly, this is the result of inadequate testing. There are only so many "who'd want to do this anyway?" scenarios I can think of on my own. Epigraphs at the bottoms of page may sometimes run exactly one line deeper than they should. The alternative (from my point of view) is to have them run 1 line shorter than they should. The problem stems from the fact the epigraphs are leaded differently than all other text, and there's only so much adjusting that can be done with the whitespace surrounding them to get them to bottom align. Since stylistically, epigraphs should never appear at the bottom of a page/column without at least some running text beneath them in order to make sense of the role they play in page layout, this not likely to be fixed for some time. groff-1.22.3/contrib/mom/PaxHeaders.22577/om.tmac0000644000000000000000000000013212426110213017406 xustar000000000000000030 mtime=1415090315.504520509 30 atime=1415090315.503520521 30 ctime=1415090315.504520509 groff-1.22.3/contrib/mom/om.tmac0000644000175000001440000235004512426110213016255 0ustar00wlusers00000000000000.\" -*- nroff -*- om.tmac .ig Mom -- a typesetting/document-processing macro set for groff. Copyright (C) 2002-2014 Free Software Foundation, Inc. Written by Peter Schaffter PDF integration contributed by Deri James This file is part of groff. groff is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. groff is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Version 2.1-c_1 --------------- Antoine de St-Exupéry asserted that elegance in engineering is achieved not when there is nothing left to add, but when there is nothing left to take away. By those standards, mom is a Rube Goldberg contraption. She was created over the years while groff, and my understanding of it, changed and evolved. However, I'm a firm believer in "if it ain't broke, don't fix it." Version 2.0 removes some of the redundancies and cruft, but mom still needs some nip and tuck. "" in the description of arguments that can be passed to a macro means that any argument turns the feature off. Thanks to everyone who has contributed suggestions and patches, and to those whose GPL'd work has been plundered. Special thanks to Werner Lemberg (margin notes), Tadziu Hoffman (underlining), Deri James (pdf integration), Robin Haberkorn (tbl integration, eqn extentions, and float management). .. .\" %beginstrip% \# \# ==================================================================== \# \# Check which version of groff is being run .if (\n[.x]\n[.y] < 118) \ . ab [mom]: You need GNU troff version 1.18 or higher to run this version of mom. \# Check that GNU troff is being run .if !\n[.g]=1 \ . ab [mom]: The mom macros require that you be running GNU troff. .if \n[.C] \ . ab [mom]: The groff mom macros do not work in compatibility mode. \# Add supplementary styles .sty \n[.fp] UL \" Ultra Light .sty \n[.fp] ULI \" Ultra Light Italic .sty \n[.fp] ULCD \" Ultra Light Condensed .sty \n[.fp] ULCDI \" Ultra Light Condensed Italic .sty \n[.fp] ULEX \" Ultra Light Extended .sty \n[.fp] ULEXI \" Ultra Light Extended Italic \# .sty \n[.fp] XL \" Extra Light .sty \n[.fp] XLI \" Extra Light Italic .sty \n[.fp] XLCD \" Extra Light Condensed .sty \n[.fp] XLCDI \" Extra Light Condensed Italic .sty \n[.fp] XLEX \" Extra Light Extended .sty \n[.fp] XLEXI \" Extra Light Extended Italic \# .sty \n[.fp] TH \" Thin .sty \n[.fp] THI \" Thin Italic .sty \n[.fp] THCD \" Thin Condensed .sty \n[.fp] THCDI \" Thin Condensed Italic .sty \n[.fp] THEX \" Thin Extended .sty \n[.fp] THEXI \" Thin Extended Italic \# .sty \n[.fp] L \" Light Roman .sty \n[.fp] LI \" Light Italic .sty \n[.fp] LCD \" Light Condensed .sty \n[.fp] LCDI \" Light Condensed Italic .sty \n[.fp] LEX \" Light Extended .sty \n[.fp] LEXI \" Light Extended Italic \# .sty \n[.fp] BK \" Book Roman .sty \n[.fp] BKI \" Book Italic .sty \n[.fp] BKCD \" Book Condensed .sty \n[.fp] BKCDI \" Book Condensed Italic .sty \n[.fp] BKEX \" Book Extended .sty \n[.fp] BKEXI \" Book Extended Italic \# .sty \n[.fp] CD \" Medium Condensed .sty \n[.fp] CDI \" Medium Condensed Italic .sty \n[.fp] EX \" Medium Extended .sty \n[.fp] EXI \" Medium Extended Italic \# .sty \n[.fp] DB \" DemiBold Roman .sty \n[.fp] DBI \" DemiBold Italic .sty \n[.fp] DBCD \" DemiBold Condensed .sty \n[.fp] DBCDI \" DemiBold Condensed Italic .sty \n[.fp] DBEX \" DemiBold Extended .sty \n[.fp] DBEXI \" DemiBold Extended Italic \# .sty \n[.fp] SB \" SemiBold Roman .sty \n[.fp] SBI \" SemiBold Italic .sty \n[.fp] SBCD \" SemiBold Condensed .sty \n[.fp] SBCDI \" SemiBold Condensed Italic .sty \n[.fp] SBEX \" SemiBold Extended .sty \n[.fp] SBEXI \" SemiBold Extended Italic \# .sty \n[.fp] BCD \" Bold Condensed .sty \n[.fp] BCDI \" Bold Condensed Italic .sty \n[.fp] BEX \" Bold Extended .sty \n[.fp] BEXI \" Bold Extended Italic .sty \n[.fp] BO \" Bold Outline \# .sty \n[.fp] XB \" Extra Bold .sty \n[.fp] XBI \" Extra Bold Italic .sty \n[.fp] XBCD \" Extra Bold Condensed .sty \n[.fp] XBCDI \" Extra Bold Condensed Italic .sty \n[.fp] XBEX \" Extra Bold Extended .sty \n[.fp] XBEXI \" Extra Bold Extended Italic \# .sty \n[.fp] UB \" Ultra Bold .sty \n[.fp] UBI \" Ultra Bold Italic .sty \n[.fp] UBCD \" Ultra Bold Condensed .sty \n[.fp] UBCDI \" Ultra Bold Condensed Italic .sty \n[.fp] UBEX \" Ultra Bold Extended .sty \n[.fp] UBEXI \" Ultra Bold Extended Italic \# .sty \n[.fp] HV \" Heavy .sty \n[.fp] HVI \" Heavy Italic .sty \n[.fp] HVCD \" Heavy Condensed .sty \n[.fp] HVCDI \" Heavy Condensed Italic .sty \n[.fp] HVEX \" Heavy Extended .sty \n[.fp] HVEXI \" Heavy Extended Italic \# .sty \n[.fp] BL \" Black .sty \n[.fp] BLI \" Black Italic .sty \n[.fp] BLCD \" Black Condensed .sty \n[.fp] BLCDI \" Black Condensed Italic .sty \n[.fp] BLEX \" Black Extended .sty \n[.fp] BLEXI \" Black Extended Italic .sty \n[.fp] BLO \" Black Outline \# .sty \n[.fp] XBL \" Extra Black .sty \n[.fp] XBLI \" Extra Black Italic .sty \n[.fp] XBLCD \" Extra Black .sty \n[.fp] XBLCDI \" Extra Black .sty \n[.fp] XBLEX \" Extra Black Italic .sty \n[.fp] XBLEXI \" Extra Black Italic \# .sty \n[.fp] UBL \" Ultra Black .sty \n[.fp] UBLI \" Ultra Black Italic .sty \n[.fp] UBLCD \" Ultra Black Condensed .sty \n[.fp] UBLCDI \" Ultra Black Condensed Italic .sty \n[.fp] UBLEX \" Ultra Black Exteneded .sty \n[.fp] UBLEXI \" Ultra Black Extended Italic \# .sty \n[.fp] SC \" Small Caps Roman .sty \n[.fp] SCI \" Small Caps Italic .sty \n[.fp] SCDB \" Small Caps Demibold .sty \n[.fp] SCDBI \" Small Caps Demibold Italic .sty \n[.fp] SCSB \" Small Caps Semibold .sty \n[.fp] SCSBI \" Small Caps Semibold Italic \# \# Instruct grops to use square linecaps and joins. \# This instruction is also executed in DO_B_MARGIN, NEWPAGE, and HEADER \# .if !n \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap' \# \# The following PostScript, provided by Tadziu Hoffmann, permits \# no-fail underlining \# .de ul*ps ps: def grops begin /decornone { grops begin /X { } def /Y { } def /y2 -1 def end } def /decorline { grops begin u neg /uld exch def u /ulw exch def /X { currentpoint /y0 exch def /x0 exch def } def /Y { currentpoint /y1 exch def /x1 exch def drawline /x2 x1 def /y2 y1 def } def end } def /drawline { gsave ulw setlinewidth 0 setlinecap x1 y1 uld sub moveto y2 y0 eq { x2 y2 } { x0 y0 } ifelse uld sub lineto stroke grestore } def decornone /uld 0 def /ulw 0 def /A { X show Y } def /B { 0 SC 3 -1 roll X widthshow Y } def /C { 0 exch X ashow Y } def /D { 0 exch 0 SC 5 2 roll X awidthshow Y } def /E { 0 rmoveto X show Y } def /F { 0 rmoveto 0 SC 3 -1 roll X widthshow Y } def /G { 0 rmoveto 0 exch X ashow Y } def /H { 0 rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def /I { 0 exch rmoveto X show Y } def /J { 0 exch rmoveto 0 SC 3 -1 roll X widthshow Y } def /K { 0 exch rmoveto 0 exch X ashow Y } def /L { 0 exch rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def /M { rmoveto X show Y } def /N { rmoveto 0 SC 3 -1 roll X widthshow Y } def /O { rmoveto 0 exch X ashow Y } def /P { rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def /Q { moveto X show Y } def /R { moveto 0 SC 3 -1 roll X widthshow Y } def /S { moveto 0 exch X ashow Y } def /T { moveto 0 exch 0 SC 5 2 roll X awidthshow Y } def end .. \# .if !n \Y[ul*ps] .if n .color 0 .nr TOC.RELOCATE 0 \" TOC.RELOCATE is off by default .ds PDFHREF.TEXTCOL.DEFAULT 0.0 0.3 0.9 \# \# ==================================================================== \# \# TYPESETTING MACROS, STRINGS, AND ALIASES \# ======================================== \# \# +++ALIASES+++ \# \# Alias .als as ALIAS, and .aln (number registers) as ALIASN \# .als ALIAS als .als ALIASN aln \# \# ALIASES FOR GROFF REQUESTS \# -------------------------- \# .ALIAS MAC de .ALIAS BR br .ALIAS SPREAD brp .ALIAS ESC_CHAR ec .ALIAS STRING ds .ALIAS INCLUDE so \# \# ALIASES FOR NUMBER REGISTERS \# ---------------------------- \# .ALIASN #PT_SIZE .ps \"fractional point size in units .ALIASN #DIVER_DEPTH dn \"diversion depth .ALIASN #DIVER_WIDTH dl \"diversion width .ALIASN #TRAP_DISTANCE .t \"distance to next trap .ALIASN #LEAD .v \"line space .ALIASN #PAGE_LENGTH .p \"page length .ALIASN #NUM_ARGS .$ \"number of arguments passed to a macro .ALIASN #INDENT .i \"value of current indent \# \# ==================================================================== \# \# MISCELLANEOUS \# ============= .nr #L_MARGIN \n[.o] \" Tabs, etc require #L_MARGIN .cflags 4 /\[en] \" So slash and en-dashes get broken \# \# ==================================================================== \# \# +++PAGE LAYOUT+++ \# \# Macros that control the physical layout of the page: paper size \# and margins. \# \# PAGE WIDTH \# ---------- \# *Argument: \# \# *Function: \# Stores user supplied page width in register #PAGE_WIDTH. \# *Notes: \# #PAGE_WIDTH is used to establish the default LL (and right margin). \# Requires unit of measure. \# .MAC PAGEWIDTH END . br . nr #PAGE_WIDTH \\$1 . if !r#L_MARGIN .L_MARGIN \\n[.o] . if !r#R_MARGIN .R_MARGIN 1i . if '\\*[.T]'pdf' \X'papersize=\\n[#PAGE_WIDTH]z,\\n[#PAGE_LENGTH]z'\c .END \# \# L_MARGIN \# -------- \# *Argument: \# \# *Function: \# Stores user supplied page offset in register #L_MARGIN. \# Sets .po to user supplied offset. \# *Notes: \# Requires unit of measure. \# .MAC L_MARGIN END . br . nr #L_MARGIN (\\$1) . po \\n[#L_MARGIN]u .END \# \# R_MARGIN \# -------- \# *Argument: \# \# *Function: \# Stores user supplied right margin in register #R_MARGIN. \# *Notes: \# This is a pseudo-margin. Right margin is actually a function of \# line length. The macro calculates line length from the page offset \# and the value plugged into #R_MARGIN. \# \# N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN. \# \# Requires unit of measure. \# .MAC R_MARGIN END . br . nr #R_MARGIN (\\$1) . ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u . ta \\n[.l]u . nr #L_LENGTH \\n[.l] .END \# \# T_MARGIN \# -------- \# *Argument: \# \# *Function: \# Stores the user supplied top margin in register #T_MARGIN. \# Advances user supplied depth from the top of the page. \# *Notes: \# Requires unit of measure. \# .MAC T_MARGIN END . nr #T_MARGIN (\\$1) . nr #TOP 1 . if !\\n[#DOCS] .sp |\\n[#T_MARGIN]u-1v . wh 0i DO_T_MARGIN .END \# \# B_MARGIN \# -------- \# *Argument: \# \# *Function: \# Stores the user supplied bottom margin in register #B_MARGIN. \# *Notes: \# Requires unit of measure. \# .MAC B_MARGIN END . br . nr #B_MARGIN (\\$1) . nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN] . nr #B_MARGIN_SET 1 . wh -\\n[#B_MARGIN]u DO_B_MARGIN .END \# \# PAGE \# ---- \# *Arguments: \# [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]] \# *Function: \# Page set-up. Collects arguments and passes them to the appropriate \# macros. \# *Notes: \# All arguments after pagewidth are optional, but must appear \# in the order given above. (User can fill in as much or as \# little as desired.) \# \# All arguments require a unit of measure. \# .MAC PAGE END . br . PAGEWIDTH \\$1 . PAGELENGTH \\$2 . ie '\\$3'' .L_MARGIN \\n[.o] . el .L_MARGIN \\$3 . ie '\\$4'' .R_MARGIN 1i . el .R_MARGIN \\$4 . if !'\\$5'' .T_MARGIN \\$5 . if !'\\$6'' .B_MARGIN \\$6 .END \# \# gropdf: pass pagelength to postprocessor; no need for -P-p \# .MAC PAGELENGTH END . pl \\$* . if '\\*[.T]'pdf' \X'papersize=\\n[#PAGE_WIDTH]z,\\n[#PAGE_LENGTH]z'\c .END \# \# ===================================================================== \# \# +++PAGE CONTROL+++ \# \# Generic macros for breaking pages. \# \# DO_T_MARGIN \# ----------- \# *Argument: \# \# *Function: \# Plants the top margin at the top of each page. \# *Notes: \# The trap is set in .T_MARGIN or .PAGE \# .MAC DO_T_MARGIN END . ev T_MARGIN . nr #TOP 1 . sp |\\n[#T_MARGIN]u-1v . ev . sp -\\n[#T_MARGIN_LEAD_ADJ]u .END \# \# DO_B_MARGIN \# ----------- \# *Argument: \# \# *Function: \# Plants the bottom margin at the bottom of each page. \# *Notes: \# The trap is set in .B_MARGIN or .PAGE. \# .MAC DO_B_MARGIN END . nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000 ' bp . if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap' .END \# \# NEWPAGE \# ------- \# *Argument: \# \# *Function: \# Breaks to a new page. \# *Notes: \# If a B_MARGIN has been set, processes that, otherwise, just \# breaks to a new page. \# .MAC NEWPAGE END . if \\n[.vpt]=0 .vpt . ie \\n[#NO_BREAK] \{\ ' br . rr #NO_BREAK . \} . el .br . nr #NEWPAGE 1 . nr @TOP 1 . ie \\n[#B_MARGIN_SET]=1 \{\ . ie !\\n[#DOCS]=1 \{\ . ev NP . DO_B_MARGIN . ev . \} . el \{\ . if \\n[#COLUMNS]=1 .nr #COL_NUM \\n[#NUM_COLS] . ie !\\n[#FN_DEPTH] \{\ . ch FN_OVERFLOW_TRAP . DO_FOOTER . wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP . \} . el .DO_B_MARGIN . \} . \} . el 'bp .END \# \# ===================================================================== \# \# +++GENERAL STYLE MACROS+++ \# \# LINE LENGTH \# ----------- \# *Argument: \# \# *Function: \# Stores user supplied line length in register #L_LENGTH. \# Sets .ll to #L_LENGTHu \# *Notes: \# Requires unit of measure. \# .MAC LL END . nr #USER_SET_L_LENGTH 1 . ll \\$1 . nr #L_LENGTH \\n[.l] . ta \\n[.l]u .END \# \# +++FAMILY AND FONT+++ \# \# FALLBACK FONT \# ------------- \# *Argument: \# [ ABORT | WARN ] | ABORT | WARN \# *Function: \# Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font \# called "dummy" at font position 0. \# *Notes: \# Calls to non-existent families cause mom to continue processing \# files using the fallback font until a valid family is entered. \# \# Calls to non-existent fonts generate warnings. If ABORT is passed \# to FALLBACK_FONT, mom stops processing files after the warning. \# Otherwise, she continues to process files using the fallback font \# after the warning is issued. The default fallback font is CR; the \# default for font warnings is to abort. \# .MAC FALLBACK_FONT END . if \\n[#NUM_ARGS]=1 \{\ . if '\\$1'ABORT' .nr #ABORT_FT_ERRORS 1 . if '\\$1'WARN' \ . if r #ABORT_FT_ERRORS .nr #ABORT_FT_ERRORS 0 . if !'\\$1'ABORT' \ . if !'\\$1'WARN' .fp 0 dummy \\$1 . \} . if \\n[#NUM_ARGS]=2 \{\ . fp 0 dummy \\$1 . if '\\$2'ABORT' .nr #ABORT_FT_ERRORS 1 . if '\\$2'WARN' .nr #ABORT_FT_ERRORS 0 . \} .END \# .FALLBACK_FONT CR ABORT \# \# FAMILY \# ------ \# *Argument: \# \# *Function: \# Stores user supplied font family in string $FAMILY. Sets .fam \# to $FAMILY. \# .MAC FAMILY END . ds $FAMILY \\$1 . if \\n[#PRINT_STYLE]=1 \{\ . fam \\*[$TYPEWRITER_FAM] . return . \} . if \\n[#IGNORE] \{\ . fam \\*[$TYPEWRITER_FAM] . return . \} . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) .ds $SAVED_STYLE \\n[.sty] . ft 0 . fam \\*[$FAMILY] . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\ . ft \\*[$SAVED_STYLE] . if !F\\n[.fn] .ft 0 . \} . ie \\n[#PRE_COLLATE]=1 . . el \{\ . if \\n[#COLLATE]=1 \ . if !r#START .ds $DOC_FAM \\*[$FAMILY] . \} .END \# \# FONT \# ---- \# *Argument: \# R | I | B | BI | \# *Function: \# Stores user supplied font in $FONT and sets .ft to $FONT. \# .MAC FT END . ds $FONT \\$1 . if \\n[#PRINT_STYLE]=1 \{\ . ie '\\$1'I' \{\ . if \\n[#UNDERLINE_ITALIC]=1 \{\ . UNDERLINE . return . \} . if \\n[#ITALIC_MEANS_ITALIC]=1 \{\ . ds $FONT \\$1 . ft \\*[$FONT] . return . \} . \} . el .UNDERLINE OFF . return . \} . ft 0 . ft \\*[$FONT] . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\ . if '\\n[.sty]'' \{\ . if !F\\n[.fn] \{\ . if !S\\*[$FONT] \{\ . tm1 "[mom]: Font style "\\*[$FONT]" at line \\n[.c] has not been registered. . ie \\n[#ABORT_FT_ERRORS]=0 \ . tm1 " Continuing to process using fallback font. . el .ab Aborting '\\n[.F]' at \\$0, line \\n[.c]. . \} . if \\n[.f]=0 \{\ . tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n[.c] does not exist in family "\\n[.fam]", . tm1 " or family "\\n[.fam]" has not been installed. . ie \\n[#ABORT_FT_ERRORS]=0 \ . tm1 " Continuing to process using fallback font. . el .ab Aborting '\\n[.F]' at \\$0, line \\n[.c]. . \} . \} . \} . \} .END \# \# POINT SIZE \# ---------- \# *Arguments: \# \# *Function: \# Sets point size to user supplied value in scaled points. \# If #AUTO_LEAD is on, resets lead accordingly. \# *Notes: \# Must NOT use a unit of measure. \# .MAC PT_SIZE END . if \\n[#PRINT_STYLE]=1 .return . if \\n[#IGNORE] .return . ps \\$1 . nr #PT_SIZE_IN_UNITS \\n[.ps] . ie '\\$0'DOC_PT_SIZE' \{\ . if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0 . br . nr #NEW_DOC_PT_SIZE \\n[.ps] . if \\n[#DOC_AUTOLEAD] \{\ . ie !\\n[#DOC_AUTOLEAD_FACTOR] .nr #AUTOLEADING \\n[#DOC_AUTOLEAD] . el .nr #AUTOLEADING \\n[.ps]*\\n[#DOC_AUTOLEAD]/1000-\\n[.ps] . nr #DOC_LEAD \\n[.ps]+\\n[#AUTOLEADING] . nr #RESET_TRAPS 1 . \} . \} . el .if \\n[#AUTO_LEAD] .vs \\n[.ps]u+\\n[#AUTOLEADING]u .END \# \# SIZE (inline) \# ------------- \# *Arguments: \# \# *Function: \# Sets point size to user supplied value in scaled points. \# Intended to be called inline with \*[SIZE ] \# *Notes: \# Can be used with a unit of measure or not. \# .MAC SIZE END \c .ps \\$1 .END \# \# LEADING \# ------- \# *Argument: \# \# *Function: \# Turns off #AUTOLEAD if it's on. \# Sets .vs to user supplied value. \# *Notes: \# Does not require unit of measure. LS automatically turns off AUTOLEAD. \# .MAC LS END . br . nr #OLD_LEAD \\n[.v] . if \\n[#PRINT_STYLE]=1 .return . if \\n[#IGNORE] .return . if \\n[#AUTO_LEAD] \{\ . rr #AUTO_LEAD . rr #AUTOLEAD_VALUE . rr #AUTOLEADING . \} . vs \\$1 . if \\n[.t]<\\n[.v] 'bp . if \\n[#TOP] \{\ . nr #TOP_BASELINE_ADJ \\n[.v]-\\n[#OLD_LEAD] . sp -\\n[#TOP_BASELINE_ADJ]u . rr #TOP . rr #TOP_BASELINE_ADJ . \} .END \# \# AUTOLEAD \# -------- \# *Argument: \# [FACTOR] \# *Function: \# Stores user supplied auto-lead value in register #AUTOLEAD_VALUE. \# Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading. \# All subsequent PT_SIZE requests reset the leading in the same way until \# AUTOLEAD is turned off. \# *Notes: \# With the optional FACTOR argument, the current point size is \# multiplied by #AUTOLEAD_VALUE/1000 instead of the two being added \# together. \# .MAC AUTOLEAD END . if \\n[#PRINT_STYLE]=1 .return . if \\n[#IGNORE] .return . nr #AUTO_LEAD 1 \" autolead on or off . nr #OLD_LEAD \\n[.v] . nr #AUTOLEAD_VALUE (p;\\$1) \" arg x 1000 . ie '\\$2'FACTOR' \{\ . if !\\n[#DOCS] .nr #DOC_AUTOLEAD_FACTOR \\n[#AUTOLEAD_VALUE] \" save for DOC_PT_SIZE . nr #AUTOLEADING \\n[.ps]*\\n[#AUTOLEAD_VALUE]/1000-\\n[.ps] . \} . el .nr #AUTOLEADING \\n[#AUTOLEAD_VALUE] . vs \\n[.ps]u+\\n[#AUTOLEADING]u . if \\n[#TOP] \{\ . nr #TOP_BASELINE_ADJ \\n[.v]-\\n[#OLD_LEAD] . sp -\\n[#TOP_BASELINE_ADJ]u . rr #TOP . rr #TOP_BASELINE_ADJ . \} .END \# \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE \# ------------------------------------------------ .ds ROM \Ef[R] .ds IT \Ef[I] .ds BD \Ef[B] .ds BDI \Ef[BI] .ds PREV \Ef[] .ds S \Es \# \# ===================================================================== \# \# +++KERNING+++ \# \# AUTOMATIC PAIRWISE KERNING \# -------------------------- \# *Arguments: \# | \# *Function: \# Turns automatic pairwise kerning on or off. \# .MAC KERN END . ie '\\$1'' \{\ . kern . nr #KERN 1 . \} . el \{\ . kern 0 . nr #KERN 0 . \} .END \# \# INLINE KERNING AND HORIZONTAL MOVEMENT \# -------------------------------------- \# \# Inline kerning provides a simple way to adjust the amount of \# space between any two letters. It's predicated on a unit of \# measure "U", which, by default, is 1/36 of the current point \# size as returned by \n[.ps]; e.g., if the current point size is \# 18, \n[.ps] returns 18000u, therefore U=500u. Since U remains \# proportional relative to the current point size, the amount of \# kerning between two letters as expressed in Us remains visually \# similar regardless of changes in point size. \# \# The default value for U may be changed or reset with the \# KERN_UNIT macro. \# .MAC KERN_UNIT END . ie '\\$1'DEFAULT' .nr #KERN_UNIT 36 . el .nr #KERN_UNIT \\$1 .END \# .nr #KERN_UNIT 36 .ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)' .ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)' \# \# Initialize strings for pre-1.1.3c-style BU and FU \# .nr #LOOP 0 1 .while \n+[#LOOP]<37 \{\ . ds BU\n[#LOOP] \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)' .\} \# .nr #LOOP 0 1 .while \n+[#LOOP]<37 \{\ . ds FU\n[#LOOP] \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)' .\} .rr #LOOP \# \# Horizontal movements \# -------------------- \# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the \# specified number of points. \# .ds BCK \h'-\\$1' .ds FWD \h'\\$1' \# .ds BP.25 \h'-.25' .ds BP.5 \h'-.5' .ds BP.75 \h'-.75' .ds BP1 \h'-1p' .ds BP1.25 \h'-1.25p' .ds BP1.5 \h'-1.5p' .ds BP1.75 \h'-1.75p' .ds BP2 \h'-2p' .ds BP2.25 \h'-2.25p' .ds BP2.5 \h'-2.5p' .ds BP2.75 \h'-2.75p' .ds BP3 \h'-3p' .ds BP3.25 \h'-3.25p' .ds BP3.5 \h'-3.5p' .ds BP3.75 \h'-3.75p' .ds BP4 \h'-4p' .ds BP4.25 \h'-4.25p' .ds BP4.5 \h'-4.5p' .ds BP4.75 \h'-4.75p' .ds BP5 \h'-5p' .ds BP5.25 \h'-5.25p' .ds BP5.5 \h'-5.5p' .ds BP5.75 \h'-5.75p' .ds BP6 \h'-6p' .ds BP6.25 \h'-6.25p' .ds BP6.5 \h'-6.5p' .ds BP6.75 \h'-6.75p' .ds BP7 \h'-7p' .ds BP7.25 \h'-7.25p' .ds BP7.5 \h'-7.5p' .ds BP7.75 \h'-7.75p' .ds BP8 \h'-8p' .ds BP8.25 \h'-8.25p' .ds BP8.5 \h'-8.5p' .ds BP8.75 \h'-8.75p' .ds BP9 \h'-9p' .ds BP9.25 \h'-9.25p' .ds BP9.5 \h'-9.5p' .ds BP9.75 \h'-9.75p' .ds BP10 \h'-10p' .ds BP10.25 \h'-10.25p' .ds BP10.5 \h'-10.5p' .ds BP10.75 \h'-10.75p' .ds BP11 \h'-11p' .ds BP11.25 \h'-11.25p' .ds BP11.5 \h'-11.5p' .ds BP11.75 \h'-11.75p' .ds BP12 \h'-12p' .ds BP12.25 \h'-12.25p' .ds BP12.5 \h'-12.5p' .ds BP12.75 \h'-12.75p' \# .ds FP.25 \h'.25' .ds FP.5 \h'.5' .ds FP.75 \h'.75' .ds FP1 \h'1p' .ds FP1.25 \h'1.25p' .ds FP1.5 \h'1.5p' .ds FP1.75 \h'1.75p' .ds FP2 \h'2p' .ds FP2.25 \h'2.25p' .ds FP2.5 \h'2.5p' .ds FP2.75 \h'2.75p' .ds FP3 \h'3p' .ds FP3.25 \h'3.25p' .ds FP3.5 \h'3.5p' .ds FP3.75 \h'3.75p' .ds FP4 \h'4p' .ds FP4.25 \h'4.25p' .ds FP4.5 \h'4.5p' .ds FP4.75 \h'4.75p' .ds FP5 \h'5p' .ds FP5.25 \h'5.25p' .ds FP5.5 \h'5.5p' .ds FP5.75 \h'5.75p' .ds FP6 \h'6p' .ds FP6.25 \h'6.25p' .ds FP6.5 \h'6.5p' .ds FP6.75 \h'6.75p' .ds FP7 \h'7p' .ds FP7.25 \h'7.25p' .ds FP7.5 \h'7.5p' .ds FP7.75 \h'7.75p' .ds FP8 \h'8p' .ds FP8.25 \h'8.25p' .ds FP8.5 \h'8.5p' .ds FP8.75 \h'8.75p' .ds FP9 \h'9p' .ds FP9.25 \h'9.25p' .ds FP9.5 \h'9.5p' .ds FP9.75 \h'9.75p' .ds FP10 \h'10p' .ds FP10.25 \h'10.25p' .ds FP10.5 \h'10.5p' .ds FP10.75 \h'10.75p' .ds FP11 \h'11p' .ds FP11.25 \h'11.25p' .ds FP11.5 \h'11.5p' .ds FP11.75 \h'11.75p' .ds FP12 \h'12p' .ds FP12.25 \h'12.25p' .ds FP12.5 \h'12.5p' .ds FP12.75 \h'12.75p' \# \# WHOLE LINE (TRACK) KERNING \# -------------------------- \# *Argument: \# \# *Function: \# Invokes .tkf (track kerning) for the current font with \# 1 as both the upper and lower point size limits, so that \# the value entered by the user applies regardless of point \# size. RW ("Reduce Whitespace") reduces the amount of space \# between all characters by an equal amount. EW ("Extra \# Whitespace") increases the amount of space. \# *Notes: \# Decimal values are acceptable. \# \# A value of 1 will produce an unacceptably tight or loose line \# at most text point sizes; therefore, effective use of RW and \# EW is in the fractional range below 1. \# \# \n[.f] holds the current font number, which is acceptable to .tkf. \# \# RW and EW must be reset to 0 to cancel their effect on subsequent \# output lines. \# .MAC RW END . if \\n[#BR_AT_LINE_KERN] \{\ . ie \\n[#JUSTIFY]=1 .brp . el .br . \} . rr #EW . rm $EW . nr #RW 1 . ds $RW \\$1 . tkf \\n[.f] 1 -\\$1 1 -\\$1 .END \# .MAC EW END . if \\n[#BR_AT_LINE_KERN] \{\ . ie \\n[#JUSTIFY]=1 .brp . el .br . \} . rr #RW . rm $RW . nr #EW 1 . ds $EW \\$1 . tkf \\n[.f] 1 \\$1 1 \\$1 .END \# \# BREAK AT LINE KERN \# ------------------ \# *Arguments: \# toggle \# *Function: \# Enables/disables .br's before .RW and .EW \# *Notes: \# Mostly, users will want .br's before any kind of line kerning, but \# there may be cases where they don't. BR_AT_LINE_KERN is off by \# default and must be invoked explicitly. \# .MAC BR_AT_LINE_KERN END . ie '\\$1'' .nr #BR_AT_LINE_KERN 1 . el .rr #BR_AT_LINE_KERN .END \# \# ===================================================================== \# \# +++HYPHENATION+++ \# \# AUTO HYPHENATION \# ---------------- \# *Arguments: \# | | DEFAULT \# or \# LINES | MARGIN | SPACE \# *Function: \# Turns auto hyphenation on or off, resets the hyphenation style \# to default, or permits the setting of various hyphenation \# parameters. \# *Notes: \# HY, by itself, defaults to .hy 14, i.e. no hyphens after the \# first two or before the last two characters of a word, and no \# hyphenation of the last line prior to a trap (e.g., at the \# bottom of a page). \# \# HY DEFAULT resets the hyphenation style to .hy 14 (see \# above) if that behaviour is desired after changes have been \# made to LINES, MARGIN, or SPACE. \# \# HY LINES sets the number of allowable consecutive hyphenated lines. \# \# HY MARGIN sets the amount of space (ipPcm) allowed at the end \# of a line in QUAD mode before hyphenation is tripped (e.g. if there's \# only 6 points left, groff won't try to hyphenate the next word). \# \# HY SPACE sets the amount of extra interword space (ipPcm) that can \# be added in JUSTIFY mode to prevent a line from being hyphenated. \# .MAC HY END . ie '\\$1'' \{\ . hy 14 . if \\n[#LINES] .hlm \\n[#LINES] . if \\n[#MARGIN] .hym \\n[#MARGIN]] . if \\n[#SPACE] .hys \\n[#SPACE] . nr #HYPHENATE 1 . \} . el \{\ . if !'\\$1'LINES' \{\ . nh . nr #HYPHENATE 0 . \} . if !'\\$1'MARGIN' \{\ . nh . nr #HYPHENATE 0 . \} . if !'\\$1'SPACE' \{\ . nh . nr #HYPHENATE 0 . \} . if !'\\$1'DEFAULT' \{\ . nh . nr #HYPHENATE 0 . \} . if '\\$1'LINES' \{\ . hlm \\$2 . nr #HY_LINES \\$2 . \} . if '\\$1'MARGIN' \{\ . hym \\$2 . nr #HY_MARGIN \\$2 . \} . if '\\$1'SPACE' \{\ . hys \\$2 . nr #HY_SPACE \\$2 . \} . if '\\$1'DEFAULT' \{\ . hlm -1 . hym 0 . hys 0 . rr #HY_LINES . rr #HY_SPACE . rr #HY_MARGIN . \} . \} .END \# \# HYPHENATION PARAMETERS \# ---------------------- \# *Arguments: \# <# of lines> | | \# *Function: \# Allows user to specify .HY LINES, MARGIN, and SPACE with a single command. \# .MAC HY_SET END . nr #HY_SET 1 . hlm \\$1 . hym \\$2 . hys \\$3 .END \# \# ===================================================================== \# \# +++VERTICAL SPACING+++ \# \# ADVANCE LEAD \# ------------ \# *Argument: \# \# *Function: \# Creates or modifies register #ALD. Adds user supplied lead \# below current baseline. \# *Notes: \# Requires a unit of measure. \# .MAC ALD END . br . if \\n[nl]=0 .nr #TOP 1 . if '\\$0'ALD' \{\ . nr #ALD (\\$1) . sp \\n[#ALD]u . \} . if '\\$0'ADD_SPACE' \{\ . vpt 0 . nr #ALD (\\$1) . rs . nop \& . sp |\\n[#T_MARGIN]u-1v+\\n[#ALD]u . rr @TOP . nr #SPACE_ADDED 1 . vpt . \} . if '\\$0'SPACE' .sp \\$1 . if '\\$0'SP' .sp \\$1 .END \# \# REVERSE LEAD \# ------------ \# *Argument: \# \# *Function: \# Creates or modifies register #RLD. Reverses user supplied \# lead above current baseline. \# *Notes: \# Requires a unit of measure. \# .MAC RLD END . br . nr #RLD (\\$1) . sp -\\n[#RLD]u .END \# \# ALD/RLD STRINGS \# --------------- \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding \# \*[RLD] forms have been left in for backward compatibility with \# documents created using mom-1.1.3c or earlier. The preferred methods \# of advancing and reversing on the page inline are \*[UP ] \# and \*[DOWN ]. \# .ds DOWN \v'\\$1' .ds UP \v'-\\$1' \# .ds ALD.25 \v'.25p' .ds ALD.5 \v'.5p' .ds ALD.75 \v'.75p' .ds ALD1 \v'1p' .ds ALD1.25 \v'1.25p' .ds ALD1.5 \v'1.5p' .ds ALD1.75 \v'1.75p' .ds ALD2 \v'2p' .ds ALD2.25 \v'2.25p' .ds ALD2.5 \v'2.5p' .ds ALD2.75 \v'2.75p' .ds ALD3 \v'3p' .ds ALD3.25 \v'3.25p' .ds ALD3.5 \v'3.5p' .ds ALD3.75 \v'3.75p' .ds ALD4 \v'4p' .ds ALD4.25 \v'4.25p' .ds ALD4.5 \v'4.5p' .ds ALD4.75 \v'4.75p' .ds ALD5 \v'5p' .ds ALD5.25 \v'5.25p' .ds ALD5.5 \v'5.5p' .ds ALD5.75 \v'5.75p' .ds ALD6 \v'6p' .ds ALD6.25 \v'6.25p' .ds ALD6.5 \v'6.5p' .ds ALD6.75 \v'6.75p' .ds ALD7 \v'7p' .ds ALD7.25 \v'7.25p' .ds ALD7.5 \v'7.5p' .ds ALD7.75 \v'7.75p' .ds ALD8 \v'8p' .ds ALD8.25 \v'8.25p' .ds ALD8.5 \v'8.5p' .ds ALD8.75 \v'8.75p' .ds ALD9 \v'9p' .ds ALD9.25 \v'9.25p' .ds ALD9.5 \v'9.5p' .ds ALD9.75 \v'9.75p' .ds ALD10 \v'10p' .ds ALD10.25 \v'10.25p' .ds ALD10.5 \v'10.5p' .ds ALD10.75 \v'10.75p' .ds ALD11 \v'11p' .ds ALD11.25 \v'11.25p' .ds ALD11.5 \v'11.5p' .ds ALD11.75 \v'11.75p' .ds ALD12 \v'12p' .ds ALD12.25 \v'12.5p' .ds ALD12.5 \v'12.5p' .ds ALD12.75 \v'12.75p' \# .ds RLD.25 \v'-.25p' .ds RLD.5 \v'-.5p' .ds RLD.75 \v'-.75p' .ds RLD1 \v'-1p' .ds RLD1.25 \v'-1.25p' .ds RLD1.5 \v'-1.5p' .ds RLD1.75 \v'-1.75p' .ds RLD2 \v'-2p' .ds RLD2.25 \v'-2.25p' .ds RLD2.5 \v'-2.5p' .ds RLD2.75 \v'-2.75p' .ds RLD3 \v'-3p' .ds RLD3.25 \v'-3.25p' .ds RLD3.5 \v'-3.5p' .ds RLD3.75 \v'-3.75p' .ds RLD4 \v'-4p' .ds RLD4.25 \v'-4.25p' .ds RLD4.5 \v'-4.5p' .ds RLD4.75 \v'-4.75p' .ds RLD5 \v'-5p' .ds RLD5.25 \v'-5.25p' .ds RLD5.5 \v'-5.5p' .ds RLD5.75 \v'-5.75p' .ds RLD6 \v'-6p' .ds RLD6.25 \v'-6.25p' .ds RLD6.5 \v'-6.5p' .ds RLD6.75 \v'-6.75p' .ds RLD7 \v'-7p' .ds RLD7.25 \v'-7.25p' .ds RLD7.5 \v'-7.5p' .ds RLD7.75 \v'-7.75p' .ds RLD8 \v'-8p' .ds RLD8.25 \v'-8.25p' .ds RLD8.5 \v'-8.5p' .ds RLD8.75 \v'-8.75p' .ds RLD9 \v'-9p' .ds RLD9.25 \v'-9.25p' .ds RLD9.5 \v'-9.5p' .ds RLD9.75 \v'-9.75p' .ds RLD10 \v'-10p' .ds RLD10.25 \v'-10.25p' .ds RLD10.5 \v'-10.5p' .ds RLD10.75 \v'-10.75p' .ds RLD11 \v'-11p' .ds RLD11.25 \v'-11.25p' .ds RLD11.5 \v'-11.5p' .ds RLD11.75 \v'-11.75p' .ds RLD12 \v'-12p' .ds RLD12.25 \v'-12.5p' .ds RLD12.5 \v'-12.5p' .ds RLD12.75 \v'-12.75p' \# \# ===================================================================== \# \# +++REFINEMENTS+++ \# \# AUTOMATIC LIGATURES \# ------------------- \# *Arguments: \# | \# *Function: \# Turns automatic ligature generation on or off. \# *Notes: \# Ligatures may be supplied manually with \[fi], \[fl], etc. \# .MAC LIGATURES END . ie '\\$1'' \{\ . lg . nr #LIGATURES 1 . \} . el \{\ . lg 0 . nr #LIGATURES 0 . \} .END \# \# SMARTQUOTES \# ----------- \# *Arguments: \# [ ,, ] | [ << ] | [ >> ] | \# or \# [ DA | DE | EN | ES | FR | IT | NL | NO | PT | SV ] | \# *Function: \# Turns smartquotes on (optionally with a quoting style from the \# argument list, or off). \# If no quoting style is given, then EN (English) is used by default. \# If no quoting style is given and smart quotes have been turned off \# previously, the old quoting style will be restored. \# *Notes: \# The " character is read outside the macro when mom is \# processed. The strings for open/close ($QUOTE) are then \# defined in the macro. \# .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])' .nr #SQ_ON 0 \# .MAC SMARTQUOTES END .\" First " will be translated to $QUOTE0 . nr #OPEN_CLOSE 0 . if '\\$1'' \{\ . if !'\\*[$RESTORE_SQ]'' \{\ . SMARTQUOTES \\*[$RESTORE_SQ] . return . \} .\" Default smart quotes (English) . ds $QUOTE0 \[lq] . ds $QUOTE1 \[rq] . ds $RESTORE_SQ EN . nr #SQ_ON 1 . return . \} . if '\\$1',,' \{\ . ds $QUOTE0 \[Bq] . ds $QUOTE1 \[lq] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'<<' \{\ . ds $QUOTE0 \[Fo] . ds $QUOTE1 \[Fc] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'>>' \{\ . ds $QUOTE0 \[Fc] . ds $QUOTE1 \[Fo] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'DA' \{\ . ds $QUOTE0 \[Fc] . ds $QUOTE1 \[Fo] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'DE' \{\ . ds $QUOTE0 \[Bq] . ds $QUOTE1 \[lq] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'EN' \{\ . ds $QUOTE0 \[lq] . ds $QUOTE1 \[rq] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'ES' \{\ . ds $QUOTE0 \[lq] . ds $QUOTE1 \[rq] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'FR' \{\ . ds $QUOTE0 \[Fo]\| . ds $QUOTE1 \|\[Fc] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'IT' \{\ . ds $QUOTE0 \[Fo]\| . ds $QUOTE1 \|\[Fc] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'NL' \{\ . ds $QUOTE0 \[rq] . ds $QUOTE1 \[rq] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'NO' \{\ . ds $QUOTE0 \[Fo] . ds $QUOTE1 \[Fc] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'PT' \{\ . ds $QUOTE0 \[Fo] . ds $QUOTE1 \[Fc] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} . if '\\$1'SV' \{\ . ds $QUOTE0 \[Fc] . ds $QUOTE1 \[Fc] . ds $RESTORE_SQ \\$1 . nr #SQ_ON 1 . return . \} .\" None of the above -> turn smartquotes off . ds $QUOTE0 \[dq] . ds $QUOTE1 \[dq] . nr #SQ_ON 0 .END \# .ds $QUOTE0 \[lq] .ds $QUOTE1 \[rq] \# \# Strings for foot and inch marks \# .ds FOOT \[fm] .ds INCH \[fm]\[fm] \# \# ===================================================================== \# \# +++LINE BREAKS+++ \# \# NO-SPACE BREAK \# -------------- \# *Argument: \# \# *Function: \# Breaks a line without advancing. \# *Notes: \# EL is the mnemonic used on older, dedicated typesetting machines \# to indicate "process the line, without advancing the galley \# medium." It stands for End Line. \# \# The \c inline must be appended to the end of input lines when in \# nofill mode; in fill modes, the \c inline must not be used. \# .MAC EL END . TRAP OFF . if \\n[#PSEUDO_FILL]=1 \& . br . sp -1v . TRAP .END \# \# An inline escape to accomplish the same thing. \# Preferable, since it works with filled and non-filled copy and \# doesn't require the user to remember whether to use (or not use) \# \c. \# .ds B \h'|0'\R'#NO_ADVANCE 1'\c \# \# ===================================================================== \# \# +++FILLING/QUADDING/JUSTIFYING+++ \# \# JUSTIFY \# ------- \# *Argument: \# \# *Function: \# Turns fill on and sets .ad to b. \# *Notes: \# Justifies text left and right. \# .MAC JUSTIFY END . if \\n[#TAB_ACTIVE]=0 \{\ . nr #QUAD 1 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE] . \} ' ce 0 . QUAD J . if \\n[#PRINT_STYLE]=1 .QUAD L . nr #PSEUDO_FILL 0 .END \# \# QUAD \# ---- \# *Arguments: \# L | LEFT | R | RIGHT | C | CENTER/CENTRE \# *Function: \# Turns fill on and sets .ad to l, r, or c. \# *Notes: \# Terminology is a problem here. Some people call quad left \# left justified, flush left, or flush left/rag right (and the \# reverse for quad right). Quad center is sometimes called rag \# both. For our purposes, all "quad" modes mean that groff fill \# mode is enabled. \# .MAC QUAD END . ds $QUAD_VALUE \\$1 . if \\n[#TAB_ACTIVE]=0 \{\ . nr #QUAD 1 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE] . \} ' ce 0 ' fi . if '\\*[$QUAD_VALUE]'L' \{\ . nr #JUSTIFY 0 . ad l . \} . if '\\*[$QUAD_VALUE]'LEFT' \{\ . nr #JUSTIFY 0 . ad l . \} . if '\\*[$QUAD_VALUE]'R' \{\ . nr #JUSTIFY 0 . ad r . \} . if '\\*[$QUAD_VALUE]'RIGHT' \{\ . nr #JUSTIFY 0 . ad r . \} . if '\\*[$QUAD_VALUE]'C' \{\ . nr #JUSTIFY 0 . ad c . \} . if '\\*[$QUAD_VALUE]'CENTER' \{\ . nr #JUSTIFY 0 . ad c . \} . if '\\*[$QUAD_VALUE]'CENTRE' \{\ . nr #JUSTIFY 0 . ad c . \} . if '\\*[$QUAD_VALUE]'J' \{\ . nr #JUSTIFY 1 . ad b . \} . if '\\*[$QUAD_VALUE]'JUSTIFY' \{\ . nr #JUSTIFY 1 . ad b . \} . nr #PSEUDO_FILL 0 .END \# \# LEFT, RIGHT, AND CENTER \# ----------------------- \# The purpose of these macros is to allow the user to enter lines \# of text that will be quadded LRC having to stick .BR or .br \# between lines. For the sake of consistency, all three appear to \# behave similarly (from the point of view of the user), although \# the underlying primitives don't. For this reason, LEFT, RIGHT, \# and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY to \# restore text to fill mode. \# \# LEFT \# ---- \# *Argument: \# \# *Function: \# Turns fill mode off. Allows user to quad lines left without \# requiring the .BR or .br macro. \# *Notes: \# LEFT simply turns fill off. Lines that exceed the current LL \# will not be broken. Note that this behaviour differs from the \# RIGHT and CENTER macros. \# .MAC LEFT END . if \\n[#TAB_ACTIVE]=0 \{\ . rr #QUAD . ds $RESTORE_QUAD_VALUE LEFT . \} . ce 0 . nf . nr #PSEUDO_FILL 1 .\" Fix for a little conflict with DOCTYPE LETTER . if '\\n[.z]'LETTERHEAD1' .rr #DATE_FIRST .END \# \# RIGHT \# ----- \# *Argument: \# \# *Function: \# Turns fill on. Allows user to quad lines right without \# requiring the .BR or .br macro. \# *Notes: \# Lines that exceed the current LL will be broken, with the excess \# text quadded right. \# .MAC RIGHT END . if \\n[#TAB_ACTIVE]=0 \{\ . rr #QUAD . ds $RESTORE_QUAD_VALUE RIGHT . \} . nf . rj 100000 . nr #PSEUDO_FILL 1 .END \# \# CENTER \# ------ \# *Argument: \# \# *Function: \# Turns fill on. Allows user to center lines without \# requiring the .BR or .br macro. \# *Notes: \# Lines that exceed the current LL will be broken, with the excess \# text centered. \# .MAC CENTER END . if \\n[#TAB_ACTIVE]=0 \{\ . rr #QUAD . ds $RESTORE_QUAD_VALUE CENTER . \} . nf . ce 100000 . nr #PSEUDO_FILL 1 .END \# \# ===================================================================== \# \# +++TABS+++ \# \# There are two different kinds of tabs: typesetting tabs and \# string tabs. \# \# Typesetting tabs are set with TAB_SET, which requires a tab number, \# an indent (offset) from the left margin and a length (optionally \# with a quad direction and an instruction to fill lines). After tabs \# are set with TAB_SET, they are called with .TAB n, where "n" \# corresponds to the number passed to TAB_SET as a valid tab number. \# \# String tabs allow the user to mark off tab positions inline. Tab \# indents and lengths are calculated from the beginning and end \# positions of the marks. Up to 19 string tabs may be created, \# numbered 1-19. Once created, they are called with .TAB n, \# just like typesetting tabs. \# \# Setting up string tabs is a two-step procedure. First, the user \# enters an input line in which s/he wants to mark off string tabs. \# The beginning of a tab is marked with \*[STn], where "n" is \# the desired number of the tab. The end of the the tab is marked \# with \*[STnX]. All ST's must have a matching STX. String tabs \# may be nested. \# \# Next, the user invokes .ST n for every string tab defined, and \# optionally passes quad information to it. That done, string tabs \# can be called just like typesetting tabs. \# \# Strings for string tab inlines \# ------------------------------ \# Initialize string tab markers numbered 1 to 19. \# .nr #LOOP 0 1 .while \n+[#LOOP]<20 \{\ . ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET] .\} \# .nr #LOOP 0 1 .while \n+[#LOOP]<20 \{\ . ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK] .\} .rr #LOOP \# \# These are reserved ST numbers for internal use .ds ST100 \Ek[#ST100_OFFSET] .ds ST100X \Ek[#ST100_MARK] .ds ST101 \Ek[#ST101_OFFSET] .ds ST101X \Ek[#ST101_MARK] .ds ST102 \Ek[#ST102_OFFSET] .ds ST102X \Ek[#ST102_MARK] .ds ST103 \Ek[#ST103_OFFSET] .ds ST103X \Ek[#ST103_MARK] \# \# QUAD AND SET STRING TABS \# ------------------------ \# *Arguments: \# L | R | C | J [QUAD] \# *Function: \# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a \# tab based on the collected information. \# *Notes: \# Like TAB_SET, ST invoked without a quad direction will default to LEFT. \# If lines should be filled and quadded, use the optional argument QUAD. \# N.B. -- indents *must* be turned off before setting string tabs \# inside .PAD \# .MAC ST END . ds $ST\\$1_QUAD_DIR \\$2 . if \\n[#NUM_ARGS]=3 .ds $ST\\$1_FILL QUAD . nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET] . ie \\n[#IN_TAB] \ . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \ \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL] . el \ . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \ \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL] .END \# \# TAB SET \# ------- \# *Arguments: \# ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]] \# *Function: \# Creates macros TABn and TAB n, where "n" is any arbitrary number. \# TABn is a typesetting tab (i.e. a tab defined as an indent \# from the page left offset plus a line length.) \# *Notes: \# n = arbitrary digit to identify the tab \# indent = indent from left margin; unit of measure required \# length = length of tab (unit of measure required; can be \# \w''u--if more than one word in string, surround \# with double quotes "\w''" \# LRCJ = quad for tab (left, right, center, justified) \# If option QUAD afterwards is not given, quad is line for line \# (no fill mode), meaning that there's no need for .BR or .br \# between lines. \# QUAD = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY \# had been given). \# \# N.B. -- indents *must* be turned off before setting tabs \# \# Tabs are not columnar in behaviour. .TN and \*[TB+] permit \# bottom-line to bottom-line tab movement. \# \# When resetting tabs, .TQ must be invoked before .TAB_SET. \# \# Indents are turned off automatically whenever a new tab is called \# with TAB . \# \# Generally, it's a good idea to make sure all indents are off \# before setting tabs. \# .MAC TAB_SET END . br . nr #TAB_NUMBER \\$1 . ds $CURRENT_TAB \\n[#TAB_NUMBER] . nr #TAB_OFFSET (\\$2) . nr #TAB_LENGTH (\\$3) . MAC TAB\\n[#TAB_NUMBER] . if !\\\\n[#TB+]=1 .br . if \\\\n[#TB+]=1 \{\ . EL . vpt 0 . rr #TB+ . \} . in 0 . nr #TAB_ACTIVE 1 . nr #CURRENT_TAB \\n[#TAB_NUMBER] . ds $CURRENT_TAB \\*[$CURRENT_TAB] . nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET] . nr #ST_OFFSET \\n[#TAB_OFFSET] . ie !'\\\\n[.z]'' \ \!. po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u . el \ . po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u . ll \\n[#TAB_LENGTH]u . ta \En[.l]u . ie '\\$5'QUAD' \{\ . if '\\$4'L' .QUAD L . if '\\$4'R' .QUAD R . if '\\$4'C' .QUAD C . if '\\$4'J' .JUSTIFY . \} . el \{\ . if '\\$4'' .LEFT . if '\\$4'L' .LEFT . if '\\$4'R' .RIGHT . if '\\$4'C' .CENTER . if '\\$4'J' .JUSTIFY . \} . if \\\\n[#TN]=1 \{\ . TRAP . rr #TN . \} .. . rr #TAB_ACTIVE .END \# \# TAB \# --- \# *Arguments: \# \# *Function: \# Moves to tab number passed as an argument. \# .MAC TAB END . ds $TAB_NUMBER \\$1 . TAB\\*[$TAB_NUMBER] . nr #IN_TAB 1 .END \# \# TAB NEXT \# -------- \# *Argument: \# \# *Function: \# Automagically moves to TAB on the same line as the last \# line of the previous tab. \# *Notes: \# The \c inline must be appended to the end of input lines when in \# nofill mode; in fill modes, the \c inline must not be used. \# .MAC TN END . nr #TN 1 . TRAP OFF . sp -1v . nr #NEXT_TAB \\n[#CURRENT_TAB]+1 . TAB\\n[#NEXT_TAB] . TRAP .END \# \# An inline escape to accomplish the same thing. Preferable, since \# it works with filled and non-filled copy and doesn't require the \# user to remember to use (or not use) the \c. \# .ds TB+ \ "\c\R'#TB+ 1'\R'#TN 1'\R'#NEXT_TAB \\n[#CURRENT_TAB]+1'\\*[TAB\\n[#NEXT_TAB]]\c \# \# TAB QUIT \# -------- \# *Argument: \# \# *Function: \# Sets #TAB_ACTIVE to "0" (off). \# Resets left margin to value in effect prior to tabs. \# Resets line length to value in effect prior to tabs. \# Checks #QUAD to see if we were in flush or quad mode \# prior to tabs (0=off, 1=on). \# Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY \# in effect prior to tabs. \# *Notes: \# TQ must precede setting new tabs to get the tabs' indents \# measured from page left. Otherwise, the tabs' indents are \# measured from the left margin of the currently active tab. \# .MAC TQ END . br . rr #TAB_ACTIVE . rr #IN_TAB . nr #LOOP 0 1 . while \\n+[#LOOP]<20 \{\ . rm $ST\\n[#LOOP]_FILL . \} . rr #LOOP . po \\n[#L_MARGIN]u . ll \\n[#L_LENGTH]u . ta \\n[.l]u . ie \\n[#QUAD] \{\ . ie '\\*[$RESTORE_QUAD_VALUE]'J' .JUSTIFY . el .QUAD \\*[$RESTORE_QUAD_VALUE] . \} . el \{\ . if '\\*[$RESTORE_QUAD_VALUE]'LEFT' .LEFT . if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' .RIGHT . if '\\*[$RESTORE_QUAD_VALUE]'CENTER' .CENTER . \} .END \# \# ==================================================================== \# \# COLOR HANDLING \# ============== \# \# COLOR \# ----- \# *Arguments: \# \# *Function: \# Allows the inline escape for setting color to be called \# as a macro. \# .MAC COLOR END . ie \\n[.u]=1 \{\ \c \\*[\\$1]\c . \} . el \\*[\\$1] .END \# \# NEWCOLOR \# -------- \# *Arguments: \# [] \# *Function: \# Based on .defcolor, allows users to name and define colors using \# one of the four color schemes rgb, cmy, cmyk and grey. The new \# color is then defined as a string so that it can be called inline \# with \*[COLORNAME] or with .COLOR. \# *Notes: \# With only two args, the default color scheme is rgb. \# \# It is highly recommended that users define new colors as \# all-cap strings, to differentiate them from x colors, which must \# be in lower case. \# .MAC NEWCOLOR END . if \\n[#NUM_ARGS]=2 .defcolor \\$1 rgb \\$2 . if \\n[#NUM_ARGS]=3 \{\ . if '\\$2'RGB' .ds $COLOR_SCHEME rgb . if '\\$2'CYM' .ds $COLOR_SCHEME cym . if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk . if '\\$2'GRAY' .ds $COLOR_SCHEME gray . if '\\$2'GREY' .ds $COLOR_SCHEME gray . defcolor \\$1 \\*[$COLOR_SCHEME] \\$3 . \} . ds \\$1 \\m[\\$1] .END \# \# XCOLOR \# ------ \# *Arguments: \# [] \# *Function: \# Defines a string of x color name (i.e. a predefined x \# color). If is given, creates a string of \# that references the x color name of the first argument. \# *Notes: \# The color name must be a valid color name from rgb.txt, and \# must be given entirely in lower case, all one word. \# .MAC XCOLOR END . ds \\$1 \m[\\$1] . if \\n[#NUM_ARGS]=2 \{\ . ds \\$2 \m[\\$1] . ds $\\$2_FILL \\$1 . ds COLAL_\\$2 \\$1 . \} .END \# \# Pre-define xcolors black and white \# .ds black \m[black] .ds BLACK \m[black] .ds white \m[white] .ds WHITE \m[WHITE] \# \# ===================================================================== \# \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++ \# \# UNDERLINE \# --------- \# *Arguments: \# | \# *Function: \# Simulates typewriter-style underlining of italic passages. \# *Notes: \# Defaults for rule weight and distance from baseline are below. \# UNDERLINE_SPECS lets user change them \# .nr _w 500 .nr _d 1250 \# .MAC UNDERLINE_SPECS END . ie \B'\\$1' .nr _w (u;\\$1) . el \{\ . ie '\\$1'DEFAULT' .nr _w 500 . el \{\ . nr _w 500 . tm1 "[mom]: The first argument to \\$0 must be a numeric . tm1 " argument with a unit of measure appended, or DEFAULT. . tm1 " Setting underline weight to DEFAULT. . \} . \} . shift . ie \B'\\$1' .nr _d (u;\\$1) . el \{\ . ie '\\$1'DEFAULT' .nr _d 1250 . el \{\ . nr _d 1250 . tm1 "[mom]: The second argument to \\$0 must be a numeric . tm1 " argument with a unit of measure appended, or DEFAULT. . tm1 " Setting underline distance from baseline to DEFAULT. . \} . \} .END \# .MAC UNDERLINE END \c . ds $SAVED_SS_VAR \\*[$SS_VAR] . ie '\\$1'' \{\ . nr #UNDERLINE_ON 1 . ss \\n[.ss] (\\n[.ss]-\\n[.ss]) . ie !n .nop \X'ps: exec \\n[_w] \\n[_d] decorline'\c . el .ul 1000 . \} . el \{\ . nr #UNDERLINE_ON 0 . SS \\*[$SAVED_SS_VAR] . ie !n .nop \X'ps: exec decornone'\c . el .ul 0 . \} .END \# \# UL/ULX \# ------ \# *Arguments: \# \# *Function: \# Simulates typewriter-style underlining of italic passages. \# *Notes: \# Intended to be called with inline escapes \*[UL] (underline \# on) and \*[ULX] (underline off). \# .MAC UL END \c . ds $SAVED_SS_VAR \\*[$SS_VAR] . ss \\n[.ss] (\\n[.ss]-\\n[.ss]) . ie !'\\n[.z]'' \{\ \c . ie !n \{\ . if !\\n[.k]=0 \?\h'-\w'\\n[.ss]'u'\? \?\R'#UNDERLINE_ON 1'\X'ps: exec \\n[_w] \\n[_d] decorline'\?\c . \} . el \{\ \?\R'#UNDERLINE_ON 1'\?\c . ul 1000 . \} . \} . el \{\ . ie !n \{\ . nr #UNDERLINE_ON 1 . nop \X'ps: exec \\n[_w] \\n[_d] decorline'\c . \} . el \{\ \R'#UNDERLINE_ON 1'\c . ul 1000 . \} . \} .END \# .MAC ULX END \c . SS \\*[$SAVED_SS_VAR] . rm $SAVED_SS_VAR . ie !'\\n[.z]'' \{\ \c . ie !n \{\ \?\R'#UNDERLINE_ON 0'\X'ps: exec decornone'\?\c . \} . el \{\ \?\R'#UNDERLINE_ON 0'\?\c . ul 0 . \} . \} . el \{\ . ie !n \{\ . nr #UNDERLINE_ON 0 . nop \X'ps: exec decornone'\c . \} . el \{\ . nr #UNDERLINE_ON 0 . ul 0 . \} . \} .END \# \# UNDERSCORE \# ---------- \# *Arguments: \# [] "text" \# *Function: \# Places an underscore 2 points under the string if no lead given, \# otherwise places underscore under string by user specified amount. \# *Notes: \# When using this macro, the string to be underscored must begin \# with double-quotes ("), regardless of whether it's the sole \# argument or the second. \# E.g.: \# .UNDERSCORE "Text to be underscored \# or \# .UNDERSCORE 2p "Text to be underscored \# \# UNDERSCORE does not work across line breaks. Each line of text \# must be entered separately. If the UNDERSCORE begins in the \# middle of a line and crosses over a break, the portion before \# the break and the portion afterwards must be entered \# separately. \# .MAC UNDERSCORE END . nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT] . nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ] . ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP] . if \\n[#FROM_BIB_STRING]=1 \{\ . nr #UNDERSCORE_WEIGHT \\n[#BIB_STRING_UNDERLINE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$BIB_STRING_UNDERLINE_GAP] . \} . if \\n[#FROM_COVER]=1 \{\ . nr #UNDERSCORE_WEIGHT \\n[#COVER_UNDERLINE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#COVER_UNDERLINE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$COVER_UNDERLINE_GAP] . \} . if \\n[#FROM_DOC_COVER]=1 \{\ . nr #UNDERSCORE_WEIGHT \\n[#DOC_COVER_UNDERLINE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#DOC_COVER_UNDERLINE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$DOC_COVER_UNDERLINE_GAP] . \} . if \\n[#FROM_DOCTYPE]=1 \{\ . nr #UNDERSCORE_WEIGHT \\n[#DOCTYPE_UNDERLINE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#DOCTYPE_UNDERLINE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$DOCTYPE_UNDERLINE_GAP] . \} . if \\n[#FROM_EN_STRING]=1 \{\ . nr #UNDERSCORE_WEIGHT \\n[#EN_STRING_UNDERLINE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$EN_STRING_UNDERLINE_GAP] . \} . if \\n[#FROM_EN_TITLE]=1 \{\ . nr #UNDERSCORE_WEIGHT \\n[#EN_TITLE_UNDERLINE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_TITLE_UNDERLINE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$EN_TITLE_UNDERLINE_GAP] . \} . ie \\n[#NUM_ARGS]=1 \{\ . nr #TEXT_WIDTH \w'\\$1' \\$1\ \D't \\n[#UNDERSCORE_WEIGHT]'\ \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\ \v'+(\\*[$UNDERSCORE_GAP])+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\ \D'l \\n[#TEXT_WIDTH]u 0'\ \D't \\n[#RULE_WEIGHT]'\ \h'-\\n[#RULE_WEIGHT]u'\ \v'-(\\*[$UNDERSCORE_GAP])-\\n[#UNDERSCORE_WEIGHT_ADJ]u' . \} . el \{\ . nr #TEXT_WIDTH \w'\\$2' \\$2\ \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\ \v'+(\\$1)+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\ \D't \\n[#UNDERSCORE_WEIGHT]'\ \D'l \\n[#TEXT_WIDTH]u 0'\ \D't \\n[#RULE_WEIGHT]'\ \h'-\\n[#RULE_WEIGHT]u'\ \v'-(\\$1)-\\n[#UNDERSCORE_WEIGHT_ADJ]u' . \} . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP] . rr #SAVED_UNDERSCORE_WEIGHT . rr #SAVED_UNDERSCORE_WEIGHT_ADJ . rm $SAVED_UNDERSCORE_GAP .END \# \# DOUBLE UNDERSCORE \# ----------------- \# *Arguments: \# [points below baseline] [points distance between rules] "text" \# *Function: \# Same as UNDERSCORE, except it produces a double underscore. The default \# distance between the rules is 2 points. \# *Notes: \# The same double-quote requirement as UNDERSCORE. \# .MAC UNDERSCORE2 END . nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT] . nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ] . ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP] . ds $SAVED_RULE_GAP \\*[$RULE_GAP] . if \\n[#NUM_ARGS]=2 \{\ . ds $UNDERSCORE_GAP \\$1 . \} . if \\n[#NUM_ARGS]=3 \{\ . ds $UNDERSCORE_GAP \\$1 . ds $RULE_GAP \\$2 . \} . if \\n[#FROM_BIB_STRING] \{\ . nr #UNDERSCORE_WEIGHT \\n[#BIB_STRING_UNDERLINE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$BIB_STRING_UNDERLINE_GAP] . ds $RULE_GAP \\*[$BIB_STRING_RULE_GAP] . \} . if \\n[#FROM_EN_STRING] \{\ . nr #UNDERSCORE_WEIGHT \\n[#EN_STRING_UNDERLINE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$EN_STRING_UNDERLINE_GAP] . ds $RULE_GAP \\*[$EN_STRING_RULE_GAP] . \} . if \\n[#NUM_ARGS]=1 \{\ . nr #TEXT_WIDTH \w'\\$1' \\$1\ \D't \\n[#UNDERSCORE_WEIGHT]'\ \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\ \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\ \D'l \\n[#TEXT_WIDTH]u 0'\ \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\ \h'-\\n[#TEXT_WIDTH]u'\ \D'l \\n[#TEXT_WIDTH]u 0'\ \D't \\n[#RULE_WEIGHT]'\ \h'-\\n[#RULE_WEIGHT]u'\ \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)' . \} . if \\n[#NUM_ARGS]=2 \{\ . nr #TEXT_WIDTH \w'\\$2' \\$2\ \D't \\n[#UNDERSCORE_WEIGHT]'\ \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\ \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\ \D'l \\n[#TEXT_WIDTH]u 0'\ \v'+(\\*[$RULE_GAP])+\\n[#UNDERSCORE_WEIGHT]u'\ \h'-\\n[#TEXT_WIDTH]u'\ \D'l \\n[#TEXT_WIDTH]u 0'\ \D't \\n[#RULE_WEIGHT]'\ \h'-\\n[#RULE_WEIGHT]u'\ \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])+(\\n[#UNDERSCORE_WEIGHT]u*2u)' . \} . if \\n[#NUM_ARGS]=3 \{\ . nr #TEXT_WIDTH \w'\\$3' \\$3\ \D't \\n[#UNDERSCORE_WEIGHT]'\ \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\ \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\ \D'l \\n[#TEXT_WIDTH]u 0'\ \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\ \h'-\\n[#TEXT_WIDTH]u'\ \D'l \\n[#TEXT_WIDTH]u 0'\ \D't \\n[#RULE_WEIGHT]'\ \h'-\\n[#RULE_WEIGHT]u'\ \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)' . \} . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ] . ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP] . rr #SAVED_UNDERSCORE_WEIGHT . rr #SAVED_UNDERSCORE_WEIGHT_ADJ . rm $SAVED_UNDERSCORE_GAP . rm $SAVED_RULE_GAP .END \# \# Default underscoring rule gaps \# .ds $BIB_STRING_UNDERLINE_GAP 2p .ds $BIB_STRING_RULE_GAP 2p .ds $COVER_UNDERLINE_GAP 2p .ds $DOC_COVER_UNDERLINE_GAP 2p .ds $DOCTYPE_UNDERLINE_GAP 2p .ds $EN_STRING_UNDERLINE_GAP 2p .ds $EN_STRING_RULE_GAP 2p .ds $EN_TITLE_UNDERLINE_GAP 2p .ds $RULE_GAP 2p .ds $UNDERSCORE_GAP 2p \# \# SUPERSCRIPT \# ----------- \# *Function: \# Prints everything after inline invocation as superscript. \# *Notes: \# \*[SUP] and \*[SUPX] turn superscript on and off respectively. \# If running type is pseudo-condensed/expanded, invoke the superscript \# strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX] \# and \*[EXTSUPX] respectively. \# \# Default raise/lower amount .ds $SUP_RAISE \v'-.3m' .ds $SUP_LOWER \v'.3m' \# \# SUPERSCRIPT RAISE \# ----------------- \# *Argument: \# \# *Function: \# Defines strings $SUP_RAISE and $SUP_LOWER for use with \*[SUP], \# \*[CONDSUP] and \*[EXTSUP]. \# .MAC SUPERSCRIPT_RAISE_AMOUNT END . ds $SUP_RAISE_AMOUNT \\$1 . ds $SUP_RAISE \v'-\\*[$SUP_RAISE_AMOUNT]' . ds $SUP_LOWER \v'\\*[$SUP_RAISE_AMOUNT]' .END \# .ds SUP \ \R'#PT_SIZE_IN_UNITS \En[.ps]'\ \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\ \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u] \# .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER] \# .ds CONDSUP \ \R'#PT_SIZE_IN_UNITS \En[.ps]'\ \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\ \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP] \# .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]\E*[COND] \# .ds EXTSUP \ \R'#PT_SIZE_IN_UNITS \En[.ps]'\ \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\ \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP] \# .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]\E*[EXT] \# \# SLANT \# ----- \# \# SETSLANT \# -------- \# *Arguments: \# | RESET \# *Function: \# Modifies register #DEGREES for use with \*[SLANT], or resets \# it to the default. Defines string \*[SLANTX] \# *Notes: \# \*[SLANT] permits pseudo-italicizing of a font in cases where \# no italic font exists in a particular family. \# \# Default # of degrees is 15. \# \# Do not use unit of measure with arg to SETSLANT. \# \# It may be necessary to adjust the spacing on either side of \# [SLANT] and [SLANTX]. \# \# In docs, SLANT carries over from para to para. \# .nr #DEGREES 15 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]' .ds SLANTX \ER'#SLANT_ON 0'\ES'0' \# .MAC SETSLANT END . ie '\\$1'RESET' \{\ . nr #DEGREES 15 . if \\n[#PRINT_STYLE]=1 \ . if \\n[#UNDERLINE_SLANT] .return . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]' . \} . el \{\ . nr #DEGREES \\$1 . if \\n[#PRINT_STYLE]=1 \ . if \\n[#UNDERLINE_SLANT] .return . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]' . \} . ds SLANTX \ER'#SLANT_ON 0'\ES'0' .END \# \# BOLDER \# ------ \# \# SETBOLDER \# --------- \# *Arguments: \# | RESET \# *Function: \# Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets \# it to the default 700 units. \# *Notes: \# \*[BOLDER] allows pseudo-emboldening of a font where no bold \# font exists in a particular family. \# \# Default for SETBOLDER is 700 units. Do not use unit of measure \# with arg to SETBOLDER. \# .nr #BOLDER_UNITS 700 \# .MAC SETBOLDER END . if \\n[#IGNORE]=1 .return . ie '\\$1'RESET' .nr #BOLDER_UNITS 700 . el .nr #BOLDER_UNITS \\$1 .END \# .MAC BOLDER END \c .bd \\n[.f] \\n[#BOLDER_UNITS] .END \# .MAC BOLDERX END \c .bd \\n[.f] .END \# \# +++CONDENSE/EXTEND+++ \# \# CONDENSE/EXTEND \# --------------- \# *Arguments: \# \# *Function: \# Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out \# new point size (for character width) from arg, and defines string \# COND or EXT, which set the type size to the new character width, \# and sets the height of type to the value stored in CURRENT_PT_SIZE \# *Notes: \# CONDENSE_OR_EXTEND is invoked from the aliases \# CONDENSE and EXTEND. CONDENSE implies <100, EXTEND \# implies >100. Do not use a percent sign in the argument. \# \# There is no default setting for CONDENSE or EXTEND. \# 80 is a good approximation of condensed type, 120 is okay \# for extended. \# \# The value set by CONDENSE or EXTEND applies to all \# subsequent \*[COND] or \*[EXT] escapes until a new value is set. \# \# \*[COND] or \*[EXT] must be turned off before all changes of point \# size, and reinvoked afterwards (if so desired). This refers to \# changes of point size via control lines AND via inlines. \# .MAC CONDENSE_OR_EXTEND END . if '\\$0'CONDENSE' \{\ . ds $COND_PERCENT \\$1 . if \\n[#PRINT_STYLE]=1 \{\ . rm $COND_PERCENT . ds $COND_PERCENT 100 . \} . ds COND \ \R'#PT_SIZE_IN_UNITS \En[.ps]'\ \R'#CONDENSE 1'\ \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\ \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u' . ds COND_FOR_SUP \ \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\ \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u' . \} . if '\\$0'EXTEND' \{\ . ds $EXT_PERCENT \\$1 . if \\n[#PRINT_STYLE]=1 \{\ . rm $EXT_PERCENT . ds $EXT_PERCENT 100 . \} . ds EXT \ \R'#PT_SIZE_IN_UNITS \En[.ps]'\ \R'#EXTEND 1'\ \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\ \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u' . ds EXT_FOR_SUP \ \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\ \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u' . \} .END \# .ds CONDX \ \ER'#CONDENSE 0'\Es[0]\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u' .ds EXTX \ \ER'#EXTEND 0'\Es[0]\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u' \# \# +++PAD LINES+++ (insert space) \# \# PAD MARKER \# ---------- \# *Arguments: \# \# *Function: \# Defines string $PAD_MARKER, used in PAD \# *Notes: \# $PAD_MARKER is normally # (the pound sign). \# .MAC PAD_MARKER END . ds $PAD_MARKER \\$1 .END \# \# PAD \# --- \# *Argments: \# "" \# "" \# *Function: \# Defines and redefines padding character (default=pound sign \# unless padding character has been set with PAD_MARKER) \# several times so that when the string is output at the end \# of the macro, every # has been converted to an equal-sized \# amount of padding (blank space) on a line. \# *Notes: \# String tabs may be marked off during PAD. \# .MAC PAD END . if \\n[.u]=1 .nr fill 1 . nf . if !d$PAD_MARKER .ds $PAD_MARKER # . char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1' . ds $FAMILY_FOR_PAD \\n[.fam] .\" .if !n .fp \\n[.fp] \\n[.sty] . ds $FONT_FOR_PAD \\n[.sty] . nr #SIZE_FOR_PAD \\n[.ps] . ds $PAD_STRING \\$1 . as $PAD_STRING \Ekp . di PAD_STRING . fam \\*[$FAMILY_FOR_PAD] \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING] . br . di . char \\*[$PAD_MARKER] \ \R'#SPACE_TO_END \En[.l]-\En[p]'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]' . di PAD_STRING . fam \\*[$FAMILY_FOR_PAD] \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING] . br . di . char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u' . if \\n[#SILENT] .SILENT . fam \\*[$FAMILY_FOR_PAD] \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u] . ie '\\$2'' .nop \\*[$PAD_STRING] . el \{\ . ie !'\\$2'NOBREAK' .pdfhref L -D "\\$2" -E -- \&\\*[$PAD_STRING] . el .nop \\*[$PAD_STRING] . \} . if \\n[#SILENT] .SILENT OFF . br . if \\n[fill] \{\ . fi . rr fill . \} . rr #PAD_COUNT . rr #SPACE_TO_END . rr #PAD_SPACE . rm $PAD_STRING . rm PAD_STRING . rchar # . if '\\$2'NOBREAK' \{\ . TRAP OFF . EOL . TRAP . \} .END \# \# +++LEADERS+++ \# \# The leader mechanism is primitive, but it works. Basically, every \# macro in this set that includes a line length also sets a single \# groff tab stop at the right hand end of the line. That way, \# whenever Ctrl-A is invoked (always at the end of an input line), \# leader of the correct length gets deposited. Ctrl-A is accessed by \# the string LEADER (i.e. inline, as \*[LEADER]). Leaders within tabs \# get their length from the tab line length. \# \# SET LEADER CHARACTER \# -------------------- \# *Arguments: \# \# *Function: \# Set leader character. \# .MAC LEADER_CHARACTER END . lc \\$1 .END \# .ds LEADER  \# \# +++DROP CAPS+++ \# \# DROP CAP FAMILY \# --------------- \# *Argument: \# \# *Function: \# Creates or modifies string $DC_FAM. \# .MAC DROPCAP_FAMILY END . ds $DC_FAM \\$1 .END \# \# DROP CAP FONT \# ------------- \# *Argument: \# \# *Function: \# Creates or modifies string $DC_FT. \# .MAC DROPCAP_FONT END . ds $DC_FT \\$1 .END \# \# DROPCAP COLOR \# ------------- \# *Arguments: \# \# *Function: \# Defines string $DC_COLOR to argument. \# *Notes: \# User must define an XCOLOR or NEWCOLOR before using \# DC_COLOR. \# .MAC DROPCAP_COLOR END . if \\n[#PRINT_STYLE]=1 .return . nr #DC_COLOR 1 . ds $DC_COLOR \\$1 .END \# \# DROP CAP GUTTER \# --------------- \# *Argument: \# \# *Function: \# Creates or modifies register #DC_GUT. \# *Notes: \# Requires unit of measure. Default is 3p. \# .MAC DROPCAP_GUTTER END . nr #DC_GUT (\\$1) .END \# \# DROP CAP ADJUST \# --------------- \# *Argument: \# <+|- # of points to in/decrease point size of drop cap letter> \# *Function: \# Creates or modifies string $DC_ADJUST. \# *Notes: \# Despite its best efforts, DROPCAP doesn't always get the point \# size of the drop cap critically perfect. DROPCAP_ADJUST lets \# the user add or subtract points (or fractions of points) to \# get the size right. \# \# Requires the + or - sign. \# .MAC DROPCAP_ADJUST END . ds $DC_ADJUST \\$1 .END \# \# DROP CAP \# -------- \# *Arguments: \# <# of lines> [COND <% to condense> | EXT <% to extend>] \# *Function: \# Calculates point size of dropcap based on # of lines passed as \# arg 2. Sets indent for text based on dropcap width+gutter. \# Advances and prints dropcap; reverses and prints indented text \# to bottom of dropcap, then resets indent to left margin (plus \# any indent that was in effect prior to invoking DROPCAP). \# *Notes: \# Drop caps when using the doc processing macro PP only work with \# initial paragraphs (i.e. at doc start, or after heads), only when \# DROPCAPS comes immediately after PP, and only when the PRINTSTYLE \# is TYPESET. If these conditions aren't met, DROPCAPS is silently \# ignored. \# \# The COND or EXT argument are processed separately from all \# other COND or EXT inlines or macros, hence passing COND or \# EXT has no effect on running type. \# .MAC DROPCAP END . if \\n[#IGNORE]=1 \{\ . PRINT \\$1\c . return . \} . br . if n \{\ . PRINT \\$1\c . return . \} . if \\n[#DOCS] \{\ . if \\n[#PRINT_STYLE]=1 \{\ . PRINT \\$1\c . return . \} . if \\n[#PRINT_STYLE]=2 \{\ . if \\n[#PP_STYLE]=2 \{\ . PRINT \\$1\c . return . \} . if \\n[#PP]>1 \{\ . PRINT \\$1\c . return . \} . ti 0 . \} . \} . ds $DROPCAP \\$1 . nr #DC_LINES \\$2-1 . if \\n[#CONDENSE]=1 \{\ . ds $RESTORE_COND \\*[$COND_PERCENT] \\*[CONDX] . nr #CONDENSE_WAS_ON 1 . \} . if \\n[#EXTEND]=1 \{\ . ds $RESTORE_EXT \\*[$EXT_PERCENT] \\*[EXTX] . nr #EXTEND_WAS_ON 1 . \} . if '\\$3'COND' .CONDENSE \\$4 . if '\\$3'EXT' .EXTEND \\$4 . if !r#DC_GUT .nr #DC_GUT (3p) . ie \\n[#DOCS] .ds $RESTORE_FAM \\*[$DOC_FAM] . el .ds $RESTORE_FAM \\n[.fam] . ie \\n[#DOCS] .ds $RESTORE_FT \\*[$PP_FT] . el .ds $RESTORE_FT \\*[$FONT] . nr #RESTORE_PT_SIZE \\n[#PT_SIZE] . nr #RESTORE_INDENT \\n[.i] . SIZESPECS . nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT] . ie !d$DC_FAM .FAM \\n[.fam] . el .FAM \\*[$DC_FAM] . ie !d$DC_FT .FT \\*[$FONT] . el .FT \\*[$DC_FT] . while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\ . ps \\n[#PT_SIZE]u+100u . SIZESPECS . nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT] . \} . if d$DC_ADJUST .ps \\*[$DC_ADJUST]p . nr #DC_LINES +1 . if \\n[#DC_LINES]v>\\n[.t] \{\ . nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1 . tm1 "[mom]: Dropcap at line \\n[.c] does not fit on page \\n[pgnum]. . tm1 " Shifting paragraph to page \\n+[pgnum]. . bp . \} . ie \\n[#DC_COLOR]=1 \{\ . ie !'\\$3'' \{\ . ie '\\$3'COND' \ . PRINT \ \\*[DOWN \\n[#DC_LINES]v]\ \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[]\\*[UP \\n[#DC_LINES]v] . el \ . PRINT \ \\*[DOWN \\n[#DC_LINES]v]\ \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[]\\*[UP \\n[#DC_LINES]v] . \} . el .PRINT \ \\*[DOWN \\n[#DC_LINES]v]\ \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[]\\*[UP \\n[#DC_LINES]v] . \} . el \{\ . ie !'\\$3'' \{\ . ie '\\$3'COND' \ . PRINT \ \\*[DOWN \\n[#DC_LINES]v]\ \\*[COND]\\*[$DROPCAP]\\*[CONDX]\\*[UP \\n[#DC_LINES]v] . el \ . PRINT \ \\*[DOWN \\n[#DC_LINES]v]\ \\*[EXT]\\*[$DROPCAP]\\*[EXTX]\\*[UP \\n[#DC_LINES]v] . \} . el .PRINT \ \\*[DOWN \\n[#DC_LINES]v]\ \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[]\\*[UP \\n[#DC_LINES]v] . \} . if '\\$3'COND' \E*[COND] . if '\\$3'EXT' \E*[EXT] . ie \\n[.i] \{\ . vs 0 . br . in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u . vs . \} . el \{\ . vs 0 . br . in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u . vs . \} . if '\\$3'COND' \E*[CONDX]\c . if '\\$3'EXT' \E*[EXTX]\c . FAM \\*[$RESTORE_FAM] . FT \\*[$RESTORE_FT] . ps \\n[#RESTORE_PT_SIZE]u . if \\n[#CONDENSE_WAS_ON] \{\ . CONDENSE \\*[$RESTORE_COND] \\*[COND]\c . \} . if \\n[#EXTEND_WAS_ON] \{\ . EXTEND \\*[$RESTORE_EXT] \\*[EXT]\c . \} . ie \\n[.u] .wh \\n[.d]u+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF . el .wh \\n[.d]u+\\n[#DC_HEIGHT]u DROPCAP_OFF . rr #CONDENSE_WAS_ON . rr #EXTEND_WAS_ON . rm $DROPCAP . rr #DC_LINES . rm $RESTORE_COND . rm $RESTORE_EXT . rm $RESTORE_FAM . rm $RESTORE_FT . rr #RESTORE_PT_SIZE . rr #RESTORE_INDENT . rr #DC_HEIGHT . rr #GET_DC_HEIGHT . rr x .END \# .MAC DROPCAP_OFF END ' in \\n[#RESTORE_INDENT]u . ch DROPCAP_OFF .END \# \# ===================================================================== \# \# +++GRAPHICAL OBJECTS+++ \# \# HORIZONTAL RULE - DRH \# --------------------- \# *Arguments: \# | [ ] \# *Function: \# With no arg, draws a full measure rule. With args, draws \# described horizontal rule. \# *Notes: \# Rules are drawn left-to-right, from the baseline down, and \# return to their point of origin. Color must be set in the \# macro; otherwise the color will be black, regardless of current \# .gcolor. If no arg given, the rule weight is the one set by \# RULE_WEIGHT. \# .MAC DRH END . if \\n[.vpt]=1 \{\ . vpt 0 . nr #RESTORE_TRAP 1 . \} . ie !\\n[#NO_ADVANCE]=1 .br . el \{\ . sp -1v . rr #NO_ADVANCE . \} . ie \\n[.u]=1 \{\ . nr #FILLED 1 . nr #FILL_MODE \\n[.j] . \} . el \{\ . nr #NOFILL 1 . if \\n[.ce]>0 .nr #NOFILL_MODE 3 . if \\n[.rj]>0 .nr #NOFILL_MODE 5 . ce 0 . rj 0 . \} . nf . ds $RL_WEIGHT \\$1 . ds $RL_INDENT \\$2 . ds $RL_LENGTH \\$3 . ie !'\\$4'' .ds $RL_COLOR \\$4 . el .ds $RL_COLOR default . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT] . nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ] . di NULL . if \\n[#NUM_ARGS]>=1 .RULE_WEIGHT \\*[$RL_WEIGHT] . di . gcolor \\*[$RL_COLOR] . ie \\n[#NUM_ARGS]=0 \{\ . ie \\n[#INDENT_ACTIVE] \{\ . nr #RESTORE_L_LENGTH \\n[.l] . if \\n[#INDENT_BOTH_ACTIVE] .ll \\n[.l]u-\\n[#BL_INDENT]u . if \\n[#INDENT_LEFT_ACTIVE] .ll \\n[.l]u-\\n[#L_INDENT]u \D't \\n[#RULE_WEIGHT]'\ \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\ \v'\\n[#RULE_WEIGHT_ADJ]u'\ \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\ \v'-\\n[#RULE_WEIGHT_ADJ]u'\ \D't \\n[#SAVED_RULE_WEIGHT]' . ll \\n[#RESTORE_L_LENGTH]u . rr #RESTORE_L_LENGTH . \} . el \{\ \D't \\n[#RULE_WEIGHT]'\ \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\ \v'\\n[#RULE_WEIGHT_ADJ]u'\ \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\ \v'-\\n[#RULE_WEIGHT_ADJ]u'\ \D't \\n[#SAVED_RULE_WEIGHT]' . \} . \} . el \{\ \D't \\n[#RULE_WEIGHT]'\ \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\ \v'\\n[#RULE_WEIGHT_ADJ]u'\ \D'l \\*[$RL_LENGTH] 0'\ \v'-\\n[#RULE_WEIGHT_ADJ]u'\ \D't \\n[#SAVED_RULE_WEIGHT]' . \} . if \\n[#FILLED]=1 \{\ . if \\n[#FILL_MODE]=0 .QUAD LEFT . if \\n[#FILL_MODE]=1 .JUSTIFY . if \\n[#FILL_MODE]=3 .QUAD CENTER . if \\n[#FILL_MODE]=5 .QUAD RIGHT . rr #FILLED . \} . sp -1v . if \\n[#NOFILL]=1 \{\ . if \\n[#NOFILL_MODE]=3 .CENTER . if \\n[#NOFILL_MODE]=5 .RIGHT . \} . gcolor . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT] . nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ] . rr #SAVED_WEIGHT . rr #SAVED_WEIGHT_ADJ . if \\n[#RESTORE_TRAP]=1 \{\ . vpt 1 . rr #RESTORE_TRAP . \} . if '\\n[.z]'FLOAT*DIV' \ . if !(\\n[.d]+\\n[#WEIGHT])<\\n[D-float] .nr D-float \\n[.d]+\\n[#WEIGHT] .END \# \# RULE \# ---- \# *Argument: \# \# *Function: \# Draws a rule the length of the current measure. \# *Notes: \# A convenience macro. DRH with no argument does the same thing. \# Kept in for backward compatibility. \# .MAC RULE END . if \\n[.u]=1 \{\ . nr fill 1 . ds $CURRENT_QUAD \\*[$QUAD_VALUE] . nf . \} . ie \\n[#INDENT_ACTIVE] \{\ . if \\n[#INDENT_BOTH_ACTIVE] .ll \\n[.l]u-\\n[#BL_INDENT]u . if \\n[#INDENT_LEFT_ACTIVE] .ll \\n[.l]u-\\n[#L_INDENT]u . PRINT \ \D't \\n[#RULE_WEIGHT]'\v'\\n[#RULE_WEIGHT_ADJ]u'\ \h'-\\n[#RULE_WEIGHT]u'\ \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c . ll . rr #RESTORE_L_LENGTH . \} . el \{\ . PRINT \ \D't \\n[#RULE_WEIGHT]'\v'\\n[#RULE_WEIGHT_ADJ]u'\ \h'-\\n[#RULE_WEIGHT]u'\ \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c . \} . if \\n[fill] \{\ . fi . rr fill . QUAD \\*[$CURRENT_QUAD] . rm $CURRENT_QUAD . \} . EOL .END \# \# VERTICAL RULE - DRV \# ------------------- \# *Arguments: \# [ ] \# *Function: \# Draws described vertical rule. \# *Notes: \# Rules are drawn left-to-right, from the baseline down, and \# return to their point of origin. Color must be set in the \# macro; otherwise the color will be black, regardless of current \# .gcolor. \# .MAC DRV END . if \\n[.vpt]=1 \{\ . vpt 0 . nr #RESTORE_TRAP 1 . \} . ie !\\n[#NO_ADVANCE]=1 .br . el \{\ . sp -1v . rr #NO_ADVANCE . \} . ie \\n[.u]=1 \{\ . nr #FILLED 1 . nr #FILL_MODE \\n[.j] . \} . el \{\ . nr #NOFILL 1 . if \\n[.ce]>0 .nr #NOFILL_MODE 3 . if \\n[.rj]>0 .nr #NOFILL_MODE 5 . ce 0 . rj 0 . \} . nf . ds $RL_WEIGHT \\$1 . ds $RL_INDENT \\$2 . ds $RL_DEPTH \\$3 . ie !'\\$4'' \{\ . ds $RL_COLOR \\$4 . \} . el .ds $RL_COLOR default . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT] . nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ] . RULE_WEIGHT \\*[$RL_WEIGHT] . gcolor \\*[$RL_COLOR] \D't \\n[#RULE_WEIGHT]'\ \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT_ADJ]u'\ \D'l 0 \\*[$RL_DEPTH]'\ \D't \\n[#SAVED_RULE_WEIGHT]' . if \\n[#FILLED]=1 \{\ . if \\n[#FILL_MODE]=0 .QUAD LEFT . if \\n[#FILL_MODE]=1 .JUSTIFY . if \\n[#FILL_MODE]=3 .QUAD CENTER . if \\n[#FILL_MODE]=5 .QUAD RIGHT . rr #FILLED . \} . sp -1v . if \\n[#NOFILL]=1 \{\ . if \\n[#NOFILL_MODE]=3 .CENTER . if \\n[#NOFILL_MODE]=5 .RIGHT . \} . gcolor . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT] . nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ] . if \\n[#RESTORE_TRAP]=1 \{\ . vpt 1 . rr #RESTORE_TRAP . \} . if '\\n[.z]'FLOAT*DIV' \{\ . if !(\\n[.d]+\\*[$RL_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$RL_DEPTH] . \} .END \# \# BOXES - DBX \# ----------- \# *Arguments: \# [ ] \# *Function: \# Draws described box. \# *Notes: \# Boxes are drawn left-to-right, from the baseline down, and \# return to their point of origin. Box rules are drawn from the \# perimeter inwards. Color must be set in the macro; otherwise \# the color will be black, regardless of current .gcolor. If no \# arg given, the rule weight is the one set by RULE_WEIGHT. \# .MAC DBX END . if \\n[.vpt]=1 \{\ . vpt 0 . nr #RESTORE_TRAP 1 . \} . ie !\\n[#NO_ADVANCE]=1 .br . el \{\ . sp -1v . rr #NO_ADVANCE . \} . ie \\n[.u]=1 \{\ . nr #FILLED 1 . nr #FILL_MODE \\n[.j] . \} . el \{\ . nr #NOFILL 1 . if \\n[.ce]>0 .nr #NOFILL_MODE 3 . if \\n[.rj]>0 .nr #NOFILL_MODE 5 . ce 0 . rj 0 . \} . nf . ie '\\$1'SOLID' .nr #BX_SOLID 1 . el .ds $BX_WEIGHT \\$1 . ds $BX_INDENT \\$2 . ds $BX_WIDTH \\$3 . ds $BX_DEPTH \\$4 . ie !'\\$5'' \{\ . ie d$\\$5_FILL .ds $BX_COLOR \\*[$\\$5_FILL] . el .ds $BX_COLOR \\$5 . \} . el .ds $BX_COLOR default . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT] . nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . if !'\\$1'SOLID' .RULE_WEIGHT \\*[$BX_WEIGHT] . ds $BX_INDENT \\*[$BX_INDENT]-\\n[#WEIGHT_ADJ]u . ie \\n[#BX_SOLID]=1 \{\ . fcolor \\*[$BX_COLOR] \h'\\*[$BX_INDENT]'\ \D'P \\*[$BX_WIDTH] 0 0 \\*[$BX_DEPTH] -\\*[$BX_WIDTH] 0 0 -\\*[$BX_DEPTH]' . fcolor . rr #BX_SOLID . \} . el \{\ . gcolor \\*[$BX_COLOR] \D't \\n[#RULE_WEIGHT]'\ \h'\\*[$BX_INDENT]'\ \v'\\n[#WEIGHT_ADJ]u'\ \D'p \\*[$BX_WIDTH]-\\n[#RULE_WEIGHT]u 0 0 \\*[$BX_DEPTH]-\\n[#RULE_WEIGHT]u -\\*[$BX_WIDTH]+\\n[#RULE_WEIGHT]u 0 0 -\\*[$BX_DEPTH]+\\n[#RULE_WEIGHT]u'\ \v'-\\n[#WEIGHT_ADJ]u'\ \D't \\n[#SAVED_RULE_WEIGHT]' . gcolor . \} . sp -1v . if \\n[#FILLED]=1 \{\ . if \\n[#FILL_MODE]=0 .QUAD LEFT . if \\n[#FILL_MODE]=1 .JUSTIFY . if \\n[#FILL_MODE]=3 .QUAD CENTER . if \\n[#FILL_MODE]=5 .QUAD RIGHT . rr #FILLED . \} . if \\n[#NOFILL]=1 \{\ . if \\n[#NOFILL_MODE]=3 .CENTER . if \\n[#NOFILL_MODE]=5 .RIGHT . \} . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT] . nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ] . rr #SAVED_WEIGHT . rr #SAVED_WEIGHT_ADJ . if \\n[#RESTORE_TRAP]=1 \{\ . vpt 1 . rr #RESTORE_TRAP . \} . if '\\n[.z]'FLOAT*DIV' \ . if !(\\n[.d]+\\*[$BX_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$BX_DEPTH] .END \# \# ELLIPSES - DCL \# -------------- \# *Arguments: \# [ ] \# *Function: \# Draws described ellipses. \# *Notes: \# Ellipses (circles) are drawn left-to-right, from the baseline \# down, and return to their point of origin. Ellipse rules are \# drawn from the perimeter inwards. Color must be set in the \# macro; otherwise the color will be black, regardless of current \# .gcolor. If no arg given, the rule weight is the one set by \# RULE_WEIGHT. \# .MAC DCL END . if \\n[.vpt]=1 \{\ . vpt 0 . nr #RESTORE_TRAP 1 . \} . ie !\\n[#NO_ADVANCE]=1 .br . el \{\ . sp -1v . rr #NO_ADVANCE . \} . ie \\n[.u]=1 \{\ . nr #FILLED 1 . nr #FILL_MODE \\n[.j] . \} . el \{\ . nr #NOFILL 1 . if \\n[.ce]>0 .nr #NOFILL_MODE 3 . if \\n[.rj]>0 .nr #NOFILL_MODE 5 . ce 0 . rj 0 . \} . nf . ie '\\$1'SOLID' .nr #CL_SOLID 1 . el .ds $CL_WEIGHT \\$1 . ds $CL_INDENT \\$2 . ds $CL_WIDTH \\$3 . ds $CL_DEPTH \\$4 . ie !'\\$5'' \{\ . ie d$\\$5_FILL .ds $CL_COLOR \\*[$\\$5_FILL] . el .ds $CL_COLOR \\$5 . \} . el .ds $CL_COLOR default . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT] . nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . if !'\\$1'SOLID' .RULE_WEIGHT \\*[$CL_WEIGHT] . ds $CL_INDENT \\*[$CL_INDENT]-\\n[#WEIGHT_ADJ]u . ie \\n[#CL_SOLID]=1 \{\ . fcolor \\*[$CL_COLOR] \h'\\*[$CL_INDENT]'\ \v'\\*[$CL_DEPTH]/2u'\ \D'E \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\ \v'-\\*[$CL_DEPTH]/2u' . fcolor . rr #CL_SOLID . \} . el \{\ . gcolor \\*[$CL_COLOR] \D't \\n[#RULE_WEIGHT]'\ \h'\\*[$CL_INDENT]'\ \v'\\*[$CL_DEPTH]/2u'\ \D'e \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\ \v'-(\\*[$CL_DEPTH]/2u)'\ \D't \\n[#SAVED_RULE_WEIGHT]' . gcolor . \} . sp -1v . if \\n[#FILLED]=1 \{\ . if \\n[#FILL_MODE]=0 .QUAD LEFT . if \\n[#FILL_MODE]=1 .JUSTIFY . if \\n[#FILL_MODE]=3 .QUAD CENTER . if \\n[#FILL_MODE]=5 .QUAD RIGHT . rr #FILLED . \} . if \\n[#NOFILL]=1 \{\ . if \\n[#NOFILL_MODE]=3 .CENTER . if \\n[#NOFILL_MODE]=5 .RIGHT . \} . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT] . nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ] . rr #SAVED_WEIGHT . rr #SAVED_WEIGHT_ADJ . if \\n[#RESTORE_TRAP]=1 \{\ . vpt 1 . rr #RESTORE_TRAP . \} . if '\\n[.z]'FLOAT*DIV' \ . if !(\\n[.d]+\\*[$CL_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$CL_DEPTH] .END \# \# RULE WEIGHT \# ----------- \# *Argument: \# \# *Function: \# Sets \D't ' to the correct number of machine units for the \# argument given in points. \# *Notes: \# Decimal fractions are allowed. Rule weight must be < 100. \# .MAC RULE_WEIGHT END . di NULL \" Diverted so there's no problem with breaks, spacing, etc. . ds $ARG \\$1 . substring $ARG -1 . if !\B'\\*[$ARG]' \{\ . tm1 "[mom]: The argument to \\$0 must not have a unit of measure appended. . ab Aborting '\\n[.F]' at \\$0, line \\n[.c]. . \} . length #STR_LENGTH \\$1 . ds $ARG \\$1 . substring $ARG 0 0 . ie '\\*[$ARG]'.' \{\ . ds $ARG \\$1 . substring $ARG 1 \\n[#STR_LENGTH]-1 . nr #WEIGHT \\*[$ARG]*100 . if (\\n[#WEIGHT]>=1000) \{\ . while (\\n[#WEIGHT]>=1000) \{\ . nr #WEIGHT \\n[#WEIGHT]/10 . \} . \} . \} . el \{\ . ds $ARG \\$1 . substring $ARG 1 1 . ie '\\*[$ARG]'.' \{\ . ds $LHS \\$1 . substring $LHS 0 0 . ds $RHS \\$1 . substring $RHS 2 . nr #WEIGHT \\*[$LHS]\\*[$RHS]*100 . if (\\n[#WEIGHT]>=10000) \{\ . while (\\n[#WEIGHT]>=10000) \{\ . nr #WEIGHT \\n[#WEIGHT]/10 . \} . \} . \} . el \{\ . ie \\n[#STR_LENGTH]<=2 .nr #WEIGHT \\$1*1000 . el \{\ . ds $ARG \\$1 . substring $ARG 2 2 . ie !'\\*[$ARG]'.' \{\ . tm1 "[mom]: Invalid argument given to macro \\$0 at line \\n[.c]. . tm1 " Rule weight must be < 100 points. . tm1 " Falling back to default weight .5 points. . nr #WEIGHT 500 . \} . el \{\ . ds $LHS \\$1 . substring $LHS 0 1 . ds $RHS \\$1 . substring $RHS 3 . nr #WEIGHT \\*[$LHS]\\*[$RHS]*1000 . if (\\n[#WEIGHT]>=100000) \{\ . while (\\n[#WEIGHT]>=100000) \{\ . nr #WEIGHT \\n[#WEIGHT]/10 . \} . \} . \} . \} . \} . \} . nr #WEIGHT_ADJ \\n[#WEIGHT]/2 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT' \{\ . nr #BIB_STRING_UNDERLINE_WEIGHT \\n[#WEIGHT] . nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'COVER_UNDERLINE_WEIGHT' \{\ . nr #COVER_UNDERLINE_WEIGHT \\n[#WEIGHT] . nr #COVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'DOC_COVER_UNDERLINE_WEIGHT' \{\ . nr #DOC_COVER_UNDERLINE_WEIGHT \\n[#WEIGHT] . nr #DOC_COVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'DOCTYPE_UNDERLINE_WEIGHT' \{\ . nr #DOCTYPE_UNDERLINE_WEIGHT \\n[#WEIGHT] . nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'ENDNOTE_STRING_UNDERLINE_WEIGHT' \{\ . nr #EN_STRING_UNDERLINE_WEIGHT \\n[#WEIGHT] . nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'ENDNOTE_TITLE_UNDERLINE_WEIGHT' \{\ . nr #EN_TITLE_UNDERLINE_WEIGHT \\n[#WEIGHT] . nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'FOOTER_RULE_WEIGHT' \{\ . nr #FOOTER_RULE_WEIGHT \\n[#WEIGHT] . nr #FOOTER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'FOOTNOTE_RULE_WEIGHT' \{\ . nr #FN_RULE_WEIGHT \\n[#WEIGHT] . nr #FN_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'HEADER_RULE_WEIGHT' \{\ . nr #HEADER_RULE_WEIGHT \\n[#WEIGHT] . nr #HEADER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'RULE_WEIGHT' \{\ . nr #RULE_WEIGHT \\n[#WEIGHT] . nr #RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . if '\\$0'UNDERSCORE_WEIGHT' \{\ . nr #UNDERSCORE_WEIGHT \\n[#WEIGHT] . nr #UNDERSCORE_WEIGHT_ADJ \\n[#WEIGHT_ADJ] . \} . di .END \# \# Aliases \# .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT RULE_WEIGHT .ALIAS COVER_UNDERLINE_WEIGHT RULE_WEIGHT .ALIAS DOC_COVER_UNDERLINE_WEIGHT RULE_WEIGHT .ALIAS DOCTYPE_UNDERLINE_WEIGHT RULE_WEIGHT .ALIAS ENDNOTE_STRING_UNDERLINE_WEIGHT RULE_WEIGHT .ALIAS ENDNOTE_TITLE_UNDERLINE_WEIGHT RULE_WEIGHT .ALIAS FOOTER_RULE_WEIGHT RULE_WEIGHT .ALIAS FOOTNOTE_RULE_WEIGHT RULE_WEIGHT .ALIAS HEADER_RULE_WEIGHT RULE_WEIGHT .ALIAS UNDERSCORE_WEIGHT RULE_WEIGHT \# \# Default rule weights \# ~~~~~~~~~~~~~~~~~~~~ .nr #BIB_STRING_UNDERLINE_WEIGHT 500 .nr #COVER_UNDERLINE_WEIGHT 500 .nr #DOC_COVER_UNDERLINE_WEIGHT 500 .nr #DOCTYPE_UNDERLINE_WEIGHT 500 .nr #EN_STRING_UNDERLINE_WEIGHT 500 .nr #EN_TITLE_UNDERLINE_WEIGHT 500 .nr #FN_RULE_WEIGHT 500 .nr #FOOTER_RULE_WEIGHT 500 .nr #HEADER_RULE_WEIGHT 500 .nr #RULE_WEIGHT 500 .nr #UNDERSCORE_WEIGHT 500 \# .nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \n[#BIB_STRING_UNDERLINE_WEIGHT]/2 .nr #COVER_UNDERLINE_WEIGHT_ADJ \n[#DOCTYPE_UNDERLINE_WEIGHT]/2 .nr #DOC_COVER_UNDERLINE_WEIGHT_ADJ \n[#DOCTYPE_RULE_WEIGHT]/2 .nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \n[#DOCTYPE_RULE_WEIGHT]/2 .nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \n[#EN_STRING_UNDERLINE_WEIGHT]/2 .nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \n[#EN_STRING_UNDERLINE_WEIGHT]/2 .nr #FOOTER_RULE_WEIGHT_ADJ \n[#FOOTER_RULE_WEIGHT]/2 .nr #FN_RULE_WEIGHT_ADJ \n[#FN_RULE_WEIGHT]/2 .nr #HEADER_RULE_WEIGHT_ADJ \n[#HEADER_RULE_WEIGHT]/2 .nr #RULE_WEIGHT_ADJ \n[#RULE_WEIGHT]/2 .nr #UNDERSCORE_WEIGHT_ADJ \n[#UNDERSCORE_WEIGHT]/2 \# \# Set default rule weight \# .di NULL \D't 500' .di \# \# ===================================================================== \# \# +++WORD AND SENTENCE SPACING+++ \# \# WORD SPACE CONTROL \# ------------------ \# *Argument: \# <+|->wordspace | DEFAULT \# *Function: \# Increases or decreases interword space by user supplied amount. \# If DEFAULT, value is set to 12 (groff default). \# *Notes: \# $WS_CONSTANT is the groff default word space. \# $WS_VAR is the user supplied amount by which to in/decrease word space. \# $WS is a concatenation of WS_CONSTANT and WS_VAR. \# \# \n[.sss] holds the current sentence space value. \# .MAC WS END . ds $WS_CURR \\n[.ss] . ds $WS_VAR \\$1 . ie '\\$1'DEFAULT' .ss 12 \\n[.sss] . el \{\ . ds $WS (\\*[$WS_CURR]\\*[$WS_VAR]) . ie \\n[.sss]=12 .ss \\*[$WS] 12 . el \{\ . ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR]) . SS \\*[$SS_VAR] . \} . \} .END \# \# SENTENCE SPACE CONTROL \# ---------------------- \# *Argument: \# <+-sentencespace> | 0 | DEFAULT \# *Function: \# Increases or decreases sentence space by user supplied amount. \# If 0, sentence spaces are ignored. If DEFAULT, value is \# set to 12 (groff default). \# *Notes: \# Because the user supplied value requires a literal + or - sign, \# the macro argument is stored in a string. \# \# Sentence space applies only to input where sentences are separated \# by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL). \# Changing .SS when sentences are separated by only one space has \# no effect on the space between sentences. \# \# \n[.ss] holds the current wordspace value. \# \n[.sss] holds the current sentence space value. \# .MAC SS END . ds $SS_VAR \\$1 . ie '\\$1'0' .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) . el \{\ . ie '\\$1'DEFAULT' .ss \\n[.ss] . el .ss \\n[.ss] (0\\*[$SS_VAR]) . \} .END \# \# ===================================================================== \# \# INDENTS \# ------- \# \# +++INDENT LEFT+++ \# .MAC IL END . if \\n[#INDENT_STYLE_BOTH] .IBX . nr #INDENT_STYLE_LEFT 1 . nr #INDENT_ACTIVE 1 . nr #INDENT_LEFT_ACTIVE 1 . ie '\\$1'' \{\ . br . in \\n[#L_INDENT]u . ta \\n[.l]u-\\n[#L_INDENT]u . \} . el \{\ . br . nr #L_INDENT +(\\$1) . in \\n[#L_INDENT]u . ta \\n[.l]u-\\n[#L_INDENT]u . \} . if \\n[#IN_ITEM] .nr #IN_ITEM_L_INDENT +(\\$1) .END \# \# +++INDENT RIGHT+++ \# .MAC IR END . if \\n[#INDENT_STYLE_BOTH] .IBX . nr #INDENT_STYLE_RIGHT 1 . nr #INDENT_ACTIVE 1 . nr #INDENT_RIGHT_ACTIVE 1 . ie '\\$1'' \{\ . br . ie \\n[#TAB_ACTIVE] \{\ . ll \\n[.l]u-\\n[#R_INDENT]u . ta \\n[.l]u-\\n[#L_INDENT]u . \} . el \{\ . ll \\n[.l]u-\\n[#R_INDENT]u . ta \\n[.l]u-\\n[#L_INDENT]u . \} . \} . el \{\ . br . nr #R_INDENT +(\\$1) . ie \\n[#TAB_ACTIVE] \{\ . ll \\n[.l]u-\\n[#R_INDENT]u . ta \\n[.l]u-\\n[#L_INDENT]u . \} . el \{\ . ll \\n[.l]u-\\n[#R_INDENT]u . ta \\n[.l]u-\\n[#L_INDENT]u . \} . \} .END \# \# +++INDENT BOTH+++ \# .MAC IB END . if \\n[#INDENT_STYLE_LEFT] .ILX . if \\n[#INDENT_STYLE_RIGHT] .IRX . nr #INDENT_STYLE_BOTH 1 . nr #INDENT_ACTIVE 1 . nr #INDENT_BOTH_ACTIVE 1 . ie '\\$1'' \{\ . br . in \\n[#BL_INDENT]u . ie \\n[#TAB_ACTIVE] \{\ . ll \\n[.l]u-\\n[#BR_INDENT]u . ta \\n[.l]u-\\n[#BR_INDENT]u . \} . el \{\ . ll \\n[.l]u-\\n[#BR_INDENT]u . ta \\n[.l]u-\\n[#BR_INDENT]u . \} . \} . el \{\ . br . nr #BL_INDENT (\\n[#INDENT]+\\$1) . ie \\n[#NUM_ARGS]=2 .nr #BR_INDENT +(\\$2) . el .nr #BR_INDENT \\n[#BL_INDENT] . ie \\n[#TAB_ACTIVE] \{\ . in \\n[#BL_INDENT]u . ll \\n[.l]u-\\n[#BR_INDENT]u . ta \\n[.l]u-\\n[#BL_INDENT]u . \} . el \{\ . in \\n[#BL_INDENT]u . ll \\n[.l]u-\\n[#BR_INDENT]u . ta \\n[.l]u-\\n[#BR_INDENT]u . \} . \} .END \# \# +++TEMPORARY INDENT+++ \# .MAC TI END . br . ie '\\$1'' \{\ . ti \\n[#T_INDENT]u . if \\n[#INDENT_LEFT_ACTIVE] .ti \\n[#T_INDENT]u+\\n[#L_INDENT]u . if \\n[#INDENT_BOTH_ACTIVE] .ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u . \} . el \{\ . nr #T_INDENT (\\$1) . ti \\n[#T_INDENT]u . \} .END \# \# +++HANGING INDENT+++ \# .MAC HI END . ie '\\$1'' .ti -\\n[#HL_INDENT]u . el \{\ . nr #HL_INDENT (\\$1) . ti -\\n[#HL_INDENT]u . \} .END \# \# +++INDENTS OFF+++ \# .MAC ILX END . ie \\n[#IN_ITEM] .nr #L_INDENT -\\n[#IN_ITEM_L_INDENT] . el \{\ . br . in 0 . rr #INDENT_LEFT_ACTIVE . \} . if '\\$1'CLEAR' \{\ . rr #L_INDENT . rr #INDENT_STYLE_LEFT . \} .END \# .MAC IRX END . br . rr #INDENT_RIGHT_ACTIVE . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB] . el \{\ . ie \\n[#COLUMNS] \{\ . ll \\n[#COL_L_LENGTH]u . ta \\n[.l]u . \} . el \{\ . ll \\n[#L_LENGTH]u . ta \\n[.l]u . \} . \} . if '\\$1'CLEAR' \{\ . rr #R_INDENT . rr #INDENT_STYLE_RIGHT . \} .END \# .MAC IBX END . br . in 0 . rr #INDENT_BOTH_ACTIVE . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB] . el \{\ . ie \\n[#COLUMNS] \{\ . ll \\n[#COL_L_LENGTH]u . ta \\n[.l]u . \} . el \{\ . ll \\n[#L_LENGTH]u . ta \\n[.l]u . \} . \} . if '\\$1'CLEAR' \{\ . rr #BL_INDENT . rr #BR_INDENT . rr #INDENT_STYLE_BOTH . \} .END \# .MAC IX END . if '\\$0'IX' \{\ . if !\\n[#IX_WARN] \{\ . tm1 "[mom]: Use of .IX is deprecated. Use .IQ instead. . tm1 " .IX will continue to behave as before, but to . tm1 " avoid this message, please update your document. . nr #IX_WARN 1 . \} . \} . br . in 0 . rr #INDENT_LEFT_ACTIVE . rr #INDENT_RIGHT_ACTIVE . rr #INDENT_BOTH_ACTIVE . if \\n[#INDENT_STYLE_RIGHT] \{\ . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB] . el \{\ . ie \\n[#COLUMNS] \{\ . ll \\n[#COL_L_LENGTH]u . ta \\n[.l]u . \} . el \{\ . ll \\n[#L_LENGTH]u . ta \\n[.l]u . \} . \} . \} . if \\n[#INDENT_STYLE_BOTH] \{\ . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB] . el \{\ . ie \\n[#COLUMNS] \{\ . ll \\n[#COL_L_LENGTH]u . ta \\n[.l]u . \} . el \{\ . ll \\n[#L_LENGTH]u . ta \\n[.l]u . \} . \} . \} . if '\\$1'CLEAR' \{\ . if \\n[#INDENT_STYLE_RIGHT] \{\ . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB] . el \{\ . ie \\n[#COLUMNS] \{\ . ll \\n[#COL_L_LENGTH]u . ta \\n[.l]u . \} . el \{\ . ll \\n[#L_LENGTH]u . ta \\n[.l]u . \} . \} . \} . if \\n[#INDENT_STYLE_BOTH] \{\ . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB] . el \{\ . ie \\n[#COLUMNS] \{\ . ll \\n[#COL_L_LENGTH]u . ta \\n[.l]u . \} . el \{\ . ll \\n[#L_LENGTH]u . ta \\n[.l]u . \} . \} . \} . rr #L_INDENT . rr #R_INDENT . rr #BL_INDENT . rr #BR_INDENT . rr #T_INDENT . rr #H_INDENT . rr #INDENT_STYLE_LEFT . rr #INDENT_STYLE_RIGHT . rr #INDENT_STYLE_BOTH . \} . rr #INDENT_ACTIVE .END \# \# ===================================================================== \# \# +++MULTIPLE COLUMNS+++ \# \# MULTIPLE COLUMNS ON \# ------------------- \# *Arguments: \# \# *Function: \# Marks the top of a column set \# .MAC MCO END . mk c .END \# \# MULTIPLE COLUMN RETURN \# ---------------------- \# *Arguments: \# \# *Function: \# Returns to the top of a column set \# .MAC MCR END . TRAP OFF . sp |\\n[c]u . TRAP .END \# \# MULTIPLE COLUMNS OFF \# -------------------- \# *Arguments: \# | \# *Function: \# Advances to the end of a column set \# *Notes: \# With no argument, advances to the next baseline (at the current \# leading value) beneath the longest column. With an argument \# (which requires a unit of measure), advances arg distance \# beneath the baseline of the deepest column. If the argument \# is zero, advances to the baseline of the deepest column. \# .MAC MCX END . TRAP OFF . ie '\\$1'' \{\ . TQ . sp |\\n[.h]u . \} . el \{\ . nr #MCX_ALD (\\$1) . TQ . ie \\n[#MCX_ALD]=0 .sp |\\n[.h]u-1v . el .sp |\\n[.h]u+\\n[#MCX_ALD]u . rr #MCX_ALD . \} . TRAP .END \# \# ===================================================================== \# \# +++TYPESETTING SUPPORT MACROS+++ \# \# TRAP \# ---- \# *Arguments: \# toggle \# *Function: \# Enables/disables traps. \# *Notes: \# EL and TN don't function as advertised on the last line before \# a trap (when they break the preceding line, they spring the \# trap, and groff won't back up to the line preceding the trap). \# TRAP is a kludge to get EL and TN work properly on last lines. \# The user simply enloses the offending lines in TRAP OFF/TRAP. \# .MAC TRAP END . ie '\\$1'' .vpt 1 . el .vpt 0 .END \# \# SILENT \# ------ \# *Arguments: \# | \# *Function: \# Diverts text so that it doesn't print, or turns the function off. \# *Notes: \# Useful for setting up autotabs where you don't want the line with \# the tab marks to print. \# \# Also aliased as COMMENT, in case user wants to input a batch of \# text that doesn't print. \# .MAC SILENT END . nr #SILENT 1 . if \\n[#QUAD] .br . ie '\\$1'' .di NO_FLASH . el \{\ . br . di . rm NO_FLASH . rr #SILENT . \} .END \# \# PRINT \# ----- \# *Function: \# Prints anything. A macro that helps keep my code nicely indented. \# .MAC PRINT END . nop \\$* .END \# \# CAPS \# ---- \# *Arguments: \# | \# *Function: \# Converts text to caps, or, if OFF, reverts to normal caps/lc. \# *Notes: \# For inline control of capitalization style, use \*[UC] and \# \*[LC]. \# .MAC CAPS END . ie '\\$1'' \{\ . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ . tr \[`a]\[`A] . tr \[^a]\[^A] . tr \['a]\['A] . tr \[:a]\[:A] . tr \[oa]\[oA] . tr \[~a]\[~A] . tr \[ae]\[AE] . tr \[`e]\[`E] . tr \[^e]\[^E] . tr \['e]\['E] . tr \[:e]\[:E] . tr \[`i]\[`I] . tr \[^i]\[^I] . tr \['i]\['I] . tr \[:i]\[:I] . tr \[`o]\[`O] . tr \[^o]\[^O] . tr \['o]\['O] . tr \[:o]\[:O] . tr \[~o]\[~O] . tr \[/o]\[/O] . tr \[`u]\[`U] . tr \[^u]\[^U] . tr \['u]\['U] . tr \[:u]\[:U] . tr \[,c]\[,C] . tr \[-d]\[-D] . tr \[~n]\[~N] . tr \[Sd]\[-D] . tr \[Tp]\[TP] . tr \['y]\['Y] . tr \[:y]\[:Y] . nr #CAPS_ON 1 . \} . el \{\ . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz . tr \[`a]\[`a] . tr \[^a]\[^a] . tr \['a]\['a] . tr \[:a]\[:a] . tr \[oa]\[oa] . tr \[~a]\[~a] . tr \[ae]\[ae] . tr \[`e]\[`e] . tr \[^e]\[^e] . tr \['e]\['e] . tr \[:e]\[:e] . tr \[`i]\[`i] . tr \[^i]\[^i] . tr \['i]\['i] . tr \[:i]\[:i] . tr \[`o]\[`o] . tr \[^o]\[^o] . tr \['o]\['o] . tr \[:o]\[:o] . tr \[~o]\[~o] . tr \[/o]\[/o] . tr \[`u]\[`u] . tr \[^u]\[^u] . tr \['u]\['u] . tr \[:u]\[:u] . tr \[,c]\[,c] . tr \[Sd]\[Sd] . tr \[~n]\[~n] . tr \[Tp]\[Tp] . tr \['y]\['y] . tr \[:y]\[:y] . rr #CAPS_ON . \} .END \# .MAC UC END \c . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ . tr \[`a]\[`A] . tr \[^a]\[^A] . tr \['a]\['A] . tr \[:a]\[:A] . tr \[oa]\[oA] . tr \[~a]\[~A] . tr \[ae]\[AE] . tr \[`e]\[`E] . tr \[^e]\[^E] . tr \['e]\['E] . tr \[:e]\[:E] . tr \[`i]\[`I] . tr \[^i]\[^I] . tr \['i]\['I] . tr \[:i]\[:I] . tr \[`o]\[`O] . tr \[^o]\[^O] . tr \['o]\['O] . tr \[:o]\[:O] . tr \[~o]\[~O] . tr \[/o]\[/O] . tr \[`u]\[`U] . tr \[^u]\[^U] . tr \['u]\['U] . tr \[:u]\[:U] . tr \[,c]\[,C] . tr \[Sd]\[-D] . tr \[~n]\[~N] . tr \[Tp]\[TP] . tr \['y]\['Y] . tr \[:y]\[:Y] . nr #CAPS_ON 1 .END \# .MAC LC END \c . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz . tr \[`a]\[`a] . tr \[^a]\[^a] . tr \['a]\['a] . tr \[:a]\[:a] . tr \[oa]\[oa] . tr \[~a]\[~a] . tr \[ae]\[ae] . tr \[`e]\[`e] . tr \[^e]\[^e] . tr \['e]\['e] . tr \[:e]\[:e] . tr \[`i]\[`i] . tr \[^i]\[^i] . tr \['i]\['i] . tr \[:i]\[:i] . tr \[`o]\[`o] . tr \[^o]\[^o] . tr \['o]\['o] . tr \[:o]\[:o] . tr \[~o]\[~o] . tr \[/o]\[/o] . tr \[`u]\[`u] . tr \[^u]\[^u] . tr \['u]\['u] . tr \[:u]\[:u] . tr \[,c]\[,c] . tr \[Sd]\[Sd] . tr \[~n]\[~n] . tr \[Tp]\[Tp] . tr \['y]\['y] . tr \[:y]\[:y] . rr #CAPS_ON .END \# \# SIZESPECS \# --------- \# Argument: \# \# Function: \# Gets cap-height, x-height, and descender depth of the \# current font at the current point size. \# *Notes: \# The routine is diverted so it remains invisible to output. \# .MAC SIZESPECS END . if '\\n[.z]'FLOAT*DIV' \ . if \\n[dn] .nr saved-dn \\n[dn] . di TYPESIZE E\R'#CAP_HEIGHT \\n[.cht]' e\R'#X_HEIGHT \\n[.cht]' y\R'#DESCENDER \\n[.cdp]' . br . ds $CAP_HEIGHT \\n[#CAP_HEIGHT]u . ds $X_HEIGHT \\n[#X_HEIGHT]u . ds $DESCENDER \\n[#DESCENDER]u . di . if '\\n[.z]'FLOAT*DIV' \ . nr dn \\n[saved-dn] .END \# \# ===================================================================== \# \# +++TYPESETTING ALIASES+++ \# .ALIAS ADD_SPACE ALD .ALIAS CENTRE CENTER .ALIAS COLOUR COLOR .ALIAS COMMENT SILENT .ALIAS CONDENSE CONDENSE_OR_EXTEND .ALIAS EXTEND CONDENSE_OR_EXTEND .ALIAS FAM FAMILY .ALIAS FONT FT .ALIAS HYPHENATE HY .ALIAS HYPHENATION HY .ALIAS HYSET HY_SET .ALIAS IBQ IBX .ALIAS ILQ ILX .ALIAS IQ IX .ALIAS IRQ IRX .ALIAS LIG LIGATURES .ALIAS NEWCOLOUR NEWCOLOR .ALIAS PADMARKER PAD_MARKER .ALIAS SP ALD .ALIAS SPACE ALD .ALIAS TABSET TAB_SET .ALIAS TB TAB .ALIAS UNDERSCORE_2 UNDERSCORE2 .ALIAS XCOLOUR XCOLOR .ALIAS PDF_LINK_COLOUR PDF_LINK_COLOR .ALIAS AUTO_TOC_RELOCATE AUTO_RELOCATE_TOC \# \# ==================================================================== \# \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES \# =============================================== \# \# DOC_MACRO_ERROR \# ---------- \# *Arguments: \# None. \# *Function: \# Warning message if DOC_ called before START. \# .MAC DOC_MACRO_ERROR END . if '\\$1'DOC_L_MARGIN' .ds $REPLACEMENT L_MARGIN . if '\\$1'DOC_R_MARGIN' .ds $REPLACEMENT R_MARGIN . if '\\$1'DOC_LINE_LENGTH' .ds $REPLACEMENT LL . if '\\$1'DOC_FAMILY' .ds $REPLACEMENT "FAMILY or FAM . if '\\$1'DOC_PT_SIZE' .ds $REPLACEMENT PT_SIZE . if '\\$1'DOC_LEAD' .ds $REPLACEMENT LS . if '\\$1'DOC_QUAD' .ds $REPLACEMENT QUAD . tm1 "[mom]: \\$1 at line \\n[.c] of '\\n[.F]' should not be used before START. . tm1 " Use \\*[$REPLACEMENT] instead. . ab Aborting. .END \# \# +++PAGE DIMENSIONS+++ \# \# PAPER SIZE \# ---------- \# *Arguments: \# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5 \# *Function: \# Sets up dimensions for different paper sizes. \# .MAC PAPER END . ds $PAPER \\$1 . if '\\*[$PAPER]'LETTER' \{\ . PAGEWIDTH 8.5i . PAGELENGTH 11i . \} . if '\\*[$PAPER]'LEGAL' \{\ . PAGEWIDTH 8.5i . PAGELENGTH 14i . \} . if '\\*[$PAPER]'STATEMENT' \{\ . PAGEWIDTH 5.5i . PAGELENGTH 8.5i . \} . if '\\*[$PAPER]'TABLOID' \{\ . PAGEWIDTH 11i . PAGELENGTH 17i . \} . if '\\*[$PAPER]'LEDGER' \{\ . PAGEWIDTH 17i . PAGELENGTH 11i . \} . if '\\*[$PAPER]'FOLIO' \{\ . PAGEWIDTH 8.5i . PAGELENGTH 13i . \} . if '\\*[$PAPER]'QUARTO' \{\ . PAGEWIDTH 610p . PAGELENGTH 780p . \} . if '\\*[$PAPER]'10x14' \{\ . PAGEWIDTH 10i . PAGELENGTH 14i . \} . if '\\*[$PAPER]'EXECUTIVE' \{\ . PAGEWIDTH 7.25i . PAGELENGTH 10.5i . \} . if '\\*[$PAPER]'A3' \{\ . PAGEWIDTH 842p . PAGELENGTH 1190p . \} . if '\\*[$PAPER]'A4' \{\ . PAGEWIDTH 595p . PAGELENGTH 842p . \} . if '\\*[$PAPER]'A5' \{\ . PAGEWIDTH 421p . PAGELENGTH 595p . \} . if '\\*[$PAPER]'B4' \{\ . PAGEWIDTH 709p . PAGELENGTH 1002p . \} . if '\\*[$PAPER]'B5' \{\ . PAGEWIDTH 501p . PAGELENGTH 709p . \} . if '\\$2'LANDSCAPE' \{\ . nr #PAGE_WIDTH_TMP \\n[#PAGE_WIDTH] . PAGEWIDTH \\n[#PAGE_LENGTH]u . PAGELENGTH \\n[#PAGE_WIDTH_TMP]u . \} . if !r#L_MARGIN .L_MARGIN \\n[.o] . if !r#R_MARGIN .R_MARGIN 1i .END \# \# ==================================================================== \# \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++ \# \# PRINTSTYLE \# ---------- \# *Arguments: \# TYPESET | TYPEWRITE [SINGLESPACE] \# *Function: \# Sets type specs for typewriter-style or typeset output. \# *Notes: \# Number registers: TYPEWRITE=1, TYPESET=2. \# .MAC PRINTSTYLE END . if !\\n[#COLLATE]=1 \{\ . if !d$PAPER .PAPER LETTER . if '\\$1'TYPEWRITE' \{\ . nr #PRINT_STYLE 1 . if !\\n[#DOC_TYPE]=4 .L_MARGIN 6P . if !\\n[#DOC_TYPE]=4 .R_MARGIN 6P . ds $TYPEWRITER_FAM C . ds $TYPEWRITER_PS 12 . TYPEWRITER . color 0 . ie '\\$2'SINGLESPACE' \{\ . nr #SINGLE_SPACE 1 . vs 12 . ie \\n[#DOC_TYPE]=4 .nr #FOOTER_ADJ \\n[.v] . el .nr #FOOTER_ADJ \\n[.v]*2 . nr #ORIGINAL_DOC_LEAD \\n[.v] . \} . el \{\ . if !\\n[#DOC_TYPE]=4 \{\ . vs 24 . nr #FOOTER_ADJ \\n[.v]/2 . nr #ORIGINAL_DOC_LEAD \\n[.v] . \} . \} . QUAD L . HY OFF . SMARTQUOTES OFF . if !\\n[#PP_INDENT] .nr #PP_INDENT 3P . HDRFTR_RIGHT_CAPS . nr #BOLDER_UNITS 0 . nr #CONDENSE 0 . nr #EXTEND 0 . if !\\n[#ITALIC_MEANS_ITALIC] .rm IT . rm BD . rm BDI . if !\\n[#ITALIC_MEANS_ITALIC] .rm PREV . if !\\n[#SLANT_MEANS_SLANT] .UNDERLINE_SLANT . if !\\n[#ITALIC_MEANS_ITALIC] .UNDERLINE_ITALIC . if !\\n[#UNDERLINE_QUOTES] .UNDERLINE_QUOTES . nr #IGNORE_COLUMNS 1 . nr #RULE_WEIGHT 500 . char \[em] -- . tr `' . tr \[lq]" . tr \[rq]" . \} . if '\\$1'TYPESET' \{\ . nr #PRINT_STYLE 2 . if !\\n[#DOC_TYPE]=4 .L_MARGIN 6P . if !\\n[#DOC_TYPE]=4 .R_MARGIN 6P . FAMILY T . FT R . if !\\n[#DOC_TYPE]=4 .ps 12.5 . if !\\n[#DOC_TYPE]=4 .vs 16 .\" In DEFAULTS, TRAPS is run with this leading, so we need a register to .\" hold it for use with the .sp in FOOTER . nr #FOOTER_ADJ 12000 . JUSTIFY . HY . HY_SET 2 36p 1p . KERN . LIG . SS 0 . SMARTQUOTES . if !\\n[#PP_INDENT] \{\ . in 2m \"Set indent . nr #PP_INDENT \\n[.i] \"Read into #PP_INDENT . in 0 \"Remove indent . \} . HDRFTR_RIGHT_CAPS . rr #IGNORE_COLUMNS . \} .\" Set up default style for nine levels of headings . nr #HD_LEVEL 0 1 \" loop step . nr #LOOP 9 \" loop count . while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\ . HEADING_STYLE \\n[#HD_LEVEL] \ FONT B \ SIZE +0 \ QUAD L \ COLOR black .\" Set up default style for nine levels of TOC headings . TOC_ENTRY_STYLE \\n[#HD_LEVEL] \ FONT R \ SIZE +0 \ COLOR black . \} .\" Set up decreasing sizes for headings levels 1 - 3, starting at +3 . nr #HD_LEVEL 0 1 \" loop step . nr #LOOP 3 \" loop count . nr #HD_SIZE 4 1 . while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\ . nr #HD_SIZE_CHANGE \\n-[#HD_SIZE] . ds $HEAD_\\n[#HD_LEVEL]_SIZE +\\n[#HD_SIZE_CHANGE] . \} .\" Set up TOC title style . TOC_TITLE_STYLE FONT R SIZE +0 INDENT 0 .\" Set up captions, labels, sources . LABELS ALL FONT B AUTOLEAD 2 . LABELS EQN FONT R QUAD RIGHT . CAPTIONS ALL AUTOLEAD 2 . CAPTIONS EQN QUAD CENTER . SOURCES TBL AUTOLEAD 2 . \} .END \# \# PRINTSTYLE TYPEWRITE control. \# .MAC TYPEWRITER_FAMILY END . ds $TYPEWRITER_FAM \\$1 .END \# .ALIAS TYPEWRITER_FAM TYPEWRITER_FAMILY \# .MAC TYPEWRITER_SIZE END . ds $TYPEWRITER_PS \\$1 .END \# .MAC TYPEWRITER END . fam \\*[$TYPEWRITER_FAM] . ft R . ps \\*[$TYPEWRITER_PS] .END \# \# ITALIC MEANS ITALIC \# ------------------- \# *Argument: \# \# *Function: \# Instructs TYPEWRITE to treat italics as italics, whether \# invoked via control lines or inline. \# *Notes: \# ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive, \# hence invoking the one automatically turns off the other. \# .MAC ITALIC_MEANS_ITALIC END . if \\n[#PRINT_STYLE]=1 \{\ . nr #ITALIC_MEANS_ITALIC 1 . rr #UNDERLINE_ITALIC . rm ROM . rm IT . rm PREV . ds ROM \Ef[R] . ds IT \Ef[I] . ds PREV \Ef[] . \} .END \# \# UNDERLINE ITALIC \# ---------------- \# *Argument: \# \# *Function: \# Instructs TYPEWRITE to underline italics, whether invoked \# via control lines or inline. \# *Notes: \# UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive, \# hence invoking the one automatically turns off the other. \# \# UNDERLINE_ITALIC is the default for TYPEWRITE. \# .MAC UNDERLINE_ITALIC END . if \\n[#PRINT_STYLE]=1 \{\ . nr #UNDERLINE_ITALIC 1 . rr #ITALIC_MEANS_ITALIC . rm ROM . rm IT . rm PREV . ds ROM \E*[ULX] . ds IT \E*[UL] . ds PREV \E*[ULX] . \} .END \# \# UNDERLINE SLANT \# --------------- \# *Arguments: \# | \# *Function: \# Instructs TYPEWRITE to underline occurrences of \*[SLANT], or \# turns feature off. \# *Notes: \# Users may want \*[SLANT] to mean slant in TYPEWRITE, although \# most of the time, \*[SLANT] most likely means the user wanted \# italic but didn't have it, ergo the need to tell TYPEWRITE to \# treat \*[SLANT] as italic (i.e. underlined). \# \# UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive, \# hence invoking the one automatically turns off the other. \# \# UNDERLINE_SLANT is the default for TYPEWRITE. \# .MAC UNDERLINE_SLANT END . if \\n[#PRINT_STYLE]=1 \{\ . rr #SLANT_MEANS_SLANT . nr #UNDERLINE_SLANT 1 . rm SLANT . rm SLANTX . ds SLANT \ER'#SLANT_ON 1'\E*[UL] . ds SLANTX \ER'#SLANT_ON 0'\E*[ULX] . \} .END \# .MAC SLANT_MEANS_SLANT END . if \\n[#PRINT_STYLE]=1 \{\ . rr #UNDERLINE_SLANT . nr #SLANT_MEANS_SLANT 1 . rm SLANT . rm SLANTX . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]' . ds SLANTX \ER'#SLANT_ON 0'\ES'0' . \} .END \# .MAC IGNORE_COLUMNS END . if \\n[#PRINT_STYLE]=1 .nr #NO_COLUMNS 1 .END \# \# ==================================================================== \# \# +++COPY STYLE -- DRAFT OR FINAL+++ \# \# COPY STYLE \# ---------- \# *Arguments: \# DRAFT | FINAL \# *Function: \# Sets registers that are used to determine what to put \# in the default header, and how to number pages. \# *Notes: \# DOCTYPE must come before COPYSTYLE. \# .MAC COPYSTYLE END . ds $COPY_STYLE \\$1 . if '\\*[$COPY_STYLE]'DRAFT' \{\ . nr #COPY_STYLE 1 . if !d$DRAFT .DRAFT 1 . \} . if '\\*[$COPY_STYLE]'FINAL' .nr #COPY_STYLE 2 . if !d$CHAPTER_STRING .CHAPTER_STRING "Chapter" . if !d$DRAFT_STRING .DRAFT_STRING "Draft" . if !d$REVISION_STRING .REVISION_STRING "Rev." .\" Default . if \\n[#DOC_TYPE]=1 \{\ . ie \\n[#COPY_STYLE]=1 \{\ . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE] . el .PAGENUM_STYLE roman . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\ . ie \\n[#DRAFT_WITH_PAGENUM] .ds $HDRFTR_CENTER . el \{\ . ie '\\*[$REVISION]'' \{\ . ds $HDRFTR_CENTER \ \\*[$DRAFT_STRING]\\*[$DRAFT] . \} . el \{\ . ds $HDRFTR_CENTER \ \\*[$DRAFT_STRING]\\*[$DRAFT], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . \} . \} . \} . el \{\ . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE] . el .PAGENUM_STYLE DIGIT . if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\ . ds $HDRFTR_CENTER . rr #USER_DEF_HDRFTR_CENTER . \} . \} . \} .\" Chapter . if \\n[#DOC_TYPE]=2 \{\ .\" Copystyle DRAFT . ie \\n[#COPY_STYLE]=1 \{\ . ie \\n[#PAGENUM_STYLE_SET] \ . PAGENUM_STYLE \\*[$PAGENUM_STYLE] . el \ . PAGENUM_STYLE roman . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\ . ie \\n[#DRAFT_WITH_PAGENUM] \{\ . ie '\\*[$CHAPTER]'' \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \ . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE] . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] . \} . el \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \ . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE] . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] . \} . \} . el \{\ . ie '\\*[$REVISION]'' \{\ . ie '\\*[$CHAPTER]'' \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \{\ . ie '\\*[$DRAFT]'' \ . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE] . el \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_TITLE], \ \\*[$DRAFT_STRING]\\*[$DRAFT] . \} . \} . el \{\ . ie '\\*[$DRAFT]'' \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_STRING] . \} . el \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_STRING], \ \\*[$DRAFT_STRING]\\*[$DRAFT] . \} . \} . \} . el \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \{\ . ie '\\*[$DRAFT]'' \ . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE] . el \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_TITLE_1], \ \\*[$DRAFT_STRING]\\*[$DRAFT] . \} . \} . el \{\ . ie '\\*[$DRAFT]'' \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_STRING] \\*[$CHAPTER] . \} . el \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_STRING] \\*[$CHAPTER], \ \\*[$DRAFT_STRING]\\*[$DRAFT] . \} . \} . \} . \} . el \{\ . ie '\\*[$CHAPTER]'' \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \{\ . ie '\\*[$DRAFT]'' \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_TITLE], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . el \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_TITLE], \ \\*[$DRAFT_STRING]\\*[$DRAFT], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . \} . el \{\ . ie '\\*[$DRAFT]'' \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_STRING], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . el \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_STRING], \ \\*[$DRAFT_STRING]\\*[$DRAFT], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . \} . \} . el \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \{\ . ie '\\*[$DRAFT]'' \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_TITLE], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . el \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_TITLE], \ \\*[$DRAFT_STRING]\\*[$DRAFT], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . \} . el \{\ . ie '\\*[$DRAFT]'' \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_STRING] \\*[$CHAPTER], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . el \{\ . ds $HDRFTR_CENTER \ \\*[$CHAPTER_STRING] \\*[$CHAPTER], \ \\*[$DRAFT_STRING]\\*[$DRAFT], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . \} . \} . \} . \} . \} . \} .\" Copystyle FINAL . el \{\ . if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\ . ie \\n[#PAGENUM_STYLE_SET] \ . PAGENUM_STYLE \\*[$PAGENUM_STYLE] . el .PAGENUM_STYLE DIGIT . ie '\\*[$CHAPTER]'' \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \ . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE] . el \ . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] . \} . el \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \ . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE] . el \ . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] . \} . \} . \} . \} .\" Named . if \\n[#DOC_TYPE]=3 \{\ . ie \\n[#COPY_STYLE]=1 \{\ . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE] . el .PAGENUM_STYLE roman . ie \\n[#DRAFT_WITH_PAGENUM] \ . ds $HDRFTR_CENTER \\*[$DOC_TYPE] . el \{\ . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\ . ie '\\*[$REVISION]'' \{\ . ie '\\*[$DRAFT]'' \ . ds $HDRFTR_CENTER \\*[$DOC_TYPE] . el \{\ . ds $HDRFTR_CENTER \ \\*[$DOC_TYPE], \ \\*[$DRAFT_STRING]\\*[$DRAFT] . \} . \} . el \{\ . ie '\\*[$DRAFT]'' \{\ . ds $HDRFTR_CENTER \ \\*[$DOC_TYPE], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . el \{\ . ds $HDRFTR_CENTER \ \\*[$DOC_TYPE], \ \\*[$DRAFT_STRING]\\*[$DRAFT], \ \\*[$REVISION_STRING] \\*[$REVISION] . \} . \} . \} . \} . \} . el \{\ . if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\ . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE] . el .PAGENUM_STYLE DIGIT . ds $HDRFTR_CENTER \\*[$DOC_TYPE] . \} . \} . \} .END \# \# ==================================================================== \# \# +++COLLECT DOC INFO -- STRINGS AND REGISTERS FOR REFERENCE MACROS+++ \# \# *Arguments: \# various string/register arguments \# *Function: \# Collect information about documents. \# .MAC DOCTITLE END . rr #DOCTITLE_NUM . nr #DOCTITLE_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#DOCTITLE_NUM] \{\ . ds $DOC_TITLE_\\n+[#DOCTITLE_NUM] \\$\\n[#DOCTITLE_NUM] . \} . ds $DOC_TITLE \\$* . PDF_TITLE \\*[$DOC_TITLE] .END \# .MAC TITLE END \"Document title . ie \\n[#NUM_ARGS]=0 \{\ . if \\n[#TITLE_NUM] \{\ . nr #ITEM 0 1 . while \\n[#TITLE_NUM]>\\n[#ITEM] \{\ . rm $TITLE_\\n+[#ITEM] . \} . rr #TITLE_NUM . \} . \} . el \{\ . nr #TITLE_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#TITLE_NUM] \{\ . ds $TITLE_\\n+[#TITLE_NUM] \\$\\n[#TITLE_NUM] . \} . ds $TITLE \\$* . \} .END \# .MAC SUBTITLE END \"Document sub-title . ie \\n[#NUM_ARGS]=0 \{\ . if \\n[#SUBTITLE_NUM] \{\ . nr #ITEM 0 1 . while \\n[#SUBTITLE_NUM]>\\n[#ITEM] \{\ . rm $SUBTITLE_\\n+[#ITEM] . \} . rr #SUBTITLE_NUM . rm $SUBTITLE . \} . \} . el \{\ . if '\\$1'DOC_COVER' \{\ . shift . nr #SUBTITLE_DOC_COVER_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_DOC_COVER_NUM] \{\ . ds $SUBTITLE_DOC_COVER_\\n+[#SUBTITLE_DOC_COVER_NUM] \ \\$\\n[#SUBTITLE_DOC_COVER_NUM] . \} . return . \} . if '\\$1'COVER' \{\ . shift . nr #SUBTITLE_COVER_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_COVER_NUM] \{\ . ds $SUBTITLE_COVER_\\n+[#SUBTITLE_COVER_NUM] \ \\$\\n[#SUBTITLE_COVER_NUM] . \} . return . \} . nr #SUBTITLE_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_NUM] \{\ . ds $SUBTITLE_\\n+[#SUBTITLE_NUM] \\$\\n[#SUBTITLE_NUM] . \} . ds $SUBTITLE \\$* . \} .END \# .MAC CHAPTER END \"If document is a chapter, the chapter number . nr #CHAPTER_CALLED 1 . ds $CHAPTER \\$1 . if r #CH_NUM \ . if \B'\\*[$CHAPTER]' .nr #CH_NUM \\*[$CHAPTER] .END \# .MAC CHAPTER_TITLE END \" This defines what comes after Chapter # . ie \\n[#NUM_ARGS]=0 \{\ . if \\n[#CHAPTER_TITLE_NUM] \{\ . nr #ITEM 0 1 . while \\n[#CHAPTER_TITLE_NUM]>\\n[#ITEM] \{\ . rm $CHAPTER_TITLE_\\n+[#ITEM] . \} . rr #CHAPTER_TITLE_NUM . rm $CHAPTER_TITLE . \} . \} . el \{\ . rr #CHAPTER_TITLE_NUM . nr #CHAPTER_TITLE_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#CHAPTER_TITLE_NUM] \{\ . ds $CHAPTER_TITLE_\\n+[#CHAPTER_TITLE_NUM] \ \\$\\n[#CHAPTER_TITLE_NUM] . \} . ds $CHAPTER_TITLE \\$* . \} .END \# .MAC DRAFT END \"Draft number . ie '\\$1'' .ds $DRAFT . el .ds $DRAFT " \\$1 .END \# .MAC REVISION END \"Revision number . ds $REVISION \\$1 .END \# .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number . nr #DRAFT_WITH_PAGENUM 1 .END \# .MAC AUTHOR END \"Author. Enclose all args fully in double quotes. . if '\\$1'DOC_COVER' \{\ . shift . nr #AUTHOR_DOCCOVER_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_DOCCOVER_NUM] \{\ . ds $AUTHOR_DOCCOVER_\\n+[#AUTHOR_DOCCOVER_NUM] \ \\$\\n[#AUTHOR_DOCCOVER_NUM] . \} . return . \} . if '\\$1'COVER' \{\ . shift . nr #AUTHOR_COVER_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_COVER_NUM] \{\ . ds $AUTHOR_COVER_\\n+[#AUTHOR_COVER_NUM] \\$\\n[#AUTHOR_COVER_NUM] . \} . return . \} . nr #AUTHOR_NUM 0 1 . rm $AUTHORS . while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\ . ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM] . as $AUTHORS \\*[$AUTHOR_\\n[#AUTHOR_NUM]], \" . \} . ds $AUTHOR \\*[$AUTHOR_1] . substring $AUTHORS 0 -2 . ds PDF_AUTHORS \\*[$AUTHORS] . pdfmomclean PDF_AUTHORS . nop \!x X ps:exec [/Author (\\*[PDF_AUTHORS]) /DOCINFO pdfmark .END \# .ALIAS EDITOR AUTHOR \# .MAC COPYRIGHT END \"For use on cover pages only . ie \\n[#NUM_ARGS]=1 \{\ . ds $COPYRIGHT \[co]\\$1 . rm $COPYRIGHT_DOCCOVER . rm $COPYRIGHT_COVER . \} . el \{\ . if '\\$1'DOC_COVER' .ds $COPYRIGHT_DOCCOVER \[co]\\$2 . if '\\$1'COVER' .ds $COPYRIGHT_COVER \[co]\\$2 . \} .END \# .MAC MISC END \"For use on cover pages only; enclose all args in double quotes . ie \\n[#NUM_ARGS]=0 \{\ . if \\n[#MISC_NUM] \{\ . nr #ITEM 0 1 . while \\n[#MISC_NUM]>\\n[#ITEM] \{\ . rm $MISC_\\n+[#ITEM] . \} . rr #MISC_NUM . rr #NUM_MISCS . \} . if \\n[#MISC_DOC_COVER_NUM] \{\ . nr #ITEM 0 1 . while \\n[#MISC_DOC_COVER_NUM]>\\n[#ITEM] \{\ . rm $MISC_DOC_COVER_\\n+[#ITEM] . \} . rr #MISC_DOC_COVER_NUM . rr #NUM_MISCS . \} . if \\n[#MISC_COVER_NUM] \{\ . nr #ITEM 0 1 . while \\n[#MISC_COVER_NUM]>\\n[#ITEM] \{\ . rm $MISC_COVER_\\n+[#ITEM] . \} . rr #MISC_COVER_NUM . rr #NUM_MISCS . \} . \} . el \{\ . if !'\\$1'DOC_COVER' \{\ . if !'\\$1'COVER' .nr #NEITHER 1 . \} . if !'\\$1'COVER' \{\ . if !'\\$1'DOC_COVER' .nr #NEITHER 1 . \} . if '\\$1'DOC_COVER' \{\ . shift . nr #MISC_DOC_COVER_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#MISC_DOC_COVER_NUM] \{\ . ds $MISC_DOC_COVER_\\n+[#MISC_DOC_COVER_NUM] \ \\$[\\n[#MISC_DOC_COVER_NUM]] . \} . nr #NUM_MISCS_DOCCOVER \\n[#NUM_ARGS] . \} . if '\\$1'COVER' \{\ . shift . nr #MISC_COVER_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#MISC_COVER_NUM] \{\ . ds $MISC_COVER_\\n+[#MISC_COVER_NUM] \\$[\\n[#MISC_COVER_NUM]] . \} . nr #NUM_MISCS_COVER \\n[#NUM_ARGS] . \} . if \\n[#NEITHER]=1 \{\ . nr #MISC_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#MISC_NUM] \{\ . ds $MISC_\\n+[#MISC_NUM] \\$[\\n[#MISC_NUM]] . \} . nr #NUM_MISCS \\n[#NUM_ARGS] . rr #NEITHER . \} . \} .END \# .MAC PAGENUMBER END \"Page # that appears on page one. . nr #n%_AT_PAGENUM_SET \\n% . nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET] . rr #n%_AT_PAGENUM_SET . nr #PAGE_NUM_SET 1 .END \# \# ==================================================================== \# \# +++TYPE OF DOCUMENT+++ \# \# DOCUMENT TYPE \# ------------- \# *Argument: \# DEFAULT | CHAPTER | NAMED " | LETTER \# *Function: \# Creates strings and sets registers for document types. \# *Notes: \# Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4 \# .MAC DOCTYPE END . if '\\$1'DEFAULT' .nr #DOC_TYPE 1 . if '\\$1'CHAPTER' .nr #DOC_TYPE 2 . if '\\$1'NAMED' \{\ . ds $DOC_TYPE \\$2 . nr #DOC_TYPE 3 . \} . if '\\$1'LETTER' \{\ . nr #DOC_TYPE 4 . L_MARGIN 1.125i . R_MARGIN 1.125i . ps 12 . vs 13.5 . nr #FOOTER_ADJ \\n[.v] . DOCHEADER OFF . PARA_INDENT 3m . INDENT_FIRST_PARAS . PARA_SPACE . ds $SUITE \En[#SUITE] . HEADER_MARGIN 3P+6p . HEADER_GAP 3P . FOOTERS . FOOTER_RULE OFF . FOOTER_LEFT "" . FOOTER_CENTER "" . FOOTER_RIGHT_SIZE +0 . FOOTER_RIGHT "\&.../\E*[$SUITE] . FOOTER_ON_FIRST_PAGE . em ALL_DONE . \} .END \# \# +++LETTER MACROS+++ \# \# First, create a register to hold incrementing numbers to be \# appended to LETTERHEAD. \# .nr #FIELD 0 1 \# \# DATE \# ---- \# *Arguments: \# \# *Function: \# Stores date (entered on the line after .DATE) in diversion \# LETTERHEAD \# .MAC DATE END . if !'\\n[.z]'' .di . di LETTERHEAD\\n+[#FIELD] . ie \\n[#FIELD]=1 \{\ . nr #DATE_FIRST 1 . RIGHT . \} . el .LEFT .END \# \# TO \# -- \# *Arguments: \# \# *Function: \# Stores addressee address (entered on the line after .TO) in \# diversion LETTERHEAD \# .MAC TO END . if !'\\n[.z]'' .di . di LETTERHEAD\\n+[#FIELD] . LEFT .END \# \# FROM \# ---- \# *Arguments: \# \# *Function: \# Stores addresser address (entered on the line after .FROM) in \# diversion LETTERHEAD \# .MAC FROM END . if !'\\n[.z]'' .di . di LETTERHEAD\\n+[#FIELD] . LEFT .END \# \# GREETING \# -------- \# *Arguments: \# \# *Function: \# Stores greeting (entered on the line after .GREETING) in \# diversion LETTERHEAD \# .MAC GREETING END . if !'\\n[.z]'' .di . di LETTERHEAD\\n+[#FIELD] . LEFT .END \# \# CLOSING \# ------- \# *Arguments: \# \# *Function: \# Stores greeting in diversion CLOSING. \# .MAC CLOSING END . if '\\*[$SIG_SPACE]'' .ds $SIG_SPACE 3v . ie ( (2v+\\*[$SIG_SPACE]) > \\n[.t] ) \{\ . ch HEADER . ch FOOTER . br . tm1 "[mom]: Insufficient room for \\$0 and signature line. . ab Aborting '\\n[.F]'. . \} . el .br . nr #CLOSING 1 . di CLOSING_TEXT .END \# \# CLOSING INDENT \# -------------- \# *Argument: \# \# *Function: \# Defines string $CLOSE_INDENT for use in macro, ALL_DONE. \# .MAC CLOSING_INDENT END . ds $CLOSE_INDENT \\$1 .END \# \# SIGNATURE_SPACE \# --------------- \# *Argument: \# \# *Function: \# Defines string $SIG_SPACE for use in macro, ALL_DONE. \# .MAC SIGNATURE_SPACE END . ds $SIG_SPACE \\$1 .END \# \# NO SUITE \# -------- \# *Arguments: \# \# *Function: \# Redefines $FOOTER_RIGHT to blank so that a suite number doesn't \# appear at the bottom of letter pages. \# .MAC NO_SUITE END . FOOTER_RIGHT "" .END \# \# ==================================================================== \# \# +++DEFAULTS+++ \# \# TYPE-STYLE CONTROL MACROS \# ------------------------- \# The control macros for family, font, size, quad and color are here \# grouped together. Each (e.g. _FAMILY or _FONT) tests for a calling \# alias before performing the action(s) appropriate to the calling \# macro. Defaults for all these guys are set in DEFAULTS, and listed \# in the "Control Macros" section of the documentation pertinent to \# the macro whose style is to be changed. \# .MAC _FAMILY END . if '\\$0'AUTHOR_FAMILY' \ . ds $AUTHOR_FAM \\$1 . if '\\$0'BIBLIOGRAPHY_FAMILY' \ . ds $BIB_FAM \\$1 . if '\\$0'BIBLIOGRAPHY_STRING_FAMILY' \ . ds $BIB_STRING_FAM \\$1 . if '\\$0'BLOCKQUOTE_FAMILY' \ . ds $BQUOTE_FAM \\$1 . if '\\$0'CITATION_FAMILY' \ . ds $BQUOTE_FAM \\$1 . if '\\$0'CITE_FAMILY' \ . ds $BQUOTE_FAM \\$1 . if '\\$0'CHAPTER_TITLE_FAMILY' \ . ds $CHAPTER_TITLE_FAM \\$1 . if '\\$0'COVER_AUTHOR_FAMILY' \ . ds $COVER_AUTHOR_FAM \\$1 . if '\\$0'COVER_CHAPTER_TITLE_FAMILY' \ . ds $COVER_CHAPTER_TITLE_FAM \\$1 . if '\\$0'COVER_COPYRIGHT_FAMILY' \ . ds $COVER_COPYRIGHT_FAM \\$1 . if '\\$0'COVER_DOCTYPE_FAMILY' \ . ds $COVER_DOCTYPE_FAM \\$1 . if '\\$0'COVER_FAMILY' \ . ds $COVER_FAM \\$1 . if '\\$0'COVER_MISC_FAMILY' \ . ds $COVER_MISC_FAM \\$1 . if '\\$0'COVER_SUBTITLE_FAMILY' \ . ds $COVER_SUBTITLE_FAM \\$1 . if '\\$0'COVER_TITLE_FAMILY' \ . ds $COVER_TITLE_FAM \\$1 . if '\\$0'DOC_COVER_AUTHOR_FAMILY' \ . ds $DOC_COVER_AUTHOR_FAM \\$1 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FAMILY' \ . ds $DOC_COVER_CHAPTER_TITLE_FAM \\$1 . if '\\$0'DOC_COVER_COPYRIGHT_FAMILY' \ . ds $DOC_COVER_COPYRIGHT_FAM \\$1 . if '\\$0'DOC_COVER_DOCTYPE_FAMILY' \ . ds $DOC_COVER_DOCTYPE_FAM \\$1 . if '\\$0'DOC_COVER_FAMILY' \ . ds $DOC_COVER_FAM \\$1 . if '\\$0'DOC_COVER_MISC_FAMILY' \ . ds $DOC_COVER_MISC_FAM \\$1 . if '\\$0'DOC_COVER_SUBTITLE_FAMILY' \ . ds $DOC_COVER_SUBTITLE_FAM \\$1 . if '\\$0'DOC_COVER_TITLE_FAMILY' \ . ds $DOC_COVER_TITLE_FAM \\$1 . if '\\$0'DOCHEADER_FAMILY' \ . ds $DOCHEADER_FAM \\$1 . if '\\$0'DOCTYPE_FAMILY' \ . ds $DOCTYPE_FAM \\$1 . if '\\$0'ENDNOTE_FAMILY' \ . ds $EN_FAM \\$1 . if '\\$0'ENDNOTE_NUMBER_FAMILY' \ . ds $EN_NUMBER_FAM \\$1 . if '\\$0'ENDNOTE_LINENUMBER_FAMILY' \ . ds $EN_LN_FAM \\$1 . if '\\$0'ENDNOTE_STRING_FAMILY' \ . ds $EN_STRING_FAM \\$1 . if '\\$0'ENDNOTE_TITLE_FAMILY' \ . ds $EN_TITLE_FAM \\$1 . if '\\$0'EPIGRAPH_FAMILY' \ . ds $EPI_FAM \\$1 . if '\\$0'FOOTNOTE_FAMILY' \ . ds $FN_FAM \\$1 . if '\\$0'HDRFTR_CENTER_FAMILY' \ . ds $HDRFTR_CENTER_FAM \\$1 . if '\\$0'HDRFTR_FAMILY' \{\ . ds $HDRFTR_FAM \\$1 . ds $HDRFTR_LEFT_FAM \\$1 . ds $HDRFTR_CENTER_FAM \\$1 . ds $HDRFTR_RIGHT_FAM \\$1 . \} . if '\\$0'HDRFTR_LEFT_FAMILY' \ . ds $HDRFTR_LEFT_FAM \\$1 . if '\\$0'HDRFTR_RIGHT_FAMILY' \ . ds $HDRFTR_RIGHT_FAM \\$1 . if '\\$0'LINENUMBER_FAMILY' \ . ds $LN_FAM \\$1 . if '\\$0'PAGENUM_FAMILY' \ . ds $PAGE_NUM_FAM \\$1 . if '\\$0'QUOTE_FAMILY' \ . ds $QUOTE_FAM \\$1 . if '\\$0'SUBTITLE_FAMILY' \ . ds $SUBTITLE_FAM \\$1 . if '\\$0'TITLE_FAMILY' \ . ds $TITLE_FAM \\$1 . if '\\$0'TOC_FAMILY' \ . ds $TOC_FAM \\$1 . if '\\$0'TOC_FAM' \ . ds $TOC_FAM \\$1 . if '\\$0'TOC_HEADER_FAMILY' \ . ds $TOC_HEADER_FAM \\$1 . if '\\$0'TOC_PN_FAMILY' \ . ds $TOC_PN_FAM \\$1 .END \# .MAC _FONT END . if '\\$0'AUTHOR_FONT' \ . ds $AUTHOR_FT \\$1 . if '\\$0'BIBLIOGRAPHY_FONT' \ . ds $BIB_FT \\$1 . if '\\$0'BIBLIOGRAPHY_STRING_FONT' \ . ds $BIB_STRING_FT \\$1 . if '\\$0'BLOCKQUOTE_FONT' \ . ds $BQUOTE_FT \\$1 . if '\\$0'CITATION_FONT' \ . ds $BQUOTE_FT \\$1 . if '\\$0'CITE_FONT' \ . ds $BQUOTE_FT \\$1 . if '\\$0'CHAPTER_TITLE_FONT' \ . ds $CHAPTER_TITLE_FT \\$1 . if '\\$0'COVER_AUTHOR_FONT' \ . ds $COVER_AUTHOR_FT \\$1 . if '\\$0'COVER_CHAPTER_TITLE_FONT' \ . ds $COVER_CHAPTER_TITLE_FT \\$1 . if '\\$0'COVER_COPYRIGHT_FONT' \ . ds $COVER_COPYRIGHT_FT \\$1 . if '\\$0'COVER_DOCTYPE_FONT' \ . ds $COVER_DOCTYPE_FT \\$1 . if '\\$0'COVER_MISC_FONT' \ . ds $COVER_MISC_FT \\$1 . if '\\$0'COVER_SUBTITLE_FONT' \ . ds $COVER_SUBTITLE_FT \\$1 . if '\\$0'COVER_TITLE_FONT' \ . ds $COVER_TITLE_FT \\$1 . if '\\$0'DOC_COVER_AUTHOR_FONT' \ . ds $DOC_COVER_AUTHOR_FT \\$1 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FONT' \ . ds $DOC_COVER_CHAPTER_TITLE_FT \\$1 . if '\\$0'DOC_COVER_COPYRIGHT_FONT' \ . ds $DOC_COVER_COPYRIGHT_FT \\$1 . if '\\$0'DOC_COVER_DOCTYPE_FONT' \ . ds $DOC_COVER_DOCTYPE_FT \\$1 . if '\\$0'DOC_COVER_MISC_FONT' \ . ds $DOC_COVER_MISC_FT \\$1 . if '\\$0'DOC_COVER_SUBTITLE_FONT' \ . ds $DOC_COVER_SUBTITLE_FT \\$1 . if '\\$0'DOC_COVER_TITLE_FONT' \ . ds $DOC_COVER_TITLE_FT \\$1 . if '\\$0'DOCTYPE_FONT' \ . ds $DOCTYPE_FT \\$1 . if '\\$0'ENDNOTE_FONT' \ . ds $EN_FT \\$1 . if '\\$0'ENDNOTE_NUMBER_FONT' \ . ds $EN_NUMBER_FT \\$1 . if '\\$0'ENDNOTE_LINENUMBER_FONT' \ . ds $EN_LN_FT \\$1 . if '\\$0'ENDNOTE_STRING_FONT' \ . ds $EN_STRING_FT \\$1 . if '\\$0'ENDNOTE_TITLE_FONT' \ . ds $EN_TITLE_FT \\$1 . if '\\$0'EPIGRAPH_FONT' \ . ds $EPI_FT \\$1 . if '\\$0'FOOTNOTE_FONT' \ . ds $FN_FT \\$1 . if '\\$0'HDRFTR_CENTER_FONT' \ . ds $HDRFTR_CENTER_FT \\$1 . if '\\$0'HDRFTR_LEFT_FONT' \ . ds $HDRFTR_LEFT_FT \\$1 . if '\\$0'HDRFTR_RIGHT_FONT' \ . ds $HDRFTR_RIGHT_FT \\$1 . if '\\$0'LINENUMBER_FONT' \ . ds $LN_FT \\$1 . if '\\$0'PAGENUM_FONT' \ . ds $PAGE_NUM_FT \\$1 . if '\\$0'QUOTE_FONT' \ . ds $QUOTE_FT \\$1 . if '\\$0'SUBTITLE_FONT' \ . ds $SUBTITLE_FT \\$1 . if '\\$0'TITLE_FONT' \ . ds $TITLE_FT \\$1 . if '\\$0'TOC_HEADER_FONT' \ . ds $TOC_HEADER_FT \\$1 . if '\\$0'TOC_PN_FONT' \ . ds $TOC_PN_FT \\$1 .END \# .MAC _SIZE END . if '\\$0'AUTHOR_SIZE' \ . ds $AUTHOR_SIZE_CHANGE \\$1 . if '\\$0'BIBLIOGRAPHY_STRING_SIZE' \ . ds $BIB_STRING_SIZE_CHANGE \\$1 . if '\\$0'BLOCKQUOTE_SIZE' \ . ds $BQUOTE_SIZE_CHANGE \\$1 . if '\\$0'CITATION_SIZE' \ . ds $BQUOTE_SIZE_CHANGE \\$1 . if '\\$0'CITE_SIZE' \ . ds $BQUOTE_SIZE_CHANGE \\$1 . if '\\$0'CHAPTER_TITLE_SIZE' \ . ds $CHAPTER_TITLE_SIZE_CHANGE \\$1 . if '\\$0'COVER_AUTHOR_SIZE' \ . ds $COVER_AUTHOR_SIZE_CHANGE \\$1 . if '\\$0'COVER_CHAPTER_TITLE_SIZE' \ . ds $COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1 . if '\\$0'COVER_COPYRIGHT_SIZE' \ . ds $COVER_COPYRIGHT_SIZE_CHANGE \\$1 . if '\\$0'COVER_DOCTYPE_SIZE' \ . ds $COVER_DOCTYPE_SIZE_CHANGE \\$1 . if '\\$0'COVER_MISC_SIZE' \ . ds $COVER_MISC_SIZE_CHANGE \\$1 . if '\\$0'COVER_SUBTITLE_SIZE' \ . ds $COVER_SUBTITLE_SIZE_CHANGE \\$1 . if '\\$0'COVER_TITLE_SIZE' \ . ds $COVER_TITLE_SIZE_CHANGE \\$1 . if '\\$0'DOC_COVER_AUTHOR_SIZE' \ . ds $DOC_COVER_AUTHOR_SIZE_CHANGE \\$1 . if '\\$0'DOC_COVER_CHAPTER_TITLE_SIZE' \ . ds $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1 . if '\\$0'DOC_COVER_COPYRIGHT_SIZE' \ . ds $DOC_COVER_COPYRIGHT_SIZE_CHANGE \\$1 . if '\\$0'DOC_COVER_DOCTYPE_SIZE' \ . ds $DOC_COVER_DOCTYPE_SIZE_CHANGE \\$1 . if '\\$0'DOC_COVER_MISC_SIZE' \ . ds $DOC_COVER_MISC_SIZE_CHANGE \\$1 . if '\\$0'DOC_COVER_SUBTITLE_SIZE' \ . ds $DOC_COVER_SUBTITLE_SIZE_CHANGE \\$1 . if '\\$0'DOC_COVER_TITLE_SIZE' \ . ds $DOC_COVER_TITLE_SIZE_CHANGE \\$1 . if '\\$0'DOCTYPE_SIZE' \ . ds $DOCTYPE_SIZE_CHANGE \\$1 . if '\\$0'ENDNOTE_NUMBER_SIZE' \ . ds $EN_NUMBER_SIZE_CHANGE \\$1 . if '\\$0'ENDNOTE_LINENUMBER_SIZE' \ . ds $EN_LN_SIZE_CHANGE \\$1 . if '\\$0'ENDNOTE_STRING_SIZE' \ . ds $EN_STRING_SIZE_CHANGE \\$1 . if '\\$0'ENDNOTE_TITLE_SIZE' \ . ds $EN_TITLE_SIZE_CHANGE \\$1 . if '\\$0'EPIGRAPH_SIZE' \ . ds $EPI_SIZE_CHANGE \\$1 . if '\\$0'FOOTNOTE_SIZE' \ . ds $FN_SIZE_CHANGE \\$1 . if '\\$0'HDRFTR_CENTER_SIZE' \ . ds $HDRFTR_CENTER_SIZE_CHANGE \\$1 . if '\\$0'HDRFTR_LEFT_SIZE' \ . ds $HDRFTR_LEFT_SIZE_CHANGE \\$1 . if '\\$0'HDRFTR_RIGHT_SIZE' \ . ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1 . if '\\$0'HDRFTR_SIZE' \ . ds $HDRFTR_SIZE_CHANGE \\$1 . if '\\$0'LINENUMBER_SIZE' \ . ds $LN_SIZE_CHANGE \\$1 . if '\\$0'PAGENUM_SIZE' \ . ds $PAGE_NUM_SIZE_CHANGE \\$1 . if '\\$0'QUOTE_SIZE' \ . ds $QUOTE_SIZE_CHANGE \\$1 . if '\\$0'SUBTITLE_SIZE' \ . ds $SUBTITLE_SIZE_CHANGE \\$1 . if '\\$0'TITLE_SIZE' \ . ds $TITLE_SIZE_CHANGE \\$1 . if '\\$0'TOC_HEADER_SIZE' \ . ds $TOC_HEADER_SIZE_CHANGE \\$1 . if '\\$0'TOC_PN_SIZE' \ . ds $TOC_PN_SIZE_CHANGE \\$1 .END \# .MAC _COLOR END . if \\n[#PRINT_STYLE]=1 .return . if '\\$0'ATTRIBUTE_COLOR' \{\ . nr #ATTRIBUTE_COLOR 1 . ds $ATTRIBUTE_COLOR \\$1 . \} . if '\\$0'AUTHOR_COLOR' \{\ . nr #AUTHOR_COLOR 1 . ds $AUTHOR_COLOR \\$1 . \} . if '\\$0'BLOCKQUOTE_COLOR' \{\ . nr #BQUOTE_COLOR 1 . ds $BQUOTE_COLOR \\$1 . \} . if '\\$0'CITATION_COLOR' \{\ . nr #BQUOTE_COLOR 1 . ds $BQUOTE_COLOR \\$1 . \} . if '\\$0'CITE_COLOR' \{\ . nr #BQUOTE_COLOR 1 . ds $BQUOTE_COLOR \\$1 . \} . if '\\$0'CHAPTER_TITLE_COLOR' \{\ . nr #CHAPTER_TITLE_COLOR 1 . ds $CHAPTER_TITLE_COLOR \\$1 . \} . if '\\$0'CODE_COLOR' \{\ . nr #CODE_COLOR 1 . ds $CODE_COLOR \\$1 . \} . if '\\$0'COVER_ATTRIBUTE_COLOR' \{\ . nr #COVER_ATTRIBUTE_COLOR 1 . ds $COVER_ATTRIBUTE_COLOR \\$1 . \} . if '\\$0'COVER_AUTHOR_COLOR' \{\ . nr #COVER_AUTHOR_COLOR 1 . ds $COVER_AUTHOR_COLOR \\$1 . \} . if '\\$0'COVER_CHAPTER_TITLE_COLOR' \{\ . nr #COVER_CHAPTER_TITLE_COLOR 1 . ds $COVER_CHAPTER_TITLE_COLOR \\$1 . \} . if '\\$0'COVER_COLOR' \{\ . nr #COVER_COLOR 1 . ds $COVER_COLOR \\$1 . \} . if '\\$0'COVER_COPYRIGHT_COLOR' \{\ . nr #COVER_COPYRIGHT_COLOR 1 . ds $COVER_COPYRIGHT_COLOR \\$1 . \} . if '\\$0'COVER_MISC_COLOR' \{\ . nr #COVER_MISC_COLOR 1 . ds $COVER_MISC_COLOR \\$1 . \} . if '\\$0'COVER_TITLE_COLOR' \{\ . nr #COVER_TITLE_COLOR 1 . ds $COVER_TITLE_COLOR \\$1 . \} . if '\\$0'COVER_SUBTITLE_COLOR' \{\ . nr #COVER_SUBTITLE_COLOR 1 . ds $COVER_SUBTITLE_COLOR \\$1 . \} . if '\\$0'COVER_DOCTYPE_COLOR' \{\ . nr #COVER_DOCTYPE_COLOR 1 . ds $COVER_DOCTYPE_COLOR \\$1 . \} . if '\\$0'DOC_COVER_ATTRIBUTE_COLOR' \{\ . nr #DOC_COVER_ATTRIBUTE_COLOR 1 . ds $DOC_COVER_ATTRIBUTE_COLOR \\$1 . \} . if '\\$0'DOC_COVER_AUTHOR_COLOR' \{\ . nr #DOC_COVER_AUTHOR_COLOR 1 . ds $DOC_COVER_AUTHOR_COLOR \\$1 . \} . if '\\$0'DOC_COVER_CHAPTER_TITLE_COLOR' \{\ . nr #DOC_COVER_CHAPTER_TITLE_COLOR 1 . ds $DOC_COVER_CHAPTER_TITLE_COLOR \\$1 . \} . if '\\$0'DOC_COVER_COLOR' \{\ . nr #DOC_COVER_COLOR 1 . ds $DOC_COVER_COLOR \\$1 . \} . if '\\$0'DOC_COVER_COPYRIGHT_COLOR' \{\ . nr #DOC_COVER_COPYRIGHT_COLOR 1 . ds $DOC_COVER_COPYRIGHT_COLOR \\$1 . \} . if '\\$0'DOC_COVER_MISC_COLOR' \{\ . nr #DOC_COVER_MISC_COLOR 1 . ds $DOC_COVER_MISC_COLOR \\$1 . \} . if '\\$0'DOC_COVER_TITLE_COLOR' \{\ . nr #DOC_COVER_TITLE_COLOR 1 . ds $DOC_COVER_TITLE_COLOR \\$1 . \} . if '\\$0'DOC_COVER_SUBTITLE_COLOR' \{\ . nr #DOC_COVER_SUBTITLE_COLOR 1 . ds $DOC_COVER_SUBTITLE_COLOR \\$1 . \} . if '\\$0'DOC_COVER_DOCTYPE_COLOR' \{\ . nr #DOC_COVER_DOCTYPE_COLOR 1 . ds $DOC_COVER_DOCTYPE_COLOR \\$1 . \} . if '\\$0'DOCHEADER_COLOR' \{\ . nr #DOCHEADER_COLOR 1 . ds $DOCHEADER_COLOR \\$1 . \} . if '\\$0'DOCTYPE_COLOR' \{\ . nr #DOCTYPE_COLOR 1 . ds $DOCTYPE_COLOR \\$1 . \} . if '\\$0'ENDNOTE_STRING_COLOR' \{\ . nr #ENDNOTE_STRING_COLOR 1 . ds $ENDNOTE_STRING_COLOR \\$1 . \} . if '\\$0'EPIGRAPH_COLOR' \{\ . nr #EPI_COLOR 1 . ds $EPI_COLOR \\$1 . \} . if '\\$0'FINIS_COLOR' \{\ . nr #FINIS_COLOR 1 . ds $FINIS_COLOR \\$1 . \} . if '\\$0'FOOTNOTE_COLOR' \{\ . nr #FOOTNOTE_COLOR 1 . ds $FOOTNOTE_COLOR \\$1 . \} . if '\\$0'HDRFTR_CENTER_COLOR' \{\ . nr #HDRFTR_CENTER_COLOR 1 . ds $HDRFTR_CENTER_COLOR \\$1 . \} . if '\\$0'HDRFTR_COLOR' \{\ . nr #HDRFTR_COLOR 1 . ds $HDRFTR_COLOR \\$1 . \} . if '\\$0'HDRFTR_LEFT_COLOR' \{\ . nr #HDRFTR_LEFT_COLOR 1 . ds $HDRFTR_LEFT_COLOR \\$1 . \} . if '\\$0'HDRFTR_RIGHT_COLOR' \{\ . nr #HDRFTR_RIGHT_COLOR 1 . ds $HDRFTR_RIGHT_COLOR \\$1 . \} . if '\\$0'HDRFTR_RULE_COLOR' \{\ . nr #HDRFTR_RULE_COLOR 1 . ds $HDRFTR_RULE_COLOR \\$1 . \} . if '\\$0'LINEBREAK_COLOR' \{\ . nr #LINEBREAK_COLOR 1 . ds $LINEBREAK_COLOR \\$1 . \} . if '\\$0'LINENUMBER_COLOR' \{\ . nr #LINENUMBER_COLOR 1 . ds $LN_COLOR \\$1 . \} . if '\\$0'PAGENUM_COLOR' \{\ . nr #PAGE_NUM_COLOR 1 . ds $PAGENUM_COLOR \\$1 . \} . if '\\$0'QUOTE_COLOR' \{\ . nr #QUOTE_COLOR 1 . ds $QUOTE_COLOR \\$1 . \} . if '\\$0'SECTION_COLOR' \{\ . nr #LINEBREAK_COLOR 1 . ds $LINEBREAK_COLOR \\$1 . \} . if '\\$0'SUBTITLE_COLOR' \{\ . nr #SUBTITLE_COLOR 1 . ds $SUBTITLE_COLOR \\$1 . \} . if '\\$0'TITLE_COLOR' \{\ . nr #TITLE_COLOR 1 . ds $TITLE_COLOR \\$1 . \} .END \# .MAC _QUAD END . if '\\$0'BIBLIOGRAPHY_QUAD' \{\ . ds $BIB_QUAD \\$1 . if '\\*[$BIB_QUAD]'R' \ .ab \\$0 at line \\n[.c] must be set to either L or J. Aborting \\n'[.F]'. . if '\\*[$BIB_QUAD]'C' \ .ab \\$0 at line \\n[.c] must be set to either L or J. Aborting \\n'[.F]'. . \} . if '\\$0'BIBLIOGRAPHY_STRING_QUAD' \ . ds $BIB_STRING_QUAD \\$1 . if '\\$0'BLOCKQUOTE_QUAD' \ . ds $BQUOTE_QUAD \\$1 . if '\\$0'CITATION_QUAD' \ . ds $BQUOTE_QUAD \\$1 . if '\\$0'CITE_QUAD' \ . ds $BQUOTE_QUAD \\$1 . if '\\$0'COVER_COPYRIGHT_QUAD' \ . ds $COVER_COPYRIGHT_QUAD \\$1 . if '\\$0'COVER_MISC_QUAD' \ . ds $COVER_MISC_QUAD \\$1 . if '\\$0'COVER_QUAD' \ . ds $COVER_QUAD \\$1 . if '\\$0'DOC_COVER_COPYRIGHT_QUAD' \ . ds $DOC_COVER_COPYRIGHT_QUAD \\$1 . if '\\$0'DOC_COVER_MISC_QUAD' \ . ds $DOC_COVER_MISC_QUAD \\$1 . if '\\$0'DOC_COVER_QUAD' \ . ds $DOC_COVER_QUAD \\$1 . if '\\$0'DOCHEADER_QUAD' \ . ds $DOCHEADER_QUAD \\$1 . if '\\$0'DOC_QUAD' \{\ . if !\\n[DOCS] .DOC_MACRO_ERROR \\$0 . ds $DOC_QUAD \\$1 . QUAD \\*[$DOC_QUAD] . \} . if '\\$0'ENDNOTE_QUAD' \{\ . ds $EN_QUAD \\$1 . if '\\*[$EN_QUAD]'R' \ .ab \\$0 at line \\n[.c] must be set to either L or J. Aborting \\n'[.F]'. . if '\\*[$EN_QUAD]'C' \ .ab \\$0 at line \\n[.c] must be set to either L or J. Aborting \\n'[.F]'. . \} . if '\\$0'ENDNOTE_STRING_QUAD' \ . ds $EN_STRING_QUAD \\$1 . if '\\$0'ENDNOTE_TITLE_QUAD' \ . ds $EN_TITLE_QUAD \\$1 . if '\\$0'EPIGRAPH_QUAD' \ . ds $EPI_QUAD \\$1 . if '\\$0'FOOTNOTE_QUAD' \ . ds $FN_QUAD \\$1 . if '\\$0'TOC_HEADER_QUAD' \ . ds $TOC_HEADER_QUAD \\$1 .END \# \# DEFAULTS \# -------- \# *Arguments: \# \# *Function: \# Sets up defaults if no values are entered prior to START. \# *Notes: \# The defaults for $CHAPTER_STRING, $DRAFT_STRING, and \# $REVISION_STRING are in the COPYSTYLE macro. \# .MAC DEFAULTS END . if !d $PAPER .PAPER LETTER . if !\\n[#DOC_TYPE] .DOCTYPE DEFAULT . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE] . el \ . if !\\n[#COPY_STYLE]=1 .PAGENUM_STYLE DIGIT . if !\\n[#COPY_STYLE] .COPYSTYLE FINAL . if \\n[#DRAFT_WITH_PAGENUM] .COPYSTYLE \\*[$COPY_STYLE] . if \\n[#DOC_TYPE]=4 \{\ . if !\\n[#USER_SET_L_LENGTH] \{\ . R_MARGIN \\n[#R_MARGIN]u . rr #USER_SET_L_LENGTH . \} . if \\n[#PRINT_STYLE]=1 .PRINTSTYLE TYPEWRITE SINGLESPACE . \} . if \\n[#COPY_STYLE]=1 \{\ . COPYSTYLE DRAFT . PAGENUMBER 1 . \} . if !r #DOC_HEADER .DOCHEADER . if !r #HEADERS_ON .HEADERS . if !r #PAGINATE .PAGINATE .\" . if !r #HEADER_MARGIN .HEADER_MARGIN 4P+6p . if !r #HEADER_GAP .HEADER_GAP 3P .\" . if \\n[#FOOTERS_ON] \{\ . HEADERS OFF . ie \\n[#PAGINATE] \ . if \\n[#PAGE_NUM_POS_SET]=0 .PAGENUM_POS TOP CENTER . el \ . if !\\n[#T_MARGIN] .T_MARGIN 6P . \} . if !\\n[#HEADERS_ON] \{\ . if !\\n[#FOOTERS_ON] \{\ . ie \\n[#PAGE_NUM_V_POS]=1 \{\ . HEADER_MARGIN \\n[#HEADER_MARGIN] . HEADER_GAP \\n[#HEADER_GAP] . \} . el .if !r #T_MARGIN .T_MARGIN 6P . \} . \} . if !r #T_MARGIN .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] . if !r #DOCHEADER_ADVANCE .nr #DOCHEADER_ADVANCE \\n[#T_MARGIN] . if !r #FOOTER_MARGIN .FOOTER_MARGIN 3P . if !r #FOOTER_GAP .FOOTER_GAP 3P . if !r #B_MARGIN .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u . if (\\n[#FOOTER_MARGIN]+\\n[.v]>=\\n[#B_MARGIN]) \{\ . tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin. . tm1 " No footers or bottom-of-page page numbers will be printed. . tm1 " Please reset B_MARGIN or FOOTER_MARGIN to allow enough space. . tm1 " If no footers or bottom-of-page page numbers are required, . tm1 " invoke .FOOTER_MARGIN 0 before .START . \} . if !r #HEADER_RULE_GAP .HEADER_RULE_GAP 4p . if !r #FOOTER_RULE_GAP .FOOTER_RULE_GAP 4p . if !r #HDRFTR_RULE .HDRFTR_RULE . if !r #PAGE_NUM_SET .PAGENUMBER 1 .\" Read in number registers and strings for type parameters . nr #DOC_L_MARGIN \\n[#L_MARGIN] . nr #DOC_L_LENGTH \\n[#L_LENGTH] . nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH]) . if '\\*[$SAVED_DOC_FAM]'' \{\ . ds $DOC_FAM \\*[$FAMILY] . rm $SAVED_DOC_FAM . \} . nr #DOC_PT_SIZE \\n[#PT_SIZE] .\" . if \\n[#TOC] .nr #DOC_PT_SIZE \\n[#TOC_PS] . if \\n[#ENDNOTES] .nr #DOC_PT_SIZE \\n[#EN_PS] . if \\n[#BIBLIOGRAPHY] .nr #DOC_PT_SIZE \\n[#BIB_PS] .\" . nr #DOC_LEAD \\n[.v] . nr #DOC@LEAD \\n[#DOC_LEAD] . if \\n[#AUTO_LEAD] .nr #DOC_AUTOLEAD \\n[#AUTOLEAD_VALUE] .\" #SAVED_DOC_LEAD is set in COLLATE . if \\n[#SAVED_DOC_LEAD] \{\ . if \ (\\n[#TOC]=0):\ (\\n[#LIST_OF_FIGURES]=0):\ (\\n[#LIST_OF_TABLES]=0):\ (\\n[#LIST_OF_EQUATIONS]=0) \ . if !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] .nr #RERUN_TRAPS 1 . \} . ie \\n[#ADJ_DOC_LEAD]=1 . . el \ . if !\\n[#DOC_LEAD_ADJUST_OFF] .DOC_LEAD_ADJUST . ds $DOC_QUAD \\*[$QUAD_VALUE] . if '\\*[$FONT]'' .FT R . if '\\*[$PP_FT]'' .ds $PP_FT \\*[$FONT] . if !'\\*[$PP_FT]'' .ds $PP_FT \\*[$FONT] .\" Counters . nr #PP 0 . nr #FN_NUMBER 0 1 . nr #EN_NUMBER 0 1 . nr #FN_COUNT_FOR_COLS 0 1 . nr #DONE_ONCE 0 1 .\" Enable shimming if user hasn't turned it off . if \\n[#NO_SHIM]=2 .rr #NO_SHIM .\" General style defaults for both PRINTSTYLEs . nr #PP_STYLE 1 . PARA_INDENT \\n[#PP_INDENT]u . if !d $HDRFTR_FAM .HDRFTR_FAMILY \\*[$DOC_FAM] . if !d $HDRFTR_SIZE_CHANGE .HDRFTR_SIZE +0 . if !d $PAGE_NUM_FAM .PAGENUM_FAMILY \\*[$DOC_FAM] . if !d $PAGE_NUM_FT .PAGENUM_FONT R . if !d $PAGE_NUM_SIZE_CHANGE .PAGENUM_SIZE +0 . if !r #PAGE_NUM_POS_SET .PAGENUM_POS BOTTOM CENTER . ie \\n[#PAGE_NUM_HYPHENS_SET] \{\ . if \\n[#PAGE_NUM_HYPHENS]=0 .PAGENUM_HYPHENS OFF . if \\n[#PAGE_NUM_HYPHENS]=1 .PAGENUM_HYPHENS . \} . el .PAGENUM_HYPHENS . if !r #HDRFTR_RIGHT_CAPS .HDRFTR_RIGHT_CAPS . if \\n[#HDRFTR_RIGHT_CAPS]=0 \ . if !d $HDRFTR_RIGHT_SIZE_CHANGE .HDRFTR_RIGHT_SIZE +0 . if !d $FN_FAM .FOOTNOTE_FAMILY \\*[$DOC_FAM] . if !d $FN_FT .FOOTNOTE_FONT R . if !d $FN_QUAD .FOOTNOTE_QUAD \\*[$DOC_QUAD] . if !r #FN_RULE .FOOTNOTE_RULE . if !r #FN_MARKERS .FOOTNOTE_MARKERS . if \\n[#FN_MARKERS]=1 \{\ . if \\n[#FN_REF]=1 \ . if !\\n[#FN_MARKER_STYLE] .FOOTNOTE_MARKER_STYLE NUMBER . if !\\n[#FN_MARKER_STYLE] .FOOTNOTE_MARKER_STYLE STAR . \} . if !r #EN_MARKER_STYLE .ENDNOTE_MARKER_STYLE SUPERSCRIPT . if !d $EN_PN_STYLE .ENDNOTES_PAGENUM_STYLE digit . if !d $EN_FAM .ENDNOTE_FAMILY \\*[$DOC_FAM] . if !d $EN_FT .ENDNOTE_FONT R . if !d $EN_QUAD .ENDNOTE_QUAD \\*[$DOC_QUAD] . if !d $EN_STRING .ENDNOTE_STRING "Endnotes" . if !d $EN_STRING_FAM .ENDNOTE_STRING_FAMILY \\*[$EN_FAM] . if !d $EN_STRING_QUAD .ENDNOTE_STRING_QUAD CENTER . if !r #EN_STRING_UNDERLINE .nr #EN_STRING_UNDERLINE 2 . if !r #EN_STRING_CAPS .ENDNOTE_STRING_CAPS . if !d $EN_TITLE \{\ . ie \\n[#DOC_TYPE]=2 \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \{\ . ie '\\*[$CHAPTER]'' .ENDNOTE_TITLE "\\*[$CHAPTER_TITLE]" . el .ENDNOTE_TITLE \ "\\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]" . \} . el \{\ . ie '\\*[$CHAPTER]'' .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" . el .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]" . \} . \} . el .ENDNOTE_TITLE "\\*[$TITLE]" . \} . if !d $EN_TITLE_FAM .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM] . if !d $EN_TITLE_QUAD .ENDNOTE_TITLE_QUAD LEFT . if !r #EN_TITLE_UNDERLINE .nr #EN_TITLE_UNDERLINE 1 . if !d $EN_NUMBER_FAM .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] . if !d $EN_LN_FAM .ENDNOTE_LINENUMBER_FAMILY \\*[$EN_FAM] . if !r #EN_NUMBERS_ALIGN_LEFT \{\ . if !r #EN_NUMBERS_ALIGN_RIGHT \{\ . ie !\\n[#EN_MARKER_STYLE]=2 .ENDNOTE_NUMBERS_ALIGN RIGHT 2 . el .ENDNOTE_NUMBERS_ALIGN RIGHT 4 . \} . \} . if !r #EN_LN_GAP .ENDNOTE_LINENUMBER_GAP 1m . if !r #EN_ALLOWS_HEADERS .ENDNOTES_ALLOWS_HEADERS . if !d $BIB_PN_STYLE .BIBLIOGRAPHY_PAGENUM_STYLE digit . if !d $BIB_FAM .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM] . if !d $BIB_FT .BIBLIOGRAPHY_FONT R . if !d $BIB_QUAD .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD] . if !d $BIB_STRING .BIBLIOGRAPHY_STRING "Bibliography" . if !d $BIB_STRING_FAM .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM] . if !d $BIB_STRING_QUAD .BIBLIOGRAPHY_STRING_QUAD CENTER . if !r #BIB_STRING_UNDERLINE .nr #BIB_STRING_UNDERLINE 2 . if !r #BIB_STRING_CAPS .BIBLIOGRAPHY_STRING_CAPS . if !d $TOC_HEADER_STRING .TOC_HEADER_STRING "Contents" . if !d $TOC_HEADER_QUAD .TOC_HEADER_QUAD LEFT . if !d $TOC_PN_STYLE .TOC_PAGENUM_STYLE roman . if !r #TOC_PN_PADDING .TOC_PADDING 3 .\" Line numbering . if !r #LN_GUTTER .nr #LN_GUTTER 2 . if !r #Q_LN_GUTTER .nr #Q_LN_GUTTER 2 . if !r #BQ_LN_GUTTER .nr #BQ_LN_GUTTER 2 . if !d $LN_FAM .ds $LN_FAM \\*[$DOC_FAM] . if !d $LN_FT .ds $LN_FT R . if !d $LN_SIZE_CHANGE .ds $LN_SIZE_CHANGE +0 . if !d $LN_COLOR .ds $LN_COLOR black .\" PDF link colour . if !\\n[PDFHREF_COLOR_SET] .PDF_LINK_COLOR 0.0 0.3 0.9 .\" PDF frame . if !d pdf-img:frame-weight .ds pdf-img:frame-weight .5 . if !d pdf-img:frame-color .ds pdf-img:frame-color black .\" Captions, labels, sources .\" All at default doc specs except leading, which is autolead 2 . nr label-type-counter 0 1 . while \\n+[label-type-counter]<=4 \{\ . if \\n[label-type-counter]=1 .ds label-type eqn . if \\n[label-type-counter]=2 .ds label-type pdf-img . if \\n[label-type-counter]=3 .ds label-type pic . if \\n[label-type-counter]=4 .ds label-type tbl . nr spec-type-counter 0 1 . while \\n+[spec-type-counter]<=3 \{\ . if \\n[spec-type-counter]=1 .ds spec-type label . if \\n[spec-type-counter]=2 .ds spec-type caption . if \\n[spec-type-counter]=3 .ds spec-type source . set-defaults . set-inline-specs . \} . \} .\" String defaults for both PRINTSTYLEs . ie \\n[#DOC_TYPE]=1 \{\ . ie '\\*[$DOC_TITLE]'' \{\ . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1] . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE] . \} . el \{\ . if \\n[#COPY_STYLE]=1 .DRAFT_WITH_PAGENUMBER . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1] . if \\n[#USER_DEF_HDRFTR_CENTER]=0 .ds $HDRFTR_CENTER \\*[$TITLE] . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$DOC_TITLE] . \} . \} . el \{\ . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1] . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE] . \} . if !d $ATTRIBUTE_STRING .ds $ATTRIBUTE_STRING by . if !d $FINIS_STRING .FINIS_STRING "End" . if !r #FINIS_STRING_CAPS .nr #FINIS_STRING_CAPS 1 .\" Covers . if !r #DOC_COVERS_OFF .nr #DOC_COVERS 1 . if !r #COVERS_OFF .nr #COVERS 1 . if !d $COVER_COPYRIGHT_QUAD .COVER_COPYRIGHT_QUAD R . if !d $COVER_MISC_QUAD .COVER_MISC_QUAD L . if !d $DOC_COVER_COPYRIGHT_QUAD .DOC_COVER_COPYRIGHT_QUAD R . if !d $DOC_COVER_MISC_QUAD .DOC_COVER_MISC_QUAD L . if !r #DOC_COVER_UNDERLINE .DOC_COVER_UNDERLINE . if !r #COVER_UNDERLINE .COVER_UNDERLINE .\" Defaults for printstyle TYPEWRITE . if \\n[#PRINT_STYLE]=1 \{\ . TYPEWRITER . SS DEFAULT . if \\n[#UNDERLINE_QUOTES]=1 .UNDERLINE_QUOTES . if \\n[#UNDERLINE_QUOTES]=0 .UNDERLINE_QUOTES OFF .\" +Doctype underlining (if NAMED) . if !r #DOCTYPE_UNDERLINE .nr #DOCTYPE_UNDERLINE 1 .\" +Quotes and blockquotes . if !r #Q_OFFSET_VALUE \{\ . if '\\*[$Q_OFFSET_VALUE]'' .QUOTE_INDENT 1 . \} .\" +Epigraphs . if !r #EPI_OFFSET_VALUE \ . if '\\*[$EPI_OFFSET_VALUE]'' .EPIGRAPH_INDENT 2 .\" +Linebreaks . if !d $LINEBREAK_CHAR .LINEBREAK_CHAR * 3 2p .\" +Footnotes . if !d $FN_SIZE_CHANGE .FOOTNOTE_SIZE +0 . if !r #FN_RULE_LENGTH .FOOTNOTE_RULE_LENGTH 2i .\" +Endnotes . if !r #EN_PP_INDENT .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] .\" +Footnotes . if !r #FN_RULE_ADJ .FOOTNOTE_RULE_ADJ 6p .\" +Slant stuff . if !r #SLANT_MEANS_SLANT \{\ . ie \\n[#UNDERLINE_SLANT]=1 .UNDERLINE_SLANT . el .UNDERLINE_SLANT OFF . \} . \} .\" Defaults for printstyle TYPESET . if \\n[#PRINT_STYLE]=2 \{\ . if !d $DOCHEADER_LEAD_ADJ .DOCHEADER_LEAD +0 .\" +Cover . if !d $COVER_LEAD_ADJ .COVER_LEAD +0 . if !d $COVER_FAM .COVER_FAMILY \\*[$DOC_FAM] .\" (title) . if !d $COVER_TITLE_FAM \{\ . ie !d $COVER_FAM .COVER_TITLE_FAMILY \\*[$DOC_FAM] . el .COVER_TITLE_FAMILY \\*[$COVER_FAM] . \} . if !d $COVER_TITLE_FT .COVER_TITLE_FONT B . if !d $COVER_TITLE_SIZE_CHANGE .COVER_TITLE_SIZE +3.5 .\" (chapter title) . if !d $COVER_CHAPTER_TITLE_FAM \{\ . ie !d $COVER_FAM .COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] . el .COVER_CHAPTER_TITLE_FAMILY \\*[$COVER_FAM] . \} . if !d $COVER_CHAPTER_TITLE_FT .COVER_CHAPTER_TITLE_FONT BI . if !d $COVER_CHAPTER_TITLE_SIZE_CHANGE .COVER_CHAPTER_TITLE_SIZE +4 .\" (subtitle) . if !d $COVER_SUBTITLE_FAM \{\ . ie !d $COVER_FAM .COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] . el .COVER_SUBTITLE_FAMILY \\*[$COVER_FAM] . \} . if !d $COVER_SUBTITLE_FT .COVER_SUBTITLE_FONT R . if !d $COVER_SUBTITLE_SIZE_CHANGE .COVER_SUBTITLE_SIZE +0 .\" (attribution and author[s]) . if !d $COVER_AUTHOR_FAM \{\ . ie !d $COVER_FAM .COVER_AUTHOR_FAMILY \\*[$DOC_FAM] . el .COVER_AUTHOR_FAMILY \\*[$COVER_FAM] . \} . if !d $COVER_AUTHOR_FT .COVER_AUTHOR_FONT I . if !d $COVER_AUTHOR_SIZE_CHANGE .COVER_AUTHOR_SIZE +0 .\" (doctype if "named") . if !d $COVER_DOCTYPE_FAM \{\ . ie !d $COVER_FAM .COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] . el .COVER_DOCTYPE_FAMILY \\*[$COVER_FAM] . \} . if !d $COVER_DOCTYPE_FT .COVER_DOCTYPE_FONT BI . if !d $COVER_DOCTYPE_SIZE_CHANGE .COVER_DOCTYPE_SIZE +3 .\" (copyright) . if !d $COVER_COPYRIGHT_FAM \{\ . ie !d $COVER_FAM .COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] . el .COVER_COPYRIGHT_FAMILY \\*[$COVER_FAM] . \} . if !d $COVER_COPYRIGHT_FT .COVER_COPYRIGHT_FONT R . if !d $COVER_COPYRIGHT_SIZE_CHANGE .COVER_COPYRIGHT_SIZE -2 .\" (misc) . if !d $COVER_MISC_FAM .COVER_MISC_FAMILY \\*[$DOC_FAM] . if !d $COVER_MISC_FT .COVER_MISC_FONT R . if !d $COVER_MISC_SIZE_CHANGE .COVER_MISC_SIZE -2 . if !r #COVER_MISC_AUTOLEAD .COVER_MISC_AUTOLEAD 2 .\" +Doc cover . if !d $DOC_COVER_LEAD_ADJ .DOC_COVER_LEAD +0 . if !d $DOC_COVER_FAM .DOC_COVER_FAMILY \\*[$DOC_FAM] .\" (title) . if !d $DOC_COVER_TITLE_FAM \{\ . ie !d $DOC_COVER_FAM .DOC_COVER_TITLE_FAMILY \\*[$DOC_FAM] . el .DOC_COVER_TITLE_FAMILY \\*[$DOC_COVER_FAM] . \} . if !d $DOC_COVER_TITLE_FT .DOC_COVER_TITLE_FONT B . if !d $DOC_COVER_TITLE_SIZE_CHANGE .DOC_COVER_TITLE_SIZE +3.5 .\" (chapter title) . if !d $DOC_COVER_CHAPTER_TITLE_FAM \{\ . ie !d $DOC_COVER_FAM .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] . el .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_COVER_FAM] . \} . if !d $DOC_COVER_CHAPTER_TITLE_FT .DOC_COVER_CHAPTER_TITLE_FONT BI . if !d $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE .DOC_COVER_CHAPTER_TITLE_SIZE +4 .\" (subtitle) . if !d $DOC_COVER_SUBTITLE_FAM \{\ . ie !d $DOC_COVER_FAM .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] . el .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_COVER_FAM] . \} . if !d $DOC_COVER_SUBTITLE_FT .DOC_COVER_SUBTITLE_FONT R . if !d $DOC_COVER_SUBTITLE_SIZE_CHANGE .DOC_COVER_SUBTITLE_SIZE +0 .\" (attribution and author[s]) . if !d $DOC_COVER_AUTHOR_FAM \{\ . ie !d $DOC_COVER_FAM .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_FAM] . el .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_COVER_FAM] . \} . if !d $DOC_COVER_AUTHOR_FT .DOC_COVER_AUTHOR_FONT I . if !d $DOC_COVER_AUTHOR_SIZE_CHANGE .DOC_COVER_AUTHOR_SIZE +0 .\" (doctype if "named") . if !d $DOC_COVER_DOCTYPE_FAM \{\ . ie !d $DOC_COVER_FAM .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] . el .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_COVER_FAM] . \} . if !d $DOC_COVER_DOCTYPE_FT .DOC_COVER_DOCTYPE_FONT BI . if !d $DOC_COVER_DOCTYPE_SIZE_CHANGE .DOC_COVER_DOCTYPE_SIZE +3 .\" (copyright) . if !d $DOC_COVER_COPYRIGHT_FAM \{\ . ie !d $DOC_COVER_FAM .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] . el .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_COVER_FAM] . \} . if !d $DOC_COVER_COPYRIGHT_FT .DOC_COVER_COPYRIGHT_FONT R . if !d $DOC_COVER_COPYRIGHT_SIZE_CHANGE .DOC_COVER_COPYRIGHT_SIZE -2 .\" (misc) . if !d $DOC_COVER_MISC_FAM .DOC_COVER_MISC_FAMILY \\*[$DOC_FAM] . if !d $DOC_COVER_MISC_FT .DOC_COVER_MISC_FONT R . if !d $DOC_COVER_MISC_SIZE_CHANGE .DOC_COVER_MISC_SIZE -2 . if !r #DOC_COVER_MISC_AUTOLEAD .DOC_COVER_MISC_AUTOLEAD 2 .\" +Docheader . if !d $DOCHEADER_FAM .DOCHEADER_FAMILY \\*[$DOC_FAM] . if !d $TITLE_FAM \{\ . ie !d $DOCHEADER_FAM .TITLE_FAMILY \\*[$DOC_FAM] . el .TITLE_FAMILY \\*[$DOCHEADER_FAM] . \} . if !d $TITLE_FT .TITLE_FONT B . if !d $TITLE_SIZE_CHANGE \{\ . ie \\n[#DOC_TYPE]=2 .TITLE_SIZE +4 . el .TITLE_SIZE +3.5 . \} . if !d $CHAPTER_TITLE_FAM \{\ . ie !d $DOCHEADER_FAM .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] . el .CHAPTER_TITLE_FAMILY \\*[$DOCHEADER_FAM] . \} . if !d $CHAPTER_TITLE_FT .CHAPTER_TITLE_FONT BI . if !d $CHAPTER_TITLE_SIZE_CHANGE .CHAPTER_TITLE_SIZE +4 . if !d $SUBTITLE_FAM \{\ . ie !d $DOCHEADER_FAM .SUBTITLE_FAMILY \\*[$DOC_FAM] . el .SUBTITLE_FAMILY \\*[$DOCHEADER_FAM] . \} . if !d $SUBTITLE_FT .SUBTITLE_FONT R . if !d $SUBTITLE_SIZE_CHANGE .SUBTITLE_SIZE +0 . if !d $AUTHOR_FAM \{\ . ie !d $DOCHEADER_FAM .AUTHOR_FAMILY \\*[$DOC_FAM] . el .AUTHOR_FAMILY \\*[$DOCHEADER_FAM] . \} . if !d $AUTHOR_FT .AUTHOR_FONT I . if !d $AUTHOR_SIZE_CHANGE .AUTHOR_SIZE +0 . if !d $DOCTYPE_FAM \{\ . ie !d $DOCHEADER_FAM .DOCTYPE_FAMILY \\*[$DOC_FAM] . el .DOCTYPE_FAMILY \\*[$DOCHEADER_FAM] . \} . if !d $DOCTYPE_FT .DOCTYPE_FONT BI . if !d $DOCTYPE_SIZE_CHANGE .DOCTYPE_SIZE +3 . if !r #DOCTYPE_UNDERLINE .DOCTYPE_UNDERLINE .\" +Headers and footers . if !d $HDRFTR_LEFT_FAM .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] . if !d $HDRFTR_LEFT_FT .HDRFTR_LEFT_FONT R . if \\n[#HDRFTR_LEFT_CAPS] \ . if !d $HDRFTR_LEFT_SIZE_CHANGE .HDRFTR_LEFT_SIZE -2 . if !d $HDRFTR_LEFT_SIZE_CHANGE .HDRFTR_LEFT_SIZE -.5 . if !d $HDRFTR_CENTER_FAM .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] . if !d $HDRFTR_CENTER_FT .HDRFTR_CENTER_FONT I . if \\n[#HDRFTR_CENTER_CAPS] \ . if !d $HDRFTR_CENTER_SIZE_CHANGE .HDRFTR_CENTER_SIZE -2 . if !d $HDRFTR_CENTER_SIZE_CHANGE .HDRFTR_CENTER_SIZE -.5 . if !d $HDRFTR_RIGHT_FAM .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] . if !d $HDRFTR_RIGHT_FT .HDRFTR_RIGHT_FONT R . if \\n[#HDRFTR_RIGHT_CAPS] \ . if !d $HDRFTR_RIGHT_SIZE_CHANGE .HDRFTR_RIGHT_SIZE -2 . if !d $HDRFTR_RIGHT_SIZE_CHANGE .HDRFTR_RIGHT_SIZE -.5 .\" +Quotes . if !d $QUOTE_FAM .QUOTE_FAMILY \\*[$DOC_FAM] . if !d $QUOTE_FT .QUOTE_FONT I . if !d $QUOTE_SIZE_CHANGE .QUOTE_SIZE+0 . if !r #Q_OFFSET_VALUE \ . if '\\*[$Q_OFFSET_VALUE]'' .QUOTE_INDENT 3 .\" +Blockquotes .\" Note: the leading for quotes and blockquotes is set after .DEFAULTS in START . if !d $BQUOTE_FAM .BLOCKQUOTE_FAMILY \\*[$DOC_FAM] . if !d $BQUOTE_FT .BLOCKQUOTE_FONT R . if !d $BQUOTE_SIZE_CHANGE .BLOCKQUOTE_SIZE -1 . if !d $BQUOTE_QUAD .BLOCKQUOTE_QUAD LEFT .\" +Epigraphs . if !d $EPI_FAM .EPIGRAPH_FAMILY \\*[$DOC_FAM] . if !d $EPI_FT .EPIGRAPH_FONT R . if !d $EPI_SIZE_CHANGE .EPIGRAPH_SIZE -1.5 . if !r #EPI_AUTOLEAD .EPIGRAPH_AUTOLEAD 2 . if !d $EPI_QUAD .EPIGRAPH_QUAD \\*[$DOC_QUAD] . if !r #EPI_OFFSET_VALUE \ . if '\\*[$EPI_OFFSET_VALUE]'' .EPIGRAPH_INDENT 3 .\" +Linebreaks . if !d $LINEBREAK_CHAR .LINEBREAK_CHAR * 3 3p . if !d $LINEBREAK_COLOR .LINEBREAK_COLOR black .\" +Footnotes . if !r #FN_RULE_LENGTH .FOOTNOTE_RULE_LENGTH 4P . if !r #FN_RULE_ADJ .FOOTNOTE_RULE_ADJ 3p . if !d $FN_SIZE_CHANGE .FOOTNOTE_SIZE -2 . if !r #FN_AUTOLEAD .FOOTNOTE_AUTOLEAD 2 .\" +Endnotes . if !r #EN_PS .ENDNOTE_PT_SIZE (\\n[#DOC_PT_SIZE]u) . if !d $EN_STRING_FT .ENDNOTE_STRING_FONT B . if !d $EN_STRING_SIZE_CHANGE .ENDNOTE_STRING_SIZE +1 . if !d $EN_TITLE_FT .ENDNOTE_TITLE_FONT B . if !d $EN_TITLE_SIZE_CHANGE .ENDNOTE_TITLE_SIZE +0 . if !d $EN_NUMBER_FT .ENDNOTE_NUMBER_FONT B . if !d $EN_LN_FT .ENDNOTE_LINENUMBER_FONT R . if !d $EN_NUMBER_SIZE_CHANGE .ENDNOTE_NUMBER_SIZE +0 . if !d $EN_LN_SIZE_CHANGE .ENDNOTE_LINENUMBER_SIZE +0 . if !r #EN_PP_INDENT .ENDNOTE_PARA_INDENT 1.5m . if !d $EN_SPACE .ENDNOTE_SPACING 0 .\" +Bibliography . if !r #BIB_LIST .BIBLIOGRAPHY_TYPE PLAIN . if !r #BIB_PS .BIBLIOGRAPHY_PT_SIZE (\\n[#DOC_PT_SIZE]u) . if !d $BIB_STRING_FT .BIBLIOGRAPHY_STRING_FONT B . if !d $BIB_STRING_SIZE_CHANGE .BIBLIOGRAPHY_STRING_SIZE +1 .\" +Table of contents . if !d $TOC_FAM .TOC_FAMILY \\*[$DOC_FAM] . if !r #TOC_PS .TOC_PT_SIZE (\\n[#DOC_PT_SIZE]u) . if '\\*[$TOC_LEAD]'' .TOC_LEAD \\n[#DOC@LEAD]u ADJUST . if !d $TOC_HEADER_FAM .TOC_HEADER_FAMILY \\*[$TOC_FAM] . if !d $TOC_HEADER_SIZE_CHANGE .TOC_HEADER_SIZE +4 . if !d $TOC_HEADER_FT .TOC_HEADER_FONT B . if !d $TOC_PN_FAM .TOC_PN_FAMILY \\*[$TOC_FAM] . if !d $TOC_PN_FT .TOC_PN_FONT R . if !d $TOC_PN_SIZE_CHANGE .TOC_PN_SIZE +0 . \} .\" +Refer support . if !r #EN_REF .nr #FN_REF 1 . if !d $REF_FN_INDENT \{\ . if \\n[#PRINT_STYLE]=1 .INDENT_REFS FOOTNOTE .5i . if \\n[#PRINT_STYLE]=2 .INDENT_REFS FOOTNOTE 2m . \} . if !d $REF_EN_INDENT \{\ . if \\n[#PRINT_STYLE]=1 .INDENT_REFS ENDNOTE .5i . if \\n[#PRINT_STYLE]=2 .INDENT_REFS ENDNOTE 2m . \} . if !d $REF_BIB_INDENT \{\ . if \\n[#PRINT_STYLE]=1 .INDENT_REFS BIBLIO .5i . if \\n[#PRINT_STYLE]=2 .INDENT_REFS BIBLIO 2m . \} .\" Define strings for idem entries . if \\n[#PRINT_STYLE]=1 .char \[idem] \[hy]\[hy]\[hy] . if \\n[#PRINT_STYLE]=2 .char \[idem] \v'-.3m'\l'3m'\v'.3m' .\" Adjust doc leading for PRINTSTYLE TYPESET . if \\n[#PRINT_STYLE]=2 \ . if \\n[#ADJ_DOC_LEAD]=1 .DOC_LEAD_ADJUST .\" This diversion is to get a value for #FN_AUTOLEAD . di NULL . if \\n[#AUTO_LEAD] \{\ . nr #RESTORE_AUTO_LEAD 1 . nr #SAVED_AUTOLEAD_VALUE \\n[#AUTOLEAD_VALUE] . \} . ev NULL . if \\n[#PRINT_STYLE]=1 \{\ . ps \\*[$TYPEWRITER_PS] . ie \\n[#SINGLE_SPACE]=1 .vs \\n[#ORIGINAL_DOC_LEAD]u . el .vs \\n[#ORIGINAL_DOC_LEAD]u/2u . \} . if \\n[#PRINT_STYLE]=2 \{\ . ps \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE] . vs \\n[.ps]u+\\n[#FN_AUTOLEAD]u . \} . nr #FN_LEAD \\n[#LEAD] . ev . di . if \\n[#RESTORE_AUTO_LEAD] \{\ . nr #AUTO_LEAD 1 . nr #AUTOLEAD_VALUE \\n[#SAVED_AUTOLEAD_VALUE] . \} . ie !\\n[#COLLATE] \{\ .\" DOC_LEAD adjusted (or not) here . TRAPS . if \\n[#REMOVE_ADJ] .DOC_LEAD \\n[#DOC_LEAD]u-\\n[#DOC_LEAD_ADJ]u .\" Endnote, bibliography and toc leading . nr #OK_PROCESS_LEAD 1 . nr #RESTORE_DOC_LEAD \\n[.v] . nr #RESTORE_B_MARGIN \\n[#B_MARGIN] . if \\n[#PRINT_STYLE]=1 \{\ . ie \\n[#SINGLE_SPACE] \{\ . ENDNOTE_LEAD 12 ADJUST . BIBLIOGRAPHY_LEAD 12 ADJUST . \} . el \{\ . ie \\n[#EN_SINGLESPACE] .ENDNOTE_LEAD 12 ADJUST . el .ENDNOTE_LEAD 24 ADJUST . ie \\n[#BIB_SINGLESPACE] .BIBLIOGRAPHY_LEAD 12 ADJUST . el .BIBLIOGRAPHY_LEAD 24 ADJUST . \} . \} . if \\n[#PRINT_STYLE]=2 \{\ . ie !d $EN_LEAD .ENDNOTE_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJUST . el .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] . ie !d $BIB_LEAD .BIBLIOGRAPHY_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJUST . el .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD] . ie !d $TOC_LEAD .TOC_LEAD \\n[#UNADJUSTED_DOC_LEAD]u \\*[$ADJUST_TOC_LEAD] . el .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] . \} . ie !d $BIB_SPACE .BIBLIOGRAPHY_SPACING 0 . el \{\ . if \\n[#DEFER_BIB_SPACING]=1 \{\ . BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE] . rr #DEFER_BIB_SPACING . \} . \} . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u . nr #B_MARGIN \\n[#RESTORE_B_MARGIN] . vs \\n[#DOC_LEAD]u . \} . el \{\ . if \\n[#COLLATE] \{\ . if !\\n[#PRINT_STYLE]=1 \{\ . if \\n[#RERUN_TRAPS] \{\ . TRAPS . rr #RERUN_TRAPS . \} . \} . \} . \} .\" Set default heading and toc-entry family if not done already . nr #HD_LEVEL 0 1 \" loop step . nr #LOOP 9 \" loop count . while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\ . if '\\*[$HEAD_\\n[#HD_LEVEL]_FAM]'' \ . ds $HEAD_\\n[#HD_LEVEL]_FAM \\*[$DOC_FAM] . if '\\*[$HEAD_\\n[#HD_LEVEL]_BASELINE_ADJ]'' \ . ds $HEAD_\\n[#HD_LEVEL]_BASELINE_ADJ \\n[.v]/10 . if '\\*[$TOC_HEAD_\\n[#HD_LEVEL]_FAM]'' \ . ds $TOC_HEAD_\\n[#HD_LEVEL]_FAM \\*[$DOC_FAM] . \} . if '\\*[$TOC_TITLE_FAM]'' .ds $TOC_TITLE_FAM \\*[$DOC_FAM] .\" Re-run MNinit to capture strings and registers set in DEFAULTS. . if !'\\*[$MN-arg1]'' \{\ . MNinit \ \\*[$MN-arg1] \\*[$MN-arg2] \ \\*[$MN-arg3] \\*[$MN-arg4] \ \\*[$MN-arg5] \\*[$MN-arg6] \ \\*[$MN-arg7] \\*[$MN-arg8] \ \\*[$MN-arg9] . \} . if \\n[#PRINT_STYLE]=1 .nr #IGNORE 1 . if \\n[#AUTO_LEAD] \{\ . rr #AUTO_LEAD . rr #AUTOLEAD_VALUE . \} .END \# \# ==================================================================== \# \# +++START THE DOCUMENT+++ \# \# THE START MACRO \# --------------- \# *Arguments: \# \# *Function: \# Reads in default document style parameters and any parameters \# the user has changed before issuing START. \# Using the information gathered in the opening macros, \# prints appropriate title (or chapter #), subtitle, author \# and document type (if appropriate). \# *Notes: \# The .PRINT \& (zero-width character) is required to get the \# subsequent .sp request to work as advertised. \# \# The overall document line length, family, and point-size \# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for \# use in the HEADER and FOOTER macros. \# \# First, define some strings for point sizes \# \# Doc cover \# .ds $DOC_COVER_AUTHOR_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_AUTHOR_SIZE_CHANGE] .ds $DOC_COVER_CHAPTER_TITLE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE] .ds $DOC_COVER_COPYRIGHT_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_COPYRIGHT_SIZE_CHANGE] .ds $DOC_COVER_DOCTYPE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_DOCTYPE_SIZE_CHANGE] .ds $DOC_COVER_MISC_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_MISC_SIZE_CHANGE] .ds $DOC_COVER_SUBTITLE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_SUBTITLE_SIZE_CHANGE] .ds $DOC_COVER_TITLE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_TITLE_SIZE_CHANGE] \# Cover .ds $COVER_AUTHOR_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$COVER_AUTHOR_SIZE_CHANGE] .ds $COVER_CHAPTER_TITLE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$COVER_CHAPTER_TITLE_SIZE_CHANGE] .ds $COVER_COPYRIGHT_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$COVER_COPYRIGHT_SIZE_CHANGE] .ds $COVER_DOCTYPE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$COVER_DOCTYPE_SIZE_CHANGE] .ds $COVER_MISC_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$COVER_MISC_SIZE_CHANGE] .ds $COVER_SUBTITLE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$COVER_SUBTITLE_SIZE_CHANGE] .ds $COVER_TITLE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$COVER_TITLE_SIZE_CHANGE] \# Docheader .ds $AUTHOR_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE] .ds $CHAPTER_TITLE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE] .ds $COPYRIGHT_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$COPYRIGHT_SIZE_CHANGE] .ds $DOCTYPE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE] .ds $SUBTITLE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE] .ds $TITLE_PT_SIZE \ \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE] \# \# Next, some utility macros for various routines to prevent repetition \# .MAC DOC_HEADER_QUAD END . if '\\$0'DOC_HEADER_QUAD' .ds $CALLING_MACRO DOCHEADER . if '\\$0'COVER_H_POS' .ds $CALLING_MACRO COVER . if '\\$0'DOC_COVER_H_POS' .ds $CALLING_MACRO DOC_COVER . ie !'\\*[$\\*[$CALLING_MACRO]_QUAD]'' \{\ . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'L' .LEFT . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'LEFT' .LEFT . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'R' .RIGHT . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'RIGHT' .RIGHT . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'C' .RIGHT . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'CENTER' .CENTER . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'CENTRE' .CENTER . \} . el .CENTER .END \# \# Aliases for DOC_HEADER_QUAD \# .ALIAS COVER_H_POS DOC_HEADER_QUAD .ALIAS DOC_COVER_H_POS DOC_HEADER_QUAD \# .MAC PRINT_AUTHORS END . ie r#DOING_COVER \{\ . if \\n[#DOC_COVER]=1 \{\ . ie !'\\*[$AUTHOR_DOCCOVER_1]'' \{\ . nr #AUTHORS \\n[#AUTHOR_DOCCOVER_NUM] . nr #NEXT_AUTHOR 0 1 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\ . ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \ . PRINT \ \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]]\m[] . el .PRINT \\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]] . \} . \} . el \{\ . nr #AUTHORS \\n[#AUTHOR_NUM] . nr #NEXT_AUTHOR 0 1 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\ . ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \ . PRINT \ \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[] . el .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] . \} . \} . return . \} . if \\n[#COVER]=1 \{\ . ie !'\\*[$AUTHOR_COVER_1]'' \{\ . nr #AUTHORS \\n[#AUTHOR_COVER_NUM] . nr #NEXT_AUTHOR 0 1 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\ . ie \\n[#COVER_AUTHOR_COLOR]=1 \ . PRINT \ \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]]\m[] . el .PRINT \\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]] . \} . \} . el \{\ . nr #AUTHORS \\n[#AUTHOR_NUM] . nr #NEXT_AUTHOR 0 1 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\ . ie \\n[#COVER_AUTHOR_COLOR]=1 \ . PRINT \ \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[] . el .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] . \} . \} . return . \} . \} . el \{\ . nr #AUTHORS \\n[#AUTHOR_NUM] . nr #NEXT_AUTHOR 0 1 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\ . ie \\n[#AUTHOR_COLOR]=1 \ . PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[] . el .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] . \} . \} .END \# .MAC DEFAULT_DOCHEADER END . DOC_HEADER_QUAD . if !'\\*[$TITLE_1]'' \{\ . FAMILY \\*[$TITLE_FAM] . FT \\*[$TITLE_FT] . ps \\*[$TITLE_PT_SIZE] . vs \\n[#DOCHEADER_LEAD]u . nr #ARG_NUM 0 1 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#TITLE_COLOR]=1 \ . PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[] . el .PRINT "\\*[$TITLE_\\n[#ARG_NUM]] . \} . \} . if !'\\*[$SUBTITLE_1]'' \{\ . FAMILY \\*[$SUBTITLE_FAM] . FT \\*[$SUBTITLE_FT] . ps \\*[$SUBTITLE_PT_SIZE] . nr #ARG_NUM 0 1 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#SUBTITLE_COLOR]=1 \ . PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[] . el .PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]] . \} . \} . if !'\\*[$AUTHOR_1]'' \{\ . FAMILY \\*[$AUTHOR_FAM] . FT \\*[$AUTHOR_FT] . ps \\*[$AUTHOR_PT_SIZE] . ie \\n[#ATTRIBUTE_COLOR]=1 \ . PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[] . el .PRINT \&\\*[$ATTRIBUTE_STRING] . PRINT_AUTHORS . \} . FAMILY \\*[$DOC_FAM] . FT R .END \# .MAC CHAPTER_DOCHEADER END . DOC_HEADER_QUAD . FAMILY \\*[$TITLE_FAM] . FT \\*[$TITLE_FT] . ps \\*[$TITLE_PT_SIZE] . vs \\n[#DOCHEADER_LEAD]u .\" Chapter title only . ie '\\*[$CHAPTER]'' \{\ . ie !'\\*[$CHAPTER_TITLE_1]'' \{\ . if \\n[#PRINT_STYLE]=2 \{\ . FAMILY \\*[$CHAPTER_TITLE_FAM] . FT \\*[$CHAPTER_TITLE_FT] . ps \\*[$CHAPTER_TITLE_PT_SIZE] . vs \\n[#DOCHEADER_LEAD]u . \} . nr #ARG_NUM 0 1 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#TITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[] . \} . el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] . \} . \} . el \{\ . ie \\n[#TITLE_COLOR]=1 \{\ . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[] . \} . el .PRINT \\*[$CHAPTER_STRING] . \} . \} .\" Chapter string, possibly with a chapter title . el \{\ . ie \\n[#TITLE_COLOR]=1 \{\ . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[] . \} . el .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] . if !'\\*[$CHAPTER_TITLE_1]'' \{\ . if \\n[#PRINT_STYLE]=2 \{\ . FAMILY \\*[$CHAPTER_TITLE_FAM] . FT \\*[$CHAPTER_TITLE_FT] . ps \\*[$CHAPTER_TITLE_PT_SIZE] . vs \\n[#DOCHEADER_LEAD]u . ALD \\n[.v]u/4u \" Put a little space before the chapter title . \} . nr #ARG_NUM 0 1 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#CHAPTER_TITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[] . \} . el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] . \} . RLD \\n[#DOC_LEAD]u \" Just looks better this way . \} . \} . FAMILY \\*[$DOC_FAM] . FT R .END \# .MAC NAMED_DOCHEADER END . DOC_HEADER_QUAD . FAMILY \\*[$TITLE_FAM] . FT \\*[$TITLE_FT] . ps \\*[$TITLE_PT_SIZE] . vs \\n[#DOCHEADER_LEAD]u . if !'\\*[$TITLE_1]'' \{\ . nr #ARG_NUM 0 1 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#TITLE_COLOR]=1 \{\ . PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[] . \} . el .PRINT "\\*[$TITLE_\\n[#ARG_NUM]] . \} . \} . if !'\\*[$SUBTITLE]'' \{\ . FAMILY \\*[$SUBTITLE_FAM] . FT \\*[$SUBTITLE_FT] . ps \\*[$SUBTITLE_PT_SIZE] . nr #ARG_NUM 0 1 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#SUBTITLE_COLOR]=1 \{\ . PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[] . \} . el .PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]] . \} . \} . if !'\\*[$AUTHOR_1]'' \{\ . FAMILY \\*[$AUTHOR_FAM] . FT \\*[$AUTHOR_FT] . ps \\*[$AUTHOR_PT_SIZE] . ie \\n[#ATTRIBUTE_COLOR]=1 \{\ . PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[] . \} . el .PRINT \&\\*[$ATTRIBUTE_STRING] . PRINT_AUTHORS . \} . FAMILY \\*[$DOCTYPE_FAM] . FT \\*[$DOCTYPE_FT] . ps \\*[$DOCTYPE_PT_SIZE] . vs \\n[#DOCHEADER_LEAD]u . ALD \\n[#DOCHEADER_LEAD]u . nr #FROM_DOCTYPE 1 . if \\n[#DOCTYPE_COLOR]=1 .COLOR \\*[$DOCTYPE_COLOR] . ie \\n[#DOCTYPE_UNDERLINE]=1 \ . UNDERSCORE \\*[$DOCTYPE_UNDERLINE_GAP] "\\*[$DOC_TYPE]" . el .PRINT "\\*[$DOC_TYPE]" . COLOR black . FAMILY \\*[$DOC_FAM] . FT R . rr #FROM_DOCTYPE .END \# \# COVER PAGE \# ---------- \# *Arguments: \# TITLE | DOCTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE | COVERTITLE \ \# [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC BLANKPAGE ] \# *Function: \# Toggles the number register for each cover page element \# passed as an argument. \# *Notes: \# TITLE, DOCTITLE, CHAPTER, CHAPTER_TITLE or CHAPTER+TITLE must \# be supplied. After that, users may enter as many or as few of \# the arguments as they like. BLANKPAGE inserts a blank page \# after the cover. \# \# If called as DOC_COVER, performs the same operations, but \# applies everything to a doc cover. \# .MAC COVER END . ie '\\$0'DOC_COVER' \{\ . nr #DOC_COVER 1 . ds DOC_ DOC_ . \} . el .nr #COVER 1 . nr #ARG_NUM 0 1 . nr #COVER_ITEM \\n[#NUM_ARGS] \"loop count . while \\n+[#ARG_NUM]<=\\n[#COVER_ITEM] \{\ . if '\\$1'TITLE' \{\ . nr #\\*[DOC_]COVER_TITLE 1 . shift . \} . if '\\$1'DOCTITLE' \{\ . nr #\\*[DOC_]COVER_TITLE 2 . shift . \} . if '\\$1'CHAPTER' \{\ . nr #\\*[DOC_]COVER_TITLE 3 . shift . \} . if '\\$1'CHAPTER_TITLE' \{\ . nr #\\*[DOC_]COVER_TITLE 4 . shift . \} . if '\\$1'CHAPTER+TITLE' \{\ . nr #\\*[DOC_]COVER_TITLE 5 . shift . \} . if '\\$1'\\*[DOC_]COVERTITLE' \{\ . nr #\\*[DOC_]COVER_TITLE 6 . shift . \} . if '\\$1'SUBTITLE' \{\ . nr #\\*[DOC_]COVER_SUBTITLE 1 . shift . \} . if '\\$1'AUTHOR' \{\ . nr #\\*[DOC_]COVER_AUTHOR 1 . shift . \} . if '\\$1'DOCTYPE' \{\ . nr #\\*[DOC_]COVER_DOCTYPE 1 . shift . \} . if '\\$1'COPYRIGHT' \{\ . nr #\\*[DOC_]COVER_COPYRIGHT 1 . shift . \} . if '\\$1'MISC' \{\ . nr #\\*[DOC_]COVER_MISC 1 . shift . \} . if '\\$1'PDF_OUTLINE_LABEL' \{\ . shift . ds $PDF_\\*[DOC_]COVER_LABEL \\$1 . shift . \} . if '\\$1'BLANKPAGE' \{\ . nr #\\*[DOC_]COVER_BLANKPAGE 1 . shift . \} . \} . if '\\$0'DOC_COVER' .rm DOC_ .END \# .MAC COVERTITLE END . ie '\\$0'DOC_COVERTITLE' \{\ . ie \\n[#NUM_ARGS]=0 \{\ . if \\n[#DOC_COVER_TITLE_NUM] \{\ . nr #ITEM 0 1 . while \\n[#DOC_COVER_TITLE_NUM]>\\n[#ITEM] \{\ . rm $DOC_COVER_TITLE_\\n+[#ITEM] . \} . rr #DOC_COVER_TITLE_NUM . rm $DOC_COVER_TITLE . \} . \} . el \{\ . nr #DOC_COVER_TITLE_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#DOC_COVER_TITLE_NUM] \{\ . ds \ $DOC_COVER_TITLE_\\n+[#DOC_COVER_TITLE_NUM] \\$\\n[#DOC_COVER_TITLE_NUM] . \} . ds $DOC_COVER_TITLE \\$* . \} . \} . el \{\ . ie \\n[#NUM_ARGS]=0 \{\ . if \\n[#COVER_TITLE_NUM] \{\ . nr #ITEM 0 1 . while \\n[#COVER_TITLE_NUM]>\\n[#ITEM] \{\ . rm $COVER_TITLE_\\n+[#ITEM] . \} . rr #COVER_TITLE_NUM . rm $COVER_TITLE . \} . \} . el \{\ . nr #COVER_TITLE_NUM 0 1 . while \\n[#NUM_ARGS]>\\n[#COVER_TITLE_NUM] \{\ . ds $COVER_TITLE_\\n+[#COVER_TITLE_NUM] \\$\\n[#COVER_TITLE_NUM] . \} . ds $COVER_TITLE \\$* .\" . if \\n[#DOCTITLE_NUM]=0 .PDF_TITLE \\*[$COVER_TITLE] . \} . \} .END \# \# COVER PAGE LEADING \# ------------------ \# *Arguments: \# <+|- amount by which to in/decrease leading of cover/doc cover> \# *Function: \# Stores user supplied lead in/decrease in string $COVER_LEAD_ADJ \# or $DOC_COVER_LEAD_ADJ, depending on whether the macro was called \# with an alias (DOC_COVER_LEAD). \# *Notes: \# A unit of measure must be supplied. Decimal fractions OK. \# Default is +0, i.e. same as DOC_LEAD. \# .MAC COVER_LEAD END . ie '\\$0'DOC_COVER_LEAD' .ds $DOC_COVER_LEAD_ADJ \\$1 . el .ds $COVER_LEAD_ADJ \\$1 .END \# \# MISCs get treated similarly to QUOTEs and BLOCKQUOTEs with respect to \# leading \# .MAC MISC_AUTOLEAD END . if '\\$0'DOC_COVER_MISC_AUTOLEAD' .nr #DOC_COVER_MISC_AUTOLEAD (p;\\$1) . if '\\$0'COVER_MISC_AUTOLEAD' .nr #COVER_MISC_AUTOLEAD (p;\\$1) .END \# .ALIAS DOC_COVER_MISC_AUTOLEAD MISC_AUTOLEAD .ALIAS COVER_MISC_AUTOLEAD MISC_AUTOLEAD \# \# COVER PAGE START POSITION \# ------------------------- \# *Arguments: \# \# *Function: \# Stores user supplied lead in/decrease in #COVER_START_POS \# or #DOC_COVER_START_POS, depending on whether the macro was \# called by an alias (DOC_COVER_ADVANCE). \# *Notes: \# A unit of measure must be supplied. Decimal fractions OK. \# If user doesn't invoke this macro, the default starting \# position for both covers and doc covers is 1/3 of the way \# down the page (setup in DO_COVER). \# .MAC COVER_ADVANCE END . ie '\\$0'DOC_COVER_ADVANCE' .nr #DOC_COVER_START_POS (\\$1) . el .nr #COVER_START_POS (\\$1) .END \# \# UNDERLINE CONTROL \# ----------------- \# *Arguments: \# [ DOUBLE ] [ [] ] | | \# *Function: \# Toggles underlining of the element indicated by the calling alias \# on or off. Uses #_UNDERLINE_WEIGHT to set the weight, \# and defines string $_UNDERLINE_GAP. \# *Notes: \# Calling aliases COVER_ and DOCCOVER_ only apply if DOCTYPE is \# NAMED and the DOCTYPE arg is passed to COVER or DOC_COVER. \# .MAC _UNDERLINE END . ie '\\$1'' \{\ . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \ . nr #BIB_STRING_UNDERLINE 1 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \ . nr #BIB_STRING_UNDERLINE 1 . if '\\$0'COVER_UNDERLINE' \ . nr #COVER_UNDERLINE 1 . if '\\$0'DOC_COVER_UNDERLINE' \ . nr #DOC_COVER_UNDERLINE 1 . if '\\$0'DOCTYPE_UNDERLINE' \ . nr #DOCTYPE_UNDERLINE 1 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \ . nr #EN_STRING_UNDERLINE 1 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \ . nr #EN_STRING_UNDERLINE 1 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \ . nr #EN_TITLE_UNDERLINE 1 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \ . nr #EN_TITLE_UNDERLINE 1 . \} . el \{\ . ie \\n[#NUM_ARGS]=1 \{\ . ds $ARG \\$1 . substring $ARG -1 . ie \B'\\*[$ARG]' \{\ . if !\\n[#PRINT_STYLE]=1 \{\ . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \ . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \ . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1 . if '\\$0'COVER_UNDERLINE' \ . COVER_UNDERLINE_WEIGHT \\$1 . if '\\$0'DOC_COVER_UNDERLINE' \ . DOC_COVER_UNDERLINE_WEIGHT \\$1 . if '\\$0'DOCTYPE_UNDERLINE' \ . DOCTYPE_UNDERLINE_WEIGHT \\$1 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\ . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1 . nr #EN_STRING_UNDERLINE 1 . \} . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\ . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1 . nr #EN_STRING_UNDERLINE 1 . \} . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \ . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \ . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1 . \} . \} . el \{\ . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\ . ie '\\$1'DOUBLE' .nr #BIB_STRING_UNDERLINE 2 . el .nr #BIB_STRING_UNDERLINE 0 . \} . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\ . ie '\\$1'DOUBLE' .nr #BIB_STRING_UNDERLINE 2 . el .nr #BIB_STRING_UNDERLINE 0 . \} . if '\\$0'COVER_UNDERLINE' .nr #COVER_UNDERLINE 0 . if '\\$0'DOC_COVER_UNDERLINE' .nr #DOC_COVER_UNDERLINE 0 . if '\\$0'DOCTYPE_UNDERLINE' .nr #DOCTYPE_UNDERLINE 0 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\ . ie '\\$1'DOUBLE' .nr #EN_STRING_UNDERLINE 2 . el .nr #EN_STRING_UNDERLINE 0 . \} . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\ . ie '\\$1'DOUBLE' .nr #EN_STRING_UNDERLINE 2 . el .nr #EN_STRING_UNDERLINE 0 . \} . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{\ . ie '\\$1'DOUBLE' .nr #EN_TITLE_UNDERLINE 2 . el .nr #EN_TITLE_UNDERLINE 0 . \} . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{\ . ie '\\$1'DOUBLE' .nr #EN_TITLE_UNDERLINE 2 . el .nr #EN_TITLE_UNDERLINE 0 . \} . \} . \} . el \{\ . if !\\n[#PRINT_STYLE]=1 \{\ . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\ . nr #BIB_STRING_UNDERLINE 1 . if '\\$1'DOUBLE' \{\ . nr #BIB_STRING_UNDERLINE 2 . shift . \} . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1 . if !'\\$2'' \ . ds $BIB_STRING_UNDERLINE_GAP \\$2 . if !'\\$3'' \ . ds $BIB_STRING_RULE_GAP \\$3 . \} . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\ . nr #BIB_STRING_UNDERLINE 1 . if '\\$1'DOUBLE' \{\ . nr #BIB_STRING_UNDERLINE 2 . shift . \} . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1 . if !'\\$2'' .ds $BIB_STRING_UNDERLINE_GAP \\$2 . if !'\\$3'' .ds $BIB_STRING_RULE_GAP \\$3 . \} . if '\\$0'COVER_UNDERLINE' \{\ . nr #COVER_UNDERLINE 1 . COVER_UNDERLINE_WEIGHT \\$1 . ds $COVER_UNDERLINE_GAP \\$2 . \} . if '\\$0'DOC_COVER_UNDERLINE' \{\ . nr #DOC_COVER_UNDERLINE 1 . DOC_COVER_UNDERLINE_WEIGHT \\$1 . ds $DOC_COVER_UNDERLINE_GAP \\$2 . \} . if '\\$0'DOCTYPE_UNDERLINE' \{\ . nr #DOCTYPE_UNDERLINE 1 . DOCTYPE_UNDERLINE_WEIGHT \\$1 . ds $DOCTYPE_UNDERLINE_GAP \\$2 . \} .\" ENDNOTE_STRING_UNDERLINE and ENDNOTE_STRING_UNDERSCORE are identical .\" _UNDERLINE left in for backward compatibility . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\ . nr #EN_STRING_UNDERLINE 1 . if '\\$1'DOUBLE' \{\ . nr #EN_STRING_UNDERLINE 2 . shift . \} . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1 . if !'\\$2'' .ds $EN_STRING_UNDERLINE_GAP \\$2 . if !'\\$3'' .ds $EN_STRING_RULE_GAP \\$3 . \} . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\ . nr #EN_STRING_UNDERLINE 1 . if '\\$1'DOUBLE' \{\ . nr #EN_STRING_UNDERLINE 2 . shift . \} . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1 . if !'\\$2'' .ds $EN_STRING_UNDERLINE_GAP \\$2 . if !'\\$3'' .ds $EN_STRING_RULE_GAP \\$3 . \} .\" ENDNOTE_TITLE_UNDERLINE and ENDNOTE_TITLE_UNDERSCORE are identical .\" _UNDERLINE left in for backward compatibility . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{\ . nr #EN_TITLE_UNDERLINE 1 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1 . ds $EN_TITLE_UNDERLINE_GAP \\$2 . \} . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{\ . nr #EN_TITLE_UNDERLINE 1 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1 . ds $EN_TITLE_UNDERLINE_GAP \\$2 . \} . \} . \} . \} .END \# .ALIAS BIBLIOGRAPHY_STRING_UNDERSCORE _UNDERLINE .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE _UNDERLINE .ALIAS COVER_UNDERLINE _UNDERLINE .ALIAS DOC_COVER_UNDERLINE _UNDERLINE .ALIAS DOCTYPE_UNDERLINE _UNDERLINE .ALIAS ENDNOTE_STRING_UNDERLINE _UNDERLINE .ALIAS ENDNOTE_STRING_UNDERSCORE _UNDERLINE .ALIAS ENDNOTE_TITLE_UNDERLINE _UNDERLINE .ALIAS ENDNOTE_TITLE_UNDERSCORE _UNDERLINE \# \# COVERS - WHETHER TO PRINT \# ------------------------- \# *Arguments: \# | \# *Function: \# Creates or removes registers #COVERS and #COVERS_OFF, checked for \# in DEFAULTS (in START) prior to printing \# .MAC COVERS END . ie '\\$0'DOC_COVERS' \{\ . ie '\\$1'' \{\ . rr #DOC_COVERS_OFF . nr #DOC_COVERS 1 . \} . el \{\ . rr #DOC_COVERS . nr #DOC_COVERS_OFF 1 . \} . \} . el \{\ . ie '\\$1'' \{\ . rr #COVERS_OFF . nr #COVERS 1 . \} . el \{\ . rr #COVERS . nr #COVERS_OFF 1 . \} . \} .END \# \# COVER_COUNTS_PAGES \# ------------------ \# *Arguments: \# | \# *Function: \# Creates or removes registers #COVERS_COUNT or #DOCCOVERS_COUNT, \# used in END_COVER to determine whether to increment the page \# number silently when doc covers or covers are output. \# .MAC COVER_COUNTS_PAGES END . if '\\$0'DOC_COVER_COUNTS_PAGES' \{\ . ie '\\$1'' .nr #DOCCOVERS_COUNT 1 . el .rr #DOCCOVERS_COUNT . return . \} . if '\\$0'COVER_COUNTS_PAGES' \{\ . ie '\\$1'' .nr #COVERS_COUNT 1 . el .rr #COVERS_COUNT . return . \} .END \# .MAC DO_COVER END . nr #DOING_COVER 1 . ev COVER . evc 0 . TRAP OFF . if \\n[#PAGINATE]=1 \{\ . nr #PAGINATION_WAS_ON 1 . rr #PAGINATE . \} . if \\n[#HEADERS_ON]=1 \{\ . nr #HEADERS_WERE_ON 1 . HEADERS OFF . \} . if \\n[#FOOTERS_ON]=1 \{\ . nr #FOOTERS_WERE_ON 1 . FOOTERS OFF . \} . if \\n[#COLUMNS]=1 \{\ . nr #COLUMNS_WERE_ON 1 . rr #COLUMNS . \} . ds PDF_BM . ie '\\$0'DO_DOC_COVER' \{\ . ds DOC_ DOC_ . nr #DOC_COVER_DONE 1 . if '\\*[$PDF_DOC_COVER_LABEL]'' \ . ds $PDF_DOC_COVER_LABEL Cover: . \} . el \{\ . if '\\*[$PDF_COVER_LABEL]'' .ds $PDF_COVER_LABEL Title Page: . \} . if !r#\\*[DOC_]COVER_START_POS \ . nr #\\*[DOC_]COVER_START_POS \\n[#PAGE_LENGTH]/3 . if \\n[#PRINT_STYLE]=1 \{\ . ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u*2u . el .vs \\n[#DOC_LEAD]u . \} . if \\n[#PRINT_STYLE]=2 \{\ . vs \\n[#DOC_LEAD]u\\*[$\\*[DOC_]COVER_LEAD_ADJ] . nr #\\*[DOC_]COVER_LEAD \\n[#LEAD] . \} . if \\n[.ns] .rs . if '\\$0'DO_COVER' \{\ . if \\n[TOC.RELOCATE]==5 \{\ . if !rTOC_BH .TOC_BEFORE_HERE . \} . \} . if '\\$0'DO_DOC_COVER' \{\ . if \\n[TOC.RELOCATE]==3 \{\ . if !rTOC_BH .TOC_BEFORE_HERE . \} . \} . RV_HARD_SET_MARGINS . sp |\\n[#\\*[DOC_]COVER_START_POS]u-1v . if \\n[#\\*[DOC_]COVER_COLOR]=1 \{\ . nf \m[\\*[$\\*[DOC_]COVER_COLOR]] . EOL . \} . \\*[DOC_]COVER_H_POS . fam \\*[$\\*[DOC_]COVER_TITLE_FAM] . ft \\*[$\\*[DOC_]COVER_TITLE_FT] . ps \\*[$\\*[DOC_]COVER_TITLE_PT_SIZE] . ie \\n[#PRINT_STYLE]=1 \{\ . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \} . el \{ .vs \\n[#DOC_LEAD]u \} . \} . el .vs \\n[#\\*[DOC_]COVER_LEAD]u . if \\n[#PRINT_STYLE]=1 .TYPEWRITER . if \\n[#\\*[DOC_]COVER_TITLE] \{\ . nr PDFHREF.VIEW.LEADING.H \\n[PDFHREF.VIEW.LEADING] . nr PDFHREF.VIEW.LEADING \\n[nl]u-1v-1000u . \} . if \\n[#\\*[DOC_]COVER_TITLE]=1 \{\ . ie \\n[#PRINT_STYLE]=1 \{\ . CAPS . nr #ARG_NUM 0 1 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE "\\*[$TITLE_\\n[#ARG_NUM]]" . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$TITLE_\\n[#ARG_NUM]] . \} . CAPS OFF . \} . el \{\ . nr #ARG_NUM 0 1 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[] . \} . el \ . PRINT "\\*[$TITLE_\\n[#ARG_NUM]] . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$TITLE_\\n[#ARG_NUM]] . \} . \} . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM] .\" . PDF_TITLE \\*[PDF_BM] . \} . if \\n[#\\*[DOC_]COVER_TITLE]=2 \{\ . ie \\n[#PRINT_STYLE]=1 \{\ . CAPS . nr #ARG_NUM 0 1 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE "\\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]" . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]] . \} . CAPS OFF . \} . el \{\ . nr #ARG_NUM 0 1 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]\m[] . \} . el .PRINT \\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]] . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]] . \} . \} . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM] .\" . PDF_TITLE \\*[PDF_BM] . \} . if \\n[#\\*[DOC_]COVER_TITLE]=3 \{\ . ie \\n[#PRINT_STYLE]=1 \{\ . CAPS . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] . CAPS OFF . \} . el \{\ . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[] . \} . el .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] . \} . PDF_BOOKMARK 1 \ \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[$CHAPTER_STRING] \\*[$CHAPTER] .\" . PDF_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER] . \} . if \\n[#\\*[DOC_]COVER_TITLE]=4 \{\ . ie \\n[#PRINT_STYLE]=1 \{\ . CAPS . nr #ARG_NUM 0 1 . ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u . el .vs \\n[#DOC_LEAD]u . sp . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]" . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] . \} . CAPS OFF . if \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u . \} . el \{\ . nr #ARG_NUM 0 1 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[] . \} . el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] . \} . \} . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM] .\" . PDF_TITLE \\*[PDF_BM] . \} . if \\n[#\\*[DOC_]COVER_TITLE]=5 \{\ . ie \\n[#PRINT_STYLE]=1 \{\ . CAPS . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] . CAPS OFF . \} . el \{\ . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[] . \} . el .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] . \} . if !'\\*[$CHAPTER_TITLE_1]'' \{\ . ie \\n[#PRINT_STYLE]=1 \{\ . ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u . el .vs \\n[#DOC_LEAD]u . sp . nr #ARG_NUM 0 1 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]" . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] . \} . if \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u . \} . el \{\ . fam \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_FAM] . ft \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_FT] . ps \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_PT_SIZE] . ALD \\n[.v]u/4u \"Put a little space before the chapter title . nr #ARG_NUM 0 1 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[] . \} . el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] . \} . \} . \} . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM] .\" . PDF_TITLE \\*[PDF_BM] . \} . if \\n[#\\*[DOC_]COVER_TITLE]=6 \{\ . ie \\n[#PRINT_STYLE]=1 \{\ . CAPS . nr #ARG_NUM 0 1 . while \\n[#\\*[DOC_]COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE "\\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]" . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]] . \} . CAPS OFF . \} . el \{\ . nr #ARG_NUM 0 1 . while \\n[#\\*[DOC_]COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\ \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]\m[] . \} . el .PRINT \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]] . if \\n[#ARG_NUM]>1 .as PDF_BM " \" . as PDF_BM \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]] . \} . \} . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM] .\" . PDF_TITLE \\*[PDF_BM] . \} . if \\n[#\\*[DOC_]COVER_TITLE] \{\ . nr PDFHREF.VIEW.LEADING \\n[PDFHREF.VIEW.LEADING.H] . rr PDFHREF.VIEW.LEADING.H . \} . if !\\n[#DOC_TYPE]=2 \{\ . if \\n[#\\*[DOC_]COVER_SUBTITLE]=1 \{\ . fam \\*[$\\*[DOC_]COVER_SUBTITLE_FAM] . ft \\*[$\\*[DOC_]COVER_SUBTITLE_FT] . ps \\*[$\\*[DOC_]COVER_SUBTITLE_PT_SIZE] . if \\n[#PRINT_STYLE]=1 \{\ . TYPEWRITER . ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u . el .vs \\n[#DOC_LEAD]u . sp . \} . if \\n[#\\*[DOC_]COVER]=1 \{\ . ie !'\\*[$SUBTITLE_\\*[DOC_]COVER_1]'' \{\ . nr #SUBTITLES \\n[#SUBTITLE_\\*[DOC_]COVER_NUM] . nr #NEXT_SUBTITLE 0 1 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\ . ie \\n[#\\*[DOC_]COVER_SUBTITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$\\*[DOC_]COVER_SUBTITLE_COLOR]]\ \\*[$SUBTITLE_\\*[DOC_]COVER_\\n+[#NEXT_SUBTITLE]]\m[] . \} . el .PRINT \ \\*[$SUBTITLE_\\*[DOC_]COVER_\\n+[#NEXT_SUBTITLE]] . \} . \} . el \{\ . nr #SUBTITLES \\n[#SUBTITLE_NUM] . nr #NEXT_SUBTITLE 0 1 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\ . ie \\n[#\\*[DOC_]COVER_SUBTITLE_COLOR]=1 \{\ . PRINT \ \m[\\*[$\\*[DOC_]COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]]\m[] . \} . el .PRINT \\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]] . \} . \} . \} . if \\n[#PRINT_STYLE]=1 \{\ . if \\n[#SINGLE_SPACE]=0 .vs . \} . \} . if \\n[#PRINT_STYLE]=1 \{\ . if !r#\\*[DOC_]COVER_SUBTITLE .sp . \} . \} . if \\n[#\\*[DOC_]COVER_AUTHOR]=1 \{\ . fam \\*[$\\*[DOC_]COVER_AUTHOR_FAM] . ft \\*[$\\*[DOC_]COVER_AUTHOR_FT] . ps \\*[$\\*[DOC_]COVER_AUTHOR_PT_SIZE] . if \\n[#PRINT_STYLE]=1 \{\ . TYPEWRITER . ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u . el .vs \\n[#DOC_LEAD]u/2u . sp . \} . ie d$ATTRIBUTE_STRING_DO_CCOVER \{\ . ie \\n[#\\*[DOC_]COVER_ATTRIBUTE_COLOR]=1 \{\ . PRINT \ \&\m[\\*[$\\*[DOC_]COVER_ATTRIBUTE_COLOR]]\ \\*[$ATTRIBUTE_STRING_\\*[DOC_]COVER]\m[] . \} . el .PRINT \&\\*[$ATTRIBUTE_STRING_\\*[DOC_]COVER] . \} . el \{\ . if d$ATTRIBUTE_STRING \{\ . ie \\n[#\\*[DOC_]COVER_ATTRIBUTE_COLOR]=1 \{\ . PRINT \ \&\m[\\*[$\\*[DOC_]COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[] . \} . el .PRINT \&\\*[$ATTRIBUTE_STRING] . \} . \} . PRINT_AUTHORS . \} . fam \\*[$\\*[DOC_]COVER_DOCTYPE_FAM] . ft \\*[$\\*[DOC_]COVER_DOCTYPE_FT] . ps \\*[$\\*[DOC_]COVER_DOCTYPE_PT_SIZE] . sp . if \\n[#DOC_TYPE]=3 \{\ . if \\n[#\\*[DOC_]COVER_DOCTYPE]=1 \{\ . ie \\n[#PRINT_STYLE]=1 \{\ . TYPEWRITER . vs \\n[#DOC_LEAD]u . UNDERSCORE2 "\\*[$DOC_TYPE]" . \} . el \{\ . nr #FROM_\\*[DOC_]COVER 1 . ie \\n[#\\*[DOC_]COVER_DOCTYPE_COLOR]=1 \{\ . COLOR \\*[$\\*[DOC_]COVER_DOCTYPE_COLOR] . ie \\n[#\\*[DOC_]COVER_UNDERLINE]=1 \ . UNDERSCORE \\*[$\\*[DOC_]COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" . el .PRINT "\\*[$DOC_TYPE]" . \} . el \{\ . ie \\n[#\\*[DOC_]COVER_UNDERLINE]=1 \ . UNDERSCORE \ \\*[$\\*[DOC_]COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" . el .PRINT "\\*[$DOC_TYPE]" . \} . rr #FROM_\\*[DOC_]COVER . \} . \} . \} . sp |\\n[#VISUAL_B_MARGIN]u . ie \\n[#PRINT_STYLE]=1 \{\ . TYPEWRITER . ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u . el .vs \\n[#DOC_LEAD]u/2u . sp . \} . el \{\ . fam \\*[$\\*[DOC_]COVER_COPYRIGHT_FAM] . ft \\*[$\\*[DOC_]COVER_COPYRIGHT_FT] . ps \\*[$\\*[DOC_]COVER_COPYRIGHT_PT_SIZE] . vs \\n[.ps]u+\\n[#\\*[DOC_]COVER_MISC_AUTOLEAD]u . nr #COPYRIGHT_V_ADJ \\n[#DOC_LEAD]-\\n[.v] . sp \\n[#COPYRIGHT_V_ADJ]u . rr #COPYRIGHT_V_ADJ . \} . if \\n[#\\*[DOC_]COVER_COPYRIGHT]=1 \{\ . if !'\\*[$COPYRIGHT_DOCCOVER]'' \{\ . ds $SAVED_COPYRIGHT \\*[$COPYRIGHT] . ds $COPYRIGHT \\*[$COPYRIGHT_DOCCOVER] . \} . QUAD \\*[$\\*[DOC_]COVER_COPYRIGHT_QUAD] . ie \\n[#\\*[DOC_]COVER_COPYRIGHT_COLOR]=1 \{\ . PRINT \m[\\*[$\\*[DOC_]COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[] . \} . el .PRINT \\*[$COPYRIGHT] . if d$SAVED_COPYRIGHT .ds $COPYRIGHT \\*[$SAVED_COPYRIGHT] . \} . br . if \\n[#\\*[DOC_]COVER_MISC]=1 \{\ . if \\n[#PRINT_STYLE]=2 \{\ . fam \\*[$\\*[DOC_]COVER_MISC_FAM] . ft \\*[$\\*[DOC_]COVER_MISC_FT] . ps \\*[$\\*[DOC_]COVER_MISC_PT_SIZE] . \} . QUAD \\*[$\\*[DOC_]COVER_MISC_QUAD] . ie !'\\*[$MISC_\\*[DOC_]COVER_1]'' \{\ . nr #MISCS \\n[#MISC_\\*[DOC_]COVER_NUM] . nr #NEXT_MISC 0 1 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\ . ie \\n[#\\*[DOC_]COVER_MISC_COLOR]=1 \{\ . da MISC_DIV . PRINT \ \m[\\*[$\\*[DOC_]COVER_MISC_COLOR]]\\*[$MISC_\\*[DOC_]COVER_\\n+[#NEXT_MISC]]\m[] . br . da . rm $MISC_\\*[DOC_]COVER_\\n[#NEXT_MISC] . rm $MISC_\\n[#NEXT_MISC] . \} . el \{\ . da MISC_DIV . PRINT \\*[$MISC_\\*[DOC_]COVER_\\n+[#NEXT_MISC]] . br . da . rm $MISC_\\*[DOC_]COVER_\\n[#NEXT_MISC] . rm $MISC_\\n[#NEXT_MISC] . \} . \} . rm $MISC_\\n+[#NEXT_MISC] . \} . el \{\ . nr #MISCS \\n[#MISC_NUM] . nr #NEXT_MISC 0 1 . while (\\n[#MISCS]>=\\n+[#NEXT_MISC]) \{\ . ie \\n[#\\*[DOC_]COVER_MISC_COLOR]=1 \{\ . da MISC_DIV . PRINT \ \m[\\*[$\\*[DOC_]COVER_MISC_COLOR]]\\*[$MISC_\\n[#NEXT_MISC]]\m[] . br . da . \} . el \{\ . da MISC_DIV . PRINT \\*[$MISC_\\n[#NEXT_MISC]] . br . da . \} . nr #MISC_DEPTH +\\n[dn] . \} . \} . nr #MISC_DEPTH -\\n[#DOC_LEAD] . sp |\\n[#VISUAL_B_MARGIN]u-\\n[#MISC_DEPTH]u . nf . MISC_DIV . rm MISC_DIV . rr #MISC_DEPTH . \} . if '\\$0'DO_COVER' .nr #COVER_END 1 . if '\\$0'DO_DOC_COVER' .nr #DOC_COVER_END 1 . if \\n[TOC.RELOCATE]==1 \{\ . if !\\n[#COVER_BLANKPAGE] \ . if !rTOC_BH .TOC_AFTER_HERE . \} . if '\\$0'DO_COVER' \{\ . if \\n[TOC.RELOCATE]==6 \ . if !rTOC_BH .TOC_AFTER_HERE . \} . if '\\$0'DO_DOC_COVER' \{\ . if \\n[TOC.RELOCATE]==4 \ . if !rTOC_BH .TOC_AFTER_HERE . \} . if '\\$0'DO_DOC_COVER' .rm DOC_ . END_COVER .END \# \# Macro to terminate (doc)cover processing \# .MAC END_COVER END . EOL . TRAP . NEWPAGE . if \\n[#PAGINATION_WAS_ON]=1 .nr % +1 . if \\n[#DOC_COVER_END]=1 \{\ . ie \\n[#DOC_COVER_BLANKPAGE]=1 \{\ . if \\n[TOC.RELOCATE] \ . if !\\n[#TOC_BH] .TOC_AFTER_HERE . NEWPAGE . rr #DOC_COVER_BLANKPAGE . if !\\n[#DOCCOVERS_COUNT]=1 .nr % -2 . \} . el \ . if !\\n[#DOCCOVERS_COUNT]=1 .nr #PAGE_NUM_ADJ -1 . rr #DOC_COVER_END . \} . if \\n[#COVER_END]=1 \{\ . ie \\n[#COVER_BLANKPAGE]=1 \{\ . if \\n[TOC.RELOCATE] \ . if !\\n[TOC_BH] .TOC_AFTER_HERE . NEWPAGE . rr #COVER_BLANKPAGE . if !\\n[#COVERS_COUNT]=1 .nr % -2 . \} . el \ . if !\\n[#COVERS_COUNT]=1 .nr #PAGE_NUM_ADJ -1 . rr #COVER_END . \} . if !'\\n[.ev]'0' .ev . if \\n[#PAGINATION_WAS_ON] \{\ . rr #PAGINATION_WAS_ON . PAGINATE . PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]-1 . \} . if \\n[#HEADERS_WERE_ON] \{\ . rr #HEADERS_WERE_ON . HEADERS . \} . if \\n[#FOOTERS_WERE_ON] \{\ . rr #FOOTERS_WERE_ON . FOOTERS . \} . if \\n[#COLUMNS_WERE_ON]=1 \{\ . rr #COLUMNS_WERE_ON 1 . nr #COLUMNS 1 . \} . rr #DOING_COVER . if \\n[.ns] .nop \& . if \\n[#RECTO_VERSO] .nr #RV_POST_COVER 1 .END \# \# Macro to begin document processing \# .MAC START END . nr #DOCS 1 . if \\n[TOC.RELOCATE]==2 \{\ . if !\\n[TOC_BH] .TOC_BEFORE_HERE . \} . if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap' . if !\\n[#PRINT_STYLE] \{\ . PRINTSTYLE TYPEWRITE . PRINT \& . po 6P . ll 39P . ta \\n[.l]u . sp |1i-1v . CENTER . PRINT "You neglected to enter a PRINTSTYLE" . fl . ab [mom]: PRINTSTYLE missing. Aborting '\\n[.F]'. . \} . if \\n[#LINENUMBERS]=1 \{\ . nn . NUMBER_LINES OFF . nr #LINENUMBERS 2 . \} . if \\n[#COLLATE] \{\ . COPYSTYLE \\*[$COPY_STYLE] . nr #HEADERS_ON \\n[#HEADER_STATE] . if \\n[#PAGE_NUM_V_POS]=1 .nr #PAGINATE \\n[#PAGINATION_STATE] . PRINT \& . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\ . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE] . rm $RESTORE_PAGENUM_STYLE . \} . \} . DEFAULTS . nr #PAGE_TOP \\n[#T_MARGIN]u-\\n[#DOC_LEAD]u . rr #RESET_TRAPS . if !r#EN_Q_AUTOLEAD .nr #EN_Q_LEAD \\n[#EN_LEAD] . if !r#EN_BQ_AUTOLEAD .nr #EN_BQ_LEAD \\n[#EN_LEAD] .\" TOC/recto-verso stuff . if !r@L_MARGIN .nr @L_MARGIN \\n[#DOC_L_MARGIN] . if !r@R_MARGIN .nr @R_MARGIN \\n[#DOC_R_MARGIN] .\" Covers and doc covers . if \\n[#DOC_COVERS]=1 \{\ . if \\n[#DOC_COVER]=1 \{\ . DO_DOC_COVER . rr #DOC_COVER . rr #DOC_COVER_TITLE . rr #DOC_COVER_SUBTITLE . rr #DOC_COVER_AUTHOR . rr #DOC_COVER_DOCTYPE . rr #DOC_COVER_COPYRIGHT . rr #DOC_COVER_MISC . \} . \} . if \\n[#COVERS]=1 \{\ . if \\n[#COVER]=1 \{\ . DO_COVER . rr #COVER . rr #COVER_TITLE . rr #COVER_SUBTITLE . rr #COVER_AUTHOR . rr #COVER_DOCTYPE . rr #COVER_COPYRIGHT . rr #COVER_MISC . \} . \} . if !\\n[#TOC] .RV_HARD_SET_MARGINS . if \\n[#COLUMNS] .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u .\" Collect TITLE for TOC. . if !\\n[#TOC]=1 \{\ . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ] . af #TOC_ENTRY_PN \\g[#PAGENUMBER] . ie \\n[#USER_SET_TITLE_ITEM] \{\ . ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM] . rr #USER_SET_TITLE_ITEM . rm $USER_SET_TITLE_ITEM . \} . el \{\ . ie \\n[#DOC_TYPE]=2 \{\ . ie '\\*[$CHAPTER_TITLE]'' \ . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER] . el \{\ . ie '\\*[$CHAPTER]'' \ . ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE] . el \ . ds $TOC_TITLE_ITEM \ \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE] . \} . \} . el \ . ds $TOC_TITLE_ITEM \\*[$TITLE] . \} . if \\n[#TOC_AUTHORS]=1 \{\ . ie '\\*[$TOC_AUTHORS]'' \ . as $TOC_TITLE_ITEM / \\*[$AUTHOR_1] . el \{\ . as $TOC_TITLE_ITEM / \\*[$TOC_AUTHORS] . rm $TOC_AUTHORS . \} . \} . sp |\\n[#DOCHEADER_ADVANCE]u-\\n[#DOC_LEAD]u . PDF_BOOKMARK 1 \\*[$TOC_TITLE_ITEM] . as $TOC_TITLE_ITEM \| . if \\n[#PREFIX_CH_NUM] \{\ . rn $TOC_TITLE_ITEM $TOC_TITLE_ITEM_OLD . ds $TOC_CH_NUM \\n[#CH_NUM].\[toc-hd-num-spacer] . ds $TOC_TITLE_ITEM \\*[$TOC_CH_NUM]\\*[$TOC_TITLE_ITEM_OLD] . rm $TOC_TITLE_ITEM_OLD . \} . TITLE_TO_TOC . \} . if !\\n[#TOC] .nr #POST_TOP 1 .\" End TITLE collection . if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\ . br . sp |\\n[#HEADER_MARGIN]u . PRINT_PAGE_NUMBER . \} . rr #COLLATE . rr #PAGINATION_STATE .\" End collate stuff . ie \\n[#DOC_HEADER]=0 \{\ . if \\n[.ns] .rs . if \\n[#DOC_TYPE]=4 \ . if !'\\n[.z]'' .di . nr #STORED_PP_INDENT \\n[#PP_INDENT] . PARA_INDENT 0 . PP . PARA_INDENT \\n[#STORED_PP_INDENT]u . rr #STORED_PP_INDENT . ie r#ADVANCE_FROM_TOP \{\ . br . sp |\\n[#ADVANCE_FROM_TOP]u-1v . if \\n[#ADJ_DOC_LEAD]=1 .SHIM . \} . el \{\ . br . sp |\\n[#T_MARGIN]u-1v . \} . if \\n[#COLUMNS] \{\ . mk dc . nr #COL_NUM 0 1 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u . nr #L_MARGIN \\n[.o] . ll \\n[#COL_L_LENGTH]u . \} . nr #PP 0 . \} . el \{\ . if \\n[#AUTO_LEAD] .nr #RESTORE_AUTO_LEAD 1 . if \\n[#PRINT_STYLE]=2 .vs \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] . if \\n[#RESTORE_AUTO_LEAD] \{\ . nr #AUTO_LEAD 1 . nr #AUTOLEAD_VALUE \\n[#SAVED_AUTOLEAD_VALUE] . \} . nr #DOCHEADER_LEAD \\n[#LEAD] .\" Default doctype . if \\n[#DOC_TYPE]=1 \{\ . if \\n[.ns] .rs . ev DOCHEADER . if \\n[#DOCHEADER_COLOR]=1 \{\ . nf \m[\\*[$DOCHEADER_COLOR]] . EOL . \} . L_MARGIN \\n[#DOC_L_MARGIN]u . LL \\n[#DOC_L_LENGTH]u . ta \\n[.l]u . if \\n[#PRINT_STYLE]=1 \{\ . DOC_HEADER_QUAD . TYPEWRITER . if !\\n[#SINGLE_SPACE] \{\ . vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u) . sp |\\n[#T_MARGIN]u-1v . \} . if !'\\*[$TITLE_1]'' \{\ . CAPS . nr #ARG_NUM 0 1 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE 3p "\\*[$TITLE_\\n[#ARG_NUM]]" . \} . CAPS OFF . \} . if !'\\*[$SUBTITLE]'' \{\ . sp . nr #ARG_NUM 0 1 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE 3p "\\*[$SUBTITLE_\\n[#ARG_NUM]]" . \} . \} . if !'\\*[$AUTHOR_1]'' \{\ . sp . PRINT \&\\*[$ATTRIBUTE_STRING] . nr #AUTHORS \\n[#AUTHOR_NUM] . nr #NEXT_AUTHOR 0 1 . if !\\n[#SINGLE_SPACE] .vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u) . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\ . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] . \} . \} . \} . if \\n[#PRINT_STYLE]=2 \{\ . DEFAULT_DOCHEADER . \} . ev . \} .\" Chapter doctype . if \\n[#DOC_TYPE]=2 \{\ . if \\n[.ns] .rs . ev DOCHEADER . if \\n[#DOCHEADER_COLOR]=1 \{\ . nf \m[\\*[$DOCHEADER_COLOR]] . EOL . \} . L_MARGIN \\n[#DOC_L_MARGIN]u . LL \\n[#DOC_L_LENGTH]u . ta \\n[.l]u . if \\n[#PRINT_STYLE]=1 \{\ . CENTER . TYPEWRITER . if !\\n[#SINGLE_SPACE] \{\ . vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u) . sp |\\n[#T_MARGIN]u-1v . \} . ie '\\*[$CHAPTER]'' \{\ . CAPS . ie !'\\*[$CHAPTER_TITLE]'' \{\ . nr #ARG_NUM 0 1 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE 3p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]" . \} . \} . el \{\ . CAPS . UNDERSCORE 3p "\\*[$CHAPTER_STRING]" . \} . CAPS OFF . RLD 1v . \} . el \{\ . CAPS . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] . CAPS OFF . if !'\\*[$CHAPTER_TITLE]'' \{\ . sp . nr #ARG_NUM 0 1 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE 3p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]" . \} . \} . RLD 1v . \} . vs \\n[#DOC_LEAD]u . if \\n[#SINGLE_SPACE] .sp 2 . \} . if \\n[#PRINT_STYLE]=2 \{\ . CHAPTER_DOCHEADER . di DOCHEADER_DIVERSION \" This diversion is only . br \" necessary to find the depth of the . CHAPTER_DOCHEADER \" docheader . br . di . nr #DOCHEADER_DEPTH \\n[dn]-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion . \" in #DOCHEADER_DEPTH . rm DOCHEADER_DIVERSION \" Removing the diversion macro . \} . ev . \} .\" Named . if \\n[#DOC_TYPE]=3 \{\ . if \\n[.ns] .rs . ev DOCHEADER . if \\n[#DOCHEADER_COLOR]=1 \{\ . nf \m[\\*[$DOCHEADER_COLOR]] . EOL . \} . L_MARGIN \\n[#DOC_L_MARGIN]u . LL \\n[#DOC_L_LENGTH]u . ta \\n[.l]u . if \\n[#PRINT_STYLE]=1 \{\ . CENTER . TYPEWRITER . if !\\n[#SINGLE_SPACE] \{\ . vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u) . sp |\\n[#T_MARGIN]u-1v . \} . if !'\\*[$TITLE_1]'' \{\ . CAPS . nr #ARG_NUM 0 1 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE 3p "\\*[$TITLE_\\n[#ARG_NUM]]" . \} . CAPS OFF . \} . if !'\\*[$SUBTITLE]'' \{\ . sp . nr #ARG_NUM 0 1 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\ . UNDERSCORE 3p "\\*[$SUBTITLE_\\n[#ARG_NUM]]" . \} . \} . if !'\\*[$AUTHOR_1]'' \{\ . sp . PRINT \&\\*[$ATTRIBUTE_STRING] . nr #AUTHORS \\n[#AUTHOR_NUM] . nr #NEXT_AUTHOR 0 1 . if !\\n[#SINGLE_SPACE] .vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u) . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\ . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] . \} . \} . ie !\\n[#SINGLE_SPACE] .sp 2 . el .sp . ie \\n[#DOCTYPE_UNDERLINE] \{\ . UNDERSCORE2 3p "\\*[$DOC_TYPE]" . \} . el \ . PRINT "\\*[$DOC_TYPE]" . if \\n[#SINGLE_SPACE]=1 .sp . \} . if \\n[#PRINT_STYLE]=2 .NAMED_DOCHEADER . ev . \} . if !\\n[#DOC_TYPE]=4 \{\ . if \\n[#PRINT_STYLE]=1 .sp . if \\n[#PRINT_STYLE]=2 .sp \\n[#DOC_LEAD]u*2u . if \\n[#COLUMNS] \{\ . nr #COL_NUM 0 1 . nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH] . ie \\n[#RV_POST_COVER] \{\ . nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#DOC_L_MARGIN] . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u . nr #L_MARGIN \\n[.o] . rr #RV_POST_COVER . \} . el \{\ . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u . nr #L_MARGIN \\n[.o] . \} . LL \\n[#COL_L_LENGTH]u . ta \\n[.l]u . \} . \} . \} . vs \\n[#DOC_LEAD]u . if \\n[#ADJ_DOC_LEAD]=1 \{\ . ie \\n[#ADVANCE_FROM_TOP]=0 \ . if \\n[#DOC_HEADER]=1 .SHIM . el .rr #ADVANCE_FROM_TOP . \} . mk dc . QUAD \\*[$DOC_QUAD] . CLEANUP_DEFAULTS . nr #START_FOR_FOOTERS 1 . if !\\n[#DOC_TYPE]=4 .em TERMINATE . if \\n[#LINENUMBERS]=2 \{\ . NUMBER_LINES RESUME . nr #LINENUMBERS 1 . \} . if \\n[#RUN_ON]=1 \{\ . if \\n[#FN_MARKER_STYLE]=1 .RUNON_WARNING . if \\n[#FN_MARKER_STYLE]=2 .RUNON_WARNING . \} .END \# .MAC CLEANUP_DEFAULTS END . nr #START 1 . if \\n[#DOC_HEADER]=1 .nr #DOC_HEADER 2 . rm $TOC_TITLE_ITEM . rr #MISC_NUM . rr #MISCS . rr #NEXT_AUTHOR . rr #NEXT_MISC .END \# \# ==================================================================== \# \# +++MACROS TO CHANGE SOME DEFAULTS+++ \# \# DOCUMENT HEADER \# --------------- \# *Argument: \# | [distance to advance from top of page] \# *Function: \# Turns printing of document header on or off. If a second \# numeric argument with units of measure is given, advances that \# distance from the top of the page without printing the document \# header. \# *Notes: \# Default is on. If the 1st argument is (which turns \# document headers off), the optional 2nd argument may be given \# (with a unit of measure). \# .MAC DOCHEADER END . ie '\\$1'' .nr #DOC_HEADER 1 . el \{\ . if !'\\$2'' .nr #ADVANCE_FROM_TOP (\\$2) . nr #DOC_HEADER 0 . \} .END \# \# DOCUMENT HEADER LEADING \# ----------------------- \# *Arguments: \# <+|- amount by which to in/decrease leading of doc header> \# *Function: \# Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ. \# *Notes: \# A unit of measure must be supplied. Decimal fractions OK. \# Default is +0, i.e. same as DOC_LEAD. \# .MAC DOCHEADER_LEAD END . ds $DOCHEADER_LEAD_ADJ \\$1 .END \# \# DOCHEADER ADVANCE \# ----------------- \# *Arguments: \# \# *Function: \# Creates register #DOCHEADER_ADVANCE, used in START. \# *Notes: \# Unit of measure required. \# Default is same as T_MARGIN. \# .MAC DOCHEADER_ADVANCE END . nr #DOCHEADER_ADVANCE \\$1 .END \# \# DOCUMENT LEFT MARGIN \# -------------------- \# *Argument: \# \# *Function: \# Creates or modifies register #DOC_L_MARGIN. \# *Notes: \# Affects everything on the page. \# .MAC DOC_LEFT_MARGIN END . if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0 . br . nr #DOC_L_MARGIN (\\$1) . L_MARGIN \\n[#DOC_L_MARGIN]u .END \# \# DOCUMENT RIGHT MARGIN \# --------------------- \# *Argument: \# \# *Function: \# Creates or modifies register #DOC_R_MARGIN. \# *Notes: \# Affects everything on the page. \# .MAC DOC_RIGHT_MARGIN END . br . nr #DOC_R_MARGIN (\\$1) . R_MARGIN \\n[#DOC_R_MARGIN] . nr #DOC_L_LENGTH \\n[#L_LENGTH] .END \# \# DOCUMENT LINE LENGTH \# -------------------- \# *Argument: \# \# *Function: \# Creates or modifies register #DOC_L_LENGTH. \# *Notes: \# Affects everything on the page. \# .MAC DOC_LINE_LENGTH END . if !\\n[DOCS] .DOC_MACRO_ERROR \\$0 . br . nr #DOC_L_LENGTH (\\$1) . LL \\n[#DOC_L_LENGTH]u . ta \\n[.l]u .END \# \# DOCUMENT FAMILY \# --------------- \# *Argument: \# \# *Function: \# Creates or modifies string $DOC_FAM. \# *Notes: \# Affects everything except headers and footers. \# .MAC DOC_FAMILY END . if !\\n[DOCS] .DOC_MACRO_ERROR \\$0 . br . ds $DOC_FAM \\$1 . ds $FAMILY \\*[$DOC_FAM] . AUTHOR_FAMILY \\*[$DOC_FAM] . BLOCKQUOTE_FAMILY \\*[$DOC_FAM] . DOCHEADER_FAMILY \\*[$DOC_FAM] . DOCTYPE_FAMILY \\*[$DOC_FAM] . EPIGRAPH_FAMILY \\*[$DOC_FAM] . FOOTNOTE_FAMILY \\*[$DOC_FAM] . HDRFTR_FAMILY \\*[$DOC_FAM] . LINENUMBER_FAMILY \\*[$DOC_FAM] . QUOTE_FAMILY \\*[$DOC_FAM] . SUBTITLE_FAMILY \\*[$DOC_FAM] . TITLE_FAMILY \\*[$DOC_FAM] .END \# \# DOCUMENT POINT SIZE \# ------------------- \# *Argument: \# \# *Function: \# Creates or modifies register #DOC_PT_SIZE. \# *Notes: \# DOC_PT_SIZE is the basis for calculating all type sizes in \# a document. Ignored if PRINTSTYLE TYPEWRITE. \# .ALIAS DOC_PT_SIZE PT_SIZE \# \# DOCUMENT LEAD \# ------------- \# *Argument: \# [ADJUST] \# *Function: \# Creates or modifies register #DOC_LEAD. If the optional \# ADJUST argument is given, adjusts leading so that the last \# line of text falls exactly on #B_MARGIN. \# *Notes: \# DOC_LEAD is the basis for calculating all leading changes in \# a document. Default for TYPESET is 16; 24 for TYPEWRITE. \# \# Because the visible bottom or footer margin of a page depends \# on the overall document lead supplied by the register #DOC_LEAD, \# DOC_LEAD, in the body of a document, should always be associated \# with the start of a new page (in other words, just before or \# just after a manual NEWPAGE). Ignored if PRINTSTYLE TYPEWRITE. \# .MAC DOC_LEAD END . if \\n[#IGNORE] .return . if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0 . br . if '\\$0'DOC_LEAD' \{\ . vs \\$1 . rr #DOC_AUTOLEAD . rr #DOC_AUTOLEAD_FACTOR . nr #DOC_LEAD \\n[.v] . \} . nr #RESET_TRAPS 1 . if !\\n[#ADJ_DOC_LEAD] .nr #REMOVE_ADJ 1 . if !'\\$0'DOC_LEAD' \{\ . if '\\$0'EN_LEAD' .nr #DOC_LEAD \\n[#EN_LEAD] . if '\\$0'BIB_LEAD' .nr #DOC_LEAD \\n[#BIB_LEAD] . if '\\$0'TOC_LEAD' .nr #DOC_LEAD \\n[#TOC_LEAD] . if '\\$2'ADJUST' .TRAPS . rr #RESET_TRAPS . \} .END \# \# ADJUST DOCUMENT LEAD \# -------------------- \# *Arguments: \# | \# *Function: \# Adjusts document lead so that the last line of text falls exactly \# on #B_MARGIN. \# .MAC DOC_LEAD_ADJUST END . ie '\\$1'' \{\ . nr #ADJ_DOC_LEAD 1 . rr #DOC_LEAD_ADJUST_OFF . \} . el \{\ . nr #ADJ_DOC_LEAD 0 . nr #DOC_LEAD_ADJUST_OFF 1 . \} .END \# \# SHIM \# ---- \# *Argument: \# None \# *Function: \# Advances to the next "valid" baseline. \# *Notes: \# If a user plays around with spacing in a doc (say, with ALD), \# it isn't easy to get mom back on track so she can achieve \# perfectly flush bottom margins. Any time SHIM is used, it \# ensures that the next output line falls on a valid baseline. \# \# First, a little convenience macro \# .MAC PROCESS_SHIM END . while \\n+[#VALID_BASELINE]<\\n[#CURRENT_V_POS] \{\ . . \} . nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS] .END \# \# And a macro to disable SHIM \# .MAC NO_SHIM END . ie '\\$1'' .nr #NO_SHIM 1 . el .rr #NO_SHIM .END \# .nr #NO_SHIM 2 \" Restored to 1 in DEFAULTS. \# .MAC SHIM END . ie \\n[#NO_SHIM] .return . el \{\ . nr #VALID_BASELINE \\n[#T_MARGIN]-\\n[#DOC_LEAD] \\n[#DOC_LEAD] . if !r#CURRENT_V_POS .nr #CURRENT_V_POS \\n[.d] . ie \\n[#ADVANCE_FROM_TOP] \{\ . ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\ . while \\n-[#VALID_BASELINE]>\\n[#CURRENT_V_POS] . . nr #VALID_BASELINE +\\n[#DOC_LEAD] . nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS] . \} . el .PROCESS_SHIM . \} . el .PROCESS_SHIM ' sp \\n[#SHIM]u . rr #CURRENT_V_POS . \} .END \# \# ==================================================================== \# \# +++INTERNATIONALIZATION+++ \# \# ATTRIBUTE STRING \# ---------------- \# *Argument: \# \# *Function: \# Creates or modifies string $ATTRIBUTE_STRING. \# *Notes: \# Default is "by". A blank string ("") may be used if no \# attribution is desired. Blank line results. \# .MAC ATTRIBUTE_STRING END . if !'\\$1'DOC_COVER' \ . if !'\\$1'COVER' .nr #NEITHER 1 . if !'\\$1'COVER' \ . if !'\\$1'DOC_COVER' .nr #NEITHER 1 . if '\\$1'DOC_COVER' \ . ds $ATTRIBUTE_STRING_DOC_COVER \\$2 . if '\\$1'COVER' \ . ds $ATTRIBUTE_STRING_COVER \\$2 . if \\n[#NEITHER]=1 \{\ . ds $ATTRIBUTE_STRING \\$1 . rr #NEITHER . \} .END \# \# CHAPTER STRING \# -------------- \# *Argument: \# \# *Function: \# Creates or modifies string $CHAPTER_STRING. \# *Notes: \# Default is "chapter". \# .MAC CHAPTER_STRING END . ds $CHAPTER_STRING \\$1 .END \# \# DRAFT STRING \# ------------ \# *Argument: \# \# *Function: \# Creates or modifies string $DRAFT_STRING. \# *Notes: \# Default is "draft". \# .MAC DRAFT_STRING END . ds $DRAFT_STRING \\$1 .END \# \# REVISION STRING \# --------------- \# *Argument: \# \# *Function: \# Creates or modifies string $REVISION_STRING. \# *Notes: \# Default is "revision". \# .MAC REVISION_STRING END . ds $REVISION_STRING \\$1 .END \# \# FINIS STRING \# ------------ \# *Argument: \# \# *Function: \# Creates or modifies string $FINIS_STRING. \# *Notes: \# Default is "END". \# .MAC FINIS_STRING END . ds $FINIS_STRING \\$1 .END \# .MAC FINIS_STRING_CAPS END . ie '\\$1'' .nr #FINIS_STRING_CAPS 1 . el .nr #FINIS_STRING_CAPS 0 .END \# \# ==================================================================== \# \# +++RECTO/VERSO+++ \# \# RECTO_VERSO \# ----------- \# *Arguments: \# | \# *Function: \# Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages. Also \# switches page numbers left and right if either is chosen rather \# than the default centered page numbers. Switches left and right \# margins if differing values have been entered. \# *Notes: \# Default is OFF. \# .MAC RECTO_VERSO END . ie '\\$1'' .nr #RECTO_VERSO 1 . el .nr #RECTO_VERSO 0 .END \# \# FORCE RECTO \# ----------- \# *Function: \# Forces doccover and cover pages to recto \# .MAC RV_HARD_SET_MARGINS END . DOC_LEFT_MARGIN \\n[@L_MARGIN]u . DOC_RIGHT_MARGIN \\n[@R_MARGIN]u . po \\n[#DOC_L_MARGIN]u . LL \\n[#DOC_L_LENGTH]u .END \# \# ==================================================================== \# \# +++EPIGRAPHS+++ \# \# EPIGRAPH INDENT \# --------------- \# *Argument: \# \# *Function: \# Creates or modifies register #EPI_OFFSET_VALUE. \# *Notes: \# Default is 2 for TYPEWRITE, 3 for TYPESET. \# .MAC EPIGRAPH_INDENT END . rr #EPI_OFFSET_VALUE . rm $EPI_OFFSET_VALUE . ds $EVAL_EI_ARG \\$1 . substring $EVAL_EI_ARG -1 . ie \B'\\*[$EVAL_EI_ARG]' .nr #EPI_OFFSET_VALUE \\$1 . el .ds $EPI_OFFSET_VALUE \\$1 . rm $EVAL_EI_ARG .END \# \# EPIGRAPH AUTOLEAD \# ----------------- \# *Argument: \# \# *Function: \# Creates or modifies register #EPI_AUTOLEAD. \# *Notes: \# Default is 2 (for TYPESET; TYPEWRITE doesn't require this). \# .MAC EPIGRAPH_AUTOLEAD END . nr #EPI_AUTOLEAD (p;\\$1) .END \# \# EPIGRAPH \# -------- \# *Arguments: \# BLOCK | \# *Function: \# Places an epigraph before the document's text, after the \# document header, or after a HEAD. \# *Notes: \# #EPIGRAPH 1 = centered; 2 = block \# \# By default, epigraphs are centered, allowing the user \# to input them on a line per line basis. To change this \# behaviour, the user can supply the argument BLOCK, which \# will produce indented, filled text similar to BLOCKQUOTE. \# \# If a block epigraph contains more than one para, ALL paras of \# the epigraph must be preceded by PP. Otherwise, PP is optional. \# .MAC EPIGRAPH END . nr #PP_STYLE 2 . nr #Q_PP 0 . if \\n[#LINENUMBERS]=1 \{\ . NUMBER_LINES OFF . nr #LINENUMBERS 2 . \} . if \\n[#START] \{\ . if \\n[#PRINT_STYLE]=1 \ . if \\n[#AUTHOR_LINES]=1 .sp \\n[#DOC_LEAD]u . \} . ie '\\$1'' \{\ . nr #EPIGRAPH 1 . ev EPIGRAPH . nr #IN_DIVER 1 . ll \\n[#L_LENGTH]u . ta \\n[.l]u . CHECK_INDENT . if \\n[#COLUMNS] \{\ . ie \\n[#START] \{\ . ll \\n[#DOC_L_LENGTH]u . ta \\n[.l]u . \} . el \{\ . ll \\n[#COL_L_LENGTH]u . ta \\n[.l]u . \} . \} . CENTER . if \\n[#PRINT_STYLE]=1 \{\ . fam \\*[$TYPEWRITER_FAM] . ft R . if '\\*[$EPI_FT]'I' .FT I . ps \\*[$TYPEWRITER_PS] . ie \\n[#SINGLE_SPACE] .vs \\n[#DOC_LEAD]u . el .vs \\n[#DOC_LEAD]u/2u . nr #EPI_LEAD \\n[#LEAD] . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD] . \} . if \\n[#PRINT_STYLE]=2 \{\ . FAMILY \\*[$EPI_FAM] . FT \\*[$EPI_FT] . ps \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE] . if \\n[#EPI_COLOR]=1 \{\ . nf \m[\\*[$EPI_COLOR]] . EOL . \} . vs \\n[.ps]u+\\n[#EPI_AUTOLEAD]u . nr #EPI_LEAD \\n[#LEAD] . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD] . \} . di EPI_TEXT . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p . hy 14 . nr #EPI_ACTIVE 1 . \} . el \{\ . ie '\\$1'BLOCK' \{\ . nr #EPIGRAPH 2 . ev EPIGRAPH . evc 0 . ie \\n[#START] \{\ . ie \\n[#COLUMNS] \{\ . ie r#EPI_OFFSET_VALUE \ . ll \ \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u)) . el \ . ll \ \\n[#L_LENGTH_FOR_EPI]u-(\\*[$EPI_OFFSET_VALUE]u*2u) . ta \\n[.l]u . \} . el \{\ . ie r#EPI_OFFSET_VALUE \ . ll \ \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u)) . el \ . ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u) . ta \\n[.l]u . \} . \} . el \{\ . ie r#EPI_OFFSET_VALUE \ . ll \ \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u)) . el \ . ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u) . ta \\n[.l]u . if \\n[#COLUMNS] \{\ . ie r#EPI_OFFSET_VALUE \ . ll \ \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u)) . el \ . ll \\n[#COL_L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u) . ta \\n[.l]u . \} . CHECK_INDENT . \} . if \\n[#PRINT_STYLE]=1 \{\ . fam \\*[$TYPEWRITER_FAM] . ft R . if '\\*[$EPI_FT]'I' .FT I . ps \\*[$TYPEWRITER_PS] . ie \\n[#SINGLE_SPACE] .vs \\n[#DOC_LEAD]u . el .vs \\n[#DOC_LEAD]u/2u . QUAD LEFT . HY OFF . nr #EPI_LEAD \\n[#LEAD] . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD] . di EPI_TEXT . nr #EPI_ACTIVE 1 . \} . if \\n[#PRINT_STYLE]=2 \{\ . FAMILY \\*[$EPI_FAM] . FT \\*[$EPI_FT] . ps \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE] . if \\n[#EPI_COLOR]=1 \{\ . nf \m[\\*[$EPI_COLOR]] . EOL . \} . vs \\n[.ps]u+\\n[#EPI_AUTOLEAD]u . QUAD \\*[$EPI_QUAD] . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p . hy 14 . nr #EPI_LEAD \\n[#LEAD] . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD] . di EPI_TEXT . nr #EPI_ACTIVE 1 . \} . \} . el .DO_EPIGRAPH . \} .END \# \# DO EPIGRAPH \# ----------- \# *Arguments: \# \# *Function: \# Ends diversion started in EPIGRAPH. Makes spacing \# adjustments to compensate for the difference between epigraph \# leading and overall document leading, so that the bottom of \# the pages remain flush. \# *Notes: \# In addition to its usual place at the beginning of a \# document, EPIGRAPH may also be used after HEAD. \# .MAC DO_EPIGRAPH END . br . di . rr #IN_DIVER . if \\n[#RESET_FN_COUNTERS]=2 \{\ . if !\\n[#FN_COUNT]=1 \{\ . if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\ . DIVER_FN_2_POST . rr #RESET_FN_COUNTERS . \} . \} . \} . nr #SAVED_FN_NUMBER \\n[#FN_NUMBER] . nr #DONE_ONCE 0 1 . REMOVE_INDENT . ev . nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD] . nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD] . ie \\n[#START] \{\ . RLD \\n[#SHIM]u . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH] . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\ . nr #EPI_WHITESPACE -\\n[#DOC_LEAD] . \} . if \\n[#PRINT_STYLE]=1 \ . if !\\n[#SINGLE_SPACE]=1 .ALD \\n[#DOC_LEAD]u . if \\n[#PRINT_STYLE]=2 \{\ . ie !\\n[#DOC_TYPE]=2 .RLD \\n[#DOC_LEAD]u . el \{\ . ie '\\*[$CHAPTER_TITLE]'' .RLD \\n[#DOC_LEAD]u . el .if '\\*[$CHAPTER]'' .RLD \\n[#DOC_LEAD]u . \} . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \ . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u) . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \ . ALD \ \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u . \} . \} . el \{\ . ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\ . nr #EPI_FITS 1 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH] . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\ . nr #EPI_WHITESPACE -\\n[#DOC_LEAD] . \} . ie \\n[#PRINT_STYLE]=1 \{\ . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \ . ALD \\n[#EPI_WHITESPACE]u/2u . \} . el \{\ . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \ . ALD \ \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u) . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \ . ALD \ \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u . \} . if \\n[#DIVER_FN]=2 .rr #DIVER_FN . \} . el \{\ . nr #EPI_LINES_TO_TRAP 0 1 . while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\ . nr #LOOP 1 . \} . nr #EPI_LINES_TO_TRAP -1 . nr #EPI_WHITESPACE \ (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD]) . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\ . nr #EPI_WHITESPACE -\\n[#DOC_LEAD] . \} . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \ . ALD \\n[#EPI_WHITESPACE]u . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \ . ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u . \} . \} . if \\n[#EPIGRAPH]=1 \{\ . po \\n[#L_MARGIN]u . if \\n[#COLUMNS] \{\ . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u . nr #L_MARGIN \\n[.o] . \} . \} . if \\n[#EPIGRAPH]=2 \{\ . ie \\n[#EPI_OFFSET_VALUE] \ . nr #EPI_OFFSET \ \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) . el .nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE] . if \\n[#COLUMNS] \{\ . ie r#EPI_OFFSET_VALUE \ . nr #EPI_OFFSET \ \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) . el .nr #EPI_OFFSET \ \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE] . \} . po \\n[#EPI_OFFSET]u . \} . nf . EPI_TEXT . br . ie \\n[#START] \{\ . if \\n[#PRINT_STYLE]=1 .SHIM . if \\n[#PRINT_STYLE]=2 \{\ . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \ . ALD \\n[#EPI_WHITESPACE]u/2u . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \ . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u . SHIM . \} . \} . el \{\ . rr #EPI_ACTIVE . ie \\n[#EPI_FITS] \{\ . ie \\n[#FN_FOR_EPI] \{\ . nr #EPI_LINES_TO_END 1 . nr #EPI_WHITESPACE \ (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD]) . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\ . nr #EPI_WHITESPACE -\\n[#DOC_LEAD] . \} . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u) . \} . el \{\ . ie \\n[#PRINT_STYLE]=1 \{\ . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \ . ALD \\n[#EPI_WHITESPACE]u . \} . el \{\ . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \ . ALD \\n[#EPI_WHITESPACE]u/2u . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \ . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u . \} . \} . \} . el \{\ . nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP] . if \\n[#LOOP] .nr #EPI_LINES_TO_END +1 . rr #LOOP . nr #EPI_WHITESPACE \ (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD]) . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\ . nr #EPI_WHITESPACE -\\n[#DOC_LEAD] . \} . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u) . if \\n[#PRINT_STYLE]=1 \{\ . if !\\n[#SINGLE_SPACE] \{\ . nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2 . ie \\n[#EPI_LINES_EVEN] .ALD .5v . el .RLD .5v . rr #EPI_LINES_EVEN . \} . \} . \} . \} . nr #PP_STYLE 1 . rr #EPI_FITS . ALD \\n[#DOC_LEAD]u . QUAD \\*[$DOC_QUAD] . po \\n[#L_MARGIN]u . if \\n[#COLUMNS] \{\ . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u . nr #L_MARGIN \\n[.o] . \} . if \\n[#START] \{\ . if \\n[#COLUMNS] \{\ . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u . nr #L_MARGIN \\n[.o] . mk dc . \} . \} . if \\n[#LINENUMBERS]=2 \{\ . NUMBER_LINES RESUME . nr #LINENUMBERS 1 . \} .END \# \# ==================================================================== \# \# +++FINIS MACRO+++ \# \# FINIS \# ----- \# *Arguments: \# \# *Function: \# Deposits --END-- at the end of a document. \# .MAC FINIS END . if !\\n[@TOP] \{\ . if \\n[.t]<=2v \{\ . tm1 "[mom]: '\\n[.F]': Insufficient room to print \\$0 on last page. . return . \} . \} . br . ev FINIS . evc 0 . if \\n[#TAB_ACTIVE] .TQ . if \\n[#INDENT_ACTIVE] .IQ CLEAR . nr #EM_ADJUST (1m/8) . if \\n[#COLUMNS] \{\ . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u . nr #L_MARGIN \\n[.o] . \} . ALD \\n[#DOC_LEAD]u . CENTER . if \\n[#FINIS_STRING_CAPS]=1 .CAPS . if \\n[#PRINT_STYLE]=1 .PRINT "--\\*[$FINIS_STRING]-- . if \\n[#PRINT_STYLE]=2 \{\ . ie \\n[#FINIS_COLOR] \ . PRINT \ \m[\\*[$FINIS_COLOR]]\v'-\\n[#EM_ADJUST]u'\[em]\v'+\\n[#EM_ADJUST]u'\ \\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\[em]\m[]\c . el .PRINT \ \v'-\\n[#EM_ADJUST]u'\[em]\v'+\\n[#EM_ADJUST]u'\ \\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\[em]\m[]\c . \} . EL . if \\n[#FINIS_STRING_CAPS]=1 .CAPS OFF . ev . pdfsync .END \# \# ==================================================================== \# \# +++HEADERS/FOOTERS+++ \# \# Define a string so that the current page number can be incorporated \# into the strings for hdrftr left, right, and center. NOTE: This is \# not the same thing as using the shortform # in hdrftr strings. \# .ds PAGE# \En[#PAGENUMBER] \# .MAC RESTORE_SPACE END . vpt 0 . rs . nop \& . sp -1 . ch RR_@TOP . rr @TOP . vpt .END \# \# HDRFTR RULE GAP \# --------------- \# *Argument: \# \# *Function: \# Creates or modifies register #HDRFTR_RULE_GAP to hold amount \# of space between header/footer and header/footer rule. \# *Notes: \# Default is 4p. \# .MAC HDRFTR_RULE_GAP END . nr #HDRFTR_RULE_GAP (\\$1) . if '\\$0'HEADER_RULE_GAP' \{\ . nr #HEADER_RULE_GAP \\n[#HDRFTR_RULE_GAP] . if r #FOOTER_RULE_GAP .nr #FOOTER_RULE_GAP \\n[#FOOTER_RULE_GAP] . \} . if '\\$0'FOOTER_RULE_GAP' \{\ . nr #FOOTER_RULE_GAP \\n[#HDRFTR_RULE_GAP] . if r #HEADER_RULE_GAP .nr #HEADER_RULE_GAP \\n[#HEADER_RULE_GAP] . \} .END \# \# HDRFTR LEFT \# ----------- \# *Argument: \# \# *Function: \# Creates or modifies string $HDRFTR_LEFT. \# Creates register #USER_DEF_HDRFTR_LEFT, which, if 1, \# overrides the $HDRFTR_LEFT string created by default \# in DEFAULTS. \# *Notes: \# Especially useful if doc has more than one author, and a list \# of authors by last name is desired in header/footers. \# Default is author. \# \# If the argument is the # character, simply prints the current \# page number. \# \# If the user wants to incorporate the page number into the string, \# \*[PAGE#] must be used. For example, if the user wants to put \# an elipsis before the page number in the string, s/he should use \# ...\*[PAGE#], not ...# \# .MAC HDRFTR_LEFT END . nr #USER_DEF_HDRFTR_LEFT 1 . ds $HDRFTR_LEFT \\$1 .END \# \# HDRFTR LEFT CAPS \# ---------------- \# *Argument: \# | \# *Function: \# Turns capitalisation of $HDRFTR_LEFT (typically, the author of \# the document) on or off. \# *Notes: \# Default is on. \# .MAC HDRFTR_LEFT_CAPS END . ie '\\$1'' .nr #HDRFTR_LEFT_CAPS 1 . el \{\ . nr #HDRFTR_LEFT_CAPS 0 . ds $HDRFTR_LEFT_SIZE_CHANGE +0 . \} .END \# \# HDRFTR CENTER \# ------------- \# *Argument: \# \# *Function: \# Creates or modifies string $HDRFTR_CENTER. \# Creates register #USER_DEF_HDRFTR_CENTER, which, if 1, \# overrides the $HDRFTR_CENTER string created by default \# in COPYSTYLE. \# *Notes: \# Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE \# CHAPTER, draft and revision number if COPYSTYLE DRAFT. \# \# If the argument is the # character, simply prints the current \# page number. \# \# If the user wants to incorporate the page number into the string, \# \*[PAGE#] must be used. For example, if the user wants to put \# an elipsis before the page number in the string, s/he should use \# ...\*[PAGE#], not ...# \# .MAC HDRFTR_CENTER END . nr #USER_DEF_HDRFTR_CENTER 1 . if '\\$0'FOOTER_CENTER' \{\ . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER] . ds $HDRFTR_CENTER_NEW \\$1 . \} . if '\\$0'FOOTER_CENTRE' \{\ . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER] . ds $HDRFTR_CENTER_NEW \\$1 . \} . ds $HDRFTR_CENTER \\$1 .END \# \# HDRFTR CENTER CAPS \# ------------------ \# *Argument: \# | \# *Function: \# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of \# the document) on or off. \# *Notes: \# Default is on. \# .MAC HDRFTR_CENTER_CAPS END . ie '\\$1'' .nr #HDRFTR_CENTER_CAPS 1 . el \{\ . nr #HDRFTR_CENTER_CAPS 0 . ds $HDRFTR_CENTER_SIZE_CHANGE +0 . \} .END \# \# HDRFTR CENTER PADDING \# --------------------- \# *Argument: \# LEFT | RIGHT \# *Function: \# Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or \# #HDRFTR_CTR_PAD_RIGHT. \# *Notes: \# By default, the HDRFTR_CENTER string is centered on the doc \# line length. Long titles or long author names can screw up \# visual centering, or create overprints. This macro allows the \# user to pad the center string by the specified amount of space \# to fix these problems. \# \# A unit of measure is required. \# .MAC HDRFTR_CENTER_PAD END . if '\\$1'LEFT' .nr #HDRFTR_CTR_PAD_LEFT (\\$2) . if '\\$1'RIGHT' .nr #HDRFTR_CTR_PAD_RIGHT (\\$2) .END \# \# SWITCH HDRFTR CENTER PADDING SIDE - support macro \# -------------------------------- \# *Argument: \# \# *Function: \# Switches the padding side of hdrftr center padding. \# *Notes: \# Required to keep spacing around hdrftr string constant \# in recto/verso documents. \# .MAC SWITCH_HDRFTR_CENTER_PAD END . nr #HDRFTR_CTR_PAD_TMP \\n[#HDRFTR_CTR_PAD_LEFT] . HDRFTR_CENTER_PAD LEFT \\n[#HDRFTR_CTR_PAD_RIGHT]u . HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u .END \# \# HDRFTR RIGHT \# ------------ \# *Argument: \# \# *Function: \# Creates or modifies string $HDRFTR_RIGHT. \# Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1, \# overrides the $HDRFTR_RIGHT string created by default \# in DEFAULTS. \# *Notes: \# Default is document title. \# \# If the argument is the # character, simply prints the current \# page number. \# \# If the user wants to incorporate the page number into the string, \# \*[PAGE#] must be used. For example, if the user wants to put \# an elipsis before the page number in the string, s/he should use \# ...\*[PAGE#], not ...# \# .MAC HDRFTR_RIGHT END . nr #USER_DEF_HDRFTR_RIGHT 1 . ds $HDRFTR_RIGHT \\$1 .END \# \# HDRFTR RIGHT CAPS \# ----------------- \# *Argument: \# | \# *Function: \# Turns capitalisation of $HDRFTR_RIGHT (typically, the title of \# the document) on or off. \# *Notes: \# Default is on. \# .MAC HDRFTR_RIGHT_CAPS END . ie '\\$1'' .nr #HDRFTR_RIGHT_CAPS 1 . el \{\ . nr #HDRFTR_RIGHT_CAPS 0 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0 . \} .END \# \# HDRFTR RULE \# ----------- \# *Arguments: \# | \# *Function: \# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule \# under the header/over the footer. Otherwise, turns HDRFTR_RULE \# on or off. \# .MAC HDRFTR_RULE END . if r #HEADERS_ON \ . if \\n[#HEADERS_ON]=1 .nr #HDRFTR_RULE_GAP \\n[#HEADER_RULE_GAP] . if r #FOOTERS_ON \ . if \\n[#FOOTERS_ON]=1 .nr #HDRFTR_RULE_GAP \\n[#FOOTER_RULE_GAP] . if '\\$0'HDRFTR_RULE_INTERNAL' \{\ . ie \\n[#USERDEF_HDRFTR] \{\ . nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT] . if \\n[#HEADERS_ON] \{\ . rt \\n[y]u . ALD \\n[#HDRFTR_RULE_GAP]u . nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT] . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ] . \} . if \\n[#FOOTERS_ON] \{\ . rt \\n[y]u . RLD \ \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u . nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT] . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ] . \} . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\ \m[\\*[$HDRFTR_RULE_COLOR]]\ \D't \\n[#HDRFTR_RULE_WEIGHT]u'\ \h'|0'\ \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\ \D'l \\n[#DOC_L_LENGTH]u 0'\ \D't \\n[#RULE_WEIGHT]u'\ \h'-\\n[#RULE_WEIGHT]u'\ \m[] . \} . el \{\ \D't \\n[#HDRFTR_RULE_WEIGHT]u'\ \h'|0'\ \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\ \D'l \\n[#DOC_L_LENGTH]u 0'\ \D't \\n[#RULE_WEIGHT]u'\ \h'-\\n[#RULE_WEIGHT]u' . \} . br . \} . el \{\ . if \\n[#PRINT_STYLE]=1 .nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT] . if \\n[#PRINT_STYLE]=2 \{\ . ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \ . nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT] . el .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] . ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \ . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST] . el .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] . \} . if \\n[#HEADERS_ON] \{\ . rt \\n[y]u . ALD \\n[#HDRFTR_RULE_GAP]u . nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT] . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ] . \} . if \\n[#FOOTERS_ON] \{\ . rt \\n[y]u . RLD \ \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u . nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT] . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ] . \} . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\ \m[\\*[$HDRFTR_RULE_COLOR]]\ \D't \\n[#HDRFTR_RULE_WEIGHT]u'\ \h'|0'\ \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\ \D'l \\n[#DOC_L_LENGTH]u 0'\ \D't \\n[#RULE_WEIGHT]u'\ \h'-\\n[#RULE_WEIGHT]u'\ \m[] . \} . el \{\ \D't \\n[#HDRFTR_RULE_WEIGHT]u'\ \h'|0'\ \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\ \D'l \\n[#DOC_L_LENGTH]u 0'\ \D't \\n[#RULE_WEIGHT]u'\ \h'-\\n[#RULE_WEIGHT]u' . \} . br . \} . \} . if '\\$0'HEADER_RULE' \{\ . ie '\\$1'' \{\ . nr #HEADER_RULE 1 . nr #HDRFTR_RULE 1 . \} . el \{\ . nr #HEADER_RULE 0 . nr #HDRFTR_RULE 0 . \} . \} . if '\\$0'FOOTER_RULE' \{\ . ie '\\$1'' \{\ . nr #FOOTER_RULE 1 . nr #HDRFTR_RULE 1 . \} . el \{\ . nr #FOOTER_RULE 0 . nr #HDRFTR_RULE 0 . \} . \} . if '\\$0'HDRFTR_RULE' \{\ . ie '\\$1'' .nr #HDRFTR_RULE 1 . el .nr #HDRFTR_RULE 0 . \} .END \# .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE \# \# HDRFTR PLAIN \# ------------ \# *Arguments: \# \# *Function: \# Sets the family, font, and point size of all strings in \# header/footers to the same family and point size as running \# text. Font for the header/footer becomes roman throughout. \# .MAC HDRFTR_PLAIN END . HDRFTR_FAMILY \\*[$DOC_FAM] . HDRFTR_PT_SIZE \\n[#DOC_PT_SIZE] . HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] . HDRFTR_LEFT_FONT R . HDRFTR_LEFT_SIZE +0 . HDRFTR_LEFT_CAPS OFF . HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] . HDRFTR_CENTER_FONT R . HDRFTR_CENTER_SIZE +0 . HDRFTR_CENTER_CAPS OFF . HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] . HDRFTR_RIGHT_FONT R . HDRFTR_RIGHT_SIZE +0 . HDRFTR_RIGHT_CAPS OFF .END \# \# SWITCH HDRFTR \# ------------- \# *Arguments: \# | \# *Function: \# Creates or modifies register #SWITCH_HDRFTR, used to switch \# default location of HDRFTR_LEFT and HDRFTR_RIGHT. \# *Notes: \# Default is OFF. \# \# Typically, the author string appears at the left of header/footers, \# and the title string appears at the right. This switches the \# location of the two. Useful in conjunction with RECTO_VERSO to tweak \# switches on alternate pages to come out as the user wishes. The \# assumption of RECTO_VERSO is that the first page of the document \# (recto) is odd, and even though it has no header/footer, if it did \# have one, it would print as AUTHOR...CENTER...TITLE (or whatever \# strings the user has supplied for HDRFTR_LEFT/RIGHT), meaning that \# the next page, which does have a header/footer, will come out as \# TITLE...CENTER...AUTHOR (or whatever strings the user has supplied \# for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user to get the \# desired string in the desired place on the desired recto/verso page. \# .MAC SWITCH_HDRFTR END . ie '\\$1'' .nr #SWITCH_HDRFTR 1 . el .nr #SWITCH_HDRFTR 0 .END \# \# USER DEFINED HDRFTR RECTO \# ------------------------- \# *Arguments: \# L | LEFT | C | CENTER | CENTER | R | RIGHT \# *Function: \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD, \# stores string in $USERDEF_HDRFTR_RECTO. \# *Notes: \# For use when users don't want 3-part headers/footers, but rather \# want to design their own headers/footers and need different \# headers/footers on recto and verso pages. Using just \# HEADER_RECTO, even when recto/verso is not on, allows users to \# design their own headers/footers for doc pages. \# .MAC HDRFTR_RECTO END . nr #USERDEF_HDRFTR 1 . if '\\$1'L' .nr #USERDEF_HDRFTR_RECTO_QUAD 1 . if '\\$1'LEFT' .nr #USERDEF_HDRFTR_RECTO_QUAD 1 . if '\\$1'C' .nr #USERDEF_HDRFTR_RECTO_QUAD 2 . if '\\$1'CENTER' .nr #USERDEF_HDRFTR_RECTO_QUAD 2 . if '\\$1'CENTRE' .nr #USERDEF_HDRFTR_RECTO_QUAD 2 . if '\\$1'R' .nr #USERDEF_HDRFTR_RECTO_QUAD 3 . if '\\$1'RIGHT' .nr #USERDEF_HDRFTR_RECTO_QUAD 3 . shift . ie '\\$1'CAPS' \{\ . nr #HDRFTR_RECTO_CAPS 1 . ds $USERDEF_HDRFTR_RECTO \\$2 . \} . el .ds $USERDEF_HDRFTR_RECTO \\$1 .END \# \# USER DEFINED HDRFTR VERSO \# ------------------------- \# *Arguments: \# L | LEFT | C | CENTER | CENTER | R | RIGHT \# *Function: \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD, \# stores string in $USERDEF_HDRFTR_VERSO. \# *Notes: \# For use when users don't want 3-part headers/footers, but rather \# want to design their own headers/footers and need different \# headers/footers on recto and verso pages. \# .MAC HDRFTR_VERSO END . nr #USERDEF_HDRFTR 1 . if '\\$1'L' .nr #USERDEF_HDRFTR_VERSO_QUAD 1 . if '\\$1'LEFT' .nr #USERDEF_HDRFTR_VERSO_QUAD 1 . if '\\$1'C' .nr #USERDEF_HDRFTR_VERSO_QUAD 2 . if '\\$1'CENTER' .nr #USERDEF_HDRFTR_VERSO_QUAD 2 . if '\\$1'CENTRE' .nr #USERDEF_HDRFTR_VERSO_QUAD 2 . if '\\$1'R' .nr #USERDEF_HDRFTR_VERSO_QUAD 3 . if '\\$1'RIGHT' .nr #USERDEF_HDRFTR_VERSO_QUAD 3 . shift . ie '\\$1'CAPS' \{\ . nr #HDRFTR_VERSO_CAPS 1 . ds $USERDEF_HDRFTR_VERSO \\$2 . \} . el .ds $USERDEF_HDRFTR_VERSO \\$1 .END \# \# PRINT FOOTER ON FIRST PAGE \# -------------------------- \# *Arguments: \# | \# *Function: \# Toggles register #PRINT_FOOTER_ON_PAGE_1 \# *Notes: \# Lets user choose whether to print footer on first \# page of doc. \# .MAC FOOTER_ON_FIRST_PAGE END . ie '\\$1'' .nr #PRINT_FOOTER_ON_PAGE_1 1 . el .rr #PRINT_FOOTER_ON_PAGE_1 .END \# \# PRINT PAGE NUMBER ON FIRST PAGE \# ------------------------------- \# *Arguments: \# | \# *Function: \# Toggles register #PRINT_PAGENUM_ON_PAGE_1 \# *Notes: \# Lets user choose whether to print page number on first \# page of doc and after collate when footers are on or page numbering \# has been user set at top of page. \# .MAC PAGENUM_ON_FIRST_PAGE END . ie '\\$1'' .nr #PRINT_PAGENUM_ON_PAGE_1 1 . el .rr #PRINT_PAGENUM_ON_PAGE_1 .END \# \# PRINT HEADER/FOOTER \# ------------------- \# *Arguments: \# \# *Function: \# Based on defaults or values entered by user, prints a \# three-part title at either the top or the bottom of the page. \# *Notes: \# Called from within either HEADER or FOOTER. \# .MAC PRINT_HDRFTR END . if \\n[#DOC_TYPE]=4 .nr #SUITE \En[.pn] . if \\n[#FOOTERS_ON] \{\ . if \\n[#START_FOR_FOOTERS] \{\ . rr #START_FOR_FOOTERS . if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{\ . ie !\\n[#HDRFTR_BOTH] .return . el \{\ . rr #FOOTERS_ON . nr #HEADERS_ON 1 . ie \\n[#HEADER_RULE]=1 .HEADER_RULE . el .HEADER_RULE OFF . ie \\n[#HDRFTR_BOTH] .HEADER_VERSO \\*[$HDR_VERSO_QUAD] "\\*[$HDR_VERSO_STRING]" . el .HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]" . return . \} . \} . \} . \} . if \\n[#USERDEF_HDRFTR] \{\ . PRINT_USERDEF_HDRFTR . return . \} . if \\n[#SWITCH_HDRFTR] \{\ . ds $HDRFTR_TMP_SWITCH \\*[$HDRFTR_LEFT] . ds $HDRFTR_LEFT \\*[$HDRFTR_RIGHT] . ds $HDRFTR_RIGHT \\*[$HDRFTR_TMP_SWITCH] . ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE] . ds $HDRFTR_LEFT_SIZE_CHANGE \\*[$HDRFTR_RIGHT_SIZE_CHANGE] . ds $HDRFTR_RIGHT_SIZE_CHANGE \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH] . nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS] . nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS] . nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH] . ds $HDRFTR_TMP_COLOR_SWITCH \\*[$HDRFTR_LEFT_COLOR] . ds $HDRFTR_LEFT_COLOR \\*[$HDRFTR_RIGHT_COLOR] . ds $HDRFTR_RIGHT_COLOR \\*[$HDRFTR_TMP_COLOR_SWITCH] . rr #HDRFTR_TMP_CAPS_SWITCH . rm $HDRFTR_TMP_SWITCH . rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH . rm $HDRFTR_TMP_COLOR_SWITCH . nr #SWITCH_HDRFTR 0 . \} . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ] . if \\n[#ENDNOTES] .PAGENUM_STYLE \\*[$EN_PN_STYLE] . if \\n[#PRINT_STYLE]=1 \{\ . if \\n[#FOOTERS_ON] \{\ . di NULL . SIZESPECS . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT] . di . \} . if o .RIGHT . if e .LEFT . if \\n[#RECTO_VERSO]=0 .LEFT . if \\n[#HDRFTR_LEFT_CAPS] .CAPS . ie '\\*[$HDRFTR_LEFT]'#' .PRINT \\n[#PAGENUMBER] . el \{\ . ie !'\\*[$HDRFTR_LEFT]'' .PRINT \\*[$HDRFTR_LEFT] . el .PRINT \& . \} . if \\n[#HDRFTR_LEFT_CAPS] .CAPS OFF . CENTER . if \\n[#HDRFTR_CENTER_CAPS] .CAPS . rt \\n[y]u . ie '\\*[$HDRFTR_CENTER]'#' .PRINT \ \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' . el \{\ . ie !'\\*[$HDRFTR_CENTER]'' .PRINT \ \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' . el .PRINT \& . \} . if \\n[#HDRFTR_CENTER_CAPS] .CAPS OFF . if o .LEFT . if e .RIGHT . if \\n[#RECTO_VERSO]=0 .RIGHT . if \\n[#HDRFTR_RIGHT_CAPS] .CAPS . rt \\n[y]u . ie '\\*[$HDRFTR_RIGHT]'#' .PRINT \\n[#PAGENUMBER] . el \{\ . ie !'\\*[$HDRFTR_RIGHT]'' .PRINT \\*[$HDRFTR_RIGHT] . el .PRINT \& . \} . if \\n[#HDRFTR_RIGHT_CAPS] .CAPS OFF . \} . if \\n[#PRINT_STYLE]=2 \{\ . if \\n[#HDRFTR_COLOR]=1 \{\ . nf \m[\\*[$HDRFTR_COLOR]] . \} . fam \\*[$HDRFTR_LEFT_FAM] . ft \\*[$HDRFTR_LEFT_FT] . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE] . if \\n[#FOOTERS_ON] \{\ . di NULL . SIZESPECS . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT] . di . \} . if o .LEFT . if e .RIGHT . if \\n[#RECTO_VERSO]=0 .LEFT . if \\n[#HDRFTR_LEFT_CAPS] .CAPS . ie '\\*[$HDRFTR_LEFT]'#' \{\ . ie \\n[#HDRFTR_LEFT_COLOR]=1 \ . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[] . el \ . PRINT \\n[#PAGENUMBER] . \} . el \{\ . ie !'\\*[$HDRFTR_LEFT]'' \{\ . ie \\n[#HDRFTR_LEFT_COLOR]=1 \ . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[] . el \ . PRINT \\*[$HDRFTR_LEFT] . \} . el .nop \& . \} . if \\n[#HDRFTR_LEFT_CAPS] .CAPS OFF . fam \\*[$HDRFTR_CENTER_FAM] . ft \\*[$HDRFTR_CENTER_FT] . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE] . if \\n[#FOOTERS_ON] \{\ . di NULL . SIZESPECS . nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT] . di . \} . CENTER . if \\n[#HDRFTR_CENTER_CAPS] .CAPS . rt \\n[y]u . ie '\\*[$HDRFTR_CENTER]'#' \{\ . ie \\n[#HDRFTR_CENTER_COLOR]=1 .PRINT \ \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\ \\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[] . el .PRINT \ \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' . \} . el \{\ . ie !'\\*[$HDRFTR_CENTER]'' \{\ . ie \\n[#HDRFTR_CENTER_COLOR]=1 .PRINT \ \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\ \\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[] . el .PRINT \ \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' . \} . el .PRINT \& . \} . if \\n[#HDRFTR_CENTER_CAPS] .CAPS OFF . fam \\*[$HDRFTR_RIGHT_FAM] . ft \\*[$HDRFTR_RIGHT_FT] . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE] . if \\n[#FOOTERS_ON] \{\ . di NULL . SIZESPECS . nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT] . di . \} . if o .RIGHT . if e .LEFT . if \\n[#RECTO_VERSO]=0 .RIGHT . if \\n[#HDRFTR_RIGHT_CAPS] .CAPS . rt \\n[y]u . ie '\\*[$HDRFTR_RIGHT]'#' \{\ . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \ . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[] . el \ . PRINT \\n[#PAGENUMBER] . \} . el \{\ . ie !'\\*[$HDRFTR_RIGHT]'' \{\ . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \ . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[] . el \ . PRINT \\*[$HDRFTR_RIGHT] . \} . el .PRINT \& . \} . if \\n[#HDRFTR_RIGHT_CAPS] .CAPS OFF . \} . if \\n[#HDRFTR_RULE] .HDRFTR_RULE_INTERNAL . br .END \# \# PRINT USER DEFINED HEADER/FOOTER \# -------------------------------- \# *Arguments: \# \# *Function: \# Based on defaults or values entered by user, prints a single part \# (i.e. not 3-part) title at either the top or the bottom of the page. \# *Notes: \# Called from within PRINT_HDRFTR. \# .MAC PRINT_USERDEF_HDRFTR END . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ] . fc ^ # . if \\n[#PRINT_STYLE]=2 \{\ . fam \\*[$HDRFTR_FAM] . ft R . ps \\n[#HDRFTR_PT_SIZE]u . if \\n[#HDRFTR_COLOR]=1 \{\ . nf . COLOR \\*[$HDRFTR_COLOR] . \} . \} . ie \\n[#RECTO_VERSO] \{\ . if o \{\ . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS . if '\\n[.ev]'FOOTER' .vs 0 . PRINT \\*[$USERDEF_HDRFTR_RECTO] . if '\\n[.ev]'FOOTER' .vs . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF . EOL . if \\n[#FOOTERS_ON] \{\ . di NULL . SIZESPECS . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT] . di . \} . \} . if e \{\ . ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\ . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 .LEFT . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 .CENTER . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 .RIGHT . if \\n[#HDRFTR_VERSO_CAPS]=1 .CAPS . if '\\n[.ev]'FOOTER' .vs 0 . PRINT \\*[$USERDEF_HDRFTR_VERSO] . if '\\n[.ev]'FOOTER' .vs . if \\n[#HDRFTR_VERSO_CAPS]=1 .CAPS OFF . EOL . if \\n[#FOOTERS_ON] \{\ . di NULL . SIZESPECS . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT] . di . \} . \} . el \{\ . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS . if '\\n[.ev]'FOOTER' .vs 0 . PRINT \\*[$USERDEF_HDRFTR_RECTO] . if '\\n[.ev]'FOOTER' .vs . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF . EOL . if \\n[#FOOTERS_ON] \{\ . di NULL . SIZESPECS . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT] . di . \} . \} . \} . \} . el \{\ . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS . if '\\n[.ev]'FOOTER' .vs 0 . PRINT \\*[$USERDEF_HDRFTR_RECTO] . if '\\n[.ev]'FOOTER' .vs . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF . EOL . if \\n[#FOOTERS_ON] \{\ . di NULL . SIZESPECS . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT] . di . \} . \} . fc . if \\n[#PRINT_STYLE]=2 \{\ . ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]] . el \m[black] . \} . if \\n[#HDRFTR_RULE] \{\ . HDRFTR_RULE_INTERNAL . \} .END \# \# +++HEADERS+++ \# \# HEADERS (off or on) \# ------------------- \# *Arguments: \# | \# *Function: \# Turns headers at the top of the page off or on. \# *Notes: \# Default is on. \# .MAC HEADERS END . ie '\\$1'' .nr #HEADERS_ON 1 . el .nr #HEADERS_ON 0 .END \# \# HEADER MARGIN \# ------------- \# *Argument: \# \# *Function: \# Creates or modifies register #HEADER_MARGIN to hold amount \# of space between top of page and header. \# *Notes: \# Requires unit of measure. Default is 4P+6p, measured top-of-page \# to baseline. \# .MAC HEADER_MARGIN END . nr #HEADER_MARGIN (\\$1) .END \# \# HEADER GAP \# ---------- \# *Argument: \# \# *Function: \# Creates or modifies register #HEADER_GAP to hold amount \# of space between header and running text. \# *Notes: \# Default is 1P+6p. \# .MAC HEADER_GAP END . nr #HEADER_GAP (\\$1) .END \# \# HEADER \# ------ \# *Arguments: \# \# *Function: \# Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE. \# *Notes: \# In order to convert the title string to caps in the header \# (in the event that the user enters .TITLE in caps/lc), I've \# used quad left, quad centre, and quad right to arrange the \# three bits of the header, rather than .tl. This allows the \# use of the CAPS macro. The downside is that I have to add \# \\v'-(\\n[#LEAD]u*) in order for -Tlatin1 output to align \# the header/footer strings on the baseline. The console output \# still isn't brilliant, but at least it's comprehensible. \# .MAC HEADER END . vpt 0 . if \\n[#NEW_DOC_PT_SIZE] .nr #DOC_PT_SIZE \\n[#NEW_DOC_PT_SIZE] . rr #NEW_DOC_PT_SIZE . if \\n[#RESET_TRAPS] \{\ . TRAPS . if \\n[#REMOVE_ADJ] .nr #DOC_LEAD -\\n[#DOC_LEAD_ADJ] . \} . rr #REMOVE_ADJ . rr #RESET_TRAPS . MNtop . rr #FROM_FOOTER . nr #FROM_HEADER 1 . nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] . if \\n[#FN_DEPTH] .PROCESS_FN_LEFTOVER . rr #RULED . if \\n[#RESET_FN_NUMBER] .nr #FN_NUMBER 0 1 . po \\n[#DOC_L_MARGIN]u . if \\n[#RECTO_VERSO] \{\ . nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN] . DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u . if \\n[#CROPS] .DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u+\\n[cropmarks]u . DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u . if \\n[#CROPS] .DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u-\\n[cropmarks]u . SWITCH_HDRFTR_CENTER_PAD . \} . \} . ev HEADER . if \\n[#PAGE_NUM_V_POS]=1 .vs 0 . sp |\\n[#HEADER_MARGIN]u-1v . mk y . ll \\n[#DOC_L_LENGTH]u . ta \\n[.l]u . if \\n[#PRINT_STYLE]=1 \{\ . fam \\*[$TYPEWRITER_FAM] . ft R . ps \\*[$TYPEWRITER_PS]\\*[$HDRFTR_SIZE_CHANGE] . \} . if \\n[#PRINT_STYLE]=2 \{\ . fam \\*[$HDRFTR_FAM] . ft R . ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE] . \} . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE] . if \\n[#CAPS_ON] \{\ . nr #CAPS_WAS_ON 1 . CAPS OFF . \} . if \\n[#PRINT_STYLE]=1 \{\ . if \\n[#ENDNOTES]=1 \{\ .\" Single-spaced endotes have a different lead . if \\n[#EN_SINGLESPACE] \{\ . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD] . nr #DOC_LEAD \\n[#EN_LEAD]u . \} . \} . \} . if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap' . sp -1v . ie \\n[#HEADERS_ON] .PRINT_HDRFTR . el \{\ . if \\n[#PAGE_NUM_V_POS]=1 \{\ . if \\n[#PAGINATE] .PRINT_PAGE_NUMBER . \} . \} . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u . if \\n[#PRINT_STYLE]=1 \{\ . if \\n[#ENDNOTES]=1 \{\ . if \\n[#EN_SINGLESPACE] \{\ . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u . rr #RESTORE_DOC_LEAD . \} . \} . \} . nr #PAGE_TOP \\n[nl] . ev . po \\n[#L_MARGIN]u . if \\n[#RECTO_VERSO] .nr #L_MARGIN +\\n[#L_MARGIN_DIFF] . if \\n[#CAPS_WAS_ON] \{\ . CAPS . rr #CAPS_WAS_ON . \} . if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB] . if \\n[#QUOTE] \{\ . ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB] . el \{\ . ie \\n[#Q_OFFSET_VALUE] .nr #Q_OFFSET \ \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) . el .nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE] . po \\n[#Q_OFFSET]u . \} . if \\n[#PRINT_STYLE]=2 .sp \\n[#Q_LEAD_DIFF]u . \} . if \\n[#EPIGRAPH] \{\ . ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB] . el \{\ . ie r#EPI_OFFSET_VALUE \ . nr #EPI_OFFSET \ \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) . el \ . nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE] . po \\n[#EPI_OFFSET]u . \} . \} . ie \\n[#EPIGRAPH] \{\ . ie !\\n[#EPI_ACTIVE] \{\ . ns . rr #EPI_ACTIVE . \} . el \{\ . ie \\n[#EPI_FITS] .ns . el .sp \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u . \} . \} . el .ns . if \\n[#COLUMNS] \{\ . nr #FN_COUNT_FOR_COLS 0 1 . nr #L_MARGIN \\n[#DOC_L_MARGIN] . if \\n[#RECTO_VERSO] .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u . nr #COL_NUM 0 1 . mk dc . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u . nr #L_MARGIN \\n[.o] . if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB] . ll \\n[#COL_L_LENGTH]u . ta \\n[.l]u . if \\n[#QUOTE] \{\ . ie \\n[#Q_OFFSET_VALUE] \ . po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u) . el \ . po +\\*[$Q_OFFSET_VALUE] . \} . if \\n[#EPIGRAPH] \{\ . if \\n[#EPI_ACTIVE] \{\ . ie \\n[#EPI_FITS] . . el .nr dc -\\n[#EPI_LEAD_DIFF] . \} . ie r#EPI_OFFSET_VALUE \{\ . po \ \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u) . \} . el .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+\\*[$EPI_OFFSET_VALUE] . \} . \} . if \\n[#RESET_FN_COUNTERS]=1 \{\ . rr #RESET_FN_COUNTERS . PROCESS_FN_IN_DIVER . nr #FN_COUNT \\n[#SAVED_FN_COUNT] 1 . if \\n[#COLUMNS]=1 .nr #FN_COUNT_FOR_COLS \\n[#SAVED_FN_COUNT_FOR_COLS] 1 . ie \\n[#RESET_FN_NUMBER]=1 .nr #FN_NUMBER \\n[#SAVED_FN_NUMBER] 1 . el .nr #FN_NUMBER \\n[#FN_NUMBER] 1 . rm FN_IN_DIVER . if dRUNON_FN_IN_DIVER .rm RUNON_FN_IN_DIVER . \} . rr #FROM_HEADER . rr #DEFER_SPACE_ADDED . if !\\n[#FN_DEPTH] .if r #DIVERTED .rr #DIVERTED . if \\n[#MN_OVERFLOW_LEFT]=1 \{\ . MN LEFT . nf . MN_OVERFLOW_LEFT . MN . \} . if \\n[#MN_OVERFLOW_RIGHT]=1 \{\ . MN RIGHT . nf . MN_OVERFLOW_RIGHT . MN . \} . rm MN_OVERFLOW_LEFT . rr #MN_OVERFLOW_LEFT . rr #no-repeat-MN-left . rm MN_OVERFLOW_RIGHT . rr #MN_OVERFLOW_RIGHT . rr #no-repeat-MN-right . if \\n[#PRE_COLLATE]=1 .rr #PRE_COLLATE . if \\n[#UNDERLINE_WAS_ON]=1 \{\ . vs 0 . ie !n \ . nop \R'#UNDERLINE_ON 1'\X'ps: exec \\n[_w] \\n[_d] decorline' . el .ul 1000 . br . ns . rr #UNDERLINE_WAS_ON . \} . if \\n[#RESTORE_PAGINATION] \{\ . PAGINATE . rr #RESTORE_PAGINATION . \} . ch RR_@TOP . ie \\n[tbl*have-header] .rr @TOP . el .wh \\n[nl]u+1u RR_@TOP . ie \\n[defer] .PROCESS_FLOATS . el \{\ . if \\n[tbl*have-caption] \{\ . RESTORE_SPACE . ie \\n[#MLA] .sp \n[tbl*label-lead-diff]u . el .sp \n[tbl*caption-lead-diff]u . \} . \} .\" So tables without TH that don't fit don't overprint first row .\" at top of page . ie \\n[tbl*no-header] \{\ . rs . nop \& . vpt . rr \\n[tbl*no-header] . SHIM . \} . el .vpt . if \\n[#NEWPAGE] .rr #NEWPAGE . ie \\n[tbl*interrupted] \{\ . tbl*print-header . rr tbl*interrupted . \} . el .tbl@top-hook .END \# \# ==================================================================== \# \# +++FOOTERS+++ \# \# FOOTERS (off or on) \# ------------------- \# *Arguments: \# | \# *Function: \# Turns footers at the bottom of the page off or on. \# *Notes: \# Default is off. If on, page numbers automatically go at \# the top, centered, unless pagination has been turned off, \# or the pagenumber position has been changed to left or right. \# .MAC FOOTERS END . ie '\\$1'' \{\ . rr #HEADERS_ON . nr #FOOTERS_ON 1 . PAGENUM_POS TOP CENTER . \} . el .nr #FOOTERS_ON 0 .END \# \# FOOTER MARGIN \# ------------- \# *Argument: \#