visual studio code – How to work on multiple latex projects in VSCode with the Latex-Workshop extension?


I am trying to set up VSCode to be my Latex IDE for homework and assignments at university. I have a repository that contains all my latex work (organized as folders by courses and assignments). Naturally, most of these projects have multiple files. An example layout of the repository would be:

.
|
|----Math
|   |
|   ----Complex Analysis
|   |   |
|   |   ----HW1
|   |       |
|   |       ----main.tex
|   |       ----q1.tex
|   |       ----q2.tex
|   |   ----HW2
|   |       |
|   |       ----main.tex
|   |       ----q1.tex
|   |       ----q2.tex
|   |----Group Theory
|       |
|       ----HW1
|           |
|           ----main.tex
|           ----q1.tex
|           ----q2.tex
|           ----q3.tex
|----Physics
|    |
|    ----Quantum Mechanics
|        |
|        ----HW1
|            |
|            ----main.tex

I have read this page which explains how Latex-Workshop finds the root file in a multi-file project. I don’t want to use magic comments or always have the main file opened (I would like auto-compile to work), so it seems the extension will simply compile the first project it finds. How can I work on multiple projects in this repository and have the Latex-Workshop extension compile the correct project I am currently working on?

The only idea that comes to my mind is to somehow trick the extension into thinking each project is its own workspace and set the “active” workspace to use for compilation. Similar to how a solution in Visual Studio has multiple projects and I can set the startup project that will be built and executed when I hit the Run button. Is there a similar feature in VSCode or the Latex-Workshop extension? being able to divide the workspace into “sub workspaces” and set the active one seems to me like the most flexible solution. If someone has a better idea, I’d like to hear it.



Source link

Leave a Comment