Sublime Forum

Auto-pair typographical quotes

#24

[quote=“pedrober”]First feedback about the new code:
–If I add a quote before an existent word, first version only added “. Now, both appears. No problem after a word.[/quote]

A typo had crept it in. It took me all of 10 seconds to fix this, but I thought rather than posting and re-posting here, I might look at other issues as well, but I didn’t have the time, so it’s just this fix for now. I thought it might be simpler for both of us if I put up a repo and use that, so: github.com/alehandrof/SmartType

You should be able to add the repository via Package Control and then just install the package “SmartType”. (If not, or if you need more detailed instructions, let me know.)

I’m still trying to get to grips with git (as I’m not a programmer, but I’ve been using it for version control for documents).

I haven’t taken hyphens & dashes into account at all. I’ll look at it tomorrow (maybe :wink: ).

Yeah, but not really. Let me know how it goes :smile:

Alex

0 Likes

#25

The forum was off-line yesterday. I have just installed the package. I’ll test and I’ll report later.

0 Likes

#26

First feedback about the package:
–As previously stated, after a dash (-, –, —), the package adds only ”, instead of “”.
–Same problem, after a existent parenthesis or square bracket. The package outputs: (”xxxxx), ”xxxxx].
No more problems, for the moment.

0 Likes

#27

Just a note: in the case of an existent parenthesis or square bracket, the expected behaviour is (“xxxxx)/“xxxxx or (xxxxx”)/[xxxxx”].

0 Likes

#28

New version in the repo. Let me know what stuff explodes.

If you’re using Package Control to handle the package, it should update automatically.

0 Likes

#29

OK, I’ll report after testing. Thank you very much. New features are welcome.

0 Likes

#30

No problem for the moment. I had macros to get n dash and m dash but your package makes it easier.
Let me encourage you to add settings to be able to switch ellipsis off. It’s a very controversial matter in good typography. So, I have modified your key bindings to switch it off.

0 Likes

#31

The n and m dash automatic substitution doesn’t work after a word. Ex: XXXX-- and not XXXX–
They also don’t work before and after an existent word ONLY at the beginning of a paragraph.

0 Likes

#32

Glad I could help. If there’s any other macros that you think might be improved upon, let me know—although see below.

I love a good typographic controversy, but I’m not aware of this one *. Nevertheless, I’ve turned off ellipsis, since you’re the only user at the moment :smile:

  • It seems to me the only alternative to the ellipsis glyph is spaced out dots (. . .) which the macro doesn’t interfer with. Can you point me to any reading material (online, books, articles, whatever) related to this?

[quote]The n and m dash automatic substitution doesn’t work after a word. Ex: XXXX-- and not XXXX–
They also don’t work before and after an existent word ONLY at the beginning of a paragraph.[/quote]

There was a silly bug with the em-dash, which was causing all sorts of weirdness. It’s fixed now.

You’ll still run into trouble if you want to write, for example, A–Z (that’s an en-dash) because the way I’ve set up the macro it only works for space followed by two hyphens.

If you can list the various situations you need/use em- and en- dashes, I can tell you whether we can work out something automagical. But I’ve found that MS Word is crap at this sort of thing, and its auto-replace feature is more powerful than what my current knowledge of Sublime allows for.

As always, feedback, &c., is welcome.

Alex

0 Likes

#33

Thank you very much again. I’ll update and I’ll continue to test.
It’s possible to perform a Google search to find information about the ellipsis and its use in good typography. Anyhow, the key point is as follows: in most of the typographic families, the dots of the ellipsis character are too tightly spaced and the designer uses other resources. Don’t think I am a designer but just test a few faces and see.
By the way, I hate Word and its behavior in this area (auto-correction)…

0 Likes

#34

The only user of your package… I can’t believe it! There are a lot of people using Sublime Text for prose. Maybe if the package were in the main repository…
More feedback:
— n dash replacement doesn’t work at the beginning of a paragraph (no problem with m dash). Is this by design?
— n dash replacement doesn’t work after an existent word (no problem with m dash).
— m dash replacement doesn’t work before an existent word (no problem with n dash).
I’ll continue testing…

0 Likes

#35

Do you see anyone else posting in this thread?

I suspect that, like myself, they use LaTeX, Markdown, ReST or some other kind of markup that takes care of typographic niceties upon compilation/conversion to other formats. Although I have to admit that it’s quite nice to have smart quotes when writing regular text, so I’ve left it on.

The en & em dashes are not affected by words before or after them. Look at the README for an explanation as to how they are triggered and ask here if it still doesn’t make sense. That said, I’ve been looking into improving the dashes, but I haven’t worked out a decent solution.

Keep me posted on what works & doesn’t…

0 Likes

#36

You’re right: Latex, Markdown, etc. cover the needs of the technical writer. In my case,as you know, I use Sublime Text for desktop publishing tagged text. I’ll continue to report.
Thank you very much again.

0 Likes

#37

More feedback:
After an equal sign (=), I get =” instead of =“
Before and existent equal sign, I get “=
Anyhow, it’s very rare to have quotation marks and equal signs together and goals of different users can vary.
Default behavior could be: ” (before) and “ (after), but…

0 Likes

#38

More feedback:
After a bar (/), I get /” instead of /“

0 Likes

#39

OK. It’s now set up to auto-pair double and single quotes before and after plus-signs and slashes. You may want to look up = in the keymap file to see how you can add more symbols with this behavior. (But unless you push to the repo, you might want to let me know as well, so I can maintain it.)

I had gotten around to the plus-signs when you first posted, but I got tangled up with git. Hopefully, the repo in its current state should fix your issues and not introduce any weirdness.

I’ve also added a couple of bindings so you can reliably add en and em dashes (super± and shift+super±, respectively). These should not conflict with anything I’m aware of in Windows & Linux; I don’t know about OSX.

I don’t think it’s possible to distinguish en dashes from em dashes automagically, thought if you can give me the most comment cases, I can give it another shot.

As always, let me know how it goes.

Alex

0 Likes

#40

OK, I’ll continue to test…

0 Likes

#41

A SmartType ST3 version would be welcome. Is it possible to install the ST2 version under ST3?

0 Likes

#42

I haven’t tested it, but I’m 99% certain it will work without problems. If you have any issues, let me know and I’ll see what I can do.

Cheers,
Alex

0 Likes

#43

Alex:
Your code doesn’t work for typographical quotes under OS X, either Mavericks or El Capitan, ST2 or ST3. Any suggestion? No problem under Windows.
Best regards.

0 Likes