Message Boards Message Boards

1
|
6465 Views
|
1 Reply
|
3 Total Likes
View groups...
Share
Share this post:

Build a LaTex table from a Dataset

Posted 4 years ago

Hi everybody!

Is it possible to turn a Dataset object into a Tex expression? One can easily build a dataset fom an Excel file:

Tableau = SemanticImport["UneFeuille.xlsx", Automatic];

Right, but :

Export[Tableau, "TeXFragment"]

for example, doesn't work. What should i do? Thanks a lot,

Claude

Attachments:
POSTED BY: Claude Mante

Dataset can wrap up a lot of things, but if you have a simple List of Lists inside, you can just do the following and get a Latex array.

Query[TeXForm][Dataset[RandomInteger[{1, 10}, {20, 2}]]]

You can also write out a full TeX document as follows:

Query[TeXForm /* (ExportString[#, "TeX"] &)][
 Dataset[RandomInteger[{1, 10}, {20, 2}]]]

And you can always use Export with a filename instead of ExportString to write out the TeX to a file.

If your Dataset is wrapping something more complicated such as a List of Associations or Association of Associations, I am not sure how TeXForm is going to work. For example, the code below "works" but I don't know enough TeX to know if the output is meaningful.

Query[(1 ;; 5) /* TeXForm][ExampleData[{"Dataset", "Titanic"}]]
POSTED BY: Seth Chandler
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract