michal-h21 / odsfile

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

Multi-line support #2

Closed yamsu closed 9 years ago

yamsu commented 10 years ago

odsfile is really useful for quickly adding tables to latex documents, excellent project! However, there is no support for multiline cells. The following tabular environment doesn't work \begin{tabular}{p{1cm}ll} This provide only a single line output as one would get with \begin{tabular}{lll}

Is it possible to get this multiline support?

michal-h21 commented 10 years ago

Breaking long lines with p{width} should work normally. But I found that manually broken cells (with ctrl+enter) didn't work. I added support for them, there is a new option for \includespread - columnbreak (default value is \linebreak). Also, when a table is inserted using templates, p{width} is created automatically for columns with multiline cells.

You can download improved code from github and test it, if everything work correctly, I will upload changes to CTAN.

Michal

2013/12/24 yamsu notifications@github.com

odsfile is really the useful for quickly adding tables to latex documents. However, there is no support for multiline cells. The following tabular environment doesn't work \begin{tabular}{p{1cm}ll} This provide only a single line output as one would get with \begin{tabular}{lll}

Is it possible to get this multiline support?

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

yamsu commented 10 years ago

Hi Michal, Thanks for the response. In fact I figured out that with the old code everything is working if I do not use a template. The following line would not work with p{wight} columns \includespread[file=file.ods,sheet=Sheet1,columns=head,template=booktabs] \includespread[file=file.ods,sheet=Sheet1,columns=head,template=default] \includespread[file=file.ods,sheet=Sheet1,columns=head,template=custom_user_defined]

However, without the template, everything is working. I modified the style file to embed a template for my own use. I will try out the github code and get back to you. Thanks

michal-h21 commented 10 years ago

Yes, older template code used l column types for all columns. Now p{some width} are used if some manual line breaks are used in a column, otherwise l are used. There is now new option for \includespread, coltypes, so it is possible to specify column types if you use templates.

Michal

2013/12/28 yamsu notifications@github.com

Hi Michal, Thanks for the response. In fact I figured out that with the old code everything is working if I do not use a template. The following line would not work with p{wight} columns \includespread[file=file.ods,sheet=Sheet1,columns=head,template=booktabs] \includespread[file=file.ods,sheet=Sheet1,columns=head,template=default]

\includespread[file=file.ods,sheet=Sheet1,columns=head,template=custom_user_defined]

However, without the template, everything is working. I modified the style file to embed a template for my own use. I will try out the github code and get back to you. Thanks

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

yamsu commented 10 years ago

Tested with the updated github code with the following options \includespread[file=table/table.ods,columns=head,template=booktabs,coltypes=cp{4cm}c] Its working!!! Thanks, please do update the CTAN