1

I want to display the Isabelle/Isar and Coq languages in Latex, e.g.

enter image description here

when I do coding format in a *.pdf format (for an academic paper). How do I do this? (I hope this generalizes to other languages like Python and Coq, so that is useful to everyone). I'd like this to work in overleaf too.

Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
  • 1
    Have a look at `listings` or `minted` packages - however you might have to define a new language style. – samcarter_is_at_topanswers.xyz Jan 24 '21 at 21:53
  • 2
    minted supports isabelle (http://proofcraft.org/blog/syntax-highlighting.html), but don't expect miracles: pygments does not understand which variable is bound (green variables), which is free (blue). Screenshots are necessary in that case. – Mathias Fleury Jan 25 '21 at 07:25
  • 1
    [coqdoc](https://coq.inria.fr/distrib/current/refman/using/tools/coqdoc.html?highlight=latex) can convert coq code to latex. First compile with `coqc Foo.v` and then do `coqdoc --latex Foo.v`. – larsr Jan 25 '21 at 10:48
  • 2
    I would like to mention that for Isabelle there exists a native methodology for the extraction of the code snippets that can be embedded into LaTeX documents: see section 7 the document titled *LaTeX Sugar for Isabelle Documents* that constitutes a part of the standard documentation of Isabelle. – user9716869 - supports Ukraine Jan 25 '21 at 16:50

0 Answers0