xcolor, \rowcolors and array environments

Is it a bug or a feature? (Or how do I disable alternating row colors
in math mode, while still using them outside?)

\documentclass{article}
\usepackage[table]{xcolor}
\rowcolors{2}{red!50}{blue!50}
\begin{document}
$a = \left(\begin{array}{c} 1\\ 2\\ 3 \end{array}\right)$
\end{document}

Thanks,
Dominik

 0
Dominik
9/11/2010 12:42:41 AM
comp.text.tex 37520 articles. 0 followers.

3 Replies
974 Views

Similar Articles

[PageSpeed] 25
Am 11.09.2010 02:42, schrieb Dominik Menke:
> Is it a bug or a feature? (Or how do I disable alternating row colors
> in math mode, while still using them outside?)
>
> \documentclass{article}
> \usepackage[table]{xcolor}
> \rowcolors{2}{red!50}{blue!50}
> \begin{document}
> $a = \left(\begin{array}{c} \hiderowcolors 1\\ 2\\ 3 \end{array}\right)$
> \end{document}

Herbert

 0
Herbert
9/11/2010 10:28:36 AM
On Sep 11, 5:28=A0am, Herbert Voss <Herbert.V...@FU-Berlin.de> wrote:
> Am 11.09.2010 02:42, schrieb Dominik Menke:> Is it a bug or a feature? (O=
r how do I disable alternating row colors
> > in math mode, while still using them outside?)
>
> > \documentclass{article}
> > \usepackage[table]{xcolor}
> > \rowcolors{2}{red!50}{blue!50}
> > \begin{document}
> > $a =3D \left(\begin{array}{c} > > \hiderowcolors > =A0 1\\ 2\\ 3 \end{array}\right)$
>
> > \end{document}
>
> Herbert

That is a little inconvenient when there are a lot of
math alignments. It would be better if xcolor.sty
defined a switch to just turn table colors off for the
rest of the document or current group (and one
to turn them back on, of course). I had some success
with the following. However, I didn't test it very much.

\makeatletter
\def\stoprowcolors{\@rowcolorsfalse}
\def\startrowcolors{\@rowcolorstrue}
\makeatother
\everymath{\stoprowcolors}

The problem with \hiderowcolors is that it must occur within
the relevant alignment (its definition starts with \noalign).
A command like \stoprowcolors would be usable elsewhere.

It would also be nice if xcolor.sty could provide a "nomath"
option for row colors.

Dan

 0
Dan
9/11/2010 5:54:14 PM
> It would also be nice if xcolor.sty could provide a "nomath"
> option for row colors.

I'd prefer that way too. I also tried to rewrite the \rowcolors
command, by I already failed on the extraction from xolors.sty...

Dominik


 0
Dominik
9/14/2010 12:15:13 PM
Similar Artilces:

Fortran MEX: How to copy a matlab cell array into a fortran string array
Hello everyone, novice MEX programmer here, so please excuse my inexperience. I'm trying to pass a cell array of strings from matlab into a fortran mex file, and ultimately assign that data into a fortran variable full of strings that will be used in a pre-existing fortran subroutine. So, within matlab, I have something like: strings{1}='100' strings{2}='50' strings{3}='301' (Notice that the string lengths are dissimilar in general, which makes the cell array useful in this case.) I then take those strings, and pass them into a mex-function that I am wri...

creating an array of arrays from a matrix
I have a 469x260 matrix of numbers. I'm wondering if there is a way I can turn this into a 469x1 array of arrays. So, I want to turn each row of numbers into a single array and store those 469 horizontal arrays in a single verticle array. So it would look like this: 1 [[ 1 2 3 4 5 6] 2 [ 7 8 9 1 2 3] 3 [ 4 5 6 7 8 9] ..... .... 469 [ 1 2 3 4 5 6]] Is it possible to do this without a loop? Thanks "Joe " <mccclxxxv@gmail.com> wrote in message news:h2io6f$5k8$1@fred.mathworks.com... >I have a 469x260 matrix of numbers. ...

Brace a group of equations in gather environment...
In the following minimal example, there are two sets of equations that are 'grouped together' with a \left\{...\right. combination. How would one go about numbering/labelling the individual equations? \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} \left\{ \begin{aligned} f(x)=2x^2+2 \\ g(x)=4x^4+4 \end{aligned} \right. \\ h(x)=6x^6+6 \\ \left\{ \begin{aligned} i(x)=8x^8+8 \\ j(x)=10x^{10}+10 \end{aligned} \right. \end{align*} \end{document} Thanks in advance, Werner ...

FAQ 4.54 Why does defined() return true on empty arrays and hashes? #9
This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 4.54: Why does defined() return true on empty arrays and hashes? The short story is that you should probably only use defined on scalars or functions, not on aggregates (arrays and hashes). See "defined" i...

recursive array
207:0> a = [1,2,3,4] [1, 2, 3, 4] 208:0> a[4] = a [1, 2, 3, 4, [...]] 209:0> a[4] [1, 2, 3, 4, [...]] 210:0> a[4][4] [1, 2, 3, 4, [...]] 211:0> a[4][4][4][4][4][3] 4 have you ever used this technique? can you provide some example code for us which illustrates any kind of usefulness of this that you can imagine? also, I'm interested in what is going on "behind the scenes" here. is a[4][4][4][4][0] actually reaching in 4 levels deep? On 10/22/07, Simon Schuster <significants@gmail.com> wrote: > 207:0> a = [1,2,3,4] > [1, 2, 3, 4] > 208:0> a[4...

checkbox array problem
Hi I have a form which contains several fields. One of which is a group of checkboxes that can all be selected, and if they are - all values should be passed as an array. Each checkbox is Named as follows. myCheckBoxName[] myCheckBoxName[] I have the following code on the following page to pick up the results from the querystring. while(list($key,$value) = each($HTTP_POST_VARS)) {$keys = $keys . "$key, "; $values=$values . "'$value', "; echo("$key = $value <br>" ); } But the field which contains multiple checkboxes only displays the v... Accessing Individual rows from a multidimensional array passed to a function I am having accessing individual rows from a multidimensional array pass to a function as reference CODE: function Declaration int Part_Buffer(char (*buffer)[_MAX_SIZE],int Low, int High) Function call pivot = Part_Buffer(buffer,0, high); when I do a print of buffer[0] it prints all the contents of the buffer but not the first row element. How do I access the individual elements from each row in that buffer. I need to pass the buffer as a reference as I need to do a quicksort on the elements in the buffer Could anyone let me know how I could do this. Thanks. ....vagrahb wrote: ... Novice array size Why this below crashes (when the executable is run)? Is there a way to avoid it? When I replace n=700-1 by n=100-1 it works but I really need large values of n how can I deal with it? Thanks #include <stdio.h> int main() { int i, j, n= 700-1; int size=(n*(n-1)); double tabP [size] [3]; for(j=0;j< 3;j++) { for (i=0;i<size;i++) { tabP[i] [j]=0.0; printf("%f",tabP[i] [j]); } } Le Tue, 3 Mar 2009 23:39:04 -0800 (PST), Francogrex a =C3=A9crit : > Why this below crashes (when the executable is run)? Is there a way to > avoid it? When I repla... Processing Cell Array of Cell Array of Strings Hi, So I have a cell array of a cell array of strings that I am working with. As an example consider the following: test=cell(5,1); test{1,1}{1}=num2str(1); test{1,1}{2}=num2str(0); test{2,1}{1}=num2str(0); test{2,1}{2}=num2str(0); test{3,1}{1}=num2str(1); test{3,1}{2}=num2str(1); test{4,1}{1}=num2str(0); test{4,1}{2}=num2str(0); test{4,1}{3}=num2str(0); test{5,1}{1}=num2str(0); test{5,1}{2}=num2str(1); test{5,1}{3}=num2str(0); I want to process this cell array of cell array of strings so that the inside cell array is removed to make it easier to analyze and look at the... Problem with XColor (can't get right color ???) Hi everyone I am using this in my code Colormap cmap = DefaultColormap( display, screen ); XColor temp; temp.red = temp.green = temp.blue = 128; XAllocColor( display, cmap, &temp ); XSetForeground( display, gc, temp.pixel ); It is very simple and I checked other examples on the web, but when I set temp to be what I would think would be grey, I get some sort of yellow ???? I tried many different things but can't seem anything consistent. If I set red = 255, green = 0, blue = 0, I get red, etc. It's when I try to get non-pure color and greys that it doesn... Two dimensional array problem #2 I have a two dimensional array, [12][31], and I have it made as a calender where the days are filled with some information. But some months, like february only has 28 days so I havent filled 29 30 and 31. But now I want to make some calculations on these numbers, and divide them by all the days. But the problem is they also count the array fields like february 29 , 30 and 31 wich is empty..I tried a for loop where if col < table[row].length && table[row][col] != null. But that didnt work, how can I do this? Someone suggested for me to try yourArray[1] = new int SomeType[28]; But ... Simple question on cloneing array I have a bug I have written and I have found. Here is the code. I want a way to "clone" an array. I think I have to create a new array and copy every item over 1 by 1. Is this correct. My code is below showing what I am doing. Thanking you Michelle public static void main(String[] args) { int[] intArray1=new int[]{1,2,3,4}; int[] intArray2; intArray2=intArray1; intArray1[0]=99; //This displays 99 and I am wanting it to display 1 //as 1 is in position 0 in intArray1 (showing below //intArray2) System.out.println(intArray2[0]); } Try this: p... Single dim array as a multidim array? Please could someone tell me how to use a single-dimensional array as a two-dimensional array? Is the following correct: int ROW_SIZE = 5; int COL_SIZE = 3; int *arr = (int*) malloc(sizeof(int) *ROW_SIZE*COL_SIZE); arr[i *COLUMN_SIZE + j]; will this only work for square arrays or all two-dim arrays ? Thanks :) Sona Sona <sona.gardner@nospam.net> wrote in <3f534c51$1@clarion.carno.net.au>: >Please could someone tell me how to use a single-dimensional array as a >two-dimensional array? Is the following correct: > >int ROW_SIZE = 5; >int COL_SIZE = 3; > &g...

What's lost, Raid 0 array or partition?
My motherboard is ABIT KT7A Raid, on which I built a raid 0 with two identical hard disks (WD 2X60G, 7200prm). Now my problem is, in the Highpoint BIOS, I still can see the array of raid 0, but the computer cannot be booted, saying no system found. I attemped to boot from XP installation CD but it recognized the two disks separately (should be one in raid 0), and both of them are detected as unpartitioned. Before I strike to restore the raid/data, I'd like to be sure which part makes the problem? Is raid array bad or the partition is lost, or both? If you know any good software (...

Putting an array within an array?
Still having fun trying to build the perfect form and validation classes and wondered if anyone can help on the following. In the following function, how can I make $validationparameters an array so it can accept multiple values that I can iterate through? Don't need the iteration part (yet). function setField($type, $name,$value, $style,$label, $validationparameter) {$this->number_of_fields++; $this->fields[] = array('type'=>$type, 'name'=>$name, 'value'=>$value, 'style'=>$style, 'label'=>$label, 'validationp...

Initialization of array by vector
Is there any way to initialize array by vector ? vector<double> v (10, 1.23); double a[] = <initialization by 'v'> -- Alex Vinokur mailto:alexvn@connect.to http://mathforum.org/library/view/10978.html Alex Vinokur wrote: > Is there any way to initialize array by vector ? > > vector<double> v (10, 1.23); > double a[] = <initialization by 'v'> No. You didn't specify a size for a, so it must get the size from the initializer, which must be known at compile time. The closest you can get would be a dynamically allocated ...

Re: help pretty please ? ....arrays and macros
On Mon, 13 Jun 2005 16:51:04 -0700, moava <claire.moava.sherrington@GMAIL.COM> wrote: >help , pretty please ? > >In the code line : >" >%tmfilter(url=&lance_articles{i}.,depth=1,dir=c:\Tour_de_france\dir,destdir=c:\Tour_de_france\destdir,norestrict=1,dataset=Lancearticles); >" >&lance_articles{i}. doesnt work and gettings the error : >"ERROR: A character operand was found in the %EVAL function or %IF >condition where a numeric operand is required. The condition was: >%bquote(&url) NE" > >How do you call an array value f...

FAQ 4.40 What is the difference between $array[1] and @array[1]? #2 #9 This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 4.40: What is the difference between$array[1] and @array[1]? The former is a scalar value; the latter an array slice, making it a list with one (scalar) value. You should use \$ when you want a scalar value (mos...

NULL in arrays
A person (cross) in the irc channel have found a bug with the new arrays. Here is what I did to reproduce: dennis=# CREATE TABLE foo (a int[]); CREATE TABLE dennis=# INSERT INTO foo VALUES (ARRAY[2,NULL]); INSERT 25353 1 That last insert contains a NULL value which are not allowed in arrays and yet a insert is performed. The table contains a NULL value afterwards (and no array). This is something that should be fixed for 7.4.2, so that it gives an error instead of inserting bad data. -- /Dennis Bj�rklund ---------------------------(end of broadcast)-----------------...

Sorting Multiple Arrays Together in C++
I was wondering if there was a quick and easy way to sort multiple arrays in C++. What I mean is that, say I have 3 integer arrays. They are in order by array indices (array1[0] corresponds to array2[0] and array3[0], etc). I want to do something exactly like the Excel sort of "Sort by A, then by B, then by C". Meaning, sort array A in ascending order, then inside of that sort B in ascending order, etc. Here is some pseudo code for what I'm trying to do: array1 = [1, 1, 2, 2, 3, 3]; array2 = [2, 1, 2, 1, 2, 1]; array3 = [1, 2, 3, 4, 5, 6]; sort_1_then_2_then_3(); array1 = [1, ...

Convert Array of Structures to Structure of arrays??
What is the most efficient way to convert from a Array of Structures to Structure of arrays (other than a for loop)?? I have a text file (xyz.txt with headerlines) and the data is not consistent, i.e. the first set of data to be extracted is X lines and second set is Y lines etc. I used textscan to read each block and then cell2mat to get the data as a vector within a cell. So finally, I get a cell with all the data (i.e., each block as an array). I converted the cell to an array of structures (this is a pain to process). Now, few of those blocks in the cell/structure have to be combined...

Loops and arrays
I need to through a matrix, then store the numbers. It's a m-by-2 matrix. I'm going through it with a for loop. Like so: rows = size (mtx, 1); for i = 1 : rows var = m (i, :); if m(2) is in A{something} if m(3) is in A{something} continue (ignore) else store m(3) in A{something} end else if m(3) is in A{something} store m(2) in A{something} else store both m(2) and m(3) in A{Newsomething} end end end With A being a cell array. Is it possible? And how can I do it? The...

Objects with dynamic arrays in heap?
Hello ! I'm using FreePascal 1.9.4. Is there any other Pascal-Compiler besides FreePascal which supports Dynamic arrays ? My program compiles without errors but I get runtime-errors. In my program I created an array of 16 objects. Each object contains the following fields: 3 * STRING 1 * SMALLRANGE [<-Integer-Type with range 1..16] 3 * LARGERANGE [<-Integer-Type with range 1..20] 4 * ARRAY OF SMALLRANGE [<-dynamic, max. 20 elements] 1 * BOOLEAN The first two objects are initialized correctly. But at some point I get the error 216 - according to the manuals: ...

change the background of one control in an array of clusters
I have a cluster within an array and I would like to programatically change the background of one of the controls based on its value. > I have a cluster within an array and I would like to programatically > change the background of one of the controls based on its value. Arrays have a single item that they move from cell to cell. The cells can have different values, but they cannot have different properties otherwise. In otherwords, setting a property will affect all of the cells at once. The solution is to put a color numeric, Color Ramp, Ring, or something behind the other obj...

Array #4
Hi Could anyone tell me if it is possible to concatenate an array ie A(1,1) = 4 A(1,2) = 5 A(1,3) =10 A(1,4) = 5 and using some kind of function get 45105 into an integer variable TNX Alot and help will be appreciated .. AARON In article <5103571.1159018495952.JavaMail.jakarta@nitrogen.mathforum.org>, aarond <aaron_debattista@yahoo.com> wrote: > Hi > > Could anyone tell me if it is possible to concatenate an array > ie A(1,1) = 4 > A(1,2) = 5 > A(1,3) =10 > A(1,4) = 5 > > and using some kind of function get 45105 into an intege...