Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#8 latex mode

Andrius Tamulis

I very much like the table mode in Emacs, it is incredibly easier to edit using it than to edit a table in raw html, or LaTeX. But I have a quibble with the way that LaTeX source is generated by table.el. TeX is a very powerful typesetting system, which has wonderful and deep algorithms to break lines, compress and expand text, and hyphenate. Thus, it seems wrong to format a table line-by-line for LaTeX. We should let LaTeX do the line breaking, and concentrate on the contents of the table.

So, attached, my humble submission for a change in table.el. First, the current 'latex language is now called 'latex-lines, in case someone wants a line-by-line conversion to LaTeX. I wrote in a 'latex language that converts cell-by-cell.

This is my first pass, and some things are still missing. I have not checked the formatting of the cells. I think that what should be done for this is, in table--generate-source-prologue, is to take the first row of the table, read off the formats of those cells, and adjust the table specification for the tabular environment from that. Then, in table--generate-source-cells-in-a-row, after the first row, if a format differs from the one in the table specification, adjustments can be made.

I've also not addressed multi-row columns. There is a package out there for such things in LaTeX (see http://en.wikibooks.org/wiki/LaTeX/Tables\), but I have never used it. (As a side note, I have never used it in many years of writing LaTeX documents, so perhaps this is not a pressing issue.)

I must also admit that I do not know how to do diffs and patches and updated versions, and all that stuff, for code. So I'm just attaching my version of table.el. My changes are commented.

I've also not changed the documentation.