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

missing headings; some at wrong level? #373

Closed
nickeubank opened this issue Jan 8, 2020 · 4 comments
Closed

missing headings; some at wrong level? #373

nickeubank opened this issue Jan 8, 2020 · 4 comments

Comments

@nickeubank
Copy link

nickeubank commented Jan 8, 2020

When rendered, I'm losing some of my headings, and others are being rendered at the wrong level. For example, here's my notebook:

image

And here's the build:

image

Also others are at the wrong level -- this should be H3:

image

But it's H4:

image

Attaching ipynb and html:

Archive.zip

(This seems distinct from other "heading" issues?)

EDIT: Add versions:

nbsphinx                  0.5.0                      py_0    conda-forge
sphinx                    2.3.1                      py_0    conda-forge
sphinx-markdown-tables    0.0.9                    pypi_0    pypi
sphinxcontrib-applehelp   1.0.1                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.1                      py_0    conda-forge
sphinxcontrib-htmlhelp    1.0.2                      py_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.2                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.3                      py_0    conda-forge
pandoc                    2.9.1.1                       0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
@nickeubank nickeubank changed the title missing headings; some at wrong label? missing headings; some at wrong level? Jan 8, 2020
@mgeier
Copy link
Member

mgeier commented Jan 9, 2020

Thanks for the report!

Have you noticed the warnings generated by Sphinx?

taxonomy_of_questions-Copy1.ipynb:122: WARNING: Title level inconsistent:

Why Causal Inference is Hard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
taxonomy_of_questions-Copy1.ipynb:171: WARNING: Title level inconsistent:

Prediction Based on Causal Methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
taxonomy_of_questions-Copy1.ipynb:184: WARNING: Title level inconsistent:

Prediction Based on Supervised Machine Learning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is caused by the peculiar way how Sphinx/docutils handles heading levels.

Sphinx doesn't have "absolute" heading levels. The resulting levels are determined by how you are nesting them.
And if you are not consistent in your usage, the result might not be as expected (and there might be a warning).

It might be possible to work around this behavior to some degree (but I don't know how), but I'm not sure if it's worth the trouble.

If you have suggestions for how to improve the situation, please speak up!

This seems distinct from other "heading" issues?

#22 (comment)
#53 (comment) and #53 (comment)

Please make all Sphinx warnings disappear, and if the problem still persists, please post an update here.

There has been a different issue regarding headings, but I don't know if it is relevant here: #55.

@nickeubank
Copy link
Author

Oh! I had not seen that - I was using auto billed to the error messages must have scrolled by too quickly. Will dig in!

Sent with GitHawk

@nickeubank
Copy link
Author

Yup, that was it! Thanks for the help, and sorry for not catching that myself.

@mgeier
Copy link
Member

mgeier commented Jan 10, 2020

No problem! I know that this behavior is not entirely obvious ...

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

2 participants