GithubHelp home page GithubHelp logo

swolegoal / vim-tectonic-live-preview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuhdev/vim-latex-live-preview

0.0 0.0 0.0 388 KB

(WIP) A Vim Plugin for Lively Previewing TeX PDF Output

Home Page: http://www.topbug.net/blog/2013/06/13/live-preview-of-latex-in-vim/

License: GNU General Public License v3.0

Shell 0.80% Vim Script 99.20%

vim-tectonic-live-preview's Introduction

A Vim Plugin for Lively Previewing LaTeX PDF Output

This plugin provides a live preview of the output PDF of your LaTeX file. The display of the output PDF file will be updated lively as you type (just hold the cursor and you will see the PDF file updated). Currently, vim-latex-live-preview only support UNIX-like systems. Please let me know if you have any suggestions.

Table of Contents

Installation

Before installing, you need to make sure your Vim version is later than 7.3, and is compiled with +python feature.

Add the plugin in the vim-plug section of your ~/.vimrc:

call plug#begin('~/.vim/plugged')
[...]
" A Vim Plugin for Lively Previewing LaTeX PDF Output
Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
[...]
call plug#end()

Then reload the config and install the new plugin. Run inside vim:

:so ~/.vimrc
:PlugInstall

Add the plugin in the Vundle section of your ~/.vimrc:

call vundle#begin()
[...]
" A Vim Plugin for Lively Previewing LaTeX PDF Output
Plugin 'xuhdev/vim-latex-live-preview'
[...]
call vundle#end()

Then reload the config and install the new plugin. Run inside vim:

:so ~/.vimrc
:PluginInstall

Manually

Copy plugin/latexlivepreview.vim to ~/.vim/plugin.

Usage

Simply execute :LLPStartPreview to launch the previewer. Then try to type in Vim and you should see the live update. The updating time could be set by Vim's 'updatetime' option. If your pdf viewer crashes when updates happen, you can try to set 'updatetime' to a higher value to make it update less frequently. The suggested value of 'updatetime' is 1000.

If the root file is not the file you are currently editing, you can specify it by executing :LLPStartPreview <root-filename> or executing :LLPStartPreview with the following declaration in the first line of your source file:

% !TEX root = <root-filename>

The path to the root file can be an absolute path or a relative path, in which case it is relative to the parent directory of the current file.

โš ๏ธ if <root-filename> contains special characters (such as space), they must be escaped manually.

Configuration

PDF viewer

By default, you need to have evince or okular installed as pdf viewers. But you can specify your own viewer by setting g:livepreview_previewer option in your .vimrc:

let g:livepreview_previewer = 'your_viewer'

Please note that not every pdf viewer could work with this plugin. Currently evince and okular are known to work well. You can find a list of known working pdf viewers here.

TeX engine

LLP uses pdflatex as default engine to output a PDF to be previewed. It fallbacks to xelatex if pdflatex is not present. These defaults can be overridden by setting g:livepreview_engine variable:

let g:livepreview_engine = 'your_engine' . ' [options]'

Autocmd

By default, the LaTeX sources will be recompiled each time the buffer is written to disk, but also when the cursor holds. To prevent recompilation on cursor hold (autocmd events CursorHold and CursorHoldI), use the feature flag:

let g:livepreview_cursorhold_recompile = 0

Known issues

Swap error

An error E768: Swap file exists may occur. See issue #7 to avoid swap filename collision.

Project tree

Currently, root file must be in the same directory or upper in the project tree (otherwise, one has to save file to update the preview).

E492: Not an editor command: LLPStartPreview

See issue #12, provided the plugin is correctly installed, this is likely a Python issue.

Python-related issues

See issue #24, currently vim-latex-live-preview does not support python/dyn and Vim must be recompiled with Python support.

Screenshot

Screenshot with Evince

vim-tectonic-live-preview's People

Contributors

applixy avatar asishallab avatar badouralix avatar bradfier avatar chrislane avatar dylnmc avatar ranguli avatar xuhdev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.