How to Autonumber Cell Tags in Mathematica Notebooks?

后端 未结 2 1712
时光取名叫无心
时光取名叫无心 2021-01-06 11:06

I tried to follow the directions on autonumbering cells in a Mathematica-8 notebook, here

http://reference.wolfram.com/mathematica/tutorial/AutomaticNumbering.html

2条回答
  •  暖寄归人
    2021-01-06 11:52

    For those of you trying to do something similar: I would recommend doing the following:

    Extract all cell tags in the notebook

    tags= Union[Cases[NotebookGet[nb], (CellTags -> t_) :> t, Infinity]]
    

    Loop through the cells by finding their tags:

    Do[
    NotebookLocate[tags[[i]]];
    (*Some stuff you wanted to do to each cell with a certain tag*)
    ,{i,1,Length[tags]}
    ]
    

    Hope that helps!

提交回复
热议问题