I'm currently having an issue with latex in Rmarkdown (using fancyhdr package). I am trying to make a data report with a certain template style. This is a screenshot of the pdf at its current stage and as you can see the title "Equity1" (entire page body) is higher up than in the page 2.

Screenshot of PDF

These are the codes on my YAML of Rmarkdown

    latex_engine: pdflatex
  \fancyhead[L]{\textbf\selectfont\sffamily{Daily Report}}
  \fancyfoot[L]{\textbf\selectfont\sffamily{NOT INTENDED FOR FORWARDING}}
classoption: a4paper

And these are in the rest of the codes:

> ## \selectfont\sffamily{EQUITY 1}
> ```{r}
> # content page 1 
> ```  
> \newpage

> ## \selectfont\sffamily{EQUITY 2} 
> ```{r}
> # content page 2 
> ```

I was wondering if I made a mistake in my YAML or in my code later on? (I am using LateX through rMarkdown because I am trying to have it available as a PDF for my output).

Thank you for your help!

  • You will get a warning in the log file about the headheight. Read the warning and act accordingly. – Johannes_B Apr 1 at 5:13
  • @Johannes_B when you mean act according, I was wondering how to code it in Tex. The error code says: Package Fancyhdr Warning: \headheight is too small (12.0pt): Make it at least 32.08571pt. How should I go by creating a headheight of 32pt? – k8a_s Apr 1 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.