Re: write a filter for latex that escapes some chars

2010-10-30 Thread SlafS
thx for that. It's not quite what I was looking for but it led me to the solution Thank You. On 29 Paź, 15:42, Brian Bouterse wrote: > We have done this before and used something like the code below.  This > sample is pretty basic. > >    def fixchar(string,char): > >     #fixes chars for latex

Re: write a filter for latex that escapes some chars

2010-10-29 Thread Brian Bouterse
We have done this before and used something like the code below. This sample is pretty basic. def fixchar(string,char): #fixes chars for latex if char == '<': newchar = '$<$' elif char == '>': newchar = '$>$' elif char == '~': newchar = '\\~{}'

write a filter for latex that escapes some chars

2010-10-29 Thread SlafS
Hi there! I'm trying to write a filter that can be used inside of a template that is used for generating latex files. The filter should replace the '|' char with '\'. Simple: @register.filter("verb_safe") def verb_safe(val): return str(val).replace('|', '\|') is outputting me '\\|' I'm lit