harrelfe / Hmisc

Harrell Miscellaneous
Other
208 stars 81 forks source link

Output from summaryM #77

Closed raffdoc closed 6 years ago

raffdoc commented 7 years ago

Hi, I am writing my thesis with @ismayc thesisdown project. I am using summaryM for tables, this is one of my tables

load("data/out_table2.RData")
latex(out_tab2, file= '', prn = FALSE,
      prmsd=TRUE,  
      middle.bold=TRUE, 
      digits=1, append=T, 
      caption="\\textit{Dati perioperatori}",
      size="scriptsize",
      pdig = 2,
      what='%',
      label = "tab:tab2",
      #where='!tbp',
      landscape=T,
      legend.bottom = T, 
      insert.bottom = "A \\textbf{b} c rappresentano il quartile inferiore a, il mediano \\textbf{b} e il quarto superiore c per le variabili continue. \\textit{X} ± \\textit{s} rappresenta \\textit{X} ± 1 \\textit{SD}. N è il numero di valori non mancanti.")

In the pdf output file it has this wired output, that I see first time (I have used summary function for other thesis project few years ago): screen shot 2017-06-22 at 23 05 39 I think something happens from rmardown file to latex, it does not comment that frase correctly. What do you think, how can I block this behaviour. All the best.

harrelfe commented 7 years ago

I've only had luck using LaTeX in RMarkdown with equations. I was not aware that general LaTeX insertions are allowed.

couthcommander commented 7 years ago

Not sure if it will help, but there is a markdown extension that can be added to the YAML metadata section to enable raw latex.

output:
  pdf_document:
    md_extensions: +raw_tex

Perhaps this will comment it out?

raffdoc commented 7 years ago

Nope, @couthcommander it does not function.

harrelfe commented 7 years ago

My understanding is that pdf_document implies you are running pdflatex, i.e., that the whole source document is LaTeX/knitr.

raffdoc commented 7 years ago

Yes @harrelfe, that is correct. That should be outputted as single line correct. But in the final latex file it is four line comment, where first line is commented and other remaining three or more not commented (for latex syntax).

harrelfe commented 7 years ago

The code is supposed to be creating a single long line for the comment. Did you pass the text through any sort of formatter that added line breaks?

raffdoc commented 7 years ago

I do use RStudio's way of converting Rmardown to md and then compiling latex with pandoc. No other softwer other then that.