md_insert_equation.vim


Ⅰ. 插件描述

Insert latex equation as image generated by 'latex.codecogs.com'

Ⅱ. 基本信息

创建日期:  2016-03-25
使用用户:  1
Github星:  14
插件作者:  Chong HE

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'ron89/md-insert-equation-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'ron89/md-insert-equation-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'ron89/md-insert-equation-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/ron89/md_insert_equation.vim

Ⅳ. 文档说明

Notice This plugin currently only offer the most simplistic interface for
simple equation inputting. To make it a full-fledged LaTeX equation editor with
all highlighting and auto-completion feature is surely doable(by using split
with tex filetype) but it could take some effort and I don't know if there
will be people needing it. So if you happen to take interests in this plugin
and have the need for such feature, or any other feature you feel nice to have,
shout out in the issue section of this repo and I'll surely work on it as
soon as I'm available.

Markdown Equation Insert Plugin for Vim

This plugin helps inserting LaTeX equation into markdown file as gif image
generated by latex.codecogs.com. All you need to do is to
**invoke the keybinding <LocalLeader>ee. Then type in your equation in
LaTeX format**. And the equation will be automatically translated into
latex.codecogs.com recognized image generating API and
inserted under your cursor. **Invoking the same keybinding under existing
equation will enable you to edit it in LaTeX format.**

screenshot

Note that this plugin is written in Python, hence +python version of Vim is
required.

Motivation

Inputing math equation into markdown file can be troublesome sometimes as there
is no standard method of it. So far the most fail-proof method to make
generally recognized(by github, etc.) equation is to use a third
party API to translate $LaTeX$ code into equation image, then generate a link
to that image. However, typing the link according to the api in markdown
hyperlink format is cumbersome. To facilitate the process in Vim editor, I made
this plugin.

How to Install

Use your plugin manager of choice.

  • Pathogen

    • git clone https://github.com/ron89/md_insert_equation.vim ~/.vim/bundle/md_insert_equation.vim
  • Vundle

    • Add Bundle 'ron89/md_insert_equation.vim' to .vimrc
    • Run :BundleInstall
  • NeoBundle

    • Add NeoBundle 'ron89/md_insert_equation.vim' to .vimrc
    • Run :NeoBundleInstall
  • vim-plug

    • Add Plug 'ron89/md_insert_equation.vim' to .vimrc
    • Run :PlugInstall

How to Use

  • To insert a new equation, invoke the function by command :EditEquation, or
    keybinding <localleader>ee, then type in the equation in direct LaTeX

syntax, e.g.

    \alpha\times\frac{\beta a}{b+\gamma}

Output would be automatically translated into an image link:

    ![eqn](http://latex.codecogs.com/gif.latex?\\alpha\\times\\frac{\\beta\ a}{b+\\gamma})

and on github, the asserted link shall appear as eqn.

  • To edit an existing equation, invoke the same function/keybinding when cursor is on an existing equation link.

Thanks To

添加新评论