LyX: The WYSIWYG Path to LaTeX (Part 4 of 6)
The Thesis Series
This is Part 4 of a 6-part series on learning LaTeX and writing my Masters thesis at Oakland University.
- Starting a Thesis: Why I Chose LaTeX Over Word
- Formatting Hell: 19 University Templates and Why LaTeX Wins
- IEEE Citations and BibTeX: Academic References Done Right
- LyX: The WYSIWYG Path to LaTeX (you are here)
- Writing IsoMob: A Cross-Platform Game Engine Thesis
- LaTeX Templates, Final Formatting, and Lessons Learned
- The Finished Thesis: 150 Pages Later
The Raw LaTeX Wall
I’ve spent the summer writing code for IsoMob in HaXe. Switching context from game engine code to raw LaTeX markup is a mental gear-shift. When I’m thinking about isometric transforms and A* pathfinding, the last thing I want is to also be debugging why \begin{figure}[htbp] isn’t placing my diagram where I expect it.
Today I downloaded additional writing reference materials – thesis writing tips, formatting examples, the OU formatting manual. And in the process, I found LyX.
What is LyX?
LyX is a document processor that uses LaTeX as its backend but presents a structured, semi-WYSIWYG editing interface. Instead of writing raw \section{Introduction}, you select “Section” from a dropdown and type “Introduction.” Instead of wrapping text in \textbf{}, you press Ctrl+B. The document on screen looks roughly like the final output – headings appear larger, bold text appears bold, lists appear indented.
But underneath, LyX generates LaTeX. When you export or compile, it produces a .tex file and runs it through pdflatex. You get all the benefits of LaTeX (automatic numbering, cross-references, BibTeX) with a visual editing experience closer to Word.
The LyX file format (.lyx) is its own markup – not raw LaTeX, but a structured representation that maps 1:1 to LaTeX concepts. Here’s what a section heading looks like in a .lyx file:
1
2
3
\begin_layout Section
Introduction
\end_layout
And a paragraph with a citation:
1
2
3
4
\begin_layout Standard
This thesis presents an isometric game engine that can target
multiple platforms with a single code base.
\end_layout
It’s more verbose than raw LaTeX but more readable than a Word binary. And critically, it’s still a plain text file – diffable, version-controllable, and uncorruptable.
Why LyX Over Raw LaTeX
For thesis writing specifically, LyX hits a sweet spot:
Visual Structure
When you’re working on a 1,000+ line document with 9 sections, dozens of subsections, and scattered notes, seeing the visual hierarchy matters. In LyX, Section headings appear large and bold, Subsection headings appear slightly smaller, and Standard text appears as body text. You can visually scan the document and understand its structure without parsing markup.
Inline Math Preview
My thesis involves isometric transforms, physics equations (Euler and Verlet integration), and A* pathfinding formulas. LyX renders math inline as you type it. Instead of staring at x_{screen} = (x - y) \cdot \cos(30°) in raw markup, you see the rendered equation right there in the editor.
Citation Management
LyX has a citation dialog – click “Insert Citation,” search your BibTeX database, select the entry. The citation appears in the text as a clickable reference. It’s more discoverable than remembering that your Craig Reynolds paper is keyed as steeringBehaviors.
Lower Barrier for Focus
The real advantage is cognitive. When I’m writing about wall avoidance algorithms or explaining why HaXe’s type system enables cross-platform compilation, I want to be thinking about that – not about LaTeX syntax. LyX lets me stay in writing mode while still producing LaTeX output.
Setting Up LyX for the Thesis
Getting LyX configured for my thesis required a few steps:
Document Class
LyX uses the article class by default. For a thesis, I configured it with the specific settings OU requires:
- Document class:
article(OU doesn’t use thereportclass convention) - Font encoding: Global
- Spacing: One-and-a-half (the
\onehalfspacingequivalent) - Geometry: Custom margins – 1.5in left, 1in top, 1in right, 1.5in bottom, 0.5in footskip
In LyX, these are set through Document > Settings rather than typing preamble commands. The settings dialog maps directly to LaTeX packages:
| LyX Setting | LaTeX Equivalent |
|---|---|
| Document Class: article | \documentclass{article} |
| Spacing: One Half | \usepackage{setspace}\onehalfspacing |
| Left Margin: 1.5in | \usepackage[left=1.5in,...]{geometry} |
| Use AMS Math | \usepackage{amsmath} |
| Use hyperref: No | (omits \usepackage{hyperref}) |
LaTeX Packages
LyX’s settings handle common packages automatically. For my thesis, the enabled packages include:
- amsmath – for equation environments
- esint – extended integral symbols
- geometry – custom page layout
- graphicx – figure inclusion (handled automatically)
BibTeX Integration
LyX integrates with BibTeX through its citation dialog. You point it at your .bib file, and citations become searchable and insertable through the GUI. The bibliography style (IEEE) is set in the document settings.
The LyX Workflow
My daily writing workflow looks like this:
- Open LyX and navigate to the section I’m working on
- Write content using the visual editor – select paragraph type from the dropdown (Standard, Section, Subsection, Itemize, etc.)
- Insert citations using Insert > Citation, which searches the
.bibdatabase - Insert figures using Insert > Graphics, which handles the
\includegraphicsandfigureenvironment - Preview the PDF using Ctrl+R (LyX compiles the LaTeX and opens the PDF viewer)
- Export to LaTeX using File > Export > LaTeX if I need the raw
.texfile
The compile step happens behind the scenes. LyX calls pdflatex and bibtex in the right order, handling the multi-pass compilation automatically. If there’s a LaTeX error, LyX shows it in a log window – still cryptic, but at least you don’t have to run the commands yourself.
What LyX Doesn’t Hide
LyX isn’t a complete abstraction. Some LaTeX knowledge is still necessary:
- Figure placement still requires understanding LaTeX’s float system (
[h],[t],[p],[!]options) - Custom formatting needs “Evil Red Text” (ERT) – raw LaTeX inserted directly into the LyX document
- Package conflicts still happen and require reading LaTeX error logs
- Advanced tables are still painful (though LyX’s table editor is better than writing raw
tabularenvironments)
The key insight is that LyX reduces the LaTeX you need to write without reducing the LaTeX you need to understand. It’s a productivity tool, not a knowledge shortcut.
Version Control with LyX
One advantage of the .lyx format being plain text: it works with version control. I’m using SVN (Subversion) hosted on Unfuddle to track my thesis alongside the IsoMob engine code. The repository structure puts the thesis documents under doc/thesis/:
1
2
3
4
5
6
7
8
9
10
11
hobo_main/
├── doc/
│ └── thesis/
│ ├── Diperna_graduate_thesis_2011.lyx
│ ├── figures/
│ │ ├── thesisIsometricPicture.png
│ │ └── thesisIsovsDimetric.png
│ ├── examples/
│ │ └── thesisExample.PDF
│ └── thesisAssets.fla
└── [engine source code]
Every edit to the thesis is trackable. I can diff versions, revert changes, and maintain a history of the writing process. Try doing that with a Word document in 2011.
The Reference Stack
Along with the LyX setup, I’ve been building a reference library for the writing process itself:
- ThesisWritingTips_lotsofEXAMPLES.pdf – practical writing advice with before/after examples
- Template_Information_and_Instructions_8-25-04.doc – OU’s template guide
- Most_frequent_errors(8-25-04).doc – common formatting mistakes to avoid
- ieeeForAuthors.pdf – IEEE’s guide for authors submitting papers
- OU_thesis_formatting_manual.doc – the definitive formatting reference
Having these open alongside LyX means I can check formatting rules as I write, without switching context to a browser or digging through email.
Up Next
The tools are configured, the references are organized, the environment is ready. Time to actually write the thesis. Next post: structuring and writing the IsoMob thesis – 9 chapters covering everything from isometric projection math to A* pathfinding to cross-platform compilation in HaXe.
This post is part of a series documenting my Masters thesis journey at Oakland University. The thesis describes IsoMob, an open-source cross-platform isometric game engine written in HaXe.
