(Message inbox:303) TeXhax Digest Tuesday, August 20, 1991 Volume 91 : Issue 036 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: "TeX by Example" files available at FILESERV feynman diagrams Wanted: Latex style file for AIAA Journal submissions LaTeX macro expansion LaTeX macro expansion again--a clarification Problem with LaTeX macro expansion (forwarded) CMR Postcript fonts? envelope.sty bibtex without LaTeX? Tabular: forbidden cs modes.mf 0.7 released ----------------------------------------------------------------------------- Date: Mon, 29 Jul 1991 12:46:51 CDT From: "George D. Greenwade" Subject: "TeX by Example" files available at FILESERV Keywords: TeX, "TeX by Example" Arvind Borde is in the final stages of completing a new book on TeX, "TeX by Example" (Academic Press, forthcoming 1992) which should be available in a few months. It is designed, from page 1 onwards, to (as the title suggests) teach TeX by example. The book contains several macros that are of varying degrees of usefulness. He has been permitted by the publisher to make them available on disk and to donate them to ftp and archive sites. I am pleased to announce that these files are available on FILESERV. Below is the description file resulting from a DIRECTORY TBEFILES command sent to FILESERV. If you prefer, these files are available for anonymous ftp retrieval from Niord.SHSU.edu (192.92.115.8) in the directory [FILESERV.TBEFILES]. Regards and thanks to Arvind for making these available, 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 TBEFILES -------- The TBEFILES package includes two files associated with Arvind Borde's "TeX by Example" (Academic Press, 1992). One file contains the base macros (TBEMACROS.TEX) and the other contains a sample of their use (TBESAMPLES.TEX). The author notes, "(s)ince the subject of `good' macros comes in occasionally for fierce debate ..., I should state right away that I make no great claims for my macros. Most have been kept deliberately simple, to encourage users to modify and experiment." You may retrieve both files by including the command: SENDME TBEFILES in the body of a mail message to FILESERV@SHSU.BITNET (FILESERV@SHSU.edu). If, for some reason, you should only need one of these files, say TBEFILES.TBEMACROS_TEX, include the command: SENDME TBEFILES.TBEMACROS_TEX in the body of your mail message to FILESERV. Files in this package: (1 Block = 512 bytes) File Blocks Save file as: TBEFILES.TBEMACROS_TEX 28 TBEMACROS.TEX TBEFILES.TBESAMPLES_TEX 34 TBESAMPLES.TEX Approximate total blocks in full TBEFILES package = 62 ------------------------------------------------------------------------------- Date: Fri, 26 Jul 91 08:44:04 +0300 From: Malki Cymbalista Subject: feynman diagrams Keywords: TeX5, Feynmann diagrams One of our users is looking for a TeX macro to aid in creating feynman diagrams (whatever they may be). Thanks in advance for any info. Malki bitnet: vumalki@weizmann internet: vumalki@weizmann.weizmann.ac.il ----------------------------------------------------------------------------- Date: Thu, 18 Jul 91 10:54:34 MDT From: Joy Kelly Subject: Wanted: Latex style file for AIAA Journal submissions Keywords: LaTeX. style file, AIAA I am looking for a Latex style file customized for submitting papers to AIAA Journals. Joy Kelly (7-4925) Kelly@harrier.den.mmc.com ----------------------------------------------------------------------------- Date: Wed, 24 Jul 91 16:49:21 BST From: G Kelly Subject: LaTeX macro expansion Keywords: LaTeX. macro, expansion Does anybody know why this doesn`t work in laTex:? \documentstyle{article} \tracingcommands=2 \tracingmacros=2 \long\def\START#1FINISH{\immediate\openout15=demo\immediate% \write15{#1}\immediate\closeout15} \def\title{A short story.} \def\story{once upon a time ...} \def\endstory{ ...and they all lived happily ever after} \begin{document} \START \title \begin{story} hello \end{story} FINISH \end{document} It causes the laTeX error :- ..... \START #1FINISH->\immediate \openout 15=demo\immediate \write 15{#1}\immediate \closeout 15 #1<-\title \begin {story} hello \end {story} {\immediate} {\immediate} \write->\title \begin {story} hello \end {story} \title ->A short story \begin #1->\@ifundefined {#1}{\def \@tempa {\@latexerr {Environment #1 undefine d}\@eha }}{\def \@tempa {\def \@currenvir {#1}\csname #1\endcsname }}\begingrou p \@endpefalse \@tempa #1<-story \@ifundefined #1#2#3->\expandafter \ifx \csname #1\endcsname \relax #2\else #3\ fi #1<-story #2<-\def \@tempa {\@latexerr {Environment story undefined}\@eha } #3<-\def \@tempa {\def \@currenvir {story}\csname story\endcsname }{no mode: \expandafter} {\csname} {\ifx} {false} \@tempa ->\def \@currenvir {document}\csname document\endcsname <-- @tempa was set \@currenvir ->document | during document, and {\csname} | not redefined.Why? \document ->\@latexerr {Can be used only in preamble}\@eha |------------------- It is meant to write the ascii output 'A short story. once upon a time ...hello ... and they all lived happily ever after. I need to write expanded macros to an external (non-dvi) output file. I`ve tried replacing \begin{story} with \story, and \end{story} with \endstory, but I get similar errors to the above, whenever laTeX comes across @ifundefined. If anybody has any bright ideas, could they e-mail them to me at : gk@seg.npl.co.uk ----------------------------------------------------------------------------- Date: Thu, 25 Jul 91 10:57:27 BST From: G Kelly Subject: LaTeX macro expansion again--a clarification Keywords: LaTeX, macro, expansion Many thanks for your reply to my question about macro expansion in the short demonstration program : \documentstyle{article} \tracingcommands=2 \tracingmacros=2 \long\def\START#1FINISH{\immediate\openout15=demo\immediate% \write15{#1}\immediate\closeout15} \def\title{A short story.} \def\story{once upon a time ...} \def\endstory{ ...and they all lived happily ever after} \begin{document} \START \title \begin{story} hello \end{story} FINISH \end{document} I fear my original posting was abiguously worded. In the above, if \begin{story}, \end{story} are replaced to story,endstory, then the output produced is correct. My problem is that I really need to keep \begin in the code. The above is just a demonstration of the problem. I am working on a program to translate given LaTeX into an ascii file. There is a style file that converts this LaTeX into a mathematical format, with logic symbols,etc. An example of the _given_ LaTeX is:- \begin{op}[i]{name}[ref.name] \parm[\\][*]{list} \end{op} I need to read in the optional arguments, which means \ifnextchar must be called. Once again,this causes an error. I think the problem must somehow be connected with fragile commands. The relevant bit of the log file is:- \@ifundefined #1#2#3->\expandafter \ifx \csname #1\endcsname \relax #2\else #3\ fi #1<-story #2<-\def \@tempa {\@latexerr {Environment story undefined}\@eha } #3<-\def \@tempa {\def \@currenvir {story}\csname story\endcsname } {no mode: \expandafter} {\csname} {\ifx} {false} \@tempa ->\def \@currenvir {document}\csname document\endcsname Note that there is no \fi command traced, so something strange is going on (c.f. pp308,7.7 of TeXbook). Also the {no mode: \expandafter} is puzzling me, and I can find no reference to this in the TeX book. Another strange thing is that if the write{#1} is replaced by just #1, then no errors occur. It must be the combination of ifundefined (and also ifnextchar, as that gives a similar error) within a write 'environment' that causes the error. If you can think of any way of 'protecting' the \begin along with the reading of optional arguments, I would be most grateful. Yours sincerely, Gavin Kelly gk@seg.npl.co.uk ------------------------------------------------------------------------------- Date: Thu, 25 Jul 91 20:32:13 +0200 From: schoepf@sc.ZIB-Berlin.DE (Rainer Schoepf) Subject: Problem with LaTeX macro expansion (forwarded) Keywords: LaTeX, macro, expansion The problem you encounter here is that everything and all is expanded when the \write primitive is executed, BUT NOTHING ELSE, i.e. no other TeX primitives are executed. If you look at the piece of tracing you quote: \@ifundefined #1#2#3->\expandafter \ifx \csname #1\endcsname \relax #2\else #3\ fi #1<-story #2<-\def \@tempa {\@latexerr {Environment story undefined}\@eha } #3<-\def \@tempa {\def \@currenvir {story}\csname story\endcsname } {no mode: \expandafter} {\csname} {\ifx} {false} \@tempa ->\def \@currenvir {document}\csname document\endcsname you see that there is a \def \@tempa. Now, since ONLY expansion happens, the \def is not executed, but is just left as it is, instead the \@tempa immediately following the \def is expanded. The same applies to all other non-expandable primitive commands. The {no mode: \expandafter} is nothing to worry about: this is TeX's mode when processing a \write. Another example that not everything is mentioned in the TeXbook... I haven't fully understood what you are trying to do, but I think you want to write everything between \START and FINISH without expansion. There is a trick that does it: first copy everything into a macro, then use meaning to extract it, e.g., \long\def\START#1FINISH{\long\def\xyz{#1}% \immediate\write15{\expandafter\stripmeaning\meaning\xyz}} \def\stripmeaning#1->{} This is explained in appendix D of the TeXbook: \meaning\xyz expands to \xyz macro->.... where .... denote the replacement text of \xyz, BUT AS A LIST OF CHARACTERS. Then \stripmeaning is expanded, removing everything up to, and including the ->. Hope that helps, Rainer Sch"opf ------------------------------------------------------------------------------- Date: Thu, 18 Jul 91 12:32:27 EDT From: tom prusa Subject: CMR Postcript fonts? Keywords: CMR, PostScript To all, Recently a set of Computer Modern fonts in POSTSCRIPT format (made by Graham Toal) was uploaded to the claremont archive. I have downloaded this file and 'untar'ed it.... but now I am stuck.... how do i get these postscript fonts to work on my machine? They do not appear to be in the same format as my other Macintosh Postscript fonts. In fact, the files look to me like lines of postscript code. I have a Mac SE/30 running both OzTeX and TeXtures, although I would also like to use them with drawing programs. If anyone can suggest how I can convert Toal's files into a Mac-compatible format it would be greatly appreciated. If there is interest, I will summarize for the net. thanks in advance, tom prusa --------------------------------------------------------------------------- Date: Wed, 17 Jul 1991 10:03:10 EDT From: ACS_STEVE@VAX2.ACS.JMU.EDU (Steve Grigg @ACS -3556) Subject: envelope.sty Keywords: envelope.sty I just retrieved env.sty from ymir. The file shows a 1988 copyright by Dimitri Vulis. Has anyone been able to get the bar code printing part of the file to translate the address to the barcode or does anyone have a .sty file that will do that? Thank in advance. Steve Grigg acs_steve@vax2.acs.jmu.edu ----------------------------------------------------------------------------- Date: Tue, 16 Jul 91 14:41:54 CDT From: koslowj@math.ksu.edu (Juergen Koslowski) Subject: bibtex without LaTeX? Keywords: BibTeX, LaTeX Is it possible to use bibtex with Plain TeX? I seem to remember a note to this effect in TeXhax last year, possibly by Karl Berry, but I cannot find it right now. Please e-mail directly, I'll summarize. J"urgen Koslowski Department of Mathematics Kansas State University ------------------------------------------------------------------------------- Date: Tue, 09 Jul 91 20:52:47 SST From: Helmer Aslaksen Subject: Tabular: forbidden cs Keywords: LaTeX, tabular, environment While trying to write my own letter.sty I run into the following problem. I want to include phone number, fax number and e-mail address. I define control sequences that provide the "labels" (I want to be multilingual) and the entries. I use a tabular environment, but I want to avoid starting a new line unless the next entry is nonempty. But LaTeX objects to code like \begin{tabular}{@{}l@{\ :\ }l@{}}\telephonetext&\telephonenum \ifx\@empty\faxnum \ifx\@empty\emailadr \else\\\emailtext&{\tt \emailadr} \fi \else\\\faxtext&\faxnum \ifx\@empty\emailadr \else\\\emailtext&{\tt \emailadr} \fi \fi \end{tabular} I get the following error message: ! Incomplete \ifx; all text was ignored after line 26. \fi \endtemplate