简体   繁体   English

Vim和Latex-Suite

[英]Vim and Latex-Suite

I'm using latexsuite with vim and I am currently editing files that have the form 我正在vim中使用Latexsuite,目前正在编辑具有以下格式的文件

\documentclass[10pt]{article}
\input{header.tex}
\item blah
\input{footer.tex}

The problem is that the \\begin{document} declaration is in the header.tex file, so that when I try to use latexsuite macros, it thinks I'm in the preamble. 问题在于\\ begin {document}声明位于header.tex文件中,因此当我尝试使用Latexsuite宏时,它认为我在序言中。 Is there any way to force latexsuite to behave as though it is in the body of the document? 有什么方法可以迫使乳胶套装的行为就好像它在文档正文中一样? (also, if you're confused, the header.tex file also starts a list environment, hence the \\item in the body.) (同样,如果您感到困惑,header.tex文件还会启动一个列表环境,因此会在主体中显示\\ item。)

Thanks 谢谢

As a practical solution, why don't you move the \\begin{document} and \\end{document} lines out of header.tex and footer.tex templates and into each actual document? 作为一种实用的解决方案,为什么不将\\begin{document}\\end{document}行移出header.texfooter.tex模板,并移至每个实际文档中? I understand you may be trying to follow the DRY principle, but for a TeX file that's honestly intended to be compiled as a document, I feel that these two tags should actually be in that document, not sourced from another TeX file. 我了解您可能正在尝试遵循DRY原则,但是对于确实打算将其编译为文档的TeX文件,我认为这两个标记实际上应该在该文档中,而不是源自另一个TeX文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM