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 << "{}"; > 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. Herbert -- http://www.lyx.org/help/