While trying to knit .rmd file to pdf, if code chunks has stargazer function, the file is not knitting to pdf format. I have several tables (both long and short) with combination of regression output via stargazer in latex format but none of them are converting to pdf. I am using MikTeX as LaTeX distribution. I have used following code (as an example)
stargazer(pre.ols.sp01SIOI,pre.ols.sp02SIOI,pre.ols.sp03SIOI,pre.ols.sp04SIOI,
post.ols.sp01SIOI,post.ols.sp02SIOI,post.ols.sp03SIOI,post.ols.sp04SIOI,
style = "qje", type = "latex", header=FALSE, title = "Regression Analysis").
I am getting the following error.
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7440 64-bit) entering extended mode I was unable to find any missing LaTeX packages from the error log Paper1.v7_11Jun2020.log. Error: LaTeX failed to compile Paper1.v7_11Jun2020.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. In addition: Warning messages: 1: In readLines(log) : line 888 appears to contain an embedded nul 2: In readLines(log) : incomplete final line found on 'Paper1.v7_11Jun2020.log' 3: In readLines(log) : line 888 appears to contain an embedded nul 4: In readLines(log) : incomplete final line found on 'Paper1.v7_11Jun2020.log' 5: In readLines(log) : line 888 appears to contain an embedded nul 6: In readLines(log) : incomplete final line found on 'Paper1.v7_11Jun2020.log' Execution halted
I have followed the debugging tips mentioned on the yihui.org. But still no luck. I have also tried to assign the stargazer output and then use kable() and still it's not working. Moreover, I have tried to using landscape style.
I appreciate any assistance with the issue.
Thanks
Edit: The YAML header
title: XXX
documentclass: article
date: "r format(Sys.Date(),'%d %B, %Y')"
output:
pdf_document:
df_print: paged
fig_caption: yes
highlight: tango
number_sections: yes
citation_package: natbib
keep_tex: yes
bibliography: library.bib
header-includes:
-\usepackage{amsmath}
-\usepackage[utf8]{inputenc}
-\usepackage{autobreak}
-\usepackage{setspace}
-\usepackage{hyperref}
-\usepackage[authoryear]{natbib}
-\usepackage{caption}
-\usepackage{babel
-\usepackage{multirow}
-\usepackage{pdflscape}
-\usepackage{dcolumn}
-\usepackage{rotating}