3

See the following latex keywords

\[\left\{\begin{matrix}
A=B \\ C=D
\end{matrix}\right.\]

This shows the two array as column wise in center part.

But how to align the equality sign $=$ balanced?

  • 3
    Welcome to TeX.SE. In the example you give it seems that the two equal signs are aligned, so not sure what the actual problem is. Also, while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Jan 29 at 19:01
6

EDIT: As suggested by @egreg :-) I add another answer using ambient cases:

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\begin{document}
\[
\begin{cases}
A =& B \\
C =& D
\end{cases}
\]
\end{document}

As correctly pointed out by the good user who gave you the first correct answer, if you do not indicate the precise packages that you have used we can not help you very well. In fact, to get it, I used another code that produces the same result using the ambient aligned.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\begin{document}
\[
\left\{
\begin{aligned}
A &= B \\
C &= D
\end{aligned}
\right.
\]
\end{document}
  • 4
    I would use cases anyhow, instead of \left\{ and \right. The answer is good otherwise. – egreg Jan 29 at 21:05
  • 2
    +1 for showing how to align the contents of the two rows on the = symbols. – Mico Jan 29 at 21:05
  • 2
    I don't think egreg meant for you to get rid of the aligned environment. Instead, I'm pretty sure he meant for you to keep using an aligned environment, while replacing the \left\{\begin{matrix} and \end{matrix}\right. directives with \begin{cases} and \end{cases}, respectively. – Mico Jan 30 at 13:59
  • 1
    @M.A.SARKAR It is good practice to post a different question for a new problem. And we would love to get a full working code this time. But, for the time being, does this link help? – Partha D. Jan 30 at 14:53
  • 2
    @M.A.SARKAR It's perfectly all right... there's noone who comes into this world knowing everything. Hope you will (and already are) enjoy(ing) the ambience of the community. Feel free to post your queries and contribute in the way you feel best. – Partha D. Jan 31 at 5:25
4

I think using the amsmath package should bring your matrix to shape:

enter image description here

with the code snippet:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
    \left\{
    \begin{matrix}
        A=B\\ 
        C=D
    \end{matrix}
    \right.
\] 
\end{document}

However, without loading the amsmath package

\documentclass{article}
\begin{document}
\[
    \left\{
    \begin{matrix}
        A=B\\ 
        C=D
    \end{matrix}
    \right.
\] 
\end{document}

it gives:

enter image description here

With a warm welcome to TeX.SX, it is advised, as @Peter Grill pointed out, that you include in your future questions a full working example (as minimal as possible) with all packages you have used and the appropriate documentclass... so that contributors are able to locate your exact problem and help you (and future [La]TeX users) better.

  • 2
    Your screenshot appears to be missing a linebreak between A=B and C=D. – Mico Jan 29 at 21:00
  • @Mico But that's what I get without any packages loaded. The linebreak appears only with \includepackage{amsmath}. Frankly speaking, I don't know the reason for that... maybe the matrix environment is defined differently there! – Partha D. Jan 30 at 13:32
  • The missing linebreak occurs precisely because you're not loading the amsmath package. The LaTeX kernel actually defines an environment called matrix, and that's what ends up being used because you're not loading the amsmath package, which provides a far more competent and polished environment with the same name. For the example at hand, I can see no valid reason for not loading the amsmath package. – Mico Jan 30 at 13:55
  • @Mico Thanks for the explanation. My answer does suggest using amsmath to let the linebreak take effect... producing the first screenshot. I added the second screenshot in a later edit to give an idea of what happens when amsmath package is not loaded. Your valuable explanation completes the cycle by providing the logic for the observed difference. – Partha D. Jan 30 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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