# Cannot create a macro for multicolumn in LyX [closed]

I am trying to write a block diagonal matrix in LyX which clearly shows the blocks by separating them using vertical and horizontal lines. I found that I can use `\cline{i-j}` to draw a horizontal line between columns i and j. Similarly, I found that I can use `\multicolumn{1}{c|}{#1}` to write an element in the matrix which has a vertical line to its right.

I tried to create a math macro for the `\multiline` command because the first two arguments are always the same in my matrix. I did it as follows,

However, when I close the file and reopen it, the macro changes to this

I do not understand why this happens. I have used macros before and they never changed like this. Is there any problem in defining a macro for `\multicolumn`?

## closed as off-topic by Torbjørn T., Martin Schröder, TeXnician, user31729, clemensApr 21 '17 at 12:49

• This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• Since this is a TeX-LaTeX site, I'd rather report such (obvious) bugs at lyx.org/trac/wiki/BugTrackerHome or LyX user/developer newsgroups. – PhilipPirrip Apr 16 '17 at 16:31
• This is going to be fixed in the upcoming LyX 2.3 and 2.2.3 (see lyx.org/trac/ticket/10466). For now you can replace `\multicolumn` with `\csname multicolumn\endcsname` and it will be preserved on loading. As said, this is not really a question for tex.se. – G.M. Apr 18 '17 at 12:32
• I'm voting to close this question as off-topic because it is about a bug in LyX that has been reported at the appropriate place (lyx.org/trac/ticket/10466) and will be fixed in an upcoming version. – Torbjørn T. Apr 21 '17 at 12:17