in reply to PostScript-Report - Sections

Is PostScript-Report absolutely necessary? If not, then there may be a different way: Use TeX as intermediate format. This comes especially handy if the report is also required as HTML or any other format that TeX can produce.

Richard Hardwick has written a nice article about that: http://tug.org/pracjourn/2010-1/hardwick/

However I must confess it introduces a new set of problem: Properly escaping the meta characters. This is what I came up with. A more elegant solution may exist.

# requires 'use utf8' and a utf8-enabled editor sub latexise_umlauts { my $string = shift; $string =~ s/\\/{\\backslash}/g; $string =~ s/\$/{\\\$}/g; $string =~ s/&/{\\&}/g; $string =~ s/%/{\\%}/g; $string =~ s/#/{\\#}/g; $string =~ s/_/{\\_}/g; $string =~ s/>/{\\textgreater}/g; $string =~ s/</{\\textless}/g; $string =~ s/ä/\\"a/g; $string =~ s/ö/\\"o/g; $string =~ s/ü/\\"u/g; $string =~ s/Ä/\\"A/g; $string =~ s/Ö/\\"O/g; $string =~ s/Ü/\\"U/g; $string =~ s/ß/\\ss{}/g; $string =~ s/²/\\textsuperscript{2}/g; $string =~ s/³/\\textsuperscript{3}/g; return $string; }