Vim LaTeX-suite compile

I have the latex-suite in vim and I use it to compile.  However, by default it compiles to DVI.  I would like for it to compile to PDF by default instead.  As of right now, if I try setting it to PDF (for example, using :TTarget pdf), it does not carry over from session to session.  Is there a way to make it set on startup (mabye via the .vimrc)?
If not, how does one get the present directory of the file currently being editted?  For example, :!cd DIRECTORY ; pdflatex FILE.tex , works when typed in manually.  How about if one wanted to create a keybinding in .vimrc to yield this?
Thanks,
zeug.

zeug wrote:
I do not seem to have that directory.  I did find that file a bunch of locations, though.  Any idea which one should be editted?
(…LOCATIONS!…)
Thanks.
Uhh, I'm never able to recall which directory gets overwritten on each vim update, sorry There was a thread about this once, but I can't seem to find it just now…
The manual explains the options very well, I think, but it still doesn't say where this stuff should belong. However, unless you intend to write your documents as root, I'd say just create the ~/.vim/ftplugin folder and put tex.vim in it.
makimaki wrote:Thanks for that tip
Yer welcome.
Edit: Found the aforementioned thread.
Last edited by Runiq (2010-02-23 22:49:26)

Similar Messages

  • Vim latex-suite F9 \cite completion in input files

    Hi,
    is there any way to use vim latex-suite's \cite completion in other files than the main texfile? I'm using seperate files for each chapter, auto completion will only work in my main file.
    thanks

    Hmm, not surprisingly, it was an unrelated stupid error on my part: the path to the file I was working on had a space in it.  Remove space from folder name, hello \cite completion.  Solved.

  • Vim latex-suite: I'm on another file after compiling

    Hi,
    a little thing that bothers me when using latex in vim:
    After using \ll to compile the file using latexmk vim opens the master document so I have to open the old file manually to keep working.
    Any idea how to change this?

    Barghest wrote:
    I already use vim-latexsuite and all its nice features like \cite completion and so on. I installed it (via AUR?) in March
    $ powerpill -Qs latexsuite
    local/vim-latexsuite 20100129-2 (vim-plugins)
    I see, I didn't realize it was in AUR. I just installed the vimball directly into my .vim folder.  From glancing at latex-suite's compiler.vim, it looks like latex-suite expects all of its function definitions to be in the same place as your personal tex.vim config file (they're all relative to $VIMRUNTIME, it seems). If your tex.vim is in your .vim folder and the latex-suite files like compiler.vim are elsewhere (as they probably are, if they were installed by pacman), then maybe latex-suite is becoming confused and causing the error you mentioned? I'm obviously not much of a coder/vim internals person, and I don't know the precise layout of the files installed by the AUR version of latexsuite, so this is mostly speculation; maybe others who are more knowledgeable can weigh in. But you might try uninstalling your AUR latexsuite and downloading and installing the latexsuite vimball directly into your ~/.vim/ftplugin, and see if that solves the problem.

  • Vim latex-suite and auto completion

    Hi,
    according to this introduction you have to hit <enter> to chose a bib entry after pressing F9 in \cite{ :
    My problem is that I see the bib entries but when I hit enter the windows close and I'm back in my tex file with no entry in the \cite bracket. When I typed in the first letters of the bib key these are also erased.
    Any ideas?
    Here's my .vimrc
    " Use Vim settings, rather then Vi settings (much better!).
    " This must be first, because it changes other options as a side effect.
    set nocompatible
    filetype plugin on
    filetype indent on
    set grepprg=grep\ -nH\ $*
    let g:tex_flavor = "latex"
    " switch on syntax highlighting
    syntax on
    let g:Tex_DefaultTargetFormat = 'pdf'
    let g:Tex_CompileRule_pdf = 'latexmk -pdf -pv -g'
    set runtimepath=~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after
    " A clean-looking font for gvim
    set guifont="DejaVu\ Sans\ Mono\ 8"
    " allow backspacing over everything in insert mode
    set backspace=indent,eol,start
    set history=100 " keep 100 lines of command line history
    set ruler " show the cursor position all the time
    set showcmd " display incomplete commands
    " set mouse -=a
    set shortmess+=I " disable the welcome screen
    " line numbering
    set nu
    " wrap like other editors
    set wrap " word wrap
    set textwidth=0 "
    set lbr " line break
    set display=lastline " don't display @ with long paragraphs
    " searching
    set hlsearch " highlight all search results
    set incsearch " increment search
    set ignorecase " case-insensitive search
    set smartcase " upper-case sensitive search
    " nice colours
    set t_Co=256
    " colorscheme twigight
    " colorscheme desert256
    " colorscheme tlvb
    " colorscheme zenburn
    colorscheme ir_black
    " scroll one screen line regardless of editor line length
    :noremap <Up> gk
    :noremap! <Up> <C-O>gk
    :noremap <Down> gj
    :noremap! <Down> <C-O>gj
    :noremap k gk
    :noremap j gj
    set enc=utf-8
    " Scrollbars
    set sidescrolloff=2
    set numberwidth=4

    Hi davvil,
    thanks for your reply. There are no whitespaces. The only thing I've noticed is, that the indention of the entries is different (INCOLLECTION, BOOK, etc isn't idented, though).
    My bib was partly created by JabRef and by entries made by me. I'll check if the problem also occurs with a new bib made from scratch.

  • Vim latex-suite opens blank firefox tab [SOLVED]

    when i try to view a text doc using \lv xdvi shows it nicely, but a blank firefox tab is also opened up for some inexplicable reason.
    anyone know what that reason might be and how i can stop this behavior?
    Last edited by pradtf (2010-07-03 04:12:10)

    no i don't and i have nothing like it in .vim or /usr/shared/vim
    so i put it into .vimrc and the problem is gone!
    thank you very much jt512!
    i am puzzled though as to what would cause vim to go to firefox in the first place. i realize it is the default browser as defined in
    .vim/browser_launcher.vim
    but i don't see how that would be connected with tex.
    Last edited by pradtf (2010-07-03 04:17:02)

  • Latex-suite no longer working

    I don't know exactly when this happened, but latex-suite doesn't work anymore since one of the latests Vim upgrades. Is anybody else experiencing this problem?
    I checked in AUR and it seems to be a general issue. Does anybody knows how to fix it?

    cmlr wrote:
    Before latex-suite, there was auctex.vim, which has many of the same features.  It still works;  I'm the author, I'm happy to consider any suggestions.  Give it a try.
    http://www.vim.org/scripts/script.php?script_id=162
    Carl
    Thanks a lot, man! I'll give it a try as soon as I get home.

  • Latex-suite: disable smart key mappings (e.g. ... - \ldots)

    I've recently started using LaTeX. Since vim/Gvim is my absolutely favorite text editor, it's plugin latex-suite comes in handy with features such as text folding. Latex-suite also has some auto-completion/conversion features; unfortunately I don't like them. The most annoying are conversions such as ... -> \ldots. While this may be useful when using ... inside a text, it definitely isn't when trying to format the LaTeX document with ............. lines because they are automatically converted to \ldots\ldots\ldots!!!
    I've already found out that this feature is called "Smart Dots" (see http://vim-latex.sourceforge.net/docume … suite.html --> "3.9. Smart Key Mappings"). Here http://vim-latex.sourceforge.net/docume … -keys.html it is described how to disable some of the smart key mappings; unfortunately, not the Smart Dots.
    Any idea how to disable Smart Dots or even all auto-completion/conversion features in general? I generally don't like auto-completion/conversion!

    It turns out this isn't QUITE as simple as I thought.  Since some latex elements are closed (eg \begin{something} ... \end{same something}) while others are not (eg \chapter \section) the folding function needs to check for each.
    First here is my generic folder
    function ToggleFold(marker)
    if foldlevel('.') == 0
    normal 0
    call search(a:marker,'c')
    let x = line('.')
    normal %
    let y = line('.')
    execute x . "," . y . " fold"
    else
    if a:marker == '<'
    normal k
    let x = line('.')
    normal j
    normal zd
    execute x
    normal j
    else
    normal zd
    normal %
    endif
    endif
    endfunction
    "some example bindings
    nmap <space> ;call ToggleFold("{")<CR>
    " } This is just here to match/close the previous line
    au BufNewFile,BufRead *.svg set filetype=xml
    au FileType html,xml nmap <space> ;call ToggleFold("<")<CR>
    au FileType html,xml let b:match_words = '<\([^ >]*\)[^>]*>:</\1>'
    And the whitespace or python-like code folder
    function ToggleIndentFold()
    if foldlevel('.') == 0
    let x = line('.')
    let i = indent('.')
    normal j
    while indent('.') > i
    normal j
    endwhile
    normal k
    let y = line('.')
    execute x . "," . y . " fold"
    else
    normal zd
    endif
    endfunction
    "" The above function may hang in the while loop if
    "" the file does not have a trailing empty line.
    "" The following function checks for and/or adds one.
    function StartOutline()
    let x = line('.')
    normal G
    if indent('.') != 0
    normal o
    execute x
    endif
    endfunction
    The challenge is parts of each of these would be needed for "complete" latex folding.  The begin/end bounded blocks can use the generic function with these line
    au BufNewFile,BufRead *.tex nmap <space> ;call ToggleFold("\begin")<CR>
    au BufNewFile,BufRead *.tex let b:match_words = 'begin{\([a-z]*\)}:end{\1}'
    but this will not fold "unbounded" blocks like chapter section and item.
    Here is my first attempt at a general purpose latex folder.  It works ... most of the time.
    function ToggleLatexFold()
    if foldlevel('.') == 0
    let block_type = matchstr(getline('.'),'\(chapter\|section\|item\)')
    if block_type != ""
    " I don't like the next four lines - there should be a better way of
    " getting the number of lines in the buffer
    normal ma
    normal G
    let last_line = line('.')
    normal `a
    " end ugliness
    let x = line('.')
    normal j
    while matchstr(getline('.'),block_type) != block_type
    if line('.') >= last_line
    break
    endif
    normal j
    endwhile
    normal k
    let y = line('.')
    execute x . "," . y . " fold"
    else
    normal 0
    call search("\begin{",'c')
    let x = line('.')
    normal %
    let y = line('.')
    execute x . "," . y . " fold"
    endif
    else
    normal zd
    normal %
    endif
    endfunction
    au BufNewFile,BufRead *.tex nmap <space> ;call ToggleLatexFold()<CR>
    au BufNewFile,BufRead *.tex let b:match_words = 'begin{\([a-z]*\)}:end{\1}'
    It fails, however, when a section is followed a new chapter rather than another section.  This part would be easy to fix.  It also fails, though, when a same-flavor block is nested within the current - for example a \item that has a nested enumerate or itemize will not fold properly.
    For my use, I'll stick with putting braces in comments around my major elements.  But hopefuly this will give you some ideas.  If you make any big improvements, let me know.
    No doubt I have really just reinvented the wheel - but thats the best way to really know how wheels work!

  • Making a PKGBUILD file for EQC (A LaTeX Equation Compiler)

    Hi everyone,
    Just yesterday I was searching in the web for some alternative to Mathcad (a useful program to make calculations the "engineering-way"), when I found this great software developed by Jan Rheinländer, which in essence, lets you do the same as Mathcad, but using Latex (very beautiful).
    So I decided to make a PKGBUILD, so other people could install it easily. The problem is, that this is my first PKGBUILD file and I have been having problems making it to work.
    Here is the code I have:
    # PKGBUILD for EQC: Latex Equation Compiler
    # Contributor: Cristóbal Tapia <[email protected]>
    pkgname=eqc
    pkgver=20130112
    pkgrel=1
    pkgdesc="A preprocessor for LaTeX files that enables numeric and symbolic calculations"
    arch=('x86_64' 'i686')
    url="http://eqc.sourceforge.net/wiki/index.php/Main_Page"
    license="(L)GPL"
    depends=('ginac' 'cln' 'gmp' 'flex' 'bison' 'texlive-science' 'texlive-pstricks')
    source=()
    _svntrunk="https://eqc.svn.sourceforge.net/svnroot/eqc"
    _eqcsrc="eqc_src"
    build() {
    cd $srcdir
    msg2 "Connecting to Sourceforge server...."
    svn co $_svntrunk $_eqcsrc --config-dir ./ -r '{'$_pkgver'}'
    cd $_eqcsrc
    ./configure
    make
    make install
    package() {
    Can anyone help me a little please?
    Thanks!
    Edit: here is the link to the wiki of the project: http://eqc.sourceforge.net/wiki/index.php/Main_Page
    Last edited by tapia (2013-04-17 03:12:08)

    Hello again!
    I have finally done this. It works for me, so I would like to know if it works for somebody else or if there is any dependency problem.
    PKGBUILD:
    # PKGBUILD for EQC: Latex Equation Compiler
    # Maintainer: Cristóbal Tapia <crtapia a gmail com>
    pkgname=eqc
    pkgrel=1
    pkgver=48
    pkgdesc="A preprocessor for LaTeX files that enables numeric and symbolic calculations"
    arch=('x86_64' 'i686')
    url="http://eqc.sourceforge.net/wiki/index.php/Main_Page"
    license="(L)GPL"
    depends=('subversion' 'ginac' 'cln' 'gmp' 'flex' 'bison' 'texlive-science' 'texlive-pstricks' 'linuxdoc-tools')
    source=(svn+svn://svn.code.sf.net/p/eqc/code)
    md5sums=('SKIP')
    install='eqc-svn.install'
    pkgver() {
    cd $srcdir/code
    svnversion | tr -d [A-z]
    build() {
    cd $srcdir/code
    ./configure
    make
    package() {
    cd $srcdir/code
    make DESTDIR="$pkgdir" install
    eqc-svn.intall:
    post_install() {
    texhash
    post_upgrade() {
    texhash
    post_remove() {
    texhash

  • LaTeX composition in (g)vim with live update-as-you-type PDF preview

    Ever since I tried the gummi LaTeX editor, I've been intrigued by the idea of having a live-updating PDF preview--i.e., a PDF output panel which updated as I typed. This provides all the good things of WYSIWYG, but without taking away the control I have by editing the source directly. However, apart from its preview panel, I was thoroughly unimpressed with gummi as an editor. It had none of the advanced features I was used to.
    Since then, I've been trying various techniques to make it work with my preferred editor, (g)vim. At first, I used latexmk with the -pvc option which recompiles whenever the file changes, along with a PDF editor that refreshes whenever the file changes (like evince); but found it slow and tended to get stuck.
    My current method is to use mupdf as my viewer, with a custom LaTeX script which calls xdotool to update mupdf whenever I have a successful compilation. This seems to be working fairly well.
    Here's an animated GIF screen capture showing it in action
    There is typically still a 1-second delay between typing something and it showing on the PDF preview, but it's not really any worse than it seems to be wih gummi, and I get to use a world-class editor.
    I should note that I'm not using the vim-latex suite plugin or anything similar, so I don't know whether or not any of this is compatible.
    Anyway, I thought I'd post my method here just in case anyone thought it useful, or more importantly, anyone had any feedback for how it might be improved. I'm not a programmer (--my degrees are in philosophy!--) and don't really have that much experience with vim or bash scripting, so forgive my naive methods.
    Anyway, in my ~/.vim/ftplugin/tex.vim I have:
    " Function to save, check if already compiling and compile if not
    function! KKLtxAction()
    " go to right directory
    lcd %:p:h
    " save the file if need be and it's possible
    if filewritable(bufname("%"))
    silent update
    endif
    " see how many kkltx processes there are
    " note that there are always 3 when the checking itself happens
    " so we need there to be no more than that
    let numrunning = system("ps ax | grep kkltx | wc -l")
    if numrunning < 4
    exec "silent !kkltx " . expand("%") . " &"
    endif
    endfunction
    " Call this function whenever mupdf the cursor moves
    " But only in gvim
    if has("gui_running")
    au CursorMoved *.tex call KKLtxAction()
    au CursorMovedI *.tex call KKLtxAction()
    endif
    So whenever the cursor moves, the file saves and checks if the compilation script is running. If it is not, it runs it. Here's the script, named kkltx. (To make it work, create a ~/.config/kkltx folder. Sorry about the stupid name; I needed it to be uncommon.)
    #!/bin/bash
    file="$1"
    logfile="${file%.tex}.log"
    auxfile="${file%.tex}.aux"
    # check to see when file was last saved and
    # check see what version of file was last compiled
    currmodified=$(stat -c %Y "$file")
    oldmodified=$(cat $HOME/.config/kkltx/lastprocessedfile)
    # if they're the same exit with no change
    if [ "$currmodified" == "$oldmodified" ] ; then
    echo "nochange"
    exit 0
    else
    # if compilation is necessary, check what program to use
    # 'xelatex' should appear in first 5 lines for xelatex docs
    if head -n 5 "$file" | grep -i -q 'xelatex' > /dev/null 2>&1 ; then
    execprog="xelatex"
    else
    execprog="pdflatex"
    fi
    # try to compile
    if ${execprog} -interaction=batchmode -file-line-error -synctex=1 "$file" > /dev/null 2>&1 ; then
    # if compiling worked check if bibtex needs to run
    if cat "$logfile" | grep -i -q 'undefined citations' > /dev/null 2>&1 ; then
    if bibtex "$auxfile" > /dev/null 2>&1 ; then
    if ! ${execprog} -interaction=batchmode -file-line-error -synctex=1 "$file" > /dev/null 2>&1 ; then
    echo "failure"
    exit 1
    fi
    else
    echo "bibfail"
    exit 2
    fi
    fi
    # check if a rerun is necessary to update cross-references
    if cat "$logfile" | grep -i -q 'rerun to get' > /dev/null 2>&1 ; then
    if ! ${execprog} -interaction=batchmode -file-line-error -synctex=1 "$file" > /dev/null 2>&1 ; then
    echo "failure"
    exit 1
    fi
    fi
    # update mupdf by sending the r key to it
    xdotool search --class mupdf key --window %@ r > /dev/null 2>&1
    echo "success"
    # save time of compilation
    echo -n "$currmodified" > "$HOME/.config/kkltx/lastprocessedfile" 2>/dev/null
    else
    echo "failure"
    exit 1
    fi
    fi
    exit 0
    One thing you miss out on with mupdf is the SyncTeX ability in, e.g., TeXworks that allows you jump from the source to the corresponding part of the PDF and vice-versa. Here's a kludge that at least gets to you to the right page by using xdotool to send the signal to move to a certain page matching the source, or to read what page mupdf is on, and move to the beginning of the source code for that page (or strictly, a couple inches over and down). Again, in my ~/.vim/ftplugin/tex.vim
    " \v to open the viewer
    nnoremap \v :exec "silent! !mupdf ".expand("%:r").".pdf &"
    " forward search with mupdf
    function! MuPDFForward()
    " make sure I'm in the right directory
    lcd %:p:h
    let pageforward = 0
    " find where I am now; adjust for starting with 0
    let searchline = line(".") + 1
    let searchcol = col(".") + 1
    " use synctex to find the page to jump to
    let pageforward = system("synctex view -i " . searchline . ":" . searchcol . ":\"" . expand("%") . "\" -o \"" . expand("%:r") . ".pdf\" | grep -m1 'Page:' | sed 's/Page://'")
    " if a page other than 0 is found, send the page number to mupdf
    if pageforward > 0
    call system("xdotool search --class mupdf type --window %1 \"" . pageforward . "g\"")
    endif
    endfunction
    " inverse search with mypdf
    function! MuPDFReverse()
    lcd %:p:h
    let gotoline = 0
    " call a script which returns the line number near start of page shown on mupdf
    let gotoline = system("syncreverse-mupdf.sh " . expand("%:p:r"))
    if gotoline > 0
    exec ":" . gotopage
    endif
    endfunction
    " mappings \f and \r for forward and reverse search
    nnoremap <buffer> \f :call MuPDFForward()<CR>
    nnoremap <buffer> \r :call MuPDFReverse()<CR>
    Here is the script syncreverse-mupdf.sh called by the above:
    #!/bin/bash
    # syncreverse.sh full-path-of-PDF-minus-extension
    pathfn="$1"
    # reduce filename to base, add .pdf
    pdffile="$(echo "$pathfn" | sed 's@.*/@@g').pdf"
    # change to directory containing files
    cd "$(echo "$pathfn" | sed 's@\(.*\)/[^/]*@\1@g')"
    # read page number in mupdf window title
    page=$(xdotool search --class mupdf getwindowname | sed 's:.* - \([0-9]*\)/.*:\1:')
    # synctex lookup; remove junk
    line=$(synctex edit -o "$page:288:108:$pdffile" | grep -m1 'Line:' | sed 's/Line://' | head -n1)
    line=$(echo "$line" | sed -n 's/\([0-9]*\).*/\1/p')
    # return line for gvim
    echo "$line"
    exit 0
    I also recommend putting mappings in vim to send keys to mupdf to move around, so you can move around in the preview but without making (g)vim lose focus. These are just examples.
    nnoremap <silent> <buffer> <C-PageDown> :silent! call system("xdotool search --class mupdf key --window %@ Page_Down")<CR>
    nnoremap <silent> <buffer> <C-PageUp> :silent! call system("xdotool search --class mupdf key --window %@ Page_Up")<CR>
    Anyway, these could definitely be improved, by, for example, accommodating master/sub-documents, and so on. Thoughts?
    Last edited by frabjous (2010-11-04 22:41:21)

    OK, I've uploaded a PKGBUILD to AUR. Since I've changed how it handles recognizing when it's safe to recompile, it no longer needs to have a weird name. The name is now:
    vim-live-latex-preview
    It comes with a very short vim help file, which I'll copy here.
    *live-latex-preview.txt* For Vim version 7.3. Last change: 2010 Oct 27
    *live-latex-preview*
    A plugin for creating a live-updating PDF
    preview for a LaTeX file in MuPDF
    Default key bindings:~
    \p = Begin auto-compilation and launch MuPDF preview.
    \o = End auto-compilation and close MuPDF preview.
    \s = Check the result of the last compilation;
    jump to first error in case of errors.
    \f = Forward search to page in PDF matching cursor
    position in source.
    \r = Reverse/inverse search to position in source
    matching active page in MuPDF. (Very approximate.)
    \<PageUp>, \<PageDown>, \<Up>, \<Down>, \<Right>, \<Left>, \G
    \m, \t, \-, \+, \= = Send the corresponding keystrokes
    to the MuPDF preview without losing focus on vim Window
    The '\' can be changed by changing <LocalLeader>.
    Be aware that your file is saved whenever the cursor moves. Be sure
    to take the appropriate measures to keep back-up saves and undo files
    so you can undo changes if need be.
    To compile with XeLaTeX rather than PDFLaTeX, include the string
    'xelatex' somewhere in the first five lines of your file (e.g., in a
    comment). Currently only PDFLaTeX and XeLaTeX are supported. (Support
    for LuaLaTeX and/or LaTeX > dvips > ps2pdf may be added in the future,
    but they may be too slow for the live updating process anyway.)
    The plug-in does not currently support master- and sub-documents
    via LaTeX's \input{...} and \include{...} mechanisms. This may be
    added in the future.
    vim:tw=78:ts=8:ft=help:norl:
    This is a new version; pretty much completely rewritten from the above. In particular, I've tried to incorporate keenerd's ideas; in particular some changes:
    Rather than grepping the active processes, when it begins a compilation, it records the process ID of the compilation script, and will not begin a new compilation until that process finishes.
    When it first launches MuPDF, it records the Window ID and sends it back to vim, so vim knows which instance of MuPDF to refresh or work with.
    I've added a \s quick key which provides a one-word summary of the effects of the last compilation and jumps to the line number of the first error, if there were errors.
    The script is located in a separate file in the main $VIMRUNTIME/ftplugin folder, rather than a user's tex.vim file.
    I'm sure there's still plenty of room for improvement. I'd still like to get it to handle master/sub-documents well, for example. All comments welcome.

  • CJK-Latex

    I use latex a lot to write my lab reports for physics. Everything works fine, I am using the vim latex-suite from aur and tetex. Now i need to write a paper for linguistics and I'd like to use latex for it since it has very nice fonts for the phonetic alphabet. the problem is that I also need to use japanese characters in the paper. I tried installing cjk-latex following this website
    http://www.physics.wustl.edu/~alford/te … latex.html but my documents just show blank where the japanese text should go.
    Has anybody successfully installed cjk-latex in archlinux?
    Any help or information would be greatly appreciated.
    Thanks

    See http://alexkrispin.wordpress.com/2010/0 … eshooting/
    I know you are not using xelatex. However, I think that if you have the texlive fonts added to fontconfig's cache, that xelatex will find those which are good for Japanese along with other system fonts which are suitable for Japanese (but won't work with regular latex). I haven't tried this but it looks at least plausible.

  • [SOLVED] How do I use .tex files as templates in vim?

    I finally got vim just the way I like it, and I plan to write papers using LaTeX now that I have seen the light. I created a .tex file called documentTemplate.tex with all the options set up for the title, author, font, margins, etc. just the way I like it. What I would like to do is be able to execute a command that opens this document with vim and then be forced to save it as a different file name. I have made my documentTemplate.tex read-only, and when I open it with vim, it gives me the usual warning and then allows me to edit the document without actually writing over it.
    The problem I have experienced is after writing the file with a new name using ":w ~/Documents/<filename>", I am not able to save over that document with ":w". Every subsequent ":w" tries to save what I have over documentTemplate.tex, but not the new file name. How can I make this work correctly?
    If there is a better way to use .tex documents as templates with vim please let me know. I am not using vim-latex because it seems to be dying/not that good/unnecessary/whatever. What are the other LaTeXers doing? At least some of you guys must use vim!
    Thanks,
    Allamgir
    Last edited by Allamgir (2009-08-17 16:19:22)

    Or add something like this in your .vimrc (much cleaner imo):
    if has('autocmd')
    autocmd BufNewFile * silent! 0r $HOME/.vim/templates/%:e.tpl
    endif
    Where in this case $HOME/.vim/templates/tex.tpl is your latex template.  Now everytime you open a file that has a .tex extension (or possibly filetype, I'm not sure what is used here) your template will be loaded.  You can obviously modify it to whatever suits you the best.
    Note that this is taken straight out of my .vimrc, and it is set up to handle multiple template languages, not just tex files.  Adding a $HOME/.vim/templates/py.tpl automatically adds python templates too.
    Last edited by rson451 (2009-08-17 16:33:42)

  • TeX 9 - LaTeX ftplugin with lots of firepower

    Original Post
    Hello fellow Archers,
    Some of you might be interested in trying out my Vim ftplugin TeX 9. If you like to prepare your LaTeX documents with Vim, chances are that you already use some ftplugin for that (LaTeX-Vim, ATP...). So why bother with TeX 9? I wrote it because I thought I could achieve everything LaTeX-Vim does in fraction of the SLOCs and I didn't want to automate the compilation/edit cycle like ATP. After all, Vim is an editor and LaTeX documents are not meant to be WYSIWYG in nature. In similar vein I wanted the ftplugin to be as Vimish as possible and not step on your toes, or fingers I should say.
    Update Sept 12 2014
    The latest version is available from Vim.org and from GitHub after they sync with Vim.org. The version 1.3.13 contains some small fixes I've come up with over this year. For example, you can now configure TeX-9 to use the -shell-escape flag which is required when using Minted for syntax highlighted code listings.
    Update Aug 10 2013
    Okaay, I'm reloaded! Get TeX-9 1.3.7 from Vim.org. This is a bugfix release of the 1.3.1 I published a couple of weeks ago. Thanks to the Archers who have helped me in debugging.
    Many of you probably want to use the git repos maintained at GitHub (http://vim-scripts.org/). However, I have no control over these repositories and I don't know when they'll update my plugin to the latest version.
    What this plugin does
    Compile, debug and launch a document viewer from within Vim
    Insert LaTeX code snippets with ease
    Powerful text-object for LaTeX environments
    Omni-completion of BibTeX database entries and label references
    Omni-completion of mathematical symbols
    SyncTeX support (for the Evince document viewer)
    Filetype specific indentation (courtesy of Johannes Tanzler)
    LaTeX2e manual (ported to Vim by Mikolaj Machowski)
    No-hassle settings, relatively few mappings
    Download
    Vim.org
    Last edited by aurinkolasit (2014-09-12 12:08:29)

    FreeTheBee wrote:Hi, I was curious whether TeX 9 plays nice with NERDTree and split windows in general? At the moment I use vim-latex, which doesn't like cite/ref completion when having a NERDTree open.
    I don't use NERDTree myself but TeX 9 is designed to play nicely with other buffers and windows, be they latex documents or other source code. If you want to try out TeX 9 and have vim-latex already installed, it's best to unzip the tarball from vim.org to a location of your choice and rename your "~/.vim" to "~/vim" say. Then you can say
    let &runtimepath.=',/path/to/it/tex_nine-1.2'
    in your .vimrc. To revert to vim-latex, well, do the opposite: remove that line and rename vim back to .vim.
    This is to avoid conflicts that could arise because of vim-latex. If I remember correctly, it's not possible to disable or remove vim-latex very easily. If you like my script and would like to use it permanently, you would then need to somehow manually remove vim-latex. In contrast, if you would like to disable my script, you can say in your .vimrc.
    au BufReadPre *.tex let b:init_tex_nine = 1
    Last edited by aurinkolasit (2012-05-03 09:35:46)

  • Archlinux policy WRT /usr/share/vim/vim72 vs. /usr/share/vim/vimfiles

    Hi all,
    with the recent vim upgrade I have notified a couple of package maintainers that they would have to move some vim support files that are in their packages (e.g. syntax highlighting) out of /usr/share/vim/syntax and similar into subdirectories. However, I'm afraid I might have suggested something wrong there: My suggestion was that they be put in /usr/share/vim/vimfiles/syntax and so on, but Pierre has already updated his cmake package (bugreport) and moved it into /usr/share/vim/vim72/syntax etc.
    Since I've also seen similar discussions at least in the latexsuite package (now removed since the packages have been renamed), and so I wonder what is the difference resp. the Archlinux policy with regard to those two directories: /usr/share/vim/vim72 vs. /usr/share/vim/vimfiles. (Personally, I thought that the vim72 subdirectory is for the distribution of vim itself, whereas distribution-specific stuff would go to the vimfiles subdirectory. - That's where the latex-suite package's files are now, too.)
    Anyone with more sound reasoning or an insight into some quasi-"official" view on the question?
    TIA,
    Andreas

    Actually the bug report asked to move from /usr/share/vim to /usr/share/vim/vimfiles
    So I am confused..
    Edit : ok I see now : http://repos.archlinux.org/viewvc.cgi/c … 3&r2=52345
    Pierre moved from /usr/share/vim to /usr/share/vim/vim72 instead.
    Last edited by shining (2009-10-08 11:13:01)

  • LaTeX cannot open files using reader 9

    For some reason LaTeX and adobe reader 9 don't get along.
    Normally, I code my document in Latex, hit compile, and it makes the pdf and has reader open the document for viewing.
    However, after updating to reader 9.3 I started getting error messages saying the document could not be opened every time a document compiled.  The documents still compiled, and I could still go and open the document in reader manually, but for whatever reason reader and Latex could no longer communicate.
    I solved this problem by rolling back to adobe reader 8.11.  The problem persisted in reader 9.2, 9.1 and 9.0.

    What browser are you using? Are you positive that they are PDF files? If so, do you have a link we can look at?
    Typicaly, if they really are PDF fies, that's the only option you get when you use fie>save as. If they're just web pages, you get the options that you mention.

  • Problem setting Vim as C++ IDE / dwm

    Hi guys,
    i am trying to set up Vim as my C++ IDE since 2 days and no success so far.
    I have installed Vim
    pacman -Q vim
    vim 7.3.661-1
    I have downloaded vim-latex and clang tar balls,
    extract and place appropriate directorys in ~/.vim e.g. plugins and doc
    from whitin vim
    :helptags ~/.vim
    my ~/.vimrc
    " Author:
    " Zhelyazko Petrov
    " [email protected]
    " Version:
    " 1.0
    " Set how many lines of history to remeber
    set history=700
    " Enable filetype plugins
    filetype plugin on
    filetype indent on
    " Set 7 lines to the cursor when moving vertically using j/k
    set so=7
    " Set runtime path
    set runtimepath=/home/dreadz/.vim/
    " Set grep to always generate a file-name.
    set grepprg=grep\ -nH\ $*
    "this is mostly a matter of taste.
    set sw=2
    " Turn on wild menu
    set wildmenu
    " Always show current position
    set ruler
    " Height of the command bar
    set cmdheight=2
    " Configure backsapce to behave as it should
    set backspace=eol,start,indent
    set whichwrap+=<,>h,l
    " Ignore case when searching
    set ignorecase
    " When searching try to be smart
    set smartcase
    " Highlight search results
    set hlsearch
    " Make search acts like in modern browsers
    set incsearch
    " Show matching brackets when text indicator is over them
    set showmatch
    " How many tenths of a second to blink when matching brackets
    set mat=2
    " No annoying sounds on errors
    set noerrorbells
    set novisualbellset t_vb=
    set tm=500
    " Set utf8 as standart encoding and en_US as standart lang
    set encoding=utf8
    " Always show the status line
    set laststatus=2
    " Show line number
    set number
    " Some stuff to get the mouse going
    set mouse=a
    set ttymouse=xterm2
    When i open .cpp file and i run :make i get the following message:
    make: *** No targets specified and no makefile found. Stop.
    Press ENTER or type command to continue
    uname -a
    Linux ufo 3.6.2-1-ARCH #1 SMP PREEMPT Fri Oct 12 23:58:58 CEST 2012 x86_64 GNU/Linux
    I would appreciate any suggestions.
    Many thanks!

    make: *** No targets specified and no makefile found. Stop.
    Press ENTER or type command to continue
    This is exactly what make says when it couldn't find a Makefile in the directory.  Do you actually have one in the directory with the .cpp file?  See the Wikipedia entry [1] for a good overview of the make process.  Also, the file should just be called Makefile with no extensions (.cpp or otherwise).  Remember, google is your friend [2]
    [1] https://en.wikipedia.org/wiki/Makefile
    [2] http://lmgtfy.com/?q=make%3A+no+targets … file+found
    Last edited by jynnantonix (2012-10-21 06:09:44)

Maybe you are looking for

  • HP Officejet Pro 8600 Plus Not Recognized On The Network

    I have a CenturyLink DSL Modem/Router that has 4 ports on the back.  I use Port 1 on the DSL Modem/Router to conntect to my NetGear Router.  I use Port 2 on the DSL Modem/Router to connect my HP OfficeJet Pro 8600 Plus printer.  I use Port 3 on the D

  • Traditional Chinese Characters Not Showing

    I am using iTunes 8.0 and imported my songs into iTunes. The titles with simplified chinese are able to show up but those with traditional characters showed up as strange characters. The songs were imported from another PC with Windows Vista, the tit

  • Problem mimicking ASP's GetRow function in PHP

    I am new to PHP but not to scripting. I am developing a web app using PHP/MySql that will let a particular client's employees set up and order their business cards. I have a Mac running InDesign CS4 and a set of scripts that will take a text file and

  • Display latest instance of Crystal Reports in SharePoint 2010

    Dear Sirs, I have BO 4.0 and SharePoint 2010 and Integration Option. I need to display latest instance of Crystal Reports in SharePoint webpart. I'd like to add "IOMS-Crystal Report Viewer" Web Part and display latest instance. But in Settings (in SA

  • How i can setup CLASSPATH in Linux!!!

    Help me plese how I can to modify PATH for JMF in Linux Red Hat 7.2