question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent treatment of H1 headers in LaTeX build

See original GitHub issue

Describe the bug Some H1 headers in .ipynb Markdown cells are converted to LaTeX \chapter{...} commands and some are converted to \section{...} commands. I can’t seem to tell or control why/how this happens.

To Reproduce Steps to reproduce the behavior:

  1. Choose a jupyter-book project. I’m using this one.
  2. Ensure that project has many different H1-type headers in it (using Markdown’s # in .ipynb cells), spread over several files.
  3. Run jupyter-book build . --builder pdflatex.
  4. View the generated PDF in ./_build/latex/. (In the above repo, it’s right here).
  5. The first # header seems to have become a chapter and all other # headers have become sections within it.

Expected behavior Each H1 header should be treated equally, each creating its own chapter.

Environment (please complete the following information):

  • Python Version 3.7.3
  • Output of jupyter-book --version
Jupyter Book: 0.7.0    # but I've tried with 0.7.2dev0 also and got the same problem
MyST-NB: 0.8.1
Sphinx Book Theme: 0.0.23
MyST-Parser: 0.8.1
Jupyter-Cache: 0.2.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:35 (30 by maintainers)

github_iconTop GitHub Comments

1reaction
nathancartercommented, Feb 23, 2021

This is great! Thanks for the persistence at it.

1reaction
AakashGfudecommented, Feb 23, 2021

thanks @RojerGS checking your issue810 repo against PR #1167 produces the following output python.pdf

Amazing work @mmcky and everybody. Can I get rid of my repository now?

I think you can. This PR is has handled the extension use case as well: https://github.com/executablebooks/jupyterbook-latex/pull/45

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bibliography header inconsistency with my page style ...
I have tried to change \leftmark with \rightmark as suggested by @daleif . It solved the Bibliography headers, but the other chapters (numbered, ......
Read more >
Headers and footers - Overleaf, Online LaTeX Editor
which explores and explains the low-level, mark-based, mechanisms used by TeX engines to create headers and footers—and why the \mark command is needed....
Read more >
LaTeX2e unofficial reference manual (January 2022)
The following document class names are built into LaTeX. ... Thus, a command to set page headers is for a package while a...
Read more >
Pandoc Markdown - Data Science with R
Turn your analyses into high quality documents, reports, presentations and dashboards with R Markdown. Use a productive notebook interface to weave together ...
Read more >
Don't write in LaTeX! It's just for typesetting - Daniel Allington
Technically, LaTeX is built on top of TeX: 'a special-purpose ... was a top level heading ('Heading 1', equivalent to the HTML H1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found