How to shift marked phrases to uppercase during compile?

Is there a way to shift a specifically marked set of words to UPPERCASE during compile?

I know I can instruct Scrivener to uppercase a specified number of words during compilation. But that’s not what I want to do.

I want to be able to mark a phrase, and shift that to uppercase. The phrases are not all the same length (each may be anywhere from 2 to 5 words long), so using a fixed length does not do what I want.

Possibilities with RegEx? I can mark the phrases (e.g. ^my phrase^) and use RegEx to detect the phrases. But is there a way to apply a transformation in the replacement text?

I have tried the \U and \L transformations that some PCRE implementations offer. Either they don’t work, or I’m not using the correct syntax. The Scrivener documentation does not offer examples, and I’m not sure where to find the Max OS X documentation for the RegEx stuff that Scrivener uses.


I’m just replying to concur that this problem exists. I’m currently cleaning up a manuscript in the scrivenings view; I’ve used a bunch of regexes this morning to get rid of some frequent formatting errors. In the cmd-F find&replace dialogue, the \U case transformation doesn’t work. But according to the the PCRE manual, this flavour of regex implementation simply doesn’t understand the \U transformation command. Cf. … ern.3.html
So, it smells like a bug, but it more likely it is a feature. :slight_smile:

Okay, I figured it out.

  • Put the text to be uppercased into the title of the document, and remove it from the body of the document. So the start of the first sentence in the document will be in the title, and the remainder will be in the body.
  • In compile settings > Formatting > Section Layout (for the appropriate type and level) > Title Appearance tab: Select Insert title as run-in head.

It’s not intuitive. In fact, putting body text in the title of the document feels kinda wrong. But it works, so there.

Out of curiosity, is there a reason you’re not just making the text uppercase within the document in Scrivener? Is it supposed to not be in uppercase for certain compiles?

That’s right. For some compiles (e.g. for a paperback or ebook) I want uppercase. For others (e.g. to submit the story to a magazine in standard manuscript format) I want to leave the text as is.