Go to page:

Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

FAQ /

ImportingFromSWP

Categories: Compatibility, Windows
<< | Page list | >>

<How to import documents from Scientific Word/Scientific Workplace (SWP) into LyX.>

Importing Scientific Word/Scientific Workplace (hereinafter SWP) .tex files into LyX is relatively straightforward. The particular procedure that works as of 22 December 2007 (LyX 1.5.3) is provided below.

Before proceeding, one should consider the issue of included graphics files. One of the allures of SWP, working under MS Windows, has been the ready cutting-pasting of Windows metafiles (.wmf, .emf) via the clipboard, out from some application, as figures into one's document. This, plus punching out the final PDF, could be done without the aggravation of first putting figures into EPS (encapsulated postscript) format, as is the standard handling practice for most other LaTeX setups. With the advent of LyX 1.5 and the contributed metafile2eps utility, one can continue this lazy practice, as the combo will auto-render .wmf that are included in the document, and auto-convert to EPS when time for PDF output.

However, metafile2eps is also great as a standalone utility for converting .wmf into EPS. If one collaborates with others possessing vanilla LaTeX setups and/or on linux, one will need to exchange figures in EPS format. So undertaking such conversions up-front is likely advisable.

STEPS to Convert SW/SWP .tex to LyX .lyx

If not done already, install the *free* MetafileToEPSConverter, per:

    <http://wiki.lyx.org/Windows/MetafileToEPSConverter>

I. In SWP, File>SaveAs Portable LaTeX.

   This will employ, for instance, the LaTeX-standard \includegraphics 

directive, and comment-out SWP-specific macros and pragmas. These comment-outs will later show up as harmless ERT (evil red text - embedded TeX commands, but here, merely % comments) in the LyX document. Those can be left alone (harmless), or deleted as desired.

II. Metafile-to-EPS conversion (optional, but recommended) Convert any figures that are windows metafiles (.wmf, .emf) to .eps:

   A. go to c:\Program Files\LyX15\bin,
       -- right-click metafile2eps.exe, and PinToStartMenu
       -- this makes it easy to invoke the program from the Start Menu
   B.
       -- in metafile2eps window: File > Open MetaFile..., then File > Export EPS...
          (you can also use the toolbar icons)

Note that when pasting, the image actually shown in the metafile2eps GUI window may not be the complete figure you were expecting, but don't be alarmed - the complete figure is put to the EPS file intact.

   C.  In .tex file, using a text editor (e.g., WinVi32, WordPad etc) 

search/replace ".wmf" to ".eps", etc.

[This workaround only pertains to LyX 1.5.2 and earlier - bug fixed as of LyX 1.5.3] III. The following is a current bug in the behind-scenes tex2lyx converter program; it will someday get fixed (bug 4418). Meanwhile, here's the workaround: In the .tex file, using a text editor (e.g., WinVi32, WordPad etc) locate all instances of 'natheight hhhuu' and 'natwidth wwwuu', where hhh and www are numbers and uu designates units. Replace both options with the single option 'bb = 0 0 hhhuu wwwuu'. If you are in a hurry, a quicker workaround is to search/replace:

   natheight with %natheight
   natwidth with %natwidth

This eliminates the bounding box definition, which is not a great thing to do in general, but is usually okay.

IV. In Lyx: > Document>Settings>LaTeX Preamble: You may need to change the \usepackage directives to match MikTeX (or whatever LaTeX installation you're employing). For example, there is no such package (at least in MikTeX):

  \usepackage{fancyheadings}

In this case, it's easy to delete this entry in the preamble and find built-in provisions for this functionality under Document>Settings>Page Layout to get what you want.

V. BibTeX Bibliography: For converted .tex files that included a BibTeX bibliography at the end, at the tail of the resulting LyX document, there will be a grey tag labeled "BibTeX Generated Bibliography" - clicking it pops a menu showing the .bib database files and a selectable bib style.

Compatibility Windows

<< | FAQ.PageList | >>

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2008-01-14 20:30 CET