How can I structure a 3-level part/chapter/section yml for quarto book

This is what I put in the yml file:

  type: book
  output-dir: /doc
  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!

What do you mean by 3 level quarto book ?
You can find example of books in the gallery 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.

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.

I don't think it is possibly as you are expecting it. You could ask about this in Discussions · quarto-dev/quarto-cli · GitHub in the Quarto project

Possible related issue by the way:

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

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.