On 04/04/2011 5:54 PM, Richard Heck wrote:
On 04/04/2011 05:32 PM, Julien Rioux wrote:
kludge solution, if you know how deep your paths are:
\def\removeprefixx/#1/#2/#3/#4/#5{Your path is /.../#5}
\def\removeprefix#1{\expandafter\removeprefixx#1}
Can you explain the point of the \expandafter? I see this often, but
don't understand it.
rh
\expandafter\foo\bar tells TeX to expand \bar before expanding \foo
in this case:
first,
expand \input@path to /home/leo/leo/Tests/Lyx-Tests/Inputpath/blam
second,
parse /home/leo/leo/Tests/Lyx-Tests/Inputpath/blam using /#1/#2/#3/#4/#5