alshedivat / al-folio

A beautiful, simple, clean, and responsive Jekyll theme for academics
https://alshedivat.github.io/al-folio/
MIT License
10.74k stars 11.05k forks source link

LaTeX Packages and Custom Environments/Commands #179

Closed taxminion closed 2 months ago

taxminion commented 3 years ago

Is your feature request related to a problem? Please describe. Certain LaTeX environments aren't available by default. Normal I would use \usepackage{} but that doesn't seem to be possible in markdown files (for blog posts). I would like to have access to the 'theorem' environment and \newtheorem command found in the 'amsthm' package, for example (among others, of course).

Describe the solution you'd like Some sort of Mathjax header file where I could call all the packages I need and define any custom environments/commands globally.

Describe alternatives you've considered The ability to call packages in markdown files would be sufficient too. Worst case, I could copy paste the would-be header in each post.

Additional context It's possible to define macros in markdown files with $$\newcommand{[macro]}{[command]}$$ but it does not seem possible to call packages.

alshedivat commented 3 years ago

@taxminion, MathJax does not support arbitrary latex, it only supports equations. Are you asking for arbitrary latex support?

FYI, I've experimented with arbitrary latex support previously. LaTeX.js provides such support. You can see a demo example. Let me know if such latex support is something you are looking for.

samfearn commented 3 years ago

I've not come across LaTeX.js before, looks interesting. Might have to play with this at some point. Thanks for letting me know about it! Unfortunately no TikZ support tho :(

samfearn commented 3 years ago

Btw, Pandoc might be relevant here. Convert latex to MD and then include the MD. Probably easiest to do the conversion outside of the jekyll build, but maybe it could be interesting to run pandoc on files in a directory before the jekyll build.