On 28/11/2012 1:13 p.m., Scott Kostyshak wrote:
On Tue, Sep 18, 2012 at 7:01 PM, Andrew Parsloe <apars...@clear.net.nz> wrote:
I've attached a python script, tablesort.py, a module tablesort.module
containing a custom inset (suggested by Liviu Andronic), and an explanatory
document, SortingTablesInLyX.lyx detailing what goes where and how to use
it. In this third incarnation of the script, by using the custom inset,
adding three buttons to the table toolbar, and changing the Overwrite on
export setting, it is possible to sort the rows of tables in LyX in a manner
that avoids all nag/query/prompt messages and feels "built-in". Sorts may be
alphabetical or numerical, ascending or descending. The default horizontal &
vertical rules delineating table cells are not disturbed by the sort. ERT in
table cells has no effect. Yellow (or other) notes by default also do not
affect the sort, but this can be changed with the -y option when invoking
the script, allowing fine-tuning of sort order. Finally, multiple tables in
the same document can be sorted at one go.
Andrew
Thank you for this, Andrew. This work is very creative. I'm especially
impressed by your excellent documentation. Is this on the wiki
somewhere?
Scott
Thanks for the comments Scott. It's on the Wiki at
http://wiki.lyx.org/Examples/SortingTablesInLyX
("Examples" seems to be something of a catch-all) which includes a link
to the MARC archive where the files are:
http://marc.info/?l=lyx-users&m=134800934727097&w=2
I've used the same trick (exporting to an alternatively named LyX
format, but retaining the lyx file extension) for a number of other
tasks (e.g. sorting lists, expanding abbreviations) and tried to sell
the idea of a proper GUI for launching such scripts to the developers
recently (see http://marc.info/?l=lyx-devel&m=135273675419027&w=2).
Andrew