Typographic sign : apostrophe (two types)

What I’m trying to do

typographic sign : apostrophe (two types)

Hi,

I have a recurrent problem. When I’m writing in obsidian, I use this sign " ’ ", but when I paste text this sign becomes another apostrophe " ’ ".

This is embarrassing because it changes my file’s name and my research queries and creates conflicts in my vault because it’s the same sign (apostrophe) but not the same typographic sign.

I would like to standardize these signs either by directly typing the correct sign or by pasting the correct sign.

Would someone have a solution ?

Thanks for your precious help

I am assuming you want to use the straight apostrophe in your note name, and the curly one in the content. Smart Topograhy plugin might solve your problem.
GIF 12-22-2022 10-55-19 AM

Using vscode to mass find & replace if you want to do a vault-wise standard-fication of apostrophes.

'([^']*)' -> ‘$1’
' -> ’

GIF 12-22-2022 11-47-44 AM

Hi Fuyu,

Thank you for your solution. I didn’t know that this plugin allowed me to type the curly apostrophe. I use a Swiss keyboard that types a straight apostrophe by default in obsidian.

I’m trying to have the same typographical sign in all my vault (in my files and in the file’s name). I paste a lot of content from pdfs and the internet which often use de curtly one.

I’ve changed all my straight apostrophes with curly ones with VS code. I’m worried because I’ve changed all files in my vault even the .css and .jonson files in the .obsidian folder. I hope it will not disrupt my obsidian vault :confused:

This plugin works for text in a file, but doesn’t work in the obsidian interface (eg. Renaming or searching files).

Do you have any other solution ?

Thank you for your help :slight_smile:

Method 1: google alt codes, and memorize them. (e.g. keep pressing alt and enter 0147 to give you a curly open apostrophe .)
Method 2: create a script. for example the old-school autohotkey

#IfWinActive ahk_exe Obsidian.exe

:*:'::‘’{left 1}

:*:"::“”{left 1}

Basically whenever you type a open straight quote ' in obsidian, it will automatically change it to the corresponding curly quotes ‘’ with cursor in the middle of them.

GIF 12-22-2022 4-53-18 PM

If you changed the quotes in CSS and JSON to curly ones, you have probably broken things.

What operating system(s) do you use? Mac and iOS have easy-ish ways to type alternate characters.

Thank you for your answers, I’m on Mac (Big sur 11.4). I don’t know if the quotes in CSS and JSON are straight or curly, but I’ve changed all of them into Curly ones.

Thank you for your answer.

I’m on Mac and I didn’t find a way to type this google alt codes. I don’t know how to use and run this script in Obsidian on my Mac.

macOS: Type Option+] (left single quote); Shift+Option+] (right); Option+[ (left double); Shift+Option+[ (right).

Source: How to Type Curly Quotes and Curly Apostrophes

1 Like

When using a national keyboard layout, those shortcuts are just wrong. We don’t use that to get the various apostrophes (or acute’s).
image

How to get these characters

I’m also on a Mac, and I just installed the Swiss/German keyboard, to locate the various apostrophes, and found the following:

  • ', Apostrophe – Right of the Zero key, no modifiers
  • `, Grave accent – Shift + Key left of the backspace (or two right of the Zero key), and then a space to loose the accent quality
  • ´, Acute accent – Alt + Key left of the backspace (or two right of the Zero key), and then a space to loose the accent quality

The key point here being that those last two are actually accent keys, used to build stuff like the following: àèò áéó, so to get the actual apostrophe, you need to accent a space, aka first hit the apostrophe key, and then the space bar.

PS! I’ve seen some references to a utility called Ukulele for the Mac, which can turn these dead keys into normal keys, so that you can type them without the space to get the apostrophe. I’ve not tried it myself, but I mention for you to install if you want to.

Various use of these (and similar) characters

You stated earlier on that you did a search-and-replace in all files, and replaced with the “curly/smart quotes”. That is dangerous to do when it comes to files containing programming language. Especially javascript can be severely damaged by such a move.

const name = "joniac"
console.log('Hi ${name}')
console.log("Hi ${name}")
console.log(`Hi ${name}`)

All of these are legal, but only the last will produce Hi joniax. Similarily if you change from ` to ' in all the markdown files, all your code blocks will not work anymore.

On my Mac I’ve setup to actually use smart quotes, but luckily it differentiate between various app on when to apply it. If I write the following in TextEdit: Say 'hi', or say "hi" it actually changes it to: Say ‘hi’, or say “hi”. These quotes are also kept if I then copy that from TextEdit into Obsidian.

And these smart quotes would break various queries and scripts, if I were to try to use them in such. In pure text, it’s more of a visual preference.

If you want to turn this on or off, goto Apple menu > System Settings, select _Keyboard, and then the Text input pane. Here you’ll find the various options to change this to the right. See mac support page in your own language.

1 Like

You’ll want to change them back. (Most) Programming languages use straight quotes in their syntax, and only (potentially) use curly ones in normally text they have stored.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.