I'm currently looking for a way to generate LaTeX inference-rules (horizontal line style) from inductive definitions in some dependently typed language, probably Coq.

I've found this package, but it seems pretty fragile, doesn't have a lot of recent updates, and fails silently whenever it hits unicode.

What I'm wondering is, could I abuse Coq's ability to write Tactics in OCaml to inspect an Inductive definition, and format it to LaTeX? Obviously I'd write the formatting code myself, but I'm wondering how to get at an AST representation

There are some plugin intro tutorials here and here, but they only give basics, and I haven't found true documentation of the plugins API, so I'm not sure how to get at an OCaml representation of the inductive type from, for example, the name of the type, or a goal of that type.

Has this been done? Are there existing tools that do this, or something similar, that I could use as an example?