X-Git-Url: https://git.sthu.org/?p=shutils.git;a=blobdiff_plain;f=bib2html.py;fp=bib2html.py;h=5d5b4db16f6e75bbd796858d792714130052a614;hp=dee284ec3a1a51239ab019801bed5e9bd772ab90;hb=794b05103d5e742df6b45dd738cc34689c2e93a7;hpb=b19c6ec5b193d142554df1aa43e1827720c84a14 diff --git a/bib2html.py b/bib2html.py index dee284e..5d5b4db 100755 --- a/bib2html.py +++ b/bib2html.py @@ -37,7 +37,25 @@ import os, sys, getopt, re def format_latex(text): # Get rid of matching dollar signs text = re.sub(r'\$([^\$]*)\$', r'\1', text) - return text.replace('\mathcal', '').replace('{', '').replace('}', '').replace('\\', '').replace('~', ' ').replace('--', '–') + + # Replace text + subst = { + '\\"a': 'ä', + '\\"o': 'ö', + '\\"u': 'u', + '\mathcal': '', + '{': '', + '}': '', + '\\': '', + '~': ' ', + '---': '–', + '--': '–', + } + + for a, b in subst.items(): + text = text.replace(a, b) + + return text def format_field_span(type, value): return "" + format_latex(value) + ""