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
2answers
108 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?
2
votes
1answer
407 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 ...
2
votes
2answers
147 views

PDF viewer syncing

The Mac latex editor 'TeXShop' has a great feature -- I can right-click anywhere in my tex and it shows me the corresponding character of the generated PDF. Similarly I can click on PDF and jump to ...
2
votes
1answer
145 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 ...
2
votes
1answer
364 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") ...
2
votes
2answers
114 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
1answer
484 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,...
2
votes
1answer
683 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 ...
2
votes
3answers
214 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
1answer
897 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, ...
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 ...
2
votes
1answer
76 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 ...
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
42 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 ...
2
votes
1answer
84 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 ...
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
1answer
299 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 ...
2
votes
1answer
27 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{...
2
votes
2answers
48 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 ...
2
votes
2answers
35 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 ...
2
votes
1answer
832 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 ...
2
votes
1answer
106 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 ...
2
votes
1answer
1k 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/...
2
votes
1answer
90 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 ...
2
votes
1answer
115 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?
2
votes
0answers
31 views

Minimum window width will not change when using specific filetype

With most filetypes, I can resize font and my GVIM application window just fine. However, when I open a specific file type (.tex), the font is easily changed, but I am unable to shrink the application ...
2
votes
0answers
36 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 ...
2
votes
0answers
50 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 ...
2
votes
0answers
84 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 ...
2
votes
0answers
299 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 ...
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
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?) ...
2
votes
0answers
522 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 ...
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 ...
1
vote
1answer
49 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
73 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 "....
1
vote
2answers
38 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 ...
1
vote
1answer
1k 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
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
1answer
122 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 ...
1
vote
1answer
179 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
2answers
131 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 ...
1
vote
1answer
71 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
109 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 ...
1
vote
2answers
47 views

Check if :make fails

I just setup this mapping for my latex development: nnoremap <buffer> <LocalLeader>o :make %:r.pdf <Bar> !open %:r.pdf<CR><CR><CR> But I wondered about checking if ...
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
33 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 ...
1
vote
2answers
853 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
122 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
774 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 ...