|
From: Eduardo O. <edu...@gm...> - 2022-11-23 04:29:06
|
On Mon, 21 Nov 2022 at 02:09, Eduardo Ochs <edu...@gm...> wrote:
>
> On Sun, 20 Nov 2022 at 16:08, Michel Talon <ta...@lp...> wrote:
> >
> > By the way, here is the patch to add tikz to draw:
>
> Works perfectly!
> Thanks! =)
> Eduardo
Hi Michel, Robert, and everybody else...
I have just tested adding a new gnuplot terminal called $pict2e, and
everything worked. Here are the details, for the sake of completeness.
I changed the functions update-terminal - defined in
share/draw/grcommon.lisp - and draw_gnuplot - defined in
share/draw/gnuplot.lisp - by following the same instructions that I
had used to add a terminal called $tikz, and then I ran
make clean
make
make install
in the Maxima source tree. It would probably be better to just run
`M-x sly-eval-defun' on update-terminal and draw_gnuplot, but I tried
that and I stumbled on a problem that I will only have time to
investigate in the weekend =(... the method with "make clean; make;
make install" was a quick workaround.
After that I ran this in Maxima,
F(x,y) := 2*x^2 - x*y - y^2;
set_plot_option ([gnuplot_term, "tikz"]);
set_plot_option ([gnuplot_out_file, "/tmp/myplot.tikz"]);
plot2d([contour, F(x, y)], [x, -2, 2], [y, -2, 2]);
set_plot_option ([gnuplot_term, "pict2e"]);
set_plot_option ([gnuplot_out_file, "/tmp/myplot.pict2e"]);
plot2d([contour, F(x, y)], [x, -2, 2], [y, -2, 2]);
and this in a shell:
cd /usr/share/texmf/tex/
cp -v gnuplot-lua-tikz-common.tex /tmp/
cp -v gnuplot-lua-tikz.sty /tmp/
cd /tmp/
cat > myplot-tikz.tex <<'---'
\documentclass{article}
\usepackage{tikz}
\usepackage{gnuplot-lua-tikz}
\begin{document}
\input myplot.tikz
\end{document}
---
cat > myplot-pict2e.tex <<'---'
\documentclass{article}
\usepackage{pict2e}
\usepackage{xcolor}
\usepackage{graphicx}
\begin{document}
\input myplot.pict2e
\end{document}
---
lualatex myplot-tikz.tex
lualatex myplot-pict2e.tex
xpdf myplot-tikz.pdf
xpdf myplot-pict2e.pdf
and everything worked. I took the lists of \usepackages from here:
http://www.gnuplot.info/docs/latex_demo.pdf
Cheers,
Eduardo Ochs
http://angg.twu.net/eev-maxima.html
|