function generateProceeding()
 {
     $doc = new LatexDoc('include');
     $doc->addContent("\\label{" . $this->_code . "}\n");
     $doc->addContent("\\Title{" . $this->_title . "}\n");
     $doc->addContent("\\Author{");
     foreach (array('_authors', '_tutors') as $var) {
         foreach ($this->{$var} as $value) {
             $tmp = $value['name'] . ' ' . $value['lastname'];
             $email[] = latexEntities($value['mail']);
             foreach ($value['institutions'] as $in) {
                 if (!isset($institution[$in['code']])) {
                     $institution[$in['code']] = $in['name'] . " -  " . $in['country'];
                 }
                 $co[] = $in['code'];
             }
             $people[] = $tmp . "(" . join(",", $co) . ")";
             unset($co);
         }
     }
     foreach ($institution as $key => $val) {
         $res[] = "(" . $key . ")" . $val;
     }
     $res = join(", ", $res);
     $doc->addContent(join(",  ", $people) . "\\\\" . "\n\\textit{emails: " . join(", ", $email) . "}\\\\\n" . $res);
     $doc->addContent("}\n");
     if (isset($this->_abstracts['spanish'])) {
         $doc->addContent("\\section*{Resumen}\n" . $this->_abstracts['spanish'] . "\n");
     }
     if (isset($this->_abstracts['english'])) {
         $doc->addContent("\\section*{Abstract}\n" . $this->_abstracts['english'] . "\n");
     }
     if (isset($this->_abstracts['portuguese'])) {
         $doc->addContent("\\section*{Resumo}\n" . $this->_abstracts['portuguese'] . "\n");
     }
     $output = fopen('files/proceedings/' . $this->_code . '_proceedings.tex', 'w');
     fwrite($output, $doc->generateDoc());
     fclose($output);
 }
/**
 *
 *@param string $name
 *@param string $content
 *@return string
 */
function latexEnviroment($name, $content)
{
    $begin = "\\begin{" . $name . "}\n";
    $end = "\\begin{" . $name . "}";
    return $begin . latexEntities($content) . $end;
}