Well written latex-Suite tutorial

Source: Internet
Author: User
Tags imap

From: http://ilovenn.blog.51cto.com/853223/369646

 

Because texlive is not installed from the source, Kile, winefish, and rubber cannot be directly installed from the source. First, you should use gedit to edit the latex document and run a latex plug-in for gedit. However, it seems that this plug-in requires rubber (can anyone solve this problem? For Help !), Therefore, use the latex-Suite plug-in of vim. 1. First, download this plug-in http://vim-latex.sourceforge.net/index.php? Subject = download & Title = download the installation method is also provided below, but I have done it many times and finally succeeded and recorded it. 2. Install 2.1 in/home/User Name (I .e ~ Directory. vim folder ,. vimrc file 2.2 right-click vim-latex-1.5-20091002-r00004.tar.gz on the downloaded vim-latex-1.5-20091002-r00004.tar.gz (I am not very familiar with using the command line for these "daily transactions", huh, copy to new ~ /. Vim 2.3 is in ~ Create the document Tex. Vim in the/. Vim/ftplugin directory and enter the following content (copy the file from the vim-latex homepage ):
"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 + =:



2.4 In the newly created ~ /. In the vimrc file, enter the following content to tell Vim to load the latex-Suite plug-in (you can also copy from the home page ;-)



"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

"'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'



2.5 set vim-latex-Suite

I now use the xelatex command to compile the document and use evince to browse the generated PDF document. You can modify

~ /. Vim/ftplugin/latex-Suite/texrc to complete these operations.

Lines 88th to 92 are modified as follows:

88 If has ('macunix ')

89 texlet G: tex_defaulttargetformat = 'pdf'

90 else

91 texlet G: tex_defaulttargetformat = 'pdf'

92 endif

Is to make Tex always compiled into PDF



Change row 117th

114 "ways to generate PDF files. There are soo files...

115 "NOTE: pdflatex generates the same output as latex. Therefore quickfix is

116 "possible.

117 texlet G: tex_compilerule_pdf = 'xelatex-interaction = nonstopmode $ *'

Use xelatex to compile Tex-> pdf



Modify row 147:

144 elseif has ('macunix ')

145 "let the system pick. If you want, you can override the choice here.

146 texlet G: tex_viewrule_ps =''

147 texlet G: tex_viewrule_pdf = 'evince'

Specify to open the PDF document using the evince program.



2.4 restart Vim

What is the restart method? I log out directly and log on again. hehahaha, it's silly and effective ;-)

(Shut down the vim program and start it again. Even if it is restarted once, you don't have to log out)

In this case, use Vim to open a document suffixed with. Tex, and you can see the latex toolbar options in vim.



TIPS ":



1. key to note at the beginning: Ctrl-J, F5, F7, F9, Shift-F5, Shift-F7,/LL (compile shortcut),/LV (view PDF shortcut),/LS, CTRL-x Ctrl-K (supplemented by dictionary.



2. Write/CITE {and press F9 without a cross reference. The reason is that the python interface in VIM has some problems with latex-suite. disable it. You only need ~ /. Vim/ftplugin/latex-Suite/texrc default



Open ~ /. Vim/ftplugin/latex-Suite/texrc, Set
Change texlet G: tex_usepython = 1 to texlet G: tex_usepython = 0! 3. in order to be able to perform a forward search, you should set the parameters and use/ll for compilation. However, when makefile is in the working directory,/ll does not execute the set compilation command, but executes makefile, as a result, forward search cannot be performed, and it is depressing for a long time. In fact, you only need to disable makefile ~ In/. Vim/ftplugin/latex-Suite/texrc, texlet G: tex_usemakefile = 04. set forward search in ~ /. Vim/ftplugin/tex. in vim, specify Let G: tex_compilerule_dvi = 'latex-Src-specials-interaction = nonstopmode $ * ', which indicates that tctarget DVI is also set, if you write this sentence in the above file, running VI will prompt an error, but you can execute this command in VI. If you can use it anyway, you will ignore it. After the settings are completed, you need to re-compile the Tex file (use/LL), and then/ls can be searched and previewed.

5. reverse search, see the http://bbs.ctex.org/viewthread.php? Tid = 39072 & extra = & page = 1
Note that reverse search only supports gvim, and gvim must be started in remote mode: gvim -- servername latex-suite -- remote-silent filename. after Tex is started, in order to be able to use reverse search, xdvi must know that the current editor works in remote mode.
Vim, so that you can call the editor to display the search results when searching. In your ~ /. Vimrc or ~ /. Vim/ftplugin/tex. in vim, add the following content: Let G: tex_viewrule_dvi = "xdvi-Editor 'gvim -- servername latex-suite -- remote-silent '". You can view the content in/ll after compiling/LS, during reverse search, remember to press Ctrl to double-click a location (it seems that you can click it with the left button) and jump to the corresponding location of the Tex source file.

6. For convenience, you have made some settings, including the shortcut keys ~ In/. Vim/ftplugin/tex. VIM:

Map <F4> <ESC>: q <CR> "F4 close the window (buffer)
Map <F2> <ESC>: W <CR>/ll "F2 save and compile
Imap <F2> <ESC>: W <CR>/LL
Map <F3> <ESC>/LV "F3 View
Imap <F3> <ESC>/LV
NMAP <tab> <c-j> "uses the tab key instead of Ctrl-J to redirect.
Imap <tab> <c-j>
Vmap <tab> <c-j>
Set keywordprg =: Help "press the K key to find help for words at the cursor. The default value is man.
Cmap XXX! Make
Set iskeyword + = ., _ "facilitates fig. XX, prl1038512345 and other forms of search completion, otherwise by default, fig is not set. XX is regarded as a word, but as fig and XX. "is used as the separator of the word. 7. As long
Latex-Src-specials-interaction = nonstopmode XXX. Tex
The compiled DVI file already contains the forward and reverse search information, so you can search in the forward or reverse direction. If you open it with xdvi, press Ctrl and left-click to search in the reverse direction, however, xdvi uses the xterm-e VI window by default. In fact, you can specify the editor by yourself, such
Xdvi-Editor gedit
As for reverse search, the gvim parameter added above only ensures that a gvim window is not opened for each reverse search.

8. temporarily cancel the definition of the shortcut key. For example, if you want to enter double quotation marks, but when you press "it will automatically become'', how can you disable automatic replacement and directly output?
Remember <Ctrl-V>!
<Ctrl-V> "get"
SS <Ctrl-V> S to get SSS
~ <Ctrl-V> ~ Get ~~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.