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 use minted from subfolder #172

Closed
hagen93 opened this issue Jul 21, 2017 · 3 comments
Closed

Can't use minted from subfolder #172

hagen93 opened this issue Jul 21, 2017 · 3 comments

Comments

@hagen93
Copy link

hagen93 commented Jul 21, 2017

It looks like minted doesn't recognize that it is being used from within a subfolder, e.g. when importing a file with the import package it looks like pygments is still outputting its processed files to the root directory while the IfFileExists/input commands (minted.sty line 101/102) looks for them under the current directory. See attached tarball for minimum viable example of this bug.

test.tar.gz
Compiled with: latexmk --shell-escape -pdf main.tex < /dev/null

@hagen93
Copy link
Author

hagen93 commented Jul 21, 2017

Problem seems to be absent when using the subfiles package instead of import by the way

@gpoore
Copy link
Owner

gpoore commented Jul 21, 2017

minted does everything based on the root document directory, so it is incompatible with the import package's starred commands, like the \import*{sub/}{sub.tex} in the sample document. The starred commands only look for input in the subdirectory. However, the unstarred commands (\import{sub/}{sub.tex}) also look for input further up the directory tree. Removing the * allows the document to compile without errors.

I can add a note about this to the minted FAQ, but getting things to work with the starred commands probably won't happen. If import provided a way to locally disable its path modifications, then it would be possible to get things to work (but then the starred commands wouldn't really be limited only to the subdirectory). Trying to get minted to work with anything other than the root document directory would introduce a lot of additional complexity.

@hagen93
Copy link
Author

hagen93 commented Jul 21, 2017

Yeah, I suppose just adding a note about it is the best then. As I said above the subfiles package seems to be compatible (as far as I can see), so my solution was to just switch to that one. =)

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

No branches or pull requests

2 participants