melff / memisc

Tools for Managing Survey Data, Creating Tables of Estimates and Data Summaries
https://melff.github.io/memisc
45 stars 8 forks source link

toLatex.escape.tex option as argument #30

Closed schoonees closed 7 years ago

schoonees commented 7 years ago

Thanks for the nice package. I just had an issue with a new improvement that you listed in the NEWS file for 0.99 under Improvements, namely:

toLatex() methods optionally escape dollar, subscript and superscript symbols.

This is great for some cases I am sure, but for my case it meant that my paper written a while ago (which has math symbols in table headers) could not be knitted without error anymore. It also seems that this is set via a global argument

toLatex.escape.tex

but the toLatex() method (in this case for an ftable) does not expose this as an argument. I was able to fix the issue with

options(toLatex.escape.tex = FALSE)

after debugging a few times. However, it would be much nicer if this argument was directly accessible in the function toLatex() itself, and documented there.

So the proposal is to have an argument in the toLatex() methods for changing this behavior, together with documentation.

For backwards compatibility, would it be an option to have toLatex.escape.tex = FALSE by default?

Sorry for not submitting a patch, but I need to work on the referenced paper now....

Thanks!

Pieter

melff commented 7 years ago

You are making a good point and your requested change is very reasonable. Sorry for the inconvenience caused by the missing documentation of the toLatex.escape.tex option. All toLatex() methods in the package now have an optional toLatex.escape.tex argument which defaults to FALSE in release 0.99.14.4. The documentation now indicates the existence of the global option.