michal-h21 / odsfile

LaTeX package for reading opendocument spreadsheet files.
14 stars 2 forks source link

attempt to index local 'x' (a nil value) #1

Closed mvhulten closed 9 years ago

mvhulten commented 10 years ago

I have an ods file (named test.ods) with one sheet (named Blad1). This consists of three rows and three columns. I am including this in a TeX file (tabods.tex) as follows: \documentclass{article} \usepackage{odsfile} \begin{document} \begin{tabular}{lll} \includespread{file=test.ods,sheet=Blad1} \end{tabular} \end{document}

When I run lualatex tabods.tex, I get this error: ! LuaTeX error .../texlive/texmf-dist/tex/lualatex/odsfile/odsfile.lua:25: atte mpt to index local 'x' (a nil value) stack traceback: .../texlive/texmf-dist/tex/lualatex/odsfile/odsfile.lua:25: in function 'getTa ble' <\directlua >:1: in main chunk. \luacode@dbg@exec ...code@maybe@printdbg {#1} #1 }

l.6 \includespread{ file=test.ods,sheet=Blad1}

michal-h21 commented 10 years ago

Hello, it seems that file test.ods wasn't loaded correctly. Could you post it somewhere? Michal

2013/12/23 mvhulten notifications@github.com

I have an ods file (named test.ods) with one sheet (named Blad1). This consists of three rows and three columns. I am including this in a TeX file (tabods.tex) as follows:

\documentclass{article} \usepackage{odsfile} \begin{document} \begin{tabular}{lll} \includespread{file=test.ods,sheet=Blad1} \end{tabular} \end{document}

When I run lualatex tabods.tex, I get this error:

! LuaTeX error .../texlive/texmf-dist/tex/lualatex/odsfile/odsfile.lua:25: atte mpt to index local 'x' (a nil value) stack traceback: .../texlive/texmf-dist/tex/lualatex/odsfile/odsfile.lua:25: in function 'getTa ble' <\directlua >:1: in main chunk. \luacode@dbg@exec ...code@maybe@printdbg {#1} #1 }

l.6 \includespread{ file=test.ods,sheet=Blad1}

— Reply to this email directly or view it on GitHubhttps://github.com/michal-h21/odsfile/issues/1 .

mvhulten commented 10 years ago

Certainly, the file is located here: http://d-brane.net/pub/test.ods It was created with LibreOffice 3.6.7.2.

michal-h21 commented 10 years ago

I found the problem. There is an old version of luaxml library on CTAN, this version is incompatible with luatex 5.2, which is included in TeX Live

  1. I fixed these problems some time ago, but forgot to upload it to CTAN.

So until I upload correct version to CTAN and until it is installed to TeX Live, you can download corrected code from https://github.com/michal-h21/LuaXML and place the files to your local texmf tree, or to the directory with your document.

After you fix the problem with luaxml library, you can use odsfile in this way, for example:

\documentclass{article} \usepackage{odsfile} \usepackage[]{booktabs}

\begin{document}

\includespread[file=test.ods, sheet=Blad1,template=booktabs, columns=head] \end{document}

This will use booktas package and first row will be used as table header.

Best regards, Michal

2013/12/23 mvhulten notifications@github.com

Certainly, the file is located here: http://d-brane.net/pub/test.ods It was created with LibreOffice 3.6.7.2.

— Reply to this email directly or view it on GitHubhttps://github.com/michal-h21/odsfile/issues/1#issuecomment-31130226 .