Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

Word2LyXMacro

Categories: MSWord, import, Tool
<< | Page list | >>

This pages provides a way to convert a Microsoft Word document to LyX format.

Table of contents (hide)

  1.   1.  A macro to help converting Word documents to LyX format
    1.   1.1  Features
    2.   1.2  Macro installation
    3.   1.3  Macro usage
    4.   1.4  File and contents
    5.   1.5  Contributors
    6.   1.6  Categories

1.  A macro to help converting Word documents to LyX format

In order to inspect the content and structure of a Word document, it may be best to use Word tools. After all the document author meant the structure of his/her document in the MSWord interface, so let's keep the LyX WYSIWYM philosophy and we might be able to get more details about the document content for a better conversion.

You will find here a MSWord macro that builds a LyX 1.3 document from a Word document (LyX 1.5 reads it of course perfectly).

It is very helpful either when you are used to Word and want to quickly start a document and later on convert it to a LyX or when you need to integrate parts of a document on which you do not have the control and that comes in the Word format

1.1  Features

This has been built in MSWord2000 and successfully ported to MSWord2007.

It is able to deal with the following document items:

  • Headings Styles (based on Word built in styles Heading 1 to Heading 4)
  • Tables
It transforms tables and keeps column relative width in order to fill the page width
  • Some document properties (Title and Author)
  • Bullets and Numbering including nesting
  • URLs
  • If a TOC is found, it is inserted in the target document
  • Font series in Normal style (Italic, Bold)
  • Minor support for font colors (converts plain red characters, blue and green available in the basic Word 2007 color palette)
  • Images that are embedded in the Word doc as links to external image files.

Note that it does not support Math formulas

1.2  Macro installation

The Macro is embedded in a .dot file. Just open the template file and you will get access to the commands.

1.3  Macro usage

  1. In Word before 2007: Tools > Macros. In Word 2007 View Pane > Macro button
  2. Select the macro called ConvertToLyx
  3. Let it run: it finally saves it into a document of same name with .lyx extension
  4. Close the document when the activity stops and you see that the document in word has a .lyx extension
  5. Open it with LyX

The macro does not ask for any input and therefore produces a rather restricted output document (but its code is rather simple to tune to you needs)

It will heavily manipulate your document and

Make sure you have a copy of your document before proceeding: this is beta, though behaving very well.

1.4  File and contents

<resource file>
the arcive contains:

  • a .dot file containing the macro
  • a document that was used for testing the conversion
  • an image file that is pointed to by the previous document

1.5  Contributors

  • Damien Boucquey

1.6  Categories

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2008-07-22 10:28 UTC