developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #130: modifier.latex.php

File modifier.latex.php, 715 bytes (added by Aubanel MONNIER, 13 years ago)

the latex modifier to escape bad chars

Line 
1<?php
2/**
3 * Plugin from smarty project and adapted for jtpl
4 * @package    jelix
5 * @subpackage jtpl_plugin
6 * @version    $Id$
7 * @author
8 * @copyright  2001-2003 ispi of Lincoln, Inc.
9 * @link http://smarty.php.net/
10 * @link http://jelix.org/
11 * @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
12 */
13
14/**
15 * modifier plugin : simple search/replace for latex chars
16 * @param string
17
18 */
19function jtpl_modifier_latex($string)
20{
21    return str_replace(array('#','$','%','^','&','_','{','}','~'), array('\\#','\\$','\\%','\\^','\\&','\\_','\\{','\\}','\\~'), str_replace('\\','\\textbackslash',$string));
22}
23
24/* vim: set expandtab: */
25
26?>