Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
Welcome to TeX.SE. –  Peter Grill Feb 1 '12 at 3:04
    
Thanks! It is good to be here. –  rpc Feb 1 '12 at 3:46
add comment

1 Answer 1

up vote 8 down vote accepted

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}
share|improve this answer
    
Thanks. I cannot up vote your answer. Bur I would if I could. –  rpc Feb 1 '12 at 3:52
    
@rpc: Thanks; you need 15 reputation in order to up-vote. So you'll be there soon. –  Werner Feb 1 '12 at 3:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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