How to Add Boxes Around Matrix Rows in Word Equations
Question details
The user wants to draw a border or box around specific rows or columns within a matrix in a Microsoft Word equation.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Formatting a mathematical equation to highlight or emphasize specific rows or columns of a matrix.
- Observed behavior
- Word's Equation Editor does not natively provide a tool or option to draw borders around individual matrix rows or columns.
Ensure your document layout and equation edits are completely finalized before adding shapes, as modifying text above the equation may cause your drawn boxes to shift out of alignment.
Use a Text Box Workaround to Highlight Matrix Rows
Since Word's Equation Editor lacks a native tool for internal matrix borders, drawing a customized text box over the row is the most effective and visually accurate workaround.
This method uses standard drawing tools layered over the equation. By removing the background fill and internal padding of a text box, you can create a perfectly sized border around any part of your matrix.
Navigate to the 'Insert' tab on the top ribbon, click on 'Text Box' in the Text group, and select 'Draw Text Box'.
Click and drag your cursor to draw the text box directly over the specific row or column in your equation that you want to highlight.
Right-click the drawn text box and select 'Format Shape'. Under the Shape Options, set the Fill to 'No fill' so the equation shows through. Then, navigate to the Text Box layout settings and set all internal margins (left, right, top, bottom) to zero.
In the 'Format Shape' pane under the 'Line' section, choose your preferred outline color, width, and dash type (e.g., solid or dashed line) to finalize the box's appearance.

Edit Equations and Format Documents Easily with WPS Office
If you frequently encounter limitations when working with complex equations and advanced document formatting, consider WPS Office. It provides a lightweight, free alternative to Microsoft Office with a familiar interface, seamless compatibility with Word documents, and highly flexible drawing tools for annotations.
- 1. Download and Install: Get the free WPS Office suite from the official website and install it on your device.
- 2. Open Your Document: Launch WPS Writer and open your existing Word (.docx) document containing the equations.
- 3. Add Shapes Easily: Use the 'Insert' > 'Shapes' tool to quickly draw transparent rectangles around any matrix row without layout breaking.

Frequently Asked Questions
Can I group the drawn text box with the equation so they move together?
Yes. While Word doesn't allow grouping inline text with shapes by default, you can place both the equation and the text box inside a 'Drawing Canvas' (Insert > Shapes > New Drawing Canvas), or change the equation's wrapping style to 'Square' or 'Tight' to enable grouping.
Is there a way to add brackets to a specific matrix row instead of a full box?
Yes. Instead of selecting 'Draw Text Box', navigate to Insert > Shapes and select the Left or Right Bracket shape. Draw and position these brackets manually around the specific row just as you would with the text box.
Why doesn't the Equation Editor support inner borders naturally?
The built-in Equation Editor treats a matrix as a single unified mathematical object rather than a traditional table grid. Because of this structural difference, it does not possess granular cell-level or row-level border formatting capabilities.




