Russell Brunelle (russellb) wrote,
Russell Brunelle

How to create beautiful documents under Windows using LyX

LyX is a free word processing tool which reduces almost to zero the effort necessary to produce documents with an elegant and scholarly appearance. What follows are my recommendations for installing and configuring it under Windows.

Start by installing all of the following:

  1. Adobe Reader, unless you already have a recent version of it. To radically improve display quality, make sure "Smooth Text" in Edit->Preferences->Page Display is set to something other than "None."
  2. LibreOffice together with its Writer2LaTeX export filter. As things stand the best free way to import a word processing document into LyX seems to be to open it in LibreOffice Writer (which can open almost any format including the default format for Microsoft Word 2010), select File->Export->LaTeX2e, choose "Ultra-clean article" as the LaTeX format, unselect "Export document properties," save the file, and finally switch to LyX and open the "tex" file you just exported with File->Import->LaTeX.
  3. Inkscape. Although there are obviously far more popular vector graphics editors for Windows (e.g. Adobe Illustrator), this is the one LyX can call behind the scenes when it needs to convert a vector graphic on the fly.
  4. GIMP, unless you already own Adobe Photoshop or are willing to purchase it. It's almost inevitable that you'll need to edit a photograph at some point, and although there are simpler and less fully-featured programs for accomplishing the same thing, I'm a strong believer in only learning to use tools that you'll never grow out of.
  5. MiKTeX. This is the Windows distribution of the free professional typesetting system which LyX depends on. Install it using the "Basic Installer" rather than the "Net Installer."
  6. JabRef. Learn this tool if you plan to create documents with bibliographies.
  7. LaTeX2rtf. Although ordinarily your completed LyX document would be exported as a PDF file, if you need to permanently turn over editing your document to someone who doesn't use either LyX or LaTeX, then installing this tool will allow LyX to export it as an RTF file: it will lose its elegant layout as well as its fonts, but any word processing software would be able to import it.
  8. LyX. Install it using the "Standard Installer" rather than either the "Alternative Installer" or the "Bundle."

Then, install some or all of the following advanced tools, depending on your needs:

  1. Both TortoiseSVN and the Slik SVN Command Line Client, if you'd like to take advantage of version control for your documents: benefits include the version control repository providing you with a form of backup (particularly if you place it on a different drive than the one you edit your documents on), being able to recover any earlier version of your document no matter how badly you may have mangled the current one, and gaining a skill which is required on a daily basis in many high-tech work environments. Three tips for anyone choosing to implement this: (1) at least through version 2.0.3 of LyX you'll need to install the 1.6.16 version of TortoiseSVN and Slik rather than their latest versions, (2) if you or anyone else will be checking out files from your repository under a non-Windows OS then you should go to TortoiseSVN's General Settings screen and edit the subversion configuration file to both uncomment the "enable-auto-props=yes" line as well as add appropriate "svn:eol-style=native" lines at the bottom, and (3) if you use the popular Notepad++ Windows text editor and plan to store more than just LyX documents in your repository then activate this editor's "Tortoise SVN" plugin.
  2. R with its Rstudio interface, if you ever have need to perform data analysis and visualization beyond what spreadsheet programs are intended for. If you go to a university bookstore today and take a look at the statistics shelves, most of the books which involve any specific statistics programming language at all will use R even for the most advanced topics. Furthermore, R is now deeply entrenched in many important industries. To be perfectly honest, depending on your line of work learning R may be a better use of your time than learning LyX, though since LyX can incorporate R computations and graphics on-the-fly via this mechanism they're obviously a good match.
  3. TrueCrypt, if any of the R data sets you'll be working with contain confidential information.
  4. Graphviz, if you regularly create certain types of diagrams using programs like Microsoft Visio, LibreOffice Draw, or Dia, and are willing to learn a new programming language in the hope of automating the process.

Finally, make the following LyX settings:

  1. Go to Tools->Preferences->Paths. First set "Working directory" to the folder where all of your LyX documents will be kept, then as necessary modify "PATH prefix" to add paths to the appropriate binaries for Inkscape, JabRef, latex2rtf, SlikSVN, R, Dia, and/or Graphviz. By way of example, my complete "PATH prefix" line after I installed everything linked to above was as follows: $LyXDir\bin;$LyXDir\python;$LyXDir\imagemagick;$LyXDir\ghostscript;C:\Program Files\MiKTeX 2.9\miktex\bin;C:\Program Files\SlikSvn\bin;C:\Users\Russell\AppData\Roaming\JabRef 2.7.2;C:\Program Files\latex2rtf;C:\Program Files\Inkscape;C:\Program Files\Graphviz 2.28\bin;C:\Program Files\Dia\bin;C:\R\R-2.14.2\bin\i386
  2. If you'll be exporting in RTF format (for subsequent import into Microsoft Word) any LyX documents which contain equations, then go to Tools->Preferences->File Handing->Converters and remove the "-p" and "-S" switches from the command which invokes latex2rt.
  3. If you use US Letter size paper, then make sure this is the setting in Tools->Preferences->Output->LaTeX.
  4. Open a new LyX document. Go to Document->Settings->Fonts and change Roman to Latin Modern Roman, Sans Serif to Latin Modern Sans, and Typewriter to Latin Modern Typewriter, and then click on "Save as Document Defaults." Next, if you use US Letter size paper, go to Document->Settings->Page Layout to confirm this is the case (once again clicking on "Save as Document Defaults" if you needed to change it).
  5. Run Tools->Reconfigure, then quit and restart LyX: both of those actions are required in order for some of the changes you made above to become effective.

If you're ever asked to produce something in double-spaced 12 point text (a common request even though the result is never that attractive), you can do so by changing Line Spacing to Double in Document->Settings->Text Layout, and entering "12pt" as a Custom Class Option in Document->Settings->Text Layout.

In closing, I think it's worth noting that essentially everything linked to in this guide is both free of charge and available in identical form for Linux: the only two exceptions (both of which are still free but not available for Linux) were Notepad++, for which Bluefish would be a good substitute, and TortoiseSVN/Slik, for which you would simply substitute your Linux distribution's standard "subversion" package.

Although installing and learning to use everything described above might take a few hours, it's interesting work which produces satisfying printed results, and particularly for students preparing for college in engineering or science I'm confident it would be time well spent.
Comments for this post were disabled by the author