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

default CSS theme: only center the title header #273

Closed
dhimmel opened this issue Oct 21, 2019 · 4 comments
Closed

default CSS theme: only center the title header #273

dhimmel opened this issue Oct 21, 2019 · 4 comments

Comments

@dhimmel
Copy link
Member

dhimmel commented Oct 21, 2019

Currently all <h1> elements are centered due the following CSS:

/* biggest heading */
h1 {
margin: 40px 0;
text-align: center;
}

However, I am thinking that the only h1 element that should be centered is the title, which pandoc denotes with class="title". Previously this was never an issue because manuscripts usually only had a single h1 heading which was the title. However, from jgm/pandoc#5071 (comment), it appears that pandoc recommends using h1 for the first level of headings (like abstract, introduction, references).

This has become an issue for manubot/manufesto#3 where I switched abstract and such to h1 in order to improve the numbed sections. See what the centering of non-title h1 elements looks like in manuscript-1.0.10-9cb98a6.pdf.

@vincerubinetti what do you think?

@vincerubinetti
Copy link
Collaborator

I'm not sure. In the case of your Manufesto that you linked, I think the better solution is either to just make "Intro", "Abstract", and "Features" <h2>'s along with all the features, or move those down to <h2> and move all the features down to <h3> and make <h3>'s more visually distinct (maybe with an underline like the <h2>'s have.

We had talked about having <h1> centered for the title, and the very rare case of supplements. I don't think <h1>'s should be used liberally sorta like they are in that version of the Manufesto; they should be super big-picture, and very rare.

If we were to left align non-title <h1>'s, we'd also want to decrease their text size too; it looks too big in your Manufesto.

@dhimmel
Copy link
Member Author

dhimmel commented Oct 21, 2019

My markdown linter in vscode seems to agree that we shouldn't use h1 for section headings:

MD025/single-title/single-h1: Multiple top level headings in the same document markdownlint(MD025)

In manubot/manufesto@0fdde9c, I tried out the --base-header-level=2 pandoc argument, such that we can type # Abstract in the markdown as suggested in jgm/pandoc#5071 (comment), but have that render as h2. The title stays as h1.

We had talked about having <h1> centered for the title, and the very rare case of supplements

Good point regarding supplements. I forgot about that use case.

Will update this issue with more final considerations, but for now thinking that I'll probably close as I think the Pandoc convention of using h1 for section headings is a bit misguided.

@agitter
Copy link
Member

agitter commented Oct 22, 2019

the Pandoc convention of using h1 for section headings is a bit misguided.

That's my opinion as well. h2 seems more appropriate for section headings, h1 for the main title and supplement title.

@dhimmel dhimmel closed this as completed Oct 22, 2019
@Nebucatnetzer
Copy link

I can understand the reasoning behind this.
I noticed however that it introduces a problem with the TOC in the HTML as we can see in the example.
Screenshot from 2019-12-22 22-56-52

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

4 participants