ivankokan / Excel2LaTeX

The Excel add-in for creating LaTeX tables
Other
1.27k stars 147 forks source link

Fixed-width columns #11

Closed jackassplus closed 8 years ago

jackassplus commented 8 years ago

Fixed width columns. \multicolumn doesn't wrap so the ability to have fixed column width would be beneficial.

\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

 \begin{longtable}{|C{0.6in}|m{1.9in}|m{2.5in}|C{0.85in}|m{0.75in}|m{2.25in}|}
 \rowcolor[rgb]{ .863,  .902,  .945} \textbf{A6.1} & \multicolumn{2}{L{4.5in}}{some really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really  really long text} & & & \\\hline
...
chelh commented 8 years ago

Could you please describe what you'd like a little bit more?

jackassplus commented 8 years ago

In the form (if possible) a way to specify column width in some latex acceptable form (in, cm, etc). And a checkbox for fixed with columns.

More often than not, I use the longtable environment. Likewise, I often have merged cells. There’s no really reliable way that I have found to deal with that combination using any other means than fixed width columns.

On Aug 17, 2016, at 2:23 PM, Chelsea Hughes notifications@github.com<mailto:notifications@github.com> wrote:

more

chelh commented 8 years ago

How about this: When Excel2LaTeX encounters a cell/column that contains text and has wrapping on, it will translate that into a p column with width equal to the column width in Excel (converted to em, accounting for merges if needed). Would that help in your case?

jackassplus commented 8 years ago

I’m definitely willing to give it shot! for the record, the spreadsheet in question is here: ISMS implementation trackerhttp://www.iso27001security.com/ISO27k_ISMS_and_controls_status_wtth_SoA_and_gaps.xlsx on this page: http://www.iso27001security.com/html/toolkit.html

chelh commented 8 years ago

Okay, try this new build: Excel2LaTeX.zip

jackassplus commented 8 years ago

As soon as I manage to unbreak Excel… A document with the name 'Excel2LaTeX.xla' is already open. every time I try to use it.

jackassplus commented 8 years ago

I’ll play with it more tomorrow.

jackassplus commented 8 years ago

Still broken. May have to call Microsoft on this one.

chelh commented 8 years ago

Do you have another copy of Excel2LaTeX.xla opened via the Add-Ins window?

jackassplus commented 8 years ago

Nope. Open Excel (for Mac 15.24 (160709)) Then open any spreadsheet I go to the Add-ins tab and click on either button. I get that error. I go to Tools > Excel Add-ins, uncheck Excel2Latex >OK click the button. then it says 'Excel2Latex.xla' could not be found. Go back in and recheck the box, A document with the name 'Excel2LaTeX.xla' is already open.

chelh commented 8 years ago

Have you gotten a response from MS support regarding this?

jackassplus commented 8 years ago

I have not. I’ll probably have to reinstall Excel. I can’t get to this again until next week.

krlmlr commented 8 years ago

Have you tried ProcessExplorer from SysInternals? It can show the location of the alleged "already open" Excel2Latex.xla.

chelh commented 8 years ago

Any progress?

jackassplus commented 8 years ago

'fraid not. haven't had any time. Secretly hoping it will just work someday.

jackassplus commented 8 years ago

I'm officially giving up. The stuff I would need to convert are relatively static in form, so I'm just going to use awk templates to post-process exported CSV.

MUCH easier than getting Excel to behave.