-
Notifications
You must be signed in to change notification settings - Fork 809
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
[toc2] Distinguish between (unnumbered) title and (numbered) section headings #1027
Comments
see #1017 - I think this would do what you're requesting? |
or rather, part of it, since it doesn't adjust the numbering of lower-level headings... |
I use the awkward solution to use html tags, via the nice :-) latex_envs extension , provided as a dependency of these contrib nbexetnsions. The The style is defined (and can be changed) in
|
#1017 may be helpful; I don't have a toc2 version that supports it yet; I may give it a try when it is ready for testing. It is less likely that MarkDown will support separate Title syntax, so such a toc2-based solution is preferable, but still somewhat of a kludge. It would indeed also be necessary to drop one level on the section numbering, and have the ability to set this per notebook, rather than globally. |
Sounds like a reasonable plan to me, @jfbercher
It wouldn't need a separate syntax, just the toc2 code to add an extra (hidden) element, or css class, if the option is in use.
The automatic numbering can be handled by using the method above, and yes, the configuration could be stored per-notebook, as with other options, and I think this would make sense. I'll have a crack at a PR now... |
@jcb91 ah ah I've almost have a running solution |
haha me too! No css/extra elements needed though. One thing I'm not clear about is what should happen to a second h1 heading, if the first has been skipped. I'm inclined to consider this as something which the user must avoid, since otherwise the numbering becomes inconsistent, or unclear how it should go - thoughts? |
Jupyter notebooks support six levels of headings in MarkDown through
#
...######
. Thetoc2
extension supports numbering of these headings.However, a document usually has only one title and this title is typically not numbered.
I typically use the level-1 heading (
# Title
) for the title, and would not want to waste a level of numbering on this.It would be nice if
toc2
would offer an option to interpret the level-1 headings as an unnumbered top-level title, and then start with just one number on level 2. That is,## Section
gives something like 1. Section, and not 1.1. Section.Or is there another/better way to do notebook titles in MarkDown?
Of course, you could do them using HTML tags to use a larger bold face font. But that would be an awkward solution.
The text was updated successfully, but these errors were encountered: