Mr. Karger:

Here are the answers to your questions.

(1) Here are the locations of the executables:

    $ which lyx
    /usr/bin/lyx

    $ which reLyX
    /usr/local/bin/reLyX

(2) reLyX executable is attached.

(3) The extra line says:

    System lyxdir is /usr/local/share/lyx and personal is
/home/mzimmerm/.lyx

Hope this helps. By the way, I didn't post the message that originated
the earlier thread discussing this issue, I just encountered exactly the
same problem. I apologize for the misunderstanding.

Thank you for your help, and please let me know if there's anything else
I can do.

Matt Zimmerman




Amir Karger wrote:
> 
> On Mon, Apr 23, 2001 at 05:19:12PM -0400, Matt Zimmerman wrote:
> > I'd like to follow up on a thread that was begun on February 13
> > regarding a problem importing LaTeX files.
> >
> > As I mentioned, this was reported in an earlier posting. There was one
> > repsonse, but the thread seemed to stop short of resolving the problem.
> 
> That's because you never responded to my post.
> 
> > The follow-up to the initial posting may be found in the archive at this
> > URL:
> >
> > http://www.mail-archive.com/[email protected]/msg19251.html
> >
> > Anyway, I know nothing of Perl and I would be grateful for some more
> > detailed instructions for correcting this problem. Let me know if more
> > information is required.
> 
> OK. The problem seems to be that reLyX is looking in the wrong directories,
> so it never finds the right files. But I don't know the exact reason so I
> can't fix the problem quite yet. Please do the following:
> 
> (1) type "which reLyX" and "which LyX" so we know where your executables
> are.
> 
> (2) Attach your reLyX executable to your next email. It should tell us which
> directories it's going to look in.
> 
> (3) Put the following line into the file
> /usr/local/share/lyx/reLyX/ReadCommands.pm at line 257:
> 
>     print "System lyxdir is $main::lyxdir and personal is $main::dot_lyxdir\n";
> 
> Indentation and whitespace don't really matter, and it doesn't matter if
> you're a line to high or low.  Then rerun reLyX and tell me what the extra
> line says.
> 
> OK?
> 
> -Amir Karger
#!/usr/bin/perl
# This file is part of reLyX
# Copyright (c) 1998-9 Amir Karger [EMAIL PROTECTED]
# You are free to use and modify this code under the terms of
# the GNU General Public Licence version 2 or later.

############################# reLyX wrapper
use strict;
use File::Basename;
$^W = 1; # same as 'perl -w'

# Variables to make global, so subroutines can use them
use vars qw($lyxdir $lyxname);

my (@maybe_dir);
my $mainscript = "reLyXmain.pl"; 

# Do this in a BEGIN block so it's done before the 'use lib' below
BEGIN{
# This points to LyX library dir, e.g. /usr/local/share/lyx
$lyxdir = "/usr/local/share/lyx";
# This is just "." if you compiled from the source directory
my $srcdir = ".";
# This is the name of the program, usually just "lyx"
$lyxname = "lyx";
# The name under which reLyX was invoked
my $name = $0;
# resolve any links to dirname
while (defined (readlink($name))) {$name = readlink($name)};
my $dir = &dirname($name);

# Create a list of possible directories to look in. Non-existent directories
#    are OK, but empty or undefined values will make 'use lib' complain
my $i = 0;
# case 1: for developers, e.g. - reLyX and $mainscript in same directory
$maybe_dir[$i++] = ".";
# case 2: environment variable LYX_DIR_11x has been set
if (exists $ENV{LYX_DIR_11x}) { $maybe_dir[$i++] = "$ENV{LYX_DIR_11x}/reLyX"};
# case 3: ran make but not make install.
$maybe_dir[$i++] = "$dir/$srcdir";
# case 4: e.g., reLyX in /opt/bin, $mainscript in /opt/share/lyx/reLyX
$maybe_dir[$i++] = "$dir/../share/$lyxname/reLyX"; # case 4
# case 5: configure figured out where $mainscript is
$maybe_dir[$i++] = "$lyxdir/reLyX";
} # end BEGIN block

# Now put those directories into @INC
use lib @maybe_dir;

# Now run the script. Perl will look in @INC to find the script (and
#     other modules that $mainscript calls)
require $mainscript; # require includes and runs the code...

exit;
############################ end reLyX wrapper

Reply via email to