>Am 18.11.2011 15:20, schrieb Helge Hafting: > >> 2. Error in the example itself. (Affected the example only) >> Spreadsheets were named sheet.gnumeric, sheet.ods and sheet.xls >> All three were exported to "sheet.tex", resulting in >> overwriting due to the name clash. > >The problem is here not the filename. You now use the names sheet1-3. But the >problem I was >referring in my bug report is about that I can insert a Gnumeric table and in >the LaTeX export it is >exported with the file extension ".tex".
This is correct, and as designed. I do not see a problem here. Maybe there is a misunderstanding, what do you expect from the spreadsheet external material support? > So when exporting your spreadsheet.lyx file to LaTeX, you get sheet1.tex, > sheet2.tex sheet3.tex. The Again, as designed. An export to LaTeX creates a bunch of TeX files, so you may work with TeX outside of LyX. > problem is that spreadsheet.tex cannot be compiled using LaTeX and also an > import to LyX is >impossible. A .gnumeric file is completely different from a .xls file. >Sheet1.tex does not exist and >thus LaTeX cannot compile the file. As all three files have the extensions >".tex", an import to LyX >vial tex2lyx is impossible. When I export to LaTeX, I get these five.tex files: spreadsheet.tex, longsheet.tex, sheet1.tex, sheet2.tex and sheet3.tex. Before the patch, this worked for export->LaTeX(plain) but not for export->LaTeX(pdflatex). Now it works for both. And if I compile "spreadsheet.tex", it works. I get a "spreadsheet.dvi" that contains the text from the LyX document, *and* the contents of the included spreadsheets. Clearly, your software must be different from mine, if "spreadsheet.tex" cannot compile using this command: latex spreadsheet.tex or pdflatex spreadsheet.tex This is supposed to work, and yield "spreadsheet.dvi" in the first case, and "spreadsheet.pdf" in the second case. What goes wrong for you? Do you get error messages? As for import via tex2lyx - that was not my goal. I have not tried that, and have no idea if "ssconvert" produces .tex code that tex2lyx can import. Note that this spreadsheet support is *not* meant for importing spreadsheets so that they can be edited as tables inside LyX. Instead, edit your spreadsheets with spreadsheet software (gnumeric, libreoffice or excel.), which is much better suited for editing spreadsheets anyway. Support via the "external material" mechanism do *not* import stuff into LyX, it merely allows stuff (in this case, spreadsheets) to be printed along with the rest of the document - using document fonts and so on. This is similiar to how chess diagrams and xfig figures are supported - they are not converted into anything editable inside LyX either. But they become part of the final output. "External material" is just that - external to LyX. So you can now pull a spreadsheet into LyX and have its content printed with the document - but you still maintain that content using the external spreadsheet software. >So the LaTeX export is definitively incorrect or let's say unusable. >Why do you export all tables as .tex files? The spreadsheets are exported as .tex, because that is what "export->latex" is supposed to do! When you print from LyX. (or make a PDF), the spreadsheets are exported from gnumeric/ods/excel to .tex, and then processed by latex. This part is normally invisible. If you export a LyX document to LaTeX, you get a .tex file ready for processing with LaTeX, and every included file (graphics, spreadsheets, etc) are provided in a form ready for LaTeX processing. In the case of spreasdsheets, that form is a .tex file that contains the printable information in the sheet. In other words, when you do an export, LyX do the first part of the print process, and then hand you the set of files instead of running latex automatically. The purpose of a latex export varies, it is usually to exchange files with someone who works with tex files rather than lyx - or to do apply some not-yet-supported-by-lyx tricks to the latex files before printing. Printing, exporting to PDF and exporting to latex is supposed to work, and there have been several users who have succeeded with this. You may have a software problem - or perhaps a wrong expectation of what the "external material" support for spreadsheets is supposed to do. It is not a tool to import a spreadsheet as a LyX table, it is a tool to include spreadsheet content in the final output. In a manner similiar to how you include a figure in the final output. (final output being a pdf file, a dvi file, a postscript file - or a printed document on paper.) MS office have something similiar, where a document can "link" to a spreadsheet. The point is to not need to synchronize spreadsheet and document, because the spreadsheet is re-processed every time you print the document. So any new content in the spreadsheet will automatically appear the next time you print. The printing process works like this: 1. LyX creates a .tex file from the .lyx file This contain the document text and markup, and references to other files. 2. LyX calls a program called "ssconvert", it converts spreadsheets to .tex files. Such a .tex file contains a latex longtable filled with spreadsheet content. It may or may not be possible to convert such a file with tex2lyx. The ssconvert tool was not developed with LyX import in mind. It is just a tool to convert spreadsheets to latex code. 3. LyX calls "latex" or "pdflatex" to process the produced .tex files. The latex software then creates the final product - usually a pdf file. (Sometimes a postscript or dvi file instead.) 4. The final output file is sent to a printer, or used as-is. Helge Hafting
