>== Auszüge aus der Nachricht von  Mario D vom 2016-03-07 19:26:
> More or less I have solved the problem I asked about: the solution is as
> follows (from my tex.vim):
> 
> ---------------------------------------------------------
> function! Set_PDF()
>     let g:Tex_CompileRule_pdf = 'pdflatex --synctex=1
> -interaction=nonstopmode -file-line-error-style $*'
>     let g:Tex_ViewRule_pdf =  'okular --unique 2>/dev/null 1>&2 '
>     let g:Tex_DefaultTargetFormat = 'pdf'
>     exec 'TTarget '.g:Tex_DefaultTargetFormat
> endfunction
> function! Set_LaTeX()
>     let g:Tex_CompileRule_dvi = 'latex -src-specials
> -interaction=nonstopmode -file-line-error-style $*'
>     let g:Tex_ViewRule_dvi = 'xdvi 2>/dev/null 1>&2 '
>     let g:Tex_DefaultTargetFormat = 'dvi'
>     exec 'TTarget '.g:Tex_DefaultTargetFormat
> endfunction
> noremap <leader>latex :call Set_LaTeX()
> noremap <leader>pdf   :call Set_PDF()
> if getline(1) =~ "PDFLaTeX" | :call Set_PDF() | endif
> -------------------------------------------------------------
> 
> Now, from within a file I am able to switch pdf/latex compilation and
> correct visualization.
> 
> The only thing that I can not fix is the following: I would like to have
> the file recognized upon opening. For this, if a file is meant to be
> pdflatex it has the first line equal to
> 
> %PDFLaTeX
> 
> so that it should trigger the "if getline..." in tex.vim
> 
> The problem is that when I open such file I get the following error:
> 
> "file.tex"  194L, 5881C
> Error detected while processing function Set_PDF:
> line    4:
> E492: Not an editor command: TTarget pdf

Obviously, your tex.vim is loaded before TTarget is defined.

`grep -rn TTarget ~/.vim` reveals TTarget is defined on line 86 in
~/.vim/ftplugin/latex-suite/compiler.vim, and a

`find ~/.vim -name tex.vim` shows me three tex.vim in my installation,
so that the location "my tex.vim" is not exactly unambiguous. I've no
idea in which order vim loads these files.

> 
> How do I fix this?

Did you put your customization in the "after" folder?
(i.e. ~/.vim/after/ftplugin/tex.vim?) This file should be loaded *after*
all other so that TTarget should be defined on this time.

> 
> TIA

Transitory Ischemic Attack?

Regards, Ruthard

-- 

Dr. Ruthard Baudach
Speckertsweg 36a
97209 Veitshöchheim
----

Emails bitte verschlüsseln und signieren.
Meine PGP-Id: 0xAC5AC6C2

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to