harrelfe / Hmisc

Harrell Miscellaneous
Other
210 stars 81 forks source link

Add a flag to omit the output of commented call when using latex #33

Open gragusa opened 8 years ago

gragusa commented 8 years ago

I use latex to create complex tables using knitr. However, latex generated tables have the call added to the table's output by default as a comment. This is problematic because knitr sanitizes the comment marker % and thus the call is added as a test before the table.

This PR add a flag output.call (default value is FALSE) which excludes the problematic output.

harrelfe commented 8 years ago

See the Hmisc package knitrSet function. As I haven't had this particular problem I suspect one of the default options used by knitrSet solved it.

Frank

On 12/04/2015 08:27 AM, Giuseppe Ragusa wrote:

I use |latex| to create complex tables using knitr. However, |latex| generated tables have the |call| added to the table's output by default as a comment. This is problematic because |knitr| sanitizes the comment marker |%| and thus the call is added as a test before the table.

This PR add a flag |output.call| (default value is |FALSE|) which excludes the problematic output.


    You can view, comment on, or merge this pull request online at:

https://github.com/harrelfe/Hmisc/pull/33

    Commit Summary

— Reply to this email directly or view it on GitHub https://github.com/harrelfe/Hmisc/pull/33.


Frank E Harrell Jr Professor and Chairman School of Medicine

Department of *Biostatistics*   *Vanderbilt University*
gragusa commented 8 years ago

The problem is there with markdown and not with latex literate file. The reason is that % does not initiate a comment in markdown.

gragusa commented 8 years ago

I have changed the output.call to comment = TRUE which leave things as they were before this PR. When comment=FALSE the comment with the call output is not shown.

harrelfe commented 8 years ago

Please state which function you are referring to and what PR means. I use knitr extensively and have never had a problem with this so please provide a trivial self-contained example that fails when running knitr to produce a .tex file.

couthcommander commented 8 years ago

Giuseppe has created a pull request (PR). He modified latex.default by adding a new argument, comment=TRUE. See the "Files Changed" tab at the top of this discussion (or https://github.com/harrelfe/Hmisc/pull/33/files).

harrelfe commented 3 years ago

I'm sorry that I've waiting so long to merge your pull request that there are now conflicts in the code. Would you mind re-doing the pull request on the latest version of Hmisc on github, and also making corresponding changes in the help file? Thanks for your efforts. -Frank