How can I have two lines – one above and one below a portion of text (or numbers) in an `align`

environment. Like for the sum in a math problem for kids. In the given example, I need a line above and below the 26 on the last row, without affecting the row spacing a lot. I much prefer not having to use a table.

```
\textbf{Amy has 12 red buttons and 14 green buttons. How many buttons does she have in all?} \par
\vspace{5mm}
\begin{align*}
&\text{Number of red buttons} & & 12\\
&\text{Number of green buttons} & &14\\
&\text{Total number of buttons Amy has} & &26\\
\end{align*}
```

## Best Answer

You can set the answer in a

`tabular`

with an`\hline`

at the top and bottom. To ensure it doesn't affect the line spacing,`\smash`

it:You can set the content in a

`tabular`

as well, and adjust the vertical padding to match that of an`align`

, if needed.