Chinaunix首页 | 论坛 | 博客
  • 博客访问: 277937
  • 博文数量: 55
  • 博客积分: 2535
  • 博客等级: 少校
  • 技术积分: 585
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-25 16:41
个人简介

Je pense donc je suis.

文章分类

全部博文(55)

文章存档

2014年(11)

2011年(3)

2010年(40)

2009年(1)

我的朋友

分类: LINUX

2011-04-09 16:17:12

法一: 使用\left\{和\right.结合align环境实现,比如下例:
\begin{equation}
 \label{2.1.4}
\left\{\begin{align*}
        u_t+b\cdot \nabla u&=0, \text{ in } \mathbb{R}^n\times(0,\infty), \\
              u&=g, \text{ on } \Gamma:=\mathbb{R}^n\times{t=0.}
       \end{align*}
\right.
\end{equation}

法二:
调用两个宏包subeqnarray和cases ,代码如下
\usepackage{subeqnarray}
\usepackage{cases}

 
\begin{subequations}
\begin{numcases}{}
   3x+4y=5\\
   5x-9y=13
\end{numcases}
\end{subequations}

此法的缺点是不能对齐.

法三: 这是LeoLiu给出的代码(他说是修改了numcases代码后的结果)

%% 用法: 把下面代码放在导言区, 用时用\begin{bracealign}
%% a&=b
%% c&=d
%% 即可.
\makeatletter
\newenvironment{bracealign}
{$$\numc@opts
 \numc@setsub
 \setbox\tw@\vbox\bgroup
  \stepcounter{equation}\def\@currentlabel{\p@equation\theequation}%
  \global\@eqnswtrue\m@th \everycr{}\tabskip\numc@left\let\\\@eqncr
  \halign to\dimen@ii \bgroup \kern1em % assume width of brace
    \tabskip\z@skip \global\@eqcnt\@ne \hfil$\displaystyle{##}$%
   &\global\@eqcnt\tw@
    $\displaystyle{}##$\unskip\hfil\tabskip\@centering% \unskip removes space if no explanations
   &\global\@eqcnt\thr@@\hbox to\z@\bgroup\hss##\egroup\tabskip\z@skip\cr
}{\@@eqncr \egroup % end \halign, which does not contain first column or brace
 \global\advance\c@equation\m@ne
%Measure the natural width of the alignment
 \unskip\unpenalty\unskip\unpenalty \setbox\z@\lastbox % grab last line
 \nointerlineskip \copy\z@ % then put it back
 \global\dimen@i\wd\z@
 \setbox\z@\hbox{\hskip-\numc@left\unhbox\z@}% Measure its natural width
 \ifdim \wd\z@<\dimen@i \global\dimen@i\wd\z@ \fi
\egroup% end \vbox (box\tw@, box\z@ is restored to LHS)
\hbox to\dimen@ii{\m@th % assemble the whole equation
  \hskip\numc@left
  \hbox to\dimen@i{$\displaystyle
    \dimen@\ht\tw@ \advance\dimen@\dp\tw@ % get size of brace
    \left\{\vcenter to\dimen@{\vfil}\right.\n@space % make brace
    $\hfil}\hskip\@centering % finished first part (filled whole line)
  \kern-\dimen@ii % backspace the full width
  $\vcenter{\box\tw@}$% overlay the alignment
 }% end the \hbox to\dimen@ii
\numc@resetsub
$$\global\@ignoretrue}
\makeatother

法四: 使用empheq包, 如下例所示:
%%%%%%%%%%%%%%% 此例使用包empheq, 可实现左边带大括号的方程组, 并且可以给每个方程编号, 用\nonumber可以实现某个方程不编号
\documentclass{article}
 \usepackage{empheq}

 \begin{document}

 \begin{subequations}
 \begin{empheq}[left=\empheqlbrace]{align} %如果要实现f(x)=, 则只要使用[left={f(x)=}\empheqlbrace]即可, 如果使用{align*}则不对方程编号.
 a_1(x) &= b_1\\
 a_2(x) &= b_2\nonumber\\
 a_3(x) &= b_3
 \end{empheq}
 \end{subequations}
\end{document}

但是请注意, 目前这个包的主要问题是, 环境empheq不能嵌入到eqnarray, align等环境中, 十分遗憾!
阅读(2578) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~