On Tuesday 26 March 2002 2:04 pm, Herbert Voss wrote:
> Angus Leeming wrote:
> > complete this for me (the '~', '^', '\\' entries)?
> >
> > string const latexify(string const str)
> > {
> >     ostringstream out;
> >
> >     string::const_iterator it  = str.begin();
> >     string::const_iterator end = str.end();
> >
> >     for (; it != end; ++it) {
> >             switch (*it) {
> >
> >             case ('$'):
> >             case ('&'):
> >             case ('%'):
> >             case ('#'):
> >             case ('_'):
> >             case ('{'):
> >             case ('}'):
> >                     out << '\\' << *it;
> >                     break;
> >
> >             case ('~'):
> >             case ('^'):
>
>                       out << '\\' << *it << "{}";

Thank you.

> >             case ('\\'):
>
> we also have a \\ in the filename, otherwise it's the beginning
> of a command, which is not possible. So we do not need this case.

Well, I was thinking of a general function to go in support/lstrings.h. It'd 
be nice to complete it.

> Herbert

Angus

Reply via email to