[sage-support] Re: sagetex: granular builds for large documents

2009-12-01 Thread Eric Drechsel
Hi Harald, thanks for the suggestion, I had thought of that too. It
seems like a viable route. Each subdocument ends up on its own set of
pages, but I guess that's the case when using \include too.

-- Eric

On Dec 1, 3:11 pm, Harald Schilly  wrote:
> On Dec 1, 8:44 pm, Eric Drechsel  wrote:
>
> >  1. Is it possible to have a master document that includes a bunch of
> > complete subdocuments?
>
> The main "problem" is, that you may happen to define a variable in the
> beginning and modify it later and in the end it is used. Therefore
> there is no mechanism to break this chain apart and everything you
> define lives along a full sage session. I don't know how far Dan's
> ideas are, but there is one immediate hack i can suggest you: Just
> create PDF files for each chapter and then stick them together using a
> PDF-merge tool. I haven't done it yet, but i guess it's simple to
> create one big pdf file merging several pdf documents.
>
> H

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: sagetex: granular builds for large documents

2009-12-01 Thread Eric Drechsel


On Dec 1, 3:30 pm, Dan Drake  wrote:
> Hi Eric,
>
>
>
> On Tue, 01 Dec 2009 at 11:44AM -0800, Eric Drechsel wrote:
> > I'm experimenting with a homework workflow using sagetex. I'd like to
> > make efficient use of resources, which seems to be a (the?) major
> > deficiency with sagetex, especially with large documents.
>
> > My initial thought was that by placing each problem in an included
> > file, I could have my build tool generate individual problem_x.sage
> > and problem_x.sout files only for problems with changes, and keep the
> > master tex file as a simple list of includes. I see now that that
> > can't work, however, at least with my limited knowledge of TeX tricks.
>
> > So I'm asking the group for ideas. Starters:
>
> >  1. Is it possible to have a master document that includes a bunch of
> > complete subdocuments? If so, one could simply keep the master
> > document clean of sagetex references, and build each subdocument
> > separately.
>
> My first thought is, if you're talking about using a master document and
> compile times for your homework...you have way too much homework. :)
>
> I don't know about keeping the master document clean of SageTeX
> references, but by using \include, you can keep things separated, and
> you can even compile only part of the document using \includeonly.

Yes, I found out about \includeonly from [1] shortly after posting,
and I think that's what I'll do in the short term (homework being due
Thursday and all :).

[1] http://web.science.mq.edu.au/~rdale/resources/writingnotes/latexstruct.html

>
> One thing you can do with SageTeX to make things go faster is to use the
> pause and unpause commands -- \sagetexpause and \sagetexunpause.
> Commands between those two don't get run when you run Sage on the .sage
> file. (SageTeX literally just comments those sections out in the .sage
> file.)

The issue I have with both \sagetexpause and \includeonly is that
they're not automate-able. Subdocuments seem like a good way to
integrate with build tools (since they can have timestamps etc)

> Actually, with the stuff I've done, the most time-consuming part of
> running Sage on the .sage file is simply startup time. Once it starts
> executing the commands, it generally goes really fast, but starting Sage
> takes a while.

Good point! Most documents are probably not so computationally
expensive as the examples file (which has lots of plots). Does sagetex-
remote help with this much, or is there still alot of overhead in
creating a new session on the server?

> I'll think about your per-file ideas, and about some kind of
> \includeonly stuff. Right now, though, it works document-wide.
>
> What would you like to see? Can you describe some commands or
> functionality that you would find helpful?

Unless you can think of a simple way to add support for generating
separate sage files per tex file (which would also require changing
the way .sout files are included I guess?), it doesn't seem worth the
trouble. I can't begin to read sagetex.sty, so I can't really evaluate
what's a reasonable feature request.

Thanks for your thoughtful response!

Regarding the build tool, I'm using SCons, with which this is my first
experience, and so far I'm liking the flexibility and extensibility
alot. My example project with SConstruct file is here [2]

[2] http://wiki.shared.dre.am/electricity_and_magnetism/probset7/
> Dan
>
> --
> ---  Dan Drake
> -  http://mathsci.kaist.ac.kr/~drake
> ---
>
>  signature.asc
> < 1KViewDownload

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] sagetex: granular builds for large documents

2009-12-01 Thread Eric Drechsel
Hi Dan, others using sagetex

I'm experimenting with a homework workflow using sagetex. I'd like to
make efficient use of resources, which seems to be a (the?) major
deficiency with sagetex, especially with large documents.

My initial thought was that by placing each problem in an included
file, I could have my build tool generate individual problem_x.sage
and problem_x.sout files only for problems with changes, and keep the
master tex file as a simple list of includes. I see now that that
can't work, however, at least with my limited knowledge of TeX tricks.

So I'm asking the group for ideas. Starters:

 1. Is it possible to have a master document that includes a bunch of
complete subdocuments? If so, one could simply keep the master
document clean of sagetex references, and build each subdocument
separately.
 2. Could sagetex be modified to work on a per-file level?

Thanks,
Eric

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Vector fields and Quivers

2008-03-04 Thread Eric Drechsel

Jason: wow, that was quick. I'll try out the plot_vector_field patch
as soon as I figure out how to test patches etc

I ended up using Hector's example and some things from the matplotlib
documentation for my assignment. A notable improvement is using
axis('tight'), which solves the window mis-alignment problem.
Uploaded to https://www.sagenb.org/home/pub/1721

On Mar 3, 8:34 pm, Eric Drechsel <[EMAIL PROTECTED]> wrote:
> Thanks for the matplotlib recipe! I just had the same problem with
> plot_vector_field not accepting coordinate functions of two arguments.
> I went ahead and created an 
> issue:http://trac.sagemath.org/sage_trac/ticket/2381
>
> - Eric
>
> On Feb 17, 10:19 am, "Hector Villafuerte" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > I would like to plot the gradient (i.e. vector field) of functions
> > such as  f(x,y) = exp(-(x^2 + y^2)); in this case:
> > grad(f(x,y)) = vector([ -2*x*exp(-(x^2 + y^2)), -2*y*exp(-(x^2 + y^2)) ])
>
> > Initially I tried with plot_vector_field, but as of now it just "takes
> > two functions of one variable". For my second attempt I used
> > matplotlib, as indicated below (also, see attached plots).
>
> > So my question: is there a SAGEly way to plot this type of vector fields?
> > Thanks in advance!
> > --
> >  Hector
>
> > sage: %python
> > sage: from pylab import *
> > sage: X,Y = meshgrid( arange(-2,2,.2),arange(-2,2,.2) )
> > sage: U = -2*X*exp(-(X*X + Y*Y))
> > sage: V = -2*Y*exp(-(X*X + Y*Y))
> > sage: figure()
> > sage: Q = quiver( U, V)
> > sage: l,r,b,t = axis()
> > sage: dx, dy = r-l, t-b
> > sage: axis([l-0.05*dx, r+0.05*dx, b-0.05*dy, t+0.05*dy])
> > sage: savefig(DATA+'quiver.png')
>
> >  quiver.png
> > 96KViewDownload
>
> >  3d.png
> > 1020KViewDownload
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Vector fields and Quivers

2008-03-04 Thread Eric Drechsel

Thanks for the matplotlib recipe! I just had the same problem with
plot_vector_field not accepting coordinate functions of two arguments.
I went ahead and created an issue: 
http://trac.sagemath.org/sage_trac/ticket/2381

- Eric

On Feb 17, 10:19 am, "Hector Villafuerte" <[EMAIL PROTECTED]> wrote:
> Hi,
> I would like to plot the gradient (i.e. vector field) of functions
> such as  f(x,y) = exp(-(x^2 + y^2)); in this case:
> grad(f(x,y)) = vector([ -2*x*exp(-(x^2 + y^2)), -2*y*exp(-(x^2 + y^2)) ])
>
> Initially I tried with plot_vector_field, but as of now it just "takes
> two functions of one variable". For my second attempt I used
> matplotlib, as indicated below (also, see attached plots).
>
> So my question: is there a SAGEly way to plot this type of vector fields?
> Thanks in advance!
> --
>  Hector
>
> sage: %python
> sage: from pylab import *
> sage: X,Y = meshgrid( arange(-2,2,.2),arange(-2,2,.2) )
> sage: U = -2*X*exp(-(X*X + Y*Y))
> sage: V = -2*Y*exp(-(X*X + Y*Y))
> sage: figure()
> sage: Q = quiver( U, V)
> sage: l,r,b,t = axis()
> sage: dx, dy = r-l, t-b
> sage: axis([l-0.05*dx, r+0.05*dx, b-0.05*dy, t+0.05*dy])
> sage: savefig(DATA+'quiver.png')
>
>  quiver.png
> 96KViewDownload
>
>  3d.png
> 1020KViewDownload

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---