How can I create an environment that does the above? I want to be as close to Isabelle as possible(see picture). My best alternative is to define an environment as in the answer to my other question and insert $ $around every math character I use. Another big drawback of this solution is that in a block of text the first line is not alligned with the rest (like a paragraph in text mode in latex). Ideally I would like to be able to leave some blank space from the text before and after it (like $$ $$ does) but also be able to text formatted this way inline (like $$ does). See the picture for the kind of result I want.

  • 1
    I'm having trouble understanding your question. Your picture doesn't have any blank lines. Or are you talking about some vertical spacing before and after the environment?
    – Teepeemm
    Commented Feb 13, 2018 at 20:22
  • @Teepeemm thanks for noticing, I changed the code to look as it was supposed to. Commented Feb 13, 2018 at 20:32
  • Don't use $$...$$ Commented Feb 13, 2018 at 22:22

1 Answer 1


As already said for your previous question, if you want to include code, a math environment might not be the best choice. I suggest the listings package instead. The appearance can be customised in many ways (syntax highlighting etc., see the documentation for details), but the basic usage would be like this:



lemma inf_lim_larger_real:
    fixes M :: real and h :: "real $\Rightarrow$ real"


enter image description here

You must log in to answer this question.

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