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

Please don't force user to select a main file! #2930

Open
goulf-3m opened this issue Apr 20, 2024 · 4 comments
Open

Please don't force user to select a main file! #2930

goulf-3m opened this issue Apr 20, 2024 · 4 comments
Labels

Comments

@goulf-3m
Copy link

Description

When I vim x.tex to create a new tex file that is meant to be a main file itself, the prompt of selecting a main file makes no sense.
But it seems that I cannot cancel the prompt.
Please provide a cancel option and enter single-file mode.

BTW, is there a way to relax this mode that a tex file has a main file?
A tex file can have multiple main files, or no main file!
For example, a .bib file shared by multiple documents.

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

No

VimtexInfo

I have vimtex ac0a41b, but I cannot run :VimtexInfo...
Actually, in this scenario, there is no relevant latex file.
@goulf-3m goulf-3m added the bug label Apr 20, 2024
@lervag
Copy link
Owner

lervag commented Apr 20, 2024

When I vim x.tex to create a new tex file that is meant to be a main file itself, the prompt of selecting a main file makes no sense. But it seems that I cannot cancel the prompt. Please provide a cancel option and enter single-file mode.

The prompt is only there if there are several "possible" main files in the directory. But I agree, it should be possible to cancel the prompt. I'll look at it when I get the time.

BTW, is there a way to relax this mode that a tex file has a main file?

Create your new file in a new directory.

I have vimtex ac0a41b, but I cannot run :VimtexInfo...
Actually, in this scenario, there is no relevant latex file.

:VimtexInfo is available when VimTeX is loaded, i.e. for tex files. The point of showing it is because I want to see some system information from your side so that I don't have to ask for it when it is relevant.

@lervag
Copy link
Owner

lervag commented Apr 20, 2024

Please provide a minimal example for your problem. I'll make a quick fix for this when I have the example with the steps necessary to reproduce the problem.

@goulf-3m
Copy link
Author

goulf-3m commented May 2, 2024

VimtexInfo:

System info:
  OS: Arch Linux
  Vim version: NVIM v0.9.5
  Has clientserver: true
  Servername: /run/user/1000/nvim.86561.0

VimTeX project: art
  base: art.tex
  root: /tmp/eg
  tex: /tmp/eg/art.tex
  main parser: current file verified
  document class: article
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: General
  qf method: LaTeX logfile

A minimal example is shown below.
I might want to keep these files in one directory, as they are in a single project.
If I nvim lit.bib, the prompt will be annoying.

lit.bib

@misc{vaswani_attention_2023,
  title         = {Attention {Is} {All} {You} {Need}},
}

pres.tex

\documentclass{beamer}
\begin{document}
\begin{frame}
    Hello\cite{vaswani_attention_2023}
\end{frame}
\begin{frame}
    \bibliographystyle{plain}
   \bibliography{lit.bib}
\end{frame}
\end{document}

art.tex

\documentclass{article}
\begin{document}
Hello\cite{vaswani_attention_2023}
\bibliographystyle{plain}
\bibliography{lit.bib}
\end{document}

lervag added a commit that referenced this issue May 2, 2024
@lervag
Copy link
Owner

lervag commented May 2, 2024

Thanks for the example; I've implemented a suggestion for this now. Please test and let me know what you think.

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

2 participants