5

I want to create an system of equation in LyX, like this:

equation

Can anyone help me?

1
  • 2
    The answer can be found directly at my previous question, there is a step-by-step procedure that will keep you from writing tedious ERT directly on LyX. Oh, by the way, let me know if I'll have to add an answer here (just for coherence).
    – TheVal
    Oct 5, 2013 at 9:59

3 Answers 3

8

You can try the systeme package.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{systeme}

\begin{document}

\systeme{
x_1  -  x_3  =  0.2,
-\dfrac{1}{2} x_1  +  x_2  -  \dfrac{1}{4} x_3  =  -1.425,
x_1  -  \dfrac{1}{2} x_2  +  x_3  =  2
}

\end{document} 

(I have found it...) Issuing the command

\syslineskipcoeff{2}

before the \systeme makes it look better (IMHO):

enter image description here

3
  • 4
    LyX is high-level processor, we should try to avoid explicit TeX whenever possible.
    – juliohm
    Oct 5, 2013 at 14:47
  • 4
    @juliohm LyX may be “high level”, but you don't obtain the same result with the way you suggest in your answer, do you?
    – egreg
    Oct 5, 2013 at 14:49
  • 3
    @downvoter is your down vote because it is not the best way to go in LyX? I'm not a LyX expert, but please explain why you've downvoted. Oct 5, 2013 at 15:37
2

In math display mode, you can just type in the first equation, then press Ctrl+Enter, type in the second, and so on.

If alignment of columns is important, you do the same procedure but within an appropriate environment such as Insert -> Math -> Aligned Environment.

5
  • I think the OP wants a proper alignment inside every inlined equation that belongs to the system. In order to achieve this a column separation macro could be defined in the preamble, (i.e. modifying the array envir.); I'm saying this because the result for Ctrl+Enter won't re-create the system wanted.
    – TheVal
    Oct 5, 2013 at 15:56
  • 2
    I'm 99.99% sure that it is you that downvoted my answer. I agree that it is not the best way to go in LyX. But really do you think that your answer is better? BTW: I won't downvote your answer, anyway... Oct 5, 2013 at 16:45
  • @karlkoeller, how is your answer specific to LyX? It's for sure a good answer.
    – juliohm
    Oct 5, 2013 at 23:45
  • 1
    @AndreaL., my answer is targeted to the specific little system of equations illustrated in the question, I should have designed a better solution though. It's just a trade-off between how much you bother with alignment or not. LyX also has direct insertion for array,aligned,cases,... that follows the same idea with Ctrl+Enter. I'll update the answer.
    – juliohm
    Oct 5, 2013 at 23:57
  • 1
    @juliohm Please, can you show the result you're getting? Otherwise your answer can't help the OP. Anyway, I don't think you can easily get the same result with your suggestion as with systeme.
    – egreg
    Oct 6, 2013 at 0:19
1

If you want aligned equations with a left curly bracket:

enter image description here

or any "more aligned" variant:

enter image description here

then...

  • Menu Insert | Math | Delimiters, then unselect Keep matched and select a curly bracket for the left delimiter, and None for the right delimiter. Click the Insert button:

    enter image description here

  • Populate the box inserting an AlignedAt environment. Menu Insert | Math | AMS AlignedAt Environment. This gives you a row of two columns.

  • Insert as many columns you need to match your custom alignment (button from array toolbar). Columns come in pairs "flush right -->|<-- flush left" alignment, but you can add an additional empty column to invert the alignment of columns on the right (proceed from left to right). Empty columns take no space on the rendered document.

  • Enter your first equation. Add as many rows as you need using Ctrl-Enter. Be sure the cursor is at the end of the first row, and the status bar displays align AlignedAt and not align. Else you will add rows, but not inside the AlignedAt environment:

    enter image description here


For information, the code generated is:

[
\left\{
  \begin{alignedat}{4}
    x_{1} &  &  &  & -x_{3} & = &  & 0.2\\
    -\frac{1}{2}x_{1} &  & +x_{2} &  & -\frac{1}{4}x_{3} & = &  & -1.425\\
    x_{1} &  & -\frac{1}{2}x_{2} &  & +x_{3} & = &  & 2
  \end{alignedat}
\right.
\]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .