On Fri, Jul 30, 2010 at 11:22 AM, Richard Heck <rgh...@comcast.net> wrote:
> On 07/30/2010 11:16 AM, David Hopkins wrote:
>>
>> On Fri, Jul 30, 2010 at 10:58 AM, Richard Heck<rgh...@comcast.net>  wrote:
>>
>>>
>>> On 07/30/2010 10:25 AM, David Hopkins wrote:
>>>
>>>>
>>>> If I export an OOo document using writer2latex.oxt, it outputs a tex
>>>> file which has all the necessary tex/latex commands to compile
>>>> directly. However, I'd like to then import that document into LyX.  My
>>>> issue is that I seem to need to create a layout that uses everthing
>>>> between the \documentclass and \begindocument in the tex file?  I've
>>>> tried reading notes on the wiki and searching this list but I have not
>>>> understood what I need to do.  For instance, if I have a very simple
>>>> document (just a line of text), writer2latex.oxt produces the
>>>> following, but I can't just import this into LyX. If someone can point
>>>> me at the correct tutorial on how to 'split out' this document so that
>>>> it can be used with LyX, I'd be very grateful. Note: My actual
>>>> document has \usepackage, \newcommand, etc but I'm assuming the
>>>> process for something simple like the following would apply for a more
>>>> complicated document as well.
>>>>
>>>>
>>>>
>>>
>>> I'm not sure I understand the problem. I just imported the document into
>>> LyX
>>> (File>Import>LaTeX). It's attached, and it compiles just fine. All the
>>> preamble stuff just ends up at Document>Settings>LaTeX Preamble. Most of
>>> that is junk that can just be deleted anyway. Why writer2latex insists
>>> upon
>>> setting footskip, e.g., is pretty unclear.
>>>
>>
>> Hmmm ... you're right.  I guess that is what happens when I try to
>> send the simplest example I can put together.  I'm not sure how to
>> send a better example e.g. writer2latex's user-manual.odt exported
>> using writer2latex's filter. It does not work if I simply import it
>> into LyX.
>>
>>
>
> What sort of failure do you get?
>
> I have generally found that things like writer2latex produce really ugly
> LaTeX, and that is likely to confuse tex2lyx. Not to mention that your
> document will be littered with ERT. My experience was mostly with wp2latex
> (for WordPerfect), and I ended up writing a sed script that went through and
> cleaned up the file in various ways. If I had it to do again, I'd probably
> do it in Perl or Python, but you get the idea.
>

There are two issues:

1) if I use writer2latex and get the 'ugly' LaTex. The first error is
a misplaced \noalign in a table which seems to cascade into a lot of
other errors.

2) the second concerns an in-house tex template that is used for
internal reports. I can use Texworks, open the file, add text,
equations, tables, and such without issues. I can also use WinEdt (on
a PC) with the tex file and it works as well.  However, importing this
tex file into LyX fails miserably.  LaTex preamble seems to capture
everything before the begin{document}, but LyX can't create the
document.  The first issue seems to be the use of

\def\PREPARETYPE {\MYTR} where MYTR is later defined via

\newcommand{\MYTR}{
  \documentclass{myarticle}
  \usepackage{boxhandler}
  \def\MandatoryDL{MY.dls}% Mandatory Distribution List File
  \def\UserDL{mystencil.dls}%User Distribution List File
  \addtolength{\cftfignumwidth}{0.0ex}%Extend width of lof label if using
%appendix figures .OR. > 99 figures
  \addtolength{\cfttabnumwidth}{0.0ex}%Extend width of lot label if using
%appendix figures .OR. > 99 figures
  \def\CaptionJustification{\raggedright}
  \usepackage[T1]{fontenc}
  \usepackage{times}
}

%insert another \newcommand for a different TYPE here ... not included
in this email

\PREPARETYPE%

I get errors about having multiple documentclass definitions.  If I
simply remove the documentclass, I still get errors about
\addtolength, and others.  boxhandler is found  as are the other LaTex
classes and styles that are referenced which were added to my local
texmf directory and texhash was run, at least LyX shows them under Tex
Info.  I'm trying to convert the template to work with LyX although it
does show up with a lot of TeX commands embedded in it. (lots of red
sections).

Sincerely,
Dave Hopkins

Reply via email to