vim和latex环境搭建

安装软件

下载软件

安装

gvim安装自不必说。

http://vim-latex.sourceforge.net/index.php?subject=download&title=Download讲了安装步骤,拷贝如下:

Installation Instructions

Step 1 of 4: Download and extract the archives

Extract one of the archives above into your ~/vimfiles directory (if you are using windows) or ~/.vim directory (if you are using *nix).
If you are updating after a long time, it might be a good idea to remove the ~/vimfiles/ftplugin/latex-suite directory from previous installations before reinstalling.

NOTE: If you already have some latex ftplugin files, read the Advanced Installation Instructions to make sure you do not over-write any of your files.

Step 2 of 4: Set a few things in .vimrc

The recommended settings for vim-latex in your .vimrc file are now only described in the vim-latex manual.

Step 3 of 4: Install the help files

To install the included latex-suite.txt and latexhelp.txt files as vim help files, start vim and do the following:

helptags ~/.vim/doc     (for *nix users) 
helptags ~/vimfiles/doc     (for windows users) 

Step 4 of 4: Done!

Thats it! You are done! Now start editing a latex file in vim. Latex-Suite should start up automatically. You can do

:help latex-suite.txt

from within vim to get the online Latex-Suite reference.

注:1. win下面,.vimrc对应的就是_vimrc;2. 上述helptags命令后面可以用相对路径或全路径文件名,如:

:helptags d:/Vim/vimfiles/doc

上面第二步的网页内容拷贝在这里,方便取用:

Installation and recommended Settings

If you are reading this, it most probably means that you have already installed Latex-Suite and the help files. If this is not the case, follow the detailed instructions on Latex-Suite’s download page.

Make sure that you create a few necessary settings in your ~/.vimrc.

" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on

" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash

" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'

In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim file:

" this is mostly a matter of taste. but LaTeX looks good with just a bit
" of indentation.
set sw=2
" TIP: if you write your \label's as \label{fig:something}, then if you
" type in \ref{fig: and press <C-n> you will automatically cycle through
" all the figure labels. Very useful!
set iskeyword+=:

顺便可以看到,http://vim-latex.sourceforge.net/documentation/latex-suite/index.html是详细的vim-latex在线帮助。

vim文档

http://www.vim.org/docs.php提供了一些vim的文档。

latex的用上面helptags的方法来即可。

练习

按照latex-suite的Tutorial,gvim打开tex文件都闪退;只能用vim。还不清楚具体原因。另外,也没有看到latex-suite的菜单。

其他

vi常用命令

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值