[racket] Scribble: how can I produce a straight quote within @racketfont?

From: Matthew Butterick (mb at mbtype.com)
Date: Sun Jul 13 14:11:09 EDT 2014

In Scribble, the @racketfont tag decodes its content, so this markup:

> @racketfont{◊(select 'h1 doc)}

Will render as this (with a curly quote in front of h1):

> ◊(select ’h1 doc)


But I want this (straight quote, not curly)

> ◊(select 'h1 doc)


@verbatim is not the answer, because it will create a line break.

@literal seems like it should be the answer:

> @racketfont{◊(select @literal{'}h1 doc)}

But oddly, even though @literal is nested inside @racketfont, the resulting markup doesn't reflect this, and renders as if the Scribble had been written this way:

> @racketfont{◊(select} @literal{'}@racketfont{h1 doc)}


Meaning, the @literal content adopts the formatting of the enclosing block, not the @racketfont span.

Hence the question: how can I force a literal character within @racketfont that actually adopts the formatting of @racketfont.

Posted on the users mailing list.