On Sat, Dec 10, 2016 at 3:30 PM, Qian Hong <fract...@gmail.com> wrote:

> Thanks David,
>
> On Sun, Dec 11, 2016 at 7:02 AM, David Roe <roed.m...@gmail.com> wrote:
> > The issue is with the simplification of the expression, rather than the
> > latex function.  The following currently works:
> >
> > sage: latex(x.mul(x.power(-1),hold=True))
> > \frac{x}{x}
> >
> > Is this sufficient for your purposes?  If not, the relevant code is in
> > sage/symbolic/expression.pyx (it's a big file: search for `hold=False`).
>
> No, this is not automatically enough, I'm looking for an automatic way
> rather than manually rewriting every expressions. In other words, I'm
> looking for something like 100k lines of sage expression samples, and
> then automatically generate 100k latex expressions and 100k images.
> Thank you for point out the relevant code, I'll start from there!
>

I don't think there's currently an easy way to do this.  I think the
easiest option would be to add a way to globally set `hold=True`.  This
will involve messing around with the functions that use it (easiest way to
find them is `search_src("hold=False")`).  See
sage/structure/proof/proof.py for a model of how to do this.  Another
option would be to use a parser to generate expressions like `
x.mul(x.power(-1),hold=True)` from `x/x`.

>
> BTW, is there anyone has idea where to find as many as sage expression
> samples?
> im2latex-100k set is built on arxiv.org papers [1]
> I built another latex formula set based on math.stackexchange.com open
> data [2]
> Is there some place containing a lot of sage expression so I can
> extract and reuse rather than constructing from scratch?
>

The only thing I'm aware of is the Sage documentation, which I think isn't
quite what you're looking for.
David

>
> [1] https://github.com/Miffyli/im2latex-dataset/blob/master/latex_urls.txt
> [2] https://archive.org/details/stackexchange
>
>
>
> --
> Regards,
> Qian Hong
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to