> This is hidden in C part: hyperdoc puts 'write' command after
> graphic commands.  Required formats are specified as part of
> that 'write' command.

Thank you. It works, but I must say, I don't (yet) like the result.

Compare the book from

  http://fricas.github.io/book.pdf

with the one without ImageMagick

  http://hemmecke.org/fricas/book.pdf

Issues that I realized with the new method
(compare for example pp. 298)

- no caption (compare for example page 298)
- 3d objects look brighter
- 3d meshes are thinner
- 2d graphics is only black/white
- 2d graphics does not fit current size

The last point can probably be adjusted, but why it is only B/W for 2D,
I don't know.

I don't think that currently this will be a good way of generating the
.ps files.

Ralf

Patch attached.

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/452bd0b5-a64c-d07f-e1a1-2bafc71eba90%40hemmecke.org.
From a9422d32eb6f6b03d98ac6adfc9bf05ec0f5e8bd Mon Sep 17 00:00:00 2001
From: Ralf Hemmecke <[email protected]>
Date: Sat, 27 Mar 2021 22:21:32 +0100
Subject: generate postscript files directly by hyper

---
 src/doc/Makefile.in | 7 ++++---
 src/doc/ugepsf.awk  | 2 +-
 src/hyper/htinp.c   | 5 +++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/doc/Makefile.in b/src/doc/Makefile.in
index 77cf5a8e..b0177aa8 100644
--- a/src/doc/Makefile.in
+++ b/src/doc/Makefile.in
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------
 #---
 #--- FriCAS
-#--- Copyright (C) 2013, 2014, 2020  Ralf Hemmecke <[email protected]>
+#--- Copyright (C) 2013, 2014, 2020, 2021  Ralf Hemmecke <[email protected]>
 #---
 #------------------------------------------------------------------
 # The main targets of this Makefile are "all" and "doc".
@@ -46,9 +46,10 @@
 #
 # "make book.pdf" does the following:
 # - Copy pictures from the ps/ directory for (documentation of HyperDoc).
-# - Convert the *.VIEW/image.xpm pictures to .ps images (target stamp-pics).
+# - Move the *.VIEW/fricas?.ps images to the out of the VIEW directory
+#   (target stamp-pics).
 #   That expects all the .VIEW/ directories to exist (make viewports).
-#   It needs the convert program from ImageMagick. See ugepsf.awk.
+#   It assumes that postscripts are automatically generated. See ugepsf.awk.
 # - Generate tmo/ug09.tex with the list of examples.
 # - Create tmp/*.input from htex/*.htex (target ${HTEX_FILES_INPUT}).
 #   The .input files contain the commands that should be executed.
diff --git a/src/doc/ugepsf.awk b/src/doc/ugepsf.awk
index e39ddde9..4f995e7a 100644
--- a/src/doc/ugepsf.awk
+++ b/src/doc/ugepsf.awk
@@ -19,6 +19,6 @@
         print "no-pics: " $0
     }
     print $0 ": " view n ".VIEW/image.xpm"
-    print "\tconvert $< $@"
+    print "\tmv ${<D}/fricas?D.ps $@"
     spadgraph=0
 }
diff --git a/src/hyper/htinp.c b/src/hyper/htinp.c
index 5174ec69..5c617f12 100644
--- a/src/hyper/htinp.c
+++ b/src/hyper/htinp.c
@@ -366,8 +366,9 @@ get_graph_output(char *command,char *pagename,int com_type)
     for (i = 0; i < n; i++) {
         get_string_buf(spad_socket, buf, 1024);
     }
-    sprintf(buf, "(|processInteractive| '(|write| |%s| \"%s%d\" \"image\") NIL)", "%",
-            pagename, example_number);
+    sprintf(buf, "(|processInteractive| '(|write| |%s| \"%s%d\" (|construct|"
+                   "\"image\" \"postscript\")) NIL)", "%",
+                     pagename, example_number);
     send_lisp_command(buf);
     send_lisp_command("(|setViewportProcess|)");
     send_lisp_command("(|processInteractive| '(|close| (|%%| -3)) NIL)");
-- 
2.25.1

Reply via email to