So this is mainly a Pandoc Markdown question, and I would even go further and say it is a conceptual question as well, rather than purely technical. Nothing about how Scrivener works is going to be of any bearing here, as will most often be the case for how you type in text in the editor, as characters (and tab stops and so forth), unless you’ve got some wild compile settings going on.
Formatting Bulk Text
To think upon the conceptual, it seems the main question here is: how do I make lots of text in this section italic. I see entire lines, and all lines (save for the heading) wrapped fully in italics, from the first to the last letter—and whenever I see that, my first question is: is this the right tool for the job? Bearing in mind asterisk marking in Markdown is primarily one of emphasis, like I just used it there, are we really emphatically stating all of these bullets and paragraphs?
Probably not—so this is a stylistic choice, and if it is widespread choice, perhaps even something where the entire chunk of text in the binder is meant to work this way, then I start thinking about section level formatting.
Why this case failed
Before getting into that though, what you saw specifically is the result of invalid syntax. You can’t put emphatic markers around list markers—the result won’t be a list. Instead you’ve got one line that begins with “1.”, that isn’t actually a list line, and the rest is tab indented which indicates a code block—which makes sense, and explains why raw Markdown passed through as well. You create code blocks by tabbing each line. You also create indented list items with tabs—but that only works if the whole looks like a list, and in your case it didn’t really look like a list, nor did it strictly follow the rules of being a list.
Here is what a list would look like where each line is emphatic:
1. *Major list element*
a. *Minor list element*
b. *Another one...*
2. *Second major element*
Using Pandoc to Mark Sections with Formatting
But going back to the conceptual thoughts above, this kind of forcing is something I always try to avoid. To me, what you typed in makes no sense, are we “shouting” every line? There are a few ways we could more meaningfully declare our intentions with this list:
::: {.italic-list}
1. Major list element
a. Minor list element
b. Another one...
2. Second major element
:::
I’d argue “italic-list” is a bit of a generic and less useful way to refer to this. A better name would be one that describes the document structure, but I don’t know what that means to you. An example is “block quote”, that’s a structural element. What structural element is portrayed by printing this section in italic text? Having good meaningful names will make things easier on you later on. You’ll come back to this a few years later and know what you meant, it also decouples presentation from the meaning, which always a good principle.
Using HTML/Markup to Mark the Outline
We could stop there, and you could start going in and adding these markers around everything that needs italics—but again I think we can do better. That’s good for the list here or there that needs to be different from the rest, but if this whole binder item needs to be italic, we should address that with CSS, and at as high a level as we can. Then, only if we need to, start adding markup to the outline, and only if that fails (binder items that have bulk italic text and regular Roman text) should we start looking to markup-based solutions like the above. So let’s take a look at Sigil, and see what we can do about it.
Here we have some HTML from a properly formatted section:
<section id="article-7-exclusions" class="level3" data-number="1.0.1">
<h3 data-number="1.0.1">Article 7 Exclusions</h3>
<p>New Article 7</p>
<p>Dri srung gronk ozlint; zeuhl la, ti dri. Relnag xi nalista dri lydran wynlarce, prinquis zorl nalista.</p>
<ol type="1">
<li>Re teng thung; kurnap fli rintax ti nalista gra athran epp. Er lamax berot cree dri.
<ol type="a">
<li>La, morvit urfa quolt… er prinquis, pank obrikt quolt gen ma dri tharn athran relnag xi erc wex velar.</li>
We have a few hooks in here we could make use of with CSS. There is the #article-7-exclusions
, which will be unique to this one chunk of text, and .level3
, which will be common to all sections of text that fall after h3 headings. Maybe one of those is useful if the answer to this is either very sporadic or very procedural. If we know for a fact only article 7, 14 and 21 are going to need this treatment, then we could name them in our CSS and be done with it:
#article-7-exclusions,
#article-14-something-else,
#article-21-lastly {
font-style: italic;
}
#article-7-exclusions em,
#article-14-something-else em,
#article-21-lastly em {
font-style: normal;
}
If you try pasting that into the stylesheet.css file in Sigil, and checking out the xhtml file that has article-7 in it, you should see it working! And thanks to the second set of declarations, we’re saying any actual emphasis in these sections should use Roman characters, as is typical in most typesetting traditions where emphasis falls within text that is italic for other reasons.
As for the very procedural, here is how we’d address that:
.level3 {
font-style: italic;
}
.level3 em {
font-style: normal;
}
Much simpler! In most cases you’ll want something like this in your CSS, rather than a manually curated list like the above. I’m not a huge fan of that, because again we are kind of forcing it. We’re saying “article-7” is italic in the same way we were saying every line is italic with asterisks. Plus, it’s fragile, in that we have to manually maintain it, and heading revisions will require editing it.
So if the very procedural doesn’t work, and this other approach isn’t the greatest, that leaves tagging structural areas of the document meaningfully—just a step higher than doing so in the text. Ideally, what we’d want to be able to do is something like this:
<section id="article-7-exclusions" class="level3 italic-section" data-number="1.0.1">
<h3 data-number="1.0.1">Article 7 Exclusions</h3>
<p>New Article 7</p>
...
Note that the class for this section is now marked as “italic-section” (which is again terribly generic, but I’ll leave that to you), as well as being “level3”. Then our CSS could be:
.italic-section {
font-style: italic;
}
.italic-section em {
font-style: normal;
}
The thing is, Pandoc is inserting the <section> element for us, it isn’t anywhere in the markup. Thankfully, Pandoc has some neat little corners. If we wrap an entire section, including its heading, in a <div> and give that div attributes, it recognises our intent and moves that markup to the right place. So what we’re looking for in markup is:
::: {.italic-section}
### Article 7 Exclusions
New Article 7
Dri srung gronk ozlint; zeuhl la, ti dri. Relnag xi nalista dri lydran wynlarce, prinquis zorl nalista.
1. Re teng thung; kurnap fli rintax ti nalista gra athran epp. Er lamax berot cree dri.
a. La, morvit urfa quolt... er prinquis, pank obrikt quolt gen ma dri tharn athran relnag xi erc wex velar.
<SNIP>
:::
If you give that a try, you’ll find you get exactly what was indicated as ideal, in the HTML. Paste the revised CSS example into stylesheet.css in Sigil, and it’ll not only be indicated in the HTML, but formatted as you want.
Using Scrivener to Generate the Markup
We could type that in ourselves, but a better way of doing it would be to finally bring Scrivener into the equation, and let it do what it does best: make such kinds of high level decisions easier to manage without having to copy and paste bits of markup over and over into different outline elements:
-
Go into Project ▸ Project Settings...
, and in Section Types, create a new type for “Section Text - Italic” (again, choosing a name that better suits the content or purpose).
-
Save the settings, and assign this new type to the Article 7 binder item.
-
Open the compiler, and double-click on the compile Format in the left sidebar to edit it.
-
Create a new Section Layout, probably from “Text Section”, which will be used to insert the markup for us.
-
In its Prefix tab, type in ::: {.italic-section}
followed by one or two carriage returns.
-
For Suffix type in one or two carriage returns, and then :::
-
We might as well paste in the CSS we want (from above) into the Pandoc Options pane while we’re here.
Hint: you may want to copy and paste from the stylesheet.css file in Sigil, from a previous compile, because Pandoc only prints all of that stock CSS if you don’t supply any yourself.
-
Save the Format, and make sure to remember to assign the new section type to the layout we’ve created.
Give that a test compile, and you should be done. Any new section you tag this way with the new Type will be italicised in full. No spamming asterisks all over the place and risk breaking syntax like lists.
Hopefully in all of the tests and iterations above, you find one solution that works for you. Depending on whether you have fifteen level 3 sections in one binder item, or only some text within Article 7 needs to be italic—whatever the case may be, you can always fall back to typing in the ::: markup ::: yourself, if a good procedural answer doesn’t arise.