- // handle the "\" character, but only when the following character
- // is not also a "\", because "\\" is valid code
- docstring const textbackslash = from_ascii("\\textbackslash{}");
- for (size_t i = 0, pos;
- (pos = name.find('\\', i)) != string::npos;
- i = pos + 2) {
- if (name[pos + 1] != '\\')
- name.replace(pos, 1, textbackslash);
- }
- // The characters in chars_name[] need to be changed to a command
- // when they are in the name field.
- // Therefore the treatment of "\" must be the first thing
- for (int k = 0; k < 6; k++)
- for (size_t i = 0, pos;
- (pos = name.find(chars_name[k], i)) != string::npos;
- i = pos + 2)
- name.replace(pos, 1, backslash + chars_name[k] + braces);
-
+ name = params().prepareCommand(runparams, name,
+ ParamInfo::HANDLING_LATEXIFY);