summaryrefslogtreecommitdiffstats
path: root/Doc/text2latex.py
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/text2latex.py')
-rw-r--r--Doc/text2latex.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/text2latex.py b/Doc/text2latex.py
index 3d28431..069155e 100644
--- a/Doc/text2latex.py
+++ b/Doc/text2latex.py
@@ -1,6 +1,7 @@
import os
import sys
import regex
+import regsub
import string
import getopt
@@ -31,6 +32,9 @@ def process(fi, fo):
if fmt:
nextline = '\n'
line = fmt % string.strip(line)
+ if '(' in line:
+ line = regsub.gsub('[a-zA-Z0-9_]+()',
+ '{\\\\tt \\0}', line)
elif inverbatim:
if blank.match(line) >= 0 and \
indented.match(nextline) < 0:
@@ -43,6 +47,9 @@ def process(fi, fo):
fo.write('\\begin{verbatim}\n')
if inverbatim:
line = string.expandtabs(line, 4)
+ elif not fmt and '(' in line:
+ line = regsub.gsub('[a-zA-Z0-9_]+()',
+ '\\\\code{\\0}', line)
fo.write(line)
#main()