TeXhax Digest Friday, March 24, 1989 Volume 89 : Issue 24 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: Announcing TransFig Release 4 Announcing tek2eepic, a Tektronix to EEPIC converter LaTeX: Problem with \figure/\ref Re: LaTeX -- \pagestyle{empty} leaves number on page 1 General headers and footers in Latex documents Re: Computer Graphics and TeX -- A Challenge Graphics in Tex ------------------------------------------------------------------------- Date: Tue, 14 Mar 89 10:50:18 -0500 From: beck@svax.cs.cornell.edu (Micah Beck) Subject: Announcing TransFig Release 4 Keywords: TransFig Release 4 of the the TransFig package is now available for anonymous FTP and by mail from the Rice and Clarkson archive servers. This release contains the latest bug fixes, as well as one new program. TransFig now translates Fig code to PiCTeX, (E)EPIC, LaTeX picture env., PostScript, and PIC. Conrad Kwok (of EEPIC fame) has contributed fig2pic, a version of f2p which supports the TFX extension to Fig code. What this means is that pic/troff users can now make full use of Fig-FS, an enhanced version of Fig which uses the TFX extension. In other Fig-related news, the next patch level (1.6) of the GnuTeX numerical plotting program will support output in Fig code. GnuTeX is a version of the Gnuplot plotting program. This means that plots produced by GnuTeX can be edited with Fig and translated using TransFig. For more information, contact David Kotz (dfk@cs.duke.edu), the author of GnuTeX. TransFig and Fig-FS are in the directory ~ftp/pub/fig on svax.cs.cornell.edu. For information about using the Clarkson archive server send a mail message containing the command "help" to archive-server@sun.coe.clarkson.edu. GnuTeX is available via anonymous FTP from duke.cs.duke.edu. Micah Beck beck@cs.cornell.edu Department of Computer Science Cornell University ----------------------------------------------------------------------------- Date: Mon, 13 Mar 89 23:19:31 EST From: achhabra@ucesp1.ece.uc.edu (Atul K. Chhabra) Subject: Announcing tek2eepic, a Tektronix to EEPIC converter Keywords: Tektronix, EEPIC This is to announce the release of the program tek2eepic, the Tektronix to EEPIC converter. The distribution can be obtained by ftp'ing the file tek2eepic.tar.Z from the directory pub on sun.soe.clarkson.edu [128.153.12.3]. Tek2eepic is based largely on tek2ps (the Tektronix to Postscript converter) of Ed Moy, UC Berkely. Thanks to Mike Liebman (mjl@cheme1.che.utexas.edu) for having mailed me the tek2ps package. The EEPIC code generated by tek2eepic can be included in LaTeX documents. EEPIC is an extension to the LaTeX picture drawing environment. It was written by Conrad Kwok of UC Davis. Thus, tek2eepic provides a way of including tekronix plots in LaTeX documents that are intended for printing on non-Postscript laser printers (I know it works for sure on Imagen 8/300 with ImPress page description language, using the driver "iptex" ftp'd from pub/TeX on a.cs.uiuc.edu [10.3.0.37] or [192.5.69.1]). There is no README file in the distribution. I have tried to incorporate most of the installation instructions, and information about EEPIC and how to get it, in the man file tek2eepic.l. Tek2eepic could do with some polishing, but I have no time for that at present. The only major shortcoming of tek2eepic is that characters are not supported (blank spaces are printed instead). This is not a problem with plotting routines that actually plot the characters using the Tektronix plot primitives rather than printing them using fonts (one plotting package that plots the characters is "crc"). However, with some effort, it should be possible to modify tek2eepic to use standard LaTeX fonts. Any volunteers? Good Luck. And please inform me of any enhancements to tek2eepic. Atul Chhabra snail: internet: Dept. of Elec. & Comp. Engg. achhabra@ucesp1.ece.uc.edu Mail Locaton 030 or achhabra@uceng.uc.edu University of Cincinnati Cincinnati, OH 45221-0030. phone: (513)556-4766 ------------------------------------------------------------------------------- Date: Sat, 18 Mar 89 19:46 EST From: Subject: LaTeX: Problem with \figure/\ref Keywords: LaTeX, \figure/\ref \documentstyle{report} \begin{document} \chapter{Foo Bar} I seem to have a problem with \LaTeX\ and report.sty dated 26 April 88---the following sentence produces four ones instead of 1.1, 1.2, 1.3 and 1.4. Observe, gentle reader, the discrepancy in numbering of Figs.~\ref{fig1}, \ref{fig2}, \ref{fig3}, and \ref{fig4} below. My usage of \verb|\label| seems to follow the excellent \LaTeX\ manual---my profound apologies to Leslie Lamport if it does not. \begin{figure}[h] \label{fig1} \vspace{1in} %picture \caption{First} \end{figure} \begin{figure}[h] \label{fig2} \vspace{1in} %picture \caption{Second} \end{figure} \begin{figure}[h] \label{fig3} \vspace{1in} %picture \caption{Third} \end{figure} \begin{figure}[h] \label{fig4} \vspace{1in} %picture \caption{Fourth} \end{figure} \end{document} -------------------------------------------------------------------------- Date: 14 Mar 89 12:51:09 GMT From: uunet!cs.ruu.nl!piet@entropy.ms (Piet van Oostrum) Subject: Re: LaTeX -- \pagestyle{empty} leaves number on page 1 Keywords: LaTeX, \pagestyle{empty} This is a reply to a news article on USENET that I think is interesting for TeXhax readers, especially Leslie Lamport. In article <7319@boulder.Colorado.EDU>, hartzell@tigger (George Hartzell) writes: `In article , ben@ulrich (Ben Lotto) writes: `> `>I have been frustrated in my attempts to completely remove the page `>numbers from a document using LaTeX. When I try \pagestyle{empty}, as `>suggested by the manual, the first page is still numbered, although the `>subsequent pages seem to be fine. I tried putting the \pagestyle{empty} `>in various places, but to no avail. Can anyone enlighten me on this? ` `This can occur when you use the \maketitle command (not sure if this `is style dependent or not...) because it does a \thispagestyle{plain}. It is worse: Latex does a \thispagestyle{plain} in several places: 1. At the beginning of most document styles. 2. At the beginning of echa chapter, part, Index, etc. 3. At the titlepage. and maybe more. If you have a report or article style, no matter where you put the \pagestyle, the first page does have the \thispagestyle set, and the only way to get rid of it is to do another \thispagestyle{empty}. I consider this a bug in Latex. I think Latex should cancel a pending \thispagestyle whenever a \pagestyle is given. This does, however, not solve all problems, because at each chapter you will get the same problem. What actually is needed is a command to specify the ``default pagestyle for these cases'' Piet van Oostrum, Dept of Computer Science, University of Utrecht Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands Telephone: +31-30-531806. piet@cs.ruu.nl (mcvax!hp4nl!ruuinf!piet) -------------------------------------------------------------------------- Date: Fri, 17 Mar 89 16:25:53 +0100 From: uunet!cs.ruu.nl!piet@entropy.ms (Piet van Oostrum) Subject: General headers and footers in Latex documents Keywords: LaTeX, headers, footers Here is a documentstylestyle option that allows you to customize your page headers and footers in an easy way. It combines features that were separately available in other pagestyles, without introducing much complexity. You can define: - three-part headers and footers - rules in header and footer - headers and footers wider than \textwidth - multiline headers and footers - separate headers and footers for even and odd pages - separate headers and footers for chapter pages To use this pagestyle, you must include the ``fancyheadings'' style option in your \documentstyle, and issue the \pagestyle{fancy} command. The \pagestyle{fancy} command should be issued after any changes made to \textwidth. The page layout will be as follows: LHEAD CHEAD RHEAD ----------------------------------- (rule) page body ----------------------------------- (rule) LFOOT CFOOT RFOOT The L-fields will be leftadjusted, the C-fields centered and the R-fields rightadjusted. Each of the six fields and the two rules can be defined separately. Simple use: The header and footer fields can be defined by commands \lhead{LHEAD} and so on for the other fields. If the field depends on something in the document (e.g. section titles) you must in general use the \markboth and \markright commands, otherwise a title may end on the wrong page. You can do this e.g. by redefining the commands \chaptermark, \sectionmark and so on (see example below). The defaults for these marks are as in the standard pagestyles. The marks can be put into a header or footer field by referencing \leftmark and \rightmark. Rules in header and footer The thickness of the rules below the header and above the footer can be changed by redefining the length parameters \headrulewidth (default 0.4pt) and \footrulewidth (default 0). These may be redefined by the \setlength command. A thickness of 0pt makes the rule invisible. If you want to make more complicated changes, you have to redefine the commands \headrule and/or \footrule. Headers and footers wider than \textwidth The headers and footers are set in a box of width \headwidth. The default for this is the value of \textwidth. You can make it wider (or smaller) by redefining \headwidth with the \setlength or \addtolength command. The headers and footers will stick out the page on the same side as the marginal notes. For example to include the marginal notes, add both \marginparsep and \marginparwidth to \headwidth (see also the example below). Multiline headers and footers Each of the six fields is set in an appropriate parbox, so you can put a multiline part in it with the \\ command. It is also possible to put extra space in it with the \vspace command. Note that if you do this you will probably have to increase the \headheight or \footskip lengths. Separate headers and footers for even and odd pages If you want the headers and footers to be different on even- and odd-numbered pages in the ``twoside'' style, the field-defining macros can be given an optional argument, to be used on the even-numbered pages, like \lhead[EVEN-LHEAD]{ODD-LHEAD}. Separate headers and footers for chapter pages LaTeX gives a \thispagestyle{plain} command for the first page of the document, the first page of each chapter and a couple of other pages. It might be incompatible with your pagestyle. In this case you can use a slightly different version of the pagestyle, called \pagestyle{fancyplain}. This pagestyle redefines the pagestyle ``plain'' to also use pagestyle ``fancy'' with the following modifications: - the thicknesses of the rules is defined by \plainheadrulewidth and \plainfootrulewidth (both default 0). - the 6 fields may be defined separately for the plain pages by giving them the value \fancyplain{PLAIN-VALUE}{NORMAL-VALUE}. This construct may be used in both the optional argument and the normal argument. Thus \lhead[\fancyplain{F1}{F2}]{\fancyplain{F3}{F4}} specifies the LHEAD value in a two-sided document: F1 on an even-numbered ``plain'' page F2 on an even-numbered normal page F3 on an odd-numbered ``plain'' page F4 on an odd-numbered normal page. Defaults: \headrulewidth 0.4pt \footrulewidth 0pt \plainheadrulewidth 0pt \plainfootrulewidth 0pt \lhead[\fancyplain{}{\sl\rightmark}]{\fancyplain{}{\sl\leftmark}} % i.e. empty on ``plain'' pages \rightmark on even, \leftmark on odd pages \chead{} \rhead[\fancyplain{}{\sl\leftmark}]{\fancyplain{}{\sl\rightmark}} % i.e. empty on ``plain'' pages \leftmark on even, \rightmark on odd pages \lfoot{} \cfoot{\rm\thepage} % page number \rfoot{} Examples: To put two lines containing the section title and the subsection title in the righthandside corner, use: \documentstyle[fancyheadings]{article} \pagestyle{fancy} \renewcommand{\sectionmark}[1]{\markboth{#1}{}} \renewcommand{\subsectionmark}[1]{\markright{#1}} \rfoot{\leftmark\\\rightmark} The following definitions give an approximation of the style used in the LaTeX book: \documentstyle[fancyheadings]{book} \pagestyle{fancyplain} \addtolength{\headwidth}{\marginparsep} \addtolength{\headwidth}{\marginparwidth} \renewcommand{\chaptermark}[1]{\markboth{#1}{#1}} % remember chapter title \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} % section number and title \lhead[\fancyplain{}{\bf\thepage}]{\fancyplain{}{\bf\rightmark}} \rhead[\fancyplain{}{\bf\leftmark}]{\fancyplain{}{\bf\thepage}} \cfoot{} %______________________________CUT_HERE______________________________ % fancyheadings.sty version 1.0 % Fancy headers and footers. % Piet van Oostrum, Dept of Computer Science, University of Utrecht % Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands % Telephone: +31-30-531806. piet@cs.ruu.nl (mcvax!hp4nl!ruuinf!piet) % March, 1989. \def\lhead{\@ifnextchar[{\@xlhead}{\@ylhead}} \def\@xlhead[#1]#2{\gdef\@elhead{#1}\gdef\@olhead{#2}} \def\@ylhead#1{\gdef\@elhead{#1}\gdef\@olhead{#1}} \def\chead{\@ifnextchar[{\@xchead}{\@ychead}} \def\@xchead[#1]#2{\gdef\@echead{#1}\gdef\@ochead{#2}} \def\@ychead#1{\gdef\@echead{#1}\gdef\@ochead{#1}} \def\rhead{\@ifnextchar[{\@xrhead}{\@yrhead}} \def\@xrhead[#1]#2{\gdef\@erhead{#1}\gdef\@orhead{#2}} \def\@yrhead#1{\gdef\@erhead{#1}\gdef\@orhead{#1}} \def\lfoot{\@ifnextchar[{\@xlfoot}{\@ylfoot}} \def\@xlfoot[#1]#2{\gdef\@elfoot{#1}\gdef\@olfoot{#2}} \def\@ylfoot#1{\gdef\@elfoot{#1}\gdef\@olfoot{#1}} \def\cfoot{\@ifnextchar[{\@xcfoot}{\@ycfoot}} \def\@xcfoot[#1]#2{\gdef\@ecfoot{#1}\gdef\@ocfoot{#2}} \def\@ycfoot#1{\gdef\@ecfoot{#1}\gdef\@ocfoot{#1}} \def\rfoot{\@ifnextchar[{\@xrfoot}{\@yrfoot}} \def\@xrfoot[#1]#2{\gdef\@erfoot{#1}\gdef\@orfoot{#2}} \def\@yrfoot#1{\gdef\@erfoot{#1}\gdef\@orfoot{#1}} \newdimen\headrulewidth \newdimen\footrulewidth \newdimen\plainheadrulewidth \newdimen\plainfootrulewidth \newdimen\headwidth \newif\if@fancyplain \@fancyplainfalse \def\fancyplain#1#2{\if@fancyplain#1\else#2\fi} % Initialization of the head and foot text. \headrulewidth 0.4pt \footrulewidth\z@ \plainheadrulewidth\z@ \plainfootrulewidth\z@ \lhead[\fancyplain{}{\sl\rightmark}]{\fancyplain{}{\sl\leftmark}} % i.e. empty on ``plain'' pages \rightmark on even, \leftmark on odd pages \chead{} \rhead[\fancyplain{}{\sl\leftmark}]{\fancyplain{}{\sl\rightmark}} % i.e. empty on ``plain'' pages \leftmark on even, \rightmark on odd pages \lfoot{} \cfoot{\rm\thepage} % page number \rfoot{} % Put together a header or footer given the left, center and % right text, fillers at left and right and a rule. % The \lap commands put the text into an hbox of zero size, % so overlapping text does not generate an errormessage. \def\@fancyhead#1#2#3#4#5{#1\hbox to\headwidth{\vbox{\hbox {\rlap{\parbox[b]{\headwidth}{\raggedright#2\strut}}\hfill \parbox[b]{\headwidth}{\centering#3\strut}\hfill \llap{\parbox[b]{\headwidth}{\raggedleft#4\strut}}}\headrule}}#5} \def\@fancyfoot#1#2#3#4#5{#1\hbox to\headwidth{\vbox{\footrule \hbox{\rlap{\parbox[t]{\headwidth}{\raggedright#2\strut}}\hfill \parbox[t]{\headwidth}{\centering#3\strut}\hfill \llap{\parbox[t]{\headwidth}{\raggedleft#4\strut}}}}}#5} \def\headrule{{\if@fancyplain\headrulewidth\plainheadrulewidth\fi \hrule\@height\headrulewidth\@width\headwidth \vskip-\headrulewidth}} \def\footrule{{\if@fancyplain\footrulewidth\plainfootrulewidth\fi \vskip-0.3\normalbaselineskip\vskip-\footrulewidth \hrule\@width\headwidth\@height\footrulewidth\vskip0.3\normalbaselineskip}} \def\ps@fancy{ \let\@mkboth\markboth \@ifundefined{chapter}{\def\sectionmark##1{\markboth {\uppercase{\ifnum \c@secnumdepth>\z@ \thesection\hskip 1em\relax \fi ##1}}{}} \def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne \thesubsection\hskip 1em\relax \fi ##1}}} {\def\chaptermark##1{\markboth {\uppercase{\ifnum \c@secnumdepth>\m@ne \@chapapp\ \thechapter. \ \fi ##1}}{}} \def\sectionmark##1{\markright{\uppercase{\ifnum \c@secnumdepth >\z@ \thesection. \ \fi ##1}}}} \def\@oddhead{\@fancyhead\relax\@olhead\@ochead\@orhead\hss} \def\@oddfoot{\@fancyfoot\relax\@olfoot\@ocfoot\@orfoot\hss} \def\@evenhead{\@fancyhead\hss\@elhead\@echead\@erhead\relax} \def\@evenfoot{\@fancyfoot\hss\@elfoot\@ecfoot\@erfoot\relax} \headwidth\textwidth} \def\ps@fancyplain{\ps@fancy \let\ps@plain\ps@plain@fancy} \def\ps@plain@fancy{\@fancyplaintrue\ps@fancy} %______________________________CUT_HERE______________________________ Organization: Dept of Computer Science, University of Utrecht, Holland --------------------------------------------------------------------- Date: Mon, 13 Mar 89 19:18 EST From: "Jerry Leichter (LEICHTER-JERRY@CS.YALE.EDU)" Subject: Re: Computer Graphics and TeX -- A Challenge Keywords: graphics David Rogers proposes a set of basic graphics primitives. Tomas Rockiki and others correctly point out that there are some problems with this approach, both from the point of view of performance and ability to deal with different printer resolutions correctly, and so on. One approach is to standardize a set of \special's. However, then one faces the problem of getting those \special's implemented in the large and growing number of DVI drivers. There is a nice half-way approach, however, which I think has been overlooked too long. It's the technique that John Renner developed for his TeXtyl processor. TeXtyl supports most of the line-art drawing operations that Rockiki mentions (drawing lines, circles, ellipses, arbitrary splines, all at arbitrary or even varying thicknesses). It is DVI-driver independent, but not resolution independent. The clever trick it uses is as follows: You produce a DVI file containing TeXtyl \special's. You then apply the TEXTYL program to the file. It will read through all the DVI stuff, find its own \special's, calculate the graphic images specified, and replace the \special's with standard DVI operations to set the images. The result is a modified DVI file which any DVI driver can handle. TeXtyl uses a set of special "vector fonts", which consists of short line segments at a wide variety of angles, drawn with different pens. Because the fonts are only available at 300dpi, the program will only produce useful results at that resolution, but of course there is nothing preventing you from producing other vector fonts. Also, TeXtyl doesn't provide support for things like shading, but that could be added if someone was willing to do the work, using a set of "shading fonts" in place of the "vector fonts". (The "gray fonts" used to produce Metafont proofs would provide a good base for building such fonts from.) The images you get from TeXtyl are not ideal - there is more "jagginess" than there has to be. Much of this is an artifact of implementation decisions made a number of years ago, when printers had much less memory: Renner goes to a great deal of trouble to avoid sending too many different fonts and too many different characters to the printer. Today, the limits are much, much larger than they used to be. For many printers, you could probably get away with a "font" containing a single, single-pixel "character"; using that, you could portably specify any bitmap image. (Again, the techniques used in the "gray fonts" could be used to specify bitmaps much more efficiently, without any loss of power. I suspect any contemporary laser printer could handle any reasonable image specified in this way.) TeXtyl was an experiment for evaluating the technique, and I wouldn't recom- mend using the program as it stands for widespread adoption; but the technique itself is very powerful and very general, and deserves further examination. Jerry -------------------------------------------------------------------------- Date: Mon, 13 Mar 89 18:18:38 -0600 From: "J.D. McDonald " Subject: Graphics in Tex Keywords: graphics I would suggest a mechanism that will work now, and, presumably, would work better in the future: Come up with a subset of Postscript that would allow for the input of non-text graphics. Allow that to be included in the .dvi file, and standardize drivers so that real Postscript printers would send the commands on out, and install a suitable subset Postscript interpreter inside the driver to send appropriate commands out to the printer. Also, provide a text mechanism, inside the dvi driver for rotating text, in intervals of 90 degrees, by direct rotation of standard fonts. This would naturally be a bit of a problem on devices with non-square pixels - but, aren't all high quality devices (Laser printers and real typesetters) square? I am not very familiar with Postscript - would a guru consider this a reasonable proposal? Doug McDonald (mcdonald@uxe.cso.uiuc.edu) -------------------------------------------------------------------------- %%% 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 %%% %%% Concerning subscriptions, address changes, unsubscribing: %%% BITNET: send a one-line mail message to LISTSERV@UWAVM %%% SUBSCRIBE TEXHAX % to subscribe %%% or UNSUBSCRIBE TEXHAX %%% %%% All others: send a similar one line mail message to %%% TeXhax-request@cs.washington.edu %%% Please be sure you send a valid internet address!! %%% in the form name@domain or name%routing@domain %%% and use the style of the Bitnet one-line message, so that %%% we can find your subscription request easily. %%% %%% All submissions to: TeXhax@cs.washington.edu %%% %%% Back issues available for FTPing as: %%% machine: directory: filename: %%% JUNE.CS.WASHINGTON.EDU TeXhax/TeXhaxyy.nn %%% yy = last two digits of current year %%% nn = issue number %%% %%% For further information about TeX Users Group services and publications %%% contact Karen at KLB@SEED.AMS.COM or write to TUG at %%% TeX Users Group %%% P.O. Box 9506 %%% Providence, R.I. 02940-9506 %%% Telephone (401) 751-7760 %%% %%% Current versions of the software now in general distribution: %%% TeX 2.95 metafont 1.7 %%% plain.tex 2.94 plain.mf 1.0 %%% LaTeX 2.09 ( 8/10/88) cmbase.mf see cm85.bug %%% SliTeX 2.09 gftodvi 1.7 %%% tangle 2.9 gftopk 1.4 %%% weave 2.9 gftype 2.2 %%% dvitype 2.9 pktype 2.2 %%% pltotf 2.3 pktogf 1.0 %%% tftopl 2.5 mft 0.3 %%% BibTeX 0.99c dvipage 3.0 %%% AmSTeX 1.1d %%%\bye %%% End of TeXhax Digest ************************** -------