sageplot and includegraphics<3->...

140 views
Skip to first unread message

Dr. Georg Damm

unread,
Mar 30, 2010, 12:51:38 PM3/30/10
to sage-support
Hi,

is there a way to use beamer overlays ( includegraphics<3->... )
with sageplot?

Georg

Harald Schilly

unread,
Mar 30, 2010, 1:09:32 PM3/30/10
to sage-support
On Mar 30, 6:51 pm, "Dr. Georg Damm" <Georg.D...@web.de> wrote:
> is there a way to use beamer overlays ( includegraphics<3->... )
> with sageplot?

Hi, could you please elaborate a bit more what you try to accomplish?
Which sageplot? Sage's plot command? And how does this relate to
beamer? (Latex's beamer?)

h

ma...@mendelu.cz

unread,
Mar 30, 2010, 1:44:37 PM3/30/10
to sage-support
Hello, I think that Georg means SageTeX and LaTeX.

What kind of error do you get. Can you provide a minimal example?

Regards

Robert

ma...@mendelu.cz

unread,
Mar 30, 2010, 1:41:19 PM3/30/10
to sage-support
I guess the we speak abour sagetex - Sage from within TeX.

What kind of error do you get? Post a minimal example, please. But
sometimes it is easier to produce image separately than loose several
days with hacking beamer code.

Regards
Robert

On 30 bře, 19:09, Harald Schilly <harald.schi...@gmail.com> wrote:

Dr. Georg Damm

unread,
Mar 30, 2010, 1:32:12 PM3/30/10
to sage-s...@googlegroups.com

I use sagetex and the latex beamer class:

...
\usepackage{sagetex}
\setbeamercovered{transparent}
\beamerdefaultoverlayspecification{<+->}
...
\begin{itemize}
\item item 1
\item item 2
\item \sageplot[height=4cm][png]{(plot_slope_field(2*x,(x,-4,4),
(y,-4,4))+(x^2-2).plot(-2,2))}
\end{itemize}

This creates 3 foils as expected, but the picture shows up in all 3
foils.
\uncover<3->{\sageplot...} does'nt work, \only<3>{\sageplot...}
doesn't look good.

I like to do something like
\sageplot<3->[height=4cm][png]{(plot_slope_field(2*x,(x,-4,4),
(y,-4,4))+(x^2-2).plot(-2,2))}
that forces sagetex to use \includegraphics<3->{...} instead of
\includegraphics{...}.

Georg

signature.asc

Dr. Georg Damm

unread,
Mar 31, 2010, 4:50:34 AM3/31/10
to sage-s...@googlegroups.com

ma...@mendelu.cz

unread,
Mar 31, 2010, 8:34:32 AM3/31/10
to sage-support
Hi, this question is not trelated to Sage, but to TeX.

Beamer redefines a lot of things, From this reason I do not like this
package. Anyway:

* sageplot does not allow option <3->

* Does \visible help?

* Do you have any reason to insert png graphics? Vector graphics would
produce much better result.

\documentclass{beamer}


\usepackage{sagetex}
\setbeamercovered{transparent}
\beamerdefaultoverlayspecification{<+->}

\begin{document}
\begin{frame}[frame]


\begin{itemize}
\item item 1
\item item 2

\item \visible<3->{\sageplot[height=4cm][png]{plot(x^2,(x,-2,2))}}
\end{itemize}
\end{frame}

\end{document}

Dr. Georg Damm

unread,
Mar 31, 2010, 9:37:33 AM3/31/10
to sage-s...@googlegroups.com
Hi,

> Hi, this question is not trelated to Sage, but to TeX.
>
> Beamer redefines a lot of things, From this reason I do not like
> this package. Anyway:
>
> * sageplot does not allow option <3->

Ok, then i should file a bug report (enhancement) for this.

> * Does \visible help?

No. \visible is ignored.

> * Do you have any reason to insert png graphics? Vector graphics
> would produce much better result.

Thanks for the hint. (It' a relict of the 3d-plots in this chapter).
[...]

Georg

Dr. Georg Damm

unread,
Mar 31, 2010, 9:49:28 AM3/31/10
to sage-s...@googlegroups.com
>> * Does \visible help?
>No.

I was wrong. Tried it again in a new tex-file and it solved my
problem.
Sorry for the noise.

Georg

ma...@mendelu.cz

unread,
Mar 31, 2010, 2:43:53 PM3/31/10
to sage-support

On 31 bře, 15:49, "Dr. Georg Damm" <Georg.D...@web.de> wrote:
> >> * Does \visible help?
> >No.
>
> I was wrong. Tried it again in a new tex-file and it solved my
> problem.

Nice to hear this.

If you want to make a command aware of beamer frames, you can redefine
it by \newcommand<> macro, as explained in Beamer User Guide, chapter
9.6.1 Making Commands and Environments Overlay-Specification-Aware, it
should be something similar to the example from beamer user guide:

\renewcommand<>{\hyperlink}[2]{\only#3{\beameroriginal{\hyperlink}{#1}
{#2}}}

or something similar to

\renewcommand<>\includegraphics[2][]{\only#3{\beameroriginal
\includegraphics[#1]{#2}}\ignorespaces}

(relevant code from beamer sources). I have seen that there is a
beamer discussion list, you can ask there.

Robert
>
> Georg

Dan Drake

unread,
Mar 31, 2010, 7:37:47 PM3/31/10
to sage-s...@googlegroups.com
On Wed, 31 Mar 2010 at 11:43AM -0700, ma...@mendelu.cz wrote:
> On 31 bře, 15:49, "Dr. Georg Damm" <Georg.D...@web.de> wrote:
> > >> * Does \visible help?
> > >No.
> >
> > I was wrong. Tried it again in a new tex-file and it solved my
> > problem.
>
> Nice to hear this.
>
> If you want to make a command aware of beamer frames, you can redefine
> it by \newcommand<> macro, as explained in Beamer User Guide, chapter
> 9.6.1 Making Commands and Environments Overlay-Specification-Aware, it
> should be something similar to the example from beamer user guide:
>
> \renewcommand<>{\hyperlink}[2]{\only#3{\beameroriginal{\hyperlink}{#1}
> {#2}}}
>
> or something similar to
>
> \renewcommand<>\includegraphics[2][]{\only#3{\beameroriginal
> \includegraphics[#1]{#2}}\ignorespaces}

Ah, this is very nice. I was going to reply and say that rewriting
\sageplot to parse things like \sageplot<-3>{...} would be very hard
(for me, at least; I'm not much of a TeX guru) but now I can put a
reference to this into the SageTeX manual.

Dan

--
--- Dan Drake
----- http://mathsci.kaist.ac.kr/~drake
-------

signature.asc

ma...@mendelu.cz

unread,
Apr 3, 2010, 2:48:58 PM4/3/10
to sage-support
Hi Dan and Georg

On 1 dub, 01:37, Dan Drake <dr...@kaist.edu> wrote:
>
> Ah, this is very nice. I was going to reply and say that rewriting
> \sageplot to parse things like \sageplot<-3>{...} would be very hard
> (for me, at least; I'm not much of a TeX guru) but now I can put a
> reference to this into the SageTeX manual.
>

I can help you to find the correct redefinition of sageplot command,
if you are interested. It should be also simple to do this
automatically by SageTeX whenever beamer class is used. But I think
that this is not a good method. WHY? If the slide contains 10 layers
and we put the graphics from the third layer, we have to generate the
graphics file 7 times! We end up with 7 identical pictures which slow
down the compilation by Sage and the resulting PDF file is too big.

The user should be encouraged to prepare pictures for PDF presentation
separately and use a convenient method to insert these pictures. For
example, there are methods which insert a picture in PDF file only
once, even if it is used on many places. But these topics are not
related to Sage and should be probably discussed somewhere on TeX
group.

Robert

> Dan
>
> --
> ---  Dan Drake
> -----  http://mathsci.kaist.ac.kr/~drake
> -------
>

>  signature.asc
> < 1KZobrazitStáhnout

Reply all
Reply to author
Forward
0 new messages