Difference between revisions of "Multiline equations"

From Wiki
Jump to navigation Jump to search
(Added details about columns and alignment)
m (typos & vertical spacing)
Line 12: Line 12:
 
</texcode>
 
</texcode>
  
Note the \\ in the last line
+
Note the \\ in the last line, above.
 +
 
 +
This appears as follows:
  
This appears as follows
 
 
<context>
 
<context>
 
\startformula \startalign
 
\startformula \startalign
Line 22: Line 23:
 
</context>
 
</context>
  
* Context Stlye
+
* Context Style
  
 
<texcode>
 
<texcode>
Line 34: Line 35:
 
\startformula \startalign
 
\startformula \startalign
 
  \NC v \NC = u + at \NR
 
  \NC v \NC = u + at \NR
  \NC h \NC= ut + \frac12 gt^2 \NR
+
  \NC h \NC = ut + \frac12 gt^2 \NR
 
\stopalign \stopformula
 
\stopalign \stopformula
 
</context>
 
</context>
  
( The examples here will focus on the context style, having two styles can be confusing --[[User:Adityam| Aditya ]] )
+
(The examples here will focus on the context style, having two styles can be confusing --[[User:Adityam| Aditya ]] )
  
 
== Changing the number of columns ==
 
== Changing the number of columns ==

Revision as of 14:34, 6 February 2006

Basic Alignment

Two modes of input

  • Latex style
\startformula \startalign
 v &= u + at \\
 h &= ut + \frac12 gt^2 \\
\stopalign \stopformula

Note the \\ in the last line, above.

This appears as follows:

  • Context Style
\startformula \startalign
 \NC v \NC = u + at \NR
 \NC h \NC= ut + \frac12 gt^2 \NR
\stopalign \stopformula

(The examples here will focus on the context style, having two styles can be confusing -- Aditya )

Changing the number of columns

The above equations were aligned at =. Suppose you also want the + to align. Well, this is simple in context, simply specify the number of columns with \startalign


\startformula \startalign[n=3]
 \NC v \NC = u \NC+ at \NR
 \NC h \NC= ut \NC+ \frac12 gt^2 \NR
\stopalign \stopformula

Alignment of each column

If you want more control over the formatting, and want the middle column to be center aligned, you can do that by

\startformula \startalign[n=3,align={right,middle,left}]
 \NC v \NC = u \NC+ at \NR
 \NC h \NC= ut \NC+ \frac12 gt^2 \NR
\stopalign \stopformula

Working with equation numbering

Changing the number of columns

Cases

Numbered Cases