I believe the sympy package is what you’re looking for. It can pretty print equations in the console. You’ll want to use the the preview function to creat e.g. a PNG, which a browser can easily open or can be linked to in a HTML file— you’ll need to have LaTeX installed to do this.