On 6/05/2011 10:26 a.m., Julien Rioux wrote:
On 05/05/2011 12:22 AM, Andrew Parsloe wrote:
On 5/05/2011 12:32 p.m., Charlie wrote:

If a vote is being taken on this feature request.

I would rather that it doesn't happen, so please put me down as a "no".

Please don't do it.

There are plenty of spreadsheet programs and if you haven't completed
your work in the program you use, why would you place it into a LyX
document and edit it anyway? LyX is great as is.

Thank you,
Charlie

I think I have confused people, perhaps because I used the phrase 'LyX
office suite' (but in quotes -- it was meant with a certain
tongue-in-cheek quality) and mentioned the word spreadsheet.

I meant something more on these lines: you have a table in LyX with a
few columns of figures; you want the totals of the columns, perhaps a
grand total. The numbers aren't at this point fixed. New data may arise
as you work on your document. Yes you could open a spreadsheet program
but it's just two or three columns and there's a certain overkill about
that.

Alternatively, you can put \usepackage{spreadtab} in your preamble and,
as things are at present, open an ERT inset, write
\begin{spreadtab}{{tabular}{|c|c|c|}}, construct the table with the
figures, ampersands, newline markers \\, spreadtab's sum() command, and
finish with \end{spreadtab}. It's now there in your document easily
accessible for any adjusted figures to be entered. This is what I do
now. LyX doesn't do any calculating.

But it is easier to enter figures and text into a table in LyX proper
rather than ERT. My request was for a button on the table toolbar that
would change LyX's \begin{tablular}{|c|c|c|} into
\begin{spreadtab}{{tabular}{|c|c|c|}}, and \end{tabular} into
\end{spreadtab}, and a few 'tidying up' operations like replacing
\tabularnewline with \\. Again, no request that LyX acquire calculating
abilities. Rather, the ability to replace one environment, tabular, with
another, spreadtab. The calculational abilities are in spreadtab and, as
far as LyX is concerned, are a side-effect of the environment change.
LyX doesn't need to acquire spreadsheet capabilities. I have no wish to
see it heading down the road of OpenOffice.

Andrew


Being able to customize the output of a tabular like this is in my
opinion a valid request and more general than just this particular case
(spreadtab, which I did not know). There are a number of latex
environment which use tab alignment &. All of them would benefit from
the nice interface that LyX provides. I can think of tikz \matrix{}, or
customizing a table using the booktabs package, for example.

The proper way to implement this is not obvious, but extending the
layout syntax would be the most flexible, with the specifics about
spreadtab in a spreadtab.module file.


My current practice is to open a table in LyX, leave the top left cell blank then label the remaining cells of the top row a, b, c, ... and the remaining cells of the first column 1, 2, 3 ... I fill in the table with text and figures but ensure that any spreadtab commands involving the backslash (e.g. \STcopy) or curly brackets (e.g. :={}) are entered in ERT -- it just means doing ctrl-L before entering these elements. The labelling of the first row & column make cell references easy. When finished I delete the first row & column, copy the code from the source view window and paste it into an ERT inset (outside the table of course). One still needs to insert line breaks, change \tabularnewline to \\, and the \begin and \end statements but that's all.

On a slightly different point, spreadtab itself isn't fussy about whether it works with the tabular environment or others. The examples in the spreadtab manual are mainly for tabular, but other environments used are matrix, array and tabularx.

Andrew

Reply via email to