How do I get Emacs org-mode to create proper typographic marks when I export to HTML, including converting straight quotes to smart quotes ("curly quotes") and converting hyphens ---
to m-dashes —
?

- 6,168
- 3
- 46
- 86
-
3No, typing curly quotes by hand would be tedious and time-consuming. – incandescentman Feb 26 '13 at 23:40
-
Uhm, yeah, it's `Alt+{` on OS X and X11 US layout. Pretty much as hard to type as a standard quote which is `Shift+'`. – Feb 27 '13 at 00:20
-
2You really want to contort your fingers every time you write `I'm` or `can't`? – incandescentman Mar 06 '13 at 16:41
-
1Thousands of times per file? – incandescentman Feb 06 '14 at 23:18
4 Answers
This is now built into org-mode 8.x. To activate it, add the following to your Emacs configuration file:
(setq org-export-with-smart-quotes t)
It works for single quotes, double quotes, and apostrophes.
Source: @Ista

- 6,168
- 3
- 46
- 86
This is only available in very recent versions of org-mode. If you are not already running the latest git version see http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development for instructions on upgrading. Then (setq org-export-with-smart-quotes t)
will do what you want with quotes, and m-dashes will also be exported correctly.

- 10,139
- 2
- 37
- 38
-
1Thanks, that worked, quotation marks appeared correctly. But apostrophes didn't appear as curly in words such as `didn't`. Is there a fix for that too? – incandescentman Feb 27 '13 at 05:54
-
1I don't see a built in way of converting single quotes to curly apostrophes. You can write an export filter to do it yourself--see section 4.3 of http://lists.gnu.org/archive/html/emacs-orgmode/2013-02/msg00067.html – Ista Feb 27 '13 at 12:36
-
1Looks like this is one way in which Markdown (e.g. Brett Terpstra's Marked, which uses Smartypants) is superior to org-mode. – incandescentman Feb 27 '13 at 19:30
-
@PeterSalazar, to add, I think while `org-mode` has so many export options and so much functionality, it is thus less ideal for staying faithful to HTML. Markdown seems to be a closer approximation, though with less power behind it. For instance, org-mode can supply CSS style sheets for syntax highlighting (okay, there's a plug-in I bet for markdown). – Brady Trainor Jul 31 '14 at 09:05
-
Right. That said, converting single quotes to curly apostrophes on HTML export now works correctly by default in org-mode. – incandescentman Jul 31 '14 at 16:20
A way to insure that smart quotes are entered in your org file is to insert the code at the following url into your init.el file. Then type M-x smart-quotes-mode and your all set.
https://github.com/gareth-rees/smart-quotes/blob/master/smart-quotes.el
MNH
-
Links can be helpful as supplemental information, but [link-only answers are frowned upon](http://meta.stackexchange.com/a/8259/228805). Please include a summary of the linked information that's relevant to the question, and explain how it resolves the issue. – Adi Inbar Mar 29 '14 at 19:10