Suppose I have a notebook with cells tagged with both numbers and words with numbers always list first, and some cells without cell tags e.g.:
Notebook[{
Cell[ ..., CellTags->{"1","cat"}],
Cell[ ..., CellTags->{"2","dog"}],
...
Cell[ ...],
Cell[ ..., CellTags->{"7","cow"}],
...
}, notebook options ...]
What is the easiest way to sort the cells based on 1) cell tag numbers, i.e. the first element in the cell tag list; and 2) cell tag words, i.e. the second element in the cell tag list?
Note that there could be additional tags but the first and second tags are always number and single word. Note also there there is unlikely to be grouped cells (none at this stage), although a solution that took cell grouping into account and rendered a sorted ungrouped answer would be fine. I want a fast way to sort a notebook and render the newly sorted form. I'm thinking ideally I'd like a palette button for this.
Comments
Post a Comment