On Mon, 5 Jun 2000, Amir Karger wrote:

>                 $newfile = "$basename.lyx";
>             } else { # keep relative path, e.g. Just change suffix
> -               ($newfile = $fil) =~ s/$suffix/.lyx/;
> +               ($newfile = $fil) =~ s/$suffix$/.lyx/;

Well, in my opinion this is the right place, also the fix is right, the only
problem is that $suffix is always empty at this place, as well as
@main::Suffix_List - looks like this variable is not exported.

I have used the following command in my Latex:
 \include{d2}

\include{d2.tex} is incorrect (TEX: "No file d3.tex.tex.") and still gets
translated to "\begin_inset Include \include{d3.tex}"

I have checked that value of $suffix at that place is "".

BTW. Both \input{d2} and \input{d2.tex} are recognized by Latex.

Here goes my version of patch:

diff -Nur reLyX/LastLyX.pm /tmp/reLyX/LastLyX.pm
--- reLyX/LastLyX.pm    Mon Jun  5 14:34:03 2000
+++ /tmp/reLyX/LastLyX.pm       Mon Jun  5 23:41:14 2000
@@ -79,8 +79,8 @@
            my $newfile;
            if ($main::opt_o) { # all files go to outputdir; no path nec.
                $newfile = "$basename.lyx";
-           } else { # keep relative path, e.g. Just change suffix
-               ($newfile = $fil) =~ s/$suffix/.lyx/;
+           } else { # keep relative path, e.g. Just change/add suffix
+               ($newfile = $fil) =~ s/$suffix$/.lyx/;
            }
            s/\Q{$fil}\E/{$newfile}/;
        } # end special if for table, bibstyle, include
diff -Nur reLyX/reLyXmain.pl /tmp/reLyX/reLyXmain.pl
--- reLyX/reLyXmain.pl  Mon Jun  5 14:34:03 2000
+++ /tmp/reLyX/reLyXmain.pl     Mon Jun  5 23:40:19 2000
@@ -27,6 +28,8 @@
             $dot_lyxdir
             $Success
             @File_List
+            @Suffix_List
+            $LyXFormat
           );
 use Cwd; # getcwd etc.
 use Getopt::Std; # read in command-line options
@@ -50,8 +53,8 @@
 use vars qw($lyxdir $lyxname);
  
 # variables that a user might want to change
-my @Suffix_List = '\.(ltx|latex|tex)'; # allowed suffixes for LaTeX file
-my $LyXFormat = "2.15"; #What to print in \lyxformat command in .lyx file
+@Suffix_List = '\.(ltx|latex|tex)'; # allowed suffixes for LaTeX file
+$LyXFormat = "2.15"; #What to print in \lyxformat command in .lyx file
 my $syntaxname = "syntax.default"; # name of the default syntax file
 $dot_lyxdir = $ENV{'HOME'} . "/.$lyxname"; # personal .lyx directory
 


Exporting LyXFormat is not needed, but why not? I have verified that it
translates correctly:

 \include{d2}
 \include{d2.tex}
\clearpage
 \input{d3}
 \input{d3.tex}

TO:

\begin_inset Include \include{d2.lyx}

\end_inset


\begin_inset Include \include{d2.lyx}

\end_inset


\latex latex

\backslash clearpage
\newline

\latex default

\begin_inset Include \input{d3.lyx}

\end_inset


\begin_inset Include \input{d3.lyx}
....


Best regards and many thanks for the program,
--
Tomasz Motylewski

Reply via email to