I was experimenting with Scrivener Styles in my project that produces Markdown.
I applied Heading 2 to a line, then compiled. No formatting came out, as expected, because I have the general convert to markdown switch off (because it escapes any markdown that I type in manually).
Then I added ## prefix and suffix to the Style in the Compile / Style section and got the output I needed.
So I am happy and this seems to be what I âshouldâ do, so long as I want also to be able to type plain old ## Heading ## whenever I care to. Yes?
Then for fun, I did the same with Emphasis, gave it prefixes of *. Works as expected.
Then I selected a work and typed command I. The word displays as italic but is not styled as italic. Scrivener still thinks it is âNo Styleâ.
Whatâs up with that, please? And âshouldâ I just assign command-I to be the shortcut for Emphasis?
The style is basically doing the typing for you; the ultimate result is the same as if you typed it into the editor. That implies you can also type it into the editor right alongside the use of the style, and that there is no compulsion to use either approach exclusively. In fact, you can mix both of those techniques with Section Layout heading generation as well, which in turn can output static hash levels by type or dynamic hash levels by outline structure.
Iâd use the style (or section layouts) where Iâm unsure of what I might really want later on. Say for example maybe I realise the stuff I marked H2 really ought to be H3. Thatâs an easy fix using the style/layout approach: one central modification to the Format. By typing in the hashes though, I know Iâm getting a static resultâwhich might be exactly what I want.
Modifying which font variant you are using is somewhat meaningless, as are most direct formatting commands. We as humans might parse italicised glyphs to mean something special, but what do we mean by it? Are they Latin phrases? Book titles? Emphasis? The software cannot know what we mean by selecting a different font table, so the answer is to use named styles, and then assign appearance to those styles to communicate with the reader what we mean by them. It might very well be that our âLatin Phraseâ and âEmphasisâ styles both end up looking the same to the readerâbut they donât have to, and meanwhile our writings are enriched and made more flexible by having tagged text like this.
If I were inclined to use the Emphasis style instead of asterisks, yeah Iâd definitely bind it to âI. I certainly have little use for raw italics themselves, so there wouldnât be much of a downside for me.
I think Iâm on your page here. What surprised me was that command-I put italic in the text yet made, apparently, no semantic mark at all in there. Somehow Scrivener knows itâs italic, definitely doesnât think itâs âEmphasisâ, seems not to think itâs anything at all.
If I get to using Scrivâs styles more, Iâll surely bind it to Emphasis. Itâs just odd to see something happen and have it do nothing.
But I suppose if I use the B and I up in the style bar the same happens, so it makes sense (in that sense).
You have direct formatting. Here you change the typeface (bold, italics, underline), line spacing and so on manually.
Then you have styles. A single is two things: (i) it is a piece of metadata associated with a block of text that identifies that text as being of a particular style; (ii) it is a set of instructions on which direct formatting to apply to such blocks of text.
So, when you apply the âEmphasisâ style, you are applying a piece of metadata that tells Scrivener that text is an âEmphasisâ block. Such blocks are italicised by default in Scrivener, but you could override that during Compile to have them, say, be bright green and bold instead of italicised.
Not everyone uses styles. Many users use only direct formatting, either because they find it simpler or donât understand styles. Scrivener doesnât force a particular usage. And besides, you wouldnât be able to create styles unless you could apply direct formatting from which to define them.
The same is true of most word processors, incidentally. Word has an âEmphasisâ style that looks the same as italics, but if you only add italics to a word, it is Normal + Italic.
Yeah, thatâs the roots of it showing through, what is the basic formatting toolkit provided by NSTextView. The whole Style system is built on top of that (what you get in TextEdit), as bespoke markup in the RTF file that Scrivener applies as you use it. If you crack open one of its internal RTF files in another word processor youâll see stuff like the following:
<$Scr_Ps::0># Heading Text #
<!$Scr_Ps::0>
Kurnap ik <$Scr_Cs::1>lydran kurnap brul<!$Scr_Cs::1>? Er urfa thung morvit helk srung tolaspa er urfa groum, gronk brul nix vo; ti gen sernag velar. Rintax arul flim groum ma; gen delm zorl nix arka erk? Qi su flim, gronk irpsa qi ik anu brul berot morvit; ux erc whik.
âI isnât going to insert those codes. Itâs a part of the core text engine that basically just plugs in the RTF \i marker along with some font table infoâsame as TextEdit would. So thatâs why the shortcut doesnât map automatically to a style that may or may not be defined in the project (and for that matter may not look italic; âEmphasisâ can be bright red if you want). And thatâs how it âknowsâ the text is italic without any styles in placeâbecause underneath the style tags there is still an RTF file that is full of hard-coded formatting (even with styles in use, but our implementation aside, thatâs how RTF works even if the parser is using native RTF stylesheet features; itâs a bit old fashioned in that regard). If thatâs still confusing, join the club. RTF is confusing.
Our putting âEmphasisâ into the default stylesheet is meant to be a hint for those that would like to take a more defined approach to formatting: where the Format Bar tools are merely a front end for defining how styles should look in the editor, rather than as tools for actually formatting anything directly. It was never meant to imply that at any point the Format Bar buttons would somehow automatically map to styles.
That said, I would guess most people are perfectly happy just clicking the âIâ button, and donât really care if it is mapped to anything meaningful. All that really matters is that it looks right, and so long as you never need anything but that text to look italic in all cases, then I suppose itâs a fine enough approachânot one Iâd ever be inclined toward, but I get the appeal. So, whether you look at the format bar as a style format editor or as a way to format your text directly, it makes sense to have these controls readily available.