Skip to main content

Latex-suite技巧总结

用latex-suite有几天了,越发得发现它太好用了.其实看它的帮助是发现功能的最好方法,很多时候比上网搜要快,可以我一般看不了多少就忍不住了...

总结一下已知的一些技巧吧

注: 我的latex-suite是放在~/.vim里了

1.修改~/.vim/ftplugin/latex-suite/texrc,将TexLet g:Tex_defaultTargetFormat='dvi'中的dvi改成pdf -- 我是一般喜欢用pdflatex直接生成pdf的,因为它对图片支持比较好.

2.输入模式下,按F5可以输入\begin{}\end{}类的命令,如果按F5之前用v选中了文字,则加入的begin和end可以把这部分文字"包住"

3.输入模式下,按F7可以输入\命令,如果已经输入了命令,如frac,光标停在c后,此时按F7可自动把它替换成\frac,且自动加入适当的{}

4.输入((,{{,[[之类的符号可自动替换成\left\right类型

5.它定义了若干三字母快捷方式,如EMA可自动替换为\begin{math}\end{math}

6.双引号可自动替换成``或'',而且是自动左右匹配

7.使用它的自动完成经常可以看到形如<++>的符号,这个是定位符,通常放在下一个你会打字的地方,比如\frac{}{<++>}<++>,按C-J可以自动定位并消除这个符号.如果只是一个},那么它的好处并不明显,但是如果是\right}就会发现它的好处了.(一开始我还以为这个符号是latex-suite的bug... -_-b)

8.make命令可以直接编译(第一步改的就是这个命令),不过要打make <文件名>

9.\ll可以编译当前文件,\lv可以查看编译后的文件

10.:Target, :TCTarget, :TVTarget可以修改9中的目标,如dvi或pdf,不过\lv对pdf支持不大好,可能需要手工修改脚本

总之,latex-suite很不错

Comments

Qiuyew said…
你好,
我使用vim-latexsuite的时候,发现输入ETB之后产生的代码如下

\begin{thebibliography} \item[<+biblabel+>]{<+bibkey+>} <++> <++> \end{thebibliography}<++>

不是很明白为什么这第二行是\item而不是\bibitem
请问是不是有其他的快捷方式能呼出有\bibitem的环境?
另外\item编译虽然能通过,却不能自动在文中引用文献处编号,请问这个\item有什么用啊?

谢谢了
Lu Wang said…
不是很清楚,那个\item可能是它习惯性的, 比如enumerate里显然就是\item.而它似乎没有考虑到bib的事情
如果想针对thebibliography, 可以尝试修改latex-suite源码

Popular posts from this blog

A Rocky Migration: Moving from docker-compose to Podman and gVisor

I've been running a few containers for several years. They were all running under rootless Docker with a single user. Initially, I planned to  migrate the containers to VMs , but I couldn't get a stable workflow after about two months of effort. Later,  gVisor caught my attention , and I decided to migrate to Podman with gVisor instead. The new plan is to run each container with  --userns=auto  and use Quadlet for systemd integration. This approach provides better isolation and makes writing firewall rules easier. I'm now close to migrating all my containers. Here are a couple of rough edges I'd like to share. Network Layout I compared  various networking options  and spent a few hours trying the one-interface-per-group approach before giving up. I settled on a single macvlan network and decided to use static IP addresses for my containers. To prevent a randomly assigned IP address from conflicting with a predefined one, I allocated a large IP range for my ...

GameConqueror 0.09 -- Linux Game Hacking Tool

If you are a game hacker If you've been looking for a `CheatEngine for Linux` Then you can't miss this. ============================================== GameConqueror is a game hacking tool for linux, it's written in PyGTK and uses scanmem as its backend. It's supposed to be with most useful features of CheatEngine for Linux. Currently, I've implemented almost everything about scanning, involving variant data types and scan types: Data Types: int{8/16/32/64}, float{32/64}, unknown type(int or float) and unknown width(will try each of them), byte array and string Scan Types: equal, greater, less, changed, unchanged, increased(by), decreased(by) This should be enough for most cases, so I decided to release it at the current status. ============================================= Here's how you can get it PPA (for Ubuntu users) https://launchpad.net/~coolwanglu/+archive/scanmem (I've not test it in 32bit environments or Jaunty, do please inform me if it doe...

Fix Google Security Code

Google Security Code (http://g.co/sc) is one type of 2-step verification. This is particularly useful when security keys and passkeys are not available. I have been using it in my LXC containers, until today I found out that it stopped working. It just kept saying "The code is invalid". It is easy to rule out some factors: The code works on other browsers on my laptop. The code works on other devices that are directly connected to the router. So it appears that Google also checks IP addresses besides the security code. Recently I have IPv6 enabled, so most devices that are directly connected to the router have both IPv4 and IPv6 addresses. But  I only enabled IPv4 for my LXC containers. So I guess when a code is generated by device A and used by device B, Google should be able to check that device A and device B are closely located. But in my case, IPv6 address appears on device A but not on device B, which may look suspicious. To fix the problem, I just needed to disable IPv...