SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 366 forks source link

How to set a specific build environment #1163

Open shouwei opened 7 years ago

shouwei commented 7 years ago

Hi there,

I am writing my thesis. The project consists of a major file thesis.tex and several individuals chapters chapter1.tex, chapter2.tex etc. By default, I have to run the build command on the thesis.tex file, even though when made some changes on the chapter files. It's very easy to forget that I have to change to thesis.tex and compile the whole project, specially compiled with shortcuts.

So I wonder may I customize a build environment that no matter which file is under editing, the compile procedure will always take place on the major file, for example, the thesis.tex file for my case.

Thank you for your reading and help.

r-stein commented 7 years ago

LaTeXTools supports multi file document either via "magic comment" (% !TEX root = thesis.tex) or via the settings:

https://latextools.readthedocs.io/en/latest/features/#multi-file-documents

shouwei commented 7 years ago

@r-stein haha, thanks for your reply. I don't know what the problem is. Would you please help me to check it? screenshot 2017-06-16 09 28 04

r-stein commented 7 years ago

This must be a comment:

% !TEX root = ../thesis.tex

If you type % !TEX root and hit = it should suggest a root with a drop down list.

shouwei commented 7 years ago

@r-stein wow! magic! problem solved. Thank you so much! :-)

r-stein commented 7 years ago

Aside from this you may want to check out the prereleases, because they have support for \graphicspath.

https://github.com/SublimeText/LaTeXTools#prereleases

shouwei commented 7 years ago

@r-stein I already insert this line into the user configuration file, "install_prereleases": ["LaTeXTools"],

Is there any guide introduce how to use this feature "graphicspath" or the new features of prereleases?

r-stein commented 7 years ago

The folders inside \graphicspath will automatically be used for several features, e.g. fill all helper (type \includegraphics and press {) or the image hover preview (hover of an \includegraphics with the mouse. No special need for adjustment.