work with spaces in file name #6
Open
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.
Remove double quotes from
\ip@filewith\StrSubstitutefromxstringpackage.I would like to compile a tex file
test 2.texwhich contains:I make the same call that
latexmkmakes:Errors including the following occur (line 378):
It seems
\ip@fileevaluates to"test 2".w18. I believe this first error is becausesh -c 'uname -s > ""test 2".w18"'results only inuname -s > test 2.w18i.e.uname -s 2.w18 > test(inferred fromstrace):Other errors such as the following then occur as a byproduct but I don't understand why--would
\@tempahave a}in it? (line 383):I am using TeX Live. I also get these errors when using LuaLaTeX with minted.
latexmksaysLatexmk: Errors, so I did not complete making targets. It also retries compilation once more for LuaLatex.Rather than try to escape the quotes when calling
unameand so on, I simply removed the quotes from\ip@fileat the top ofifplatform.styby includingxstringand usingStrSubstituteas in this file change.I confirmed that
test 2.w18is created and removed during compilation. This change removed all errors when using regular LaTeX and LuaLaTeX with minted.A cleaner way to fix this may be to instead only replace all
"with'on lines377and379, butCatchFileapparently wipes the two quotation marks either advertently or inadvertently by the time it callsopenat(AT_FDCWD,"/home/user/test dir/test 2.tex",O_RDONLY) = -1 ENOENT (No such file or directory)andaccess, resulting in/usr/share/texmf-dist/tex/latex/ifplatform/ifplatform.sty:96: Package catchfile Error: File '"test 2".w18' not found.. For the case that a user has quotes in their filename, is no point in say only removing the first and last quote if there are spaces in the file name (implying LaTeX added quotes to the jobname), because quotes in a path may create an error from CatchFile anyway.\jobname?latexmk? It seems likemintedis able to use its shell escapes effectively despite them. Is\linuxtruedefault?test 2.pdf,test 2.aux, etc. are all named without quotes around the base file name, how do the other subsystems of LaTeX handle the quotes imposed by\jobnameif they do use\jobname; and what do they use to get the file name if not?