TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im using \lstdefinelanguage to add some new languages. Now everything is fine, I just would like to add another font to my language. I would like to use inconsolata.

I have now this:

  basicstyle=\small %what else do i have to add to use inconsolata?

Any ideas? Thanks

share|improve this question
up vote 3 down vote accepted

Just loading the inconsolata package, the monospaced font is redefined, so it's enough to add \ttfamily (you could also access the font using \fontfamily{fi4}\selectfont):


object HelloWorld {
    def main(args: Array[String]) {
      println("Hello, world!")


enter image description here

share|improve this answer
Thank you, this is working. Im just asking myself why "fi4"? And also, how to add the same font in a bold format? – LissyA Oct 6 '12 at 18:38
Shouldn't basicstyle=\ttfamily\small suffice? – clemens Oct 6 '12 at 18:41
@LissyA unfortunately the inconsolata package doesn't offer a bold version of the font. – Gonzalo Medina Oct 6 '12 at 18:41
@cgnieder you're absolutely right; I'll edit the answer. Thank you. – Gonzalo Medina Oct 6 '12 at 18:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.