TeXhax Digest Sunday, September 8, 1991 Volume 91 : Issue 039 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: Can one use a \loop...\repeat to contribute columns to an \halign? JGR style Manipulating tables of contents help with the DVIPS program under DOS OzTeX and Postscript Re: Index Landscape Printing RE: Index [TeXhax V91 #35] Accessing PostScript accented characters RE: Problems in TeX 3.1 installation (VMS) [TeXhax V91 #35] ------------------------------------------------------------------------------- Date: Wed, 21 AUG 91 21:44:09 BST From: TEX@rmcs.cranfield.ac.uk Subject: Can one use a \loop...\repeat to contribute columns to an \halign? Keywords: \loop, \repeat, \halign I'm trying to write a (raw) TeX program that will set a number of different characters next to each other (number of characters unknown until other macros, not shown below, determine the [contiguous] sequence of non-empty characters in the font). Furthermore, I want to repeat each such row a number of times. To my consternation (well, not really ;-) I discovered that including a `&' within a \loop...\repeat upsets TeX --- it complains about the \endtemplate contributed [Runaway argument...Forbidden control sequence encountered when scanning use of \loop]. But I can hide that by including a separate macro \endcolumn. But the rather more major problem is that when \endcolumn is expanded, and the & seen by \halign, it *terminates* a group, thus restoring the saved version of \body created by the *enclosing* loop. Funnily enough, the same problem doesn't seem to arise from the \cr contributed to the outer loop at the end of \drawrow. I've tried all the dirty tricks going with brace hacks, to no avail, because the group ended by the & isn't started by any such animal. I've got over the problem by using a sledgehammer: I save the outer loop's \body and make the \body of the inner loop \global --- since the enclosing group is still restored by the &, this entails making all the arithmetic with my counters global too. Needless to say, I'm not happy with these macros (even though they work) so I'd prefer to know how to do it `properly'. (Incidentally, an earlier version had loops *outside* the \halign, and constructed the lines of the alignment by gradually extending a macro. But that's not satisfactory if there are a lot of rows and/or columns because of the time taken in performing the \xdef each time around. I haven't tried constructing a token list: perhaps that's the solution?) Anyone got any ideas? Here's some excerpts from my .tex file (\scale being the macro that's supposed to get the whole kit-and-caboodle going)... > > ... > > \newcount\m \newcount\n \newcount\p \newdimen\dim > \newcount\first \newcount\last \newcount\rows \newdimen\boxwd > \newlinechar=`@ > > ... > > \def\scale{$$\global\n=0 > \halign to\hsize{& \hfil ##\hfil \cr > {}% Something to ensure that \halign doesn't scan the \loop after > % reading the \cr at the end of the preamble > \loop \message{Row \the\n@} > \drawrow > \ifnum \n<\rows \global\advance \n 1 > \repeat \crcr > }$$ > } > > \def\drawrow{\global\m=\first > \global\let\oldbody=\body > \loop > \message{Char \the\m@} > \global\let\body=\body > \hbox to\dim{\leaders\hbox{\char\m}\hfil}% > \ifnum \m<\last \global\advance \m 1 > \endcolumn > \repeat \cr > \let\body=\oldbody > } > > \def\endcolumn{& } > > ... > Brian {Hamilton Kelly} +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + JANET: tex@uk.ac.cranfield.rmcs + + BITNET: tex%uk.ac.cranfield.rmcs@ac.uk + + INTERNET: tex%uk.ac.cranfield.rmcs@nsfnet-relay.ac.uk + + UUCP: {mcsun,ukc,uunet}!rmcs.cranfield.ac.uk!tex + + Smail: School of Electrical Engineering & Science, Royal Military + + College of Science, Shrivenham, SWINDON SN6 8LA, U.K. + + Phone: Swindon (0793) 785252 (UK), +44-793-785252 (International) + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------------------------------------------------------------------------- Date: 21 Aug 91 08:48:00 PDT From: "GEOVAX::NANDERSON" Subject: JGR style Keywords: JGR style Is there a sty file for submission to the journal JGR? Please advise. Nannette Anderson, E-mail BITNET ANDERSON@UCLASP, or Internet nanderson%geovax.decnet@uclasp.igpp.ucla.edu or iaj2nka@mvs.oac.ucla.e du Thanks! ------------------------------------------------------------------------------ Date: Wed, 21 Aug 91 11:14:32 EDT From: oak!jim@uunet.UU.NET (Jim Mochel) Subject: Manipulating tables of contents Keywords: table of contents, manipulating Hello There, I am looking for some simple help in manipulating Tables of Contents. I would like to specify \twocolumn, and \small in the toc file without editing the toc file after creation. I thought that I could do so using \addtocontents but I have had no luck. Any suggestions ? Thanks, Jim Mochel chaman@oak.com ---------------------------------------------------------------------------- Date: Wed, 21 Aug 91 11:14:17 EDT From: oak!jim@uunet.UU.NET (Jim Mochel) Subject: help with the DVIPS program under DOS Keywords: dvips I am looking for help with the DVIPS program under DOS. The postscript printer I am using handles most postscript cleanly but when the document I am printing out contains both PostScript and Tex's computer modern roman fonts the text in CMR will have characters missing (fairly randomly). It only seems to happen to text inside equations. In looking at the debugging output of DVIPS I see that the CMR fonts are being sent to the printer as bitmaps. The only warning message I get is that three fonts generate checksum errors: cmmi7.300pk cmsy7.300pk cmr7.300pk I believe that ( And a call to TurboTex confirms it) that the printer is goofing up on handling bitmaps within PostScript. What I would like to do is simply use a native PostScript font for the text within equations. I currently use the TIMES.STY and PALATINO.STY files that came with the DVIPS driver but I am not advanced enough in TeX and LaTeX to puzzle out the macros. I would appreciate any clues that anyone can give me. Thanks, Jim Mochel chaman@oak.com ------------------------------------------------------------------------------- Date: Tue, 20 Aug 1991 16:22:52 -0400 (EDT) From: Peter Glen Berger Subject: OzTeX and Postscript Keywords: OzTeX, Postscript Dumb Mac-specific question; will the DVI driver in OzTeX automatically download postscript fonts to a laserwriter by my just naming the font in the .sty file, or must I, effectively, download it outside of OzTeX. ------------------------------------------------------------------------ Pete Berger || ARPA: peterb@cs.cmu.edu Professional Student || Pete.Berger@andrew.cmu.edu Univ. Pittsburgh School of Law || BITNET: R746PB1P@CMCCVB Attend this school, not CMU || UUCP: ...!harvard!andrew.cmu.edu!pb1p ------------------------------------------------------------------------ "Goldilocks is about property rights. Little Red Riding Hood is a tale of seduction, rape, murder, and cannibalism." -Bernard J. Hibbits ------------------------------------------------------------------------------- Date: Tue, 20 Aug 91 10:12:50 +1000 From: Chris Fama Subject: Re: Index Keywords: index, macros In comp.text.tex you write: >I've been having a problem with my index macros---the ones at the end of >this message. They write out the index fine, but space gets inserted >in the document too, not much but its noticeable. For instance, >if the TeX file contained the following How about putting a % at the end of each line ending in a brace? ie. \xdef\RIGHTNOW{\noexpand\write...}% instead of \xdef\RIGHTNOW{\noexpand\write...} . (BTW, thought about using LaTeX's .idx file format instead of your .index one? Creativity is wonderful, but there are a number of tools (external to TeX) to help in compiling in index done that way---Lamport's 'MakeIndex' program is great. I use one called 'index' in the standard distribution. For each index entry, just write \indexentry{gnats and gnus}{23} or whatever, to the .idx file. Then a program like the two I mentioned sorts the .idx file by keys, and according to certain rules separates things into items, subitems and subsubitems, and writes on an output file: \item Aardvarks \subitem in the wild, 23 \subitem in captivity, 25--34 \indexspace \item compactness \subitem relative, {\em see\/} relative compactness ... Very nice!) Anyway, not much of a suggestion (the main one), but could be the problem. I follow the 'layman's rule': put a % at the end of the line to 'swallow' the space implied by the return whenever you don't want a space, but the line ends with anything but but a control sequence or a number (that TeX has to 'see'), or a glue spec. \relax is the go now and then, too. Ciao, Chris ----------------------------------------------------------------------------- Date: Mon, 19 Aug 91 16:26:58 MDT From: jbrunt%sevilleta.unm.edu@ariel.unm.edu (James Brunt) Subject: Landscape Printing Keywords: LaTeX, landscape, vertical, printing I know I've seen information on Landscape (Vertical) printing in LaTeX on the TeXhax before but I can't find it. I would appreciate any information, macros, or experiences anyone has had. Thanks, James Brunt jbrunt@sevilleta.unm.edu jbrunt@unmb ------------------------------------------------------------------------------- Date: Sun, 18 AUG 91 23:42:15 BST From: TEX@rmcs.cranfield.ac.uk Subject: RE: Index [TeXhax V91 #35] Keywords: index, macros In a message of Wed, 10 Jul 91 11:22:02 PST, DOCUMENTS@grouch.JPL.NASA.GOV wrote in TeXhax Digest V91 #035: > I've been having a problem with my index macros---the ones at the end of > this message. They write out the index fine, but space gets inserted > in the document too, not much but its noticeable. For instance, > if the TeX file contained the following > > If I use \FLAG{flag}, flag will appear in the .dvi file and > the index; but if I use \INDEX{index}, index will not appear > in the .dvi file, but will appear in the index. > > would yield something like this in the output file > > If I use flag , flag will appear in the .dvi file and the > index; but if I use , index will not appear in the .dvi > file, but will appear in the index. > > Even when I write only to the index file, I'm getting this extra space. > I don't understand why. Any ideas? > > fam@grouch.jpl.nasa.gov This is the old favorite of including spurios spaces within ones macros; remember that any newline behaves as if it were just one space, except when it follows the name of a control sequennce. So put a % after every opening or closing brace, and maybe one or two others as well, and everything will be hunky-dorey... > ***************************************************************************** > % > % Now we only want to make an entry for the index in the table of contents > % if there is an index, and there can't be an index without use of \INDEX, > % and we'll know if there can be an index when \INDtrue is set. > % > \newif\ifIND > \INDfalse > > \def\CSEQINDEX#1{\csname CSEQ \endcsname \string{#1\string}} > \def\CVSEQINDEX#1{\csname CVSEQ \endcsname \string{#1\string}} > \def\CXSEQINDEX#1{\csname CXSEQ \endcsname \string{#1\string}} > > \def\INDEX#1{% ^Here > \ifIND > % Nothing special to do, its been done. > \else > \immediate\openout\INX=\jobname.index% Probably unnecessary here, but... > \immediate\write\INX{\csname def \endcsname > \csname DOCUMENTNUMBER \endcsname > \string{ \DOCUMENTNUMBER \string}}% > \immediate\write\INX{\csname def \endcsname > \csname DOCUMENTTITLE \endcsname > \string{ \DOCUMENTTITLE \string}}% > \ifLEFT > \immediate\write\INX{\csname LEFTtrue \endcsname}% > \fi > \ifDRAFT > \immediate\write\INX{\csname DRAFTtrue \endcsname}% > \fi > \immediate\write\INX{\csname BEGININDEX \endcsname}% > \INDtrue > \fi > {\let\CSEQ=\CSEQINDEX > \let\CVSEQ=\CVSEQINDEX > \let\CXSEQ=\CXSEQINDEX > \if\pageno<0 Definitely not needed here; the space terminates the > \xdef\RIGHTNOW{\noexpand\write\INX{#1,\noexpand\romannumeral\pageno}}% > \else > \xdef\RIGHTNOW{\write\INX{#1,\noexpand\number\pageno}}% > \fi}% > \ignorespaces\RIGHTNOW\ignorespaces > } > > % > % And if you just want to flag a word to be in your index and in your > % document. > % > \def\FLAG#1{\ignorespaces\INDEX{#1}#1} ^ Don't dangle the close brace Brian {Hamilton Kelly} +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + JANET: tex@uk.ac.cranfield.rmcs + + BITNET: tex%uk.ac.cranfield.rmcs@ac.uk + + INTERNET: tex%uk.ac.cranfield.rmcs@nsfnet-relay.ac.uk + + UUCP: {mcsun,ukc,uunet}!rmcs.cranfield.ac.uk!tex + + Smail: School of Electrical Engineering & Science, Royal Military + + College of Science, Shrivenham, SWINDON SN6 8LA, U.K. + + Phone: Swindon (0793) 785252 (UK), +44-793-785252 (International) + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ P.S. Presumably the \ignorespaces were a vain attempt to get over the problem; I can't see that they're really used. ------------------------------------------------------------------------------- Date: Sun, 18 Aug 91 19:12:46 EDT From: clayton@thumper.bellcore.com (R. Clayton) Subject: Accessing PostScript accented characters Keywords: PostScript. .sty file This .sty file defines some macros to access the accented characters defined in a PostScript font. Here are some things to keep in mind: 1 These macros should be called when a PostScript-based virtual font is in effect. They won't work with unprocessed PostScript fonts. 2 These macros work for PostScript-based virtual fonts generated by afm2tfm. I am unsure, and doubtful, if they will work with PostScript-based virtual fonts generated by some other method. 3 These macros work only when called with a character for which PostScript has an accented version. % psaccents.sty % % Define a set of macros to access the accented characters available % in afm2tfm-generated virtual fonts based on PostScript fonts. The % macros are named \ps, where is one of acute, circumflex, % dieresis, grave, ring, tilde, cedilla, or caron. All macros take % the character to be accented as their single argument. Unlike tex, % which can accent any character, these macros work only for the % characters (in either case) for which PostScript provides accented % versions: % % acute a, e, i, o, u % circumflex a, e, i, o, u % dieresis a, e, i, o, u, y % grave a, e, i, o, u % ring a % tilde a, n, o % cedilla c % caron s, z % % Examples: "na\psdieresis ive" (but not "na\psdieresis\i ve") and % "P\psacute{a}l" (but not "\psacute Swierczkowski"). This file may % also be used in tex source. % % 11 Aug 91 Created. % clayton@thumper.bellcore.com \ifcat @a \def \restore@{} \else \catcode `@ = 11 \def \restore@{\catcode `@ = 12} \fi % #1 The character to find. % #2#3 A non-empty string (#2 is the first character, #3 is the rest). \newif\if@isinstring \def \@is #1 in #2#3?{{% \if #1#2% \global\@isinstringtrue \else \def \arg{#3}% \def \empty{}% \ifx \arg\empty \global\@isinstringfalse \else \@is #1 in #3?% \fi \fi }} % #1 The accent name. % #2 The tex-font encoding for the accent character. % #3 The characters accented in the PostScript font. \def \@definepsaccent#1#2#3{% \expandafter \def \csname ps#1\endcsname##1{% \@is ##1 in #3?% \if@isinstring \else \errmessage{There is no #1-accented ##1 character in PostScript} \fi \char#2##1% }% } \@definepsaccent{acute}{'023}{AEIOUaeiou} \@definepsaccent{circumflex}{'136}{AEIOUaeiou} \@definepsaccent{dieresis}{'177}{AEIOUYaeiouy} \@definepsaccent{grave}{'022}{AEIOUaeiou} \@definepsaccent{ring}{'027}{Aa} \@definepsaccent{tilde}{'176}{ANOano} \@definepsaccent{cedilla}{'030}{Cc} \@definepsaccent{caron}{'024}{SZsz} \restore@ ------------------------------------------------------------------------------- Date: Sun, 18 AUG 91 23:30:16 BST From: TEX@rmcs.cranfield.ac.uk Subject: RE: Problems in TeX 3.1 installation (VMS) [TeXhax V91 #35] Keywords: TeX 3.1, installation In TeXhax Digest V91 #035 Minas Perakis wrote on 11 Jul 91 16:08:15 EDT: > We downloaded TeX1 (TEX.WEB and the change file) from ymir.claremont.edu > and - after changing the parameters stated in vms_tex_notes.txt to get it > "tangled" properly - we proceeded with the installation. This is what we got : > > From Tangle : > > @d VAX_ss_normal == > @= sts$k_success @> *1444 > ! This identifier has already appeared. > (change file 1.3237) This error suggests to me that your Tangle is out-of-date; the current version is V4.1. When building anything to do with TeX, the FIRST move should be to get up-to-date versions of Tangle and Weave. Brian {Hamilton Kelly} +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + JANET: tex@uk.ac.cranfield.rmcs + + BITNET: tex%uk.ac.cranfield.rmcs@ac.uk + + INTERNET: tex%uk.ac.cranfield.rmcs@nsfnet-relay.ac.uk + + UUCP: {mcsun,ukc,uunet}!rmcs.cranfield.ac.uk!tex + + Smail: School of Electrical Engineering & Science, Royal Military + + College of Science, Shrivenham, SWINDON SN6 8LA, U.K. + + Phone: Swindon (0793) 785252 (UK), +44-793-785252 (International) + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ----------------------------------------------------------------------- %%% 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 ************************** -------