For Programmers: Free Programming Magazines  


Home > Archive > Mathematica > September 2007 > Still More Stylesheet Questions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Still More Stylesheet Questions
Kevin J. McCann

2007-09-22, 4:27 am

This seems like a never ending battle.

I have developed a new Stylesheet based on the JournalArticle
Stylesheet. The biggest changes are to redefine what the next new cell
type is. For example, the original Stylesheet starts off with the
default Title cell, after that has been typed, if you click on the next
line, the it gives a Subtitle cell, and so on. All of these are
controlled by the DefaultNewCellStyle option for each cell type. I
changed all of these to Input. However, when I go to use this new
Stylesheet, I find, for example, that after a Section has been entered
that the next new cell type is Text even though the Stylesheet says
Input. If I actually click on the Section in the notebook that uses this
SS, it says the DefaultNewCellStyle is Text. This is driving me crazy
and there is virtually no documentation on it. If someone can help me, I
would appreciate it. Thanks,

Kevin

Chris Chiasson

2007-09-23, 4:38 am

On Sep 22, 2:30 am, "Kevin J. McCann" <Kevin.McC...@umbc.edu> wrote:
> This seems like a never ending battle.
>
> I have developed a new Stylesheet based on the JournalArticle
> Stylesheet. The biggest changes are to redefine what the next new cell
> type is. For example, the original Stylesheet starts off with the
> default Title cell, after that has been typed, if you click on the next
> line, the it gives a Subtitle cell, and so on. All of these are
> controlled by the DefaultNewCellStyle option for each cell type. I
> changed all of these to Input. However, when I go to use this new
> Stylesheet, I find, for example, that after a Section has been entered
> that the next new cell type is Text even though the Stylesheet says
> Input. If I actually click on the Section in the notebook that uses this
> SS, it says the DefaultNewCellStyle is Text. This is driving me crazy
> and there is virtually no documentation on it. If someone can help me, I
> would appreciate it. Thanks,
>
> Kevin


It is probably being inherited from another stylesheet.


chuck009

2007-09-26, 8:15 am

Hello Keven. Here's the problem: it's a sensitive situation. Or between you and me: "they haven't gotten all the bugs out yet". But that's ok. It stll works pretty good if you give Mathematica a chance to "adjust" to your style changes. That's the
key: adjustment time.

Start from scratch just to get the "DefaultNewCellStyle" working when you place the cursor right below a "Section" cell and start typing:

With a fresh kernel, go to Format/StyleSheets and choose Article/Journal Article. Now choose Edit style sheets and obtain "private style definitions" for untitled-1. In the choose a style to modify menu, choose "section". A private override of Section
will appear. Go to that cell and press Shift/Return E. You'll get

Cell[StyleData["Section"]]

And that's it. It's just a skeleton that you need to edit. So add the NewDefaultCellStyle:

Cell[StyleData["Section"],
NewDefaultCellStyle -> "Input"
]

Close the cell, choose "save as" say "myNewArticleStyle". Make sure it's in the StyleSheet directory. But this session of Mathematica won't recognize it yet. (Don't know why). Just leave mathematica and start a new session. You should see "myNewArticl
eStyle" when you choose Format/StyleSheets. choose it. Now, enter the title, author, then choose a Section cell and enter something. Now here comes the test:

Place the cursor right below that Section style and begin typing. I bet a dollar the new cell that appears will be an input cell style :)

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com