Getting Started
Installation
Windows Users
- Download
FLEx.Interlinear.Copy.Assistant.exefrom the latest release - No installation required - just double-click the .exe file to run
- Windows may show a security warning for downloaded files - click "More info" then "Run anyway"
macOS and Linux Users
- Ensure Python 3.x is installed on your system
- Install the required dependency:
pip install pyperclip - Download flex-interlinear-copy.py
- Run the script:
python3 flex-interlinear-copy.py
Basic Workflow
The typical workflow for using this tool follows these steps:
Step 1: Copy Your Data
In FLEx or your spreadsheet application, select and copy the interlinear data you want to convert. The data should be in tab-separated format with rows like:
- Word - the source language words
- Morphemes - morphological breakdown with boundary markers (-, =, .)
- Lex. Gloss - glosses for each morpheme
- Word Gloss - word-level glosses
- Free - free translation (full sentence)
Step 2: Launch the Application
When you start the application, it automatically pastes the current clipboard contents into the preview window. You'll see your data displayed in a text box at the top of the window.
Step 3: Select Output Format
Use the dropdown menu to choose your desired output format:
LaTeX Options:
- Single Example - For standalone numbered examples
- New List Example - Creates a new list environment with sub-examples
- Add to Existing List Example - Adds an item to an existing list
XLingPaper Options:
- Single Interlinear Example - Standard example format
- List Interlinear - Create New List - New list with examples
- List Interlinear - Add Item to Existing List - Add to existing list
Other Formats:
- Spreadsheet App - Returns clean TSV data
- HTML Table - For web display or wikis
Step 4: Configure Options
Use the checkboxes to customize the output:
- Enable Predefined LaTeX Styles - Use custom LaTeX commands like
\extitle{}instead of built-in formatting - Remove Column breaks between Morphemes - Enforces word alignment instead of morpheme alignment (checked by default)
- Remove FLEx row labels - Removes labels like "Word", "Morphemes", etc. from the output (checked by default)
Step 5: Convert and Copy
Click the "Convert and Re-Copy!" button. The converted output is automatically copied to your clipboard, ready to paste into your document.
Step 6: Paste into Your Document
Go to your LaTeX editor, Word processor, or XML editor and paste (Ctrl+V or Cmd+V). The formatted interlinear text will be inserted.
Manual Entry Mode
If you don't have data in FLEx, or want to create examples from scratch, use the manual entry feature:
- Click "Manually Enter Interlinear Example..." button
- Type or paste a source-language sentence in the dialog that appears
- A spreadsheet-like editor opens with your sentence split into cells
- Add rows for morphemes, glosses, etc. using the "Add Row" button
- Use "Split Cell" to divide a cell at the cursor position
- Use "Delete Row" to remove unwanted rows
- Enter the free translation in the text field at the bottom
- Click "Done" when finished
Format-Specific Instructions
📝 Recommended: Using Overleaf.com (Online LaTeX Editor)
Overleaf.com is the easiest way to use LaTeX output from this tool. It's a free online editor that requires no software installation and automatically handles compilation. Follow these detailed steps:
Step 1: Create or Open Your Project
- Go to www.overleaf.com and sign in (or create a free account)
- Either create a New Project (green button) or open an existing project
- If creating new, select "Blank Project" and give it a name
Step 2: ⚙️ Configure the Compiler (CRITICAL)
- Click the Menu button in the top-left corner (looks like three horizontal lines ☰)
- The settings panel opens on the left side of the screen
- Scroll down to find the "Compiler" dropdown menu
- Click on it and select either:
- XeLaTeX (recommended) - better font support
- LuaLaTeX (also works well)
- The menu will automatically save your choice - you'll see "Compiler: XeLaTeX" displayed
Step 3: 📦 Upload the MIT Interlinear Package
- Download the interlinear.sty file (right-click → Save As)
- In Overleaf, look at the left sidebar where your project files are listed
- Find and click the "Upload" icon/button (usually at the top of the file list, looks like an upload arrow ⬆)
- Select "Project Files" from the dropdown
- Click "Select files" and choose the
interlinear.styfile you downloaded - Click "Upload" - the file will appear in your project file list
Step 4: 🔧 Configure Your Document Preamble
In your main .tex file (usually main.tex), add these lines after the \documentclass{...} line but before \begin{document}:
% Required package for interlinear examples
\usepackage{interlinear}
% Required for IPA characters and special fonts
\usepackage{fontspec}
% Recommended: Set a font that supports IPA (Charis SIL)
\setmainfont{Charis SIL}
\setmainfont{Charis SIL} will work immediately!
Step 5 (Optional): Add Custom LaTeX Styles
If you enabled "Predefined LaTeX Styles" in the FLEx Interlinear Copy Assistant, add these commands to your preamble (after the packages):
% Custom formatting commands
\newcommand{\extitle}[1]{\textbf{\underline{#1}}}
\newcommand{\exsubtitle}[1]{\textit{#1}}
\newcommand{\txtref}[1]{\hfill\textit{#1}}
Step 6: ✂️ Paste Your Interlinear Examples
- In the document body (between
\begin{document}and\end{document}), place your cursor where you want the example - Paste the LaTeX code you copied from FLEx Interlinear Copy Assistant (Ctrl+V or Cmd+V)
- The code will include
\begin{exe},\ex,\glllor\gllcommands, and\end{exe}
Step 7: ▶️ Compile and View
- Click the green "Recompile" button at the top of the preview pane
- Wait a few seconds for compilation to complete
- Your formatted interlinear examples will appear in the PDF preview on the right!
- If you see errors, they'll appear in red at the bottom - click on them to see details
- Overleaf auto-saves constantly - no need to manually save
- Turn on "Auto Compile" (in the Menu) to see updates as you type
- Use the "History" feature to revert to earlier versions if needed
- Download your project as a ZIP file using Menu → Download → Source
🖥️ Using LaTeX on Your Computer (Advanced Users)
If you prefer to use LaTeX on your local machine:
Prerequisites:
- Install a TeX distribution: TeX Live (Linux/Mac) or MiKTeX (Windows)
- Download the MIT interlinear package and place it in your project folder
- Install Charis SIL font for IPA character support
- Compile using
xelatexorlualatexcommand (notpdflatex)
📄 Using XLingPaper (XML Mind Editor)
XLingPaper is a specialized XML editor for linguistic papers developed by SIL International. It uses XML Mind XMLEditor as its underlying editor. Learn more at SIL's website.
Step 1: 🎯 Position Your Cursor
- Open your XLingPaper document in XMLMind
- In the graphical view (default WYSIWYG view), click where you want to insert your interlinear example
- This could be in a section, a paragraph, or inside an example environment
- Make note of your location - you'll need to find it in the XML code
Step 2: 🔄 Switch to XML Source View
- Go to the menu bar at the top
- Click View → XML Source (or press the keyboard shortcut if configured)
- The editor switches to show the raw XML code of your document
- You'll see tags like
<section>,<p>,<example>, etc.
Step 3: 🔍 Find the Correct Insertion Point
- Locate the XML tags corresponding to where you clicked in the graphical view
- Look for appropriate container tags:
- Inside an
<example>tag for a new interlinear - After a
</example>closing tag to add a new example - Inside a
<listInterlinear>if adding to an existing list
- Inside an
- Place your cursor at the insertion point (usually just before a closing tag or after content)
Step 4: ✂️ Paste the XLingPaper XML Code
- Paste the XML code you copied from FLEx Interlinear Copy Assistant (Ctrl+V or Cmd+V)
- The pasted code will include tags like:
<example>,<interlinear>for single examples<listInterlinear>for list items<lineGroup>,<line>,<wrd>for the interlinear structure<free>for free translations
- Make sure the pasted code is properly nested within the existing XML structure
Step 5: ✅ Validate and Switch Back
- XMLMind will usually highlight XML syntax errors in red if there are any problems
- Check that all your opening tags have matching closing tags
- Go back to View → Normal View (or WYSIWYG view) to see the formatted result
- Your interlinear example should now appear in the document!
Step 6: 💾 Save and Continue
- Save your document (Ctrl+S or Cmd+S)
- If XMLMind reports validation errors, go back to XML Source view to fix them
- You can now continue editing or add more examples using the same process
- Always save before switching views - this helps prevent data loss
- Use Ctrl+Z (Undo) if something goes wrong
- Keep a backup copy of your document before making major changes
- Consult the XLingPaper documentation for XML structure details
- If you're new to XML, practice with a test document first
Using HTML Output
The HTML output creates a clean table suitable for:
- Pasting into wikis (Wikipedia, MediaWiki, etc.)
- Web content management systems
- HTML email
- Blog posts
The generated table uses basic HTML with inline styles, making it compatible with most platforms. FLEx row labels are automatically bolded.
Understanding Data Processing
Automatic Cleaning
The tool automatically performs several cleaning operations:
1. Removing Blank Columns
Columns that are completely empty across all rows are automatically removed to create cleaner output.
2. Handling Numbered Examples
If your data includes example numbers in the first column, the tool attempts to handle them intelligently, preserving them where appropriate.
3. Morpheme Break Markers
The tool recognizes morpheme boundary markers (-, =, _, .)
and can:
- Copy them from the Morphemes row to the Lex. Gloss row automatically
- Collapse morpheme breaks when "Remove Column breaks" is enabled
4. Free Translation Formatting
Rows starting with "Free" or surrounded by single quotes are automatically recognized as free translations and formatted appropriately for each output format.
FLEx Label Processing
When "Remove FLEx row labels" is checked, the tool:
- Removes the label column (Word, Morphemes, etc.) from non-Free rows
- Removes the "Free" prefix from the translation row
- Adds quotation marks around the free translation
Tips and Best Practices
For Best Results:
- Check your data - Review the preview window before converting
- Use consistent formatting - Keep morpheme markers and spacing consistent in your source data
- Test with a small example first - Make sure your workflow is correct before processing many examples
- Keep the app open - You can paste and convert multiple examples without restarting
- Save your work - Always save documents after pasting converted examples
Keyboard Shortcuts:
- Ctrl+C / Cmd+C - Copy in FLEx or spreadsheet
- Paste Button - Refresh clipboard data in the app
- Ctrl+V / Cmd+V - Paste converted output into your document
Troubleshooting:
- Data doesn't appear? - Click "Paste from Clipboard" button manually
- Weird formatting? - Check that your source data uses tabs (not spaces) between columns
- Missing morpheme markers? - Ensure markers are in the Morphemes row, not the Gloss row
- LaTeX won't compile? - Make sure you have the interlinear package installed and are using XeLaTeX
Example Workflow
Converting a FLEx Example to LaTeX
Step-by-step example:
- In FLEx, select your interlinear text and copy it (Ctrl+C)
- Launch FLEx Interlinear Copy Assistant
- Your data appears in the preview window
- Select "LaTeX - MIT interlinear package - Single Example" from dropdown
- Check "Remove FLEx row labels" (should be on by default)
- Check "Remove Column breaks between Morphemes" (should be on by default)
- Click "Convert and Re-Copy!"
- Open your LaTeX editor
- Paste (Ctrl+V) where you want the example to appear
- Compile with XeLaTeX or LuaLaTeX
The output will be a properly formatted LaTeX interlinear example ready to compile!