TeXhax Digest Thursday, March 24, 1988 Volume 88 : Issue 28 [SCORE.STANFORD.EDU]TEXHAX28.88 Editor: Malcolm Brown Today's Topics: Superscripted citations in LaTeX Re: .tfm files for Hewlett-Packard Series II laser printer Personal TeX's PTIPS won't work with PSFIG.TEX detecting current font Re: new bibtex man style TeXhax Digest V88 #24 Re: A problem with \immediate and \write in TeX generating tfm files for HP fonts question about very long tables LaTeX editing support in GNU Emacs Where's PXtoPK {\bf Version 2.3}?? LaTeX Notes (Re: TeXhax Digest V88 #23) Tex (?) previewer on a PC ---------------------------------------------------------------------- Date: Sat, 12 Mar 88 10:32:09 PST From: KARNEY%PPC.MFENET@NMFECC.ARPA Subject: Superscripted citations in LaTeX The following code is part of my aip (American Institute of Physics) style option: % (2) Superscript reference numbers in citation and bibliography. You % should put the references in the logically correct place, e.g., "... as % is given by Landau \cite{landau}. Next sentence ..." \cite takes care % of removing the preceding spaces and putting the reference after the % punctuation (e.g, "... Landau.$^7$ ..."). % (3) Three or more consecutive reference numbers are represented as a % range. Thus 1,3,4,5,6,8,9 is printed as 1,3--6,8,9. No sorting is % performed; i.e., 1,3,2 is printed as such. % (4) \citenum and \citea give you more control over the appearance of % the citations. \citenum emits the plain citation number without % ornament as in "... as shown in Ref.~\citenum{foo}.". \citea puts it's % argument into the ornamentation for citations. Thus \cite{foo} is % equivalent to \citea{\citenum{foo}}. \def\thebibliography#1{\par\clearpage\section*{References\@mkboth {REFERENCES}{REFERENCES}}\list {$\m@th^{\arabic{enumi}}$}{\settowidth\labelwidth{$\m@th^{#1}$}% \labelsep0pt\leftmargin\parindent \itemindent-\leftmargin\advance\itemindent\labelwidth \usecounter{enumi}} \def\newblock{\hskip .11em plus .33em minus -.07em} \sloppy \sfcode`\.=1000\relax} % Superscript citations -- skip optional arg to \cite % Move citation after period and comma. \def\@cite#1#2{\unskip\nobreak\relax \def\@tempa{$\m@th^{\hbox{\the\scriptfont0 #1}}$}% \futurelet\@tempc\@citexx} \def\@citexx{\ifx.\@tempc\let\@tempd=\@citepunct\else \ifx,\@tempc\let\@tempd=\@citepunct\else \let\@tempd=\@tempa\fi\fi\@tempd} \def\@citepunct{\@tempc\edef\@sf{\spacefactor=\the\spacefactor\relax}\@tempa \@sf\@gobble} % \citenum emits the plain citation number without ornament % \citea puts it's argument into the ornamentation for citations % thus \cite{foo} is equivalent to \citea{\citenum{foo}} \def\citenum#1{{\def\@cite##1##2{##1}\cite{#1}}} \def\citea#1{\@cite{#1}{}} % Collapse citation numbers to ranges. Non-numeric and undefined labels % are handled. No sorting is done. E.g., 1,3,2,3,4,5,foo,1,2,3,?,4,5 % gives 1,3,2-5,foo,1-3,?,4,5 \newcount\@tempcntc \def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi \@tempcnta\z@\@tempcntb\m@ne\def\@citea{}\@cite{\@for\@citeb:=#2\do {\@ifundefined {b@\@citeb}{\@citeo\@tempcntb\m@ne\@citea\def\@citea{,}{\bf ?}\@warning {Citation `\@citeb' on page \thepage \space undefined}}% {\setbox\z@\hbox{\global\@tempcntc0\csname b@\@citeb\endcsname\relax}% \ifnum\@tempcntc=\z@ \@citeo\@tempcntb\m@ne \@citea\def\@citea{,}\hbox{\csname b@\@citeb\endcsname}% \else \advance\@tempcntb\@ne \ifnum\@tempcntb=\@tempcntc \else\advance\@tempcntb\m@ne\@citeo \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}} \def\@citeo{\ifnum\@tempcnta>\@tempcntb\else\@citea\def\@citea{,}% \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else \def\@citea{--}\fi \advance\@tempcnta\m@ne\the\@tempcnta\@citea\the\@tempcntb}\fi\fi} Charles Karney Plasma Physics Laboratory Phone: +1 609 243 2607 Princeton University MFEnet: Karney@PPC.MFEnet PO Box 451 ARPAnet: Karney%PPC.MFEnet@NMFECC.ARPA Princeton, NJ 08543-0451 Bitnet: Karney%PPC.MFEnet@ANLVMS.Bitnet ------------------------------ Subject: Re: .tfm files for Hewlett-Packard Series II laser printer Date: Sat, 12 Mar 88 13:59:18 -0800 From: Jerry Sweet > I am using PCTEX and Arbortext's dvilaser/hp on a Compaq Portable III > and printing on a Hewlett-Packard Series II laser. If I purchase extra > fonts from HP, I need .tfm files. If you get the same DVILASER/HP software in Australia that we get here in the States, you should find that you get the .TFM files for the TMSRMN and HELV HP Soft Fonts along with the CM fonts. This doesn't help you if you want .TFM files for HP's other fonts, but it's a start. -jns ------------------------------ Date: Fri 11 Mar 88 13:57:06-PST From: Ted Shapin Subject: Personal TeX's PTIPS won't work with PSFIG.TEX Trevor Darrell in TEXHAX v.87 issue 5 (Jan. 87) talked about PSFIG.TEX, a TeX macro package he developed to include PostScript figures inside a TeX or LaTeX document. I have been using it with Arbortext's DVIPS on the IBM-PC until recently when we needed to include a postscript file with extended ASCII (high order bit on) characters. DVIPS reads the postscript file in 7-bit mode. Personal TeX's PTIPS will read the high order chars, unfortunately, PSFIG.TEX doesn't work with it. I get "Fatal error: Can not open file l" Apparently, the originator of pti's program isn't around anymore, an the people I've talked to aren't much help. As near as I can tell, psfig.tex brackets the postscript insert with ps::[begin] and ps::[end] which is to keep dvips from issuing saves and restores. I don't know if there is anything equivalent for PTIPS. Ted Shapin, Beckman Instruments, Fullerton, CA. ------------------------------ Date: Mon, 14 Mar 88 12:30 GMT From: Peter Flynn UCC Subject: detecting current font I want to be able to automate begin-double-quote and end-double-quote detection correctly (as partially implemented in the PC-WRITE-to-TeX translator). I can make " \active and do a \def"{mumble} OK, but if the user is using {\tt ...} at the time, you get 66 and 99 style quotes, which is normally wrong: in \tt you normally want the plain double-quote character. I have tried \if\the\font=\tentt\char'042\else [etc] \fi but although it reacts if I stick in a \message{\the\font} and displays \tentt correctly, I still get two single-open-quotes and two single-close-quotes in the output. Why does it not take my \if\the\font=\tentt as .true. when the user is in \tt ? Or have I misunderstood the nature of \if ? I tried it with \ifx and got the same result. Peter Flynn ------------------------------ Date: Mon 14 Mar 88 07:22:21-PST From: Oren Patashnik Subject: Re: new bibtex > From: rusty%velveeta.Berkeley.EDU@berkeley.edu (rusty wright) > Subject: new bibtex > > What a nasty program! Whenever I give it the wrong filename it > deletes all of my files! There is no code in BIBTEX.WEB that does anything remotely resembling file deletion, so clearly you have a system-specific problem. I suggest that you describe the problem in detail to the person who wrote the WEB change file for your system. --Oren Patashnik ------------------------------ Date: Tue, 15 Mar 88 10:00:08 pst From: Alex Woo Subject: man style Does anyone have TeX or LaTeX macros for something like UNIX(tm) man pages? Thanks. Alex Woo woo@pioneer.arc.nasa.gov ------------------------------ Date: Mon, 14 Mar 88 08:40:55 PST From: mackay@june.cs.washington.edu (Pierre MacKay) Subject: TeXhax Digest V88 #24 The NW computing Support Center (UnixTeX) has just received a large tape full of not one, but two versions of jTeX (lower-case j makes it jeneric). One is ASCII's version, and the other is NTT's. We are still working out how to unpack it and rearrange it. We will probably ask to put the change files on uunet, possibly the fonts too. We can also send out a copy of this tape under the same arrangements as are used for the UnixTeX distribution. The software comes with a warning that it is still under construction, and we haven't entirely unravelled the fonts question yet, but things are moving along. Any mf sources we can find will be put out into FTP land as soon as we can extract them intelligently. Pierre A. MacKay TUG Site Coordinator for Unix-flavored TeX ------------------------------ Date: Mon, 14 Mar 88 17:04:02 GMT From: JCB7%phoenix.cambridge.ac.uk@NSS.Cs.Ucl.AC.UK Subject: Re: A problem with \immediate and \write in TeX The way I dealt with this problem in my dissertation last year was: My \section etc. commands took an additional parameter which was a control sequence name, generated the section number, and \def'd the name to be the section number (in text form). Whenever I wanted to refer to a section, I referred to the control sequence name for it, so I never had to worry about numbering in the source. The section macro also wrote out to an auxiliary file (\immediate ly, to get the section number right) the \def\sectionname{sectionnumber} command, and wrote out to the contents file a suitable entry, _using the control sequence name_ (non-\immediate ly, to get the page number right). Then to process the table of contents, all I had to do was read in the \def's of the section names, and read the contents file. Hope that helps; if you want to see my macros, drop me a note and I'll send them. Julian Bradfield JCB7@PHX.CAM.AC.UK (and also jcb@lfcs.ed.ac.uk) ------------------------------ Date: Mon, 14 Mar 88 12:27:24 EST From: cww@mathvax.msi.cornell.edu (Clarence Wilkerson) Subject: generating tfm files for HP fonts I recently downloaded from GENIE "HP2TEX.ARC", a utility that generates from an HP softfont a PL font(use PLtoTF to produce TFM file) and a PXL pixel file. The program is written in Turbo Pascal 3.0 by David Strip and D.L. Vulisassisting. GENIE also has several sets of free soft fonts for the HP, including Roman, Helvetica, Optimus, and Cenxxxxx generated by the glyfix(sic) program. I have used these with success with MS WORD. I would like a converse to the program, one which would produce soft fonts for the HP from TeX fonts. One that would do it on the fly as the fonts are downloaded to the printer would be even nicer, since "PK" fonts are a factor of 2 or 3 smaller than the soft fonts. Clarence Wilkerson, Dept. Math. Cornell University ------------------------------ Date: Mon, 14 Mar 88 15:19:11 EST From: sundar@wheaties.ai.mit.edu (Sundar Narasimhan) Subject: question about very long tables Hi: I have tables with a large number of entries in them (more than a couple of pages long). What I would like to have is a table or tabular environment in LaTeX that would take a count of how many entries should be on a page, and a specification for the header entry that gets automatically inserted at the top of every new page. I'd appreciate knowing if anyone else has run into this problem, and if they managed to hack up a solution. Or is there an obvious way for doing this? Thanks, -Sundar ------------------------------ Date: Mon 14 Mar 88 14:02:45-MST From: "Nelson H.F. Beebe" Subject: LaTeX editing support in GNU Emacs Based on my original LaTeX TECO library for TOPS-20 Emacs, I have prepared a powerful extended version for GNU Emacs, which runs on most varieties of Unix, as well as on VAX VMS. Some of you have seen our Local LaTeX Guide which describes my original Emacs LaTeX support. I am seeking a limited number of beta testers who would like to exercise the library and send me their comments and bug reports; volunteers should send mail to me directly (beebe@science.utah.edu). Distribution will be via electronic mail only. At the completion of the beta test (in perhaps 2 months), I plan to submit the library to the GNU Project for inclusion in the standard Emacs distribution, as well as make it available for the standard TeX distributions. The new version currently amounts to 2115 lines of Lisp code, more than twice the size of the original TECO version (977 lines). It includes support for virtually ALL the LaTeX macros in the LaTeX Users Manual, including knowing what arguments they take. There are also functions for support of SLiTeX. A copy of the LaTeX-mode description follows: ======================================================================== LaTeX-mode: Major editing mode for LaTeX, with tex-mode underneath. To create a new LaTeX document, use M-X make-LaTeX-document (on C-c d). With an argument, it will provide some additional helpful comments. It will prompt for document style and options. Type ? to see the standard ones; you can enter them with name completion. You can also enter your own, since it is possible to have private styles and options unknown to make-LaTeX-document. The most frequent LaTeX construct is the \begin{}...\end{} grouping; you can generate it by LaTeX-begin-end-block (on C-c b). With an argument, a helpful comment may be printed. Type ? to see the standard environments, or enter your own. Other common constructs are the insertion of labels, citations, cross-references, index entries, verbatim strings, and additional items in a list. The functions C-c . LaTeX-add-word-to-index C-c c LaTeX-cite C-c f LaTeX-footnote C-c i LaTeX-index C-c t LaTeX-item C-c t LaTeX-item C-c l LaTeX-label C-c m LaTeX-macro C-c p LaTeX-pageref C-c r LaTeX-ref C-c v LaTeX-verb C-c d make-LaTeX-document provide for these. Most major LaTeX macros can be entered by LaTeX-macro (on C-c m). This will supply the correct set of following braces, brackets, and parentheses, and with an argument, will insert a short comment about the expected command arguments. You can move over \begin{} ... \end{} groups with LaTeX-to-begin (on C-c a) and LaTeX-to-\end (on M-x LaTeX-to-\end). Insertion of paired braces, braces, and parenthesis is provided by C-c { LaTeX-insert-braces C-c [ LaTeX-insert-brackets C-c ( LaTeX-insert-parentheses With an argument, these insert backslash prefixes for literal braces, math mode, and displaymath mode. Unbalanced character pairs are found by C-c } LaTeX-check-brace-balance C-c ] LaTeX-check-bracket-balance C-c ) LaTeX-check-parenthesis-balance You can test for undefined labels with check-LaTeX-labels, and display the labels and their line numbers with show-LaTeX-labels. Environment nesting errors can be caught by check-LaTeX-nesting. Use indent-LaTeX-\begin{}-\end{}-groups to get nested environments nested for improved visibility. Please report bugs, comments, and enhancements by e-mail to Beebe@science.utah.edu (Internet) LaTeX-gripe (on M-x LaTeX-gripe) makes this easier. ------------------------------ Date: Mon, 14 Mar 88 15:46 EST From: Subject: Where's PXtoPK {\bf Version 2.3}?? Foo. There I was in a state of modified rapture, having gotten PXtoPK.WEB from LISTSERV@TAMVM1.bitnet, thinking all I needed was a VAX/VMS change file, and then I notice what I have is Version 2.2. The one that contains what's described as a serious bug. (1) Philosophical question: I asked before why LISTSERV@TAMVM1 is missing so many files. Now I have to ask, why are they distributing buggy versions of the few files they've got? (2) Practical question: How do I get Version 2.3 of PXtoPK for VAX/VMS through Bitnet? We can't do FTP. Richard S. Holmes Phone: (315)423-3891 or Physics Department -2701 Syracuse University BITNET: Rich@SUHEP Syracuse, NY 13244 ------------------------------ Date: Mon, 14 Mar 88 13:33:49 PST From: lamport@src.dec.com (Leslie Lamport) Subject: LaTeX Notes (Re: TeXhax Digest V88 #23) John Lee writes: How would one go about limiting the textheight on a given page only? The Latex manual states \textheight can only be set in the preamble, making the textheight the same for the entire document. The way porcupines make love--carefully. After outputting a page, the \output routine uses \textheight to set TeX's \vsize parameter. If there are no figures on the page, you could probably set \textheight and \vsize at the appropriate places and get the right things to happen. You'd have to look at LaTeX's output routine to figure out exactly what to do. However, there's probably an easier solution, which depends upon exactly what you're trying to do. For example, to the naive reader, a page that has three vertical inches less text looks very much like an ordinary page that has a three-inch tall blank figure at the bottom. John Sotos writes The common form of LaTeX citations is: ... the study by Smith et al [5]. I would like: ... the study of Smith et al.5 with the '5' superscripted a la a footnote. Footnotes would, in turn, rely on * and **. Any suggestions? Note that it may be difficult to switch from one format to another, since in the first case \cite precedes the . and in the second case it would, I assume, follow the period. Changing the \cite command to produce ^{5} instead of [5] is a fairly simple change to the document style, and browing through latex.tex(?) for the definition of \cite should reveal how to do it. However, like all style file hacking, you have to know something about raw TeX--e.g., about what you'd learn from a quick, cursory reading of the TeXbook. I would not recommend trying to write a macro that effectively converts "\cite{foo}." to ".\cite{foo}". While it may be possible to hack something that works much of the time, there are undoubtedly enough exceptional cases that searching for where it screws up would be as time consuming as doing the conversion manually. Tom Schneider writes: I am required by a publisher to double space my text. I have several figures that contain text strings, and I must leave these single spaced. So I used \renewcommand{\baselinestretch}{2} to get double spacing, but I discovered to my horror that I can't turn it on and off for my figures! That is, latex insists on doing double space figures after a \renewcommand{\baselinestretch}{1} command. How do I do this? From the index double spacing, 155 From page 155 \baselinestretch ... The value of \baselineskip is set by \begin{document} and by each type-size changing command^{2} to its default value times \baselinestretch. --- ^{2} However, a \normalsize command does not change \baselineskip when a \normalsize declaration is in effect. This implies that the sequence \small \renewcommand{\baselinestretch}{1} \normalsize right after the \begin{figure} should work. Leslie Lamport ------------------------------ Date: Mon, 14 Mar 88 22:33:43 CST From: amit@umn-cs.cs.umn.edu (Neta Amit) Subject: Tex (?) previewer on a PC Ken, You've inquired about non-proprietary previewers for TeX. I can't add much to this category. But I can report on a "non-traditional TeX previewer" that TeX users might be interested in. Beware, though, that my impression is preliminary. I'm talking about SoftJet, a HP-Laserjet Plus simulator that runs on IBM-PC family of computers. It has nothing to do with TeX, except that it will take a .dvi file filtered for the LJ+ (as well as any other LJ+ input) and display it on a screen. Did I say "simulator"? Yes, and a VERY FAST one. Each (text) page takes about 1-2 seconds to display. Obviously, 300dpi is pretty hard to display on a low-res display. It can be done either by compression, or by presenting part of the page at any one time. SoftJet does both. You get 300dpi, for outline. You can't read anything, but you can get some rough idea how your page is going to look like. Then you can choose a section, and display it at either 150dpi or at 75 dpi, depending on the level of detail you need. On standard or enhanced EGA (enhanced= 640x480 pixels), things look quite ok. Not great, but ok. I hate the user interface. The Outline window is always there, taking .25 of the screen. Some area is dedicated to a menu-line. The rest is for the big window, which means that it's pretty small. You may guess that when you want a different section, you have to indicate it on the Outline window. Distracting, annoying, and limiting the functionality. The interpretation appears to be accurate. They (a company in Vancouver, BC) claim that all PCL commands are supported, and I tend to believe them. In the case of TeX, where soft characters are loaded, there are no problems with fonts. If a package is using HP fonts (including those on cassettes), SoftJet needs equivalent font files built for the PC. The product comes with only a few fonts. The rest must be purchased separately. Again, for TeX (and the DVIJEP driver that I'm using), this is a non-issue. (By the way, Nelson, the version of DVIJEP that I'm using is not bug-free.) All things considered, - the approach is interesting - the implementation is very efficient - the previewer is acceptable - the cost is reasonable ($120) If there are TeXhax readers that have any dealings with Theta Systems Corp. of Vancouver, you can pass my initial impression on to them. I'd also be interested to hear different experiences. Cheers, --Neta Amit, U of Minn. Csci amit@umn-cs.cs.umn.edu ------------------------------ %%% %%% subscriptions, address changes to: texhax-request@score.stanford.edu %%% please send a valid arpanet address!! %%% %%% BITNET distribution: subscribe by sending the following %%% line to LISTSERV@TAMVM1.BITNET: %%% SUBSCRIBE TEX-L %%% %%% submissions to: texhax@score.stanford.edu %%% %%%\bye %%% ------------------------------ End of TeXhax Digest ************************** -------