Dashes & Quotation Marks

In Scrivener, when I have a sentence like:
“What do you mean—”

Scrivener, when using smart (curly) quotes, doesn’t like the dash. What I end up with is this:
“What do you mean—

Rather than this:
“What do you mean—

Is there a way to fix that in Scrivener? It’s causing all sorts of issues in compiling.

Probably simplest to type the curly quote in the first place:

briarkitesme.com/2014/12/07/how- … ion-marks/

When I’m writing a 100K novel with a deadline, I’m not about to use keyboard shortcuts. No offense–I’m sure that works for some folks–but this should be something changeable within Scrivener.

Cool. They’re not shortcuts. They’re the proper keystrokes for producing curly quotes. The system of replacing primes with quotes is a fudge throughout OS platforms.

This is something you can sort out in Scrivener. Three simple solutions I can think of:

  1. Search —“ and replace with —”

  2. Set up a compile replacement as above.

  3. In OS X System preferences, set up an autocorrect substitution in Language & Text.

I know they’re proper keystrokes. :wink:

Option 3 is an idea, but I couldn’t figure out how to get it to work. When I tried, the OS didn’t care about the difference between one quote and the other. I’ll give it another lookl

Yep–I’ve already got it inside the OS autocorrect. Scrivener doesn’t care at all that it’s there and replaces the straight quote with the wrong curly quote anyway. facepalm

Scratch that–Mac is doing that in Notepad, too, making this an OS problem and not one solely in Scrivener. This is annoying. I don’t have this issue on my Windows machine.

Well, thanks for the suggestions.

Hope you can find a solution. Good luck! :smiley:

I don’t know if this’ll work with the OS X autocorrect, but if you have TextExpander (or maybe one of the other text expansion apps), this seems to do the trick:

Turn off smart quotes in Scrivener.

Set up a substitution to replace the straight quote with the curly one.

in the case of TextExander at least, I had to set that to expand after any character instead of the default expand after whitespace.

Didn’t test exhaustively, but seems to work.

Edit: but of course, with that you’ll be unable to type straight quotes at all.

I got this substitution to work (in Scrivener, TextEdit, Safari, etc) from OS X Sys Prefs:

[size=150]REPLACE
—T

WITH
—”
[/size]
You could use any letter in place of the T.

No matter what solution you land on, I recommend that you implement #2 in the compile settings, just to catch any such backward quotations that you might miss (or have already missed). If you use the ‘project’ tab in the Replacements section of the compile window, then it’ll stay put if you chose to start over with any other preset.

I’m on with apple support and we just tried the straight quote to curly trick. Works in Mac’s NOTES app but not Scrivener. This is looking more like a Scrivener issue. :confused:
I’ll use the workaround (–T) if I have to but this is ridiculous and shouldn’t be broken. (Forgive my frustration folks!)

Okay, I just tried this and Scrivener is still leaving the —T. Can you explain in more detail what you did? I’m apparently missing something…

Just set it up in sys prefs. I’m only on 10.7.5. Which version of OS X are you using?

The first replace in Scrivener had a small time lag: about a second. After that, it worked instantly.

10.10.3 Yosemite.

I changed it in the OS X settings, but something in the Scrivener settings is undoing it. I can’t tell if it’s Scrivener’s smart quotes thinking it converting it or what, but something in my settings will not do this.

I’m on 10.10.3 as well.

This seems to work using just the OS autocorrect: replace -" (single dash, quote) with —” Alt+Shift+dash, Alt+Shift+[

You’ll have to remember to just use a single dash in those situations rather than a double.

I think this is some sort of weirdness in the Apple Text Engine. On this MBA having put a substitution in the OSX settings:

Nisus Writer Pro, which is based on the same text engine, doesn’t have a problem with this and uses a closing smart quote, whether single or double and whether one enters the em-dash as two hyphens or directly with Shift-Opt-hyphen. But Nisus have modified the text engine very heavily.

Text edit, does not replace the straight quotes at all after an em-dash when following a conversion from two hyphens, but when the em-dash is entered directly, it presents a little windowlet with the correct substitution asking for confirmation of the substitution to be made.

Scrivener, uses the wrong smart quote after an em-dash however the em-dash is entered.

Notes, on the other hand, makes the substitution correctly however the em-dash is entered.

In a further twist, Pages, although apparently not based on Apple’s Text Engine, behaves exactly like Scrivener … so one might say Scrivener is in good or bad company, depending on your feelings about Pages. :unamused:

So one wonders what on earth is going on.

Incidentally, there was a discussion of this in a thread a couple of years or so ago … finding that may include other ways round the issue. I have not had to use this combination, but were I going to, I’d go with Robert’s No 2 suggestion of using straight quotes in the editor and either set up a replacement in compile, or deal with it in NWP (I don’t have Word) in final tweaking.

:slight_smile:

Mr X

The underlying problem is that it’s difficult for software to know exactly what the intention of the user is, as software is rarely aware of more than the characters you are typing right now. For smart punctuation, it follows “best fit” rules for trying to determine which smart punctuation to use, but inevitably sometimes it fails to guess at the human’s intentions.

The problem of word processors failing to get the correct quotes after hyphens is an old one - it’s always been present (and still is present) in Microsoft Word, for instance. Because of this, I long ago got in the habit of typing the hyphen, then a character (always a “d” for some reason of habit), then the quotation mark, then cursoring back, backspacing, and cursoring forward again. It’s been a habit for so long, ever since I first started using Word, that I don’t even notice I’m doing it any more.

Which isn’t to say there shouldn’t be a better solution, of course. It used to be that you could set up a system replacement to address this, but it seems that on Yosemite that no longer works as well. The problem is that our smart quotes and hyphens system is all provided by the Apple text system.

And… Following that post I spent a while researching the issue. So, it turns out that NSTextView - the base Cocoa class used by Scrivener’s editor, just as its used in TextEdit - does have a public method (function) that handles inserting the various replacements. I’ve overridden this method so that my code examines the results that are normally returned for insertion, looking for:

  1. A smart quote insertion.
  2. A replacement consisting of an open quote based on current language settings (single or double).
  3. An insertion position that immediately follows a hyphen, en-dash or em-dash.

If these criteria are met, my (new) code substitutes the result for one with a replacement of a close quote.

This seems to address the issue. This is experimental at the moment, so it’s unlikely to make it into the next release version as I want to test it out thoroughly, because of the way it intercepts typing, but I’m hopeful that this should resolve this annoying issue.

Isn’t the OP looking for a close quote? Or have I misunderstood? Though I guess either will be configurable.

I’ve got in the habit of turning smart quotes off and typing the single and double primes/quotes I want instead. This really helps in writing MMD, when you need primes in HTML elements and curly quotes in the body text.