PhilipPirrip wrote:

> On 08/19/2015 04:44 PM, Georg Baum wrote:
>> PhilipPirrip wrote:
>>
>>> Why does \input@path end with two slashes, as in
>>> /home/user/directory//
>>
>> IIRC this means that also sub directories are searched, but this should
>> be documented in some TeX or LaTeX docs.

I did some reserach, and could not find any LaTeX docs about double slashes. 
What I know is that one slash is definitely needed, and that these double 
slashes at the end do exist at least since LyX 1.2. I don't have older 
sources on my disk, and unfortunately I am too stupid to use git blame on 
older revisions, so I don't know when this was introduced. Maybe it was by 
accident?

>>> and why is its output
>>> "/home/user/dir ectory/"/
>>> (note quotation marks, and two separate ending slashes) when the folder
>>> name contains spaces?
>>
>> Wiothout quotes only the part before the space would be used. I believe
>> that the second slash is not included in the quotes since it is only a
>> special marker (see above).
> 
> 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, then you see that this is not done: If they are well written 
then they use \filename@parse from $TEXMDIST/tex/latex/base/latex.ltx to 
expand file names, and I could not see any quotes adding there.

> You'll almost certainly have to add a file name at the end of the path,
> and then you're in trouble.

Can you give an example? I made some tests. I created a directory named "dir 
with space", then put all three attached files in there, and then tried to 
view different formats. Result:

PDF (pdflatex): works fine
Postscript: Does not work: 

dvips: Unknown keyword (with) in \special will be ignored
dvips: Unknown keyword (space/"/./escher-lsd.eps") in \special will be 
ignored
dvips: Could not find figure file /home/xxx/dir; continuing.

These results did not change if I removed the second slash after the double 
quote. However, the double quotes are needed: After removing them, neither 
pdflatex not dvips find the graphics file.

> Look at the answers here for removing the quotes:
> http://tex.stackexchange.com/questions/259015/one-liner-for-removing-characters-from-a-string

IMHO removing the quotes is a workaround if you don't want to (or can't) 
change LyX. I am more interested in how LyX should behave ideally.

> At least for biblatex (and biber), the path doesn't have to include any
> quotes.

Please give an example how to use biblatex and biber with paths including 
spaces and \input@path.

>> As you already found out \input@path does not work in several cases,
>> therefore LyX changed to use TEXINPUTS. If biber does not work with
>> either mechanism then please report this to the biber people.

Correction: TEXINPUTS is still used, but \input@path is used in addition, 
since relative paths starting with ./ or ../ do not work with TEXINPUTS.

> There are BIBINPUTS in that case,
> http://tex.stackexchange.com/questions/67205/use-bibinputs-to-specify-other-location-for-bib-file
> so I still have to report to the LyX people (who did a great job
> otherwise)

BIBINPUTS is indeed not set by LyX. Searching the bugtracker shows that 
there is already a quite old enhancement request about that (which I 
completely forgot): http://www.lyx.org/trac/ticket/2645

I think it would be good to add a biblatex/biber test case there, so that 
this can be considered when a fix is implemented.


Georg

Attachment: inputpath.lyx
Description: application/lyx

Attachment: escher-lsd.pdf
Description: Adobe PDF document

Reply via email to