Open coaxial opened 9 years ago
Hmm… that's a good question. This question suggests maybe there are a couple variations of TEXINPUTS
that might be helpful in this situation: http://tex.stackexchange.com/questions/93712/definition-of-the-texinputs-variable
(Specifically, do you need TEXINPUTS=./lib/texdocs:/usr/local/share/???/texdocs
or wherever your tex installation resides? This is slightly outside of my current knowledge of latex setup)
Otherwise, is it possible to specify the working directory in the gulp file when you select sources? See: https://github.com/gulpjs/gulp/blob/master/docs/recipes/specifying-a-cwd.md
gulp.src('./some/dir/**/*.js', { cwd: 'public' });
If it works, I think that might be the best solution since it's minimally invasive and puts the onus of getting this right on the particular script you're using.
I think it would also be possible to just use cd ${your_dir} && latex
(that's es6 string interpolation syntax that I couldn't remember how to wrap with backticks in markdown, but whatever works for you).
That's just a few shots in the dark, so let me know if you still have any trouble!
I couldn't find any other solution than using gulp-shell or child_process.exec() which both let you set the cwd. It's not ideal and probably doesn't handle errors and other odd conditions as well as your plugin or the underlying module though but I couldn't get anything else to work.
If I have the following tree:
And
document.tex
's document class iscustomclass.cls
Then the plugin doesn't output any pdf because it can't find
customclass.cls
.The same thing happens on the CLI: