BTW, although the original generation of the book seems to have taken
care of the underscore by means of an awk script, I consider the
following a bug. It should be escaped by a backslash like this: \_.
(5) -> )set output algebra off
(5) -> )set output tex on
(5) -> escape()
$$
_
\leqno(5)
$$
Same here.
(6) -> 1.2345678901234567890123
$$
1.2345678901_23456789
\leqno(6)
$$
Furthermore:
(1) -> "a_b_"\"
(1) "a_b"\"
$$
\mbox{\tt "a_b"\"}
\leqno(1)
$$
That is wrong in many places.
I've fixed that here:
https://github.com/hemmecke/fricas/commits/escape-in-tex-context
With that the output is as follows:
(1) -> escape()
(1) _
$$
\_
\leqno(1)
$$
Type:
Character
(2) -> 1.2345678901234567890123
(2) 1.
2345678901_23456789
$$
1.2345678901_23456789
\leqno(2)
$$
Type:
Float
(3) -> "a_b_"\"
(3) "a_b"\"
$$
\verb#"a_b"\"#
\leqno(3)
$$
The use of \verb is perhaps questionable, since I don't know whether it
is plain TeX, but one can certainly provide such a macro in plain TeX.
Ralf