On 04/04/2011 5:32 PM, Julien Rioux wrote:
On 04/04/2011 3:47 PM, Hellmut Weber wrote:
Hi list,
recently in another post I found the internal LaTeX macro
\input@path
mentioned. Putting this (surrounded by \makeatletter and \makeatother)
in an ERT eventually gives me the correct path to my LyX document as
string in the document.
Soooooooo many thanks to the poster of that other message (soem days
ago) !
Here is now my question to the LaTeX gurus:
How can I define a LaTeX macro which gives me the END of the string
delivered by \input@path?
To give a concrete example: When I open document test-01.lyx with LyX in
the directory
/home/leo/leo/Tests/Lyx-Tests/Inputpath/blam
and compile my document it shows the correct path
/home/leo/leo/Tests/Lyx-Tests/Inputpath/blam/
Fine.
What I would like to derive from this string is
/.../Lyx-Tests/Inputpath/blam/ ;-)
See what I mean?
My LaTeX experience told me the need for \makeat...,
but this transformation I'm not able to do in LaTeX.
Any help appreciated
Cheers
Hellmut
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}
\removeprefix{\input@path}
(...will not work with windows-style paths.
If you need that remove the leading / after removeprefixx)
--
Julien