Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including articles as chapters #2

Open
bbartholdy opened this issue May 19, 2022 · 3 comments
Open

Including articles as chapters #2

bbartholdy opened this issue May 19, 2022 · 3 comments

Comments

@bbartholdy
Copy link
Owner

Need to find a way to include articles as chapters without (or with limited) copy-paste.

@bbartholdy
Copy link
Owner Author

The current solution:

Include the article as a git submodule. Each section in the article has its own .Rmd or .qmd file. These are included in the chapter by using the include shortcode {{< include path/to/file.ext >}}. This has the benefit of executing any R code, both chunks and inline, that is included in the file and rendering it properly in the chapter.

issue with current solution:

The articles use the here() function to sort out the file paths relative to the project root. When included in the chapters, the here() functions start at the project root of the dissertation, not the articles, causing the filepaths to break.

@bbartholdy
Copy link
Owner Author

Issue with here() has been resolved by including a code chunk at the top of the chapter .qmd/.rmd file. The current issue is that the shift-heading-level-by: 1 only works for html output and not pdf output. The pdf output retains the original heading levels from the chapter document, meaning the section headers from the article are rendered as individual chapters in the book.

@bbartholdy
Copy link
Owner Author

Solution recommended by Quarto team: quarto-dev/quarto-cli#1635

Shift heading levels via a lua filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant