TeXhax Digest Friday, October 28, 1988 Volume 88 : Issue 97 Moderator: Malcolm Brown Today's Topics: NEC P6 driver wanted Re:Page Make-up Challenge (1) colour (2) 256-char TeX Re: BibTeX 0.99 for IBM PC (TeXhax # 92) Re: Maple to Tex and a question 24-pin LQ driver needed Spacing Question Re: TeXhax Digest V88 #95 (LaTeX notes) METAFONT and PostScript Re: METAFONT & PostScript makeindex bug mode_def for Linotronic 300 Upside-down text Tex and Latex on the MAC II (Texhax 92 query) Maple to TeX conversions (TexHax 92 query) Use of METAFONT to design Chinese characters? ---------------------------------------------------------------------- Date: Tue, 25 Oct 88 11:12:24 MEZ From: ZZKNAUF%DHVRRZN1.BITNET@CUNYVM.CUNY.EDU Subject: NEC P6 driver wanted Is there a driver for the NEC P6 dot matrix printer that uses the 360 x 360 dots per inch resolution of this printer and runs on IBM PCs with 512 or 640 KB? Any hints (PD or commercial) welcome. Gerd-H. Knauf RRZN Universitaet Hannover Schlosswender Str. 5 D-3000 Hannover 1 Germany ZZKNAUF@DHVRRZN1.BITNET ------------------------------ Date: Tue, 25 Oct 88 14:11:06 +0100 From: Joost Zalmstra Subject: Re:Page Make-up Challenge Maybe the following set of macros can contribute to the solution of the problem posed by David Rogers in TeXhax #86. It implements a floating insertion with the following properties: - Every insertion must be put in a \vbox. Customised macros can then be used to place the white space for the figure and the figure caption in this box. - The order in which these \vbox-es are inserted is maintained. - No more than two boxes are placed on one page: the first on the top and the second on the bottom of the page. The proposed macro \figplace should create a \vbox with the correct layout of the figure and then call \addfigure to put it in the insertionlist: \def\figplace#1#2#3#4{setbox0=\vbox{% % here call macros to place figure and caption } \addfigure0} Note that the space separating the figure from the text should not be included in the \vbox. The skipregister \figureskip is used for this purpose. The macros are written in plain TeX, in fact the output routine given here is an extension of the plain output routine (TeX-book page 364). The basic idea is that figures that won't fit on the current page are kept on a list (the \box \figlist). This list is checked after a \shipout and if not empty a maximum of two \vboxes is inserted (using plains \topins) for the next page. As the insertions are \vboxes it is easy to split the insertion and put one at the top and one at the bottom of the page. Two further refinements should be mentioned here. 1) If the figures on a page take so much room that less than a specified amount of space (given in dimen register \minpagesize) is left for the text, this text is shifted through to the next page. 2) By inserting a \vbox with height \vsize (created by \vbox to \vsize..) a page insert is created. No extra \figureskip will be include in this case. I have tested these macros with real input (16 pages with on the first page the insertion of several figures) and it seems to work on the moment. However, I'm not a TeX guru and I would expect that these macros can be improved. One of the problems left is te fact that \addfigures must be called in horizontal mode ( \vadjust won't work). I would therefore apreciate comments, both on the macros as they stand and on how this contributes to the Challenge. Joost Zalmstra. jjaz%nat.vu.nl@hearn.bitnet \newbox\figlist \newcount\figuresonpage \figuresonpage=0 \newcount\figuresonlist \figuresonlist=0 \newskip\figureskip \figureskip=1.2 pc plus 1 pc \newdimen\pagesize \newdimen\minpagesize \minpagesize=5 pc \newdimen\figuresizeonpage \def\addfigure#1{% add figure in box #1 to the document \ifnum\figuresonpage>1 % allready two figures on this page \addtolist{#1}% % so save for later \else \ifnum\figuresonlist>0 % figlist is not empty \addtolist{#1} % so save for later \else % no figures left over, so try to fit this one \dimen0=\ht#1 \ifdim\dimen0<\vsize% not a pagesize figure \advance\dimen0 by \dp#1 % size of the box \advance\dimen0 by \figureskip % extra space below or above \fi \advance\dimen0 by \pagetotal \ifdim\dimen0>\pagegoal % no space on this page \addtolist{#1} % so save for later \else \advance\dimen0 by \figuresizeonpage \ifdim\dimen0>\dimen\topins % exceding maximum insertion size \addtolist{#1} % so save for later \else \figureinsert{#1} % insert the figure \fi \fi \fi \fi } \def\addtolist#1{% add box #1 to figlist \global\setbox\figlist=\vbox{% \nointerlineskip \box#1 \unvbox\figlist} \global\advance\figuresonlist by 1 } \def\figureinsert#1{% insert figure on this page \ifdim\ht#1<\vsize \insert\topins{\vbox{% \ifnum\figuresonpage=0 \unvbox#1\vskip\figureskip % skip below the figure \else \vskip\figureskip\unvbox#1 % skip above the figure \fi }} \else \pageinsert \unvbox#1 \endinsert \fi \global\advance\figuresonpage by 1 \global\advance\figuresizeonpage by \ht#1 \global\advance\figuresizeonpage by \dp#1 \global\advance\figuresizeonpage by \figureskip } \def\checkfiglist{% see if there is a figure in the list that will % fit on the next page \ifnum\figuresonlist>0 \global\setbox\figlist=\vbox{% \unvbox\figlist \setbox0=\lastbox \global\advance\dimen0\ht0 \ifdim\ht0<\vsize \global\advance\dimen0 by \dp0 \global\advance\dimen0 by \figureskip \fi \ifdim\dimen0>\vsize \vbox{\box0} % no room ; replace the figure \else \ifdim\dimen0>\dimen\topins \vbox{\box0} \else \global\advance\figuresonlist by -1 \fi \fi \global\setbox0=\box0 } \else {\setbox1=\box0 % make box0 void \global\setbox0=\box0} \fi } % Borrowing the macros from plain TeX \catcode`@=11 \output{\myoutput} \def\myoutput{\shipout\vbox{\makeheadline\pagebody\makefootline}% \advancepageno \global\figuresonpage=0 \dimen0=0pt \global\figuresizeonpage = 0pt \checkfiglist % check if there is figure waiting and return it in box 0 \ifvoid0 % nothing left \else \figureinsert0% insert this figure \checkfiglist % check for a second figure \ifvoid0\else \figureinsert0 \fi \fi \ifvoid255\else\unvbox255\penalty\outputpenalty\fi % unused page back on list \ifnum\outputpenalty>-\@MM \else\dosupereject\fi} \def\pagecontents{% \ifnum\figuresonpage>0 % check for insertion of figures \unvbox\topins % place the figure(s) on top \ifnum\figuresonpage=2 \setbox0=\lastbox % remove the second figure \fi \setbox1=\lastbox \unvbox1 \fi % Check box 255 \pagesize=\ht255 \advance\pagesize by \dp255 % determine size of box 255 \ifdim\pagesize>\minpagesize \dimen@=\dp255 \unvbox255 % the real page contents \else \message{tekstsize = \the\ht255, \the\dp255} \ifdim\ht255=0pt % box is empty \else \vfil % to small so leave for next page \fi \fi % \ifnum\figuresonpage=2 \box0 % the second figure \fi \ifvoid\footins\else % footnote info is present \vskip\skip\footins \footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} \catcode`@=12 % at signs no longer letters ------------------------------ Date: Tue, 25 Oct 88 18:19:43 BST From: Dr R M Damerell (RHBNC) Subject: (1) colour (2) 256-char TeX 1. I am thinking about the possibility of writing a driver for the HP Paintjet, which prints many colours. Please, is there any agreed way to tell TEX to insert a change-colour command into a DVI file? If so, what will the syntax of the command be? 2. S. P. Manganaris asked about extending TeX's alphabet from 128 to 256 characters. Please may I draw your attention to a bug in the VMS change files. (Every VMS change file I have seen contains this). Array xord is defined as xord: array [char] of ascii-code ; and therefore it has 256 elements, but only the first 128 of them get initialised. mark ------------------------------ From: Z3000JD%AWITUW01.BITNET@Forsythe.Stanford.EDU Subject: Re: BibTeX 0.99 for IBM PC (TeXhax # 92) I have implemented BibTeX version 0.99 for the PC with MS-Pascal 3.31. I have a TANGLE for MS-Pascal 3.31 (if not ported on another host) and one for BibTeX. But I cannot recommend this version of BibTeX because - it doesnot write a logfile - it can only handle up to 500 entries - MS.Pascal has great problems with memory during compilation and execution of BibTeX. I'm looking too for a got BibTeX 0.99 for PC's (in C??) Johannes Demel Technical University Vienna Z3000jd@awituw01,bitnet ------------------------------ Date: Tue, 25 Oct 88 11:42:55 EDT From: "Ricardo A. Baeza-Yates" Subject: Re: Maple to Tex and a question >TeXhax Digest Tuesday, October 18, 1988 Volume 88 : Issue 92 ====> Maple to TeX conversion... >---------------------------------------------------------------------- >Date: 14-OCT-1988 11:23:18 GMT >From: KNEIJ%VAX.OXFORD.AC.UK@Forsythe.Stanford.EDU >To: texhax@SCORE.STANFORD.EDU >Subject: Maple to TeX conversion... >Well, the Macsyma and SMP gangs have asked, so why shouldn't we Maple >users get in on the act: does anyone have a routine for converting Maple >files/output to TeX? >Ivo Kneij >Clarendon Laboratory, >Oxford. >kneij@uk.ac.ox.vax A function that converts Maple results to Latex is part of the miscelaneous library function of Maple 4.2 (last version distributed). A question: In the same Latex document I need left-justified, right-justified and centered \begin{equation},\[, begin{eqnarray}, etc (any equation environment). All what I tried failed. Any ideas? rabaeza@watmum.waterloo.{edu,cdn} 519-885-1211 x3497 Ricardo Baeza-Yates rabaeza@watmum.uwaterloo.ca CS Dept., U. Waterloo uunet!watmath!watmum!rabaeza Waterloo, Ont. N2L3G1 ------------------------------ Date: Tue, 25 Oct 88 13:32:08 CDT From: Pat Lestrade Subject: 24-pin LQ driver needed I am looking for a driver for my new epson LQ-500 (24-pin) dot matrix. The normal 9-pin driver works but I am hoping to get stupendous results from something more specific to the LQ. Surely someone has done this by now...... I will be happy to echo back to texhax a summary of any replies that I receive. Thanks, Pat Lestrade (lestrade@msstate.bitnet) Mississippi, not just a tourist trap... QUIT ------------------------------ Date: Tue, 25 Oct 88 11:12:44 CDT From: Alan Josephson Subject: Spacing Question Please forgive me if this has been beaten into the ground before. I'm having problems with double/single spacing within LaTeX documents in the context of \begin{array}. I'm using an "inherited" spacing.sty which sets up doublespace/ singlespace environments. While most of my text is doublespaced, occasionally I have displayed text that is singlespaced, eg: \begin{doublespace} ... \begin{singlespace} \[ \begin{array}{rcl} f(a,b) & \arr & \TRUE \\ f(b,c) & \arr & \TRUE \\ g(b,c) & \arr & \TRUE \\ g(b,d) & \arr & \TRUE \\ \TRUE \wedge X & \arr & X \end{array} \] \end{singlespace} ... \end{doublespace} The paragraph of text preceding this block is affected and comes out singlespaced as does the text following it (intermittently). Not being a (La)TeX hacker, I'd appreciate a quick fix to ensure that this doesn't happen or a more reliable method for handling spacing issues. Please mail any suggestions to me directly as I do not subscribe to this newsgroup. Thanks. Alan Josephson USENET: {ctvax,im4u,texsun,rice}!ti-csl!naj PO 655474 M/S 238 ARPA: Naj%TI-CSL@CSNet-Relay Texas Instruments Inc. CSNET: Naj@Ti-CSL Dallas, Texas 75265 VOICE: (214) 995-0371 ------------------------------ Date: Tue, 25 Oct 88 16:00:11 PDT From: lamport@src.dec.com (Leslie Lamport) Subject: Re: TeXhax Digest V88 #95 (LaTeX notes) In response to Adrian F. Clark's query: \the\fam will produce a number that identifies the font style. A modearte amount of TeX hacking will then suffice to define commands \savestyle and \setstyle so that "\it\savestyle\small\setstyle" is equivalent to "\small\it". Leslie Lamport ------------------------------ Date: Tue, 25 Oct 88 19:48:40 edt From: smithda@cpsvax.cps.msu.edu (Daniel Smith) Subject: METAFONT and PostScript I've had quite a few comments since I posted this article on USENET. Someone suggested that I post in on TeXhax too. I apologize to all of you who have already read this in comp.text, comp.fonts, or comp.postscipt.... As I was working on installing a new DVI driver to handle resident PostScript font, I began to think about the relationship between METAFONT and PostScript. It occured to me that the two do about the same thing, its just that they do it at different times. METAFONT translates source code describing fonts into bit maps, and so does PostScript. The difference is that PostScript does it when the document is printed, and METAFONT does it when the font itself is created. I began to wonder if anyone has tried to make METAFONT spit out PostScipt outline fonts? Such a scheme would seem to combine the best of both worlds. METAFONT is a real programming language, written by a computer scientist. This makes is "easy" to describe fonts accurately and formally. PostScript on the otherhand is not very easy to read. While it is possible to make sense out of PostScript code, it is not as good as METAFONT. Here is a list of pros and cons for such a scheme: METAFONT doing just what it does now: * The fonts produced will work on just about ANY printer. One does not need a PostScript printer to use TeX/METAFONT. * However, these fonts take up A LOT of disk space, espically when compared to PostScript fonts. For example, a PostScript outline for for say Times-Roman is basically one file. That is one file for ALL sizes of Times-Roman, for ALL device resolutions. Since the PostScript software in each printer has "lots of smarts" this method works. * DVI drivers are non-trivial pieces of software. Each driver must deal with the bitmaps in the GF/PK/PXL files and convert those to a scheme for the current printer. METAFONT producing PostScript * A LARGE savings in disk space can be realized, because very few files are required for a font. * Of course, the output is only of use to those who have PostScript printers. * PostScript is fast becoming a standard for desktop-publishing. * Writing a DVI driver is quite simple. One no longer needs to deal with bitmaps of fonts. The DVI file and TFM files for the fonts are all that are needed. In some cases, the TFM may not even be necessary. * TeX fonts (Computer Modern) behave just like any other PostScript font. J. Daniel Smith smithda@cpsvax.cps.msu.edu Michigan State University "An average English word is four letters and a half. By hard, honest labor I've dug all the large words out of my vocabulary and shaved it down till the average is three and a half..." Mark Twain ------------------------------ Date: Tue, 25 Oct 88 18:48:51 EDT From: Michael DeCorte Subject: Re: METAFONT & PostScript smithda@cpsvax.cps.msu.edu (Daniel Smith) writes: >METAFONT translates source code describing fonts into bit maps, and so >does PostScript. The difference is that PostScript does it when the >document is printed, and METAFONT does it when the font itself is >created. I began to wonder if anyone has tried to make METAFONT spit >out PostScript outline fonts? [lots of other useful observations] I have been thinking of how to do this for quite some time now. There are a few things that have to be first examined: (I am calling these things .psf for PostScript fonts) 1) As I understand it, under postscript, when you scale a font you are doing the equivalent of magstep under TeX. This is unacceptable for TeX. Therefore it won't be possible to have cmr.psf but there is nothing to stop you from having cmr10.psf. There are several advantages to this: a) it is portable between different PS printers of different resolutions b) it should be portable between write-white and write-black engines c) the .psf file may be smaller than the cmr10.pk but I am only guessing d) the cmr10.psf file will DEFINITELY be smaller than the cmr10.pk @ magstep 0,0.5,2..5. (I really like this) e) it may be faster to download as you don't have to download multiple mag of the same font and it may even be possible to make the cmr10.psf very small by having a set of ps libraries that you download before any fonts 2) if we ever get a PostScript previewer on our Sun, I won't have to have fonts at every size and dots/inch know to mankind 3) this could be generalized for vector output devices in general. Wouldn't it be nice to be able to use that 4105 to preview? I suppose you could get plotters going also. 4) internal PostScript fonts will be easier to handle I assume, as they will be handled the same as external fonts. 5) it will be necessary to use the .tfm files or duplicate them in the .psf file. I think it is better to just use the .tfm file 6) this is probably portable but... Donald Knuth spent a lot of time figuring out how to make a { look like a }. Did Adobe? Rounding leads havoc on low res fonts. 7) we will have to redo LaTeX's definition of fonts. With all of these fonts that we now have available, it will be necessary to have a font defined in three parts: family, style, size. Eg. right now we have Computer Modern, Italic, 12. We will have Helvetica, Bold, 10. This means that you would to choose a font you would do something like \rm\it\large or \hv\bf\normalsize. If you only want to change the style of the font from bold to italic but nothing else you would only do \it. Likewise, to change the family but not the size or style you would only do \rm. One minor problem is that \rm stands for Computer Modern not Roman. 9) If the .psf fonts are defined correctly, it will be possible to use fonts from TeX in non TeX stuff. -- Michael DeCorte // (315)268-2292 // P.O. Box 652, Potsdam, NY 13676 Internet mrd@sun.soe.clarkson.edu // Bitnet mrd@clutx.bitnet Clarkson Archive Server archive-server@sun.soe.clarkson.edu archive-server%sun.soe.clarkson.edu@omnigate.bitnet dumb1!dumb2!dumb3!smart!sun.soe.clarkson.edu!archive-server ------------------------------ Date: Tue, 25 Oct 88 20:28:02 EDT From: zaccone - 1393 Subject: makeindex bug I have found what appears to be a bug in makeindex. Suppose I would like the string "le%en" to appear in the index, and have it alphabetized as leen. I get the following entry in my .idx file: \indexentry{leen@le%en}{8} The %e is interpreted as a C format operator as can be seen from the .ind file produced by makeindex: \begin{theindex} \item le0.000000e+00n, 8 \end{theindex} Doubling up on the percent sign makes the problem go away. The following line \indexentry{leen@le%%en}{8} produces \begin{theindex} \item le%en, 8 \end{theindex} If it's not a bug, it should at least be documented. Rick Zaccone zaccone@bknlvms.bitnet zaccone@rigel.bucknell.edu ------------------------------ From: Clark Adrian Date: Wed, 26 Oct 88 10:56:42 GMT Subject: mode_def for Linotronic 300 I need to generate a couple of fonts for a Linotronic 300 typesetter (1270dpi). Has anyone figured out a sensible mode_def for it? I've been recommended to use the same values for fillin, etc, as for a DEC LN03 laser printer, but the output I get is much too black. Adrian F. Clark JANET: alien@uk.ac.essex.ese ARPA: alien%uk.ac.essex.ese@nss.cs.ucl.ac.uk BITNET: alien%uk.ac.essex.ese@ac.uk Smail: Dept. of Electronic Systems Engineering, Essex University, Wivenhoe Park, Colchester, Essex C04 3SQ, U. K. Phone: (+44) 206-872432 (direct) ------------------------------ From: Clark Adrian Date: Wed, 26 Oct 88 10:50:32 GMT Subject: Upside-down text I have a colleague who wants to generate some upside-down text. Only one font is needed, say cmudr10 (computer modern upside-down roman, 10pt :->). Has any reader attempted to do this using Metafont? (I'd like the resulting font to have the effective meanings of height and depth interchanged.) Glancing through the Metafontbook, it doesn't look to hard...but I'm no MF expert. Adrian F. Clark JANET: alien@uk.ac.essex.ese ARPA: alien%uk.ac.essex.ese@nss.cs.ucl.ac.uk BITNET: alien%uk.ac.essex.ese@ac.uk Smail: Dept. of Electronic Systems Engineering, Essex University, Wivenhoe Park, Colchester, Essex C04 3SQ, U. K. Phone: (+44) 206-872432 (direct) ------------------------------ Date: Wed, 26 Oct 88 09:18 EST From: Subject: Tex and Latex on the MAC II (Texhax 92 query) I have been running TeXTures (1.01) on a MAC II with 1 meg of Ram, attached to an Apple LaserWriter IINT for about 6 weeks. My previous TeX experience was using it on a VAX for about 2 years. In general, I am extremely happy with both Plain TeX and LaTeX. The previewer is fast, and gives several choices for sizes to preview at. There is an easy to use facility to include pictures (in MacPaint format), although you will have to write a macro to do things like center automatically etc. A few quibbles: 1) The manuals are not very clear on the best way to organise the font, format and style files for LaTeX. I had to call Blue Sky Research (the current distributors) for help. They were responsive and helpful. 2) Blue Sky does not supply BibTeX, although I personally have never needed it. 3) Some TeX beginners here have managed to obtain various MAC system errors, and crash the machine by writing badly structured, although (barely) syntactically correct code. The same code doesn't even cause the VAX TeX to hiccup. This is (I think) a problem caused by lack of virtual memory etc., but can be avoided by being careful in your TeX coding. Ois\'{\i}n McGuinness Mathematics Department Fordham University Bronx NY 10458 mcguiness@fordmurh.bitnet (212)-579-2355 (please note spelling!) ------------------------------ Date: Wed, 26 Oct 88 09:27 EST From: Subject: Maple to TeX conversions (TexHax 92 query) The version 4.2 distribution of Maple contains a function ``latex()'', that converts a Maple expression to Latex form. It appears to work well with simple expressions, and I haven't tried it with more complex expressions. It is overly cautious in some respects, and will give you many more pairs '{' and '}' than are actually needed. Also you have to supply the $...$ or \[..\] to surround the output with. A warning: latex() is adapted from the similar Maple function eqn(), and contains some seemingly unreachable code that has some troff constructs left in. (If you already have Maple 4.2, look for the lines containing ``size 13'' in the source of latex() to see what they mean. I sent a note to Gaston Gonnet at Waterloo about this back in May, so the Maple people should know about this problem already.) Ois\'{\i}n McGuinness Mathematics Department Fordham University Bronx NY 10458 mcguiness@fordmurh.bitnet (212)-579-2355 (note the spelling!) ------------------------------ Date: Wed, 26 Oct 88 13:54 GMT From: GTEO%cs.tcd.ie@Forsythe.Stanford.EDU Subject: Use of METAFONT to design Chinese characters? These questions are reserved for anyone who is interested in font design, METAFONT, PostScript, hand on experience with MF or PS, and anyone just curious, please read on. METAFONT design philosophy is to describe characters's shapes to computers using a number of font parameters. The same set of parameters should be able to define the whole family of fonts. An example is the Computer Modern, a translation of Monotype Modern 8A into METAFONT code. It proved very effective by seeing the quality of CM fonts output on printers. However, I have a few questions here when considering use of METAFONT to design Chinese character based on the same design concepts that METAFONT adopted for phonetic languages where the size of the alphabet is small and comparative simple. The total number of Chinese characters to date are over 50000, even though only some 8000 are in common usage. Q1. What is the maximun number of fonts parameters that anyone has used to design any fonts? Q2. What is the optimun number of fonts parameters before the font designer is overloaded? (If anyone has such an experience) Any suggestions or comments or experiences shared are most appriciated. Thanks. ------------------------------ %%% %%% 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 ************************** -------