Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

When you create a new styled notebook from the Stylesheets chooser dialag, you get a new notebook using the chosen style with some sample content provided.

enter image description here enter image description here


But if you apply styles from the same stylesheet to an open blank notebook, there will be no sample content such as Enter title here


My question is how can I create one new cells with a given style and some sample content already present?

For example: I would like to be able to press Alt+1 to create a Title-style cell with words Enter title here.

share|improve this question
    
Why not just create a notebook with what you want. Whenever you want to use it, open that notebook and copy/paste. Or, if you want keyboard shortcuts, just use command-1 for titles, 2 for subtitles etc. –  bill s Jun 9 '13 at 8:55
    
@bills Yes, I sometimes do that like what you said. But if the question is solvable, that'll be more convinient in some cases. –  HyperGroups Jun 9 '13 at 10:27
add comment

1 Answer

Here's one way to go about this:

NotebookPut[Notebook[{Cell["Edit this", "Title"], 
    Cell["Edit that", "Subtitle"],
    Cell["type here", "Section"]}]];

This will create a new notebook with three cells: the first says "Edit this" in the "Title" style, the next says "Edit that" in the "Subtitle" style and the third says "type here" in the "Section" style.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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