billyi
January 15, 2023, 6:40am
1
This is what I put in the yml file:
project:
type: book
output-dir: /doc
book:
title: just a book
chapters: # for level 1 - part
- index.qmd
- part: part1.qmd
chapters: # for level 2 - chapter
- chap1.qmd
- chap2.qmd
chapters: # for level 3 - section
- sect1.qmd
- sect2.qmd
Then I got "ERROR: YAMLException: bad indentation of a sequence entry" message.
Is there an example for 3-level quarto book yaml file? Thank you!
cderv
January 17, 2023, 4:44pm
2
What do you mean by 3 level quarto book ?
You can find example of books in the gallery Quarto – Gallery
I don't think using chapters
twice this way is supported. On the YAML it should be part optionally if you want to regroup chapters. Then using the headers in each chapter will organize the TOC with some main section and subsection.
billyi
January 19, 2023, 8:07am
3
Thank you for the reply.
Upon visiting all eight books' "_quarto.yml" files listed in the Gallery book section, I find that none of them use a three-level structure. Therefore, I am still looking for hints.
cderv
January 19, 2023, 10:24am
4
I don't think it is possibly as you are expecting it. You could ask about this in quarto-dev/quarto-cli · Discussions · GitHub in the Quarto project
Possible related issue by the way:
opened 02:36PM - 06 Aug 22 UTC
enhancement
books
Quarto version: I tried a few version. Started with 1.0.37 then I updated to the… latest dev version (says 99.9.9) using this
```
git clone https://github.com/quarto-dev/quarto-cli
cd quarto-cli
./configure-macos.sh
```
Then went back to v1.0.38 by re-installing.
RStudio: 2022.02.2
OS: Mac Big Sur 11.6.2
This is specific to a Quarto book project.
If have 2 h1 headers in a chapter qmd, the first appears in TOC and the others appear with the right sequential chapter numbers but don't appear in the TOC and later chapters don't "know" about the new chapters.
Example `_quarto.yml`
```
project:
type: book
book:
title: "test"
chapters:
- index.qmd
- chap1and2.qmd
- chap3.qmd
format:
html:
theme: cosmo
```
`chap1and2.qmd`
```
# Chapter 1
This is chapter 1
# Chapter 2
This is chapter 2
```
This is the output. Notice the TOC.
<img width="662" alt="image" src="https://user-images.githubusercontent.com/2545978/183253088-e90f396a-43fc-4253-b199-50c865c61326.png">
### `quarto check` Output
```
[✓] Checking Quarto installation......OK
Version: 1.0.37
Path: /Applications/quarto/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.9.12
Path: /opt/homebrew/opt/python@3.9/bin/python3.9
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking R installation...........OK
Version: 4.1.1
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Users/eli.holmes/Library/R/x86_64/4.1/library
- /Library/Frameworks/R.framework/Versions/4.1/Resources/library
rmarkdown: 2.14
[✓] Checking Knitr engine render......OK
```
### `quarto tools check` Output
```
[✓] Inspecting tools
Tool Status Installed Latest
chromium Not installed --- 869685
tinytex External Installation --- v2022.08
```
### Use case, why is this needed?
In report writing situation, you often don't know how many chapters (appendices) you will need. You are using `knit_expand()` with an child.Rmd that is creating all your chapters (appendices) based on the data (which vary). That `knit_expand()` is a for loop (or map function) and is creating the markdown dynamically. This works fine in Quarto...except that it doesn't recognize the later h1 levels as proper chapters.
### Checklist
- [x] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [x] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [x] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [x] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [x] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [x] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [x] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
billyi
January 19, 2023, 12:23pm
5
Thank you very much for your guide. Having visited the Quarto project discussion, now I am aware that there is no 3-level structure available at this time. ( Quarto book, Chapters-part-chapters, can I create a third directories? · Discussion #2504 · quarto-dev/quarto-cli · GitHub )
1 Like
system
Closed
January 26, 2023, 12:24pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.