# How to get single curved quotation marks in math mode

I know I can get these fancy quotes

abc'


I want to get those quotes separately. I know how to get the left one:

{}a


But when I try just the right one, I get a different quote then when used together:

abc{'}


How can I get the right curved one alone in math mode?

I am using pdflatex.

-
Can you please explain better? Aren't you getting single quotes with abc'? –  egreg Mar 4 at 14:39
@egreg edited. I get a different right quote when I use that one separately. –  Sergey L. Mar 4 at 14:42
That's not the default behaviour for text mode. Perhaps some package is causing this. Can ypu please add a complete, minimla document, showing the undesired output? –  Gonzalo Medina Mar 4 at 14:43
You get a prime only in math mode. Is your aim to get a right quote in math mode? If so, please change the title and the text of the question accordingly. –  egreg Mar 4 at 14:43
\usepackage{amsmath} and $abc{\text{'}}$. –  Gonzalo Medina Mar 4 at 14:45

## 2 Answers

In math mode ' produces a prime; to get the closing quotation mark in math mode you can use \text from amsmath:

\documentclass{book}
\usepackage{amsmath}

\begin{document}
$abc' \quad abc{\text{'}}$
\end{document}


-

In math mode, typing ' is equivalent to typing ^{\prime}, '' to ^{\prime\prime} and so on.

If you need “real” quotes in math mode, you have to define a math character for them. Typing  is not guaranteed to give the desired result.

You can define

\DeclareMathSymbol{\mlq}{\mathord}{operators}{}
\DeclareMathSymbol{\mrq}{\mathord}{operators}{'}


Complete example:

\documentclass{article}

\DeclareMathSymbol{\mlq}{\mathord}{operators}{}
\DeclareMathSymbol{\mrq}{\mathord}{operators}{'}
\DeclareMathSymbol{\mlqq}{\mathord}{operators}{"5C}
\DeclareMathSymbol{\mrqq}{\mathord}{operators}{"}

\begin{document}
$\mlq a\mrq$

$\mlqq a\mrqq$
\end{document}
`

See http://tex.stackexchange.com/a/161253/4427 for a similar setup, but in that case relations were concerned.

-