OXY2DEV/markview.nvim

not a ๐Ÿž Bug: LaTeX isn't rendering

Closed this issue ยท 3 comments

Before reporting:

  • Ensure that the issue is reproducable on the main branch.
  • Ensure that there isn't an issue on this(either open or closed).

Problem:

image

I have installed the latex parser for treesitter, I have enabled latex in the config, and markdown is enabled, as far as I know it should be rendering, but given the fact no one has reported this, I know it's an issue in something I'm doing, and not a bug, the following is my markview config

markview.setup({
    checkboxes = presets.checkboxes.nerd,
    headings = presets.headings.glow_center,
    latex = {
        enable = true,

        --- Bracket conceal configuration.
        --- Shows () in specific cases
        brackets = {
            enable = true,

            --- Highlight group for the ()
            ---@type string
            hl = "@punctuation.brackets"
        },

        --- LaTeX blocks renderer
        block = {
            enable = true,

            --- Highlight group for the block
            ---@type string
            hl = "Code",

            --- Virtual text to show on the bottom
            --- right.
            --- First value is the text and second value
            --- is the highlight group.
            ---@type string[]
            text = { "๎š› LaTeX ", "Special" }
        },

        --- Configuration for inline LaTeX maths
        inline = {
            enable = true
        },

        --- Configuration for operators(e.g. "\frac{1}{2}")
        operators = {
            enable = true,
            configs = {
                sin = {
                    --- Configuration for the extmark added
                    --- to the name of the operator(e.g. "\sin").
                    ---
                    --- see `nvim_buf_set_extmark()` for all the
                    --- options.
                    ---@type table
                    operator = {
                        conceal = "",
                        virt_text = { { "๐šœ๐š’๐š—", "Special" } }
                    },

                    --- Configuration for the arguments of this
                    --- operator.
                    --- Item index is used to apply the configuration
                    --- to a specific argument
                    ---@type table[]
                    args = {
                        {
                            --- Extmarks are only added
                            --- if a config for it exists.

                            --- Configuration for the extmark
                            --- added before this argument.
                            ---
                            --- see `nvim_buf_set_extmark` for more.
                            before = {},

                            --- Configuration for the extmark
                            --- added after this argument.
                            ---
                            --- see `nvim_buf_set_extmark` for more.
                            after = {},

                            --- Configuration for the extmark
                            --- added to the range of text of
                            --- this argument.
                            ---
                            --- see `nvim_buf_set_extmark` for more.
                            scope = {}
                        }
                    }
                }
            }
        },

        --- Configuration for LaTeX symbols.
        symbols = {
            enable = true,

            --- Highlight group for the symbols.
            ---@type string?
            hl = "@operator.latex",

            --- Allows adding/modifying symbol definitions.
            overwrite = {
                --- Symbols can either be strings or functions.
                --- When the value is a function it receives the buffer
                --- id as the parameter.
                ---
                --- The resulting string is then used.
                ---@param buffer integer.
                today = function (buffer)
                    return os.date("%d %B, %Y");
                end
            },

            --- Create groups of symbols to only change their
            --- appearance.
            groups = {
                {
                    --- Matcher for this group.
                    ---
                    --- Can be a list of symbols or a function
                    --- that takes the symbol as the parameter
                    --- and either returns true or false.
                    ---
                    ---@type string[] | fun(symbol: string): boolean
                    match = { "lim", "today" },

                    --- Highlight group for this group.
                    ---@type string
                    hl = "Special"
                }
            }
        },

        subscript = {
            enable = true,

            hl = "MarkviewLatexSubscript"
        },

        superscript = {
            enable = true,

            hl = "MarkviewLatexSuperscript"
        }
    },

    tables = {
        enable = true,

        --- Parts for the table border.
        ---@type { [string]: string[] }
        text = {
            top       = { "โ•ญ", "โ”€", "โ•ฎ", "โ”ฌ" },
            header    = { "โ”‚", "โ”‚", "โ”‚" },
            separator = { "โ”œ", "โ”€", "โ”ค", "โ”ผ" },
            row       = { "โ”‚", "โ”‚", "โ”‚" },
            bottom    = { "โ•ฐ", "โ”€", "โ•ฏ", "โ”ด" },

            --- Used when table borders are overlapping.
            overlap   = { "โ”œ", "โ”€", "โ”ค", "โ”ผ" },

            align_left = "โ•ผ",
            align_right = "โ•พ",
            align_center = { "โ•ด", "โ•ถ",}
        },

        --- Highlight groups for the "parts".
        ---@type { [string]: string[] }
        hls = {
            top       = { "TableHeader", "TableHeader", "TableHeader", "TableHeader" },
            header    = { "TableHeader", "TableHeader", "TableHeader" },
            separator = { "TableHeader", "TableHeader", "TableHeader", "TableHeader" },
            row       = { "TableBorder", "TableBorder", "TableBorder" },
            bottom    = { "TableBorder", "TableBorder", "TableBorder", "TableBorder" },

            overlap   = { "TableBorder", "TableBorder", "TableBorder", "TableBorder" },

            align_left = "TableAlignLeft",
            align_right = "TableAlignRight",
            align_center = { "TableAlignCenter", "TableAlignCenter",}
        },

        --- Minimum width of a table cell
        ---@type integer?
        col_min_width = 5,

        --- When true, top & bottom borders aren't drawn
        ---@type boolean
        block_decorator = true,

        --- When true, top & bottom borders are made with
        --- virtual lines instead of virtual text.
        ---@type boolean
        use_virt_lines = true
    },

    list_items = {
        enable = true,

        --- Amount of spaces that defines an indent
        --- level of the list item.
        ---@type integer
        indent_size = 2,

        --- Amount of spaces to add per indent level
        --- of the list item.
        ---@type integer
        shift_width = 4,

        marker_minus = {
            add_padding = true,

            text = "๎ฉฑ",
            hl = "MarkviewListItemMinus"
        },
        marker_plus = {
            add_padding = true,

            text = "๎ชซ",
            hl = "MarkviewListItemPlus"
        },
        marker_star = {
            add_padding = true,

            text = "๎ชฉ",
            hl = "MarkviewListItemStar"
        },

        --- These items do NOT have a text or
        --- a hl property!

        --- n. Items
        marker_dot = {
            add_padding = true
        },

        --- n) Items
        marker_parenthesis = {
            add_padding = true
        }
    },

});

vim.cmd("Markview enableAll");

Steps to reproduce the issue:

  1. I only have markview installed to begin with
  2. I had just updated like 5 minutes ago
  3. 0.10.1
  4. I have markdown, markdown_inline, html, and latex

Expected behavior:

No response

Neovim version:

NVIM v0.10.1

note that the latex document above is an example curtsy of chatGPT, I didn't want to share any that I wrote

markview.nvim doesn't work(by default) on latex files.

Use this in your config.

filetypes = { "markdown", "latex" },

To use it in latex files.

ohhh, thank you so much

I think this should be in the wiki tbh