void latexdoc()
{
    string basename;
    string latexname;
    string yodldefine;

    md("tmp/latex");

                                    // cp necessary files for LaTeX
    if (!exists("tmp/latex/cplusplus.sty"))
        system("cp -r documentation/manual/latex tmp");

                                    // assign file name variables
    basename = "simrisc";
    latexname = basename + ".latex";

    chdir("documentation/manual");


    system("yodl2latex --no-warnings -l3 "
            "-o ../../tmp/latex/simrisc.latex simrisc.yo");

    chdir("../../tmp/latex");

    system("latex " + latexname);
    system("latex " + latexname);

    system("latex " + latexname);
}
