Add --root argument and %!TEX root support #242
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should address #131 following the suggested approach in this comment, that is:
Implementation details
%!TEX root
directive, the path provided should be treated as relative to the current file.--root
argument, the path provided should be treated relative to the working directory.Hence the implementation of these two features are a bit different.
Corner case
Due to the current logic if you for example supply both
%!TEX root = ../root.tex
and--root dir/root.tex
options, it might generate incorrect paths:dir/../child.tex
. But I don't think this should happen often. I can add additional logic to ignore the%!TEX root
if--root
is supplied, but is it necessary? There's no need to supply--root
if the directives are present.