8

As the title says I want to add quotation marks around a fraction in \displaystyle mode. My first try looks very unnatural, as you can see

^{``}\frac{1}{0^-}^"

The problem is with the first quotation mark: how do I put it at the same height as the second one?

10

The following minimal example provides \mathquotes{<stuff>} that puts quotes around <stuff> in math mode at the same level of the highest element (in \displaystyle):

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\newsavebox{\mathbox}\newsavebox{\mathquote}
\makeatletter
\newcommand{\mathquotes}[1]{% \mathquotes{<stuff>}
  \savebox{\mathquote}{\text{``}}% Save quotes
  \savebox{\mathbox}{$\displaystyle #1$}% Save <stuff>
  \raisebox{\dimexpr\ht\mathbox-\ht\mathquote\relax}{``}#1\raisebox{\dimexpr\ht\mathbox-\ht\mathquote\relax}{''}
}
\makeatother
\begin{document}
\[\text{``}\frac{1}{0^-}\text{''} \quad \mathquotes{\frac{1}{0^-}}\]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.