nvim-neorg / neorg

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

latex not rendering #1596

Open Kaitxn opened 3 days ago

Kaitxn commented 3 days ago

Prerequisites

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 = { ensureinstalled = { "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.

PartyWumpus commented 3 days ago

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

Kaitxn commented 3 days ago

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 commented 3 days ago

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 commented 2 days ago

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:

```lua
["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.

Kaitxn commented 2 days ago

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 commented 2 days ago

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.

Kaitxn commented 1 day ago

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,
}