COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### problem with array, delarray

• Email
• Follow

Having some difficulties getting array, and delarray to do what I want.
For example,

\documentclass[11pt]{article}
\usepackage{delarray}

\begin{document}

$\begin{array}({cc}) a & b\\ c & d \end{array}$

\end{document}

compiles fine. But if I try square delimiters

\documentclass[11pt]{article}
\usepackage{delarray}

\begin{document}

$\begin{array}[{cc}] a & b\\ c & d \end{array}$

\end{document}

doesn't compile at all (despite the fact that this is the *same* example
as shown at the bottom of p. 105 of Kopka & Daly - 3rd edition). To get
square delimiters, I need to use

\documentclass[11pt]{article}
\usepackage{delarray}

\begin{document}

$\left[ \begin{array}{cc} a & b\\ c & d \end{array} \right]$

\end{document}

OK, I suppose I can work with that (although it puzzle me why delarray
only seems to play nice with () delimiters -- if true, pretty limited,
no pun intended).

But, the \left \right approach doesn't seem to 'play nice' with the
tabular environment. Ultimately, I'm trying to generate something like
the following

\documentclass[11pt]{article}
\usepackage {delarray}
\begin{document}

\begin{tabular}{ c  @{} c  }
&\begin{tabular}{cc} A & B \end{tabular} \\
\begin{tabular} {c} A \\ B \end{tabular}
&
\begin{tabular} ({cc})
1 & 2 \\
3 & 4\\
\end{tabular}
\end{tabular}

\end{document}

but with square delimiters. If I try

\documentclass[11pt]{article}
\usepackage {delarray}
\begin{document}

$\begin{tabular}{ c @{} c } &\begin{tabular}{cc} A & B \end{tabular} \\ \begin{tabular} {c} A \\ B \end{tabular} & \left( \begin{tabular} {cc} 1 & 2 \\ 3 & 4\\ \end{tabular} \right) \end{tabular}$

\end{document}

doesn't compile. Which means that

\documentclass[11pt]{article}
\usepackage {delarray}
\begin{document}

$\begin{tabular}{ c @{} c } &\begin{tabular}{cc} A & B \end{tabular} \\ \begin{tabular} {c} A \\ B \end{tabular} & \left[ \begin{tabular} {cc} 1 & 2 \\ 3 & 4\\ \end{tabular} \right] \end{tabular}$

\end{document}

won't compile either.

If only blkarray weren't broken. ;-)

Suggestions/solutions?


 0

See related articles to this posting

cooch17@NOSPAMverizon.net wrote:
> Having some difficulties getting array, and delarray to do what I want.
> For example,
>
> \documentclass[11pt]{article}
> \usepackage{delarray}
>
> \begin{document}
>
> $> \begin{array}({cc}) > a & b\\ > c & d > \end{array} >$
>
> \end{document}
>
> compiles fine. But if I try square delimiters
>
> \documentclass[11pt]{article}
> \usepackage{delarray}
>
> \begin{document}
>
> $> \begin{array}[{cc}] > a & b\\ > c & d > \end{array} >$
>
> \end{document}
>
> doesn't compile at all (despite the fact that this is the *same* example
> as shown at the bottom of p. 105 of Kopka & Daly - 3rd edition). To get
> square delimiters, I need to use
>
> \documentclass[11pt]{article}
> \usepackage{delarray}
>
> \begin{document}
>
> $> \left[ > \begin{array}{cc} > a & b\\ > c & d > \end{array} > \right] >$
>
> \end{document}
>
> OK, I suppose I can work with that (although it puzzle me why delarray
> only seems to play nice with () delimiters -- if true, pretty limited,
> no pun intended).
>
> But, the \left \right approach doesn't seem to 'play nice' with the
> tabular environment. Ultimately, I'm trying to generate something like
> the following
>
> \documentclass[11pt]{article}
> \usepackage {delarray}
> \begin{document}
>
> \begin{tabular}{ c  @{} c  }
>     &\begin{tabular}{cc} A & B \end{tabular} \\
>  \begin{tabular} {c} A \\ B \end{tabular}
>  &
>  \begin{tabular} ({cc})
>   1 & 2 \\
>   3 & 4\\
>   \end{tabular}
> \end{tabular}
>
> \end{document}
>
> but with square delimiters. If I try
>
> \documentclass[11pt]{article}
> \usepackage {delarray}
> \begin{document}
>
> $> \begin{tabular}{ c @{} c } > &\begin{tabular}{cc} A & B \end{tabular} \\ > \begin{tabular} {c} A \\ B \end{tabular} > & > \left( > \begin{tabular} {cc} > 1 & 2 \\ > 3 & 4\\ > \end{tabular} > \right) > \end{tabular} >$
>
> \end{document}
>
> doesn't compile. Which means that
>
> \documentclass[11pt]{article}
> \usepackage {delarray}
> \begin{document}
>
> $> \begin{tabular}{ c @{} c } > &\begin{tabular}{cc} A & B \end{tabular} \\ > \begin{tabular} {c} A \\ B \end{tabular} > & > \left[ > \begin{tabular} {cc} > 1 & 2 \\ > 3 & 4\\ > \end{tabular} > \right] > \end{tabular} >$
>
> \end{document}
>
>
> won't compile either.
>
> If only blkarray weren't broken. ;-)
>
> Suggestions/solutions?
>

see 'texdoc delarray'

and you will see why [ does not work as expected, array is changed such
that

\begin{array}[t]({c})

is supported

have you tried blkarray instead? delarray is from 1994 (apparently)

--

/daleif (remove RTFSIGNATURE from email address)

Memoir and mh bundle maintainer
LaTeX FAQ:      http://www.tex.ac.uk/faq
LaTeX book:     http://www.imf.au.dk/system/latex/bog/  (in Danish)
Remember to post minimal examples, see URL below
http://www.minimalbeispiel.de/mini-en.html

 0

Lars Madsen wrote:
> cooch17@NOSPAMverizon.net wrote:
>> Having some difficulties getting array, and delarray to do what I
>> want. For example,
>>
>> \documentclass[11pt]{article}
>> \usepackage{delarray}
>>
>> \begin{document}
>>
>> $>> \begin{array}({cc}) >> a & b\\ >> c & d >> \end{array} >>$
>>
>> \end{document}
>>
>> compiles fine. But if I try square delimiters
>>
>> \documentclass[11pt]{article}
>> \usepackage{delarray}
>>
>> \begin{document}
>>
>> $>> \begin{array}[{cc}] >> a & b\\ >> c & d >> \end{array} >>$
>>
>> \end{document}
>>
>> doesn't compile at all (despite the fact that this is the *same*
>> example as shown at the bottom of p. 105 of Kopka & Daly - 3rd
>> edition). To get square delimiters, I need to use
>>
>> \documentclass[11pt]{article}
>> \usepackage{delarray}
>>
>> \begin{document}
>>
>> $>> \left[ >> \begin{array}{cc} >> a & b\\ >> c & d >> \end{array} >> \right] >>$
>>
>> \end{document}
>>
>> OK, I suppose I can work with that (although it puzzle me why delarray
>> only seems to play nice with () delimiters -- if true, pretty limited,
>> no pun intended).
>>
>> But, the \left \right approach doesn't seem to 'play nice' with the
>> tabular environment. Ultimately, I'm trying to generate something like
>> the following
>>
>> \documentclass[11pt]{article}
>> \usepackage {delarray}
>> \begin{document}
>>
>> \begin{tabular}{ c  @{} c  }
>>     &\begin{tabular}{cc} A & B \end{tabular} \\
>>  \begin{tabular} {c} A \\ B \end{tabular}
>>  &
>>  \begin{tabular} ({cc})
>>   1 & 2 \\
>>   3 & 4\\
>>   \end{tabular}
>> \end{tabular}
>>
>> \end{document}
>>
>> but with square delimiters. If I try
>>
>> \documentclass[11pt]{article}
>> \usepackage {delarray}
>> \begin{document}
>>
>> $>> \begin{tabular}{ c @{} c } >> &\begin{tabular}{cc} A & B \end{tabular} \\ >> \begin{tabular} {c} A \\ B \end{tabular} >> & >> \left( >> \begin{tabular} {cc} >> 1 & 2 \\ >> 3 & 4\\ >> \end{tabular} >> \right) >> \end{tabular} >>$
>>
>> \end{document}
>>
>> doesn't compile. Which means that
>>
>> \documentclass[11pt]{article}
>> \usepackage {delarray}
>> \begin{document}
>>
>> $>> \begin{tabular}{ c @{} c } >> &\begin{tabular}{cc} A & B \end{tabular} \\ >> \begin{tabular} {c} A \\ B \end{tabular} >> & >> \left[ >> \begin{tabular} {cc} >> 1 & 2 \\ >> 3 & 4\\ >> \end{tabular} >> \right] >> \end{tabular} >>$
>>
>> \end{document}
>>
>>
>> won't compile either.
>>
>> If only blkarray weren't broken. ;-)
>>
>> Suggestions/solutions?
>>
>
> see 'texdoc delarray'
>
> and you will see why [ does not work as expected, array is changed such
> that
>
> \begin{array}[t]({c})
>
> is supported
>
> have you tried blkarray instead? delarray is from 1994 (apparently)
>
>

sorry did't read all the text

--

/daleif (remove RTFSIGNATURE from email address)

Memoir and mh bundle maintainer
LaTeX FAQ:      http://www.tex.ac.uk/faq
LaTeX book:     http://www.imf.au.dk/system/latex/bog/  (in Danish)
Remember to post minimal examples, see URL below
http://www.minimalbeispiel.de/mini-en.html

 0

Le 22/03/2011 16:18, cooch17@NOSPAMverizon.net a �crit :
> Having some difficulties getting array, and delarray to do what I want.
> For example,
>
> $> \begin{array}({cc}) > compiles fine. But if I try square delimiters > >$
> \begin{array}[{cc}]

SYNTAX ? \begin{array} [ outer alignment ]
<delarray left> { preamble } <delarray right>

Well. So: \begin{array} [ => [{cc}] => outer alignment = {cc}
=> where is the preamble ????

$\begin{array} [c] [{cc}] ... \end{array}$

With tabu it's also possible to say:

$\begin{tabu} [] [{cc}] ... \end{tabu}$

then the default outer alignment is used... next release next ;-)

Regards.

 0

Le 22/03/2011 16:48, GL a �crit :
> Le 22/03/2011 16:18, cooch17@NOSPAMverizon.net a �crit :
>> Having some difficulties getting array, and delarray to do what I want.
>> For example,
>>
>> $>> \begin{array}({cc}) >> compiles fine. But if I try square delimiters >> >>$
>> \begin{array}[{cc}]
>
> SYNTAX ? \begin{array} [ outer alignment ]
> <delarray left> { preamble } <delarray right>
>
> Well. So: \begin{array} [ => [{cc}] => outer alignment = {cc}
> => where is the preamble ????
>
>
> $\begin{array} [c] [{cc}] ... \end{array}$
>
> With tabu it's also possible to say:
>
> $\begin{tabu} [] [{cc}] ... \end{tabu}$
>
> then the default outer alignment is used... next release next ;-)

In fact, braces are mandatory around the tabular/array preamble, at
least when delarray.sty is loaded. For tabu they are always mandatory.

Then I will implement the test so that
$\begin{tabu} [{cc}] ... will be possible ! Thanks. > > Regards.   0 Reply GL 3/22/2011 3:53:22 PM > > see 'texdoc delarray' > > and you will see why [ does not work as expected, array is changed such > that > > \begin{array}[t]({c}) > > is supported So, only () delimiters? Alas, then useless for me. > > have you tried blkarray instead? delarray is from 1994 (apparently) > > blkarray is broken, and delarray is overly limited. So, for the moment, there seems to be no way to take the following and put square brackets around the matrix. I can hear my editor now ('Gee, you could do this with MathType in Word in about 10 seconds...'). Free virtual beer for anyone who can figure out a solution. All I want is to generate something like...(where the braces are contiguous on left and right sides). A B A [1 2] B [3 4] \documentclass[11pt]{article} \usepackage {delarray} \begin{document}$
\begin{tabular}{ c  @{} c  }
&\begin{tabular}{cc} A & B \end{tabular} \\
\begin{tabular} {c} A \\ B \end{tabular}
&
\begin{tabular} ({cc})
1 & 2 \\
3 & 4\\
\end{tabular}
\end{tabular}
$\end{document}   0 Reply cooch17 3/22/2011 4:00:19 PM On 3/22/2011 11:48 AM, GL wrote: > Le 22/03/2011 16:18, cooch17@NOSPAMverizon.net a �crit : >> Having some difficulties getting array, and delarray to do what I want. >> For example, >> >>$
>> \begin{array}({cc})
>> compiles fine. But if I try square delimiters
>>
>> >> \begin{array}[{cc}] > > SYNTAX ? \begin{array} [ outer alignment ] > <delarray left> { preamble } <delarray right> > > Well. So: \begin{array} [ => [{cc}] => outer alignment = {cc} > => where is the preamble ???? Why do I need one? Never needed one for any other tables I've generated. I digress... > > >\begin{array} [c] [{cc}] ... \end{array}$> > With tabu it's also possible to say: > >$\begin{tabu} [] [{cc}] ... \end{tabu}> > then the default outer alignment is used... next release next ;-) > > Regards. So
\begin{array}[alignment][{cc}]
a & b\\
c & d
\end{array}
works. Thanks -- so apparently, alignment is needed only for non-() delimiters? Strange...   0 Reply cooch17 3/22/2011 4:09:28 PM cooch17@NOSPAMverizon.net wrote: > >> >> see 'texdoc delarray' >> >> and you will see why [ does not work as expected, array is changed such >> that >> >> \begin{array}[t]({c}) > > > > > >> >> is supported > > > So, only () delimiters? Alas, then useless for me. > >> >> have you tried blkarray instead? delarray is from 1994 (apparently) >> >> > > > blkarray is broken, and delarray is overly limited. So, for the moment, > there seems to be no way to take the following and put square brackets > around the matrix. I can hear my editor now ('Gee, you could do this > with MathType in Word in about 10 seconds...'). > > Free virtual beer for anyone who can figure out a solution. All I want > is to generate something like...(where the braces are contiguous on left > and right sides). > > A B > A [1 2] > B [3 4] > > > \documentclass[11pt]{article} > \usepackage {delarray} > \begin{document} > >
> \begin{tabular}{ c  @{} c  }
>     &\begin{tabular}{cc} A & B \end{tabular} \\
>  \begin{tabular} {c} A \\ B \end{tabular}
>  &
>  \begin{tabular} ({cc})
>   1 & 2 \\
>   3 & 4\\
>   \end{tabular}
> \end{tabular}
> $> > \end{document} I do not quite see the problem \documentclass[11pt]{article} \usepackage{blkarray} \begin{document} $\begin{blockarray}{ccc} & A & B\\ \begin{block}{c[cc]} A & 1 & 2 \\ B & 3 & 4\\ \end{block} \end{blockarray}$ \end{document} seem to give me what you asked for -- /daleif (remove RTFSIGNATURE from email address) Memoir and mh bundle maintainer LaTeX FAQ: http://www.tex.ac.uk/faq LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish) Remember to post minimal examples, see URL below http://www.minimalbeispiel.de/mini-en.html   0 Reply Lars 3/22/2011 4:10:55 PM cooch17@NOSPAMverizon.net wrote: > On 3/22/2011 11:48 AM, GL wrote: >> Le 22/03/2011 16:18, cooch17@NOSPAMverizon.net a �crit : >>> Having some difficulties getting array, and delarray to do what I want. >>> For example, >>> >>>$
>>> \begin{array}({cc})
>>> compiles fine. But if I try square delimiters
>>>
>>> >>> \begin{array}[{cc}] >> >> SYNTAX ? \begin{array} [ outer alignment ] >> <delarray left> { preamble } <delarray right> >> >> Well. So: \begin{array} [ => [{cc}] => outer alignment = {cc} >> => where is the preamble ???? > > > Why do I need one? Never needed one for any other tables I've generated. > I digress... > >> >> >>\begin{array} [c] [{cc}] ... \end{array}$>> >> With tabu it's also possible to say: >> >>$\begin{tabu} [] [{cc}] ... \end{tabu}>> >> then the default outer alignment is used... next release next ;-) >> >> Regards. > > > So > >
> \begin{array}[alignment][{cc}]
> a & b\\
> c & d
> \end{array}
> > > works. Thanks -- so apparently, alignment is needed only for non-() > delimiters? Strange... parsing issues -- /daleif (remove RTFSIGNATURE from email address) Memoir and mh bundle maintainer LaTeX FAQ: http://www.tex.ac.uk/faq LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish) Remember to post minimal examples, see URL below http://www.minimalbeispiel.de/mini-en.html   0 Reply Lars 3/22/2011 4:11:30 PM Le 22/03/2011 17:09, cooch17@NOSPAMverizon.net a �crit : > On 3/22/2011 11:48 AM, GL wrote: >> Le 22/03/2011 16:18, cooch17@NOSPAMverizon.net a �crit : > > > So > >
> \begin{array}[alignment][{cc}]
> a & b\\
> c & d
> \end{array}
> > > works. Thanks -- so apparently, alignment is needed only for non-() > delimiters? Strange... The default *outer* alignment for array is centered [c]. Normal in math mode ! The default for tabular is [c] as well while for tabu it is [c] in math mode and [t] in text mode... As Lars said: TeX reads: \begin{array} [ and then while it sees "the character [" it thinks "there is an outer alignment specification". U Understand ? So you need to give an *explicit* *outer* alignment spec only when you use brackets delimiters [ and ]. Now I thank you because I improved tabu in order not to get into this problem: TeX sees "the character [" and looks forward then it sees "the character {" and thinks "it's not the outer alignment but the preamble..." As long as the outer alignment il always a single letter, the user who writes [{c}] for a centered outer alignment is wrong... Well that's all folks: with brackets, array and tabular require an explicit outer alignement specification. Best regards.   0 Reply GL 3/22/2011 6:49:49 PM cooch17@NOSPAMverizon.net writes: >> >> see 'texdoc delarray' >> >> and you will see why [ does not work as expected, array is changed such >> that >> >> \begin{array}[t]({c}) >> >> is supported > > So, only () delimiters? Alas, then useless for me. no. the doc shows an example with \{\} delimiters, and \begin{array}[t][{cc}] works for me. if you omit the optional argument, and then try for [] delimiters, the environment will be confused enough to imagine that you're giving it an optional argument. hence the structure of my example, with the optional argument given even though not strictly (otherwise) needed. -- Robin Fairbairns, Cambridge my address is @cl.cam.ac.uk, regardless of the header. sorry about that.   0 Reply Robin 3/22/2011 9:27:44 PM <cooch17@NOSPAMverizon.net> wrote: > So, only () delimiters? Alas, then useless for me. You can use also \begin{array}\lbrack{...}\rbrack or any other pair of delimiters. Did you try the bmatrix environment of amsmath? Ciao Enrico   0 Reply Enrico 3/22/2011 9:37:50 PM 11 Replies 114 Views Similar Articles 12/19/2013 5:57:47 PM page loaded in 47056 ms. (0)  Reply: Similar Artilces: problem making an array of arrays (of arrays) Hey, bit of a ruby noob here :) First, hello ruby-forum community. So, here is my problem. I want to create a 5x5 grid, however, each of the 'cells' in the grid should be able to hold a variety of values. Firstly, I started off with this: @row_1 = ['x','x','x','x','x'] @row_2 = ['x','x','x','x','x'] @row_3 = ['x','x','x','x','x'] @row_4 = ['x','x','x','x','x'] @row_5 = ['x','x'... Sorting problem with an Array of Arrays Hi there, I have an array of arrays that looks like the following: arr1 = [["ABC-1", 1271768400, 2], ["ABC-2", 1271773800, 1], ["ABC-3", 1271863200, 2], ["ABC-4", 1271869200, 2], ["AAA-1", 1271862000, 2], ["DEF-1", 1271772000, 1]] Desired sort order: (1) label (1st element = all unique) (2) different labels (e.g. AAA, DEF) need to be inserted according to timestamp (2nd element), but maintain (1) label sort order; so AAA-2 can't come before AAA-1. (I don't have that data point here but it happens) => I ... problem determining uniqueness in array of arrays I create an array of arrays, each inner array containing the mtime value and fully qualified pathname of a file. sources = [ [ mtime.to_i, "filename" ], [. . . ] ] It happens that the same file is occasionally added twice or more. I want to eliminate the duplicates. I thought that sources.uniq! would work but I was surprised to discover that it returned nil indicating that there were no duplicates found. I then tried sources.uniq.sort to see if this was true and saw this: 1276181402 acrfile.0610104802 1276181402 acrfile.0610104802 ... Problem with assigning 1D array to a 2D array I am trying to write a program with a function int** One2Two(int *a, int si= ze, int (*A)[10]) that takes the address of a1D int array (A1) , the size o= f A1 and the address of a 2D int array (A2). The function should copy the v= alues of A1 and store them in A2 as suggested by the pattern below: =20 If A1 is 1, 2, 3:=20 then A2 should be 1 0 0 1 2 0 1 2 3 If A1 is 1, 2, 3, 4, 5: then A2 should be 1 0 0 0 0 1 2 0 0 0 1 2 3 0 0 1 2 3 4 0 1 2 3 4 5 My program is given b... Problem with an array I have the following line: if(newValidate->isNotEmpty($this->userName) &&$newValidate->isNotEmpty($this->passWord)) which checks to see if two text boxes contain any data. However if both boxes are empty, it only displays the error message once. Below is the Validate class. <?php class Validate { private$valueToCheck; private $errorMessage; function printErrorMessage () { print$this->errorMessage[0]; print $this->errorMessage[1]; } function isNotEmpty($valueToCheck) { if (!empty($valueToCheck)) { return TRUE; } else {$message = "A field is empty....

An array problem.
Brain Lock I can't get my brain working this morning. set LTR(0) 0 set f [lindex [split $zy ,] 1] set dj [list$f $zy] puts stdout$dj LTR {Some String} if {[string range $zy 0 7] != "SIN,CNV,"} {\ putkey2 "TRN,$SIN_INDEX" "dload TRN cmd EDC" array set L $dj eval incr${f}(0) 1 if I did this all by typing this line: set ${f}(${f}(0)) "$SIN_INDEX,$zy,$zzf,$digest" would look like this: set LTR(1) "$SIN_INDEX,$zy,$zzf,$digest" } IOW how do I get LTR(${f}(0)) to use 1 or whatever number is assigned to the array LTR(0). TI... array problem I have a nasty problem with arrays, just the kind you like! I have a set of arrays that I'm using throughout a process. These arrays get set and unset pretty regularly. I know that the base node in the array will always be populated, but I'm dynamically building subsequent nodes each time through the process, with a variable size to the array. What I'm trying to do is to elminate all nodes on the array, except the 0 node, at the end of each pass through this process. I'm trying to use "array unset" with a pattern match directly from the node on the array i'm ... Problem with Arrays and For Each What I am trying to do is get all the information in the text area into the database. But what happens with this script, is that for each$div, a NEW entry gets put into the database. I want EVERYTHING in the text area into ONE new entry in the database... echo '<textarea name="style" cols="50" rows="5" onClick="this.focus();this.select()">'; foreach($match[0] as$div) { $div = str_replace('\'', '"',$div); echo $div; } ?> <?php echo "</textarea>";$sql = mysql_query("INSERT INT...

Problem in array
HI all I am facing a small problem in array. I am placing the values of the select list in an array. Now I want to check if any of the values in the array is greater then the "0.0" . I had used the following command: if ((p[x] >= 0.0)) puts "true" else puts "false" end. I am getting the following error: Loaded suite login Started Web page opened successfully They can be used E Finished in 16.074 seconds. 1) Error: test_b_add_activity(TestCase): NoMethodError: undefined method >=' for nil:NilClass login.rb:111:in test_b_add_activity&#...