[Tex/LaTex] item formatting in description list


How can I get this to work:

    \item[\texttt{foo :: a \rightarrow b}] bla

without having to write:



  • \ttfamily: for typewriter formating
  • ~: to get the spacing right(??)
  • $: to activate math mode
  • \normalfont: to get back to normal
  • last ~: insert simple space(??)

or how would you list some function definitions and append a description for the functions?

Best Answer

How about

    \item[\texttt{foo :: a $\rightarrow$ b}] bla

That is: add a closing brace and $s around \rightarrow.

Or maybe you want

    \item[\texttt{[foo ::~a $\rightarrow$ b]}] bla