noOutputXtc and ")read"

22 views
Skip to first unread message

Qian Yun

unread,
Feb 10, 2024, 6:07:58 AM2/10/24
to fricas-devel
(Background: ug21.htex contains the input files to generate
the fancy images, I'm trying to run those code and include
the output images into book.pdf.)

The problem I met in ug21 (and other places, e.g. chapter
10.5 A Bouquet of Arrows) is that for a block like this:

\noOutputXtc{
Read torus knot program.
}{
\spadcommand{)read tknot \bound{b1}}
}


The comments in tknot.input and intermediate computing steps
are still shown in final document.

This could be solved by tweaking spool2tex.awk and fricas.sty,
I guess. Opinions? @Ralf.

- Qian

Ralf Hemmecke

unread,
Feb 10, 2024, 8:08:27 AM2/10/24
to fricas...@googlegroups.com
Hi Qian,

I do not think that many people on the list are interested in the
detail. So we could switch to private mails. On the other hand "
"spamming" fricas-devel with that stuff is probably also good just to
keep the history.

> \noOutputXtc{
> Read torus knot program.
> }{
> \spadcommand{)read tknot \bound{b1}}
> }

From the top of my head ... you have probably seen that there are
several commands \...Xtc. I basically left them as they were originally
and did everything through the definition in the sty file or some
translation.

I basically had to guess what the meaning of those commands is.

> The comments in tknot.input and intermediate computing steps
> are still shown in final document.

Hmmm...? I do not know what exactly you mean.

Since the above code snipped does not (yet) appear in the FriCAS
sources, you probably meant to use that in order to generate the tknot
image?

Can you tell me the branch in your repo that I see what you are working on?

> This could be solved by tweaking spool2tex.awk and fricas.sty,
> I guess.  Opinions? @Ralf.

In fact, I am a bit lost. I guess, you want to add text (maybe at the
end of ug21.htex) in order to show the nice pictures that appear in the
middle of the original AXIOM book, right?
Anyway, it would be easier for me to see in which file you are currently
working and what exactly you want to achieve.

Up to know I thought that it would first be necessary to get the .ps (or
rather .eps) image generation correctly done by fricas (with all
colors). Only after that I would think about tweaking the generation of
book.pdf to generate .ps instead of .xpm and use it for the .pdf file.

Ralf

Qian Yun

unread,
Feb 10, 2024, 8:54:46 AM2/10/24
to fricas...@googlegroups.com


On 2/10/24 21:08, Ralf Hemmecke wrote:
>
> Hmmm...? I do not know what exactly you mean.
>
> Since the above code snipped does not (yet) appear in the FriCAS
> sources, you probably meant to use that in order to generate the tknot
> image?
>
> Can you tell me the branch in your repo that I see what you are working on?

Yes, it is easier to understand with code. Please see

https://github.com/oldk1331/fricas/tree/improve-book

You'll see what I mean after you generate the book and see "Appendix B".

>> This could be solved by tweaking spool2tex.awk and fricas.sty,
>> I guess.  Opinions? @Ralf.
>
> In fact, I am a bit lost. I guess, you want to add text (maybe at the
> end of ug21.htex) in order to show the nice pictures that appear in the
> middle of the original AXIOM book, right?
> Anyway, it would be easier for me to see in which file you are currently
> working and what exactly you want to achieve.
>
> Up to know I thought that it would first be necessary to get the .ps (or
> rather .eps) image generation correctly done by fricas (with all
> colors). Only after that I would think about tweaking the generation of
> book.pdf to generate .ps instead of .xpm and use it for the .pdf file.
>
> Ralf
>

These 2 improves are orthogonal:
1. fix generating ps image format.
2. tweak ug21 to generate extra images.

- Qian

Waldek Hebisch

unread,
Feb 10, 2024, 9:05:17 AM2/10/24
to fricas...@googlegroups.com
AFAICS '\noOutputXtc' works as intended (I agree that name my
be misleading, it produces output which is included in book or
HyperDoc pages).

--
Waldek Hebisch

Waldek Hebisch

unread,
Feb 10, 2024, 9:33:20 AM2/10/24
to fricas...@googlegroups.com
On Sat, Feb 10, 2024 at 09:54:41PM +0800, Qian Yun wrote:
>
>
> On 2/10/24 21:08, Ralf Hemmecke wrote:
> >
> > Hmmm...? I do not know what exactly you mean.
> >
> > Since the above code snipped does not (yet) appear in the FriCAS
> > sources, you probably meant to use that in order to generate the tknot
> > image?
> >
> > Can you tell me the branch in your repo that I see what you are working on?
>
> Yes, it is easier to understand with code. Please see
>
> https://github.com/oldk1331/fricas/tree/improve-book
>
> You'll see what I mean after you generate the book and see "Appendix B".

AFAICS you try do this differently than in the orignal. If you
you manage, this could be a nicer setup, but you need to develep
your own commands.

Orignally image sources were duplicated, one "print only" copy in
ug21.htex, and separate executable copies in .input files.
It seems that for printed Axiom Book they simply run .input files
by hand, in particular comment about using X11 window dump indicate
that this was manual process. However, one can extract images
from viewports, and if image is not generated in other place (HyperDoc
shows the same image in multiple places, I did not check the book,
but probably book has less duplication) one can do what is done
for 'mobius.VIEW': generate the viewport from the Makefile.

Note: Almost all viewports are generated by HyperDoc as a byproduct
of handling documentaion pages, but page showing 'mobius.VIEW' do not
generate it, so I added separate command in the Makefile.in. If
needed the same could be done for other viewports.

--
Waldek Hebisch

Ralf Hemmecke

unread,
Feb 10, 2024, 6:08:06 PM2/10/24
to fricas...@googlegroups.com
>> https://github.com/oldk1331/fricas/tree/improve-book

>> You'll see what I mean after you generate the book and see "Appendix B".

I wanted to write something else, but then I investigated in more detail
and think that you have simply found a bug.

When you look at the place
https://github.com/fricas/fricas/blob/master/src/doc/htex/ug10.htex#L540
which is in Section "10.5 A Bouquet of Arrows", then you see that also
there is some text from the bouquet.input file that appears (even as
text) in book.pdf. I must check on Monday with the physical AXIOM book,
but I think that it should not have happened. I guess, I simply
overlooked a special handling of the ")read" commands.

Let me think about it for some time. If you can meanwhile concentrate on
the .ps generation that would be great.

In general, it should be possible to generate the pictures with the
\...xtc commands. For some reason moebius was a special case. I will
look at it again. However, I think we need the concrete parameters to
generate the high-resolution pictures from the book. What currently
comes out is not really convincing.

And while we are at it... you certainly see that bouquet.input actually
appears as a piece of code in ug10.htex, so why not generating
bouquet.input from there? (Well, it's a bit of work, but somehow like
literate programming.)

Ralf
Reply all
Reply to author
Forward
0 new messages