ajshort / vscode-latex-preview

Compilation and embedded preview of LaTeX documents for Visual Studio Code
MIT License
32 stars 11 forks source link

Feat: auto detect main tex file #19

Closed aichbauer closed 6 years ago

aichbauer commented 6 years ago

I have a setup where I have multiple tex files (config, abstract, body, ...) in one directory. I mostly work on body.tex and when I need a preview I have to switch to the main file, for the preview.

So it would be great if we could add a functionality that allows to detect the main.tex file and opens the preview for you. Since every latex document starts with \documentclass{...} this would be easy to detect.

If you like this idea, I could implement it.

ajshort commented 6 years ago

You can set the the latex-preview.filename option to your main file to always open it without having to switch to it in the editor.

aichbauer commented 6 years ago

I know but then you have to set it manually per workspace, or in the user settings, and if the files not always the same, that is one extra step. Why not automate that step since every time someone needs a preview it can only be that one file that could be run with pdflatex (or similar commands).