logo
search
Formatting Issues

How to Add Boxes Around Matrix Rows in Word Equations

Steve KSteve K Sep 28, 2026 869 views

Question details

The user wants to draw a border or box around specific rows or columns within a matrix in a Microsoft Word equation.

How to Add Boxes Around Matrix Rows in Word Equations
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.
Before you start

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.

Solution 1Recommended

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.

1
Insert a Text Box

Navigate to the 'Insert' tab on the top ribbon, click on 'Text Box' in the Text group, and select 'Draw Text Box'.

2
Draw the Box over the Matrix

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.

3
Remove Background and Padding

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.

4
Customize the Border Outline

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.

Use a Text Box Workaround to Highlight Matrix Rows
Preventing Misalignment: To prevent the box from moving independently of the equation, you can change the text wrapping of the equation and group it with the text box, or place both elements inside a single Drawing Canvas.
Free Microsoft Office alternative

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. 1. Download and Install: Get the free WPS Office suite from the official website and install it on your device.
  2. 2. Open Your Document: Launch WPS Writer and open your existing Word (.docx) document containing the equations.
  3. 3. Add Shapes Easily: Use the 'Insert' > 'Shapes' tool to quickly draw transparent rectangles around any matrix row without layout breaking.
Fully compatible with Microsoft Word (.docx) formats and embedded equation objects.Flexible drawing and shape tools that easily layer over mathematical formulas.Familiar user interface requires no learning curve to master.Lightweight architecture ensures it runs smoothly even on older devices.
QA img-9

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.