Latex za izvoze: IZVOZ-68: Ce anketa vsebuje znak: »&« izvoz v PDF ne deluje

This commit is contained in:
patrik2020 2020-12-08 15:30:43 +01:00
parent ddafd55127
commit eba0905fca
3 changed files with 24 additions and 7 deletions

View File

@ -926,6 +926,11 @@ class LatexAnalysisElement{
//$text = str_replace('_','\_ ',$text); //$text = str_replace('_','\_ ',$text);
$text = str_replace('_','\_',$text); $text = str_replace('_','\_',$text);
$text = str_replace('~','\textasciitilde{} ',$text); $text = str_replace('~','\textasciitilde{} ',$text);
if(strpos($text, '&')){ //ce je prisotno v besedilu &'
$text = str_replace('&','\& ',$text);
}else{
$text = str_replace('&','\& ',$text);
}
$andSymbolPresent = 0; $andSymbolPresent = 0;
$posAndSymbolPresent = strpos($text,'&'); $posAndSymbolPresent = strpos($text,'&');

View File

@ -1364,8 +1364,11 @@ class LatexDocument{
$text = str_replace('^','\textasciicircum{} ',$text); $text = str_replace('^','\textasciicircum{} ',$text);
$text = str_replace('_','\_ ',$text); $text = str_replace('_','\_ ',$text);
$text = str_replace('~','\textasciitilde{} ',$text); $text = str_replace('~','\textasciitilde{} ',$text);
$text = str_replace('&','\&',$text); if(strpos($text, '&')){ //ce je prisotno v besedilu &'
$text = str_replace('&','\&',$text); $text = str_replace('&','\& ',$text);
}else{
$text = str_replace('&','\& ',$text);
}
$text = str_replace(' ','~',$text); $text = str_replace(' ','~',$text);
//$text = str_replace('<','\textless ',$text); //$text = str_replace('<','\textless ',$text);
$text = str_replace('<',' \textless ',$text); $text = str_replace('<',' \textless ',$text);

View File

@ -899,8 +899,11 @@ class LatexSurveyElement{
$text = str_replace('^','\textasciicircum{} ',$text); $text = str_replace('^','\textasciicircum{} ',$text);
$text = str_replace('_','\_ ',$text); $text = str_replace('_','\_ ',$text);
$text = str_replace('~','\textasciitilde{} ',$text); $text = str_replace('~','\textasciitilde{} ',$text);
$text = str_replace('&','\&',$text); if(strpos($text, '&')){ //ce je prisotno v besedilu &'
$text = str_replace('&','\&',$text); $text = str_replace('&','\& ',$text);
}else{
$text = str_replace('&','\& ',$text);
}
$text = str_replace(' ','~',$text); $text = str_replace(' ','~',$text);
//$text = str_replace('<','\textless ',$text); //$text = str_replace('<','\textless ',$text);
$text = str_replace('<',' \textless ',$text); $text = str_replace('<',' \textless ',$text);
@ -2172,10 +2175,12 @@ class LatexSurveyElement{
$loop_id = $loop_id_raw; $loop_id = $loop_id_raw;
#za pridobitev stevila vrstic #za pridobitev stevila vrstic
//echo "SELECT id, naslov, naslov2, variable, other FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red"; //echo "SELECT id, naslov, naslov2, variable, other FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red </br>";
$sqlVrednostiKombo = sisplet_query("SELECT id, naslov, naslov2, variable, other FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red"); $sqlVrednostiKombo = sisplet_query("SELECT id, naslov, naslov2, variable, other FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red");
$numRowsSql = mysqli_num_rows($sqlVrednostiKombo); $numRowsSql = mysqli_num_rows($sqlVrednostiKombo);
//echo $numRowsSql."</br>"; //echo $numRowsSql."</br>";
//echo $spremenljivke['id']."</br>";
#za pridobitev stevila vrstic - konec #za pridobitev stevila vrstic - konec
#za pridobitev stevila stolpcev #za pridobitev stevila stolpcev
@ -2184,6 +2189,7 @@ class LatexSurveyElement{
$numColSql = $rowStVrednost['count(*)']; //stevilo vseh stolpcev $numColSql = $rowStVrednost['count(*)']; //stevilo vseh stolpcev
//echo "stevilo stolpcev: ".$numColSql."</br>"; //echo "stevilo stolpcev: ".$numColSql."</br>";
#za pridobitev stevila stolpcev - konec #za pridobitev stevila stolpcev - konec
//echo "presirokaTabela: ".$presirokaTabela."</br>"; //echo "presirokaTabela: ".$presirokaTabela."</br>";
if($presirokaTabela==0){ //ce tabela ni presiroka if($presirokaTabela==0){ //ce tabela ni presiroka
$sqlSubGrid = sisplet_query("SELECT m.spr_id, s.tip FROM srv_grid_multiple m, srv_spremenljivka s WHERE m.parent='".$spremenljivke['id']."' AND m.spr_id=s.id ORDER BY m.vrstni_red"); //pridobimo spr_id in tip podvprasanj, ki sestavljajo kombinirano tabelo $sqlSubGrid = sisplet_query("SELECT m.spr_id, s.tip FROM srv_grid_multiple m, srv_spremenljivka s WHERE m.parent='".$spremenljivke['id']."' AND m.spr_id=s.id ORDER BY m.vrstni_red"); //pridobimo spr_id in tip podvprasanj, ki sestavljajo kombinirano tabelo
@ -2217,10 +2223,13 @@ class LatexSurveyElement{
//echo $sqlVsehVrednostiString."</br>"; //echo $sqlVsehVrednostiString."</br>";
//echo $rowVrednosti['tip']."</br>"; //echo $rowVrednosti['tip']."</br>";
//echo $rowVrednosti['other']."</br>";
//echo "Vrednost: ".$rowVrednosti['spr_id']."</br>"; //echo "Vrednost: ".$rowVrednosti['spr_id']."</br>";
$sqlVsehVrednosti = sisplet_query($sqlVsehVrednostiString); $sqlVsehVrednosti = sisplet_query($sqlVsehVrednostiString);
//echo mysqli_num_rows($sqlVsehVrednosti)."</br>"; //echo mysqli_num_rows($sqlVsehVrednosti)."</br>";
$roletaZabelezena = 0; $roletaZabelezena = 0;
while ($rowVsehVrednosti = mysqli_fetch_assoc($sqlVsehVrednosti)){ while ($rowVsehVrednosti = mysqli_fetch_assoc($sqlVsehVrednosti)){