Stack Exchange Network

Stack Exchange network consists of 174 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.

2
votes
1answer
93 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
26 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
20 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
29 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
36 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
21 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....
0
votes
0answers
76 views

E20: mark not set error occurs sometimes

I am editing latex1 prose in vim. For paragraph reformatting, I am using the par text formatter. I have set up the following autocommand for latex-files, to map A-q for reformatting the whole ...
1
vote
0answers
77 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 ...
0
votes
0answers
18 views

Open all tex files with contents from a template tex file in vim [duplicate]

How can I achieve this? Do I use autocmd?
0
votes
0answers
24 views

tex.vim and syntax highlighting problem

I am having some trouble with the default syntax highlighting for .tex files. I am using the elflord color scheme, and whenever I use a \textit{} environment, the text between the braces is ...
2
votes
1answer
35 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
0answers
91 views

Display output of a shell command in vim-airline status upon every save

I have access to both vim8.xx and neovim. For the vim-airline plugin for filetype tex, I'd like to add the output from the following shell command each time the buffer is saved to disk. texcount -sum ...
0
votes
1answer
151 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
59 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
72 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
74 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
71 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
402 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
136 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
234 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
182 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
83 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
44 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
46 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
109 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
304 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
431 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
21 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
151 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
39 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
497 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
238 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
58 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
192 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
64 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
63 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
0answers
116 views

Fix vim-latexsuite autocompletion of \cite{} argument

I'm using vim on Ubuntu 16.04 with the following packages installed: vim vim-addon-manager vim-common vim-latexsuite vim-nox vim-runtime vim-tiny vim-youcompleteme When writing LaTeX documents I ...
0
votes
1answer
201 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
215 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
81 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
290 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
2answers
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
80 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 ...
0
votes
0answers
213 views

Vim - plugin working partially

I am new to rather new to vim. I use the same `vimrc' and the same plugins at my home and work computers. One has Ubuntu-debian and the other one has a Ubuntu-KDE setup. My question concerns the ...
3
votes
2answers
178 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 ...
4
votes
1answer
134 views

Turn off Vim spellcheck in custom region

I have the following definitions in a .tex file preamble: \newcommand{\beq}{\begin{eqnarray}} \newcommand{\eeq}{\end{eqnarray}} If I then use \beq and \eeq to define an equation array region, spell ...