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

Render LaTeX #373

Merged
merged 3 commits into from
Sep 11, 2024
Merged

Render LaTeX #373

merged 3 commits into from
Sep 11, 2024

Conversation

albertoperdomo2
Copy link
Contributor

This PR introduces LaTeX equation rendering capability to AstroPaper, enhancing its functionality for technical and scientific writing. By integrating KaTeX, we now support rendering of both inline and block LaTeX equations in Markdown files.

I do think this will enlarge the use of AstroPaper in the scientific community.

Many technical bloggers and documentation writers need to include mathematical equations in their content. Adding LaTeX support significantly expands AstroPaper's usefulness for these users, making it a more versatile platform for a wider range of creators.

Changes Made

  • Updated astro.config.mjs to include remark-math and rehype-katex plugins.
  • Modified the Layout.astro file to include KaTeX CSS.
  • Added necessary dependencies (rehype-katex, remark-math, and katex) to package.json.
  • Created a sample Markdown file demonstrating LaTeX usage.

@satnaing
Copy link
Owner

satnaing commented Sep 9, 2024

I love what you’ve done and agree that this would be useful for many users. However, I think it might be better suited as a (docs) blog post rather than a default feature, as LaTeX syntax seems specific to certain use cases, like the blog post you've written.

How about creating a docs blog post for what you've implemented so far? This way, we avoid adding additional dependencies to the project, while users who want to use LaTeX syntax can follow along with the guide.

@albertoperdomo2
Copy link
Contributor Author

@satnaing yep, I noticed the emphasis on the minimal aspect of AstroPaper. I'll change the PR and create a simple blog post with instructions to enable LaTeX rendering.

src/content/blog/latex-rendering.md Outdated Show resolved Hide resolved
src/content/blog/latex-rendering.md Outdated Show resolved Hide resolved
src/content/blog/latex-rendering.md Outdated Show resolved Hide resolved
src/content/blog/latex-rendering.md Outdated Show resolved Hide resolved
src/content/blog/latex-rendering.md Outdated Show resolved Hide resolved
src/content/blog/latex-rendering.md Outdated Show resolved Hide resolved
@satnaing
Copy link
Owner

@albertoperdomo2
I made some changes to this PR.
You can check whether the syntaxes are OK or not.
If everything's fine, I'll merge it.

@albertoperdomo2
Copy link
Contributor Author

@satnaing LGTM 👍🏽

@satnaing satnaing merged commit 70b2486 into satnaing:main Sep 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants