Andre Berger wrote:

> Hi,
> 
> I'm looking for any variables that could help me splitting the path
> to a LyX document into a) the directory the file is in and b) the
> name of the file without the extension ".lyx".
> 
> Background: I'm not happy with latex2html exporting .html files to
> a directory the ".lyx" file is in, but not putting the images in this
> directory. Right now I have
> 
> \converter latex html "rm -rf /tmp/lyx-html 2>/dev/null && latex2html
> --init_file /etc/latex2html.conf $$i && mkdir -p /tmp/lyx-html &&
> chmod 0777 /tmp/lyx-html && cp ../lyx_tmpbuf0/*.{html,*g*}
> /tmp/lyx-html/" ""
> 
> (one line)
> 
> but that is rather bad. What I really want is a directory in the one
> the ".lyx" file is in, make a directory named after the file (w/o
> ".lyx"), and have the complete HTML structure in this directory.
> 
> -Andre

You can hide this nastiness and ultimately end up with something more robust 
if you write a shell script to wrap all this up.

To answer the specific questions: try this shell script

#! /bin/sh
test $# -eq 1 || {
        echo "Usage:"
        echo "sh $0 <file_with_path>"
        exit 1
}

dir=`dirname $1`
base=`basename $1 .lyx`

echo "Directory is $dir
echo "File base is $base"

-- 
Angus

Reply via email to