Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

style forcing straight quotes

Explorer ,
Nov 05, 2017 Nov 05, 2017

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?

5.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 05, 2017 Nov 05, 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

...
Translate
Community Expert ,
Nov 05, 2017 Nov 05, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 05, 2017 Nov 05, 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"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2017 Nov 05, 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?)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2017 Nov 05, 2017

https://forums.adobe.com/people/%5BJongware%5D  wrote

... 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.

@Jongware

And yet, I always love to know alternatives, even if they are workarounds. Is your IndyFont for sale? Can you put a screenshot of the quotes and a few characters?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2017 Nov 05, 2017

Here is how it would work.

1. Create a new font where the curly quotes appear as straight ones in the code font in use.

Screen Shot 2017-11-05 at 10.08.13 PM.png

Screen Shot 2017-11-05 at 10.12.02 PM.png

2. Apply the custom font to just curly quotes using a GREP style.

Screen Shot 2017-11-05 at 10.23.03 PM.png

Screen Shot 2017-11-05 at 10.23.19 PM.png

3. Done. I added a yellow background in the character style so you can see where a curly quote is changed to look like a straight one.

Screen Shot 2017-11-05 at 10.25.03 PM.png

IndyFont is for sale at IndiScripts: Indiscripts :: IndyFont

You can try this with the free demo, but beware that it only allows you to create one character per unique font. (You can still do what I did here, but you'll have to create a unique font for each of the curly characters.)

That said: I would not advocate this approach. Suppose someone copies the code out of a PDF; then, the curly quotes would return, and that code would not work! The same goes for exporting to a HTML page or an ePub. You can compare it to making a text correction by pasting new text in a white box over the wrong word – it works, kinda, in a PDF, but nowhere else.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2017 Nov 05, 2017
LATEST

Thank you—it's always good to tuck away that kind of information!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines