LibreOffice Writer displays blue squiggly lines under dashes because its grammar checker flags hyphens as potential errors when used in place of em or en dashes. To eliminate these distractions, you can either disable the specific grammar check for punctuation or configure automatic replacement rules to convert typed hyphens into proper em dashes during input.
Understanding the Grammar Check Trigger
The blue wavy underline is a visual indicator from LibreOffice’s spell and grammar checking engine. By default, the software distinguishes between a simple hyphen (-), an en dash (–), and an em dash (—). When you type two hyphens together (--) or use a single hyphen in a context where a longer dash is grammatically preferred, the grammar checker may flag it as an error. This is particularly common when users are trying to create a pause in a sentence but are unaware that LibreOffice expects a distinct character entity for an em dash rather than a sequence of hyphens.
This behavior is not a bug but a feature of the localization settings. In many English locales, the standard typographic convention requires an em dash surrounded by spaces or no spaces depending on style guides. The checker assumes that if you type a hyphen, you might have made a mistake, hence the blue squiggle. Understanding this distinction helps in choosing the right fix: either telling the checker to ignore your intent or correcting the input method itself.
Method 1: Disable Grammar Checking for Punctuation
If you prefer to keep general spell checking active but simply want to stop the annoyance of grammar flags on dashes, you can adjust the proofing options. This method leaves your document formatting intact but removes the visual noise. Navigate to Tools in the main menu bar, then select Options. In the dialog box that appears, expand the LibreOffice node and click on Language Settings. Under this section, choose Proofing. You will see a list of available language modules and their associated checking features. Look for the entry corresponding to your primary writing language (e.g., English USA). Click on it to reveal the sub-options. Here, you will find checkboxes for various checks such as "Check spelling," "Check grammar," and specifically "Check punctuation." Uncheck the box for Check punctuation. Alternatively, if you want to be more granular, some versions allow you to toggle specific grammar rules. However, disabling punctuation checking broadly is the most effective way to stop the blue squiggles related to dashes without altering your text. Click OK to save the changes. The existing marks may remain until you re-run the spell check or restart the application, at which point they should disappear. For more details on customizing your workspace to reduce visual clutter, consider reading about Creating a Full-Page Workspace in LibreOffice Writer, which complements this cleaning up of editing indicators.Method 2: Configure AutoCorrect for Em Dashes
A more robust solution is to teach LibreOffice to automatically convert what you type into the correct character. This prevents the grammar checker from ever seeing a "wrong" dash in the first place. You can set up AutoCorrect options to replace double hyphens (--) with an em dash (—) as you type. Go to Tools and select AutoCorrect Options. Switch to the Options tab. Here, look for the checkbox labeled Create replacement entries. Ensure this is enabled. Then, switch to the Localization tab. In the "Replace" field, enter two hyphens (--). In the "With" field, you must insert the actual em dash character. You can do this by copying an em dash from another source or using the Insert > Special Character menu. Select the em dash and paste it into the "With" field.
Click New to add this rule to the list. You can also add similar rules for en dashes (using a single hyphen or other sequences if desired). Once added, click OK. Now, whenever you type two hyphens followed by a space or punctuation, LibreOffice will instantly swap them for a proper em dash. Since the resulting character is valid, the grammar checker will no longer flag it. This approach improves document quality while removing the error markers.
If you are interested in how spacing affects document appearance after making such changes, How to Change Spacing in LibreOffice Header, Page, and Body provides guidance on managing whitespace around these new characters.
Manual Correction and Keyboard Shortcuts
For occasional use, you can manually insert the correct character without changing global settings. Place your cursor where the dash is needed and go to Insert > Special Character. In the dialog, search for "em dash" or browse the Unicode block. Select the character and click Insert. Alternatively, memorize the keyboard shortcut for your operating system. On Windows, holdingAlt and typing 0151 on the numeric keypad produces an em dash. On macOS, press Option + Shift + -. On Linux, depending on your desktop environment, you might use Compose key sequences like Compose + - + -. Using these shortcuts ensures you are always typing the correct glyph, bypassing the grammar checker entirely.
For those who frequently mix text and mathematical expressions, understanding how different editors handle symbols is useful. See our guide on the LibreOffice Writer Formula Editor Interface: A Comprehensive Guide to distinguish between text punctuation and formulaic symbols.
Frequently Asked Questions
Why does LibreOffice flag my hyphens but Microsoft Word does not?
LibreOffice uses a stricter grammar checking engine that often distinguishes more sharply between hyphens and dashes based on locale rules. Word may auto-correct silently before the checker sees it, whereas LibreOffice shows the flag first unless configured otherwise. Adjusting the AutoCorrect rules in LibreOffice mimics Word's silent correction behavior.Can I turn off only the grammar check and keep spell check?
Yes. In Tools > Options > Language Settings > Proofing, you can uncheck "Check grammar" while leaving "Check spelling" enabled. This stops all grammar-related squiggles, including those for dashes, but still highlights misspelled words in red.What is the difference between an en dash and an em dash?
An en dash (–) is half the width of an em dash and is typically used for ranges (e.g., 1990–2000). An em dash (—) is wider and used for breaks in thought or parenthetical statements. LibreOffice treats them as distinct entities, so confusing them can trigger grammar warnings depending on your style settings.