Hi all,

I'm a new user to lyx and totally love it. However, I'm having this
peculiar problem with importing tex files to lyx - tables and cross
references get totally messed up- when I try to import latex files to
lyx, even when the latex file was generated by lyx itself
(export->LaTeX). I encountered this problem while trying to work on my
tex files in both lyx (in linux) and WinEdt( windows). I'm running lyx
1.3.1 under Linux (Redhat 9).

  Has anyone encountered anything like this? I have heard about another
tex importing tool - tex2lyx, should I try to install it? any help here
would be greatly appreciated.

==============================================================

Here's a demo of the problem I'm facing: I create a lyx file
(demo_orig.lyx) with a 2X2 table and export it to latex by using the
pulldown 'export...latex' menu. Both the original lyx file and the
exported tex file are good, they produce perfectly fine output when
compiled. If I now try to import the .tex file created by lyx to lyx
again,i get a screwed up table and cross reference - the latex file
generated when I export this bad import shows the problem clearly

demo_orig.tex - result of export of original lyx file:
-- from here--
%% LyX 1.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

\usepackage{babel}
\makeatother
\begin{document}

\section{Section\label{sec:demo_section}}

%
\begin{table}
\begin{tabular}{|c|c|}
\hline 
1&
2\tabularnewline
\hline
\hline 
3&
4\tabularnewline
\hline
\end{tabular}


\caption{demo table}
\end{table}


here I'll refer to the current section - \ref{sec:demo_section} 
\end{document}

-- till here --






Now import this latex file to lyx, get a file with screwed up tables and
cross reference. Export this file to latex again to see the code: this
is what it generates:








-- latex export of bad import: starts here  --
%% LyX 1.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

\usepackage{babel}
\makeatother
\begin{document}

\section{Section\label{sec:demo}section\}}

%
\begin{table}
\begin{tabular}{|c|c|}
\hline 
1&
\tabularnewline
\hline
&
\\
2\\
3\\
4 \tabularnewline
\hline
\end{tabular}


\caption{demo table}
\end{table}


here I'll refer to the current section - \ref{sec:demo}section\}
\end{document}
-- end here --



thanks,

Prabir



-- 
Prabir Barooah <[EMAIL PROTECTED]>
ECE @ UCSB

Reply via email to