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 not rendering #1596

Closed
2 tasks done
khljc opened this issue Oct 19, 2024 · 9 comments
Closed
2 tasks done

latex not rendering #1596

khljc opened this issue Oct 19, 2024 · 9 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@khljc
Copy link

khljc commented Oct 19, 2024

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.10.2

Neorg setup

-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
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 = ","

-- Setup lazy.nvim
require("lazy").setup({
spec = {
{
"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,
},
{
"nvim-neorg/neorg",
lazy = false,
version = "*",
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/notes",
},
default_workspace = "notes",
},
},
},
}

    vim.wo.foldlevel = 99
    vim.wo.conceallevel = 2
  end,
},

},
})

Actual behavior

2024-10-19_21-02

Putting the equation in $ makes it change colour to orange but does nothing.

Expected behavior

It should show the 2 after c to be a power. This doesn't only happen to this equation, latex doesn't work in general

Steps to reproduce

  1. Install neorg through the kickstart
  2. Try to write latex between $ in norg files

Potentially conflicting plugins

This is the default kickstart config, no plugins.

Other information

On fedora and using kitty(other terminals also dont work btw).

Help

None

Implementation help

I am new to neorg and nvim in general, I am probably doing something wrong but I don't know what, I need someone to tell me what's happening.

@khljc khljc added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Oct 19, 2024
@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker Oct 19, 2024
@PartyWumpus
Copy link

You need to enable the latex renderer with ["core.latex.renderer"] = {}, i imagine

@khljc
Copy link
Author

khljc commented Oct 19, 2024

image

Still doesn't work:

{
"nvim-neorg/neorg",
lazy = false,
version = "*",
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/notes",
},
["core.latex.renderer"] = {},
default_workspace = "notes",
},
},
},
}

    vim.wo.foldlevel = 99
    vim.wo.conceallevel = 2
  end,
}

@PartyWumpus
Copy link

You also need image.nvim and a latex install as described in the wiki, although I probably would've expected the command to show up but just fail after adding that, idk.

@benlubas
Copy link
Contributor

when you send code on github you need to use code blocks.

local x = "this is a lua code block"

It looks like:

```lua
local x = "this is a lua code block"
```

Now. Let's format the code that you sent, specifically this part:

["core.dirman"] = {
  config = {
    workspaces = {
      notes = "~/notes",
    },
    ["core.latex.renderer"] = {},
    default_workspace = "notes",
  },
}

Now, that doesn't look right... You're passing ["core.latex.render"] to the config of the ["core.dirman"] module.


All that said. The latex module is very buggy, and also requires a lot to get working. You need to read the documentation for it. And also the documentation for neorg. The wiki is your friend.

@khljc
Copy link
Author

khljc commented Oct 20, 2024

image

I've done what you guys said and now it doesnt seem to give an error but it still doesnt do anything, but thanks for your suggestions i will keep looking in the wiki.

@PartyWumpus
Copy link

I've done what you guys said and now it doesnt seem to give an error but it still doesnt do anything, but thanks for your suggestions i will keep looking in the wiki.

What's the raw text, you should be doing $|\frac{1}{4}|$ for a LaTeX block, or just $1 + 2 + 3$ for a plain maths block.

@khljc
Copy link
Author

khljc commented Oct 21, 2024

image

No error, no nothing ;-;
My neorg setup rn(I have the image.nvim plugin aswell):

{
"nvim-neorg/neorg",
lazy = false,
version = "*",
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.integrations.image"] = {},
["core.latex.renderer"] = {},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/notes",
},
default_workspace = "notes",
},
},
},
}

    vim.wo.foldlevel = 99
    vim.wo.conceallevel = 2
  end,
}

@sdifru
Copy link

sdifru commented Nov 15, 2024

I've got the same issue. No error, just nothing happens.

@khljc
Copy link
Author

khljc commented Dec 17, 2024

back, fixed it just needed to enable some more things:

return{
"nvim-neorg/neorg",
lazy = false,
version = "*",
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.integrations.image"] = {},
["core.autocommands"] = {},
["core.highlights"] = {},
["core.integrations.treesitter"] = {},
["core.neorgcmd"] = {},
["core.latex.renderer"] = {},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/notes",
},
default_workspace = "notes",
},
},
},
}

    vim.wo.foldlevel = 99
    vim.wo.conceallevel = 2
  end,
}

@khljc khljc closed this as completed Dec 17, 2024
@github-project-automation github-project-automation bot moved this from added-updated-reopened to done in sorting neorg issue tracker Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

4 participants