# Tag Info

21

The Vim-LaTex / LaTeX-Suite for Vim adds these markers automatically and by intension. You can jump to the next such marker using CTRL+J, which removes this marker. The idea is to speed things up by allowing you to jump to the end of the group or environment which was just added. This is also useful for templates where you can add <+name+> markers ...

20

I would highly recommend the vim latex-suite, which you can get either from http://vim-latex.sourceforge.net/index.php?subject=manual&title=Manu or (on an Ubuntu machine) using sudo apt-get install vim-latexsuite sudo vim-addons -w install latex-suite It provides many shortcuts. If I were going to type your first summation ...

18

I have the following function in my $VIM/ftplugin/context.vim file to format ConTeXt paragraphs (same as LaTeX: the environments are enclosed in \start... and \stop... instead of \begin{...} and \end{...}. It should be easy to adapt this to LaTeX (In fact, I think that I copied it originally from someone who had written it for LaTeX and adapted it to ... 18 It would help to know which, if any, LaTeX plugin you're using for vim. (E.g., the latex-suite, vim-auctex, latex-box, etc.) Next, as far as viewer choice, the only widely used open source PDF viewer for linux which currently supports SyncTeX well out of the box is Okular. That's probably your best choice. There are instructions fo setting up SyncTeX with ... 12 If you write "... this was written by \ref{foo}" then following output is possible: ... this was written by [1] which looks ugly in fact of the linebreak, the reason why vim is very nice to you and told you that you should write: "... this was written by~\ref{foo}". Then your output is at least: ... this was written by [1] So it is not a LaTeX ... 10 Quick and dirty solution :syn match texStatement "\\[a-zA-Z_:]\+" or add @ :syn match texStatement "\\[a-zA-Z_:@]\+" It isn't enough, but looks much better. But better Modify$VIM/syntax/tex.vim, search b:tex_stylish, and modify all expressions about it.

9


9

I don't know about Vim and its TeX/LaTeX syntax parser. It probably uses some rule that interprets a number followed by one of the keywords in pt cm mm em ex (and maybe also the other units of measure accepted by TeX) as denoting lengths; this is usually good, but it fails in situations such as There are 42 books on the shelf and still 32 in the box My ...

9

It has been saved as utf-16 and so every other byte is 0 (often displayed as ^@ as @ has code 64 so zero is control-@) The only thing I know about vim is that it isn't emacs but in chat my backup vim expert suggests :set fileencoding=utf-8 :set encoding=utf-8

9

If you run gnuplot <basename>-gnuplottex-fig1.gnuplot, you'll see gnuplot's error message plot for [i=1:14] 'benchmarks/test.csv' u (\$0+1):i title ''.i.'00 kb' with linespoints ^ "texse-gnuplottex-fig1.gnuplot", line 16: invalid character \ gnuplot is stumbling over the \$. You don't need to escape the ...

8

I suppose you already have Vim installed in your operating system. Usually, the installation is very straightforward for every operating system. For Macs, we have MacVim, and AFAIK two options are available: Getting the correct MacVim version for your operating system in the project website, unzip the archive file and drag MacVim.app to your Applications ...

8

Add let g:Tex_SmartKeyQuote=0 to $VIM/ftplugin/tex.vim (create that file if necessary), where$VIM corresponds to ~/.vim for unixy operating systems and ~/vimfiles for Windows. There are more configuration variables, see the latexsuite manual.

8

\Copy probably isn't used as a document level command but then that is because it's not a good name for a document level command (according to the somewhat under-enforced LaTeX command naming guidelines). See Macro naming best practice? Other possibilities would be: emacs naming (clearly good:-) \kill and \yank (but some people may find that a bit ...

7

Your question is a little confusing. What you mean is compiling a LaTeX document manually (into a PDF). You might want to adjust your title. Creating one would be the process of writing the document. This can be done in the command line using pdflatex <filename>. In VIM you could just use ESC:!pdflatex % (% can be used instead of the current filename) ...

7

This is a solution for evince, thanks to José Aliste who wrote gedit-synctex-plugin: Preamble Download these files deflate them to ~/bin (or something within $PATH) Backward Search (Evince → Editor) Adopt the first line of »~/bin/evince« (EDITORCMD) to your needs. (run »evince_backward_search« to get help for possible entries) Compile your .tex File ... 6 The following works on my end: Create a file called latexmk.vimrc in the current directory with the following content set nocompatible filetype plugin on set grepprg=grep\ -nH\$* filetype indent on let g:tex_flavor='latex' let g:Tex_DefaultTargetFormat = 'pdf' let g:Tex_CompileRule_pdf = 'latexmk -pdf -f $*' set iskeyword+=: Call vim -u latexmk.vimrc ... 6 Vim has built in spell checking. You do not need external spell checkers. Simply use :set spell to enable spell checking. To disable spell checking in code listings, you need to modify the vim syntax file for tex. Copy$VIMRUNTIME/syntax/tex.vim to \$HOME/.vim/syntax/tex.vim. Around line 402, this file has: syn region texZone start="\\begin{verbatim}" ...

6

A quite long comment... I don't think your question is specific to Vim or any other editor. Whether you are given a code completion, auto-environment closing tool or not it is quite important to reduce the mental load while writing your code. A short-term loss can be a long-term benefit if you can spend extra seconds to write-up with a better indentation. I ...

6

If you are using Adobe Reader or certain other PDF readers it locks the file. I don't know what OS you are on, but based on discussion in the chatroom Reader only locks the file on Windows. If you are indeed on Windows switch to Sumatra PDF, which does not lock the file. I don't know what linux or Mac PDF readers lock the file, but you should try switching ...

6

The following hopefully answers your "abbreviated questions": vim suggests inserting \@ before . in ...GRIP/ABP. So, do it! The reason here is that GRIP/ABP or any capitalized word before a period is usually an abbreviation. And, in some instances, abbreviations have periods, while some don't. To treat the end-of-abbreviation period as an end-of-sentence ...

6

SumatraPDF can be called with commandline options, see help manual. The option -reuse-instance will do the trick The final modification that made it works is this: let g:Tex_ViewRule_pdf = 'SumatraPDF -reuse-instance'

6

Recent versions of Vim have a new 'conceal text' function. The syntax highlighting file contains code to work with this feature. The conceal text function collapses a string of text into a single Unicode character. For example, it might visually substite \beta with β. Vim provides substitutions for the following subscripts by default, replacing the ...

5

There are no real standards, but here are some tips I’ve found handy: Don’t indent parts of a paragraph, but do break lines between sentences and after significant phrases within a sentence. As I posted at http://tex.stackexchange.com/a/64538/2966, this makes it easier for small edits to have small diffs. (You are using a VCS, aren’t you?) To exaggerate my ...

5

I would not change them. They are much more readable than the “traditional” TeX syntax. If you use unicode input they should work in your document. If you really want to: %s/“/"/g This line changes “ to " in the entire document. Use a similar mapping for ”: %s/”/<whatever>/g

5

If I understand your question correctly, you're having problems to get Alt-i working in the console version of vim, right? At least, with gvim it works as expected on my system. Some terminals send different character codes when using Alt key combinations so that vim is unable to recognize them properly. To fix this, it might help to enable the meta key ...

5

Kile has vim mode, as it uses kate as the editing component. It can be set under Settings/Editing/Editor/Vi input mode. It does not support all vim features, but I found it good enough for what I needed (i.e. usual way to type/search/copy/move/...)

5

The following solution only applies to paragraph formatting, it will properly work depending on the LaTeX styling settings. Another possible solution would be to set a hard wrap of 80 characters. http://vimcasts.org/episodes/hard-wrapping-text/ formatoptions: t - Auto-wrap text using textwidth c - Auto-wrap comments using textwidth, ...

5

hmmmm. Are you sure you want to do this? You need .aux files for subsequent compiles and sometime you need to compile three times until everything is worked out properly (like with note connections, I think). It might be better to set up your editor so that it cleans up when you close the file, or close the editor, or something like that.....cleaning up ...

4

This is a vim latex-suite macro, the official way to disable these is described here http://vim-latex.sourceforge.net/documentation/latex-suite.html#latex-macros However I had trouble getting those instructions to work in the past. Eventually I created a file ~/.vim/after/ftplugin/tex/afterls.vim and added the line call IMAP('EMP', 'EMP', 'tex') which ...

4

Try compiling with pdflatex -file-line-error <filename> That way, the .log file will generate C-style errors which begin with filename.tex:12:Error message, for an error on line 12; I think vim may even have built-in mechanisms for parsing these, or if not, making a regex for finding them in the log should not be hard. As others have mentioned ...

Only top voted, non community-wiki answers of a minimum length are eligible