26.9 Escape String for LATEX

Produce a string with the usual LATEX special characters escaped so that they print themselves in typewriter mode.

329auxiliary subroutines 305b+   (330)  328b
sub escapeForTTLatex {
    my($s)=@_;
    $s =~ s/\\/\\adbackslash /g;
    $s =~ s/{/\\{/g;
    $s =~ s/}/\\}/g;
    $s =~ s/_/\\_/g;
    $s =~ s/\^/\\^{}/g;
    $s =~ s/~/\\~{}/g;
    $s =~ s/%/\\%/g;
    $s =~ s/#/\\#/g;
    $s =~ s/&/\\&/g;
    return $s;
}

Defines:
escapeForTTLatex, used in chunks 308, 325, and 328a.