Dear LyX developers & users,

Now that LyX 2.0 is about to be launched perhaps it is a good time to mention the missing element in the 'LyX office suite'. At present LyX provides the wordprocessor & mathematics editor, beamer (presumably) covers the slide show/presentation side of things, and I understand from keeping an eye on the developers' list that biblatex is being worked on. Biblatex is more than just a bibliography engine -- it lends itself to handling more general databases, which is how I've used it (a large database of people). Thus the obvious missing element from the 'LyX office suite' is a spreadsheet facility. At present one can't even sum a column of figures in a table.

I've recently discovered the latex spreadtab package which provides limited but useful spreadsheet facilities. It is being actively developed. The spreadtab manual shows a good range of applications, and I've created a timesheet with this package in which you enter date, start & end times and spreadtab then calculates time worked, the total hours worked over all entries, and the daily hours worked, and compiles to a nice pdf.

Even now, LyX's table button and toolbar is helpful for building a spreadtab table. Having tried both, I found it much easier to do this in LyX than in a text editor. In a LyX table one has the ability to insert or delete rows or columns and not have to fuss over all those ampersands and keeping them in sync with the formatting header if you want to add or delete columns, which is messy if there are wide formulas in some columns and not others. When the table has been filled with spreadtab commands and data, open the source view window in LyX, copy the table code, and paste it into an ERT inset. Insert line breaks, find & replace items like '\textbackslash' with '\', '\{' with '{', '\}' with '}', '\tabularnewline' with '\\' and adjust the table header if there are hidden columns.

At present, inserting an empty (say) 2 by 3 table in LyX & viewing the source code shows:

\begin{tabular}{|c|c|c|}
\hline
 &  & \tabularnewline
\hline
\hline
 &  & \tabularnewline
\hline
\end{tabular}

The spreadtab package with the same latticework of lines requires:

\begin{spreadtab}{{tabular}{|c|c|c|}}
\hline
 &  & \\
\hline
\hline
 &  & \\
\hline
\end{spreadtab}

In my ignorance, these don't look too different. It would be nice to have a button on the table toolbar which would convert the former into the latter, and even better if it would do the find-&-replaces referred to earlier, or something equivalent.

The spreadtab manual describes its mode of working: first it reads the body of the table, then it computes the formulas in the cells, then it rebuilds the table replacing formulas with calculated values. The final result is a latex table which only then gets compiled as such.

The current lack of even a basic 'active' table in LyX, where you can sum a column of figures for instance, seems an obvious missing element in the LyXian scheme of things. Spreadtab could fill that gap.

Andrew Parsloe


Reply via email to