TeXhax Digest Wednesday, August 24, 1988 Volume 88 : Issue 76 Moderator: Malcolm Brown Today's Topics: Re: The best way to do pictures in TeX The best way to do the best way to do pictures in TeX Re: The best way to do pictures in TeX Replies to my problem with local.mf and metafont. \chemical macro Just a question... Announcement: Fig 1.4.FS and TransFig 1.4 Release 3 RE: The best way to do pictures in TeX Re: TeXhax Digest V88 #72 (LaTeX notes) Re: TeXhax Digest V88 #73 (LaTeX notes) TeX Previewer PD implementation for DOS, any available via FTP? Re: Increasing TeX's memory limits Re: LaTeX: Indenting after Sectioning TeX/METAFONT on ICL Clan 7 Answers to my Metafont question ---------------------------------------------------------------------- Date: Wed, 17 Aug 1988 10:57:03 CDT From: "Thomas J. Reid" Subject: Re: The best way to do pictures in TeX William (Phil?) LeFebvre, In TeXhax issue 73, you propose treating graphics in TeX as a font. I agree with making the graphic appear as a font to TeX, but would like to point out a couple of possible problems. A few issues back in TeXhax, a fellow from Iowa State University asked about a font for electronic symbols. At first, I felt that this type of thing would be better handled through graphics. Storing something that is basically a line drawing as a bitmap seems wasteful. However, TeX is quite flexible in positioning characters. Further, TeX itself doesn't care how the font is actually represented; all TeX needs is a TFM file: the driver is free to represent the font any way it wants to. While it is appropriate to represent small, special symbols in METAFONT, I don't think that this should be used exclusively. First, the bitmap formats are resolution and size dependent. This means that scaling the graphic would require re-running METAFONT to generate a new bitmap. Separate bitmap files would be needed for different resolution output devices as well. Further, bitmap files tend to be large; even PK format does not give efficient compression for a large area. Finally, using METAFONT would be difficult for output from another graphics package. The other point that I see a problem with is the idea of "tiling" the graphic as multiple "characters." The problem is getting the widths of each "tile" set so that rounding errors won't create effects such as that shown in the Matthew Carter quote on page 207 of "The METAFONTbook." As far as TeX is concerned, a font can have a "design size" up to 2048 points and widths, depths, and heights can be up to 16 times the "design size." Thus, a character can be up to roughly 450 inches high. So, graphics do not need to be tiled for TeX's benefit. If the graphic needs to be rendered as a tiled bitmap for a particular device, the driver could break it into tiles and position them in device units to avoid any rounding problems. It makes sense to treat graphics as "characters" from a font in TeX since this is what TeX is intended for. But, I think that drivers should be allowed the freedom to represent these fonts in formats other than the GF, PK and PXL bitmap forms. This will allow drivers to work efficiently with graphic formats that are more appropriate for the output device. Thomas Reid, Texas A&M University ------------------------------ Date: Wed, 17 Aug 88 12:22:52 EDT From: beck@svax.cs.cornell.edu (Micah Beck) Subject: The best way to do the best way to do pictures in TeX In TeXhax Digest V88 #73 Phil LeFebvre writes about a scheme to use MF to do pictures in TeX: > Metafont is as maleable as TeX, which means that one could > emulate one's favorite picture drawing environment (such as "pic") on > top of it. That way, your metafont file would look more like pic than > metafont, but for graphics drawing it would be all that you need. Let me offer a suggestion for anyone implementing this scheme or any other graphics mechanism for TeX: write a translator from Fig code to your mechanism, rather than spending a lot of time devising a nice interface of your own. In the scheme Phil suggested, a fig2mf translator is all that is needed. Fig code is the intermediate form of the Fig graphics editor. Versions of Fig run under both Suntools and X11. In addition, a program called pic2fig translates from PIC to Fig code. The TransFig package includes translations from Fig code to PiCTeX, LaTeX picture mode, PostScript, Tpic, and soon Epic. For more info on Fig code as a graphics description format, see the TransFig manual, which is available via anonymous FTP from svax.cs.cornell.edu in ~ftp/pub/fig/transfig-man.dvi. Micah Beck beck@svax.cs.cornell.edu Cornell Dept. of Computer Science ------------------------------ From: Julian Bradfield Date: Wed, 17 Aug 88 21:58:16 BST Subject: Re: The best way to do pictures in TeX In V88 #73 William LeFebvre suggests that the best way to draw pictures is to make them with Metafont, and ultimately to have a font for `tiles' to make up your pictures. This is a route I have adopted: last year I wrote a dissertation concerned with Petri nets, and all my Petri net pictures were drawn in Metafont. Since I was only using a Laserwriter, it was possible to make each diagram a separate character (even when it covered most of the page!)---for my thesis, I shall be producing a font with many components, and shall `tile' them to produce my diagrams. I confess my policy for positioning text is crude---I draw the diagram on graph paper first, then produce the TeXery for the picture, and put the text in place by specifying coordinates. I'm not too sure whether it's actually useful trying to do anything much fancier---simple macros such as `annotate this component' would be OK, but when drawing I like to stay at a fairly low level. ------------------------------ Date: Wed, 17 Aug 88 13:16 GMT From: Ian Murphy Subject: Replies to my problem with local.mf and metafont. Thanks to everybody who replied to my request for help regarding LOCAL.MF and Metafont, there was some mail to which I could not reply, this was due to problems with our mailer not having very complete routing tables (yet), so if anybody sent me advice and didn't get a reply, t'ain't my fault blame the mailer. If there is anybody out there trying to write a new driver for TeX and needs to adapt local.mf to produce fonts of the correct resolution then note the following o Metafont DOES NOT read in local.mf from your directory or any other when you run it, as I thought it did. o The only permenant way (unfortunately) to get it to recognise your new definitions is to run inimf (which comes with the TeX distribution) and to read in plain.mf and local.mf and then dump it, as described in the Metafont manual. o A temporary solution (read 'kludge') is to run metafont and do the following ** \INPUT LOCAL (assuming its in your own directory/path/whatever) * \MODE= yournewmode * \MAG=xxx * INPUT CMR10 which results (here at least) in a font called LOCAL.xxxGF that you can rename to cmr10.xxxGF. Ian Murphy University College Cork/ Procyon Informatics Dub. IAN@VAX1.UCC.IE : Internet (Here most of the year) IAN@IRUCCVAX : Bitnet MURPHY_I@PROCYON.IE : Internet (here at the moment) ------------------------------ From: INHB%MCGILLC.BITNET@Forsythe.Stanford.EDU Date: THU AUG 18, 1988 09.53.38 Subject: \chemical macro From: Michael Barr For Jim Seidman who was looking for a \chemical macro that would take \chemical{H2O} and produce, H$_2$O, I offer the following code. Note that the syntax is different. You have to type {\chemical H20}, but the result is the same. For reasons I guess I would understand if I understood TeX better, if I try to define \chemical#1{{\catcode`1=\active ... #1}}, it simply ignores the change of category codes. I also made up a macro \. with the same syntax (for the same reason) so that {\chemical NaAl(SO4)2{\.12}H2O} produces the equivalent of NaAl(SO$_4$)$_2\cdot$12H$_2$O. \let\zero=0 \let\one=1 \let\two=2 \let\three=3 \let\four=4 \let\five=5 \let\six=6 \let\seven=7 \let\eight=8 \let\nine=9 \chardef\other=12 { \catcode`0=\active \gdef0{\hbox{${}_\zero$}} \catcode`1=\active \gdef1{\hbox{${}_\one$}} \catcode`2=\active \gdef2{\hbox{${}_\two$}} \catcode`3=\active \gdef3{\hbox{${}_\three$}} \catcode`4=\active \gdef4{\hbox{${}_\four$}} \catcode`5=\active \gdef5{\hbox{${}_\five$}} \catcode`6=\active \gdef6{\hbox{${}_\six$}} \catcode`7=\active \gdef7{\hbox{${}_\seven$}} \catcode`8=\active \gdef8{\hbox{${}_\eight$}} \catcode`9=\active \gdef9{\hbox{${}_\nine$}} } \def\chemical{% \catcode`0=\active \catcode`1=\active \catcode`2=\active \catcode`3=\active \catcode`4=\active \catcode`5=\active \catcode`6=\active \catcode`7=\active \catcode`8=\active \catcode`9=\active } \def\.{\hbox{$\cdot$}% \catcode`0=\other \catcode`1=\other \catcode`2=\other \catcode`3=\other \catcode`4=\other \catcode`5=\other \catcode`6=\other \catcode`7=\other \catcode`8=\other \catcode`9=\other } %%%%%%%%%%% Some samples to try: {\chemical C12H22O11} {\chemical Na2CO3} {\chemical C10H22} {\chemical NaAl(SO4)2{\.12}H2O} ------------------------------ Date: Thu, 18 Aug 88 11:11 N From: Subject: Just a question... Hi from Crete. Does anybody know of the needed resolution of a laser printer for producing camera-ready output? Thanks in advance. Giannis. ------------------------------ Date: Thu, 18 Aug 88 10:21:18 EDT From: beck@cs.cornell.edu (Micah Beck) Subject: Announcement: Fig 1.4.FS and TransFig 1.4 Release 3 Announcing availability of two software components: Fig 1.4.FS and TransFig Version 1.4 Release 3: * Fig 1.4.FS is an enhanced version of Fig 1.4 Release 2. Some bugs are fixed, the user interface is enhanced, and some new graphics features are supported. * TransFig 1.4 Release 3 includes Fig code translators which implement the extension to Fig code needed by Fig 1.4.FS to implement new graphics features. New graphics features include setable text font and size, and area fill. Both Fig 1.4.FS and TransFig Release 3 use an extension to the definition of Fig code. This extension maintains compatibility with standard Fig code. Fig 1.4.FS was developed by Frank Schmuck at Cornell University. It is no sense an "official" version of Fig. The features added to Release 2 are summarized below: 1. New operation: zoom 2. New operation: change object properties 3. New modes: LaTeX line and vector 4. Search uses real mouse position rather than magnet-rounded coordinates 5. Centered and right justified text is drawn correctly. 6. Displays current file and directory on window label Frank Schmuck has left Cornell and I now support Fig 1.4.FS. It is available for anonymous FTP from svax.cs.cornell.edu as ~ftp/pub/fig/fig-fs.tar.Z. TransFig Release 3 is available as ~ftp/pub/fig/transfig.tar.Z. Some technical notes: * Fig 1.4.FS is different enough from Release 2 that it was not possible to automatically generate patch files for the bug fixes. Sorry. * In a recent posting, Ken Yap of Rochester U. suggested that Fig hacking be done on Xfig, his generalized Fig which runs under both Suntools and X11. Unfortunately, Fig 1.4.FS was developed in parallel to Xfig, and thus some work will be required to merge the two. * If you picked up a version of Fig 1.4.FS or TransFig Release 3 before reading this note, then you may have to apply this fix: line 121 of read.c should be tfx_flag = !strncmp(buf, "#FIG 1.4-TFX", 11); /* check for TFX */ Micah Beck beck@svax.cs.cornell.edu Cornell Dept of Computer Science ------------------------------ Date: Thu, 18 Aug 88 09:34:48 CDT From: Don Hosek Subject: RE: The best way to do pictures in TeX A few notes on Phil's note regarding drawing pictures for TeX using MF: It has been done before; I seem to recall hearing about an article (in TUGboat?) on the topic, and I've heard from people who have done this for circuit diagrams. As for the resolution used, one should use the resolution of the output device for the font when it is generated. i.e., for a 300dpi device, create a file GRAPHIC.300GF &c. 2602dpi, by the way is *not* MF's highest resolution. I'm not sure what it is, although I do believe it's pretty big (I've gone up to 3600GF on some of the stuff I've done, and I have no reason to think I came close to the limit). I agree with Tom Reid in that tiling should not be necessary, but then again, a lot of things shouldn't be necessary. Many implementations of MF have dreadfully small memories (VMS MF from Stanford can't even do 2602dpi proofs of cmr10 because of memory limitations). This may cause people to be unable to draw large diagrams. To make it easier for people to use MF, it may be useful to create a special base file along the lines of a LaTeX for MF. This fall, I may create one for electronic diagrams if I get the time. Also, it is a very important point that this still doesn't resolve the problem of importing graphics from other packages. -dh ------------------------------ Date: Thu, 18 Aug 88 08:47:29 PDT From: lamport@src.dec.com (Leslie Lamport) Subject: Re: TeXhax Digest V88 #72 (LaTeX notes) Walter Olthoff writes: I know some people call it ``bad style'', but I would like to have an \parindent already in the first paragraph of a section. The article.sty and art12.sty macro packages seem to have no provision for it (for example, \section is defined by \@startsection, but I can't find the latter). Searching art12.st for "\@startsection" reveals the following coments % \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE} % optional * [ALTHEADING]{HEADING} % Generic command to start a section. ... % BEFORESKIP : Absolute value = skip to leave above the heading. % If negative, then paragraph indent of text following % heading is suppressed. Jonathan Thornburg writes: I'm looking for a LaTeX "short verbatim" macro, rather like \verb|...|, but which can be used in chapter/section titles, figure captions, inside a box in math mode, and generally in arguments to other macros. \tt alone almost does the job because I'm really only worried about computer program names, which don't have many special characters in them, *but* I don't want to have to say \_ to get an underscore. Unfortunately, what he wants to do is impossible in TeX, since when TeX processes \macroa{\macrob{a}} the charcter code of the "a" is determined before \macrob is looked at. The only solution is to define an environment "nosubscript" in which "_" is \catcoded to an ordinary character. One can then write something like \begin{nosubscript} \section{The variable {\tt foo_bar}} This variable is related to {\tt foo_foo} ... \end{nosubscript} Sorry guys, but your mother should have warned you about the evils of macro expansion languages. Leslie Lamport ------------------------------ Date: Thu, 18 Aug 88 09:36:49 PDT From: lamport@src.dec.com (Leslie Lamport) Subject: Re: TeXhax Digest V88 #73 (LaTeX notes) Mik Bickis writes: I notice that inside an eqnarray environment LaTeX ignores any explicit commands about pagebreaks, either in its own dialect (\pagebreak or \nopagebreak) or in terms of TeX \penalty's. Does anyone know if this is a "known bug" or a "design feature"? Although LaTex will break long eqnarray's across pages, it does not always put the break in the best place semantically. I have not been able to figure out how LaTeX decides on such breaks, so I am not able to override its choice. I suppose this should be a bug, but the work-around easy enough that I probably won't fix it. Of course, to get LaTeX to break the page, you just break the eqnarray environment into two separate environments, with a \pagebreak in between. There's another amusing hack that seems to work--end the equation that should end the page with \\[0pt\pagebreak] (TeX hackers should be able to figure out what's going on.) However, I make no promises that this hack will continue to work in future versions. ... This made me check on other places where \pagebreak might not work, and I discovered that it also has no effect inside a tabbing environment. This seems more serious, since the work around is harder. You have to split it into two tabbing environments and reset the tab stops, making use of the \kill command. Perhaps I should fix this. Leslie Lamport ------------------------------ Date: 18 Aug 88 19:39:00 EST From: "NJITX::HXN8477" Subject: TeX Previewer We, in the EE dept. of the NJ Inst. of Tech. are desparately looking for a TeX previewer for both the VAX VMS TeX and the IBM PC's LaTeX. Any idea as to where we can find such previewers. FTP is ok. Thanks in advance. Hamed Nassar Internet: hxn8477%njitx.decnet@njitc.njit.edu UUCP : bellcore!argus!mars!nancy ------------------------------ Date: Fri, 19 Aug 88 10:16 EDT From: Ted Nieland - SRL <@WPAFB-AAMRL.ARPA:TNIELAND@FALCON> Subject: PD implementation for DOS, any available via FTP? Is there a Public Domain Version of TeX for DOS available via FTP? Also, where can one get a hold of PiCTeX? I am also interested in receiving notices of where on the Internet people can get any TeXware. I will compile the list (and keep it current) and put it out on the list once or twice a year. I am willing to keep track of these locations so people can easily find the locations fo TeXware and we can keep down the number of requests like this. Therefore, would all TeX storage sites send me a a blurb on what they have available and how to get it and I will get a list put together for a future issue of TeXHaX (and possibly TUGBoat). | M. Edward (Ted) Nieland - Systems Analyst | US Snail: | Arpa Internet: | Systems Research Laboratories, Inc. | TNIELAND@WPAFB-AAMRL.ARPA | 2800 Indian Ripple Road WP 196 | TNIELAND%FALCON@WPAFB-AAMRL.ARPA | Dayton, OH 45440 | | A T & T: (513) 255-8846/8760/5156 ------------------------------ Date: Fri, 19 Aug 88 10:21:46 PST From: Peter Scott Subject: Re: Increasing TeX's memory limits Eric Hildum (hildum@iris.ucdavis.edu" in 88/#72 gives a list of changes to make to Kellerman & Smith's TeX to expand the memory, and is surprised how small it is. I have done the same thing here, after consulting with David Kellerman, and my list is even smaller; since it appears to work just fine, maybe I can save someone some typing by publishing my table of differences: ************ File DJA0:[TEX.TEX.BIGTEX]TEX.CH;1 169 @!mem_max=262000; {greatest index in \TeX's internal |mem| array; 170 must be strictly less than |max_halfword|; ****** File DJA0:[TEX.TEX]TEX.CH;1 169 @!mem_max=65000; {greatest index in \TeX's internal |mem| array; 170 must be strictly less than |max_halfword|; ************ ************ File DJA0:[TEX.TEX.BIGTEX]TEX.CH;1 225 @d mem_top==262000 {largest index in the |mem| array dumped by \.{INITEX}; 226 must be substantially larger than |mem_bot| ****** File DJA0:[TEX.TEX]TEX.CH;1 225 @d mem_top==65000 {largest index in the |mem| array dumped by \.{INITEX}; 226 must be substantially larger than |mem_bot| ************ ************ File DJA0:[TEX.TEX.BIGTEX]TEX.CH;1 752 @d max_halfword==65535 {largest allowable value in a |halfword|} 753 @y 754 @d max_halfword==262001 {largest allowable value in a |halfword|} 755 @z 756 757 @x 758 @d qi(#)==#+min_quarterword ****** File DJA0:[TEX.TEX]TEX.CH;1 752 @d qi(#)==#+min_quarterword ************ ************ File DJA0:[TEX.TEX.BIGTEX]TEX.CH;1 810 var t:packed array[1..7] of 0..65535; {raw year, month, day and time} 811 begin @= $numtim@>(t);@/ ****** File DJA0:[TEX.TEX]TEX.CH;1 804 var t:packed array[1..7] of halfword; {raw year, month, day and time} 805 begin @= $numtim@>(t);@/ ************ Peter Scott (pjs%grouch@jpl-mil.jpl.nasa.gov) ------------------------------ From: Ronald J. Watro Date: Fri, 19 Aug 88 11:30:59 EDT Subject: Re: LaTeX: Indenting after Sectioning One of the wonderful things about the LaTeX macros is that they are so easy to change. To get indentations after headings, just look at the definition of \@startsection from the file latex.tex: % \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE} % optional * [ALTHEADING]{HEADING} % Generic command to start a section. % NAME : e.g., 'subsection' % LEVEL : a number, denoting depth of section -- e.g., chapter=1, % section = 2, etc. % INDENT : Indentation of heading from left margin % BEFORESKIP : Absolute value = skip to leave above the heading. % If negative, then paragraph indent of text following % heading is suppressed. Just remove the minus sign from the style file calls to \@startsection and you get indentations. It's that easy !!! Dr. Ronald J. Watro The MITRE Corporation, MS A040, Burlington RD, Bedford, MA 01730 USA 617-271-8390 ARPA: watro%linus@mitre-bedford.ARPA UUCP: ...{decvax,utzoo,philabs,security,allegra,genrad}!linus!watro ------------------------------ Date: Fri, 19 Aug 88 19:25:24 BST From: David Osborne Subject: TeX/METAFONT on ICL Clan 7 i'm pleased to say that TeX 2.9 and METAFONT 1.3 passed the trip and trap tests on our ICL Clan 7 yesterday morning. the machine is really a CCI Power6/32, but is running an ICL version of Unix System V with a Berkeley Unix filesystem. i know other Power6 machines are running TeX, but most will be using either Berkeley 4.2 or 4.3, so this is more relevant to our particular version of the operating system. without a Pascal compiler, the only route was via Tim Morgan and Tom Rokicki's "web2c" package (version 2.17). i hit a few snags with version 2.0, but after Sebastian Rahtz pointed me towards the 2.17 sources, most things came up without much difficulty. congratulations and thanks are due to Tim and Tom for a superbly useful set of tools. now all that's needed is a full suite of changefiles for all the TeXware and MFware (gftodvi is conspicuously absent) and Unix sites without Pascal compilers will be forever in their debt. \dave David Osborne Cripps Computing Centre, University of Nottingham, Nottingham NG7 2RD, UK Phone: +44 602 484848 x2064 JANET: dao@uk.ac.nott.cs BITNET: dao%uk.ac.nott.cs@ukacrl.bitnet ARPA: dao%uk.ac.nott.cs@nss.cs.ucl.ac.uk or %ukacrl.bitnet@cunyvm.cuny.edu UUCP: ,...!mcvax-!ukc!nott-cs!dao ------------------------------ Date: Fri, 19 Aug 88 14:51 GMT From: Ian Murphy Subject: Answers to my Metafont question Thanks to everybody who replied to my request for help regarding LOCAL.MF and Metafont, there was some mail to which I could not reply, this was due to problems with our mailer not having very complete routing tables (yet), so if anybody sent me advice and didn't get a reply, t'ain't my fault; blame the mailer. If there is anybody out there trying to write a new driver for TeX and needs to adapt local.mf to produce fonts of the correct resolution then note the following o Metafont DOES NOT read in local.mf from your directory or any other when you run it, as I thought it did. o The only permenant way (unfortunately) to get it to recognise your new definitions is to run inimf (which comes with the TeX distribution) and to read in plain.mf and local.mf and then dump it, as described in the Metafont manual. o A temporary solution (read 'kludge') is to run metafont and do the following ** \INPUT LOCAL (assuming its in your own directory/path/whatever) * \MODE= yournewmode * \MAG=xxx * INPUT CMR10 %or whatever which results (here at least) in a font called LOCAL.xxxGF that you can rename to cmr10.xxxGF. Ian Murphy University College Cork/ Procyon Informatics Dub. IAN@VAX1.UCC.IE : Internet (Here most of the year) IAN@IRUCCVAX : Bitnet MURPHY_I@PROCYON.IE : Internet (here at the moment) ------------------------------ %%% %%% Concerning subscriptions, address changes, unsubscribing: %%% BITNET: send a one-line mail message to LISTSERV@TAMVM1.BITNET: %%% SUBSCRIBE TEX-L % to subscribe %%% %%% All others: send mail to %%% texhax-request@score.stanford.edu %%% please send a valid arpanet address!! %%% %%% %%% All submissions to: texhax@score.stanford.edu %%% %%% Back issues available for FTPing as: %%% machine: directory: filename: %%% [SCORE.STANFORD.EDU]TEXHAXnn.yy %%% nn = issue number %%% yy = last two digits of current year %%%\bye %%% ------------------------------ End of TeXhax Digest ************************** -------