partial linked cells

21 views
Skip to first unread message

Wolfgang Lindner

unread,
Dec 1, 2018, 4:39:49 AM12/1/18
to sage-cell
Hello Group,

using the markdown editor ByWord on MacOS it is possible to activate Sage cells.
In the following script I try to mix unlinked and linked cells.

The first two cells work as expected.
But the last cell 'show(x*y)' does not work.

What I am doing wrong?

HTH Wolfgang
Leichlingen, Germany

--

<html>

<script>sagecell.makeSagecell({"inputLocation": ".sage",
                               languages: sagecell.allLanguages
                               //,linked: false
                               });</script>

<div class="sage"><script type="text/x-sage">
x = 5; y = 2
show(x+y)
</script></div>

// ----- cell not linked, evaluation error because of unknown x and y:

<script>sagecell.makeSagecell({"inputLocation": ".sage",
                               languages: sagecell.allLanguages
                               //,linked: false
                               });</script>

<div class="sage"><script type="text/x-sage">
show(x+y)
</script></div>

// ------  now 2 linked cells:

<script>sagecell.makeSagecell({"inputLocation": ".sage",
                               languages: sagecell.allLanguages,
                               linked: true});</script>
<div class="sage"><script type="text/x-sage">
x = 5; y = 2
show(x+y)
</script></div>

//.. giving evaluation error again (because of ?? ):


<script>sagecell.makeSagecell({"inputLocation": ".sage",
                               languages: sagecell.allLanguages,
                               linked: true});</script>
<div class="sage"><script type="text/x-sage">
show(x*y)
</script></div>


</html>

Andrey Novoseltsev

unread,
Dec 2, 2018, 1:05:43 PM12/2/18
to sage-cell
When you call makeSagecell, it processes the whole document. If you call it again with the same inputLocation - nothing happens. So in your file the first call made 4 unlinked cells and they worked as expected. If you want to have linked and unlinked cells on the same page or multiple groups of linked cells, give them different names as below. (You can also see that cells are linked because the border remains green, indicating that the corresponding kernel is still running.)

Thank you!
Andrey


<html>

<script src="https://sagecell.sagemath.org/static/embedded_sagecell.js"></script>
<script>sagecell.makeSagecell({"inputLocation": ".sage",
                               languages: sagecell.allLanguages
                               //,linked: false
                               });</script>

<div class="sage"><script type="text/x-sage">
x = 5; y = 2
show(x+y)
</script></div>

// ----- cell not linked, evaluation error because of unknown x and y:

<div class="sage"><script type="text/x-sage">
show(x+y)
</script></div>

// ------  now 2 linked cells:

<script>sagecell.makeSagecell({"inputLocation": ".sage2",

                               languages: sagecell.allLanguages,
                               linked: true});</script>
<div class="sage2"><script type="text/x-sage">

x = 5; y = 2
show(x+y)
</script></div>

//.. giving evaluation error again (because of ?? ):

<div class="sage2"><script type="text/x-sage">
show(x*y)
</script></div>


</html>

Lindner Dr. Wolfgang

unread,
Dec 2, 2018, 2:32:30 PM12/2/18
to Andrey Novoseltsev, sage-cell
Thank you, Andrey, for this clear solution with a good explanation.
Wolfgang

--
Dr. Wolfgang Lindner
0175 8890002
 

Von: sage...@googlegroups.com im Auftrag von Andrey Novoseltsev <novo...@gmail.com>
Gesendet: Sonntag, Dezember 2, 2018 19:05
An: sage-cell
Betreff: [sage-cell] Re: partial linked cells
 
--
You received this message because you are subscribed to the Google Groups "sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cell+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cell/7d809d9b-484a-482a-aa4a-86711490d5a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages