Skip to main content
Inspiring
November 5, 2017
Answered

style forcing straight quotes

  • November 5, 2017
  • 1 reply
  • 5176 views

i have preferences set to curly quotes because i need them for most text. but when i have code, i want straight quotes. i have a style for code that uses fixed-width font. is it possible to have this style automatically format all quotes as straight?

    This topic has been closed for replies.
    Correct answer Jongware

    The automatic Curly Quotes option is a one-time Special Offer only, and as soon as they are inserted in your text, curly or not, they're going to stay that way.

    ... It is rather tempting to promote my own IndyFont here. ("Create a font where the curly quotes lok like straight ones and apply it through a GREP style in your 'code' paragraph style, done.") But I won't because I am a code purist and it's not a problem to change the quotes to their proper form.

    You can safely use Find/Change to change all curly quotes in code to straight ones. With a plain text search, search in turn for ' and " and replace with ^' and ^". Make sure to specifiy your "code" style in the Find Format. This will work because by default, when looking for ' InDesign finds all kinds of single quotes, curly or otherwise. The replacement string ^' in turn forces a straight quote, regardless of the setting of your Typo Quotes in Preferences.

    (By the way, did you take care to switching ligatures off for your code snippets?)

    1 reply

    jane-e
    Community Expert
    Community Expert
    November 5, 2017

    You can insert them directly from Type > Insert Special Character > Quotation Marks > Straight [Double/Single] Quotation Mark(s)

    Or you can use the keyboard shortcuts.

    You can select and then load them into Find or Change and Find / Change in your selected code for quotes that already exist.

    There may be other ideas.

    deereyAuthor
    Inspiring
    November 5, 2017

    i have used all of those options and the last is best i've found for global changes. i was hoping there was something i could use that would automatically format all quotes as straight if the paragraph style applied was "code"

    Jongware
    Community Expert
    JongwareCommunity ExpertCorrect answer
    Community Expert
    November 5, 2017

    The automatic Curly Quotes option is a one-time Special Offer only, and as soon as they are inserted in your text, curly or not, they're going to stay that way.

    ... It is rather tempting to promote my own IndyFont here. ("Create a font where the curly quotes lok like straight ones and apply it through a GREP style in your 'code' paragraph style, done.") But I won't because I am a code purist and it's not a problem to change the quotes to their proper form.

    You can safely use Find/Change to change all curly quotes in code to straight ones. With a plain text search, search in turn for ' and " and replace with ^' and ^". Make sure to specifiy your "code" style in the Find Format. This will work because by default, when looking for ' InDesign finds all kinds of single quotes, curly or otherwise. The replacement string ^' in turn forces a straight quote, regardless of the setting of your Typo Quotes in Preferences.

    (By the way, did you take care to switching ligatures off for your code snippets?)