5

How can I do this without the cases?

$\begin{cases} 
 \dfrac{\partial u(x,y)}{\partial x}=2x=\dfrac{\partial v(x,y)}{\partial y} \\ 
 \dfrac{\partial u(x,y)}{\partial y}=-2y=- \dfrac{\partial v(x,y)}{\partial x} 
 \end{cases} 
 \forall (x,y)\in \mathbb{R}^2$
  • 2
    aligned instead of cases? With a & to start the rows. Welcome to TeX.sx! – egreg Feb 28 '13 at 16:02
  • For your information, if you type 4 spaces before a line, it will be shown as code. – Ignasi Feb 28 '13 at 16:03
  • do you wanna avoid the brace or just do it in another way with brace? – Rico Feb 28 '13 at 16:09
  • wanna avoid the brace – Henfe Feb 28 '13 at 16:12
6

Looking at the typeset result, I'd say you're looking not for cases or aligned, but alignedat (or its standalone version, alignat).

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}

\noindent Standalone:
\begin{alignat*}{99}
    \dfrac{\partial u(x,y)}{\partial x}&{}={}& 2&x={}&  &\dfrac{\partial v(x,y)}{\partial y} \\ 
    \dfrac{\partial u(x,y)}{\partial y}&{}={}&-2&y={}& -&\dfrac{\partial v(x,y)}{\partial x} 
\end{alignat*}
Embedded:
\begin{align*}
  \begin{alignedat}{99}
    \dfrac{\partial u(x,y)}{\partial x}&{}={}& 2&x={}&  &\dfrac{\partial v(x,y)}{\partial y} \\ 
    \dfrac{\partial u(x,y)}{\partial y}&{}={}&-2&y={}& -&\dfrac{\partial v(x,y)}{\partial x} 
  \end{alignedat}
  &&
  \forall x \in \mathbb{R}
\end{align*}

\end{document}

The {99} argument is there to satisfy an obtuse requirement of the environment: it specifies the maximum number of columns. I generally don't care to count, so I just make it absurdly large.

enter image description here

It's also possible to have the 2x centered, as tohecz requests, but this entails a small amount of hackery.

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}

\noindent Default
\begin{align*}
  \begin{alignedat}{99}
    \dfrac{\partial u(x,y)}{\partial x}&{}={}& 2&x={}&  &\dfrac{\partial v(x,y)}{\partial y} \\ 
    \dfrac{\partial u(x,y)}{\partial y}&{}={}&-2&y={}& -&\dfrac{\partial v(x,y)}{\partial x} 
  \end{alignedat}
  &&
  \forall x \in \mathbb{R}
\end{align*}
$2x$ centered:
\begin{align*}
  \begin{alignedat}{99}
    \dfrac{\partial u(x,y)}{\partial x}&{}={}&\omit\hfil$2x$\hfil&{}={}&  &\dfrac{\partial v(x,y)}{\partial y} \\ 
    \dfrac{\partial u(x,y)}{\partial y}&{}={}& -2y &{}={}& -&\dfrac{\partial v(x,y)}{\partial x} 
  \end{alignedat}
  &&
  \forall x \in \mathbb{R}
\end{align*}
\end{document}

Namely, you have to remove the "template" from the column containing 2x and replace it with the necessary glue (not forgetting the $ $, because those are normally included in the template). This entails a slightly different arrangement of columns than before, since now we want to keep the entire monomial together.

enter image description here

  • The extra space in fron of 2x seems to be disturbing to me. If you really want all the = aligned, you might consider centering 2x there ;) – yo' Feb 28 '13 at 16:58
  • @tohecz: I like to have the variables aligned, but that could just be my linear algebra lectures talking. – Ryan Reich Feb 28 '13 at 16:59
  • I don't like it because it looks like that a - is missing in the first line :-/ – yo' Feb 28 '13 at 17:01
  • @tohecz: How do you like my new example? – Ryan Reich Feb 28 '13 at 17:13
  • +1, just there's still the same problem in front of dv/dy ;) – yo' Feb 28 '13 at 17:15
7

amsmath provides a bunch of environments for alignments; in this case you're probably looking for aligned:

\documentclass{article}
\usepackage{amsmath,amssymb}

\begin{document}

\[
\begin{aligned} 
& \dfrac{\partial u(x,y)}{\partial x}=2x=\dfrac{\partial v(x,y)}{\partial y} \\ 
& \dfrac{\partial u(x,y)}{\partial y}=-2y=- \dfrac{\partial v(x,y)}{\partial x} 
\end{aligned}
\quad
\forall (x,y)\in \mathbb{R}^2
\]
\end{document}

enter image description here

I'd never use it inline, though.

  • Don't forget \! before aligned. – kiss my armpit Oct 29 '13 at 5:47
3

Do you mean literally not using "cases" as in this?

$
   \begin{array}{l}
     \dfrac{\partial u(x,y)}{\partial x}=2x=\dfrac{\partial v(x,y)}{\partial y} \\ 
     \dfrac{\partial u(x,y)}{\partial y}=-2y=- \dfrac{\partial v(x,y)}{\partial x} 
   \end{array}
   \forall (x,y)\in \mathbb{R}^2
$

Or am I not understanding the question? [I edited to remove the brace]

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.