Format indented list items as italic text

Intent versus Tool Usage

All right, so to get one thing straight, I was not saying that italics, as a font variant, should only ever be used for emphasis! I think the intention is being confused with the tool, here. When I said “you’re using emphasis in a way that doesn’t fit”, I didn’t mean you’re using italics in a way that doesn’t fit—that’s your choice and your style guide to design and establish (and personally I think that’s a good approach to the problem you describe). I was saying emphasis, the tool, with asterisks, isn’t the best way to establish a high level design decision. Really, no different than I would say to a word processor user manually changing the font variant to italics across whole sections of text. That’s also a less than optimal approach to solving this design problem.

This statement, and the solution of using higher-level sectional semantics, is of course the spiritual cousin of:

\begin{updated-article}
First line.

Second line.
\end{updated-article}

…where you’ve designed your preamble so that the updated-article environment prints its contents in italic font. This is what you would want to do, rather than the equivalent of wrapping every line in asterisks:

\emph{First line}

\emph{Second line}

Hopefully that helps to map a familiar concept over to unfamiliar territory.

In the ebook realm, the <div> method I described is most often the best way of handling shorter chunks of text in a longer section where not all of the text in that section falls under this semantic (only exceptions being cases where HTML has dedicated markup for that purpose, like <blockquote>). Divs with class names are the spiritual cousin to LaTeX environments. And when whole sections needs this treatment, marking that <section> as being special and needing italic formatting is the most semantic way to handle it in an ebook. In your example, the “New Article 7” line is not within this range, nor is the heading, so this method is probably best (rather than the section type/layout approach):

### Article 7 Exclusions

New Article 7

::: {.updated-article}

The following are excluded from the application of rules...

1. Exclude from application...
	a. Family members of the employer...
<ETC>

:::

And back to normal semantics.

In using the best tool for the job (sectional semantics), we avoid pitfalls that can occur from trying to wrap every single line, no matter how complex it may be (multi-level lists for instance) in inline emphasis (the tool!) formatting. And that’s not even getting into the human cost, where typing every line with asterisks is more labour-intensive than just marking the whole section with a few simple markers.

You could even use a paragraph style to automatically insert the ::: div ::: markers for you, keeping the editor cleaner, but that would only work if these areas only ever contain simple text rather than other styles.

Cleanup

I also didn’t go about providing a solution for easily fixing the sections marked with asterisks. This is not too hard to clean up:

  1. Select the text where they need to be cleaned out.
  2. Hit ⌘F / Ctrl+F and set the Replace All scope to “Selected Text”.
  3. In the Find field, paste: ^(\t)*\*(.+)\*$
  4. In the Replace field, paste: $1$2
  5. Set the search mode to Regular Expression, and click Replace All.

That will preserve tabs that fall at the beginning of the line, and only remove asterisks if they are (tabulation excluded) the very first and very last characters on a line. You will note the Find part also works as a search, which can be used to find sections and quickly convert them to sectional semantics, even project-wide via the Project Search tool set to regex mode (though you would of course only want to do that after adding the sectional semantics, or setting section types).

Depending on how much of this there is, I wouldn’t suspect it being more than an afternoon of work, particularly if you use macro software like Keyboard Maestro, which could insert the ::: div ::: markup around the selected text, then clean out the asterisks (it also does regex, so you don’t need Scrivener for that), and jump to the next matching line, in one shortcut.