- escapedname=re.sub('_','\\\\\\\\_', m['name'])
- file.write ('s^\\markup { \\musicglyph #"%s" "%s" }\n' % (m['name'], escapedname))
+
+ count += 1
+
+## \musicglyph and \markup require "_" to be escaped differently:
+
+
+ scm_string = re.sub('_', r'_', m['name'])
+ tex_string = re.sub ('_', r'\\_' , m['name'])
+
+## prevent TeX from interpreting "--" as long dash:
+ tex_string=re.sub('--','-{}-', tex_string)
+
+ file.write (' \\markup { \\raise #0.75 \\vcenter \\musicglyph #"%s" " %s" } 4 \n' % (scm_string, tex_string))
+
+ if (count % 3) ==0:
+ file.write ('\skip 8 \\break\n')