TeXhax Digest Friday, December 9, 1988 Volume 88 : Issue 107 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: Query: how do you get the Czech long u (circle over a u)? TeX/METAFONT VMS installation procedure TeX question re: alignment of additional text in EQNARRAY A problem with pictures in LaTeX ?? TeXhax Digest V88 #104 (Possible LaTeX bug) Separate chapter bibliographies with LaTex & BibTeX Bibliography converter ---------------------------------------------------------------------------- Date: Wed, 23 Nov 88 12:24:13 -0800 From: kelem@aerospace.aero.org Subject: Query: how do you get the Czech long u (circle over a u)? In TeX, one can type \aa to get the Danish a (a circle over the a) and \AA to get the Danish A (a circle over the A). How do you get the Czech long u (circle over a u)? Steve Kelem internet: kelem@aerospace.aero.org uucp: ...!sdcrdcf!aero!kelem or: ...!trwrb!aero!kelem --------------------------------------------------------------------------- Date: Thu, 1 Dec 88 21:56:43 PST From: zar@XHMEIA.Caltech.Edu (Daniel M. Zirin) Subject: TeX/METAFONT VMS installation procedure Keywords: TeX, METAFONT, VMS I'm almost finished with a command procedure for VMS to recompile all sources, generate MF bases and TeX formats, and selectively generate font files at various sizes and for various printers. Is anyone else interested in such a beast. Once its finished, I'll probably make a VMSINSTAL kit for PD VMS TeX as well and submit it to DECUS. The Great Zar Security Pacific Bank Zar Limited ---------------------------------------------------------------------------- Date: Thu, 1 Dec 88 12:20:47 PST From: chase#lila%c.mfenet@NMFECC.ARPA Subject: TeX question re: alignment of additional text in EQNARRAY Keywords: TeX, LaTeX A user has had a need for alignment of additional text in EQNARRAY. Since only 3 columns are provided by that environment, a TeX user here suggested that he do the equations in TeX using HALIGN. SETCOUNTER could be used to set the EQUATION counter properly. However, the user also has LABEL's attached to these equations. We looked in the definition for EQNARRAY and tried adding the following coding: \stepcounter{equation} \catcode`\@=11 \let\@currentlabel=\theequation \catcode`\@=12 before each equation labelled. However, it appeared to have no effect, using the previous label for the four equations done in TeX. The equation counter was updated correctly after EQNARRAY though. I saw a comment about \refstepcounter{equation}, so tried that. It also has no effect inside the HALIGN. However, when I moved it outside the HALIGN, it had the desired effect. Would appreciate any light you can shed on this topic and any suggestions as to how we can get this to work. Thank you. ------------------------------------------------------------------------------- Date: Thu, 1 Dec 88 17:22:07 MST From: maccabe@unmvax.unm.edu (Barney Maccabe) Subject: A problem with pictures in LaTeX ?? Keywords: LaTeX % My apologies if this has already been reported and discussed at % length, but I ran into a problem using the picture stuff in latex. % It may be a misunderstanding on my part, or a bug in the implementation % I am using. Here are the facts: % I am using Common TeX, Version 2.9 (preloaded format=lplain 88.8.17) % LaTeX Version 2.09 <3 Jan 1988> % Document Style `article' <12 Oct 87> % Thanks for looking at it. \documentstyle{article} \begin{document} % We're going to draw the following picture % | 0 | \newcommand{\mylinesone}{ \begin{picture}(16,10) \put(0,0){\line(0,1){10}} \put(8,5){\makebox(0,0){0}} \put(16,0){\line(0,1){10}} \end{picture} } % a simple macro to draw a vertical line \newcommand{\myline}{ \begin{picture}(0,10) \put(0,0){\line(0,1){10}} \end{picture} } % We draw the same picture using the macro defined above % this SHOULD look like the first one, but it looks more like % |0 | % Why? \newcommand{\mylinestwo}{ \begin{picture}(16,10) \put(0,0){\myline} \put(8,5){\makebox(0,0){0}} \put(16,0){\myline} \end{picture} } % Let's try some inline expansion -- this one seems to work correctly \newcommand{\mylinesthree}{ \begin{picture}(16,10) \put(0,0){\begin{picture}(0,10)\put(0,0){\line(0,1){10}}\end{picture}} \put(8,5){\makebox(0,0){0}} \put(16,0){\begin{picture}(0,10)\put(0,0){\line(0,1){10}}\end{picture}} \end{picture} } % Now, let the subpicture position itself -- this one also works % This I view as a reasonable work around for the current situation. \newcommand{\mylinetwo}[2]{ \put(#1,#2){\begin{picture}(0,10) \put(0,0){\line(0,1){10}} \end{picture}} } \newcommand{\mylinesfour}{ \begin{picture}(16,10) \mylinetwo{0}{0} \put(8,5){\makebox(0,0){0}} \mylinetwo{16}{0} \end{picture} } \begin{picture}(16,70) \put(0,60){\mylinesone} \put(0,40){\mylinestwo} \put(0,20){\mylinesthree} \put(0,0){\mylinesfour} \end{picture} \end{document} ----------------------------------------------------------------------------- Date: Wed, 30 Nov 88 09:12:36 PST From: lamport@src.dec.com (Leslie Lamport) Subject: Re: TeXhax Digest V88 #104 (Possible LaTeX bug) Keywords: LaTeX The anomaly reported by Johannes Braams has a rather obscure cause, the details of which are of little interest to the sane LaTeX user. The general manifestation of the anomaly is the following: If a command such as \index or \label that generates no output appears after a space in the middle of a paragraph, and the next \end command does not end a paragraph, then a space following the \end is suppressed. Since most \end commands end a paragraph, this is unlikely to cause a problem. The anomaly results from a little piece of code that makes no sense to me now, but that I obviously put in for some reason that I now forget. I may eventually remove that code and wait for bug reports to remind me why it's there, but there seems to be no rush. The particular example does not bother me because it is pretty flakey. It is a bad idea to depend upon TeX's line-breaking algorithm to get lines broken exactly where you want them. That's why LaTeX has a \\ command. Bill Alford's problem with \left( \begin{array}[t]... has been dealt with before in TeXHaX. If you realize that delimiters like parentheses are vertically centered at the center line of the equation (the place where an "=" would go), and think about where an array with the [t] option should be positioned relative to this center line, you'll see that LaTeX is doing exactly what it's supposed to do. The solution depends upon exactly what the desired result is. (In the fragment given, the [t] option serves no purpose and removing it produces what I presume is the desired result; but I suppose Alford just extracted the array from a larger example.) Perhaps the \raisebox command will be of some use to him. Leslie Lamport ----------------------------------------------------------------------------- Date:29-NOV-1988 15:47:32 GMT From: RM028A%cdvc.cranfield.ac.uk@NSS.Cs.Ucl.AC.UK Subject: Separate chapter bibliographies with LaTex & BibTeX Keywords: LaTeX, BibTeX As a new subscriber to TeXhax, I've been browsing through the back issues and I've noticed a few requests for a LaTeX style file which will allow separate BibTeX bibliographies in each chapter. I had a similar requirement, so here's the `chapterbib' style file! The style will allow multiple bibliographies with the correct citation numbers and no interference between bibliographies. There are of course some restrictions: 1. The \bibliography and \bibliographystyle commands may not be used in the root file, only in files that have been \include'd. If you try to use them, a LaTeX warning is issued and the offending command(s) ignored. This restriction occurs because the root .aux file includes the subsidiary .aux files and when BibTeX processes the root .aux file, it complains about multiple \bibdata commands. 2. If you want to \cite in the root file, you must provide your own bibliography within the root file using the thebibliography environment. I don't suppose that this will appeal to BibTeX users! 3. The subsidiary files must be \include'd (not \input'ed) by the root file, with only one bibliography per \include'd file. 4. The style file works by redefining the \bibcite, so if you've got any other style files that use \bibcite, watch out! The only style files (that I've seen) with \bibcite in them are deproc.sty, ctswan.sty & ipr.sty. Apart from these restrictions (which are easily overcome), I've tested chapterbib.sty on several documents with in-chapter bibliographies and common references and all appears to be OK. No doubt other people will find some (more) errors that I didn't anticipate, but I'd be happy to try to fix them. NOTE: I tried to send an earlier version of chapterbib.sty to TeXhax, but as I haven't seen it, I can only assume that it was swallowed by CUNYVM. That version was faulty, so perhaps it was a blessing in disguise! C. Niel KEMPSON %%%Moderators note: The faulty version appeared in Issue 104 of the TeXhax %%%Digest. .----------------------------------------------------------------------------. | Slow (but reliable) Mail: | Telephone: Swindon (0793) 785687 | | School of Elec Eng & Science, | International: +44-793-785687 | | Royal Military College of Science,| | | Shrivenham, SWINDON, | E-mail | | SN6 8LA, | JANET: rmcs-tex@uk.ac.cranfield.cdvc | | United Kingdom | | `----------------------------------------------------------------------------' CHAPTERBIB.STY follows: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CUT HERE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< %========================================================================== % chapterbib.sty Version 1.0 (23-NOV-1988) % ~~~~~~~~~~~~~~ % Allow multiple bibliographies in a LaTeX document, including items % \cite'd in more than one bibliography. % % Restrictions % ~~~~~~~~~~~~ % % 1. The \bibliography and \bibliographystyle commands may not be used % in the root file, only in files that have been \include'd. If you % try to use them, a LaTeX warning is issued and the offending % command(s) ignored. This restriction occurs because the root .aux % file includes the subsidiary .aux files and when BibTeX processes % the root .aux file, it complains about multiple \bibdata commands. % % 2. If you want to \cite in the root file, you must provide your own % bibliography within the root file using the thebibliography % environment. I don't suppose that this will appeal to BibTeX users! % % 3. The subsidiary files must be \include'd (not \input'ed) by the root % file, with only one bibliography per \include'd file. % % 4. The style file works by redefining the \bibcite, so if you've got % any other style files that use \bibcite, watch out! The only style % files (that I've seen) with \bibcite in them are deproc.sty, % ctswan.sty & ipr.sty. % % Author % ~~~~~~ % Niel Kempson | Telephone: Swindon (0793) 785687 % School of Elec Eng & Science, | International: +44-793-785687 % Royal Military College of Science, | % Shrivenham, SWINDON, | E-mail: % SN6 8LA, | JANET: rmcs-tex@uk.ac.cranfield.cdvc % United Kingdom | %========================================================================== \let\@debugoutput=\@gobble % %************************************************************************* % DEBUGGING MACROS. To see what global variables are being assigned and % tested, uncomment these lines. % % % \let\@debugoutput=\typeout % \def\@debugnamedef#1#2{\expandafter\def\csname #1\endcsname{#2}% % \@debugoutput{\string\@debugnamedef: defined `#1' \space as `#2'}} % \def\@debugtestdef #1#2#3{% % \@debugoutput{\string\@debugtestdef: testing whether `#1@#2' = `#3'} % \def\@tempa{#3}\expandafter \ifx \csname #1@#2\endcsname% % \@tempa \else \@tempswatrue \fi} % \def\@debugbibtestdef #1#2#3#4{% % \@debugoutput{\string\@debugbibtestdef: testing whether `#1@#2@#4' % % = `#3'} % \def\@tempa{#3}\expandafter \ifx \csname #1@#2@#4\endcsname% % \@tempa \else \@tempswatrue \fi} % \let\@testdef=\@debugtestdef % \let\@bibtestdef=\xbibtestdef % \let\@namedef=\@debugnamedef % %************************************************************************* % %------------------------------------------------------------------------- % Keep track of files currently opened. % 1. The counter @ipfilectr keeps track of the currently open I/P file, % and @includefilectr keeps track of the \include files. % 2. @ipfilectr is set to @includefilectr, except when processing the root % file. An arbitrary large (number greater than the maximum number of % include files) is used to denote the root file. %------------------------------------------------------------------------- \newcounter{@ipfilectr} % current I/P file, \def\the@ipfilectr{\roman{@ipfilectr}} % displayed as roman numerals \newcounter{@includefilectr} % current \include file \def\@rootfilevalue{1988} % arbitrary value for root file \def\savedjobname{\jobname} % save root file name as a macro % %----------------------------------------------------------------------- % The name of the current I/P file is stored in macro \@currentipfile % and the global macro ipfile@the@ipfilectr is set to this name whenever % \@currentipfile changes. %----------------------------------------------------------------------- \def\@currentipfile{\jobname} % initialize to root file \setcounter{@ipfilectr}{\@rootfilevalue} % ditto \global\@namedef{ipfile@\the@ipfilectr}{\@currentipfile} % %----------------------------------------------------------------------- % Redefine the \include macro (taken from LATEX.TEX of 25-JAN-1988) so % that when a file is \include'd % 1. \@currentipfile is updated and \includefilectr incremented % 2. ipfilectr set to includefilectr % 3. global macro ipfile@\the@ipfilectr set to \@currentfile % % When the \include'd file is finished with % 1. reset \@currentipfile to the root file name (\jobname) % 2. reset ipfilectr to \@rootfilevalue % 3. global macro ipfile@\the@ipfilectr set to \@currentfile %----------------------------------------------------------------------- \def\include#1{\clearpage \def\@currentipfile{#1} \@debugoutput{\string\@currentipfile = `\@currentipfile'} \addtocounter{@includefilectr}{1} \setcounter{@ipfilectr}{\value{@includefilectr}} \global\@namedef{ipfile@\the@ipfilectr}{\@currentipfile} % \if@filesw \immediate\write\@mainaux{\string\@input{#1.aux}}\fi \@tempswatrue\if@partsw \@tempswafalse\def\@tempb{#1}\@for \@tempa:=\@partlist\do{\ifx\@tempa\@tempb\@tempswatrue\fi}\fi \if@tempswa \if@filesw \let\@auxout=\@partaux \immediate\openout\@partaux #1.aux \immediate\write\@partaux{\relax}\fi\@input{#1.tex}\clearpage \@writeckpt{#1}\if@filesw\immediate\closeout\@partaux \fi \let\@auxout=\@mainaux\else\@nameuse{cp@#1}\fi % \def\@currentipfile{\jobname} \@debugoutput{\string\@currentipfile = `\@currentipfile'} \setcounter{@ipfilectr}{\@rootfilevalue} \global\@namedef{ipfile@\the@ipfilectr}{\@currentipfile}} % %------------------------------------------------------------------------- % **************************************** % * BIBLIOGRAPHY * % **************************************** % % A bibliography is created by the bibliography environment, which % generates a title such as ``References'', and a list of entries. The % BIBTeX program will create a file containing such an environment, which % will be read in by the \bibliography command. With BIBTeX, the % following commands will be used. % % CONVENTION % % \b@FOO@ipfile@iv : The name or number of the reference created by % \cite{FOO} in \include file iv % e.g. if in the 4th \include file, \cite{FOO} -> [17], % then \b@FOO@ipfile@iv -> 17. %------------------------------------------------------------------------- % %------------------------------------------------------------------------- % \bibcite is now defined as: \bibcite{LABEL}{VALUE}{IPFILECTR}, so make % the \bibitem & \bibiteml commands output the extra parameter. %------------------------------------------------------------------------- \def\@lbibitem[#1]#2{\item[\@biblabel{#1}]\if@filesw { \def\protect##1{\string ##1\space}\immediate \write\@auxout{\string\bibcite{#2}{#1}{\the@ipfilectr}}}\fi\ignorespaces} %% Placement of `}' in def of \@lbibitem corrected 29 Apr 87 %% (Error found by Arthur Ogawa.) \def\@bibitem#1{\item\if@filesw \immediate\write\@auxout {\string\bibcite{#1}{\the\c@enumi}{\the@ipfilectr}}\fi\ignorespaces} \def\bibcite#1#2#3{{\global\@namedef{b@#1@#3}{#2}}} \def\cite{\@ifnextchar [{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}} % % \penalty\@m added to definition of \@citex to allow a line % break after the `,' in citations like [Jones80,Smith77] % (Added 23 Oct 86) % % space added after the `,' (21 Nov 87) % \def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi \def\@citea{}\@cite{\@for\@citeb:=#2\do {\@citea\def\@citea{,\penalty\@m\ }% \@debugoutput{\string\@citex: testing whether `b@\@citeb @\the@ipfilectr'% is defined.}% \@ifundefined {b@\@citeb @\the@ipfilectr}{{\bf ?}\@warning {Citation `\@citeb' in file `\@nameuse{ipfile@\the@ipfilectr}' % on page \thepage \space undefined}}% \hbox{\csname b@\@citeb @\the@ipfilectr\endcsname}}}{#1}} % %------------------------------------------------------------------------- % We don't allow \bibliography and \bibliographystyle commands in the root % file, so warn and ignore if appropriate. %------------------------------------------------------------------------- \def\bibliographystyle#1{% \ifx\@currentipfile\savedjobname \@warning{\string\bibliographystyle \space commands in the root file % are ignored ^^Jby the `chapterbib' style option.} \else \if@filesw\immediate\write\@auxout{\string\bibstyle{#1}}\fi \fi} \def\bibliography#1{% \ifx\@currentipfile\savedjobname \@warning{\string\bibliography \space commands in the root file % are ignored ^^Jby the `chapterbib' style option.} \else \if@filesw\immediate\write\@auxout{\string\bibdata{#1}}\fi \@input{\@currentipfile.bbl}\fi} % %------------------------------------------------------------------------- % All we need to do now is to redefine \enddocument so that it properly % checks whether the \cite labels have changed. %------------------------------------------------------------------------- \def\enddocument{\@checkend{document}\clearpage\begingroup \if@filesw \immediate\closeout\@mainaux \def\global\@namedef##1##2{}\def\newlabel{\@testdef r}% \def\bibcite{\@bibtestdef b}\@tempswafalse \makeatletter\input \jobname.aux \if@tempswa \@warning{Label(s) may have changed. Rerun to get cross-references right}\fi\fi\endgroup\deadcycles\z@\@@end} \def\@bibtestdef #1#2#3#4{% \def\@tempa{#3}\expandafter \ifx \csname #1@#2@#4\endcsname% \@tempa \else \@tempswatrue \fi} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CUT HERE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ----------------------------------------------------------------------------- Date: Wed, 30 Nov 1988 16:22:58 PST From: Peter Karp Subject: Bibliography converter Keywords: LaTeX You may find the following tool useful. I do not read this list and am new to Latex so if something better already exists I would be interested to hear about it. ;;;; ;;;; Converts a bibliography (.BIB) file in Scribe format to BibTeX format. ;;;; GNUemacs lisp code. ;;;; ;;;; Peter Karp -- karp@sumex-aim.stanford.edu -- Nov 1988 ;;;; ;;;; Please send bugs, suggetions, improvements to the above address. ;;;; ;;;; To execute, visit the bibiligraphy file to be converted, then: ;;;; m-X load-file cnvtbib ;;;; m-X eval-expression (cvbib) ;;;; ;;;; BUGS: ;;;; ;;;; BibTex will complain if author names are not separated by ;;;; "and"; this converter does not add necessary "and"s. BibTex ;;;; will also complain if names are separated by ", and". This ;;;; converter does remove these commas. (defun cvbib () (let (dpos) (beginning-of-buffer) ; First modify all entries so that the delimiters used for the entry ; are "{}". So we'd convert @book< ... > to @book{ ... } (while (search-forward "@" nil t) (progn (forward-word 1) (setq dpos (point)) (goto-matching-delimiter) (backward-delete-char 1) (insert-string "}") (goto-char dpos) (delete-char 1) (insert-string "{") )) (beginning-of-buffer) ; Now convert all key fields from, e.g., AUTHOR= to AUTHOR="PKARP" ; Note that some key fields aren't delimited by anything, which is ok but ; requires a special check in the code below. (while (search-forward "=" nil t) (progn (while (search-forward " " (+ 1 (point)) t) nil) (if (assoc (point-char) all_delims) (progn (setq dpos (point)) (goto-matching-delimiter) (backward-delete-char 1) (insert-string "\"") (goto-char dpos) (delete-char 1) (insert-string "\"") )) )) (beginning-of-buffer) ;;;; Change all ", AND" within AUTHOR and EDITOR strings to " AND" ;;;; because BibTex complains about the former. (while (re-search-forward "AUTHOR\\s-*=\\s-*" nil t) (setq dpos (point)) (goto-matching-delimiter) (while (re-search-backward ",\\s-*AND" dpos t) (delete-char 1)) ) (beginning-of-buffer) (while (re-search-forward "EDITORS\\s-*=\\s-*" nil t) (setq dpos (point)) (goto-matching-delimiter) (while (re-search-backward ",\\s-*AND" dpos t) (delete-char 1)) ) (beginning-of-buffer) ) ) ;;;; ;;;; Goes to the character in the buffer which closes the Scribe delimiter ;;;; where (point) is when this function is called. I.e., if the buffer is ;;;; "@book< foo >bar" and we're called with point at "<", we'll leave ;;;; point at the "b" of "bar". ;;;; (setq all_delims '(("<" . ">") ("[" . "]") ("\"" . "\"") ("(" . ")") ("{" . "}"))) (defun goto-matching-delimiter () (let (delim match-char mdelim redelims (nomatch t)) (setq delim (point-char)) (setq mdelim (cdr (assoc delim all_delims))) (if (null mdelim) (error "~s is not a valid delimiter" delim)) (setq redelims (concat "[" mdelim delim "]" )) (forward-char) (while nomatch (progn (if (not (re-search-forward redelims nil t)) (error "No matching delimiter found")) (setq match-char (buffer-substring (- (point) 1) (point))) (if (and (not (equal "\"" delim)) (equal match-char delim)) (progn (backward-char) (goto-matching-delimiter)) (setq nomatch nil)) )) )) ;;;; ;;;; Return the character at the cursor ;;;; (defun point-char () (buffer-substring (point) (+ 1 (point))) ) ;;;; ;;;; Debugging routine x;;;; (defun mark-and-hold (mark-char-string) (insert-string mark-char-string) (read-string "holding...") (backward-delete-char 1) ) ------------------------------------------------------------------------------- %%% 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.ACS.WASHINGTON.EDU %%% 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 %%% %%% Current versions now in general distribution: %%% TeX 2.93 metafont 1.5 %%% plain.tex 2.92 plain.mf 1.0 %%% LaTeX 2.09 (10/26/88) cmbase.mf see cm85.bug %%% SliTeX 2.09 gftodvi 1.7 %%% tangle 2.8 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 %%%\bye %%% End of TeXhax Digest ************************** -------