# Typesetting Quine quotes

The obvious way of typesetting Quine quotes, also known as quasi-quotation marks, in LaTeX doesn't work well when the content of the quote is tall. For example:

\documentclass[12pt]{article}
\usepackage{amssymb}
\begin{document}
$\left\ulcorner \frac{1}{2} \right\urcorner$
\end{document}


This seems odd, given that \ulcorner (resp. \urcorner) is in the mathopen (resp. mathclose) class. Is there some way of getting LaTeX to automatically raise the quotes to match the height of the content?

Edit. I forgot to mention that I would very much prefer a solution that works with unicode-math.

For good results \left and \right need support at font level for their delimiters. For example, MnSymbol supports resizable corners:

\documentclass[12pt]{article}
\usepackage{MnSymbol}
\begin{document}
$\left\ulcorner \frac{1}{2} \right\urcorner$
\end{document}


However, loading MnSymbol also affects the appearance of other math symbols.

The following example only uses the relevant part of MnSymbol to get the two corner symbols:

\documentclass[12pt]{article}

\makeatletter
\DeclareFontFamily{OMX}{MnSymbolE}{}
\DeclareSymbolFont{MnLargeSymbols}{OMX}{MnSymbolE}{m}{n}
\SetSymbolFont{MnLargeSymbols}{bold}{OMX}{MnSymbolE}{b}{n}
\DeclareFontShape{OMX}{MnSymbolE}{m}{n}{
<-6>  MnSymbolE5
<6-7>  MnSymbolE6
<7-8>  MnSymbolE7
<8-9>  MnSymbolE8
<9-10> MnSymbolE9
<10-12> MnSymbolE10
<12->   MnSymbolE12
}{}
\DeclareFontShape{OMX}{MnSymbolE}{b}{n}{
<-6>  MnSymbolE-Bold5
<6-7>  MnSymbolE-Bold6
<7-8>  MnSymbolE-Bold7
<8-9>  MnSymbolE-Bold8
<9-10> MnSymbolE-Bold9
<10-12> MnSymbolE-Bold10
<12->   MnSymbolE-Bold12
}{}
\DeclareMathDelimiter{\ulcorner}
{\mathopen}{MnLargeSymbols}{'036}{MnLargeSymbols}{'036}
\DeclareMathDelimiter{\urcorner}
{\mathclose}{MnLargeSymbols}{'043}{MnLargeSymbols}{'043}
\makeatother

\begin{document}
$\left\ulcorner \frac{1}{2} \right\urcorner$
\end{document}

• Actually, I'm using unicode-math, so MnSymbol is not even an option for me. – Zhen Lin Apr 18 '13 at 13:44
• What is required to obtain the other two corners \llcorner and \lrcorner? – flamingpenguin Aug 22 '14 at 10:24
• @flamingpenguin An editor with the ability to replace \ulcorner by \llcorner and \urcorner by \lrcorner :-) – Heiko Oberdiek Aug 22 '14 at 13:52

I know this was a long time ago, but how about using Sam Buss's macro that is supposed to work for Gödel numbers. See http://www.logicmatters.net/latex-for-logicians/symbols/corner-quotes-for-godel-numbers/

\documentclass{article}

\usepackage{amssymb}

\newbox\qqBoxA
\newdimen\qqCornerHgt
\setbox\qqBoxA=\hbox{$\ulcorner$}
\global\qqCornerHgt=\ht\qqBoxA
\newdimen\qqArgHgt
\def\Quinequote #1{%
\setbox\qqBoxA=\hbox{$#1$}%
\qqArgHgt=\ht\qqBoxA%
\ifnum     \qqArgHgt<\qqCornerHgt \qqArgHgt=0pt%
\fi \raise\qqArgHgt\hbox{$\ulcorner$} \box\qqBoxA %
\raise\qqArgHgt\hbox{$\urcorner$}}

\begin{document}
$\Quinequote{\frac{1}{2}}$
\end{document}


Results in

The scalerel package can stretch or scale the symbols, but that may not be what you want. On the other hand, if the quotes are just shifted, is the meaning unambiguous, or could the quotes be misiniterpreted to apply to the numerator only? (I don't know how they are used). Otherwise, if just shifting is acceptable, use \atop

\documentclass[12pt]{article}
\usepackage{scalerel}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
$\stretchleftright{\ulcorner}{\displaystyle\frac{1}{2}}{\urcorner}$

$\scaleleftright{\ulcorner}{\displaystyle\frac{1}{2}}{\urcorner}$

${\ulcorner \atop \phantom{2}} \frac{1}{2} {\urcorner \atop \phantom{2}}$

\end{document}


• This works in unicode-math, though the results are ugly. Thanks for the suggestion! – Zhen Lin Apr 18 '13 at 13:48

It may be ugly in code, but this mess

\newlength{\tmplenA}
\newlength{\tmplenB}

\newcommand{\ucorner}[1]{\settowidth{\tmplenA}{$\ulcorner$}
\settoheight{\tmplenB}{$#1$}
\setlength{\tmplenB}{1.1\tmplenB}
\raisebox{\tmplenB}{$\ulcorner$}\hspace{-0.5\tmplenA}
#1
\hspace{-0.5\tmplenA}\raisebox{\tmplenB}{$\urcorner$}}


will let you produce

$\ucorner{P}$\\\\
$\ucorner{\frac{1}{2}}$\\\\
$\ucorner{\left(x^{x^x}\right)}$


To adjust the height of the corner brackets upwards, replace the 1.1s with something greater than 1.1. To adjust the brackets inwards, replace the 0.5s with something greater than 0.5 (but keep the negative on the second one).

• Why do you subtract the width of the quasi-quotation mark from 1.1x the height of the argument in #1? What does width has to do with height? See "\addtolength{\tmplenB}{-\tmplenA}". – Alessander Botti Benevides Jul 5 at 17:36

My solution is a little easier and a lot sketchier.

The symbols appear as accents in the tipa package (which works in textmode), so when used as punctuation they had questionable spacing, which I modified using equally questionable methods:

\usepackage{tipa}

\newcommand{\lquine}{\textopencorner\hspace{-1pt}}
\newcommand{\rquine}{$\,$\textcorner$\$}