Question

This may be a stupid question, but I can't figure it out. I have made some tables in SPSS. Now I want them over to my latex document.

What I do, it that I right-click the table in SPSS, and press export. Here I can choose between PDF or .doc. BUT the PDF-file created, generates a file with the table on top of a page (A4 size, with "page 1" at the bottom). I do not want this, I only want the table. example how it turns out: How it turns out, I do not want this

Example how I want it to turn out: I want it like this

If I export to word, I can further save as PDF, but same problem occurs.

Screenshot works, but does not give me the same picture-quality that I prefer.

Do anyone of you have any tips for me? Thanks :)

No correct solution

OTHER TIPS

Unfortunately SPSS does not provide native table export to Latex. It does provide table export to html and xls, which can post-hoc be converted to Tex tables. PDF output for everything forces to export the full page (very annoying for graphics as well) - but you probably don't want to insert the image of the table (you could crop the PDF if need be), but have a Tex table (in the same font) as your document anyway.

One thing I have done in the past to make the export to text tables with specific markup is to use the PRINT or LIST commands to print the text table to the output (or to a text file) that is closer to the end goal. In this NABBLE post I have some syntax that makes pandoc flavored pipe style markdown tables - it should be pretty clear how that same approach could be used for Tex tables (actually Tex tables should be much simpler).

Here is an example of some code using LIST to make a the markup closer to Tex tables.

DATA LIST FREE / Variable (A1) Mean Median (2F4.2).
BEGIN DATA
A 3.25 2.00
B 2.56 2.50
C 9.87 10.20
END DATA.

*Using LIST to make Latex style table.
STRING Mid (A1) End (A2).
COMPUTE Mid = "&".
COMPUTE End = "//".
LIST /VARIABLES = Variable Mid Mean Mid Median End.

And here is a screen shot of the produced output on my machine.

enter image description here

So here I would still have to copy-paste the text output into my Tex document, (and make the header row).

You can also use OMS to save designed items in a variety of formats, including XML and then use an xml-to-Latex tool such as xmltex. You could probably even generate such a conversion with XSLT from the XML.

From the Viewer, you could also retrieve the table with Python scripting and use a Python-based converter tool.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top