Skip to content

Commit

Permalink
Merge pull request #2341 from codeeu/dev
Browse files Browse the repository at this point in the history
Update LatexCleaner and participation tex files attempt to fix issues…
  • Loading branch information
bernardhanna authored Nov 25, 2024
2 parents 257028a + ab2a609 commit 46ea5ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
17 changes: 8 additions & 9 deletions app/Traits/LatexCleaner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ə
'#' => '\\#',
'$' => '\$',
'%' => '\\%',
Expand All @@ -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;
}
Expand Down
21 changes: 9 additions & 12 deletions resources/latex/participation.tex
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -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}{%
Expand All @@ -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}{<CERTIFICATE_HOLDER_NAME>}
\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}{<EVENT_NAME>}
\textcolor{myorange}{Соціальна інженерія в цифровому просторі} % Event name
\end{otherlanguage*}
\end{center}
\end{table}
Expand All @@ -65,9 +64,7 @@
\begin{center}
\hspace{-0.5cm}
\begin{otherlanguage*}{russian}
\textcolor{black}{<EVENT_DATE>}
\textcolor{black}{12/11/2026} % Event date
\end{otherlanguage*}
%\end{tabular}

\end{center}
\end{document}
\end{document}
2 changes: 1 addition & 1 deletion resources/latex/participation_greek.tex
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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}
Expand Down

0 comments on commit 46ea5ed

Please sign in to comment.