I am working in a notebook. I would like to be able to easily style and restyle text fragments in a notebook text cell. I want to determine this styling in a style sheet, so that text fragments are styled separately from the other text. (So, I don't want to just select and style each fragment separately; I want stylesheet control over the styling of all code fragments at one go.) This is of course trivial in an HTML document: just place the fragment in a CODE element or a KBD and style it with CSS. How is it done in a Mma document?
Edit:
I'm going to reframe this a bit to emphasize work flow. Consider notebook usage and entering text in a text cell. In addition to being able to easily enter math, here are some types of text we might want (in terms of HTML elements): code, kbd, emph, samp, strong. If I understand correctly, Mma does not build in such text-level semantics to instead provides StyleBox
as a rough equivalent of a span
with a specified "style" playing the role of a class attribute for the span. So it appears the right way in Mma to discard the idea of semantic elements and focus on the idea that any semantics will be embodied in the names of styles. Unfortunately, if I press Alt-0 while entering text and then enter a style, it does not start a style box but instead styles the whole cell. (Is this desirable? It seems wrong.) So I think my question has become, can I hijack Alt-0 for starting style boxes with the same interface for entering a user-specified style?
(If this edit seems to shift the emphasis of the question too much, I can change it to a new question.)
Comments
Post a Comment