Skip to content

%latex -- bug in passing in predefined sage variables (serious but probably very easy to fix) #1897

@williamstein

Description

@williamstein
12:46 < ianxek> hi there
12:47 < ianxek> A Latex question in sage : if I define a variable say x=3 and later on use the
                %latex environment and use $\sage{x}$ then it says x is unknown
12:48 < ianxek> How do I tell sage to access the previously defined x ?
13:03 < sage> This is a bug in Sage!
13:03 < sage> However, here is a workaround until it gets fixed.
13:03 < sage> ianxek.
13:03 < sage> latex.eval('$2+\sage{a}$', locals=globals())
13:03 < sage> I.e., instead of typing %latex in the cell, do 
13:04 < sage> latex.eval("A latex string", locals=globals())
13:04 < sage> And you'll see the variables properly.
13:04 < sage> Thanks for asking this question.

I think the problem involves system.eval not getting passed the
globals() dictionary correctly...

Component: notebook

Issue created by migration from https://trac.sagemath.org/ticket/1897

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions