<!-- ------------------------------------------------------------------- -->
<!--                                                                     -->
<!--  others.xml          Utils documentation                Stefan Kohl -->
<!--                                                   Sebastian Gutsche -->
<!--                                                            Max Horn -->
<!--  Copyright (C) 2015-2016, The GAP Group                             --> 
<!--                                                                     -->
<!-- ------------------------------------------------------------------- -->

<?xml version="1.0" encoding="UTF-8"?>

<Chapter Label="chap-others">
<Heading>Various other functions</Heading>


<Section Label="sec:folder-ops">
<Heading>Operations on folders</Heading>

<ManSection>
  <Func Name="FindMatchingFiles" 
        Arg="pkg dirs extns"/>
  <Func Name="CreateDirIfMissing" 
        Arg="str"/>
<Description>
These functions have been transferred from package &AutoDoc; 
where they were named <C>AutoDoc_FindMatchingFiles</C> 
and <C>AutoDoc_CreateDirIfMissing</C>. 
<P/>
<C>FindMatchingFiles</C> scans the given (by name) subdirectories 
of a package directory for files with one of the given extensions, 
and returns the corresponding filenames, 
as paths relative to the package directory.
<P/>
<C>CreateDirIfMissing</C> checks whether the given directory exists 
and, if not, attempts to create it. 
In either case <C>true</C> is returned. 
<P/>
<E>Warning:</E> this function relies on the undocumented library function 
<C>CreateDir</C>, so use it with caution. 
<P/>
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> FindMatchingFiles( "utils", [ "/", "tst" ], [ "g", "txt" ] );
[ "/LICENSE.txt", "/PackageInfo.g", "/init.g", "/makedoc.g", "/read.g", 
  "tst/testall.g" ]
gap> CreateDirIfMissing( "/Applications/gap/temp/" );
true
]]>
</Example>


</Section>


<Section Label="sec:log2html">
<Heading>File operations</Heading>

<ManSection>
  <Func Name="Log2HTML" 
        Arg="filename"/>
<Description>
This function is in the process of being transferred from package &RCWA;: 
for now you should &LoadRCWA; in order to use it. 
<P/>
This function converts the &GAP; logfile logfilename to HTML. 
The extension of the input file must be <A>*.log</A>. 
The name of the output file is the same as the one of the input file 
except that the extension <A>*.log</A> is replaced by <A>*.html</A>. 
There is a sample CSS file in <File>utils/doc/gaplog.css</File>, 
which you can adjust to your taste. 
<P/>
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> LogTo("mar2.log");
gap> FindMatchingFiles( "utils", [""], ["g"] ); 
[ "/PackageInfo.g", "/init.g", "/makedoc.g", "/read.g" ]
gap> LogTo();
gap> Log2HTML( "mar2.log" );
gap> FindMatchingFiles( "utils", [""], ["html", "log"] );
[ "/mar2.html", "/mar2.log" ]
]]>
</Example>

</Section>


<Section Label="sec:latex">
<Heading>&LaTeX; strings</Heading>

<ManSection>
  <Func Name="IntOrOnfinityToLaTeX" 
        Arg="n"/>
<Description>
This function is in the process of being transferred from package &ResClasses;: 
for now you should &LoadResClasses; in order to use it. 
<P/>
<C>IntOrInfinityToLaTeX(n)</C> returns the &LaTeX; string for <A>n</A>. 
<P/>
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> IntOrInfinityToLaTeX( 10^3 );
"1000"
gap> IntOrInfinityToLaTeX( infinity );
"\\infty"
]]>
</Example>

<ManSection>
  <Func Name="LaTeXStringFactorsInt" 
        Arg="n"/>
<Description>
This function is in the process of being transferred from package &RCWA;: 
for now you should &LoadRCWA; in order to use it. 
<P/>
It returns the prime factorization of the integer <M>n</M> as a string in 
&LaTeX; format.
<P/>
</Description>
</ManSection>
<P/>
<Example>
<![CDATA[
gap> LaTeXStringFactorsInt( Factorial(12) );
"2^{10} \\cdot 3^5 \\cdot 5^2 \\cdot 7 \\cdot 11"
]]>
</Example>


</Section>



</Chapter>

