Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find custom cls files #1

Open
coaxial opened this issue Sep 14, 2015 · 2 comments
Open

Can't find custom cls files #1

coaxial opened this issue Sep 14, 2015 · 2 comments

Comments

@coaxial
Copy link

coaxial commented Sep 14, 2015

If I have the following tree:

.
├── gulpfile.js
├── lib
│   └── texdocs
│       ├── customclass.cls
│       └── document.tex
└── package.json

And document.tex's document class is customclass.cls

Then the plugin doesn't output any pdf because it can't find customclass.cls.

The same thing happens on the CLI:

$ pwd
/some/path

$ pdflatex lib/texdocs/document.tex
# pdflatex errors because it can't find customclass.cls that document.tex refers to

$ TEXINPUTS='lib/texdocs' document.tex
# pdflatex errors because it's looking for article.cls (which customclass.cls is based on) in lib/texdocs

$ cd lib/texdocs && pdflatex document.tex
# all is well, document.tex compiles and we have document.pdf in ./
@rreusser
Copy link
Owner

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!

@coaxial
Copy link
Author

coaxial commented Sep 22, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants