Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In LaTeX+amsmath, I can say

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation*}
  \left\{
    \begin{aligned}
      px-y-4&=0\\
      2x-2y-6m&=0
    \end{aligned}
  \right.
\end{equation*}
\end{document}

to get an aligned system of equations with a brace on the left. How to achieve a similar effect in ConTeXt? I tried saying \startalign[left=\{] and similar things with no effect.

Edit: thanks to Aditya's and Marco's comments below I came up with this:

\starttext
\startformula
  \startmathmatrix[left={\left\{},right={\right.},distance=0pt,align={right,left}]
    \NC px-y-4\NC{}=0\NC\NR
    \NC 2x-2y-6m\NC{}=0\NC\NR
  \stopmathmatrix
\stopformula
\stoptext

Now my question is: can this be made better? I do not like the distance=0pt and {} stuff very much (but I guess this keeps the spacing on both sides of the equation sign uniform).

share|improve this question
1  
Use mathmatrix. –  Aditya Nov 9 '12 at 8:41
    
Could you show an example? –  mbork Nov 9 '12 at 8:48
4  
Here are two articles worth reading: Using \startalign and Display math in ConTeXt –  Marco Nov 9 '12 at 8:48
1  
I don't have an answer to the {} spacing issue. But to keep the code cleaner you can define your own environment: \definemathmatrix[eqnsystem][left={\left\{},right={\right.},distance=0pt,align=‌​{right,left}] and then use \starteqnsystem … \stopeqnsystem instead. –  Marco Nov 12 '12 at 9:13
    
@Marco: could you make your comment into an answer, so that I could accept it? –  mbork Nov 12 '12 at 21:22
add comment

1 Answer

up vote 5 down vote accepted

As mentioned in the documentation Using \startalign and Display math in ConTeXt you can use the \startmathmatrix … \stopmathmatrix environment.

It makes sense to define your own environment for equation systems. This has the advantage that it is logically marked up. “This is an equation sytem” as opposed to “This is a multi-line formula with a brace at the left”. You can change the layout of the equation systems globally and it keeps the source code clean and makes it easier to read.

I would also get rid of the ugly pair of braces. However, I don't have a proper solution for the correct spacing (either wait for Aditya to tune in – he's the expert for math or ask on the mailing list).

\definemathmatrix
  [eqnsystem]
  [left={\left\{},
   right=\right.,
   distance=.3em,
   align={right, left}]

\starttext
\startformula
  \starteqnsystem
    \NC px-y-4   \NC =0 \NC\NR
    \NC 2x-2y-6m \NC =0 \NC\NR
  \stopeqnsystem
\stopformula
\stoptext

result

share|improve this answer
    
Thanks a lot! And what's wrong with the .3em approach? It seems perfect! (I'd also add a \thinspace after \left\{, but this is a matter of taste.) –  mbork Nov 16 '12 at 18:22
2  
The .3em seems arbitrary and a little hackish. I did some testing and found that the actual value is more about .2278em. I'd prefer the exact value that TeX uses for this distance. –  Marco Nov 16 '12 at 20:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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