__license__ = 'GPLv3' __author__ = 'Alberto Pettarin (pettarin gmail.com)' __copyright__ = '2011 Alberto Pettarin (pettarin gmail.com)' __version__ = 'v1.02' __date__ = '2011-09-28' __description__ = 'Fix the footnote links/backlinks generated by TeX4ht. Input from stdin and output to stdout.' import sys import string # read from stdin data = sys.stdin.read() # match footnote endlabel endLabel="" occurrenceEndLabel = 0 # match math tag openingMathTag="[' + footnoteNumber + ']' data = string.replace(data, oldString, newString) # loop! occurrenceEndLabel += 1 # print to stdout print data