Pages - multiple paragraph styles in a single paragraph
You need to use a character style for code, and then perhaps use a &quot;code block&quot; paragraph style for code blocks that are, well, paragraphs. Think about this: if the code paragraph style is double spaced and your prose paragraph style is 1.5 spaced, which one &quot;wins&quot; when the break is mid-line?
To add a new Character Style in pages
(from https://help.apple.com/pages/mac/5.6/index.html?localePath=en.lproj#/tan7aaef6765)

Select the character with the formatting you want to save as a style.
Click the Style button near the top of the sidebar on the right.
If you don’t see a sidebar, or the sidebar doesn’t have a Style button, click Format button in the toolbar. If the text is in a text box, table, or shape, first click the Text tab at the top of the sidebar, then click the Style button.
In the Font section, click the pop-up menu next to Character Styles, then do one of the following:

Create a new style with a new name: Click New style button in the top-right corner of the Character Styles menu, then type a name for the style.

Create a new style based on an existing style: Move the pointer over the style name in the list, click the arrow that appears, then choose Redefine from Selection (characters that used the original style aren’t changed).


Type a name for the style.