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
0answers
52 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 ...
2
votes
1answer
931 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, ...
6
votes
2answers
369 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
67 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
473 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
75 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
92 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
315 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
495 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 ...
7
votes
0answers
101 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, ...
4
votes
1answer
478 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
56 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 ...
2
votes
3answers
5k 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
110 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 ...
4
votes
2answers
203 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 ...
5
votes
1answer
236 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 ...
2
votes
1answer
119 views

Something like iabbrev that works in the middle of words?

In LaTeX the \ldots command is used to make an ellipsis, so I wanted something like iabbrev ... \ldots that would work in the middle of words, so whatever... would become whatever\ldots. Any ideas?
1
vote
1answer
46 views

Create ,SI command to pack numbers and unit into \SI{…}{…}

I have a lot of older LaTeX files about physics, which contain values like 9.81 m/s^2. Since I'm now using siunitx and it's very useful \SI command, I have to change this to \SI{9.81}{m/s^2}. There ...
3
votes
1answer
462 views

Check if current line ends in a comment

I added something like this to my tex.vim ftplugin (I tried to simplify it because there are other plugins involved, but hopefully it makes sense): set comments+=b:\\item inoremap <expr> <...
0
votes
1answer
62 views

How to discover available keybindings for Vim's vanilla TeX mode?

I'd like to use Vim (version 7.4) to edit TeX files using the built-in, vanilla TeX mode. How do I find out about any available keybindings that are special for this mode? Does not seem to be listed ...
2
votes
2answers
1k views

How do I get Vim to correctly highlight Math mode in LaTeX command options?

I adopted the bracket notation, e.g., x[i], for the discrete signal x where i is the time index. The problem occurs in a pgfplots figure but I figured, the syntax highlighting behavior is due to being ...
2
votes
3answers
251 views

Compiling whole LaTeX projects

I am looking for a way to easily compile whole latex projects, based in several files through the following set of folders: . |- MyProjectsMainFile.tex |- img/ | |- image1.png | |- image2.jpg | `- ...
5
votes
1answer
374 views

Make autoformating insert a line break instead of two spaces after full stop

I noticed that vi's auto format adds two spaces after a full stop. I wonder how this can be changed, i.e., insert just one space after a full stop, or even a line break. The application is in using a ...
12
votes
5answers
11k views

How do I get Vim to compile my .tex file when executing :w?

My writing routine is like this: I edit a .tex file using vim I go to the command line and I compile it using pdflatex. I find myself always saving the file with :w and immediately having to switch ...
3
votes
1answer
76 views

Switching back and forth between two text layout conventions of input to LaTeX

While using git and other versioning systems, it is very useful that text lines occupy no more than (say) 80 characters. It is also more comfortable to edit text with vi if lines are note excessively ...
3
votes
1answer
194 views

LaTeX-Box does not define :Latexmk

The LaTeX-Box plugin is supposed to define the command :Latexmk, but it doesn't! Am I missing something obvious? (The reason I'm trying to run latexmk from vim is that I want to use the quickfix ...
6
votes
1answer
110 views

Autoformatting LaTeX: how to add characters in front of a wrapped line

When writing LaTeX, I like a newline between every sentence as it helps me jump around more easily. Additionally, I put two spaces at the start of lines where sentences don't start. For example: This ...
2
votes
1answer
77 views

How do I hide a TeX macro and highlight the arguments?

I have to put a macro in front of Greek text to get correct hyphenation, such that I have, e.g.: possibly \textgreek{κινούμενον} and possibly not. Could I use conceal to conceal the macro and show ...
1
vote
0answers
365 views

Conceal not working with tex files and vim-plug

Normally, :syn match Entity "e" conceal and :set conceallevel=3 results in all es being concealed. But, if I use vim-plug, this does not work in a tex-file …
6
votes
1answer
318 views

How do I spellcheck TeX files using vim-lexical, skipping some command arguments but not others?

I use the vimtex plugin for TeX editing and vim-lexical for spell-checking. This works generally fine, but there are several commands vim-lexical tries to spellcheck. For example, in \includepdf{...
4
votes
1answer
1k views

Folding slow with vimtex

Automatic folding with the vimtex plugin is unbearably slow. Is there anything I can do to speed this up? I tried installing the fastfold plugin but that did nothing I could notice.
2
votes
0answers
30 views

Folding from occurrence to next; two or more comments

I wanted to fold my LaTeX document and found this: https://tex.stackexchange.com/questions/130586/vim-nice-folding-function (Which seems to indicate that folding has been removed from Latex-Box?) ...
1
vote
1answer
1k views

Map single key to compile and open LaTeX PDF [duplicate]

I use VIM for writing in LaTeX and I would like to have a single key to compile the text and open a PDF of it. I have the line map <F10> :!pdflatex % && start %.pdf in my vimrc. It ...
7
votes
1answer
349 views

How can I make quick environment or command changes in LaTeX

I have a large body of LaTeX text (a whole book) which has \textit{} and \textbf{} commands interchanged in some places. In other places they are completely missing. How do I create quick shortcuts in ...
2
votes
0answers
531 views

Trying to get a particular SuperTab behavior with snippets and omnicomplete

I'm trying to get SuperTab to work a particular way with .tex files. I am also using the vimtex plugin as well as snipMate. The behavior I want is the following. In most text, I want the main ...
5
votes
1answer
152 views

Text formatting CVS-friendly

I have seen this very interesting article: http://dustycloud.org/blog/vcs-friendly-patchable-document-line-wrapping/ --- basically it is a suggestion for hard-breaking lines of text (for example, in ...
4
votes
0answers
129 views

How to align a Latex table that uses \multicolumn?

I want to align a Latex table the way it appears in the final document. There are various Vim plugins for aligning tables (2, 3, 4), but none of them handle the spanning cell correctly. The code ...
2
votes
0answers
62 views

How can I set tex filetypes to use plaintex solarized coloring

I use solarized for my terminal color. When I first create a new tex file and begin writing, I get the plaintex colorscheme, which I like. But once I save and reopen, I get the tex colorscheme, which ...
6
votes
2answers
317 views

Fix syntax highlighting after unmatched parentheses

I have a parenthesis in my LaTeX document that is intentionally unmatched. This breaks syntax highlighting for all of the following text. Is there some way to reset syntax highlighting after this ...
6
votes
1answer
187 views

Mathematical expressions in TeX files are displayed in a human-readable way

When I type some mathematical expressions in Tex files using Vim, e.g. a_{2} = a_{1} + a_{0}, it is displayed in a human readable way like a2 = a1 + a0. (Actually the numbers are of a smaller font, ...
2
votes
1answer
417 views

Completion past special characters

When I used vim for programming I used cntrl+n/cntrl+p a lot for keyword completion. I switched from programming to reporting with vim and now I have some new needs, one of which is amazing LaTeX ...
4
votes
0answers
92 views

Latex plugin for Vim that supports files organized in multiple directories

I have a multiple file/folder project that looks like the following. ├── 0_Preamble │   ├── 01_TitlePage.tex │   ├── 02_TitleBack.tex │   ├── 03_Dedication.tex │   ├── 0_Preamble.tex ├── 1_Theory │  ...
4
votes
2answers
161 views

Apply formating with a script, or have ftplugin format particular text based on syntax

When I am writting a Latex document I generally like to keep an 80 column line width to keep things easy to read. However I don't like to use text wrapping because it can get in the way of typing ...
2
votes
2answers
66 views

Deleting a Latex command multiple times

Indexing a Latex document, I added a lot of \index[]{} commands in \footcite prenotes. It's stupid! Anyway, in my code I have a lot of : \footcite[blabla blabla\index[n]{something} blabla.][postnote]{...
2
votes
1answer
312 views

How to add '.' to autocomplete suggestions in vim-latexsuite?

In vim-latexsuite how do I make vim completing references and equations labels with . in them? For example, I call the equations by chapters: label{eq:intro.x} label{eq:physics.y} But then, when ...
8
votes
1answer
119 views

change meaning of “paragraph” for TeX input?

I'm writing LaTeX code which has a lot of sections like this \begin{definition} blah blah blah ... ... \end{definition} In normal text, I'm very fond of gq] to rewrap everything nicely. Inside a ...
3
votes
1answer
151 views

Disabling Automatic Latex Plugin (ATP) mappings

I’m trying to use the Automatic LATEX Plugin for Vim (ATP), and found it has quite neat features. However, I do not like input abbreviations, so I tried to disable them using let g:atp_no_env_maps=1 ...
7
votes
3answers
359 views

Make % jump between identical delimiters

I use Vim to edit LaTeX files frequently. I want to use % to jump between matching $ which can be used to delimit where mathematical expressions are written. I have tried using matchit and, ...
3
votes
2answers
240 views

Call PDF viewer on the compiled tex file

Suppose I am editing a file.tex. How would I open file.pdf in zathura (or any pdf viewer) from vim? I understand how to reference file.tex using '%' but I'm not sure how to reference file.pdf.
10
votes
2answers
280 views

Context sensitive insert mode mapping or abbreviation

I'm planning to implement some utility mappings for my LaTeX plugin to simplify typing of mathematics. For instance, I want to create abbreviations similar to `a : \alpha `b : \beta -> : \to => ...