aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/www/include/share/str/tex.php
blob: 76cf5117518a61e0c306753b2df2da7fc61ed068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php

    function TeXSpecialChars($szoveg) {
        $trans = array(
//                        "\\'" => "'", ## ezt kell kiszedni 2.0-ban
                        '+' => '$+$',
                        '/' => '$/$',
                        '*' => '$*$',
                        '=' => '$=$',
                        '<' => '$<$',
                        '>' => '$>$',
                        '{' => '$\{$',
                        '}' => '$\}$',
                        '#' => '\#',
                        '%' => '\%',
                        '_' => '\_',
                        '&' => '\&',
                        '~' => ' ',
			'…' => '...',
			'´' => '\'',
                        '^' => '(exp)',
//                        '~' => '\~\ ',
//                        '$' => '\$',
//                        "\\" => '$\backslash$'
                );
	if (__NYOMTATAS_XETEX) {
    	    $trans['^'] = '\^\ ';
	}
        return strtr(strtr($szoveg, array('$' => '\$', "\\" => '$\backslash$')), $trans);
    }

    function LaTeXSpecialChars($szoveg) {
        $trans = array(
                        '_' => '\_',
			'#' => '\#',
			'$' => '\$',
			'%' => '\%',
			'&' => '\&',
			'~' => '\verb|~|',
			'^' => '\verb|^|',
			'{' => '\{',
			'}' => '\}',
			'\\' => '$\backslash$',
// 0160 => 0032, // valami' spéci szóköz --> sima szóköz
                );
        return strtr($szoveg,$trans);
    }



?>