GithubHelp home page GithubHelp logo

Comments (16)

kristijanhusak avatar kristijanhusak commented on September 3, 2024

Thanks for the detailed explanation.

To be honest, I have absolutely no experience with Latex. Any assistance on this topic is appreciated.

Is Latex in org only available between /begin{something} /end{something} or also outside of it?

Image preview is possible via https://pypi.org/project/ueberzug/ (only on X11), but I'm not even sure how would it be done.

For the publishing, I plan to support all publishing by using the emacs orgmode tools. I know https://github.com/jceb/vim-orgmode supports it so I assume it's possible.

From what I see, fastest thing that could be done is to allow "tex" highlight as part of org. Publishing will come later, and i'm not sure about the previews.

from orgmode.

shaunsingh avatar shaunsingh commented on September 3, 2024

Any assistance on this topic is appreciated.

Sure, let me know if you need anything else. I have minimal experience making lua plugins but I can try my best.

Is Latex in org only available between /begin{something} /end{something} or also outside of it?

According to the org wiki, latex fragments are identified as any of the following

  1. Anything encased within \begin and \end
  2. Anything within the LaTeX math delimiters (this is either $text$ (no whitespaces allowed), $$ text $$, \( text \), or \[ text \]

(a more detailed explanation can be found here: https://orgmode.org/manual/LaTeX-fragments.html#LaTeX-fragments)

Image preview is possible via https://pypi.org/project/ueberzug/ (only on X11), but I'm not even sure how would it be done.

Looks good! I think the only possible way is to create a floating window, start a terminal, and use ueberzug to display the image. I use this method to display images for my startup dashboard. The only issue is that you would have to keep the preview aligned with scrolling text, and regenerate the preview multiple times (causing lag and performance drops)

For the publishing, I plan to support all publishing by using the emacs orgmode tools. I know https://github.com/jceb/vim-orgmode supports it so I assume it's possible.

I believe the code we need is Here. Its in python so we would need to translate that to lua, but the logic looks quite simple.

from orgmode.

kristijanhusak avatar kristijanhusak commented on September 3, 2024

I think, for now, I could add latex highlighting for those fragments (via syntax region), and have publishing be done separately for everything.

For the image preview, do you know if there's a way to generate the image with emacs?

from orgmode.

shaunsingh avatar shaunsingh commented on September 3, 2024

You can use org-latex-preview to generate a preview of the latex equation under the cursor. I'm not sure once you generate a preview, how to extract it.

Screen Shot 2021-07-09 at 1 37 32 PM

from orgmode.

kristijanhusak avatar kristijanhusak commented on September 3, 2024

@shaunsingh I added some basic highlighting options. It's disabled by default. Check here https://github.com/kristijanhusak/orgmode.nvim/blob/master/DOCS.md#org_highlight_latex_and_related.

Let me know how it works for you.

from orgmode.

shaunsingh avatar shaunsingh commented on September 3, 2024

image

Seems like it isn't working on my end. I tried both the "native" and "entities" options.

This is my config with packer:

        use {
            'kristijanhusak/orgmode.nvim',
            ft = {'org'},
            config = function()
                require("orgmode").setup(
                    {
                        org_highlight_latex_and_related = 'entities'
                    }
                )
            end
        }

from orgmode.

kristijanhusak avatar kristijanhusak commented on September 3, 2024

Please pull latest master and give it another try.
If it doesn't work, please try without packer's lazy loading.

from orgmode.

kristijanhusak avatar kristijanhusak commented on September 3, 2024

I added exporting. See https://github.com/kristijanhusak/orgmode.nvim/blob/master/DOCS.md#org_export.

from orgmode.

shaunsingh avatar shaunsingh commented on September 3, 2024

Please pull latest master and give it another try.

Thanks, works well now.

I added exporting.

Works as expected. Would you consider also adding pandoc as an export option? Might be useful for those who don't have emacs installed but would like to export to pdf.

from orgmode.

kristijanhusak avatar kristijanhusak commented on September 3, 2024

Yeah, why not. I'll probably group exports to allow more options, and also expose a setting for custom exports.

from orgmode.

kristijanhusak avatar kristijanhusak commented on September 3, 2024

I added pandoc exports for several file types (html, tex, pdf). Also, I added an option to add custom exports. See https://github.com/kristijanhusak/orgmode.nvim/blob/master/DOCS.md#org_custom_exports . Let me know how it works.

Regarding the preview, I'm not sure if I'll be adding it. It seems very complicated, especially since Neovim can't show images inline.

I didn't try, but you could maybe use this solution via lsp, and here's the preview.

from orgmode.

shaunsingh avatar shaunsingh commented on September 3, 2024

Is it possible by any chance to use treesitter for the latex highlighting? The treesitter colors are a little easier to read:

image

(treesitter on the right)

from orgmode.

kristijanhusak avatar kristijanhusak commented on September 3, 2024

I don't think it's possible to inject treesitter for some syntax. Once we have treesitter support in the whole org, we should be able to do this easily.

from orgmode.

kristijanhusak avatar kristijanhusak commented on September 3, 2024

@shaunsingh did you had a chance to test features added through this issue? Can this be closed if everything is working as expected?

from orgmode.

shaunsingh avatar shaunsingh commented on September 3, 2024

Everything works great! The only thing I couldn't get working was the preview with lsp, since the built-in markdown renderer in my gui didn't seem to support mathjax, but that isn't something you can solve

You can close the issue

from orgmode.

kristijanhusak avatar kristijanhusak commented on September 3, 2024

Awesome, thanks for the feedback and for testing it.

from orgmode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.