Skip to content

feat(image): match latex code tag for math preview #945

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

Merged
merged 3 commits into from
Mar 25, 2025

Conversation

js0ny
Copy link
Contributor

@js0ny js0ny commented Mar 25, 2025

Summary

Add latex preview image for common markups/blocks

screenshot_20250325_032926

Related PRs

Changes

  • Let the rendering match latex source
  • Let the rendering match equation block
  • Let the rendering match \[\] block (latex_env in Org Treesitter)

Checklist

I confirm that I have:

  • Followed the
    Conventional Commits
    specification
    (e.g., feat: add new feature, fix: correct bug,
    docs: update documentation).
  • My PR title also follows the conventional commits specification.
  • Updated relevant documentation, if necessary.
  • Thoroughly tested my changes.
  • Added tests (if applicable) and verified existing tests pass with
    make test.
  • Checked for breaking changes and documented them, if any.

Further TODOs?

For typst, the rendering is feasible and only just feasible, I did not commit that change, the snippet is below

; NOTE: This is buggy
(block
  name: (expr) @name
  parameter: (expr) @lang
  contents: (contents) @image.content 
  (#match? @name "(src|SRC)")
  (#match? @lang "(typst|TYPST)")
  (#set! injection.language "typst")
  (#set! image.ext "math.typ"))

Maybe match other common blocks like align?

Copy link
Member

@kristijanhusak kristijanhusak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kristijanhusak kristijanhusak merged commit 3f8114e into nvim-orgmode:master Mar 25, 2025
17 checks 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