harrelfe / Hmisc

Harrell Miscellaneous
Other
210 stars 81 forks source link

fix double replacement of ampersand in latex.summary.formula.reverse() and latex.summaryM() #72

Closed ecortens closed 7 years ago

ecortens commented 7 years ago

Both latex.summary.formula.reverse() and latex.summaryM() use sedit() to replace ampersands in labels with "\&" and then call latexTranslate(), which replaces the ampersand again, resulting in "\&" (backslash-backslash-ampersand) being written to the LaTeX output, i.e., an escaped backslash and an unescaped ampersand, causing an error.

This pull request eliminates the unnecessary first replacement of the ampersand, keeping the call to latexTranslate(), which is sufficient.