GAP (Utils) - Chapter 6: Various other functions

Goto Chapter: Top 1 2 3 4 5 6 Bib Ind
[Top of Book] [Contents] [Previous Chapter] [Next Chapter]

[MathJax off]

6 Various other functions
6.1 Operations on folders
6.1-1 FindMatchingFiles
6.2 File operations
6.2-1 Log2HTML
6.3 LaTeX strings
6.3-1 IntOrOnfinityToLaTeX
6.3-2 LaTeXStringFactorsInt

### 6 Various other functions

#### 6.1 Operations on folders

##### 6.1-1 FindMatchingFiles

`‣ FindMatchingFiles`( pkg, dirs, extns ) | ( function )

`‣ CreateDirIfMissing`( str ) | ( function )

These functions have been transferred from package AutoDoc where they were named `AutoDoc_FindMatchingFiles` and `AutoDoc_CreateDirIfMissing`.

`FindMatchingFiles` 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.

`CreateDirIfMissing` checks whether the given directory exists and, if not, attempts to create it. In either case `true` is returned.

Warning: this function relies on the undocumented library function `CreateDir`, so use it with caution.

    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

#### 6.2 File operations

##### 6.2-1 Log2HTML

`‣ Log2HTML`( filename ) | ( function )

This function is in the process of being transferred from package RCWA: for now you should `LoadPackage("rcwa")` in order to use it.

This function converts the GAP logfile logfilename to HTML. The extension of the input file must be *.log. The name of the output file is the same as the one of the input file except that the extension *.log is replaced by *.html. There is a sample CSS file in `utils/doc/gaplog.css`, which you can adjust to your taste.

    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" ]

#### 6.3 LaTeX strings

##### 6.3-1 IntOrOnfinityToLaTeX

`‣ IntOrOnfinityToLaTeX`( n ) | ( function )

This function is in the process of being transferred from package ResClasses: for now you should `LoadPackage("resclasses")` in order to use it.

`IntOrInfinityToLaTeX(n)` returns the LaTeX string for n.

    gap> IntOrInfinityToLaTeX( 10^3 );
    "1000"
    gap> IntOrInfinityToLaTeX( infinity );
    "\\infty"

##### 6.3-2 LaTeXStringFactorsInt

`‣ LaTeXStringFactorsInt`( n ) | ( function )

This function is in the process of being transferred from package RCWA: for now you should `LoadPackage("rcwa")` in order to use it.

It returns the prime factorization of the integer \(n\) as a string in LaTeX format.

    gap> LaTeXStringFactorsInt( Factorial(12) );
    "2^{10} \\cdot 3^5 \\cdot 5^2 \\cdot 7 \\cdot 11"

[Top of Book] [Contents] [Previous Chapter] [Next Chapter]
Goto Chapter: Top 1 2 3 4 5 6 Bib Ind

generated by GAPDoc2HTML