summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/multirow/bigdelim.sty
blob: 72eda5ae2dfb267574ed85573a7e4702f22c36c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% bigdelim.sty 
% version 1.0
% Nov 5, 1999
% Piet van Oostrum <piet@cs.uu.nl>
% From bigbrace.sty : Oct 2, 1994 \Oystein Bache <bache@kjemi.unit.no>
%         from: \dobrace by piet@cs.ruu.nl (Piet van Oostrum): 
%%
%% This file may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1 or, at your option, any later version.
%%
%
% Usage in a tabular or array:
% \usepackage{multirow}
% \usepackage{bigdelim}
% \ldelim({n}{w}[text]
% \rdelim){n}{w}[text]
% Use these commands in a column of a tabular or array. They generate a big
% parenthesis/brace extending over the next n rows (including this one).
% The corresponding entries in the next rows must explicitely be given as
% empty cells. The first parameter must be the delimiter to be used, e.g.
% \{ \} [ ] ( ), in fact any parameter that can be used with \left and
% \right. The text is optional and is set centered to the left of
% \ldelim and to the right of \rdelim.  w must be the width reserved for
% the brace and text.  If you have a recent version of multirow.sty {w} may
% be given as {*}, but this may cause the braces to be too small. Also with
% a recent version of multirow.sty the commands may be used in the last row
% of the extension with a negative n parameter. This is useful in
% combination with the colortbl package (see multirow.sty)
% If there are unusually large rows you may have to enlarge n (you can use
% non-integral values). 
% If you have horizontal lines that interact with the braces you are
% advised to use the hhline package to make the lines.

\def\ldelim#1#2#3{\@ifnextchar[{\@ldelim{#1}{#2}{#3}}{\@ldelim{#1}{#2}{#3}[\null]}}
\def\@ldelim#1#2#3[#4]%
 {\multirow{#2}{#3}{%
   \ensuremath
     {\left.\vcenter{\hsize=0pt\vrule height 
           \ifnum #2<0 -\fi#2\baselineskip width 0pt}%
     \textrm{#4}\right#1}}}
%
\def\rdelim#1#2#3{\@ifnextchar[{\@rdelim{#1}{#2}{#3}}{\@rdelim{#1}{#2}{#3}[\null]}}
\def\@rdelim#1#2#3[#4]%
 {\multirow{#2}{#3}{%
   \ensuremath
     {\left#1\vcenter{\hsize=0pt\vrule height 
           \ifnum #2<0 -\fi#2\baselineskip width 0pt}%
       \textrm{#4}\right.}}}
%
\endinput
%
% Example:
\documentclass{article}
\usepackage{multirow}
\usepackage{bigdelim}
\begin{document}

\begin{equation}
  \begin{array}{ccccccc}
    \ldelim({4}{4mm}& x & x & x & x &\rdelim){4}{4mm}  \\
    & x & x & x & x &  & i\\
    & x & x & x & x &  & j\\
    & x & x & x & x &  \\
    &   & u & v &  & 
  \end{array}
\end{equation}
\end{document}