8

I know I can get these fancy quotes

`abc'

enter image description here

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

{`}a

enter image description here

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

abc{'}

enter image description here

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

I am using pdflatex.

lockstep
  • 250,273
Sergey L.
  • 203

2 Answers2

9

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}

enter image description here

Gonzalo Medina
  • 505,128
7

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}

enter image description here

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

egreg
  • 1,121,712