This package adds a widget that renders Latex in doc modules into the Lean infoview.
- Add the following line to the end of your
lakefile.lean
:require LatexInLean from git "https://github.com/kcaze/LatexInLean.git"@"main"
- Run the
lake update LatexInLean
in the root directory of your Lean project.
To use LatexInLean in a .lean
file, you need to add two lines:
- Add
import LatexInLean
to the beginning of your file to import the LatexInLean package. - Add
show_panel_widgets [latex]
immediately after your import statements to activate the LatexInLean widget in the Lean infoview.
Once LatexInLean is activated, you can document your theorem
's, lemma
's, example
's, etc. with module docstrings that contain Latex within $
's. A module docstring is a special type of comment that begins with the syntax /-!
and ends with -/
.
Here is an example of how you might document your code to use LatexInLean.