xuhdev / vim-latex-live-preview

A Vim Plugin for Lively Previewing LaTeX PDF Output
https://www.topbug.net/blog/2013/06/13/live-preview-of-latex-in-vim/
GNU General Public License v3.0
834 stars 74 forks source link

Does it work on windows 7? #5

Closed vanabel closed 6 years ago

vanabel commented 10 years ago

I type: LLPStartPreview it says not a editor command...

I suspect it is not work for win? is it?

xuhdev commented 10 years ago

It does not work on WIN. It's written in the readme.

vanabel notifications@github.com wrote:

Itype:LLPStartPreviewitsaysnotaeditorcommand...Isuspectitisnotworkforwin?isit?ReplytothisemaildirectlyorviewitonGitHub.

vanabel commented 10 years ago

@xuhdev Yap, I see. But did there any issue to say that it is impossible to work on win? I really want a version that will work on win? Where can I start, if I want to modify your plugin?

I have tried to add autocmd FileType tex :autocmd InsertLeave * silent call Tex_RunLaTeX() in .vimrc, which will auto-compile when return to normal mode. But this is not so perfect, when compile will shot at your plugin?

vanabel commented 10 years ago

I found your trigger for compile: CursorHold,CursorHoldI,BufWritePost, maybe this is not good enough, just try to input math formula like:

$a^2+b^2=c^2$ and $$a^2+b^2=c^2$$
xuhdev commented 10 years ago

The main obstacle is that, after opening a PDF file, windows PDF viewers don't allow other processes to write the file, while on UNICES this case is very rare. We need to let pdflatex be able to write the file while it is opened by a PDF viewer.

vanabel commented 10 years ago

Ok, If this is your problem, It can be solved by use Sumatra PDF, which will auto-refresh after each compile, and needn't to close it when I compile the tex file.

xuhdev commented 10 years ago

@vanabel OK, can you try it by adding

let g:livepreview_previewer = 'x:\path\to\sumatra.exe'

to your vimrc file? Thanks!

vanabel commented 10 years ago

I don't know what's wrong, It says that It is not a command of the editor... when I type the command :LLPStartPreview

xuhdev commented 10 years ago

Could you post the full error message?

vanabel commented 10 years ago

E492: Not an editor command:LLPStartPreview

xuhdev commented 10 years ago

@vanabel Sorry for the delay, I was sick these days. Could you check whether you have +python feature built into your Vim? You can check this by:

    :echo has('python')
vanabel commented 10 years ago

Returns 0, means no?

xuhdev commented 10 years ago

@vanabel Yes. Where did you download your Vim binary? Or did you build it yourself?

vanabel commented 10 years ago

The :version output: python

vanabel commented 10 years ago

I use it in winows 7, and just download it from http://www.vim.org/download.php, the link is:ftp://ftp.vim.org/pub/vim/pc/gvim74.exe

xuhdev commented 10 years ago

The reason that echo has('python') returns 0 is that you don't actually have python installed (or not visible by Vim).

vanabel commented 10 years ago

Yes, I didn't install python. I need to install python? Shall I install version 2.7 or 3.3?

xuhdev commented 10 years ago

2.7

vanabel commented 10 years ago

Installed, why phthon is not added to the path, I can use python in cmd. And I think that is why echo has('python') is still return 0, how to fix this? I mean, when I add the path of python to path on win7, it will disappear after a restart of win7.

xuhdev commented 10 years ago

Please see this page to set your PATH environmental variable.

vanabel commented 10 years ago

Any way, echo has('python') is 1 now. Why the error is still here?

vanabel commented 10 years ago

Ok, sorry, I find the problem: It seems that I directly put into bundle (since I install pathogen to manage plugins) is not working, but when I put it into Vim/vimfiles/plugins/ it works.

Is there any way to call the LLPStartPreview automatically for tex file?

Is there any way to use your plugin without install python? I found Automatica latex plugin for vim has the feature.

vanabel commented 10 years ago

It need not to set let g:livepreview_previewer = 'x:\path\to\sumatra.exe' in vimrc, probably since I set:

let g:Tex_DefaultTargetFormat = 'pdf'
let g:Tex_MultipleCompileFormats='pdf, aux'
let g:Tex_ViewRule_pdf = 'SumatraPDF -reuse-instance -inverse-search "gvim -c \":RemoteOpen +\%l \%f\""'
let g:Tex_CompileRule_pdf = 'xelatex -shell-escape -synctex=1 -src-specials -interaction=nonstopmode $*'

In vimrc?

xuhdev commented 10 years ago

If you want to call LLPStartPreview automatically, you can add

autocmd FileType tex   :LLPStartPreview<cr>

into your vimrc.

You need to install python for this plugin because viml doesn't support multithreading, which is critical for this plugin.

I don't understand what your last comment means.

czhang03 commented 8 years ago

it is working on my windows 10 box

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed. Thanks for contributing to vim-llp!