11

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 ?

incandescentman
  • 5,479
  • 1
  • 37
  • 75

4 Answers4

18
#+LANGUAGE: de
#+OPTIONS: ':t

also does the right thing now

Erich Neuwirth
  • 691
  • 5
  • 10
10

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

incandescentman
  • 5,479
  • 1
  • 37
  • 75
8

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.

Ista
  • 9,106
  • 2
  • 32
  • 30
  • 1
    Thanks, 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
  • 1
    I 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
  • 1
    Looks 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
-2

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