Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latex support #28

Closed
koaning opened this issue Feb 10, 2019 · 4 comments
Closed

latex support #28

koaning opened this issue Feb 10, 2019 · 4 comments
Labels
question Not a bug, but a FAQ entry

Comments

@koaning
Copy link

koaning commented Feb 10, 2019

Does pdoc3 offer mathematical rendering via something like MathJax? I wouldn't know how to implement it but I'd be willing to investigate if people are open to this feature.

@kernc kernc added the question Not a bug, but a FAQ entry label Feb 13, 2019
@kernc
Copy link
Member

kernc commented Feb 13, 2019

This use case had been accounted for. You should be able to make a template file head.mako with contents like:

<script async defer src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>

Then run pdoc with --template-dir pointing to the directory containing this overridden template file (see custom templating documentation).

Afterwards, $$-delimited LaTeX blocks should render in symbols.

@kernc kernc closed this as completed Feb 13, 2019
@kernc
Copy link
Member

kernc commented Jun 25, 2019

As of #74, you should be able to run pdoc with pdoc --config latex_math=True ... for seamless MathJax support.

Duplicate of #70.

@paloha
Copy link

paloha commented Oct 17, 2022

Hello @kernc I would like to ask about $ inline math support. I thought this was supported, but now I realized only $$ for blocks of math are supported. I described my situation here in a GitLab issue. The result of this issue is that basically GitLab now finally supports $...$ and $$...$$ for math. This is in sync with GitHub 🎊 It also works in the .pdf output obtained by piping pdoc to pandoc. Unfortunately, it does not work in your html output even with --config latex_math=True. I believe it would be reasonable to have a default which is in sync with the big players like GitHub and GitLab. What do you think?

For those who want a workaround: Copy the head.mako to your desired location, fill it with code from this answer, and then compile your documentation with custom --template-dir as @kernc suggested here, a few comments above.

@kernc
Copy link
Member

kernc commented Oct 17, 2022

@paloha I agree. Care to open a new issue for this to be properly tracked and eventually taken care of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Not a bug, but a FAQ entry
Development

No branches or pull requests

3 participants