# apostrophe in org-babel export to latex and beamer

How can I get org-babel to properly render ' and not ’ when exporting to LaTeX and to Beamer? I didn't find any good solution yet, and I would like the code to be copy-pasteable.

Smart quotes render `'text'` as ``text'` in LaTeX.

That can be done in following ways.

### Enable smart quotes for all exports

Put this in your `init.el` after loading org-mode.

``````(setq org-export-with-smart-quotes t)
``````

### Enable smart quotes on export only a particular org file

Put this in the beginning of the org file.

``````#+OPTIONS: ':t
``````

### References

• I tried this solution but still get the same issue. – mhartm Nov 4 '14 at 5:14
• Actually I notice that, even without (setq org-export-with-smart-quotes t) it renders ' for html but not for latex nor beamer exports. – mhartm Nov 4 '14 at 5:53
• @mhartm I thought of smartquotes and upquotes as the same. The second solution should resolve your question. – Kaushal Modi Nov 4 '14 at 17:39

I misunderstood your question when writing my first answer. Here's a second try, tested out.

### Solution

You need to use a combination of `alltt` and `upquote` latex packages. Here is my solution based on the below referenced solutions from TeX SE and the use of org-mode Macro Replacement.

The below MWE was tested on `emacs -Q`, emacs 24.4.

```#+LaTeX_HEADER: \usepackage{alltt}

#+MACRO: UPQUOTE @@latex:\textalltt{'}@@

• `alltt` and `upquote` LaTeX packages. If you use TexLive, you can do `tlmgr install alltt` and `tlmgr install upquote`.