I am having trouble writing procedure for Gauss-Jordan transformation matrix in LaTeX.

I want to write something like

```
r2 - r1 r3-2r1
[A|I] -------> [A'|I'] ----->
```

and so on

with the corresponding transformations (e.g., r2-r1) on top of the arrows. Could you give me an example code of how to do this? I only know that I need `\bmatrix`

for matrices with [], but I do not know how to split them in between with a vertical line |.

Thanks a lot!

## Best Answer

With

amsmathyou can usethat will produce an arrow wide enough to accommodate the thing on top.

In order to split matrices you need to use

`array`

With the

`@{}`

at both sides you'll get output similar to that of`bmatrix`

.