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

Formatting of the last element before a new section gets distorted in a GitBook. #662

Closed
GegznaV opened this issue Dec 11, 2018 · 6 comments

Comments

@GegznaV
Copy link

GegznaV commented Dec 11, 2018

Formatting of the last element in the chapter before a new section gets distorted in a GitBook. I used the same project as in #661, thus session information is the same. To reproduce the problem:

  1. Open minimal bookdown example in RStudio.
  2. Create file 01.Rmd with contents: # (PART\*) Section {-}.

image

  1. Build a GitBook.
  2. Scroll to the end of Chapter 2, whis is before the new section:

image

If the section (01.Rmd) is removed, the formatting of the element is correct:
image

@yihui
Copy link
Member

yihui commented Dec 11, 2018

Since you have already got the reproducible example in your hands, why not upload it as a zip file here? That way, I don't have to repeat the work that you have already done by following your steps: https://yihui.name/en/2018/06/copy-and-run/ Thanks!

@GegznaV
Copy link
Author

GegznaV commented Dec 12, 2018

The project:
bookdown-issue-662--section-distortions.zip

At first, please, investigate contents of folder "_book" and compare the lists of references in Chapter 1 and Chapter 2.

@GegznaV
Copy link
Author

GegznaV commented Oct 1, 2019

Any news on solving this issue? @RLesur Maybe you have time to look into this?

@RLesur
Copy link
Collaborator

RLesur commented Oct 2, 2019

@GegznaV I had a quick look. My problem is that I do not understand your use case and your goal.

2. Create file 01.Rmd with contents: # (PART\*) Section {-}.

Why do you need this file with such a content?
If I do not create this file and insert # (PART\*) Section {-} as the first line of 02-literature.Rmd, the gitbook seems to be correct.

@cderv
Copy link
Collaborator

cderv commented Mar 24, 2021

Thank you all for your patience!

This is indeed a current limitation of bookdown design that we have now documented better: https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#special-headers

A part title should be written right before the first chapter title in this part, both title in the same document.

So the advice is to do as said in #662 (comment) : the special header must be set in the same document as the first chapter.

We know that this would be a limitation when writing a book and the chapter order will change. In that case you would like to have your part section on their own. It happened sometimes and it is a special case so it is why we will track this issue in #974
but that is not an easy thing to change I think and it feels like adding the special header in the chapter file is a easy to do. Please give a 👍 to the other issue if it matters for you.

Thank you.

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants