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

2
  • 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? Apr 13, 2015 at 0:58
  • 1
    One obvious choice is $\prime$, but your best bet is to check the comprehensive list of latex symbols. Apr 13, 2015 at 2:14

1 Answer 1

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

1
  • Perfect, this is what I am looking for! Apr 13, 2015 at 14:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .