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.

When I specify a set of partial differential equations, I usually have to write out not only the equation itself, but also its domain. To complete the problem, I need to specify the boundary conditions underneath it in the same fashion. So the information I need to write is of the format:

EQUATIONS in DOMAIN
CONDITIONS in BOUNDARY

Using simple \[ ... \] format, it looks absolutely horrible. So I tried using a 2x2 array using \begin{array}{cc}...\end{array}, but this doesn't look correct either. What is the standard approach to formatting these equations?

Update: This is what I have coded thus far:

 \[ \begin{array}{cc} -\nabla^2u=0, & \Omega\\u=g & \partial\Omega \end{array}\]  
share|improve this question
    
Could you provide a MWE (minimal working example) of what you have done? –  azetina Dec 11 '12 at 20:35
    
take a look at the multi-line display structures in amsmath -- texdoc amsmath should bring up the manual if you're working with a tex live installation. –  barbara beeton Dec 11 '12 at 20:35
    
@azetina: good point! I just updated my question with the code. –  Paul Dec 11 '12 at 20:39
    
@barbarabeeton \OT In my MikTeX installation (Win 7) I have to command texdoc amsldoc (as the documentation is named amsldoc.pdf). \endOT –  Qrrbrbirlbel Dec 11 '12 at 20:51
    
@Qrrbrbirlbel -- ah, okay. i'm working on a (shared) linux installation (don't know which flavor of the os), and both amsmath and amsldoc pull up the same manual. but you're right -- it's more reliable to use the exact name. –  barbara beeton Dec 11 '12 at 20:57
add comment

1 Answer

up vote 6 down vote accepted

You can probably use the align environment:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
     \begin{align*}
     -\nabla^2u&=0,\quad \Omega\\
     u&=g \quad \partial\Omega
     \end{align*} 

% alignat option added

     \begin{alignat*}{2}
       -\nabla^2u&=0,&\quad &\Omega\\
                u&=g &      &\partial\Omega
     \end{alignat*} 
\end{document}

For further reading about alignment, check amsldoc under Displayed equations. About \quad, it is defined as:

\def\quad{\hskip 1em\relax}
share|improve this answer
    
Yes! This was exactly what I was looking for! Thank you so much, azetina! –  Paul Dec 11 '12 at 20:49
    
Out of curiousity... What exactly does the command \quad do? –  Paul Dec 11 '12 at 20:50
    
@Paul \quad is a space command equivalent to 1em –  azetina Dec 11 '12 at 20:54
    
Using alignat might be a better choice. This just happened to work great only because the right hand side were of approximately equal width. –  Peter Grill Dec 11 '12 at 23:14
    
I know @PeterGrill It was not my intention to align vertically. It just happened to be. I will update my example with alignat. –  azetina Dec 11 '12 at 23:16
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.