Questions tagged [filetype-tex]

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

Filter by
Sorted by
Tagged with
6
votes
1answer
167 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, ...
45
votes
2answers
14k views

What are the differences between LaTeX plugins?

There are a number of Tex plugins for vim (vim-latex, AutomaticLatexPlugin to say a couple). What are the differences in the provided functionalities between these (the ones I named and possibly ...
1
vote
1answer
121 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{...
3
votes
2answers
172 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, ...
10
votes
5answers
9k 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 ...
29
votes
4answers
434 views

How can I treat LaTeX quotes as a text object?

Quotation marks in LaTeX are different than in normal text, in that they're formatted ``like this'' (or `like this' for single quotes). This makes it difficult to navigate through them in Vim. I ...
13
votes
2answers
2k views

How can I lookup LaTeX symbols in Vim?

Can I integrate some form of symbol completion to Vim? Dedicated TeX editors like TeXMaker provide a list of symbols for completion (for example, \al shows a list with \alpha, \la shows \lambda and \...
5
votes
1answer
150 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
5answers
231 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 ...
4
votes
2answers
554 views

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

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 ...
3
votes
1answer
866 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 ...
10
votes
2answers
265 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 => ...
6
votes
2answers
348 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 ...
6
votes
1answer
105 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 ...
5
votes
1answer
455 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 ...
5
votes
1answer
221 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 ...
4
votes
2answers
156 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 ...
3
votes
2answers
977 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 ...
2
votes
1answer
80 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} , \...
2
votes
2answers
102 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 ...
1
vote
1answer
86 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 ...
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 ...