1

When working in vim-latex suite the commands \lv and \lc are used for view and compile master document respectively. When doing figures in larger projects, it's nice to compile them within a sub folder of the master directory.

If multiple figure's are in the same folder it's not possible to have *.latexmain files for them all. So I'd like a ''Compile the file the cursor is in'' and ''view the pdf of the file the cursor is in'' command.

something like \cc and \cv for compile current and view current

is this possible?

  • how does this differ from tex.stackexchange.com/questions/68125/… – user170109 Oct 1 '18 at 15:38
  • @KJO in that I wanted to have multiple figures in the same folder ;-) and thus cannot have a *.latexmain for each figure. – Thorbjørn E. K. Christensen Oct 1 '18 at 16:04
  • I do not use vim except to check odd features, however my understanding from vim-latex.sourceforge.net/documentation/latex-suite/… is that there should only be one latexmain per project (or folder?) since it tells the system which is the one master file (with input/include others) to be compiled each time (similar in some ways to the internal declaration in sub files %!TeX root=MyMain.tex) the only way I see a workaround is to rename the one file in the folder to match the tex file – user170109 Oct 2 '18 at 23:15
  • I am achieving what you describe simply in most other editors by NOT having a system such as latexmain. I.e. in each file there is a firstline matching the filename similar to % %!TeX root=figure1.tex , Thus whilst in the file I can compile it (in vim is it \ll ?) just as if its the main file, equally at the level above in the main.tex first my line reads % %!TeX root=main.tex. does that format not work in Vim ? – user170109 Oct 4 '18 at 13:23
  • @KJO Yes there should only be one latexmain per project, but if you are making figures as tex files they are sort of their own project, I'ts however nice to have the figures in subfolders of your project, so the solution you commented can be used, if only one figure per folder is needed. I don't know how one would make the system you describe in the second comment work, that's why I made this question. Sorry for being slow to come back to you. – Thorbjørn E. K. Christensen Jan 29 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.