Hi, i'm new to markdown, so this is difficult to me. I'm working with feols function from the package "fixest" to estimate a fixed effects model. My code runs fine in R scrip and rmd, but when I try etable to export my results I only get Latex code. My code looks something like this (here I use airquality as an example):
The statement etable(est1,est2, tex = T) generates LaTeX code .
With the chunk option results='asis' you should indicate that
you want to include that 'as it is' in the tex intermediary file.
When I did this I got an error that the midrule command could not be found.
Google search told me that midrule belongs to the booktabs package
Therefore I added extra_dependencies: ["booktabs"] in the YAML to generate \usepackage{booktabs} ,
but there are other ways to add to the preamble. See e.g. https://bookdown.org/yihui/rmarkdown-cookbook/latex-preamble.html
The full Rmd file then looks like this (I enclosed it in four backticks to show the three backticks ) :
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: