Cody

# Problem 1860. Remove TeX from string

Solution 793075

Submitted on 11 Dec 2015 by Jean-Marie Sainthillier
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% texStr = '\beta'; txt = 'beta'; assert(isequal(tex2txt(texStr),txt))

txt = beta

2   Pass
%% texStr = ['\fontsize{16}black {\color{magenta}magenta '... '\color[rgb]{0 .5 .5}teal \color{red}red} black again']; txt = 'black magenta teal red black again'; assert(isequal(tex2txt(texStr),txt))

txt = black magenta teal red black again

3   Pass
%% texStr = {'We need to work with cells, too' '(for {\bfmultiline} labels) and' 'return strings with newline characters.'}; txt = sprintf(['We need to work with cells, too\n' ... '(for multiline labels) and\n' ... 'return strings with newline characters.']); assert(isequal(tex2txt(texStr),txt))

txt = We need to work with cells, too (for multiline labels) and return strings with newline characters.

4   Pass
%% texStr = '\slRemove {\bfall} \itof \rmthese.'; txt = 'Remove all of these.'; assert(isequal(tex2txt(texStr),txt))

txt = Remove all of these.

5   Pass
%% txt = 'variable_i^2/pi'; texStr = texlabel(txt); assert(isequal(tex2txt(texStr),txt))

txt = variable_i^2/pi