4

Here is a quick question, how to use tex to print this ' symbol? An example is shown below:

data 'a list = Nil | Cons (e, 'a list)

I tried to use ' or `, but they all looks bad.. I am sorry but I am not a native English speaker, so I don't even know the name of '..

Could anyone help me on this simple problem? thank you

  • 1
    If it's Lisp code (I assume), have you tried the listings package with basicstyle=\ttfamily to make it look like a typewriter font? – Mike Renfro Apr 13 '15 at 0:58
  • 1
    One obvious choice is $\prime$, but your best bet is to check the comprehensive list of latex symbols. – John Kormylo Apr 13 '15 at 2:14
5

You can use the package upquote and put the code in a verbatim environment.

\documentclass{article}
\usepackage{upquote}
\begin{document}
\begin{verbatim}
data 'a list = Nil | Cons (e, 'a list)
\end{verbatim}
\end{document}

enter image description here

  • Perfect, this is what I am looking for! – lllllllllllll Apr 13 '15 at 14:37

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.