I need to write a vertically stacked subscript in a notation meant to say "evaluate expression at k=..., and k'=...". In the end it should look like

/    SOME    \        
|     BIG    |        
\ EXPRESSION / k = ...
               k'= ...

with the "k=, k'=" part as subscript in normal subscript size (hence the matrix environnment is unsuitable). In LaTeX I'd use the subarray environment and indeed LyX supports a command \subarray. However, I can't find a method to change the alignment from centered to left-aligned.

When inserting a matrix similarly just writing \matrix in the equation editor gives a matrix where all columns are centered and I know no method to change this after creation, while using the "Insert > Math > Matrix" dialog allows specifying the alignment. A method for changing matrix alignment would probably also allow aligning subarray.

Does such a method exist or is there a dialog based method to create a subarrayenvironment similar to matrix?


I want the result to look correct in LyX's math editor, in the output document and in the LyX's instant preview. The closest I got was defining a LyX math macro with two arguments that inserts a left-aligned matrix (which in the math editor looks like a \begin{subarray}{l}...\end{subarray}) and then overwriting it with ERT to actually use subarray for the pdf output. However, for instant preview this will use \begin{matrix}{l}...\end{matrix} and thus look incorrect.

closed as off-topic by Werner, Przemysław Scherwentke, Kurt, Jesse, Svend Tveskæg Sep 9 '15 at 3:58

  • 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.

  • \begin{subarray}[l] k=...\\ k'=...\end{subarray} – egreg Apr 9 '15 at 17:58
  • I also don't use/know Lyx. I have a solution using my stackengine package, but won't post it if it is useless in a Lyx context. – Steven B. Segletes May 11 '15 at 18:48
  • The mathtools package has starred versions of matrix, bmatrix, pmatrix, &c., environments, that accept an optional argument ([l], [r] or \ [c]` – the default). – Bernard Aug 10 '15 at 0:14
  • 4
    I'm voting to close this question as off-topic because it's about a feature-request for adjusting displays of internal content that forms part of the LyX UI. See lyx.org/GetInvolved. – Werner Sep 8 '15 at 23:55

The correct way is using \begin{subarray}{l}...\end{subarray}.

\left[\frac{k}{k'}\right]_{\begin{subarray}{l} k=1\\k'=2+4\end{subarray}}

enter image description here

  • Sadly I can't find a way to do that properly in LyX (which the question is about). While I can create such an effect by using mixing LyX's builtin Mathmacros and overwriting my macro with ERT (i.e. plain latex), I don't know how to consistently get this result in LyX's math editor, in instant preview for the expression and in the output document. – kdb Apr 11 '15 at 16:50
  • @kdb Sorry for that, but I'm not a LyX user and can't help you more than this. If LyX puts so many constraints, leave it or ask the developers to make available the well documented subarray environment. – egreg Apr 11 '15 at 16:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.