TeXhax Digest Friday, September 18, 1987 Volume 87 : Issue 77 [SCORE.STANFORD.EDU]TEXHAX77.87 Editor: Malcolm Brown Today's Topics: Re: framebox ... Where do I find... Answer to dynamic tex macro creation More \write without token expansion Combining DISSPLA with TeX Multi column output from LaTeX Postscript lines/circles in LaTeX Celerity Computer TeX build Another view of document indexing Right and Left side figures LaTeX --- Double column tables in single column mode? Please? Re: almost like \item, but ... ---------------------------------------------------------------------- 15-Sep-87 03:30:42-PDT,2316;000000000000 Date: Tue, 15 Sep 87 10:39:52 -0200 From: mcvax!dutesta!mol@uunet.UU.NET ( ) To: texhax@score.stanford.edu Subject: Re: framebox ... A while ago I posted a problem about framing text. I got a few replies and will summerize below. But first thanks to the peole who replied to me. METHOD 1 -------- \fbox{ \parbox{\textwidth}{ }} This can also be done by using minipage instead of parbox. It can also be used in picture environment with \fbox sustituted by \frame. I found two problems with these methods. First I could not use verbatim mode inside a parbox or minipage. Second, the framed box is subject to \parindent, so when building a frame of width \textwith and \parindent <> 0 it will cause a overful hbox. METHOD 2 -------- \documentstyle{article} \begin{document} \newbox\testbox \def\boxit#1{\vbox{\hrule\hbox{\vrule\kern3pt \vbox{\kern3pt#1\kern3pt}\kern3pt\vrule}\hrule}} % \setbox\testbox=\vbox{ } \boxit{\copy\testbox} \end{document} This method works fine and frames everything. Even verbatim mode can be used. Also you won't have troubles with \parindent. A minor problem is that the resulting box (includeing the frame) will be a bit wider than width of a page (6pt I believe), but LaTeX doesn't complain about it (no overfull hbox). By polishing, a nice (perhaps new LaTeX) command can be build from it. Greetings Marcel ########################################################################## Marcel Mol | UUCP: ..!mcvax!dutrun!dutesta!mol Delft Univ. of Tech. | BITNET: ETSTMOL@HDETUD1 Fac. of Elec. Eng. The Netherlands ------------------------------ Date: Tue 15 Sep 87 14:00:06-CDT From: Anthony Aristar Subject: Where do I find... To: texhax@SCORE.STANFORD.EDU I'm a new TeX user, and I've heard that you can run LaTeX on an IBM PC. If this is true, can anyone tell me what I need,and where to get it? I have a PS-2, model 30, and would need a driver for a Panasonic KX-P1091i. My thanks... ------------------------------ Date: Tue, 15 Sep 87 17:40:33 EDT From: oravax!norman@cu-arpa.cs.cornell.edu (Norman Ramsey) To: cornell!TeXhax@score.stanford.edu Subject: Answer to dynamic tex macro creation Dear Murali Krishnamurthi: what you want is: \def\mahmacro#1#2{\expandafter\def\csname#1\endcsname{#2}} Norman ------------------------------ Date: Tue, 15 Sep 87 17:44:38 EDT From: oravax!norman@cu-arpa.cs.cornell.edu (Norman Ramsey) To: cornell!TeXhax@score.stanford.edu Subject: More \write without token expansion David Cantor suggests \i solve this problem by resetting catcodes. This is fine if I want to write text, but won't help if I want to write a textual representation of *tokens*. In particular, it's no help at all if I want to write the arguments of a \section macro (for example) to a file, for alter use in a table of contents. As I said earlier, I have written an implementation using token lists. With this implementation I have managed to rewrite the latex sectioning macros so that they don't choke on ``fragile'' arguments (to my mind one of the great misfeatures of latex). Norman ------------------------------ Date: Wed, 16 Sep 87 10:17:14 EDT From: akk2@tut.cc.rochester.edu (Atul Kacker) To: texhax@score.stanford.edu Subject: Combining DISSPLA with TeX I was wondering if anyone has included graphs produced by the DISSPLA graphics package into a TeX document. It will probably have to be done using \special type commands. Most engineering students here use TeX to do their thesis and just cut and paste graphic output produced in DISSPLA. I believe DISSPLA now supports POSTSCRIPT output devices so it should be possible (I think) to do something like \psfig. Please e-mail. ------------------------------------------------------------- Atul Kacker ...{seismo,topaz,nike}!rochester!ur-tut!akk2 OR akk2@tut.cc.rochester.edu ------------------------------ From: RCOPROB%HDETUD1.BITNET@forsythe.stanford.edu Date: Wed, 16 Sep 87 17:16:02 MET To: TEXHAX@score.stanford.edu Return-Receipt-To: RCOPROB@hdetud1.bitnet Subject: Multi column output from LaTeX From: Rob van Hoboken +31 15 78-3813 RCOPROB at HDETUD1 Is it possible to create multi column (i.e. more than two columns) output with LaTeX? We want to create a three column text, LaTeX seems to be restricted to two columns (a sensible restriction MOST of the time). So far there has been no answer on my previous question about "drawing" program structure diagrams with TeX macros. Has anyone got a method to illustrate the documentation of a program with figures containing the graphical representation the program stucture, without having to resort to cut and paste. I would like to type the structure of my program like this: \IF{any condition} \THEN{ \WHILE{result OK} { some more code follows... } } \ELSE{ error message ... } and have the macros make me a beautiful drawing with comments etc. ------------------------------ Date: Wed, 16 Sep 87 10:42:36 PDT From: KARNEY%PPC.MFENET@NMFECC.ARPA Subject: Postscript lines/circles in LaTeX To: TeXhax@Score.Stanford.EDU We received Textures 1.0 (a version of TeX for the Macintosh) a few weeks ago. The documentation is much improved over the earlier versions. Also the handling of fonts is much cleaner (no more of this "Add Font" business is needed). It's a very nice package. Two questions: TUGboat v 7 no 1 (march 86) contained an article by Maus and Baker of Textset describing public domain macros that allow arbitrary lines and circles to be included on a PostScript printer. Does anyone know how to get hold of these macros? Textures would be more useful if I could transfer fonts generated by Metafont on a VAX to a Mac. Does anyone know how to convert a PK file (for example) into Mac format and how to incorporate a TFM file in Textures TFM file. Charles Karney Plasma Physics Laboratory Phone: 609/683-2607 Princeton University MFENet: Karney@PPC.MFENET PO Box 451 ARPANet: Karney%PPC.MFENET@NMFECC.ARPA Princeton, NJ 08544-0451 Bitnet: Karney%PPC.MFENET@ANLVMS.BITNET CC: TeXhax@Score.Stanford.EDU KARNEY ------------------------------ Date: Thu, 17 Sep 87 12:03:35 EDT From: Peter Galvin To: texhax@score.stanford.edu Subject: Celerity Computer TeX build Has anyone succeded in building the current TeX distribution on a Celerity system? The problems I'm facing are the lack of a "pxp" program and a celerity-specific set of change files. Thanks for the help. --Pete ------------------------------ Date: Thu 17 Sep 87 10:46:37-MDT From: "Nelson H.F. Beebe" Subject: Another view of document indexing To: texhax@SCORE.STANFORD.EDU The document indexing problem for TeX is rapidly being solved with new programs which have appeared in TUGBoat and in some of the TeX distribution channels, such as the Rochester repository. Most of these programs are reasonably large: GNU texidx is about 1700 lines, Chen/Lamport Makeindex is about 2600 lines. Both are written in C. In the Unix world, people tend to produce new software tools by combining several independent small tools. The new book Alfred V. Aho, Brian W. Kernighan, and Peter J. Weinberger, ``The AWK Programming Language'', Addison-Wesley (1988) (yes, 198-eight), ISBN 0-201-07981-X describes a set of 6 awk programs that were used to produce a comprehensive index for the book itself. The total code amounts to about 60 (sixty) lines of awk code, including comments and blank lines. Besides awk, the only Unix program used is sort. As another example, an awk program to replace lines beginning '#include "file"' by the contents of the named file amounts to 9 lines; in C, it took me 55 lines. Until recently, one might correctly argue that "this is all very nice, but doesn't help me if I don't have a Unix system". This need no longer be the case. AT&T has been making the source code for the new awk available, and now with the publication of the book, Addison-Wesley offers a distribution for Unix and MS-DOS. For details, contact Attn: M. Descoteaux Addison-Wesley Publishing Co. Reading, MA 01867 USA Tel: (617) 944-3700 I have personally ported the new awk to VAX VMS, MS-DOS, Unix, and TOPS-20 (both KCC and PCC compilers) with no difficulty at all, so I am confident that ports to other environments should be equally straightforward. Besides this version, (essentially) public-domain versions of awk have appeared from the Free Software Foundations GNU project, gawk, and from the Minix project, bawk. There are commercial implementations for the IBM PC of many Unix tools including awk and sort; consult the back pages of Byte, Computer Language, and Dr. Dobbs Journal of Software Tools for ads. The Lawrence Berkeley Laboratory has implemented many of the tools in Ratfor as part of a Virtual Operating System, and these are widely available. [[By the way, in case you wondered, the name awk originally had nothing to do with the auk bird; it is the initials of the authors. The book however now pictures the bird.]] ------------------------------ Date: Thu, 17 Sep 87 12:29:04 EDT From: mscbtc!btc!mike@gvax.cs.cornell.edu To: texhax@score.stanford.edu Subject: Right and Left side figures Ralph Becker-Szendy, V87 #61, wanted figures next to text. I was interested to see how TeXperts did this. Now Lamport, V87 #71, says that it is "infeasible in TeX". Well we did most of what Ralph wants for a research paper, for an example see Michael O. Thompson, Anomalous Behaviour During the Solidification of Silicon in the Presence of Impurities, Materials Research Society Symposium Proceedings Vol 51. Below are the macros we use for right and left side figures. They don't automatically float, but they do continue along several paragraphs. They will not break cleanly across pages so you do have to do some manual placement. If someone can show us how to count lines, we could simplify the continuation over paragraphs. Mike Heisler, Cornell University Bitnet MIKE@CRNLMSC Arpa mscbtc!btc!mike@gvax.cs.cornell.edu % Macros for right and left side figures % MGH 7/7/86 initial coding % Include: \input local*>tex>rlfigs.tex % Arguments: % #1 - width of figure space % #2 - length of figure space, not including figure caption % #3 - figure caption id, ie. Fig. 1 % #4 - figure caption text % % Usage: % \rightfig{3in}{5in}{Fig. 1}{This is the caption}% % The '%' at the end of \rightfig is needed to keep extra space out % Use \hangover after each paragraph that might have the figure % beside it % side figure macros' variables \newdimen\figwidth % figure box width \newdimen\boxht % figure box height \newbox\figbox % figure box \newbox\capbox % caption box, used for caption indent \newbox\dumybox % used for font height \newdimen\lineht % font height dimension \newcount\nlines % number of lines to hang indent text beside figure \newcount\linehtint % font height integer sp's, scaled points % % rightfig - Leaves space for right column figure with caption \def\rightfig#1#2#3#4{ \figwidth=\hsize % save current hsize \setbox\capbox = \hbox{#3} % use box to find width of Fig # \setbox\figbox =\vbox {\hsize=#1 \vskip#2 % setup the figure space \hangindent=\wd\capbox \hangafter=1 #3#4} \boxht=\ht\figbox % save the box height \advance\figwidth by -#1 {\ht\figbox=0pt \moveright\figwidth \box\figbox} % put the figure in \vskip-\parskip \vskip-4.0pt %paragraph beside the figure \setbox\dumybox=\vbox{\strut} % get the height and depth of a line \lineht=\ht\dumybox \advance\lineht by \dp\dumybox \linehtint=\lineht \nlines=\boxht % scale and truncate dimensions \divide\nlines by \linehtint % box height/line height = # of lines \advance\nlines by 2 % find par width \figwidth=#1 \advance\figwidth by 0.25in \hangindent=-\the\figwidth \hangafter=-\the\nlines % } % % leftfig - leave space for left column figure with caption, needs % declarations before rightfig \def\leftfig#1#2#3#4{ % #1 - width of figure space % #2 - length of figure space, not including figure caption % #3 - figure caption id, ie. Fig. 1 % #4 - figure caption text \figwidth=\hsize % save current hsize \setbox\capbox = \hbox{#3} % use box to find width of Fig # \setbox\figbox =\vbox {\hsize=#1 \vskip#2 % setup the figure space \hangindent=\wd\capbox \hangafter=1 #3#4} \boxht=\ht\figbox % save the box height {\ht\figbox=0pt \box\figbox} % put the figure in \vskip-\parskip \vskip-4.0pt %paragraph beside the figure \setbox\dumybox=\vbox{\strut} % get the height and depth of a line \lineht=\ht\dumybox \advance\lineht by \dp\dumybox \linehtint=\lineht \nlines=\boxht % scale and truncate dimensions \divide\nlines by \linehtint % box height/line height = # of lines \advance\nlines by 2 % find par width \figwidth=#1 \advance\figwidth by 0.25in \hangindent=\the\figwidth \hangafter=-\the\nlines % } % % Continues the hanging indent over between paragrahs, useful for right % and left figure macros. It is black magic from the TeXbook p316, ex 14.24 \def\hangover{\edef\next{\hangafter=\the\hangafter \hangindent=\the\hangindent} \par\next \edef\next{\prevgraf=\the\prevgraf} \indent\next} Sample: This is a ... paragraph. \rightfig{2in}{4in}{Fig. 1}{This is the caption}% This is another paragraph. \hangover This is even more paragraphs. \hangover etc. ------------------------------ Date: Thu, 17-Sep-1987 21:35:12.87 CST From: (John L. Huxtable) Subject: LaTeX --- Double column tables in single column mode? Please? To: I have been trying to get LaTeX to produce double-column tables in single column mode. The best I can do is something like: \twocolumn[all the text on that page which is to be single column] the table text (which is not necessarily a table). \onecolumn This is distinctly not what I want, since it doesn't float, it requires a page break after it to get back to single column mode, and it doesn't allow me to include description environments within the single column text since it chokes on the \item[label]. Is this unreasonable? It seems like I have seen this sort of thing in textbooks before... John L. Huxtable Huxtable@ukanvax.bitnet ------------------------------ Date: Fri, 18 Sep 87 15:54 EST From: "ALAN M. BAUM (313-986-1435)" To: texhax@SCORE.STANFORD.EDU Subject: Re: almost like \item, but ... X-VMS-To: NET%"texhax@score.stanford.edu" Here is a basic, no frills solution to the problem of aligning definitional material. % Definitions % \definition is used to align multiline % definitions like this % \defnamespace is used to change the amount % of space allowed for the name % \newdimen\defnamespace % Space for name in aligned definition \defnamespace=2in % Default value \def\definition#1#2{ % Aligned definition {\advance\parindent by \defnamespace \advance\defnamespace by -.5em \item{\hbox to \defnamespace{#1\hfil}}#2\par}} % Example: \definition{Cosmetology}{The science of the makeup of the universe including such issues as: big bangs vs.\ curls, the role of mascara in Grand Unification Theories, the application of charm and intergalactic lip gloss.} \definition{Conformality}{The code of behavior of convicted felons which preserves the angles between them.} gives the following output (making allowances for non-proportional spacing): Cosmetology The science of the makeup of the universe including such issues as: big bangs vs. curls, the role of mascara in Grand Unification Theories, the application of charm and inter- galactic lip gloss. Conformality The code of behavior of convicted felons which preserves the angles between them. For more or less space for the name, say \defnamespace=xin before using \definition. To avoid the indentation of the names, set \parindent to 0in before using. --------------------------------------------------- %%% %%% subscriptions, address changes to: texhax-request@score.stanford.edu %%% %%% submissions to: texhax@score.stanford.edu %%% %%% BITNET redistribution: TEX-L@TAMVM1.BITNET (list server) %%% %%%\bye %%% ------------------------------ End of TeXhax Digest ************************** -------