TeXhax Digest Monday, March 9, 1992 Volume 92 : Issue 005 Moderators: Tiina Modisett and Pierre MacKay %%% The TeXhax digest is brought to you as a service of the TeX Users Group %%% %%% in cooperation with the UnixTeX distribution service at the %%% %%% University of Washington %%% Today's Topics: TRANSFER of TeXhax to the UK **** New version of DVIDVI for VMS on FILESERV dcolumn.sty announcement -- correction and apologies Re: Indexing facility for TeX ----------------------------------------------------------------------------- N N OOOO TTTTTTT EEEEEE NN N O O T E N N N O O T E N N N O O T EEEE N N N O O T E N NN O O T E N N OOOO T EEEEEE TRANSFER of TeXhax to the UK This is the next to last issue of TeXhax to come out of the University of Washington. David Osborne Cripps Computing Centre, University of Nottingham has kindly (and bravely---he little knows) arranged to take over the moderation. Tiina is off to another part of the U.S., and my part in this effort has been barely a formality for a couple of years. I cannot find words adequate to express my appreciation of all the work that Tiina has done, often under rather trying curcumstances. We shall miss many parts of the association with TeXhax. There are others, such as the discovery that our first attempt to send out the digest from here coincided with the birth of the Loathly Worm of Sendmail, that are more interesting than pleasurable to remember. Thank you all for your patience at various difficult times, and an especial thanks to those who helped with the BITNET redistribution, something which we never really understood. I urge you to give David Osborne the same sort of support that you have given us. The new addresses for submissions and subscriptions are TeXhax@tex.ac.uk and TeXhax-request@tex.ac.uk ------------------------------------------------------------------------------- - Date: Wed, 26 Feb 1992 15:46:38 CST From: "George D. Greenwade" Subject: New version of DVIDVI for VMS on FILESERV Keywords: dvidvi for VMS Hunter Goatley brought to my attention and kindly provided me with a different version of the VMS port of DVIDVI (authored by Tony McGrath ). The new VMS_SHARE file has been installed on FILESERV/Niord for your convenience. Below is the description file for this package. My thanks are extended to Hunter for his efforts on this. --George =========================================================================== DVIDVI ------ The DVIDVI package includes Tony McGrath's port of Tom Rokicki's DVIDVI (version 0.5) program for VMS. DVIDVI lets you manipulate DVI files, performing tricks by extracting selected pages (or a selected ordering of pages) into a new DVI file. This newer port also provides fuller functionality in that it allows a user to extract certain pages from a document. The command: dvidvi m[n] file outfile will extract n pages starting at m. This is in addition to previously supported page reversal, extraction of only odd or even pages, preparation of folded brochures, and other items. The C source, along with a DCL build file and sample are provided. This version also includes Hunter Goatley's DUPLEX.COM, for poor-man's duplex printing. This package differs from the one which has been available previously from SHSU in that it uses C extensions to do the some things which the prior version relied on RMS calls to handle. The original DVIDVI created Stream_LF files under VMS; the VMS port of DVIPS V5.47 (as well as the new DVITYPE, the latest DECUS TeX programs, etc.) expects the file to consist of fixed-length, 512-byte records. This version of DVIDVI creates such files under VMS. Since this package is is specifically a VMS port and probably of interest only to VMS users, the sources necessary to rebuild this version are in a VMS_SHARE format. You may retrieve the VMS_SHARE file by including the command: SENDME DVIDVI in the body of a mail message to FILESERV@SHSU.BITNET (FILESERV@SHSU.edu). For anonymous ftp retrieval, this file is available from Niord.SHSU.edu (192.92.115.8) in the directory [.DVIDVI]. Files in this package: (1 Block = 512 bytes) File Blocks DVIDVI.VMS_SHARE 63 Approximate total blocks in full DVIDVI package = 63 =============================================================================== NOTE: For users unfamiliar with FILESERV desiring an overview of the commands, use, and syntax of it, please include the command HELP in the body of a mail message to FILESERV@SHSU.BITNET (FILESERV@SHSU.edu) ------------------------------------------------------------------------------ Date: Tue, 25 Feb 1992 17:04:02 CST From: "George D. Greenwade" Subject: dcolumn.sty announcement -- correction and apologies Keywords: dcolumn.sty, modification In <009567CB.8D770FA0.9837@SHSU.edu> (Fri, 21 Feb 1992 11:45:45 CST), I posted an announcement about David Carlisle's dcolumn.sty. In it, I said: > If you need ... or [c] the doc.sty file from > Frank Mittelbach and Rainer Schoepf's multicol package (needed to create > the documentation for all of the above), include the respective commands > shown below on unique lines of your mail message to FILESERV: > ... > SENDME MULTICOL.DOC_STY Piet van Oostrum properly pointed out in article <1992Feb24.133618.19179@cs.ruu.nl> posted to comp.text.tex (and on to ctt-Digest) on 24 Feb 92 13:36:18 GMT: > The doc.sty forbids distribution of itself outside of the complete multicol > package. And subsequently, David posted to me in a private note: > I thought of [only retrieving the DOC.STY file alone], but unfortunately > doc.sty unconditionally inputs multicol.sty, this is for the index. My > files do not produce an index, as distributed, and every page only has one > column, but there on line 329, we have \input{multicol.sty}, so people need > the whole package. perhaps the comments in the template I use for my files > should be changed to `if you have Mittelbach's MULTICOL package ...' Or we > could get FM to re-organise things so that multicolumn.sty is only input if > needed. Therefore, be it resolved: 1. The proper (and requisite) command is *not* SENDME MULTICOL.DOC_STY; it properly is SENDME MULTICOL in the body of a mail message to FILESERV@SHSU.BITNET (FILESERV@SHSU.edu); 2. I, too, know how to read and it is patently obvious in all of the files associated with MULTICOL that the package, in whole, is supposed to be distributed at one time -- I screwed up by trying to save a little bandwidth and I apologize for my ignorance; 3. I extend my sincerest apologies to both Frank and Rainer for suggesting that the single file out of any of their packages be retrieved individually -- I will never do this again; and finally, 4. I extend my sincerest apologies to anyone who retrieved only those files I identified and were unable to properly process the documentation. Might I suggest that, since an increasing number of authors are using doc.sty for documentation (a welcome movement since it is impossible to fetch a style without its documentation -- the largest cause of user error) and is a movement I personally wish was better documented for others to use, as well, that a DOC package be considered for development which is wholly independent of MULTICOL? Ideally, I guess I'm suggesting that it be capable of both including (for the use of authors) and extracting (for the use of end users) documentation. Possibly this already exists; if so, please pass it along to me or tell me where to fetch it from (with all the appropriate and requisite files 8-)). Regards and apologies once again, George %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% George D. Greenwade, Ph.D. Bitnet: BED_GDG@SHSU Department of Economics and Business Analysis THEnet: SHSU::BED_GDG College of Business Administration Voice: (409) 294-1266 P. O. Box 2118 FAX: (409) 294-3612 Sam Houston State University Internet: bed_gdg@SHSU.edu Huntsville, TX 77341 bed_gdg%SHSU.decnet@relay.the.net %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ------------------------------------------------------------------------------- Date: Tue, 25 FEB 92 13:13:19 BST From: CHAA006@vax.rhbnc.ac.uk Subject: Re: Indexing facility for TeX Keywords: TeX, indexing Remo --- >>> I am just starting to write a book for the Cambridge University Press >>> and I have been requested to do it with Tex (rather than with Latex, >>> which I have been using for a long time). >>> The publisher provided me with their macros, which work all right. >>> However, there is indexing facility. I included the one Knuth used for >>> his book, but I am not very satisfied with it (especially because when I >>> type ^{H\'enon} for example, I get H{\accent 19} ... in the index file). >>> Would it be possible to have an index-maker which just writes on the >>> index file the entry as it is (including control symbols and math-mode >>> symbols) plus the page number (or even, when requested, "\bf pagenumber")? >>> I would appreciate very much of you could help me. >>> Another possibility would be to get a copy of the TUGboat {\bf 1} (1980), >>> paper by T. Winograd and B. Paxton, A1-A12, where an indexing macro is >>> presented. %%% -------- %%% There are three basic techniques which may be used to implement %%% cross-referencing in TeX: \catcode alteration, token list registers, %%% and \meaning (there is a fourth, the \protect bodge of LaTeX-2, %%% but that will not be further considered here). The basic %%% techniques may be used independently or in combination; a combination %%% is usually more efficient than any one technique. The techniques are %%% as follows: %%% 1) \catcode alteration: the key of the entity to be referenced is not %%% passed directly as a parameter to the cross-referencing macro, but %%% is subject to `delayed assignment'; the cross-referencing macro first %%% changes the category code of all characters to something innocuous, and %%% then calls a dependent macro which actually performs the cross- %%% referencing on the now-safe text. %%% Disadvantages: major consumer of CPU power if programmed defensively; %%% some means is needed of getting the non-passive form of the key if it %%% is also to be typeset (usually achieved by writing it twice to the XRF %%% file, and reading back one instance in passive mode, the other in %%% active). %%% 2) token-list registers: the key of the entity to be referenced is placed %%% in a token-list register, which is then expanded exactly once during the %%% \write operation; further expansion is automatically inhibited by the %%% nature of token-list registers. %%% Disadvantages: may only be used in \immediate \write contexts; deferred %%% \writes will allow the register to be overwritten by a later reference %%% on the same page. (It is rumoured there are ways around this but the %%%% present author remains to be convinced). %%% 3) \meaning: the key of the entity to be referenced is made the replacement %%% text of a macro; the \meaning of that macro, after removal of the %%% static components [macro ->], consists solely of \catcode 10 and \catcod e %%% 12 tokens, both of which are safe for transput. %%% Disadvantages: when a token has been \let equal to a primitive, %%% \meaning can reflect the primitive rather than the token. %%% The following code demonstrates somewhat simplified techniques for %%% performing immediate and non-immediate cross-referencing (simplified %%% in that dependencies are left to the reader). Upper-case entities %%% are DEFINING occurences; lower-case entities are APPLIED occurrences. %%% ------------------------------------------------------------------------ %%% Part-1: immediate cross-referencing (used for \figure, \table, etc.) %%% \Xref is the high-level defining macro which will be called by the %%% user command (e.g. \Figure, \Table, etc). \def \Xref #1#2#3% #1 is the generic tag (Figure, Table, etc); % #2 is the actual instance (i.e. the key); % #3 is the value. {\xreftoks = {#1:#2}% \immediate \write \xrefout {\noexpand \XREF {\the \xreftoks}{#3}}% } %%% \XREF is the internal macro which is used only within the cross-referencing %%% file; it performs catcode magic to ensure that the resulting \csname ... %%% \endcsname is valid, then transfers control to \AfterXREF after assigning %%% the now-safe composite key to \xreftoks. For pedadogic purposes only, %%% \PAGE has been declared as a synonym for \XREF (see below). \def \XREF {\begingroup \passivate \afterassignment \AfterXREF \global \xreftoks = } \def \AfterXREF {\endgroup \expandafter \def \csname \the \xreftoks \endcsname} \let \PAGE = \XREF %%% \xref is the applied counterpart of \Xref; %%% it uses techniques similar to \XREF, and transfers control to \afterxref. %%% \afterxref terminates the group (thereby reinstating the normal catcodes) %%% and transfer control to \postxref, which picks up as parameter the name %%% of the control sequence through which the equivalence string is to be %% returned. %%% \postxref returns [undefined] if the cross-reference is not resolvable, %%% otherwise returns the equivalence string; The result is returned in %% the third pseudo-parameter to \xref. %%% The second two are nested in the first to allow the parameter to \xref %%% to be implicitly passed to the two subordinate macros. \def \xref #1% {\def \postxref ##1% {\ifundefined {#1:\the \xreftoks}% \def ##1{[undefined]}% \else \edef ##1{\csname #1:\the \xreftoks \endcsname}% \fi }% \begingroup \def \afterxref {\endgroup \postxref}% \passivate \afterassignment \afterxref \global \xreftoks = } %%% \ifundefined is taken straight from Appendix-A \def \ifundefined #1{\expandafter \ifx \csname #1\endcsname \relax} %%% \passivate ensures that only `safe' catcodes remain; %%% is treated specially, as during the \write phase, %%% control words will be followed by a . \def \passivate {\loopcount = 0 \loop \ifcase \catcode \loopcount \catcode \loopcount = 12 %%% 0 \ --> \or \relax %%% 1 { \or \relax %%% 2 } \or \relax %%% 3 $ \or \relax %%% 4 & \or \relax %%% 5 ^^M \or \catcode \loopcount = 12 %%% 6 # --> \or \relax %%% 7 ^ \or \relax %%% 8 _ \or \relax %%% 9 ^^@ \or \catcode \loopcount = 9 %%% 10 --> \or \relax %%% 11 A \or \relax %%% 12 1 \or \catcode \loopcount = 12 %%% 13 ~ --> \or \relax %%% 14 % \or \relax %%% 15 ^^? \else \catcode \loopcount = 12 %%% ?? --> \fi \ifnum \loopcount < 255 \advance \loopcount by 1 \repeat } %%% Try to read the previous cross-reference file: \newread \xrefin \newwrite \xrefout \newtoks \xreftoks \newcount \loopcount \def \xrefile {\jobname.XRF} \openin \xrefin = \xrefile \relax \ifeof \xrefin \closein \xrefin \message {Warning: cross-reference file \xrefile \space does not exist} % \else \closein \xrefin \input \xrefile \fi %%% Then open a new cross-reference file for output (defensive programming %%% would require that this be a temporary file, to be copied to the real %%% XRF file only at end-of-job). \immediate \openout \xrefout = \xrefile \relax %%% Now a simple demonstration of its use: the \Xref|\xref commands would %%% normally be called from higher-level user commands such as \Figure|\figure, %%% \Table|\table, etc. \Xref {Figure}{\TeX{}$&^_^^@ A1~}{1.234} \xref {Figure}{\TeX{}$&^_^^@ A1~}{\crossref} \message {The reference for the figure with the unpronounceable name is: Fig. \crossref} %%% \immediate \closeout \xrefout %%% but we're going to re-use the file here %%% ------------------------------------------------------------------------ %%% Part-2: deferred cross-referencing (used where a page number, or any %%% quantity only known at \shipout time is required). Much of the preceding %%% code is be re-cycled here for efficiency. %%% \Page is the high-level defining macro which will be called by the %%% user command. The resulting line in the cross-reference file will %%% by \PAGE {generic-tag:specific tag}{page-number}; for the purposes %%% of demonstration only, \PAGE has been let equal to \XREF; however, %%% if used purely for indexing purposes, the number of unique control %%% sequences created would be untenable, and in a production indexing %%% environment the cross-referencing file would not be re-read by TeX %%% at all (or at least, not until post-processed by something such as %%% IdxTeX or MakeIndex). A suitable re-definition of \PAGE is left to %%% the reader. \def \Page #1#2% #1 is the generic tag; % #2 is the actual instance (i.e. the key); % #3 is implicit; the page number on which this item occurs. {\def \temp {#1:#2}% \write \xrefout {\noexpand \PAGE {\Meaning \temp \EndMeaning}% {\the \pageno}% }% } %%% \page is the applied counterpart of \Xref; it is simply a synonym for %%% \xref, since their functionality is identical. \let \page = \xref %%% \Meaning expands \meaning, which itself expands \temp; %%% \Meaning then transfers control to \AfterMeaning, %%% which strips off the punctuation from the output of \meaning, %%% leaving the bare replacement text with catcodes 10 & 12 only. \def \Meaning {\expandafter \AfterMeaning \meaning} \def \AfterMeaning #1->#2\EndMeaning {#2} %%% \openout \xrefout = \xrefile \relax %%% We've left it open for demo. only \Page {Index}{This page [\TeX{}$&^_^^@ A1~]} \page {Index}{This page [\TeX{}$&^_^^@ A1~]}{\crossref} \message {The reference for the page with the unpronounceable name is: Page \crossref} \closeout \xrefout %%% ------------------------------------------------------------------------ %%% Conclusions: These techniques demonstrate that cross-referencing in %%% TeX may be achieved without insuperable difficulty, provided that %%% expansion is suppressed by one of several means. Please note that %%% this code was written, from cold, between 22:30 last night and 01:00 %%% this morning; caveat emptor! %%% Copyright (C) MCMLXXXXII Philip Taylor %%% ``The University of London at Windsor'' \end ----------------------------------------------------------------------- %%% Further information about the TeXhax Digest, the TeX %%% Users Group, and the latest software versions is available %%% in every tenth issue of the TeXhax Digest. %%% %%% Concerning subscriptions, address changes, unsubscribing: %%% %%% BITNET: send a one-line mail message to LISTSERV@xxx %%% SUBSCRIBE TEX-L % to subscribe %%% or UNSUBSCRIBE TEX-L %%% %%% Internet: send a similar one line mail message to %%% TeXhax-request@cs.washington.edu %%% JANET users may choose to use %%% texhax-request@uk.ac.nsf %%% All submissions to: TeXhax@cs.washington.edu %%% %%% Back issues available for FTPing as: %%% machine: directory: filename: %%% JUNE.CS.WASHINGTON.EDU TeXhax/TeXhaxyy.nnn %%% yy = last two digits of current year %%% nnn = issue number %%% %%%\bye %%% End of TeXhax Digest ************************** -------