1
$\begingroup$

I often assign label to cells by OptionInspector (SHIFT + CRTL + O) > CellFrame > etc. It would be great to have the possibility to jump directly to CellFrameLabel or, even better, to edit the label simply clicking on it. Any hint ? P.S. If it matters, in this period I'm using ver. 8.0.1.0

$\endgroup$
  • 1
    $\begingroup$ This will make a button that sets the label to values specified by t. maybe you can use KeyEventTranslations.tr to make a shortcut for it. t = {"a", "b", "c", "d"}; Button["cell frame", SetOptions[SelectedCells[InputNotebook[]][[1]], CellFrameLabels -> {{t[[1]], t[[2]]}, {t[[3]], t[[4]]}}]] $\endgroup$ – egwene sedai Feb 5 '16 at 9:46
  • $\begingroup$ Thanks for your reply! I don't understend what SelectedCells means. So I have tried this variant: t = {"a", "a", "a", "a"}; Button["cell frame",SetOptions[NotebookSelection[InputNotebook[]],CellFrameLabels -> {{t[[1]], t[[2]]}, {t[[3]], t[[4]]}}]] and it seems to work.. Please can you enlighten me ? $\endgroup$ – mitochondrial Feb 5 '16 at 12:15
  • $\begingroup$ I think SelectedCells refers to the cell with the input cursor, or selected via the bracket at the right side of the cell. $\endgroup$ – egwene sedai Feb 5 '16 at 13:01
  • $\begingroup$ An useful trick, to set labels to progressive numbers: counter = 0; Button["cell frame", SetOptions[NotebookSelection[InputNotebook[]], CellFrameLabels -> {{ToString[++counter], None}, {None, None}}]] . Unfortunately, it work only as long as counter is defined. After the notebook has been closed and reopend how can I get the last label assigned and put it tn counter ?. $\endgroup$ – mitochondrial Feb 5 '16 at 13:26
  • 1
    $\begingroup$ Dynamic[counter, SaveDefinitions -> True] may save the counter; but bear in mind SaveDefinitions is considered a bit dangerous here. $\endgroup$ – egwene sedai Feb 5 '16 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.