Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [filetype-tex]

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

1
vote
1answer
41 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
81 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
40 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
27 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
28 views

How to stop vim from automatically displaying latex formatting?

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
26 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
30 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: ...
2
votes
1answer
120 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 ...
0
votes
1answer
31 views

LaTeX indent for \iff error in vim

With the minimal vimrc (with vimtex plugin): set nocp filetype plugin indent on syntax on set st=2 set acd set wildmenu set wildmode=longest,list,full let $USRPLUGD=$HOME.'\vimfiles\myvim\plugged' ...
0
votes
1answer
22 views

fnameescape() : add other characters to be escaped (parenthesis, commas etc)

I looked around for a long time but did not find any solution for that. On my Unix system (Ubuntu), using LaTeX-suite, I need to escape some characters in file names for compilation, say parenthesis (,...
0
votes
1answer
34 views

Make conditional imap to text being enclosed in certain characters

How can I create mappings that work only if the cursor is enclosed by certain characters? As an example, I want to map ja to \alpha if the cursor is enclosed by $$ or by \[\] so as to make This jar ...
2
votes
1answer
69 views

How to force vimtex to display \textbf and \textit in insert/normal mode?

When I add \textbf{} or \textit{} before a word in vimtex the terminal shows the word but strangely hides the commands. I can only see them in the visual mode (see pictures below). Is there a way to ...
0
votes
1answer
27 views

Read the first line of the current file to process it in a command (Emulating %TeX root)

Currently I have the line :nnoremap <leader>c :w<CR>:!arara %<CR><CR> in my $MYVIMRC. If I press <leader>c, it will save the current file and run the command arara on ...
0
votes
1answer
25 views

How to map a call to a system function using the current filename?

I've been using vim for a little while and I'm doing some LaTeX with it, using Tectonic as the engine. What I was doing to generate the pdf (without leaving the editor) :call system("tectonic main....
1
vote
0answers
121 views

How to map <C-Space> to ESC

I am using nnoremap <C-Space> i inoremap <C-Space> <Esc> to map to Esc. It works for all file with any extension but it doesn't work for the files with ".tex" extension ( I am ...
2
votes
1answer
40 views

Unable to set iskeyword for colon ( : ) character

I am using vim to edit LaTeX files. Throughout the text, there are labels to equations, tables etc. for which an accepted convention among TeX writers is the following \label{eq:massenergy} , \...
0
votes
1answer
207 views

Syntax highlight Markdown formulas using LaTeX highlighting

I often write non-trivial mathematical formulas inside Markdown documents, and having them syntax-highlighted would really help. In Markdown, LaTeX math formulae are denoted: $x^2$ and $$x^2$$, and ...
0
votes
1answer
81 views

Trigger reindentation after snippet has expanded to word in 'indentkeys'

The ftplugin vimtex provides the file indent/tex.vim with following line setlocal indentkeys+=[,(,{,),},],\&,=item,=else,=fi 'indentkeys' 'indk' string (default "0{,0},:,0#,!^F,o,O,e") ...
6
votes
0answers
80 views

Matching interval brackets

I'm using vim to edit LaTeX code, and I'm often writing intervals like (a,b] but this messes with other vim features. For instance, Jumping with %: if I have something like \phi((a,b]), the final ) ...
1
vote
0answers
76 views

macvim does not recognize math latex symbols anymore

I am running Macvim 8.0.1633 (146) on macos 10.13.3 Weirdly, even with syntax on, the math highlighting is plain wrong: Here, I didn't search for end{equation} Does anyone know what is going on?
1
vote
0answers
25 views

Do not wrap certain environments [duplicate]

I am using neovim. When editing a .tex file I don't want to wrap the lines within certain environments like equation or align and some others. \begin{equation} % very long line I don't want to ...
0
votes
0answers
17 views

Alter formatting behavior of comments in texfiles

While editing .tex files, I like to maintain a textwidth of 80 characters. And so I frequently do things like gqq to format a line after editing. But sometimes I've commented out something at the end ...
1
vote
1answer
75 views

formatoptions for hybrid (short markup + long paragraphs) content

I am trying to write my PhD thesis in vim using LaTeX So the documents will have two distinct types of content - markups that are relatively short, and paragraph text that is rather long. \begin{...
1
vote
1answer
526 views

Syntax of :endif in if-statements

I have the following code in my vimrc to compile my latex documents with <F5>: map <F5> :write <Bar> :if expand("%") == "body.tex" <bar> :exe ':!arara -v "main.tex"' <cr>...
1
vote
0answers
149 views

vim - latex suite compile and view keys does not work

I'm trying to setup vim-LaTeX on a new pc and I'm having problems with compile and view. ( \ll and \lv commands). When I push \ll I get the following error; Error detected while processing function ...
1
vote
2answers
332 views

Syntax highlighting of underscores in LaTeX, even though they only appear in filenames

I'm using nvim and LaTeX together, and for the most part it's been great. However, nvim appears to be incorrectly highlighting underscores that appear in filenames I include as part of the subfiles ...
0
votes
1answer
221 views

Vimtex commands only working on main file

Hi I am trying out vimtex on a multi-file project, and so far I was liking it a lot. However, I just found out that vimtex commands (\lv, \lt, \li, etc) work correctly when used while editing the main ...
3
votes
2answers
92 views

Replace text and move cursor to end of replacement in insert mode

How can I perform a search-and-replace and leave the cursor at the end of the replacement? I want to replace $...$ with \(...\) as I type in insert mode. Notice that I can't use an abbreviation, ...
2
votes
0answers
48 views

New text object for LaTeX subscript or superscript

Suppose in a latex file, I have a line $X_{i_{j}}$ and $Y^{i_{k}}$ My goal is to define a text object in VIM for the subscript, i.e. _{i_{j}}, and superscript, i.e. ^{i_{k}}. I was reading this ...
1
vote
1answer
47 views

Insert text automatically surrounded by other text

For easy typesetting of song sheets using the leadsheets LaTeX package I want to make a shortcut for vim. Using the leadsheets package, chords are inserted into the lyrics like this: ^{Am7}Sunny So ...
1
vote
0answers
122 views

in-line math equation rendering/preview for macvim/vim for filetypes other than RMarkdown

I recently installed vim-rmarkdown package, and found that the package allows me to see the rendered math equation in macvim, and when move cursor over, the line will render back to latex equation ...
1
vote
1answer
355 views

spacevim remapping of plugin keybindings

I am totally new to using Vim, and I have been trying out SpaceVim so far. One issue is with keybindings. So I have the Vimtex and Vim-Latex plugins installed. I want to use the compilation option ...
1
vote
1answer
530 views

LaTeX: Ultisnips

I'm new to Vim and setting up LaTeX with vimtex. Now, I am looking for a Snippet-Manager and decided to give UltiSnips a try. It seems to be very handy. But it doesn't come with a lot snippets (honza/...
1
vote
1answer
22 views

Fields in templates without resorting to commented-out lists (aka are drop-down options possible?)

I do a lot of work in plain TeX and XeTeX, editing the documents in vim, and have a variety of templates which I use to make the process more efficient. As you might expect, these use quite a lot of ...
3
votes
3answers
156 views

How can I show a preview of my LaTeX buffer without stealing focus from Vim?

I'm using Vim to write LaTeX on my Mac. I could make a shortcut to execute pdflatex (it should be possible right?) and see the result on Preview. But it steals the focus when it updates to the new ...
2
votes
0answers
41 views

LaTeX tabu package breaks Vim spell and syntax highlighting

The first line of this section of LaTeX code breaks syntax highlighting and spell check whenever I scroll to the area of the document that contains it: \begin{tabu} {*3{X[l$]}} col1 & col2 ...
1
vote
1answer
574 views

Using Text Objects with vimtex

I am having trouble figuring out how to use the text objects with the vimtex plugin. The mappings with leaders and the commands in normal and insert mode are fine. But to get environments, sections, ...
4
votes
2answers
247 views

iskeyword for latex

Context Currently, when I set ft=tex, my set isk? reads iskeyword=@,48-57,_,192-255 that is, the default for vim. My "issue" Currently, in a LaTeX string such as $\abcde_\fgh$ the w jump would ...
1
vote
0answers
61 views

vim-latexsuite syntax highlight in macro parameter

I'm using vim with vim-latex to edit my LaTeX-files. I noticed that the \begin{env} and \end{env} are not colorized when they are in a macro parameter (the \vary command and question environment are ...
3
votes
1answer
207 views

Underscores don't show up in some colorschemes

Sometimes, when I'm using the torte colorscheme and editing latex files, my latex expressions inside of $ signs show up in yellow. When this happens, my underscores disappear, as the following figure ...
1
vote
2answers
65 views

Erratic spell checking

I was editing the resume in latex I had downloaded from here. Vim is most erratic when it comes to checking spelling. In the resume_cv.tex file, the spell checking works. When I open any of the ...
2
votes
1answer
69 views

Way to merge edits in a shared file during simultaneous editing

Currently, a colleague and I are working on a joint project written in LaTeX. I am using a plugin (VimTeX) which, in addition to calling a compiler tool (upon saving the file) offers some bindings for ...
0
votes
1answer
215 views

vim latex livereload/preview plugin

Can you please suggest any latex plugin with livereload/preview support ? All of the plugins google suggested me does not support preview/reload, or use 3rd party tools that use another 3rd party ...
5
votes
1answer
230 views

Insert a newline after punctuations

I'm writing a report in LaTeX that I keep in a Git repository. In order to make the most out of Git, I would like to keep each sentence on its own line. I.e. for each dot, exclamation mark and ...
6
votes
0answers
83 views

Count only words for which Spell is enabled?

I want to count the words in my buffers, but for TeX files, for instance, a lot of words (e.g., commands) shouldn't be counted. I'm aware that there are scripts that do this specifically for LaTeX, ...
3
votes
1answer
312 views

Syntax highlighting for custom LaTeX commands

I have a few custom LaTeX commands like this one, for instance: \newcommand{\oeuvre}[1]{\textit{#1}} I use this for titles of books and other works. Sometimes I want them to be italicized, sometimes ...
0
votes
1answer
52 views

Allow comment highlighting inside biblatex entries

The default syntax highlighting for bib files doesn't highlight comments inside entries, like this: @book{test, % title = {This isn't highlighted as a comment}, } That's because bibtex doesn't ...
1
vote
3answers
2k views

How to Get syntax highlight of LaTeX in Debian's Vim?

I get no syntax highlight now in Debian's Vim by the workflow which works in Ubuntu 16.04: installation of packages and activating syntax installation apt-get install vim texlive-full activation in ...
1
vote
1answer
82 views

Text expansion for LaTeX editing

For writing a text book I would like text expansion; on typing this: |25,50,65| it should expand this to: $25\ux,50\uy,65\uz$ I tried to use simple text replacement with :s%/TEXT/NEWTEXT/gc, but ...
3
votes
2answers
179 views

Use search matches as parameters in external command

I want to define a Vim command that will install all LaTeX packages used in a .tex file. To install packages I can do sudo tlmgr install package1 package2 package3 etc. in the command line. So now I ...