-
Notifications
You must be signed in to change notification settings - Fork 165
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
pdfpages cannot include paths with a .
#50
Comments
Ah, whoa! I didn't think this would be a problem but it seems that it is. Here's my test case:
Where I'd think that such a path would get passed directly to the FilesystemIo backend where it ought to work to open it, so this will take some digging. |
The solution to this may be identical to the solution to #31. |
Wow, I learned a lot about TeX trying to figure this out. Solution is at the end, but I wanted to share my struggle :) So it turns out that the correct file name is passed to tectonic, and tectonic has no problem opening it. However the latex code in
everything works fine. If I use I was trying to find a problem in the The fact that \def\Ginclude@graphics#1{%
\begingroup
\let\input@path\Ginput@path
\filename@parse{#1}%
\ifx\filename@ext\relax
\@for\Gin@temp:=\Gin@extensions\do{%
\ifx\Gin@ext\relax
\Gin@getbase\Gin@temp
\fi}%
\else
\Gin@getbase{\Gin@sepdefault\filename@ext}%
\ifx\Gin@ext\relax
\@warning{File `#1' not found}%
\def\Gin@base{\filename@area\filename@base}%
\edef\Gin@ext{\Gin@sepdefault\filename@ext}%
\fi
\fi
...
\ifx\filename@parse\@undefined
\def\reserved@a{./}\ifx\@currdir\reserved@a
\typeout{^^JDefining UNIX/DOS style filename parser.^^J}
\def\filename@parse#1{%
\let\filename@area\@empty
\expandafter\filename@path#1/\\}
\def\filename@path#1/#2\\{%
\ifx\\#2\\%
\def\reserved@a{\filename@simple#1.\\}%
\else
\edef\filename@area{\filename@area#1/}%
\def\reserved@a{\filename@path#2\\}%
\fi
\reserved@a}
\else\def\reserved@a{[]}\ifx\@currdir\reserved@a
... So it first checks if \IfFileExists{./texsys.aux}{\gdef\@currdir{./}}%
{\IfFileExists{[]texsys.aux}{\gdef\@currdir{[]}}%
{\IfFileExists{:texsys.aux}{\gdef\@currdir{:}}{}}}
\ifx\@currdir\@undefined
\global\let\@currdir\@empty
\typeout{^^J^^J%
!! No syntax for the current directory could be found^^J%
}%
\fi So there it is, LaTeX checks if file Since So the solution is to implement a proper path normalization in In fact, the following hack works:
let name = if name == OsStr::new("./texsys.aux") {
OsStr::new("texsys.aux")
} else {
name
};
|
Very impressive detective work! I think I prefer a more general change to have MemoryIo strip off
Note that one policy that I want to clarify is that Tectonic will always use Unix-style path names when parsing paths in TeX documents, even when running on Windows — you don't want the interpretation of the document to be platform-dependent. |
Thank you for the clarification about the path policy. In that case, tectonic should probably not internally store paths (for In any case, |
struct cleanups
I'm using the
pdfpages
package to include other pdf files. It seems like Tectonic can't handle paths with a.
or..
in them, while pdflatex can. Quite minimal example:some.tex:
test.tex:
In this example, the
some.pdf
is in the same directory as the test.tex. Note that using pathsome.pdf
instead of./some.pdf
will work. I get the similar exceptions when:some.pdf
in the directory above and use../some.pdf
to include it.subdir
and usesubdir/../some.pdf
.Exception:
The text was updated successfully, but these errors were encountered: