Cody

# Problem 1860. Remove TeX from string

Solution 964827

Submitted on 10 Sep 2016 by Jan Orwat
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))

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))

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))

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

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

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!