You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/settings.md
+41-8Lines changed: 41 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,26 +198,59 @@ Other example formats are provided in the settings file.
198
198
199
199
## Project-Specific Settings
200
200
201
-
Any settings can be overridden on a project-specific basis if you are using SublimeText's [project system](https://www.sublimetext.com/docs/projects.html). In addition, you can use the `tex_root` setting in the project file only to specify the master tex file instead of using `%!TEX root =` magic comments. If specified in the project file, the `tex_root` will be resolved relative to the location of your `.sublime-project` file. Similarly, if you use `output_directory` or `aux_directory` in the project file, they will be resolved relative to the location of the project file.
201
+
Any LaTeXTools settings can be overridden via [`"settings": {}` in sublime-project files](https://www.sublimetext.com/docs/projects.html#settings-key).
202
202
203
-
To use project-specific settings, simply create a [`"settings"` section in your project file](https://docs.sublimetext.info/en/latest/file_management/file_management.html#the-sublime-project-format). The structure and format is the same as for the `LaTeXTools.sublime-settings` file, but the first level settings are prefixed with `latextools.` to avoid collisions with other packages. Here is an example:
203
+
**Note:** Setting keys must be prefixed by `latextools.` to prevent ambiguities with Sublime Text's preferences or settings added by other 3rd-party plugins.
204
+
205
+
Additionally `latextools.tex_root` setting provides an alternative to `%!TEX root =` magic comments, to specify file path of main TeX document.
206
+
207
+
**Note:** If specified in project file, `latextools.tex_root`, `latextools.aux_directory` and `latextools.output_directory` are resolved relative to `.sublime-project` file location.
208
+
209
+
### Example
210
+
211
+
**Folder structure:**
212
+
213
+
```
214
+
.
215
+
├── A Project.sublime-project
216
+
├── build/
217
+
| ├── aux/
218
+
| | ├── .gitignore
219
+
| | └── main.aux
220
+
| ├── main.pdf
221
+
| ├── main.synctex.gz
222
+
└── src/
223
+
├── chapters/
224
+
| ├── chapter1.tex
225
+
| ├── ...
226
+
| └── chapterN.tex
227
+
├── main.tex
228
+
└── bibliography.bib
229
+
```
230
+
231
+
**A Project.sublime-project**
204
232
205
233
```json
206
234
{
207
-
... <folder-related options here> ...
208
-
235
+
"folders": [
236
+
{
237
+
"path": "."
238
+
}
239
+
],
209
240
"settings" : {
210
-
"latextools.tex_root": "main.tex",
241
+
"latextools.tex_root": "src/main.tex",
211
242
"latextools.tex_file_exts": [".tex", ".tikz"],
243
+
"latextools.aux_directory": "build/aux",
244
+
"latextools.output_directory": "build",
212
245
"latextools.builder_settings": {
246
+
"builder": "traditional",
213
247
"program": "xelatex",
214
248
"options": "--shell-escape"
215
249
}
216
250
}
217
251
}
218
252
```
219
253
220
-
This sets `main.tex` as the master tex file (assuming a multi-file project), and allows `.tikz` files to be recognized as tex files. Furthermore (using the default, i.e., traditional builder), it forces the use of `xelatex` instead of the default `pdflatex`, and also adds the `--shell-escape` option. All of these settings will only apply while in the current project.
221
-
222
-
**Note:** tweaking settings on a project-specific level can lead to subtle issues that can be difficult to track down. If you notice a bug, in addition to resetting your `LaTeXTools.sublime-settings` file, you should remove any LaTeXTools settings from your project file.
254
+
This sets _src/main.tex_ as the main tex file (assuming a multi-file project), and allows `.tikz` files to be recognized as tex files. Furthermore (using the default, i.e., traditional builder), it forces the use of `xelatex`, and adds `--shell-escape` option. Intermediate build assets are created in _<dir of project-file>/build/aux/_ and final documents are copied to _<dir of project-file>/build/_.
223
255
256
+
**Note:** All of these settings apply only, if the project is opened in Sublime Text.
0 commit comments