nvim-neorg / neorg

Modernity meets insane extensibility. The future of organizing your life in Neovim.
GNU General Public License v3.0
6.08k stars 202 forks source link

latex renderer `render_on_enter` not working #1445

Open glyh opened 1 month ago

glyh commented 1 month ago

Prerequisites

Neovim Version

NVIM v0.10.0 Build type: Release LuaJIT 2.1.1716656478

Neorg setup

require("neorg").setup {
  load = {
    ["core.defaults"] = {},
    ["core.export"] = {},
    ["core.export.markdown"] = {},
    ["core.concealer"] = {},
    ["core.completion"] = {
      config = {
        engine = "nvim-cmp",
      },
    },
    ["core.dirman"] = {
      config = {
        workspaces = {
          notes = "~/Documents/notes/neorg",
        },
        default_workspace = "notes",
      },
    },
    ["core.integrations.image"] = {},
    ["core.latex.renderer"] = {
      config = {
        render_on_enter = true,
      },
    },
  },
}

Actual behavior

No latex is being rendered as I enter, I have to type :Neorg latex-render

Expected behavior

latex is not rendered when I opened the buffer

Steps to reproduce

Use this config:

-- Adapted from https://github.com/folke/lazy.nvim#-installation

-- Install lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable", -- latest stable release
        lazypath,
    })
end
vim.opt.rtp:prepend(lazypath)

-- Set up both the traditional leader (for keymaps) as well as the local leader (for norg files)
vim.g.mapleader = " "
vim.g.maplocalleader = ","

require("lazy").setup({
    {
        "3rd/image.nvim",
        dependencies = { "luarocks.nvim" },
        config = true,
    },
    {
        "rebelot/kanagawa.nvim", -- neorg needs a colorscheme with treesitter support
        config = function()
            vim.cmd.colorscheme("kanagawa")
        end,
    },
    {
        "nvim-treesitter/nvim-treesitter",
        build = ":TSUpdate",
        opts = {
            ensure_installed = { "c", "lua", "vim", "vimdoc", "query" },
            highlight = { enable = true },
        },
        config = function(_, opts)
            require("nvim-treesitter.configs").setup(opts)
        end,
    },
    {
        "vhyrro/luarocks.nvim",
        priority = 1000,
        config = true,
    },
    {
        "nvim-neorg/neorg",
        dependencies = { "luarocks.nvim" },
        version = "*",
        config = function()
            require("neorg").setup({
                load = {
                    ["core.defaults"] = {},
                    ["core.concealer"] = {},
                    ["core.dirman"] = {
                        config = {
                            workspaces = {
                                notes = "~/notes",
                            },
                            default_workspace = "notes",
                        },
                    },

                    ["core.latex.renderer"] = {
                        config = {
                            render_on_enter = true,
                        },
                    },
                },
            })

            vim.wo.foldlevel = 99
            vim.wo.conceallevel = 2
        end,
    },
})
nvim -u config.lua some_file_containing_latex.norg

Potentially conflicting plugins

None as I have a minimal reproduction.

Other information

None.

Help

Yes, but I don't know how to start. I would need guidance (check question below)

Implementation help

Tell me where should I start.