From ab2a60975409c19d2cda48c9b8a5ca986162a07b Mon Sep 17 00:00:00 2001 From: bernardhanna Date: Mon, 25 Nov 2024 16:40:51 +0000 Subject: [PATCH] Update LatexCleaner and participation tex files attempt to fix issues with cert generation --- app/Traits/LatexCleaner.php | 17 ++++++++--------- resources/latex/participation.tex | 21 +++++++++------------ resources/latex/participation_greek.tex | 2 +- 3 files changed, 18 insertions(+), 22 deletions(-) mode change 100644 => 100755 resources/latex/participation.tex mode change 100644 => 100755 resources/latex/participation_greek.tex diff --git a/app/Traits/LatexCleaner.php b/app/Traits/LatexCleaner.php index c535a97f1..867f64a70 100644 --- a/app/Traits/LatexCleaner.php +++ b/app/Traits/LatexCleaner.php @@ -6,11 +6,9 @@ trait LatexCleaner { public function tex_escape($string) { - - $string = str_replace('"', "''", $string); - $string = str_replace('Ȋ', 'Î', $string); - $map = [ + 'ʼ' => "'", // Replace Unicode apostrophe with standard apostrophe + 'ə' => '\\textschwa{}', // Handle ə '#' => '\\#', '$' => '\$', '%' => '\\%', @@ -23,12 +21,13 @@ public function tex_escape($string) '}' => '\\}', ]; - $string = preg_replace_callback("/([\^\%~\\\\#\$%&_\{\}])/", + $string = preg_replace_callback( + "/([\^\%~\\\\#\$%&_\{\}ʼ])/", function ($matches) use ($map) { - foreach ($matches as $match) { - return $map[$match]; - } - }, $string); + return $map[$matches[0]] ?? $matches[0]; + }, + $string + ); return $string; } diff --git a/resources/latex/participation.tex b/resources/latex/participation.tex old mode 100644 new mode 100755 index c544d1324..6296ff33a --- a/resources/latex/participation.tex +++ b/resources/latex/participation.tex @@ -1,7 +1,7 @@ \documentclass[12pt]{article} \usepackage[T2A,T1]{fontenc} \usepackage[utf8]{inputenc} -\usepackage[greek,russian,english,ukrainian,turkish,azerbaijani]{babel} +\usepackage[russian,english]{babel} \usepackage{mathpazo} \renewcommand{\familydefault}{\sfdefault} \usepackage[landscape,a4paper]{geometry} @@ -15,12 +15,15 @@ \usepackage{textcomp} \usepackage{paratype} \usepackage{tgpagella} +\usepackage{tipa} - +% Declare font substitution for Cyrillic encoding \DeclareFontFamilySubstitution{T2A}{\rmdefault}{PTSerif-TLF} +% Define custom color \definecolor{myorange}{RGB}{226, 83, 48} +% Background image setup \newcommand\BackgroundPic{% \put(0,0){% \parbox[b][\paperheight]{\paperwidth}{% @@ -31,31 +34,27 @@ \vfill }}} - - \begin{document} \AddToShipoutPicture{\BackgroundPic} ~ \vspace{2.2cm} ~ \begin{center} - \vspace{5.9cm} {\centering\fontsize{36}{48}\selectfont \begin{otherlanguage*}{russian} -\textcolor{myorange}{} +\textcolor{myorange}{Білоголова Дар'я} % Replace placeholder here \end{otherlanguage*} \par} \begin{table}[h] \footnotesize - \begin{center} \fontsize{24}{36}\selectfont \vspace{1.6cm} \begin{otherlanguage*}{russian} -\textcolor{myorange}{} +\textcolor{myorange}{Соціальна інженерія в цифровому просторі} % Event name \end{otherlanguage*} \end{center} \end{table} @@ -65,9 +64,7 @@ \begin{center} \hspace{-0.5cm} \begin{otherlanguage*}{russian} -\textcolor{black}{} +\textcolor{black}{12/11/2026} % Event date \end{otherlanguage*} -%\end{tabular} - \end{center} -\end{document} \ No newline at end of file +\end{document} diff --git a/resources/latex/participation_greek.tex b/resources/latex/participation_greek.tex old mode 100644 new mode 100755 index 7aecb1827..c56599558 --- a/resources/latex/participation_greek.tex +++ b/resources/latex/participation_greek.tex @@ -1,7 +1,7 @@ \documentclass[12pt]{article} \usepackage[T1,LGR,T2A]{fontenc} \usepackage[utf8]{inputenc} -\usepackage[greek,russian,english,ukrainian,turkish,azerbaijani]{babel} +\usepackage[greek,russian,english]{babel} \usepackage{mathpazo} \renewcommand{\familydefault}{\sfdefault} \usepackage[landscape,a4paper]{geometry}