Questions tagged [filetype-tex]

Questions about editing Tex documents, either with or without a frontend such a LaTeX.

Filter by
Sorted by
Tagged with
2
votes
1answer
66 views

TeX/LaTeX vim fold markers options

In complex files, especially when writing packages with basic TeX-LaTeX code, the standard definition of foldmarker, namely {{{,}}}, is unfortunate — in effect is quite common to have pieces of code ...
1
vote
1answer
23 views

How to autocomplete citations in markdown files

I take notes in markdown files which I sometimes convert to other documents with pandoc. With the --bibliography=bibliography.bib argument, pandoc recognizes the @key citation format in markdown and ...
0
votes
1answer
36 views

How to set a command as a file type specific autocommand

I would like the :Toc command to call :Voom in R markdown files and :VimtexTocOpen in latex files. First try: au BufRead,BufNewFile *.Rmd command! Toc Voom au BufRead,BufNewFile *.tex command! Toc ...
1
vote
0answers
21 views

Conceal with the highlighting of matching begin/end latex environment

I want to use vim conceal feature with the highlighting of matching begin/end latex environment (vimtex plugin). When I use the following code syn match texStatement '\\begin{itemize}' contained ...
1
vote
1answer
84 views

How to change make command

In my ~/.config/nvim/ftplugin/tex.vim I have the following: set makeprg=pdflatex\ -halt-on-error\ -file-line-error\ -synctex=1\ % set errorformat=%f:%l:\ %m however when I run make the command that ...
2
votes
1answer
23 views

How to edit a macro for F5 in Latex Suite

I have an environment for Theorem (aliased to "thm") When in VIM editor I write "thm" followed by "F5" I get: \begin{thm} \end{thm}<++> Can I edit the macro so that I get instead: \begin{...
0
votes
0answers
16 views

Wrap specific lines in buffer

is it possible to set nowrap to a line range in the active buffer and set wrap to everything else? I edit LaTeX files. I want to see everything after \begin{document}. but only see the general ...
3
votes
1answer
48 views

Disabling `kana/vim-textobj-entire` by filetype autocommand

kana/vim-textobj-entire creates text-obejcts ae and ie which stand for the entire buffer. But in lervag/vimtex ae and ie stand for an environment in a .tex file. vimtex's ae and ie mappings are much ...
1
vote
1answer
71 views

Silence command but not its output

I use the following function to compile a LaTeX document function! TeXCompile() let filepath = expand('%:p') execute "!cd $(dirname ".shellescape(filepath,1).") && pdflatex -synctex=1 "....
0
votes
1answer
28 views

How to prevent duplicated sections in taglist with vim-latex

The plugin yegappan/taglist and the plugin vim-latex are very nice to navigate within the table of content of a latex document. There is an issue however on my system section titles are duplicated. ...
0
votes
1answer
27 views

Indentation is slow in vimtex

If you try to indent a moderate size .tex file (~ 3,000 words/500 lines) using the normal mode command gg=G, vimtex seems to take some time. However LaTeX-Box seems to indent faster. I didn't ...
2
votes
0answers
31 views

Concealing \begin and \end lines in latex with MathZone

I'm trying to get the lines that have \begin{equation} and \end{equation} to be concealed. I've tried using call matchadd('Conceal','\\begin{equation\*}', 10,13,{'conceal':' '}) and it works, but it ...
1
vote
1answer
19 views

Opening and compiling tex files in subdirectory

I am using Linux mint cinnamon. Let's say I have .tex file in the sub-directory ~/MyTexfiles/Integration. When I double click on the .tex file to open it, it opens in vim since vim is my default ...
1
vote
1answer
26 views

Command to open pdf file when editing a latex document

I have this command to open the pdf created by a latex document: autocmd FileType tex nnoremap <leader>p :silent !open $(echo "%:p" \| sed s/.tex/.pdf/g)<CR> which works, but I'd like to ...
1
vote
1answer
48 views

Empty space between two &

I want to empty inner columns in a latex table, ie all the words between 2 &. How I can do it ? I have tried quite a few formulas like s/&*&/\& \&/gc but I just can't find ...
1
vote
1answer
57 views

How to use TexMathZones in Markdown Syntax, for Snippets?

I am a recent and very happy Vim User. I write Mathematics and Computer Science Lecture Notes in Markdown Files, organized in a Vimwiki. I use the UltiSnips Snippet Plugin. This plugin provides me ...
4
votes
5answers
222 views

Delete text between two $ symbols in gvim

I understand that we can use da{ to delete a whole {} block in vim. I am wondering if there is a corresponding version with { replaced by $ (similarly for di{) as this would be very useful for people ...
2
votes
2answers
76 views

Latex Subscripts Rendering Weirdly [duplicate]

I'm trying to type the following latex in nvim: f_{high}=\{1209,1336,1477,1633\}Hz. For some reason, nvim is rendering this as: fₕᵢgₕ= \{ 1209, 1336, 1477, 1633\}\si{Hz} How do I fix this?
1
vote
0answers
20 views

Autoindentation in .tex files

I use Vim to write Latex code and I would like to have autoindent when adding environments. I am aware of the smartindent capabilities that can be toggle on and off by inspecting the $VIMRUNTIME/...
2
votes
2answers
94 views

How to quickly jump between inline equations in vimtex?

Suppose I have a line of LaTeX code as follows We have two equations $E=mc^2$ and $F=ma$. How do I quickly jump between inline math equations? Let's say I'm editing the first equation $E=mc^2$, how ...
2
votes
2answers
46 views

How to (more reliably) recognize the end of sentences in LaTeX?

Movement and actions using ) and ( are very powerful: I use them all the time. However, when writing and editing LaTeX, I have run into the following problem: vim cannot recognize the end of some ...
1
vote
1answer
84 views

Difference between tex and plaintex Vim file type

I made up keybindings to compile tex file in Vim but sometimes it doesn't work because the file is identified as a plaintex file. I'd like to understand the difference. I have also noticed that this ...
2
votes
1answer
38 views

gw text wrapping for LaTeX

Is there an easy way to wrap LaTeX source? Using gwip is great for individual paragraphs, Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore ...
3
votes
2answers
57 views

Automatic completion in Latex environments

I am trying to implement a way to get automatic completion when typing Latex environments. Consider the following situation: \begin{|} \end{} where | stands for the position of the cursor. Then I ...
2
votes
0answers
42 views

Vim - QuickTex is incompatible with Auto-Pairs or Auto-Close

I'm looking to set up Vim for Latex editing and I came across this very simple and useful plugin, QuickTex. However, I doesn't seem to be compatible with vim-autoclose nor with auto-pairs (which are ...
1
vote
1answer
157 views

How to disable ligatures “inside the editor” while using vim for latex documents? [duplicate]

I'm using vim for writing LaTeX documents. I also have vim-latex installed. While I'm writing my documents in the editor, I get ligatures for that piece of text which is meaningful for the LaTeX ...
1
vote
0answers
15 views

TeX file, search outside math

Well, the question is clear. I want to search only on text that is not inside \[ \] or $ $ . Is there some readymade code to do so? Thanks.
2
votes
1answer
76 views

Stop Snippet from Triggering Inside Other Snippet

I am using ultisnips with Gilles Castel's subscript snippet along with a snippet I found on SE to create matrices in latex rather quickly. Unfortunately, I can't use the matrices snippet because it ...
1
vote
1answer
27 views

Latex-Suite in Vim exits out of tex document if there's a warning in the aux file on compilation

I recently installed Latex-Suite using Vundle, and I use Latex to take notes. My notes are separate files for each lecture, but I have a master.tex file set up to compile each document together, and I ...
1
vote
2answers
35 views

Unable to conditionally test for presence of a plugin command & invoke it

I have the following code in my vimrc if exists(":Goyo") augroup LatexGoyo autocmd! autocmd BufReadPost,BufNewFile *.tex Goyo augroup END else augroup LatexColumnSet ...
2
votes
1answer
380 views

Why does vim still auto-indent LaTeX after I set noai noci nosi?

I want to disable autoindent and smartindent for LaTeX so I did :set noai noci nosi When I open a brand new mwe.tex, filetype=plaintex and there is no auto indent magic. When I then enter some code,...
3
votes
0answers
216 views

Vimtex conceal doesn't recognize new command math environment

I recently added the vimtex plugin which includes a conceal feature which I really like; however, I found it doesn't work in custom math environments such as \newcommand{\beq}{\begin{equation}} \...
1
vote
2answers
121 views

How to set LaTeX syntax to “ConTeXt” in vimrc

TL;DR: How do I permanently and persistently :set syntax=context for *.tex files? I've been using vim for a LaTeX project, with monokai-tasty as the colour scheme. The default syntax highlighting ...
3
votes
1answer
26 views

How can I make $ in LaTeX insert \( and \) automatically? [duplicate]

I'm writing a lot of LaTeX recently, and am used to hitting the $ key for inline math, but have heard that \( and \) is better (apparently it confuses vim less, especially with $$, which I'm also not ...
1
vote
1answer
48 views

Yank both sides of equation

While writing in latex I often want to copy a math equation's right hand side or left hand side. For example I have something like this \begin{gather*} 5 \cdot \left( A A 3 \right) + 50 \cdot \...
1
vote
1answer
65 views

Execute command only for specified filetype

I'm setting up an environment to automatically recompile .tex files on save. I've found solution for this: autocmd BufWritePost *.tex :! latexmk -pdf But is there any better way to do this? It seems ...
1
vote
1answer
32 views

When does the file depending plugin kicks in?

I'm learning to use Vim with vim-latex and I'm wondering when does the plugin actually activates once I open a file. My intuition tells me that any file with the .tex extension should do it, but if I ...
2
votes
2answers
33 views

vimrc and finding errors in latex document

To find errors in a latex document, I open vim on the .log file. Then I type manually /^l\.\|[Ee]rr\|[Ww]ar followed by RETURN This extended regular expression works well. It matches a line starting ...
0
votes
1answer
367 views

How to show all LaTeX code but still have set conceallevel=3 for vim-devicons and NERDTree?

How can I adjust my .vimrc so that set conceallevel=0 is specific to just LaTeX documents? The plugin vim-devicons requires the following conceal level with NERDTree: set conceallevel=3 However, ...
0
votes
1answer
79 views

Run pdflatex in vim without a pop-up window

I currently have this autocommand in my vimrc: autocmd BufWritePost *.tex silent! execute "!pdflatex %" | redraw! It compiles my current LaTeX file whenever I save with :w. However, a terminal ...
0
votes
0answers
365 views

UltiSnips: snippets not expanding

This is a noob question. I just installed UltiSnip to make use of the TeX snippets. Here is the relevant part of my init.vim: " Specify a directory for plugins (powered by vim-plug) call plug#begin('~...
1
vote
2answers
742 views

VIM conceal doesn't work

VIM doesn't conceal text, for example tex. Here's my vimrc: "commands for vim-plug "PlugInstall - installs plugs "PlugUpdate - updates plugs "PlugClean - remove unused directories "PlugUpgrade -...
1
vote
1answer
91 views

Multiline errorformat

I would like to parse the latex log to extract warnings from the refcheck package. These warnings look like this Package refcheck Warning: Unused label `eq:my_equation_label' on input line 2 28. The ...
1
vote
1answer
215 views

Latex-suite <alt-I> mapping

Last week I reinstalled Ubuntu 18.04 LTS on my laptop. During my last installation of ubuntu (also 18.04) I learned vim and used it in combination with the latex-suite. However on this new ...
0
votes
1answer
138 views

Stop vim-latex from autocompiling on save

I'm not sure if it has always happened or its just recent, but vim auto-compiles on each save (:w). I would like to only manually compile (I use a hot-keyed pdflatex command instead). I've had a ...
1
vote
0answers
71 views

Ignore acronyms as spelling errors in TeX files

My LaTeX files contain lots of acronyms and they are often highlighted as spelling errors. I tried to ignore acronyms by adding syn match AcronymNoSpell '\<\(\u\|\d\)\{3,}s\?\>' contains=@...
1
vote
0answers
63 views

How to stop vim from automatically displaying latex formatting? [duplicate]

I have a latex file I am editing in vim. Something annoying that I'm running into is that vim seems to auto display things that I am typesetting in math mode. Here is an example. Say I write the ...
1
vote
0answers
36 views

custom syntax hilighting lost on single LaTeX file

I use vimtex plugin for writing tex documents in vim8. I added custom hilight for sections in my .vimrc like so: autocmd FileType tex :syntax match texSectioning "\\section.*" The texSectioning is ...
0
votes
1answer
84 views

inoremap inserts unwanted tabs

I recently made myself custom insert mode keybindings to type faster in LaTeX. However, When I use them, Vim adds tabs that weren't part of the original keybinding. Example: Here is my inoremap: ...
3
votes
1answer
840 views

UltiSnips, Context and Tex

For best experience, I want to enable some snippets to be expanded only in Tex Math environments. A wonderful person, lacygoill helped me on GitHub to achieve just this with the following setup: Let ...