UKTeX Digest Friday, 4 Jan 1991 Volume 91 : Issue 1 Today's Topics: RE: Testing for numeric-only input RE: Help with TeX fonts re: Footnotes without the number metafont bombs out on cmbase.mf Moderator: Peter Abbott (Aston University) Editor: David Osborne (University of Nottingham) Contributions: UKTeX@uk.ac.aston Administration, subscription and unsubscription requests: UKTeX-request@uk.ac.aston UKTeX back issues: stored in the Aston archive, in the directory DISK$TEX:[TEX-ARCHIVE.DIGESTS.UKTEX.91] TeXhax back issues:stored in the Aston archive, in the directory DISK$TEX:[TEX-ARCHIVE.DIGESTS.TEXHAX.91] Latest TeXhax: #01 TeXMaG back issues: stored in the Aston archive, in the directory DISK$TEX:[TEX-ARCHIVE.DIGESTS.TEX-MAG] Latest TeXMaG: V4 N6 ------------------------------------------------------------ Date: Tue, 13 Nov 90 19:35:05 +0000 From: TEX@UK.AC.CRANFIELD.RMCS Subject: RE: Testing for numeric-only input In message 84 of Tue, 13 Nov 90 11:20:22, C20249@UK.AC.POLY-SOUTH-WEST.PRIME-A wrote: > Back in March, I wrote to you asking for help with a TeX/LaTeX query. > I have still not had any acknowledgment or reply. Can you please help? > Here is my query: I'm sorry, but there appears to be no record of your submission to UKTeX ever having arrived. Perhaps it came in when Aston were experiencing some difficulty in forwarding Janet mail to the UKTeX editor, and you missed the ``bounce''. > I am writing a LaTeX "program" and need your help. I am using \typein > to prompt the user to enter a "number" via the terminal. Then I set a > counter to the value of the "number" read in. > > \typein[\mynumber]{Please type a number} > \setcounter{mycounter}{\mynumber} > > What I would like to do is to insert some TeX logic (before setting > the counter) to check the validity of the "number" entered (it should > consist of a sequence of digits 0-9 only) and to prompt the user again > if it contains anything else. > > I have scoured the TeXbook looking for anything that might appear to > be useful or relevant, but I'm not a TeXpert and my search was > fruitless. Having had a slightly similar requirement when writing my crossword.sty option, and eventually being pointed towards \afterassignment by Frank Mittelbach, I can sympathize. I've just knocked together (and tested!) the following style option, which fills the bill, I think. Enjoy!! Brian {Hamilton Kelly} +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + JANET: tex@uk.ac.cranfield.rmcs + + BITNET: tex%uk.ac.cranfield.rmcs@ac.uk + + INTERNET: tex%uk.ac.cranfield.rmcs@nsfnet-relay.ac.uk + + UUCP: ...!mcvax!rmcs.cranfield.ac.uk!tex + + OR ...!ukc!rmcs.cranfield.ac.uk!tex + + Smail: School of Electrical Engineering & Science, Royal Military + + College of Science, Shrivenham, SWINDON SN6 8LA, U.K. + + Phone: Swindon (0793) 785252 (UK), +44-793-785252 (International) + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [Start of attached file CHECKNUM.STY] % CHECKNUM.STY % % A style file providing the macro \getnumber. % % Usage: \getnumber{A prompt string}{countername} % or: \getnumber{A prompt string}[default]{countername} % % Outputs the specified prompt and accepts input interactively. % % If the input forms a valid number, it will be assigned to the LaTeX % counter `countername'. Invalid input causes repetition of the prompt % until a valid response is given. % % The second form, with the optional parameter, will assign the value % `default' (which must be a valid number) to countername if the user % types return by itself. % % Caveat: Input commencing with leading zeros will be spuriously rejected. % % % Author: Brian {Hamilton Kelly} % Address: Royal Military College of Science, % Shrivenham, SWINDON, SN6~8LA, United Kingdom % Tel: ++44 793 785252 % e-mail: % Date: 13th November 1990 % % This macro reads and consumes all following text, up to and including % the special marker \@nil \def\special@gobble #1\@nil{} % This if allows us to decide whether a valid number was entered \newif\ifg@rbage % % Here is the macro to be invoked by the user % \def\getnumber#1{\@ifnextchar[{\g@tnumber#1}{\g@tnumber#1[]}} % % This is the macro that does the work! % \def\g@tnumber#1[#2]#3{% \loop % Doing things this way allows us to get the prompt and the response onto % the same line; the alternative course of using \typein would have % separated these items, and the prompt line itself would have read as % ``\@tempa=''. \typeout{}% Ensure we start on a newline; prompt & response then together % If the optional default value is provided, include it in the prompt \ifx #2 \@empty \message{#1: }% \else \message{#1 [#2]: }% \fi % Read the user's response \read\m@ne to\@tempa % If the user types just a return, \@tempa will be set to `\par '; convert % this into just a space by itself. When we later perform the assignment % to \@tempcnta, the latter will assume the value zero, so the expansion of % \@tempa will NOT equate to that of \@tempb, and the input of a return by % itself will thus be rejected. (NB \@defpar is defined by LaTeX.TeX) \ifx \@tempa\@defpar \xdef\@tempa{#2\space}\fi % We'll now assign to \@tempcnta whatever part of the beginning of the % content of \@tempa (read from the input) that constitutes a legal % number; any remaining characters (including the terminating space) will % then be discarded by the call of \special@gobble, but this macro only % takes effect AFTER the assignment to the counter has taken place \afterassignment \special@gobble \@tempcnta=0\@tempa \@nil % We define \@tempb to expand to whatever legal number was input, with a % trailing space. \xdef\@tempb{\the\@tempcnta\space}% % therefore, iff \@tempa contained only digits then its first-level % expansion will be identical to that of \@tempb \ifx\@tempb\@tempa \g@rbagefalse \else % But if the `number' input contained non-digit characters, then \@tempb % will contain something different! \g@rbagetrue \fi % If we didn't get a valid number, then tell the punter; the \repeat will % then return us to the \loop above, and re-prompt for input. \ifg@rbage \typeout{Your response contained non-digit characters; try again!}% \repeat % Finally, we can set the user-provided LaTeX counter and return \setcounter{#3}{\the\@tempcnta}% } ------------------------------ Date: Fri, 21 Dec 90 17:08:58 +0000 From: TEX@UK.AC.CRANFIELD.RMCS Subject: RE: Help with TeX fonts In an ID-less message of Fri, 21 Dec 90 11:39 GMT, Erwin Kronheimer wrote: > Sorry for the delay in sending you this message, as you kindly > suggested in our telephone conversation two hours ago. (I had a > dentist's appointment; but I'll be in my office all day now.) > > What I need is a complete file of CM fonts, .TFM and .PK, with > resolution 180 dpi and the usual magnifications (197, 216, 259, 311, > 373) to use with our EmTex program and the PcTeX PC Dot/LQ driver, > which was supplied (by System Science) with only the AM files.* > > I tried sending the messsage DIRECTORY [TEX-ARCHIVE..]*.PK to > TEXSERVER, but I got a blank reply (header but no text), which > I presumed meant you have no files with this extension. DId you really say this, because you need THREE periods for a directory ellipsis under VMS; but I think that there are NOT any files with extension .PK --- they're all things like .300PK, .329PK, etc. I can't seem to be able to log in at Aston at present to check what's really there: you'd probably be better off collecting [TEX-ARCHIVE]00DIRECTORY.LIST, in case the fonts you want have some other naming. Hope you have some success soon, and have a Merry CHristmas yourself. Brian {Hamilton Kelly} ------------------------------ Date: Fri, 21 Dec 90 15:06:51 -0400 From: LEICHTER%COM.LRW@UK.AC.NSFNET-RELAY Subject: re: Footnotes without the number In a recent UKTeX, Peter Abott asks for a way to leave space for a photograph at the bottom of a column in a LaTeX multicolumn document. He's been using \footnotetext, but doesn't want the footnote number. Here's what I used in a style file I came up with based on the ACM's standard layout. It requires you to leave space at the bottom of the first column on the first page for them to insert copyright information. This code is taken from \maketitle: \if@twocolumn \twocolumn[\@maketitle] % % Leave room for ACM copyright stuff \begin{figure}[b] \vskip -\dbltextfloatsep % Cancel extra space at top % % Text specs say .75in, but the example sheet says 1in. Sigh % \vskip .75in % Insert the 3/4in ACM wants \vskip 1in % Insert the 1in ACM wants \end{figure} \global\@minipagefalse % Avoid screwing up section headings etc. \else \newpage \global\@topnum\z@ % Prevents figures from going at top of page. \@maketitle \fi (Since the ACM specs assume two-column format, this doesn't actually leave any space if you turn two-column format off.) -- Jerry ------------------------------ Date: Fri, 04 Jan 91 14:48:38 +0000 From: DEREK@UK.AC.SHEFFIELD.AIVRU Subject: metafont bombs out on cmbase.mf Hello, I run dvips which calls mf (via MakeTeXPK) and the following happens, can any kind soul tell me why? : ############# Begin included text ######################### This is dvips, version 5.41 (C) 1986-90 Radical Eye Software ' TeX output 1991.01.04:1428' -> !lpr - - MakeTeXPK cmr10 400 400 magstep\(0.0\) mf \mode:=nexthi; mag:=magstep(0.0); scrollmode; input cmr10 \ ( l.47 def dish_serif( suffix $,$$,@)(expr left_darkness,left_jut) ! Missing `=' has been inserted. ( l.58 def nodish_serif( suffix $,$$,@)(expr left_darkness,left_jut) ......... more of the same >> extra_endchar >> "r:=r+shrink_fit;w:=r-l;" ! Not implemented: (unknown numeric)&(string). ; l.477 ...=extra_endchar&"r:=r+shrink_fit;w:=r-l;"; >> extra_endchar >> "r:=r+shrink_fit;w:=r-l;" ! Equation cannot be performed (numeric=string). ; .......... more of the = problem >> font_identifier >> "CMR" ! Equation cannot be performed (numeric=string). ; l.4 font_identifier:="CMR"; font_size 10pt#; >> font_size10pt# ! Isolated expression. ; l.4 font_identifier:="CMR"; font_size 10pt#; ################### End included text ###################### I have the standard .mf bases I believe, and mf itself is from the labrea web2c distribution. Many thanks in advance, Derek Jones. System Manager. A.I. Vision Research Unit, Sheffield University, Western Bank, Sheffield. S10 2TN U.K. Tel: (0742) 768555 X 6551 email: derek@aivru.sheffield.ac.uk ------------------------------ UK TeX ARCHIVE at ASTON UNIVERSITY *** FTP access *** Host: uk.ac.aston.tex username: public password: public *** Files of interest *** [tex-archive]00aston.readme [tex-archive]00directory.list [tex-archive]00directory_dates.list [tex-archive]00directory.size [tex-archive]00last30days.files *** Media distributions *** Washington Unix tape (28 March 1990) TeX 2.993(==3.0), LaTeX 2.09, Metafont 1.9 (2.0) Unix 4.2/3BSD & System V. Tar 1600bpi, blockfactor 20, 1 file. Send one 2400' tape with return labels AND return postage. VMS backup of the archive requires two 2400' tapes at 6250bpi. VMS backup of TeX 2.991 plus PSprint requires one tape. Exabyte 8mm tapes: same formats available as 1/2in tapes. The following tapes are available: SONY Video 8 cassette P5 90MP, MAXCELL Video 8 cassette P5-90, TDK Video 8 cassette P5-90MPB OzTeX (for Macintosh): Send 10 UNFORMATTED 800K disks with return postage. emTeX (for MS-DOS): Send 11 UNFORMATTED 720K 3.5" disks or 12 UNFORMATTED 5.25" disks with return postage. *** Postage rates: (cheques made payable to Aston University) *** 0.5" tapes: UK: 2.50 pounds sterling (one tape), 5.00 (two tapes). Europe: 5.00 pounds sterling (one tape), 9.00 (two tapes). Outside Europe please enquire. 8mm tapes: UK: 1.00 pound sterling. Europe: 2.00. DC600A cartridges: UK: 1.00 pound sterling. Europe: 2.00. Diskettes: UK: 1.00 pounds sterling. Europe: 2.00. *** Postal address *** Peter Abbott, Computing Service, Aston University, Aston Triangle, Birmingham B4 7ET End of UKTeX Digest *******************