Questions tagged [filetype-tex]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
40 views

Is it possible to setup vim to use vimtex for Rmd files?

I need to write Rmd files, but I can't imagine life without vimtex. Is there a way that I can use vimtex with Rmd files? Ideally, I would also like to keep the syntax highlighting that I have for Rmd ...
1
vote
0answers
44 views

Can Ultisnips regular expression match forward?

The question may be also phrased as, can Ultisnips regular expression match after the current cursor? My goal is to have a postfix of curly bracket for LaTeX subscripts. Say I want to type a_{bcd}, ...
0
votes
1answer
19 views

Plain Text for LaTeX, No Rich Text Features [duplicate]

Look at Line 37 and Line 45, Line 45 has been folded so that $...$ does not show. But I do not want this feature. Is there any way to stop it? (I have not installed vimtex) Also I do not want the rich ...
1
vote
1answer
30 views

Enhance Latex Syntax without Rewriting everything

I want to extend the latex syntax for the given file: \documentclass[a4paper,11pt]{book} \begin{document} \begin{figure}[t] \begin{tikzpicture} \node[alter] at (0,0) (v1) {typ0}; ...
1
vote
1answer
22 views

Syntax Highlight Problem for Latex/Tikz

I have a tikzpicture inside a latex file. My problem is that when I open the file and jump with GG to the end of the file, the math environment inside the tikz-nodes is not highlighted (e.g. $v_0^1$)....
0
votes
0answers
20 views

Automaticall close LaTeX begin environment with end [duplicate]

I want to automate some routine operations when working with LaTeX documents writing, e.g. I often write these lines: \begin{<environment-name>} some text and commands here \end{<environment-...
1
vote
0answers
33 views

How to control and filter warnings in vim-latex?

While vim-latex is great, I've been having a bit of trouble using some of its features. Controlling the warning system (and hotfix window) has been particularly difficult for me. Today I'm trying to ...
0
votes
1answer
24 views

Display the same color for all characters in a math section

In a tex file, almost all the characters inside delimiters like $...$ or \[...\] have the same color, but there are some characters, like = (and possibly others) which have a different color. I would ...
1
vote
1answer
30 views

How to switch the order in which objects appear

I have a custom command in a TeX file which takes two inputs A and B, let's call it \operation{A}{B}. I want to find all of the instances of \operation where the first entry A starts with the string ...
0
votes
0answers
52 views

Open pdf command in Nvim

I use Nvim to write my LateX documents. In my init.vim file I have defined a command to compile my .tex file like this: command CompileXelatex !xelatex -halt-on-error % I tried to do the same to view ...
1
vote
1answer
33 views

UltiSnips regex macthing

I want the possibility of transforming an inline equation in latex to a display equation. So I want $something$ to become $$ something $$ My attempt was this: snippet "$(.+)$" "...
0
votes
2answers
37 views

conceal function not working in tmux

Version: vim 8.1 Problem: Latex objects like \int, ^, \alpha, \beta, etc, all get replaced by _ in tmux when using conceallevel=1,2. Expected: correct concealment, as it happens in normal terminal, ...
1
vote
0answers
22 views

Unwanted characters appear in an UltiSnips macro setup

I am new to vim and I am using a mac with vimtex, UltiSnips plugins. I am using the vim latex snippets found here (the tex.snippets file). Whenever I type "()", "{}", the text ...
1
vote
1answer
20 views

Unable to select templates with vim-latex

I have Vim on Ubuntu 18.04 and I have sucessfully installed the vim-latex package. When I open a .tex file, vim regognizes it as latex and the plugin kicks in (I have already struggled with this a few ...
2
votes
0answers
35 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
2answers
47 views

Where do filetype-specific autocommands live?

I have a plugin for a specific filetype (*.tex), and I'm wondering where I can find all the commands which are executed when I type :e examplefile.tex? In general, is there a standardized practice for ...
3
votes
0answers
32 views

More intelligent automatic formatting

I use vim to edit latex files and the automatic formatting option (formatoptions+=a) works very well, since you can enter text anywhere in the paragraph and vim will reformat the entire paragraph. The ...
1
vote
1answer
97 views

Vim-latex not starting automatically for .tex files

I have Vim on Ubuntu 18.04 and I am trying to use the vim-latex package. By typing :set rtp? on Vim I get the following output: runtimepath=~/.vim,~/.vim/pack/bundle/start/vim-latex-1.10.0,/var/lib/...
3
votes
0answers
45 views

How does expression folding actually work?

The following is a stripped down version of my folding function for LaTeX documents: setlocal foldmethod=expr setlocal foldexpr=LaTeXFoldsExpr(v:lnum) " Sections to be folded let g:...
1
vote
2answers
52 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
0answers
28 views

TeX syntax file not recognising bold-italic blocks

Basically title. Text inside \textit and \textbf is correctly formatted in italics and bold, but if I nest one inside the other, the text takes the formatting of the outer command, as shown here the ...
0
votes
1answer
30 views

Toggle between displaymath and inline math modes in LaTeX

I'm trying to come up with a way of doing the following in vim. When editing LaTeX documents, I need on a fairly regular basis to toggle between display and inline math modes. Let me explain: suppose ...
1
vote
0answers
13 views

Doxygen LaTeX syntax

I am using doxygen to document my code and I like to have additional markdown files which include formulas by using \f$ Formula \f$. I know markdown syntax provided by the vim-markdown plugin supports ...
0
votes
0answers
15 views

Conceal works but not on some nested regions

I'm trying to conceal the LaTeX command \footnote{} in a .tex file and show a bullet point instead. This works mostly fine, but when there is a \cite{} command inside the footnote, everything but the ...
2
votes
1answer
211 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
116 views

How to autocomplete citations in markdown files

I take notes in markdown files which I sometimes convert to other documents with pandoc. With the --bibliography=bibliography.bib argument, pandoc recognizes the @key citation format in markdown and ...
0
votes
1answer
58 views

How to set a command as a file type specific autocommand

I would like the :Toc command to call :Voom in R markdown files and :VimtexTocOpen in latex files. First try: au BufRead,BufNewFile *.Rmd command! Toc Voom au BufRead,BufNewFile *.tex command! Toc ...
1
vote
0answers
37 views

Conceal with the highlighting of matching begin/end latex environment

I want to use vim conceal feature with the highlighting of matching begin/end latex environment (vimtex plugin). When I use the following code syn match texStatement '\\begin{itemize}' contained ...
1
vote
1answer
89 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 ...
2
votes
1answer
28 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{...
0
votes
0answers
16 views

Wrap specific lines in buffer

is it possible to set nowrap to a line range in the active buffer and set wrap to everything else? I edit LaTeX files. I want to see everything after \begin{document}. but only see the general ...
3
votes
1answer
72 views

Disabling `kana/vim-textobj-entire` by filetype autocommand

kana/vim-textobj-entire creates text-obejcts ae and ie which stand for the entire buffer. But in lervag/vimtex ae and ie stand for an environment in a .tex file. vimtex's ae and ie mappings are much ...
1
vote
1answer
74 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 "....
0
votes
1answer
33 views

How to prevent duplicated sections in taglist with vim-latex

The plugin yegappan/taglist and the plugin vim-latex are very nice to navigate within the table of content of a latex document. There is an issue however on my system section titles are duplicated. ...
0
votes
1answer
37 views

Indentation is slow in vimtex

If you try to indent a moderate size .tex file (~ 3,000 words/500 lines) using the normal mode command gg=G, vimtex seems to take some time. However LaTeX-Box seems to indent faster. I didn't ...
2
votes
0answers
38 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 ...
1
vote
1answer
25 views

Opening and compiling tex files in subdirectory

I am using Linux mint cinnamon. Let's say I have .tex file in the sub-directory ~/MyTexfiles/Integration. When I double click on the .tex file to open it, it opens in vim since vim is my default ...
1
vote
1answer
33 views

Command to open pdf file when editing a latex document

I have this command to open the pdf created by a latex document: autocmd FileType tex nnoremap <leader>p :silent !open $(echo "%:p" \| sed s/.tex/.pdf/g)<CR> which works, but I'd like to ...
1
vote
1answer
49 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
144 views

How to use TexMathZones in Markdown Syntax, for Snippets?

I am a recent and very happy Vim User. I write Mathematics and Computer Science Lecture Notes in Markdown Files, organized in a Vimwiki. I use the UltiSnips Snippet Plugin. This plugin provides me ...
4
votes
5answers
344 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 ...
2
votes
2answers
133 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?
1
vote
0answers
22 views

Autoindentation in .tex files

I use Vim to write Latex code and I would like to have autoindent when adding environments. I am aware of the smartindent capabilities that can be toggle on and off by inspecting the $VIMRUNTIME/...
2
votes
2answers
131 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
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 ...
1
vote
1answer
140 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 ...
2
votes
1answer
50 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 ...
3
votes
3answers
90 views

Automatic completion in Latex environments

I am trying to implement a way to get automatic completion when typing Latex environments. Consider the following situation: \begin{|} \end{} where | stands for the position of the cursor. Then I ...
2
votes
0answers
59 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 ...
1
vote
1answer
231 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 ...