Discussion:
Using Metafont without (and then with) an input file
(too old to reply)
Peter Percival
2014-03-20 17:18:04 UTC
Permalink
I am reading D.E. Knuth's 'The METAfont Book' (1993 printing). In
Chapter 5, 'Running METAFONT' I learn that if I type 'mf' there will be
a prompt '**' (and there is!)

The book invites me to type '\relax' and then, at a prompt '*',
'drawdot (35,70); showit;', etc, etc. But typing '\relax' produces an
error message and a swift exit from METAFONT.

The file mfput.log reads:

This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:05
**\relax
! Emergency stop.
<*> \relax

*** (job aborted, no legal end found)

So, what should I type in place of '\relax' in order to continue
'drawdot...'?

To continue. I prepared a file page31.txt with

drawdot (35,70); showit;

followed by a newline, in it, and saved the file in the same directory
as mf,exe and typed 'page31.txt. at the ** prompt. Again, there was an
error message and a swift exit from METAFONT.

The file page31.log reads:

This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:12
**.\page31.txt
(D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\page31.txt)
! Emergency stop.
<*> .\page31.txt

*** (job aborted, no legal end found)

What's going on?
--
Madam Life's a piece in bloom,
Death goes dogging everywhere:
She's the tenant of the room,
He's the ruffian on the stair.
Robin Fairbairns
2014-03-20 19:59:34 UTC
Permalink
Post by Peter Percival
I am reading D.E. Knuth's 'The METAfont Book' (1993 printing). In
Chapter 5, 'Running METAFONT' I learn that if I type 'mf' there will
be a prompt '**' (and there is!)
The book invites me to type '\relax' and then, at a prompt '*',
'drawdot (35,70); showit;', etc, etc. But typing '\relax' produces an
error message and a swift exit from METAFONT.
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:05
**\relax
! Emergency stop.
<*> \relax
*** (job aborted, no legal end found)
So, what should I type in place of '\relax' in order to continue
drawdot...'?
To continue. I prepared a file page31.txt with
drawdot (35,70); showit;
followed by a newline, in it, and saved the file in the same directory
as mf,exe and typed 'page31.txt. at the ** prompt. Again, there was
an error message and a swift exit from METAFONT.
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:12
**.\page31.txt
(D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\page31.txt)
! Emergency stop.
<*> .\page31.txt
*** (job aborted, no legal end found)
What's going on?
the hint is in that error message

*** (job aborted, no legal end found)

it seems to want an "end;" command after your "showit;".

disclaimer: the only ever metafont project i did was for the company i
left in 1992. so this may all be piffle.

there's this huge thing, on the net: http://metafont.tutorial.free.fr/
which i got to via http://www.tex.ac.uk/cgi-bin/texfaq2html?label=mfptutorials

there's more in that faq answer.
--
Robin Fairbairns, Cambridge
Jean-Côme Charpentier
2014-03-20 20:06:42 UTC
Permalink
Post by Peter Percival
I am reading D.E. Knuth's 'The METAfont Book' (1993 printing). In
Chapter 5, 'Running METAFONT' I learn that if I type 'mf' there will be
a prompt '**' (and there is!)
Ok. Start is ok!
Post by Peter Percival
The book invites me to type '\relax' and then, at a prompt '*',
That's right.
Post by Peter Percival
'drawdot (35,70); showit;', etc, etc. But typing '\relax' produces an
error message and a swift exit from METAFONT.
That's very strange. I don't understand why. Here:

***@Gauss:~$ mf
This is METAFONT, Version 2.718281 (TeX Live 2013)
**\relax

*drawdot(35,70);

*showit;

[beautiful windows with a big point]

*end
Transcript written on mfput.log.
Post by Peter Percival
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:05
**\relax
! Emergency stop.
<*> \relax
*** (job aborted, no legal end found)
It's like a '\relax' file exist. Do you have a file named \relax???
Post by Peter Percival
So, what should I type in place of '\relax' in order to continue
'drawdot...'?
\relax
There isn't any other way (afaik).
Post by Peter Percival
To continue. I prepared a file page31.txt with
Strange to use txt extension but you can do it.
Post by Peter Percival
drawdot (35,70); showit;
followed by a newline, in it, and saved the file in the same directory
as mf,exe and typed 'page31.txt. at the ** prompt. Again, there was an
error message and a swift exit from METAFONT.
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:12
**.\page31.txt
(D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\page31.txt)
! Emergency stop.
<*> .\page31.txt
*** (job aborted, no legal end found)
What's going on?
* First, it's strange that
**\page31.txt
don't complain or don't give a '*' prompt. To call a file, you have to
give the real name. Here page31.txt, not \page31.txt
* Second, the error message is clear enough: you forget to say 'end'
at the end of your file
-----%<-----%<-----
drawdot (35,70);
showit;
end
-----%<-----%<-----
* Third, it is possible that you don't see anything with this code
because the showit is too short (in time). Better, for example:

-----%<-----%<-----
drawdot (35,70);
showit;
pause;
end
-----%<-----%<-----
* Last, you can call Metafont with this syntax:

mf page31.txt

Jean-Côme Charpentier

PS: I don't use Metafont since a loooong time ago then I able to say
some nonsenses!
Dan Luecking
2014-03-21 15:32:01 UTC
Permalink
On Thu, 20 Mar 2014 21:06:42 +0100, Jean-Côme Charpentier
Post by Jean-Côme Charpentier
Post by Peter Percival
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:12
**.\page31.txt
(D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\page31.txt)
! Emergency stop.
<*> .\page31.txt
*** (job aborted, no legal end found)
What's going on?
* First, it's strange that
**\page31.txt
don't complain or don't give a '*' prompt. To call a file, you have to
give the real name. Here page31.txt, not \page31.txt
What was typed was ".\page31.txt". The dot is a legal start to a
filename and this should read in the file is it is in the current
directory. Indeed the terminal output shows it does.

On the other hand, MF would interpret "\page31.txt" (without the dot)
as two commands: \ (which means "relax") and page31.tex which is
the same as the variable page[31]txt. What it should do is not
complain, but produce the * prompt for more input
(where on could type "=3", for example).

It is odd that Knuth invites one to type "\relax", because that means
the same as "relax relax". Actually, \ is the primitive command and
plain.mf says "let relax = \;" so "\relax" means "\ \". I usually only
type \ and press the enter key.
Post by Jean-Côme Charpentier
* Second, the error message is clear enough: you forget to say 'end'
at the end of your file
That shouldn't matter. MF should just produce its * prompt and wait
for more input.

I'm pretty certain this is a bug in MiKTeX. I ran across the same
thing years ago in MiKTeX where I could not run mpost interactively
(although mf was fine back then). It's why I switched to fpTeX
(then in TeX Live) and stayed with TeX Live until now.


Dan
To reply by email, change LookInSig to luecking
Peter Percival
2014-03-21 20:12:17 UTC
Permalink
Post by Dan Luecking
On Thu, 20 Mar 2014 21:06:42 +0100, Jean-Côme Charpentier
Post by Jean-Côme Charpentier
Post by Peter Percival
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:12
**.\page31.txt
(D:\Program Files (x86)\MiKTeX 2.9\miktex\bin\page31.txt)
! Emergency stop.
<*> .\page31.txt
*** (job aborted, no legal end found)
What's going on?
* First, it's strange that
**\page31.txt
don't complain or don't give a '*' prompt. To call a file, you have to
give the real name. Here page31.txt, not \page31.txt
What was typed was ".\page31.txt". The dot is a legal start to a
filename and this should read in the file is it is in the current
directory. Indeed the terminal output shows it does.
Also tried "page31.txt" and got the same result.
Post by Dan Luecking
On the other hand, MF would interpret "\page31.txt" (without the dot)
as two commands: \ (which means "relax") and page31.tex which is
the same as the variable page[31]txt. What it should do is not
complain, but produce the * prompt for more input
(where on could type "=3", for example).
It is odd that Knuth invites one to type "\relax", because that means
the same as "relax relax". Actually, \ is the primitive command and
plain.mf says "let relax = \;" so "\relax" means "\ \". I usually only
type \ and press the enter key.
I tried just "\" and got the same result.
Post by Dan Luecking
Post by Jean-Côme Charpentier
* Second, the error message is clear enough: you forget to say 'end'
at the end of your file
That shouldn't matter. MF should just produce its * prompt and wait
for more input.
I'm pretty certain this is a bug in MiKTeX. I ran across the same
thing years ago in MiKTeX where I could not run mpost interactively
(although mf was fine back then). It's why I switched to fpTeX
(then in TeX Live) and stayed with TeX Live until now.
Dan
To reply by email, change LookInSig to luecking
--
Madam Life's a piece in bloom,
Death goes dogging everywhere:
She's the tenant of the room,
He's the ruffian on the stair.
Phillip Helbig---undress to reply
2014-03-20 21:00:51 UTC
Permalink
Post by Peter Percival
I am reading D.E. Knuth's 'The METAfont Book' (1993 printing). In
Chapter 5, 'Running METAFONT' I learn that if I type 'mf' there will be
a prompt '**' (and there is!)
The book invites me to type '\relax' and then, at a prompt '*',
'drawdot (35,70); showit;', etc, etc. But typing '\relax' produces an
error message and a swift exit from METAFONT.
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:05
**\relax
! Emergency stop.
<*> \relax
*** (job aborted, no legal end found)
For what it's worth, I get the same thing:

$ mf
This is METAFONT, Version 2.718 [PD VMS 2.2] (preloaded base=plain 95.6.22)
**\relax
$ typ mfput.lis;*
This is METAFONT, Version 2.718 [PD VMS 2.2] (preloaded base=plain 95.6.22) 20 MAR 2014 21:52
**\relax
! Emergency stop.
<*> \relax

*** (job aborted, no legal end found)


$

Yes, this is on VMS. I've never done anything with Metafont, except
what LaTeX itself does. This is a quite old installation, probably 15
years old.
Luis Rivera
2014-03-21 00:14:48 UTC
Permalink
Post by Phillip Helbig---undress to reply
$ mf
This is METAFONT, Version 2.718 [PD VMS 2.2] (preloaded base=plain 95.6.22)
**\relax
$ typ mfput.lis;*
This is METAFONT, Version 2.718 [PD VMS 2.2] (preloaded base=plain 95.6.22) 20 MAR 2014 21:52
**\relax
! Emergency stop.
<*> \relax
*** (job aborted, no legal end found)
$
Yes, this is on VMS. I've never done anything with Metafont, except
what LaTeX itself does. This is a quite old installation, probably 15
years old.
Again, fwiw, good old mf386 from emTeX running on a DOSbox doesn't spit me back any error; but with no access whatsoever to *any* windowing system, it simply does nothing when issued the order `showit;'

Just to confirm my conjecture: Phillip, do you have access to a windowing system on your vms machine? If you don't, it seems to me that somehow command-line mfs implementations for terminals without graphics have some built-in feature that keeps them from running some commands.

I say it's just a conjecture since I haven't checked the source code for any of these implementations. (In some cases, like emTeX's, the source code seems to be missing altogether.)

My two pennies at that.

Cheers,

Luis.
Phillip Helbig---undress to reply
2014-03-21 06:09:38 UTC
Permalink
Just to confirm my conjecture: Phillip, do you have access to a windowing s=
ystem on your vms machine?
Yes, DECwindows, and the display was set correctly.
Luis Rivera
2014-03-21 18:06:20 UTC
Permalink
Post by Phillip Helbig---undress to reply
Just to confirm my conjecture: Phillip, do you have access to a windowing s=
ystem on your vms machine?
Yes, DECwindows, and the display was set correctly.
That's interesting. So, apparently, your mf version has too been compiled without access the windows/graphics interface.

As Dan has already pointed out on this thread, this seems to be rather a bug on your vms implementation and MikTeX: TeXLive and emTeX display far more regular behaviours.

Cheers,

Luis.
Luis Rivera
2014-03-20 23:47:48 UTC
Permalink
Post by Peter Percival
I am reading D.E. Knuth's 'The METAfont Book' (1993 printing). In
Chapter 5, 'Running METAFONT' I learn that if I type 'mf' there will be
a prompt '**' (and there is!)
The book invites me to type '\relax' and then, at a prompt '*',
'drawdot (35,70); showit;', etc, etc. But typing '\relax' produces an
error message and a swift exit from METAFONT.
Well, I'm fortunate enough to have two implementations in the same box: Cygwin's TeXLive 2013 with and without Xterm, and MikTeX 2.9. What I found is that, if mf has access to the windowing system from the command prompt (the Xterm from cygwin), the dot appears as expected; but if mf has no direct access to the windowing system from the command prompt (MikTeX's command prompt), the error appears right after \relax.

An interesting third case happens when I access mf from TeXLive at cygwin *without* the windowing system: then I can type in \relax, and the console responds; but when I issue the next instructions, right after `showit;', mf aborts with the message `Error: can't open display:' So apparently TeXLive's mf has built in capabilities to *try* to access the host's windowing system.

So my conjecture is: MikTeX's mf cannot execute the \relax, because it has no direct access whatsoever to the windowing system from within the command prompt. Why is that, I don't know. Maybe Schenk can answer that.

Cheers,

Luis.
Dan Luecking
2014-03-21 15:43:09 UTC
Permalink
On Thu, 20 Mar 2014 16:47:48 -0700 (PDT), Luis Rivera
Post by Luis Rivera
Post by Peter Percival
I am reading D.E. Knuth's 'The METAfont Book' (1993 printing). In
Chapter 5, 'Running METAFONT' I learn that if I type 'mf' there will be
a prompt '**' (and there is!)
The book invites me to type '\relax' and then, at a prompt '*',
'drawdot (35,70); showit;', etc, etc. But typing '\relax' produces an
error message and a swift exit from METAFONT.
Cygwin's TeXLive 2013 with and without Xterm, and MikTeX 2.9. What I found
is that, if mf has access to the windowing system from the command prompt
(the Xterm from cygwin), the dot appears as expected; but if mf has no
direct access to the windowing system from the command prompt (MikTeX's
command prompt), the error appears right after \relax.
An interesting third case happens when I access mf from TeXLive at cygwin
*without* the windowing system: then I can type in \relax, and the console
responds; but when I issue the next instructions, right after `showit;',
mf aborts with the message `Error: can't open display:' So apparently
TeXLive's mf has built in capabilities to *try* to access the host's
windowing system.
So my conjecture is: MikTeX's mf cannot execute the \relax, because it has
no direct access whatsoever to the windowing system from within the command
prompt. Why is that, I don't know. Maybe Schenk can answer that.
While showit needs a windowing system, relax does not. It just needs
a terminal to display the * prompt and receive input. I think this is
a bug.

There used to be in some distributions (not sure about MiKTeX) a
special mf-nowin command that ran mf with window access ignored.
It was used by makeTeXPK and other scripts. If MiKTeX has it or
something similar, one might try that.


Dan
To reply by email, change LookInSig to luecking
Dan Luecking
2014-03-21 21:13:28 UTC
Permalink
Post by Dan Luecking
While showit needs a windowing system, relax does not. It just needs
a terminal to display the * prompt and receive input. I think this is
a bug.
And even when a windowing system is needed, a TeX system for
the Windows OS like MiKTeX ought to be able to call up a window
using the Windows API. Indeed, I use TeX Live on a Windows 7
system and its mf causes no such problems. It will even display
the result of
drawdot (35,70); showit;
in a standard win7-style window.


Dan
To reply by email, change LookInSig to luecking
g***@gmail.com
2017-11-03 09:26:58 UTC
Permalink
Post by Peter Percival
I am reading D.E. Knuth's 'The METAfont Book' (1993 printing). In
Chapter 5, 'Running METAFONT' I learn that if I type 'mf' there will be
a prompt '**' (and there is!)
The book invites me to type '\relax' and then, at a prompt '*',
'drawdot (35,70); showit;', etc, etc. But typing '\relax' produces an
error message and a swift exit from METAFONT.
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:05
**\relax
! Emergency stop.
<*> \relax
*** (job aborted, no legal end found)
So, what should I type in place of '\relax' in order to continue
,,,
Did you ever resolve this?
The latest (2017) version of Metafont distributed with MikTeX still shows this behaviour.
Geoffrey.
Peter Percival
2017-11-03 13:12:07 UTC
Permalink
Post by g***@gmail.com
Post by Peter Percival
I am reading D.E. Knuth's 'The METAfont Book' (1993 printing). In
Chapter 5, 'Running METAFONT' I learn that if I type 'mf' there will be
a prompt '**' (and there is!)
The book invites me to type '\relax' and then, at a prompt '*',
'drawdot (35,70); showit;', etc, etc. But typing '\relax' produces an
error message and a swift exit from METAFONT.
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:05
**\relax
! Emergency stop.
<*> \relax
*** (job aborted, no legal end found)
So, what should I type in place of '\relax' in order to continue
,,,
Did you ever resolve this?
No, but I haven't tried very hard! My interest then was in just playing
or experimenting, and it is no more advanced than that now.
Post by g***@gmail.com
The latest (2017) version of Metafont distributed with MikTeX still shows this behaviour.
Geoffrey.
--
Do, as a concession to my poor wits, Lord Darlington, just explain
to me what you really mean.
I think I had better not, Duchess. Nowadays to be intelligible is
to be found out. -- Oscar Wilde, Lady Windermere's Fan
Dan Luecking
2017-11-07 16:45:21 UTC
Permalink
Post by g***@gmail.com
Post by Peter Percival
I am reading D.E. Knuth's 'The METAfont Book' (1993 printing). In
Chapter 5, 'Running METAFONT' I learn that if I type 'mf' there will be
a prompt '**' (and there is!)
The book invites me to type '\relax' and then, at a prompt '*',
'drawdot (35,70); showit;', etc, etc. But typing '\relax' produces an
error message and a swift exit from METAFONT.
This is METAFONT, Version 2.718281 (MiKTeX 2.9) (preloaded base=mf
2013.5.9) 20 MAR 2014 16:05
**\relax
! Emergency stop.
<*> \relax
*** (job aborted, no legal end found)
So, what should I type in place of '\relax' in order to continue
,,,
Did you ever resolve this?
The latest (2017) version of Metafont distributed with MikTeX still shows this behaviour.
Geoffrey.
I had this problem years ago (late 1990s maybe) (although it was
maybe mpost that gave me the problem). It led me to switch from
MiKTeX to a different TeX distribution (fpTeX and later TeX Live).
It looks like MiKTeX's mf is not programmed to run interactively.

In TeX Live, mf can be run interactively, and one uses mf-nowin
to run a noninteractive version (e.g., for on-the-fly generation
of missing PK fonts). Actually, even mf-nowin can be run
interactively, but it ignores any command that would open a
graphics window, such as showit.

Dan
To reply by email, change LookInSig to luecking

Loading...