0

Example

I can only insert matrix without the stroke.

lyxnoob
  • 11
  • I'm not sure this should be marked as a duplicate since the question has the tag "lyx". Perhaps the question should be edited to specify that the OP is looking for a solution that is native to LyX. The other answers could be adapted to be used in LyX by using LyX's TeX box (Insert > TeX Code) and also adding relevant code to the LaTeX preamble in Document > Settings > LaTeX Preamble. Then it will work, but LyX will not show it in WYSIWYM. It can show it in WYSIWYG if you wrap the TeX Box in Insert > Preview (if preview is on in Tools > Preferences). – scottkosty Nov 19 '22 at 16:06
  • @scottkosty I voted to reopen, but apparently the gold tag badge works both for opening and closing .. So the question is opened again, feel free to add an answer :) – Torbjørn T. Nov 21 '22 at 19:28
  • Thanks for voting to reopen! Oh shoot, now I feel bad since I don't know an elegant "LyX way" to answer the question :). I scrolled through the Help > Math manual and don't see something like it. Perhaps ERT is the only solution. – scottkosty Nov 21 '22 at 19:46
  • Take a look at nicematrix. – projetmbc Nov 21 '22 at 19:53

1 Answers1

2

if you want to draw this type of matrix using LyX's GUI (and not using ERT) you must do it with array and not pmatrix. In LyX: 1) enter math mode (via ctrl+M or ctrl+shift+M), 2) press Alt+M ( to add the parentheses, 3) type \array then space.

Now you should see the array menu at the bottom of the screen, there you can add rows and columns to the array.

enter image description here

After formatting the array to the desired size, right click on the column positioned to the left of the vertical bar you want to add, and press Add Line to Right.

enter image description here

Udi Fogiel
  • 3,824