CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<Chapter Label="intro">
4
<Heading>
5
The <Package>IntPic</Package> package
6
</Heading>
7
<!-- <Index>&IntPic; - Overview</Index>-->
8
<Section>
9
<Heading>Overview and Introduction</Heading>
10
The &IntPic; package has as its main goal producing <C>Tikz</C> code for arrays of integers to be included in a &LaTeX; file, which can then be processed. Some of the integers are emphasized, by using different colors for the cells.
11
<!-- When used in conjunction with the package <Package>IntPic</Package> <Cite Key="DelgadoEgri-NagyMitchellPfeiffer2012-Viz"></Cite>, &IntPic; provides an immediate visualization.-->
12
<P />
13
&IntPic; grew up from my will to have a pictorial view of some sets of integers. I wanted, in particular, get a pictorial view of the results produced by the <Alt Not='Text'><URL
14
Text='NumericalSgps'>http://www.fc.up.pt/cmup/mdelgado/numericalsgps</URL></Alt><Alt Only='Text'><Package>NumericalSgps</Package></Alt> package <Cite Key="DelgadoGarcia-SanchezMorais:numericalsgps"></Cite>. Effort has then been made to serve a slightly more general purpose.
15
For instance, if the user wants to have a pictorial idea of how many primes there are between 800 and 1000, or show it to his students and, perhaps, which among these primes are twin primes, he will probably be happy by producing a picture like the following
16
<P />
17
18
<Alt Only="LaTeX">
19
\begin{center}
20
\includegraphics[width=0.95\textwidth]{../images/primesandtwins}
21
\end{center}
22
</Alt>
23
<Alt Only="HTML">
24
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;../images/primesandtwins.jpg&#34;&#62;&#60;/center&#62;&#60;br&#62;
25
</Alt>
26
27
It has clearly too much information, given through the different colors. The twin primes in the given range are in red-blue, while the remaining primes in the same range are in red.
28
<P />
29
This package contains relatively few lines of code. The heavier part is the documentation, where many examples are presented.
30
<P />
31
The design of this greatly benefits from my long experience on producing visualization tools for &GAP; objects. The package <Package>sgpviz</Package> <Cite Key="DelgadoMorais:sgpviz"></Cite> is the visible part. More recently, I got involved in a more general project, the <Package>Viz</Package> package <Cite Key="DelgadoEgri-NagyMitchellPfeiffer2012-Viz"></Cite>.
32
The experience gained there, especially through long and fruitful discussions with J. Mitchell, influenced me a lot. This package will probably be part of that more general project. For the moment it is independent, but its use in conjunction with the <Package>Viz</Package> package is recommended since in this case an immediate visualization is provided.
33
<P />
34
The package produces <C>tikz</C> code that the user may then use at his wish. In particular, he can use it in publications. But prior to obtaining results that lead to a publication, the user may benefit of viewing thousands of images. There is a (almost platform independent) function in <Package>Viz</Package> that is intended to make this task easy. It benefits from the &GAP; stuff on creating a temporary directory where the computations occur. The cleaning task is also left to &GAP;, which leaves the user free of the need of collecting the garbage.
35
36
In order to produce the drawings, &LaTeX;, as well as some &LaTeX; packages, in particular <C>tikz</C> and <C>pgf</C>, must be installed and working. I will assume that this is the case.
37
38
All the images in <Cite Key="fengraoab"></Cite> have been produced by using the &IntPic; package.
39
<P />
40
This package consists basically of a function with many options associated. The purpose of the manual is to illustrate the use of the options. Many examples are presented. A file, named <F>examples.g</F> contains the &GAP; code, including the one to save the <C>tikz</C> code, to produce the examples in the manual.
41
42
</Section>
43
44
<!-- ######################################## -->
45
<Section Label="install">
46
<Heading>
47
Installing <Package>IntPic</Package>
48
</Heading>
49
In this section we give a brief description of how to start using &IntPic;. If you have any problems getting &IntPic; working, then you could try emailing me at <Email>[email protected]</Email>.
50
<P/>
51
It is assumed that you have a working copy of &GAP; with version number 4.5 or higher. The most up-to-date version of &GAP; and instructions on how to install it can be obtained from the main &GAP; web page
52
<Alt Only="LaTeX">\noindent\vspace{\baselineskip}</Alt>
53
<URL>http://www.gap-system.org</URL>.
54
<P/>
55
56
<Alt Only="LaTeX">\noindent</Alt>
57
If the &IntPic; package was obtained as a part of the &GAP; distribution from the <Q>Download</Q> section of the &GAP; website, you may proceed to Section <Ref Sect="loading"/>. Alternatively, the &IntPic; package may be installed using a separate archive, for example, for an update or an installation in a non-default location (see <Ref Sect="GAP Root Directories" BookName="ref"/>).
58
<P/>
59
60
Below we describe the installation procedure for the <File>.tar.gz</File> archive format, which can be obtained from <URL>http://cmup.fc.up.pt/cmup/mdelgado/intpic/</URL>. Installation using other archive formats or non UNIX-like systems is performed in a similar way.
61
<P/>
62
63
To install the &IntPic; package, unpack the archive file, which should have a name of the form
64
<C>
65
intpic-<A>XXX</A>.tar.gz
66
</C>
67
for some version number
68
<A>XXX</A>, by typing
69
<P/>
70
&nbsp;&nbsp;
71
<C>
72
gzip -dc intpic-<A>XXX</A>.tar.gz | tar xpv
73
</C>
74
<P/>
75
76
It may be unpacked in one of the following locations:
77
<List>
78
<Item>
79
in the <File>pkg</File> directory of your &GAP; installation;
80
</Item>
81
<Item>
82
or in a directory named <File>.gap/pkg</File> in your home directory (to be added to the &GAP; root directory unless &GAP; is started with <C>-r</C> option);
83
</Item>
84
85
<Item>
86
or in a directory named <File>pkg</File> in another directory of your choice (e.g.&nbsp;in the directory <File>mygap</File> in your home directory).
87
</Item>
88
</List>
89
90
In the latter case one must start &GAP; with the <C>-l</C> option, e.g.&nbsp;if your private <F>pkg</F> directory is a subdirectory of <F>mygap</F> in your home directory you might type:
91
<P/>
92
&nbsp;&nbsp;
93
<C>
94
gap -l "<A>;myhomedir</A>/mygap"
95
</C>
96
<P/>
97
<Alt Only="LaTeX">\noindent</Alt>
98
where <A>myhomedir</A> is the path to your home directory, which may be replaced by a tilde (the empty path before the semicolon is filled in by the default path of the &GAP; home directory).
99
</Section>
100
101
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
102
103
104
<Section Label="loading">
105
<Heading>
106
Loading <Package>IntPic</Package>
107
</Heading>
108
109
To use the &IntPic; Package you have to request it explicitly. This is done by calling <Ref Func="LoadPackage" BookName="ref"/>:
110
<P/>
111
<Example><![CDATA[
112
gap> LoadPackage("intpic");
113
]]></Example>
114
<P/>
115
The package banner, followed by <C>true</C>, will be shown, if the load has been successful.
116
<P/>
117
If you want to load the &IntPic; package by default, you can put the <C>LoadPackage</C> command into your <F>gaprc</F> file
118
(see Section&nbsp;<Ref Sect="The gap.ini and gaprc files" BookName="ref"/>).
119
120
</Section>
121
</Chapter>
122
123