4

I am a sage novice trying to export a table output to some image format (so that it might be shared). I tried using the .save() function as so:

my_table1 = table(my inputs) result = my_table1.transpose() result.save('here')

My table outputs properly after I run the program (not featured), but for some reason I receive the following error when I try and save the table:

"Error! /home/sage/Documents/here.sobj is not UTF-8 encoded

Saving disabled.

See Console for more details."

Any help in exporting this table is greatly appreciated. Additionally, if you require any more information please do not hesitate to ask!

Background: I am working in Jupyter for Sage on a browser via localhost/8000; not sure if that matters. My OS is Windows 10 and I am using Sage version 7.6.

  • Did you check that /home/sage/Documents/here.sobj (wherever that may be on a Windows 10 system) is UTF-8 encoded? – simlev Jul 27 '17 at 09:28
  • I'm running sage in Virtual Box on my machine. It has to be installed as an application in VB, and the actual file is just in Downloads. Besides that, I'm not sure how to check whether or not a file destination is UTF-8 encoded. Thank you for your help, sorry I am a novice. – BlobofJello Jul 29 '17 at 01:08
  • This is important information and you should add it to your question. Add links and version for all software and tools you are using. Where did you get the appliance from? My guess is that it's a Linux system, you should login and check the file encoding. If that is too much for you, you should look for a different Sage setup, one that you are more comfortable with. – simlev Jul 29 '17 at 21:21

1 Answers1

1

Would LaTeX output help? Using an example in the documentation for table?:

rows = [['a', 'b', 'c'], [100,2,3], [4,5,60]]
table(rows)._latex_()

'\\begin{tabular}{lll}\na & b & c \\\\\n$100$ & $2$ & $3$ \\\\\n$4$ & $5$ & $60$ \\\\\n\\end{tabular}'

You could try for the html but that would be harder, because it returns a HTMLFragment object, and you'd need the MathJax for it to look right.

str(table(rows)._html_())

'<div class="notruncate">\n<table  class="table_form">\n<tbody>\n<tr class ="row-a">\n<td>a</td>\n<td>b</td>\n<td>c</td>\n</tr>\n<tr class ="row-b">\n<td><script type="math/tex">100</script></td>\n<td><script type="math/tex">2</script></td>\n<td><script type="math/tex">3</script></td>\n</tr>\n<tr class ="row-a">\n<td><script type="math/tex">4</script></td>\n<td><script type="math/tex">5</script></td>\n<td><script type="math/tex">60</script></td>\n</tr>\n</tbody>\n</table>\n</div>'

In any case, the image wouldn't be savable as-is. Unless you took a screenshot!

kcrisman
  • 4,374
  • 20
  • 41