<p id="mathjaxlink" class="pcenter"><a href="chap2_mj.html">[MathJax on]</a></p>
<p><a id="X83A243C47B056636" name="X83A243C47B056636"></a></p>
<div class="ChapSects"><a href="chap2.html#X83A243C47B056636">2 <span class="Heading">
The <strong class="pkg">IntPic</strong> package main function
</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X80ABA2918548E108">2.1 <span class="Heading">The main function</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X858D6CD18272C90F">2.1-1 <span class="Heading">Tikz code for arrays of integers</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X7D3BCADE7903D62D">2.1-2 <span class="Heading">Tikz code for arrays, in a simplified way</span></a>
</span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X7EF12D7787D2A886">2.2 <span class="Heading">Producing tables</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X816D055F845B0D71">2.2-1 IP_TableWithModularOrder</a></span>
</div></div>
</div>
<h3>2 <span class="Heading">
The <strong class="pkg">IntPic</strong> package main function
</span></h3>
<p>This chapter consists of two sections, the first of which describes the main function of the package. The second one can be thought just as an example to produce a table where the integers appear ordered in a non standard way.</p>
<h4>2.1 <span class="Heading">The main function</span></h4>
<p>The function <code class="func">IP_TikzArrayOfIntegers</code> (<a href="chap2.html#X858D6CD18272C90F"><span class="RefLink">2.1-1</span></a>) is the main function of the <span class="URL"><a href="https://gap-packages.github.io/intpic/">IntPic</a></span> package. It aims to produce <code class="code">tikz</code> code for displaying arrays of integers.</p>
<h5>2.1-1 <span class="Heading">Tikz code for arrays of integers</span></h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IP_TikzArrayOfIntegers</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>The arguments (at most 3) are:</p>
<ol>
<li><p>(optional)</p>
<ul>
<li><p>a table of integers. In this case, the length of the rows is the maximum of the lengths of the sublists in the table, <em>or</em></p>
</li>
<li><p>a list of integers and, optionally, an integer which indicates the length of the rows; when the length of the rows is not indicated, a compromise between the width and the height is tried.</p>
</li>
</ul>
</li>
<li><p>a record of options. One of the fields of this record, named <code class="code">highlights</code>, is an array whose entries are the numbers to be highlighted: one color per sublist. See details and other options in Chapter <a href="chap5.html#X7DE2DA167A0098E7"><span class="RefLink">5</span></a>.</p>
</li>
</ol>
<p>When no list nor table is present, the smallest range containing all the integers to be highlighted is taken.</p>
<p>The aspect of the string <var class="Arg">tkz</var> produced is not very appealing. We show it once, by asking it explicitly in the next example. In the forthcoming examples we keep using two semicolons to avoid showing this kind of strings.</p>
<p>This string can be used at the users wish. In particular, it can be sent to the standard output using the command <code class="func">Print</code> (<a href="../../../doc/ref/chap6.html#X7AFA64D97A1F39A3"><span class="RefLink">Reference: Print</span></a>).</p>
<p>It can now be copied and pasted in a LaTeX document (having the appropriate packages in the preamble). See Chapter <a href="chap4.html#X79BE6CBC7AA29804"><span class="RefLink">4</span></a> for details and alternatives.</p>
<p>The next function uses the previous one, but is called with a simpler argument. It will hopefully be useful for simple drawings. The length of each row and the umber of columns varies. A compromise based on some experiments has been established in order to obtain not too large nor too high images.</p>
<h5>2.1-2 <span class="Heading">Tikz code for arrays, in a simplified way</span></h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IP_SimpleTikzArrayOfIntegers</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>The argument is either a list of integers or a matrix of integers. The integers involved are embedded in a range <var class="Arg">rg</var> of minimum length and highlighted by using the list of default colors.</p>
<p>When the user is interested in tables of a certain kind, it may be a good idea to write some code to produce these tables. The following function (whose code is part of the file <em>ip_tables.gi</em> in the <em>gap</em> folder of this package) is convenient to deal with numerical semigroups with two generators and has been used to produce the images contained in <a href="chapBib.html#biBfengraoab">[DFGL14]</a>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IP_TableWithModularOrder</code>( <var class="Arg">o</var>, <var class="Arg">a</var>, <var class="Arg">b</var>, <var class="Arg">depth</var>, <var class="Arg">height</var>, <var class="Arg">rep</var>, <varclass="Arg">pos</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>The arguments <var class="Arg">rep</var> and <var class="Arg">pos</var> are booleans (<code class="code">true</code> or <code class="code">false</code>). When <var class="Arg">rep</var> is <code class="code">true</code> there is some repetition: the last column is equal to the first, but pushed down some rows. When <var class="Arg">pos</var> is <code class="code">true</code>, no rows below 0 are considered, (contradicting <var class="Arg">depth</var>, if needed).</p>
<p>The first five arguments arguments <var class="Arg">o, a, b,depth</var> and <var class="Arg">height</var> are integers. What they represent is described in what follows. There is assigned some kind of a referential on the constructed table and the fist argument, <var class="Arg">o</var>, stands for the origin. A table with <var class="Arg">b</var> columns (<span class="SimpleMath"><var class="Arg">b</var>+1</span> columns when <var class="Arg">rep</var> is <code class="code">true</code>) is constructed as follows. The row containing the origin is</p>
<ul>
<li><p><span class="SimpleMath"><var class="Arg">o</var>+ [0..<var class="Arg">b</var>-1]*<var class="Arg">a</var></span>, if <var class="Arg">rep</var> is <code class="code">false</code>, <em>or</em></p>
</li>
<li><p><span class="SimpleMath"><var class="Arg">o</var>+ [0..<var class="Arg">b</var>]*<var class="Arg">a</var></span>, if <var class="Arg">rep</var> is <code class="code">true</code></p>
</li>
</ul>
<p>The remaining rows are obtained by adding <var class="Arg">b</var> (the upper ones) or subtracting <var class="Arg">b</var> (the others) to these rows.</p>
<p>Note: when <span class="SimpleMath"><var class="Arg">a</var> < <var class="Arg">b</var></span> are co-prime, this construction provides a representation of the integers as an array.</p>
<p><br><center><img src="../images/table_axis_ground_8_19.jpg"></center><br> The next picture is obtained in the same way. The information that only the shape has interest is given by including the option <code class="code">shape_only:=""</code>. The variable <code class="code">tkz</code> should be defined in a similar manner to the following one.</p>
<p><br><center><img src="../images/table_axis_ground_shape.jpg"></center><br> Next, a minimum of changes, just to illustrate the effect of <var class="Arg">rep</var> and <var class="Arg">pos</var>.</p>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.