#LyX 1.1 created this file. For more info see http://www.lyx.org/ \lyxformat 2.16 \textclass article \language default \inputencoding latin1 \fontscheme pslatex \graphics default \paperfontsize 12 \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Title Mif2lyx: Convert FrameMaker MIF files to LyX \layout Author Pablo Funes \layout Date pablo@cs.brandeis.edu \layout Section Introduction \layout Standard I decided to migrate from FrameMaker to LyX. The Linux FrameMaker demo is expiring on December 31, 2000 and their versions for other platforms are so expensive, it is time to move on. \layout Standard I hacked this Perl converter from MIF files to LyX --- originally to \latex latex \backslash LaTeX \latex default also but at some point I dropped the \latex latex \backslash LaTeX \latex default version and just kept the LyX one. \layout Standard It works by translating your FrameMaker styles into their equivalent LyX styles. That's the whole idea. It does not convert math formulas (wherever you had a formula, it will appear as \begin_inset Formula \( a=a \) \end_inset on the LyX document): Sorry. \layout Standard Mif2lyx does a good attempt to convert tables, and figures. To convert pixmap formats it calls \begin_inset Quotes eld \end_inset convert \begin_inset Quotes erd \end_inset , the excellent command that's part of the ImageMagick package. All figures and tables are put into floats. \layout Standard Mif2lyx is just a hack --- but it gets the job done for me. Please notify me if you make any cool improvements. \layout Section Pre-Requisites \layout Standard Mif2lyx is Perl, so you need Perl. Also you need the module mif2lyx by Earl Hood, ehood@pobox.com. Available from CPAN, http://www.cpan.org. \layout Standard To convert images, mif2lyx calls ImageMagick's convert. http://www.imagemagick.org. \layout Section Invocation \layout LyX-Code mif2lyx [-d] [-2] file[.mif] (file...) \layout Standard Switches: \layout Description -d Debug mode. Mif2lyx prints lots of info telling you all it's doing. \layout Description -2 Two-pass mode. Sometimes you need to make two passes to load all text boxes that are reference d on the MIF source before being defined. The two pass mode will find the reference on the first pass, then insert it on the second pass. \layout Section The .m2l file \layout Standard Mif2lyx doesn't know about the definition of styles in a FrameMaker document. It will just ignore them. Instead, you must supply a table of equivalences. Table \begin_inset LatexCommand \ref{one} \end_inset lists the defaults. \begin_float tab \layout Standard \added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable multicol5 16 2 0 0 -1 -1 -1 -1 1 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 8 1 0 "" "" 8 1 1 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" FrameMaker style \newline LyX layout \newline Body \newline Standard \newline Bulleted \newline Itemize \newline CellBody \newline \series bold none \series default \newline CellHeading \newline \series bold none \series default \newline Footnote \newline Standard \newline Heading1 \newline Section \newline Heading2 \newline Subsection \newline HeadingRunIn \newline SubSubsection \newline Indented \newline Quote \newline Numbered \newline Enumerate \newline Numbered1 \newline Enumerate \newline TableFootnote \newline \series bold none \series default \newline TableTitle \newline \series bold none \series default \newline Title \newline Title \newline Emphasis (fontstyle) \newline \series bold emph \layout Caption \begin_inset LatexCommand \label{one} \end_inset Default Styles \end_float \layout Standard Mif2lyx expects to find a companion .m2l file to every .mif file. Otherwise, it will attempt to create a default .m2l file (fig. \begin_inset LatexCommand \ref{fig.2} \end_inset . You usually have to modify this .m2l file to suit your FrameMaker document. All FrameMaker styles used on your MIF document but not defined on the .m2l file will be treated as \series bold none \series default and print an error message. \begin_float fig \layout Standard \family typewriter \size footnotesize Body=standard \layout Standard \family typewriter \size footnotesize Bulleted=bulleted \layout Standard \family typewriter \size footnotesize CellBody=invisible \layout Standard \family typewriter \size footnotesize CellHeading=invisible \layout Standard \family typewriter \size footnotesize Footnote=standard \layout Standard \family typewriter \size footnotesize Heading1=section \layout Standard \family typewriter \size footnotesize Heading2=subsection \layout Standard \family typewriter \size footnotesize HeadingRunIn=subsubsection \layout Standard \family typewriter \size footnotesize Indented=quote \layout Standard \family typewriter \size footnotesize Numbered=enumerate \layout Standard \family typewriter \size footnotesize Numbered1=enumerate \layout Standard \family typewriter \size footnotesize TableFootnote=invisible \layout Standard \family typewriter \size footnotesize TableTitle=invisible \layout Standard \family typewriter \size footnotesize Title=title \layout Standard \family typewriter \size footnotesize f.emphasis=FAngle.Italic \layout Caption \begin_inset LatexCommand \label{fig.2} \end_inset Default .m2l file \end_float \layout Subsection Editing the .m2l file \layout Standard The .m2l file consists of lines with a FrameMaker paragraph style name followed by an equal sign, or a FrameMaker character style name preceded by \begin_inset Quotes eld \end_inset f. \begin_inset Quotes erd \end_inset and followed by the equal sign. The right side of the equal sign tells mif2lyx what to do, and it's either a mif2lyx style name or a MIF font style definition. \layout Standard Most Mif2lyx styles are just LyX styles, only with lowercase names. But some of them are special. The following mif2lyx styles translate directly into LyX styles: \layout Quote section, subsection, subsubsection, section*, subsection*, subsubsection*, caption, author, title, abstract, standard, quote, comment, date, bibliography, itemize, lyx-code, enumerate \layout Subsection \begin_inset Quotes eld \end_inset Special \begin_inset Quotes erd \end_inset styles \layout Description tt Use this style to introduce a typewriter font \layout Description none Also called \series bold invisible, \series default this style copies the text without introducing a new style \layout Description noprint Ignore all text in this style \layout Description centering Centered paragraph \layout Description bibtex Inserts a BibTeX reference. \layout Subsection Font styles \layout Standard Unfortunately, we are defining this with MIF notation. Here's a list of supported MIF styles. \layout Description Fposition.FSuperscript Superscript. LyX doesn't really support superscript. It works sometimes by introducing a little math formula. Same for \series bold Fposition.FSubscript. \layout Description FWeight.Bold Bold \layout Description FAngle.Italic Italic \layout Description FFamily.Symbol Symbol font \layout Section Bibframe Support \layout Standard I use \series bold Bibframe \series default to introduce references on FrameMaker. Bibframe introduces BibTeX citations by means of variables called \begin_inset Quotes eld \end_inset cite-referencename \begin_inset Quotes erd \end_inset . Mif2lyx will translate this into the corresponding citation reference. \layout Section Graphics and Figures \layout Standard Anchored frames in FrameMaker become floats in LyX. But sometimes you might want to have just figures without the floats. This is easy to change in the code but I haven't introduced it as an option. \layout Standard Figures embedded in a FrameMaker document are not understood by Mif2lyx, of course. Only those \emph on referenced \emph default within FrameMaker will be converted. You should never embed figures in a document, FrameMaker or otherwise. Always introduce as references. \layout Standard Anyways, referenced figures are copied into a \begin_inset Quotes eld \end_inset graph \begin_inset Quotes erd \end_inset subdirectory created for the purpose. \layout Standard Files with extensions: \series bold ps, eps, epsi, PS, EPS \series default and \series bold EPSI \series default are not copied, only referenced by symbolic links on the graph subdirectory. Windows users will need to modify this code, probably, for Windows doesn't have symbolic links, does it? \layout Standard A conversion is attempted for all others. The command \begin_inset Quotes eld \end_inset convert \begin_inset Quotes erd \end_inset is executed which converts jpegs, gifs, tiffs, etc. to encapsulated postscript if you have ImageMagick's \series bold convert \emph on \series default \emph default program in your path! \layout Section Conclusions \layout Standard Mif2lyx was useful, for me. Good Luck! \layout Date Oct 26, 2000 \the_end