Questions tagged [filetype-tex]
Questions about editing Tex documents, either with or without a frontend such a LaTeX.
202
questions
1
vote
1
answer
26
views
Migrating from Latex-Suite to vimtex
So I've been using latex-suite for a few years, and I realised recently that vimtex has some nice features (especially the text objects). So I'm tempted to use that instead, but it would require me to ...
1
vote
2
answers
93
views
How can I ignore default filetype indenting?
Can I tell Neovim not to load a bundled indentation file? For example, when I edit a .tex file, "share/nvim/runtime/indent/tex.vim" loads automatically. I don't want those settings. Do I ...
1
vote
0
answers
20
views
How to add a syntax rule to LaTeX filetype?
How can I colorize elements of the regex rule "\w\+:\w\+:\d\{4\}" in a LaTeX file ?
If I open a new document with no filetype and add the two following command :
syn match Bib3Dots '\w\+:\w\+...
0
votes
0
answers
57
views
How to display LanguageTool suggestions with neovim
I want to see LanguageTool suggestions (not just errors) when using LanguageTool with my LaTeX documents. LanguageTool can output the Error, Context, and Suggestion. However, with my setup (ltex-ls ...
1
vote
1
answer
115
views
How to turn off auto indenting while editing a LaTeX file?
I edit a LaTeX file, and for some commands Vim does auto indenting.
I would like to switch it off.
Consulting:
https://www.serverwatch.com/guides/automatic-indenting-vim/
I tried:
:filetype indent off
...
-1
votes
1
answer
161
views
vimtex#syntax#in_mathzone with tree-sitter and texlab
Vimtex provides the very useful family of functions vimtex#syntax#in_mathzone(), vimtex#syntax#in_comment() and vimtex#env#is_inside('...'), which come in handy for context sensitive snippets, e.g. ...
0
votes
0
answers
20
views
vim (8.2) "freezes" when :VimTexCompileSS is used (I need to write CTRL+C to make it work again)
I am using vim with vimtex, to use the background compilation.
When I use the command :VimTexCompileSS, I am then unable to write anything on vim, unless I press CTRL+C to stop it. To click on the ...
1
vote
2
answers
102
views
Editing .bib files in (n)vim with tailored autocompletion
I use BibDesk on a Mac to edit .bib files (in biblatex, using biber to compile). This generally works, but for various reasons it would be nice to be able to edit them in nvim too. My current setup ...
0
votes
0
answers
32
views
UltiSnips Latex snippet does not work correctly when wrapped around due to textwidth setting
Given snippet:
snippet mm "Inline Math" wA
\\( $1 \\) $0
endsnippet
which inserts inline math mode in LaTeX: \( | \) where cursor position is |
and following .vimrc:
"-------------Load ...
0
votes
1
answer
38
views
What other than mappings and abbreviations can change the text I'm typing?
The question
When editing TeX files (to do so, I use vimtex) if I've discovered that if I write lll in insert mode, I get \ell.
How do I find why this is happening?
My research
I thought "ok, I'...
2
votes
1
answer
27
views
Why does iskeyword contain colon for TeX files? And where is it set?
From iskeyword's doc I read that its default on Linux is @,48-57,_,192-255.
However, when I open a *.tex file, echo &iskeyword gives @,48-57,_,192-255,:.
Where in the startup of Vim is that : ...
0
votes
1
answer
45
views
Change " to `` or '' depending on whether it's typed after a space or non-space
The usecase is LaTeX, which I write using VimTeX.
To make double quoted words one would write ``words''.
However, I'm much more used, from many other contexts (both prose and code), to type " for ...
-2
votes
1
answer
37
views
What is `<++>`?
In the example in this question, and in the latex-suite documentation, what is <++>?
1
vote
0
answers
19
views
Strange behavior: latex-suite, alt-key macros, adding <++>. How can I disable this?
I’m using vim with the latex-suite plugin, on Ubuntu 22.04.1 LTS. (I installed the plugin through the Ubuntu package manager, i.e., through sudo apt install vim-latexsuite, then followed the ...
1
vote
0
answers
37
views
lstlisting environment it not treated as verbatim, which results in several false positives
ALE does not treat text inside of listing environments like verbatim, which spawns many whitespace related errors (i.e. space before punctuation marks, etc.).
I've found somewhat of an answer on ...
0
votes
0
answers
93
views
Neovim recognizes LaTeX class files (.cls) as filetype=st
When I run nvim test.cls (a LaTeX class file looking something like this:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{landscapetest}[forcing landscape mode]
\LoadClass[landscape]{article}
\RequirePackage[...
1
vote
1
answer
82
views
Ultisnips dynamic tabstop generation with custom justified option
It seems possible to have ultisnips produce a dynamically sized array as specified here:
https://github.com/SirVer/ultisnips/blob/master/doc/examples/tabstop-generation/README.md
The array environment ...
1
vote
0
answers
191
views
vim-fugitive support for diff --color-words
I use vim and git primarily for editing prose documents in LaTeX or Markdown, not for coding. For this reason, my go-to git diff command is git wdiff, where the relevant part of .gitconfig reads
...
1
vote
1
answer
54
views
Concealing ~ in texvim + conceal
I tried
syn match texStatement '\\\[' contained conceal cchar=⟦
syn match texStatement '\\\]' contained conceal cchar=⟧
syn match texStatement '\\~' ...
2
votes
1
answer
769
views
Vimtex not opening SumatraPDF automatically
I am using Vim 64 bit and have installed Vimtex on Windows 11. I can compile a LaTeX file and changes are shown in the pdf file, but typing \lv does not open my pdf viewer, SumatraPDF.
Here is part ...
7
votes
1
answer
1k
views
Why does Vim highlight "in" in tex files and how can I stop it?
I write a lot of LaTeX. In plain text mode, sequences like 123 in are highlighted in red. That is a space, a digit string, a space, and then the specific word in. Such things as a1 in are not ...
3
votes
1
answer
146
views
Why is my # mapping behaving oddly in TeX files?
I recently made the following key-map in my .vimrc file:
inoremap # \
inoremap \ #
since I just want to switch those two key on my keyboard, everything works just fine until I notice this:
Only in ....
1
vote
1
answer
38
views
Odd behaviour when pressing Tab with this mapping
I am trying to map ctrl+shift+i to insert an italics command in LaTeX files, and here's my attempt:
autocmd BufNewFile,BufRead,BufWrite *.tex inoremap <buffer> <c-I> \textit{}^[i
I am ...
2
votes
1
answer
125
views
Autocomplete LateX citations in chapters directory
Currently writing my thesis using LateX, I'm trying to obtain autocomplete on my citations when writing the chapters. The directory structure is that each chapter has its own main.tex files (template ...
2
votes
1
answer
387
views
Is it possible to render just math equations in real time?
I have been using neovim to write LaTeX/Markdown for a while and it brings really great experience. Since I usually write equations, I'm wondering is there any plugin to render and just render math in ...
1
vote
1
answer
76
views
VIM and UltiSnips delay with pound "#" key
Consider the following snippet
context "math()"
snippet "([a-zA-Z])#" "Vectors" riA
\mathbf{`!p snip.rv=match.group(1)`}
endsnippet
The expected behaviour is that if I ...
1
vote
1
answer
48
views
Certain LaTeX not displayed in GVim
I use conceal and write some LaTeX files in the GVim 8.2 editor on windows. The conceal works fine most of the time but it is unable to display certain characters like ∈ and ⊆. It shows a box with a ...
1
vote
2
answers
85
views
Disabling automatic imap of "< |" to "\bra{" (using neovim + vimtex)
In LaTeX, I'm trying to write if \(|x - a| < \delta\) then ... but in math mode, the combination < | is automatically replaced by x \bra{.
I've been editing tex files with neovim for years, and ...
2
votes
1
answer
93
views
Manage syntax groups in Vim Latex (how to create new ones, or add to existing ones)?
I'm trying to optimize for my needs the syntax highlighting offered automatically by Vim for Latex. For example by changing colors to my liking or link colors to new commands/environemnts.
After a ...
0
votes
1
answer
275
views
Turn off concealed text not working properly
So basically, I'm testing out writing a Latex document in neovim. I want to make this as similar as an IDE as possible, but with some added Vim functionality. That includes having text that I'm ...
1
vote
1
answer
101
views
vim command for jumping to <++>
I recently moved from vim-latex-suit to vimtex.
In vim-latex-suit, there was this awesome feature that when I press Ctrl-j, it jumps to where <++> is and replace that to the cursor.
To clarify,
...
0
votes
0
answers
82
views
Ignore spell check for LaTeX commands with multiple arguments
I have read through a lot of the posts on spell checking LaTeX syntax - here, here, and here.
I am sure the problem is my lack of regex understanding, but I am having trouble configuring it so that ...
0
votes
1
answer
59
views
Shell script runs multiple times, I want it to run only once
I use vim pretty extensively for latex compiling. I've a function which automatically compiles the current tex file. I use pdflatex as a compiler, which creates a bunch of different files that it ...
3
votes
1
answer
164
views
LaTeX: turn off text wrap and auto indent in maths environments
I use vim with vim-latex for editing latex files. I always have hard wrapping enabled using set tw=80. I also have the default vim-latex auto indent settings enabled.
I wonder if there is a way to ...
0
votes
1
answer
145
views
vim/vim-latex: spell-check highlighting breaks after occurrences of \end{center}, \end{enumerate}, \end{itemize}
The highlighting of misspelled words in my LaTeX documents breaks, when I open a .tex file and jump to the bottom instead of scrolling through the whole document. Only .tex files seem to be affected, ...
1
vote
1
answer
428
views
Wrapping text in environment vimtex
I use vimtex although I am by no means an expert in Vim, so it may be that I'm missing something obvious. Anyway, I am looking for functionality similar to that of 'cse, csc, csd' (which change the ...
1
vote
0
answers
118
views
:PlugUpdate is required every time I open vim [closed]
I’m setting up my LaTeX environment for vim, but the snippets (Ultisnips + vim-snippets + Gilles Castel’s tex.snippets with some changes) only work after I run :PlugUpdate (using vim-plug). I have to ...
4
votes
1
answer
174
views
LaTeX dollar signs confuse syntax highlighting
I am editing LaTeX code such as:
\documentclass{article}
\usepackage{booktabs,tabularx}
\begin{document}
Blah blah Blah blah
\begin{table}\centering
\begin{tabular}{>{$}l<{$}p{4in}}
%...
1
vote
1
answer
796
views
Setting conceallevel in .vimrc does not work in .tex file
I've set conceallevel=0 in .vimrc, but the text is not shown normally after opening .tex file. I have to type it again while the file is open and it works.
From my .vimrc:
"vimtex config
set ...
0
votes
0
answers
27
views
snippets visual is not selected when there is overfull warning
Disclmair: this is a question about using vim to write LaTeX. I don't know if this behaviour is visible in other languages also.
I use Ultisnips with honza/vim-snippets to expand latex snippets. If ...
1
vote
1
answer
60
views
Running pdflatex using a key mapping
I have a latex file which includes multiple figures. These figures are kept in different directories whose path is given in the latex file using the graphicx package:
\usepackage{graphicx}
\...
0
votes
0
answers
46
views
Personalizing Vim-Latex reference \ref completion
Vim-Latex is a very big plugin, but the only reason why I use it is that it can complete references \ref{.. and citations \cite{..
I recently created my own latex equation environment, which usually ...
1
vote
0
answers
152
views
I would like to set the math direct display mode in vim as seen in Sublime Text 3
When I write mathematical formulas of any kind, the vim editor displays them and transforms them into a more readable format, see here: https://github.com/KeitaNakamura/tex-conceal.vim (the images ...
1
vote
1
answer
469
views
Is it possible to setup vim to use vimtex for Rmd files?
I need to write Rmd files, but I can't imagine life without vimtex. Is there a way that I can use vimtex with Rmd files? Ideally, I would also like to keep the syntax highlighting that I have for Rmd ...
2
votes
0
answers
116
views
Can Ultisnips regular expression match forward?
The question may be also phrased as, can Ultisnips regular expression match after the current cursor?
My goal is to have a postfix of curly bracket for LaTeX subscripts. Say I want to type a_{bcd}, ...
0
votes
1
answer
55
views
Plain Text for LaTeX, No Rich Text Features [duplicate]
Look at Line 37 and Line 45, Line 45 has been folded so that $...$ does not show. But I do not want this feature. Is there any way to stop it? (I have not installed vimtex)
Also I do not want the rich ...
1
vote
1
answer
79
views
Enhance Latex Syntax without Rewriting everything
I want to extend the latex syntax for the given file:
\documentclass[a4paper,11pt]{book}
\begin{document}
\begin{figure}[t]
\begin{tikzpicture}
\node[alter] at (0,0) (v1) {typ0};
...
1
vote
1
answer
133
views
Syntax Highlight Problem for Latex/Tikz
I have a tikzpicture inside a latex file. My problem is that when I open the file and jump with GG to the end of the file, the math environment inside the tikz-nodes is not highlighted (e.g. $v_0^1$)....
0
votes
0
answers
28
views
Automaticall close LaTeX begin environment with end [duplicate]
I want to automate some routine operations when working with LaTeX documents writing, e.g. I often write these lines:
\begin{<environment-name>}
some text and commands here
\end{<environment-...
4
votes
0
answers
591
views
How to control and filter warnings in vim-latex?
While vim-latex is great, I've been having a bit of trouble using some of its features.
Controlling the warning system (and hotfix window) has been particularly difficult for me. Today I'm trying to ...