The list of allowed options, some of which already familiar from the examples, can be obtained as follows:
gap> RecNames(IP_TikzDefaultOptionsForArraysOfIntegers); [ "other", "colors", "highlights", "shape_only", "colsep", "rowsep", "cell_width", "allow_adjust_cell_width", "scale", "inner_sep", "line_width", "line_color" ]
Its meaning is as follows:
colors: any list of colors (to be used with the LaTeX package xcolor)
highlights: a list of lists of integers -- the elements of the first are colored by using the first color, etc. In cases of elements that appear in more than one list a kind of gradient (made with 4 colors at most) is used to fill the cell; the number may be printed with a fifth color and a sixt color may be used for the border.
shape_only: an option to be used when only the shape is important. When true or " " is used, all the nodes are empty; using a symbol, for instance a \(*\), this symbol is printed in all the nodes.
colsep: the tikz matrix option column sep
rowsep: the tikz matrix option row sep
cell_width: the tikz matrix option minimum width
scale: the tikz matrix option scale
inner_sep: the tikz matrix option inner sep
line_width: the tikz matrix option line width
line_color: the tikz matrix option line color: the color of the cell borders
allow_adjust_cell_width: the number of points per digit (to avoid discrepancies between the width of the cells when there are numbers with different number of digits to be printed). When the user sets the option cell_width, then allow_adjust_cell_width is automatically set to false
other: if non empty, the complete tikz
code has to be written (it may be useful when several images are to be produced - otherwise, changing the tikz
code would be enough)
other := ["\\draw[postaction={draw,line width=1pt,red}] (-80pt,-8pt) rectangle (16pt,40pt);","\\draw[postaction={draw,line width=1pt,blue}] (-16pt,8pt) rectangle (80pt,-40pt);"]
Adding this option to one of the preceding examples, one obtains the following:
The defaults for the available options are as follows
colors: ShuffledIP_colors
highlights: [[]]
shape_only : "false"
colsep: "2"
rowsep: "2"
cell_width: "30"
scale: "1"
inner_sep: "3"
line_width: "0"
line_color: "black"
allow_adjust_cell_width: "10"
negatives: [true]
other: []
They may be consulted:
gap> IP_TikzDefaultOptionsForArraysOfIntegers; rec( allow_adjust_cell_width := "10", cell_width := "30", colors := [ "red", "green", "blue", "-red", "-green", "-blue", "black!80", "black!30", "red!50", "green!50", "blue!50", "-red!50", "-green!50", "-blue!50", "black!70", "black!25", "red!20", "green!20", "blue!20", "-red!20", "-green!20", "-blue!20", "black!60", "black!20", "red!80!green!50", "green!80!red!50", "blue!80!red!50", "-red!80!green!50", "-green!80!red!50", "-blue!80!red!50", "black!50", "black!15", "red!80!blue!60", "green!80!blue!60", "blue!80!green!60", "-red!80!blue!60", "-green!80!blue!60", "-blue!80!green!60", "black!40", "black!10" ], colsep := "2", highlights := [ [ ] ], inner_sep := "3", line_color := "black", line_width := "0", negatives := true, other := [ ], rowsep := "2", scale := "1", shape_only := "false" )
The user may want to change the defaults by editing the file options.gd
in the folder gap
. The changes are lost whenever any re-installation occurs. It is recommended that in this case a copy is made, although it is not guaranteed that it will work in the next release.
The next example illustrates the use of the option negatives
. The images produced are shown below.
gap> rg := [-5..23];; gap> len := 10;; gap> hg := rec();; gap> hg.highlights:=[[2,3,5,7],[11,13,17,19],[23]];; gap> tkz := IP_TikzArrayOfIntegers(rg,len,hg);; gap> Print(tkz); gap> #IP_Splash(tkz); gap> hg.negatives:=false;; gap> tkz := IP_TikzArrayOfIntegers(rg,len,hg);; gap> Print(tkz); gap> # IP_Splash(tkz);
generated by GAPDoc2HTML