ismayc / thesisdown

An updated R Markdown thesis template using the bookdown package
Other
809 stars 357 forks source link

How do I include external `00--prelim.Rmd` file in the `yaml` header? #166

Closed atanasj closed 2 years ago

atanasj commented 3 years ago

The 00--prelim.Rmd file has a number of headers. How is this called in the yaml header?

I have tried to put it under a heading e.g., acknowledgements, but then all the subheadings included in the document are printed in the final output i.e., Acknowledgements>Preface, Acknowledgements>Acknowledgements, etc. They way I interpreted the commented instructions I thought something along the lines of:

acknowledgements: |
  '`r if(knitr:::is_latex_output()) paste(readLines(here::here("prelims", "00--prelim.Rmd")), collapse = "\n  ")`'

Although the all the content is printing, it is all under the acknowledgements heading.

Thanks in advance for your help.

ismayc commented 3 years ago

Can you provide some screenshots to explain what you are seeing a little further?

ismayc commented 3 years ago

The 00--prelim.Rmd file is not called at all in YAML. It is only included if you don't want to use the YAML like here.

ismayc commented 3 years ago

If you are using readLines() it is going to remove much of the formatting, which may be leading to this.

atanasj commented 3 years ago

Thanks for that. That works well, however is there a way to insert those sections before the Contents as they appear in the main body now…

ismayc commented 3 years ago

You should be able to create individual files for each heading and use code similar to the code shown for the abstract in the YAML.

atanasj commented 3 years ago

Okay, great. I got that working by adding latex commands for the toc etc to specific docs, so I could make them appear where I wanted.

Apologies that I am turning this into a help thread, however where would I set the font size of the headers and paragraph indentation. I need to format this as APA v7, and they have specific formatting requirements for header levels and paragraph indentation.

Thanks in advance.

ismayc commented 3 years ago

You'll need to look through either template.tex or reedthesis.cls to change those settings. Unfortunately, I'm not able to support LaTeX help at this time.

github-actions[bot] commented 2 years ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org whenever possible) and link to this issue. If a reprex is not applicable, recording a short Loom video showing what you are seeing can go a long way in helping to diagnose problems.