Thanks Georg, I hope we'll eventually get somewhere.

On 08/26/2015 04:42 PM, Georg Baum wrote:
What do others think? Should we remove the second slash? I tend to say yes,
since I could not find any documentation about it.

I suspect the other slash was added as a bug fix for those OS's that do not have it at the end of the path, can't see any other reason.
So I suppose this should be tested on OSX and Windows as well.



Well, the code is programmed like that on purpose to be on the safe side.

I understand the intention, but I don't think that's the right solution for this case. It's just that you can't feed this
{\string "/home/user/di rectory/\string "/file name.bib}
to any, let's call it, "file=" option without fully expanding first, and then you're back to what you tried to avoid.

In addition, biblatex doesn't seem to recognize quoted paths and the quotes have to be stripped off.

P.S. From what you said below, I now see that \input@path list was not meant to be used in this way, however it's still the only method of obtaining the absolute paths we have.




But one can always add the quotes, I assume, before using the command.
Of course you can do that. However, if you look how \input@path is used
by LaTeX packages




Hm... I thought \input@path was just a command being added by LyX at the
compilation time for its own purposes. Isn't it? What LaTeX packages use
\input@path?

No, LyX did not invent \input@path. In my texlive installation, it occurs 87
times


Hm, yeah. I can see that. I don't know exactly when and what it's used for, though. LaTeX alone does not set it to any particular path.


This, for example,


\documentclass{article}
\begin{document}
\makeatletter
\texttt{\meaning\input@path}
\makeatother
\end{document}

doesn't seem to have it defined, \input@path is only there when you compile it from LyX. A few random pages from the web made me think one has to define \input@path oneself, and this will be the last resort for LaTeX, but no other supporting processors, to look for the files.



The curly braces are not unnecessary. They are required by LaTeX (see the
explanation in $TEXMFDIST/tex/latex/base/texsys.cfg)

OK, I see... \input@path is a LIST of directories. But then, what additional protection the quotes (are supposed to) give if the whole thing within {} will be parsed as an entity anyway? There's unfortunately no mention of the quotes or paths with spaces in texsys.cfg.



This is not how \input@path is supposed to be used. I suggest to try this
instead:

\filename@parse{file name.bib}
\addbibresource{\filename@area\filename@base\filename@ext}


I wish this was true, but no... \filename@parse only *parses* (no search involved) its argument for the three parts, and it does it in a very primitive way.


\documentclass{article}
\begin{document}
\makeatletter
\filename@parse{/home/user/doesn.t exist/test v2.1 new.bib}
\texttt{\meaning\filename@area}

\texttt{\meaning\filename@base}

\texttt{\meaning\filename@ext}

\texttt{\meaning\input@path}
\makeatother
\end{document}


check: http://tex.stackexchange.com/questions/39634/how-to-trim-tex-for-each-filename-read-from-an-external-file


Since the way \input@path is being used in the biblatex hack from http://wiki.lyx.org/BibTeX/Biblatex is barely legal, maybe LyX should define its own command, say \LyX@basepath that'd contain the absolute path to the master .lyx document (no qoutes, no curly braces - only for the brave). Would you be willing to do that? (being that biblatex support is nowhere on the horizon yet)



(when the documents are exported to LaTeX \LyX@basepath should still be defined, but can be simply ./)





\filename@parse searches the file, trying all directories in \input@path,
and then defines the three variables \filename@area (contains the
directory), \filename@base (contains the base name), \filename@ext (contains
the extension).





That's why, I think, \input@path should contain no quotes, and whoever
uses it should be aware that the qoutes are (or might be) missing. Of
course, we should all check if quotes in the file name mean anything to
LaTeX, i.e. is the string within the quotes treated as an entity.

These checks have been done already (although one could retest whether the
results are still valid after 10 years), see the wiki page.


My tests show, let's note it, that quotes don't work with biblatex and the quoted path is never found.




Reply via email to