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

How to disable adding figure caption after \ref{} #3009

Open
JulioHC00 opened this issue Oct 4, 2024 · 4 comments
Open

How to disable adding figure caption after \ref{} #3009

JulioHC00 opened this issue Oct 4, 2024 · 4 comments
Labels

Comments

@JulioHC00
Copy link

Description

I'm sorry if this isn't something that VimTex does, but I can't think of any other plugin that may be doing this. Whenever I write \ref{fig:blahblah} I immediately get the caption added after it as a kind of ghost text. It's just there to be seen, but won't appear in the document. Just like below.

image

This is being quite buggy for me, and I'd like to disable it. I've tried disabling concealing, but it remains there, and I can't find anything in the docs to help me.

Steps to reproduce

% Minimal latex document
% Run 
\documentclass{article}

% Package for figures
\usepackage{graphicx}

\begin{document}

\begin{figure}
	\centering
	\includegraphics[width=\linewidth]{missing.png}
	\caption{Some figure here}
	\label{fig:figure}
\end{figure}

Here we refer to the figure \ref{fig:figure}. %Here you get the text "Figure 1: Some figure here" in a lighter colour.


\end{document}

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Ubuntu 22.04.5 LTS
  Vim version: NVIM v0.10.2
  Has clientserver: true
  Servername: /run/user/1000/nvim.26660.0

VimTeX project: minimal
  base: minimal.tex
  root: /home/julio/Downloads/latex_test
  tex: /home/julio/Downloads/latex_test/minimal.tex
  main parser: fallback current file
  document class: 
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: 7
      output: /tmp/nvim.julio/4PKYWa/0
      cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -view=none -e '$compiling_cmd = ($compiling_cmd ? $compiling_cmd . " ; " : "") . "echo vimtex_compiler_callback_compiling"' -e '$success_cmd = ($success_cmd ? $success_cmd . " ; " : "") . "echo vimtex_compiler_callback_success"' -e '$failure_cmd = ($failure_cmd ? $failure_cmd . " ; " : "") . "echo vimtex_compiler_callback_failure"' 'minimal.tex'
      pid: 26854
  viewer: General
    job: 
      pid: -
      cmd: okular --unique file:'/home/julio/Downloads/latex_test/minimal.pdf'#src:5'/home/julio/Downloads/latex_test/minimal.tex'
  qf method: LaTeX logfile
@JulioHC00 JulioHC00 added the bug label Oct 4, 2024
@lervag
Copy link
Owner

lervag commented Oct 5, 2024

I'm sorry if this isn't something that VimTex does, but I can't think of any other plugin that may be doing this. Whenever I write \ref{fig:blahblah} I immediately get the caption added after it as a kind of ghost text. It's just there to be seen, but won't appear in the document. Just like below.

I'm pretty sure, but not entirely, this is something caused by texlab. So I'm also quite sure you are using texlab as an LSP. But it's hard to know, because I don't know anything about your config...

Steps to reproduce

Your "steps to reproduce" do not contain a minimal init.lua file. An example of such a file is this:

-- NOTE: Use the correct path to VimTeX in the following two lines!
vim.opt.runtimepath:prepend "~/.local/plugged/vimtex"
vim.opt.runtimepath:append "~/.local/plugged/vimtex/after"
vim.cmd [[filetype plugin indent on]]

vim.g.vimtex_cache_root = "."
vim.g.vimtex_cache_persistent = false

@user202729
Copy link

Try running :scriptname, it will give a reasonable description of what plugins you have. Then you can disable them one by one.

To copy to clipboard use

:let @+=execute('scriptname')

@BRS5672023
Copy link

I'd guess this comes from nvim-lspconfig, you may disable the inlay hints like this LazyVim/LazyVim#3191 (reply in thread)

@thunderbird-1990
Copy link

I figured it out.

This is indeed TexLab related.

The related settings are texlab.inlayHints.labelDefinitions and texlab.inlayHints.labelReferences, see https://github.com/latex-lsp/texlab/wiki/Configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants