"; if (strlen($dir_name) == 0) { $errors[] = "Error: Please enter directory name."; } if(in_array($file_ext,$extensions)=== false) { $errors[]="Error: Extension not allowed, please choose a JPEG or PNG file."; } if(empty($errors)==true) { //$new_name = md5(time() . $file_name); unlink($upload_dir.$file_name); unlink($upload_dir.$without_extension.".pdf"); unlink($upload_dir.$without_extension.".pdf_tex"); if (move_uploaded_file($file_tmp, $upload_dir.$file_name)) { echo "Upload successful.
"; $current_dir = getcwd(); echo "Current directory is ".$current_dir."
"; $output = shell_exec("./svg-to-latex.sh ".$upload_dir.$file_name." ".$dir_name); echo "

"; echo "Conversion results :
"; ?> " target="_blank">
" target="_blank">

"; echo "
$output
"; } else { echo "Error: File could not be moved to target directory.
"; } } else { print_r($errors); } } ?> This little tool allows to convert vector graphics to latex. The actual workhorse is inkscape. Please upload the .svg file you wish to convert.
Directory where you store images e.g. fig: