SublimeText / LaTeXTools

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

\input@path change not parsed by latextools #1408

Open payoto opened 5 years ago

payoto commented 5 years ago

Summary

Is there an option to manually add directories for LatexTools to search for figures/tex files? Or how can I set the \input@path and \graphicspath values for LatexTools' internal commands?

Context

I am using subfiles to write a large document this lets me build chapters in standalone and still build the entire document. The build process works flawlessly for both the main and subfiles. My issue is that features of LatexTools don't work: the TOC is empty, figures don't get detected when parsing, bib files are not necessarily found, etc...

This is because the main document relies on setting latex input and graphics paths manually with the commands below.

\makeatletter
\@ifundefined{SUBFILECOMPILE}{
\def\input@path{
    {./}
    {chapters/1_background/}
    {chapters/2_2DRSVS/}
    }
    \newcommand{\MAINFILECOMPILE}{}
}{}
\makeatother
\appendtographicspath{
    {chapters/1_background}
    {chapters/2_2DRSVS}
}

How can these changes be propagated to LatexTools?

r-stein commented 5 years ago

If you enable the prereleases you will get support for \graphicspath in general, however not for the \appendtographicspath command. (it is impossible to support every LaTeX command).

A workaround would be to include the comments package and use the corresponding include commands inside the comment environment or after \end{document}. Adding additional input parts is as far I know not supported.

payoto commented 5 years ago

Ok, thanks using the comment package does allow me to add graphics paths and define the bibliography in a way LaTeXTools understands, bringing back those lovely fuzzy search functionalities.

It would be nice if there was a setting to manually extend the path in which latextools looks for all types of sources (.tex, .bib, .sty, images...) when parsing rather than simply using the latex path. Do you have any idea how realistic would that be?