How can I generate a seires of iterable slots in template notebook I can later loop over and assign values to? For example: enter image description here

I could generate this manually by typing out each one. However, it gets very tedious if a lot of slots need to be generated. How can I automate this? Can I use repeating block?

  • $\begingroup$ You could use CellPrint[] and Defer[] for this... $\endgroup$ Jun 8, 2016 at 3:21
  • $\begingroup$ Template notebooks toolbars' containg "Repeating Block" button, you can create only the first set and tell it to iterate over e.g. Range[5]. Is that what you need? $\endgroup$
    – Kuba
    Jun 8, 2016 at 4:55

1 Answer 1

  Notebook[Flatten[{Cell[ToString@#, "Subsection"], 
       Cell["A=" <> ToString@#, "Input"]} & /@ Range@10]]];

Actually I don't think I get your point. Will this code solve your problem?

It will create a new notebook with 10 sections in it. In each section, there'll be one subtitle cell and one content cell, where you can modify its content.

Is that what you need?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.