Comments (3)
It seems that the bug comes from these two lines:
(define/public (number-depth number)
(if (null? number)
0
(+ 1 (for/sum ([i (in-list (cdr number))]) (if (not (string? i)) 1 0))))) ;; ignores strings here
(define depth (+ (number-depth number) (or (render-part-depth) 0)))
not
The number-depth
function computes how many "segments" compose the number, and ignores strings (it seems that one should instead return a list of two strings to obtain the correct behaviour, but this is not documented). However, I understand that the depth of the section should depend on the whole number
, including the strings and #f
values, so (length number)
should be used instead of number-depth
, again, if I understand correctly what's going on here.
Note that the following document, which returns #f
instead of strings, correctly nests SubAA
and SubAB
as subsections of SecA
, so I don't really see why strings are treated as an exception here.
#lang scribble/manual
@require[scribble/core]
@(define my-numberer
(make-numberer (λ (current parents)
(values #f
(add1 current))) 1))
@(define s (style #f (list my-numberer)))
@title{Foo}
@(table-of-contents)
@section[#:style s]{SecA}
@subsection{SubAA}
@subsection{SubAB}
@section[#:style s]{SecB}
@section[#:style s]{SecC}
from scribble.
Is this the same doc issue as #96, or is something more needed here?
from scribble.
Using a list of two strings does "solve" the problem, but when a single string is returned, I don't see why the subsections would need to bebe lifted one level up.
If I understand correctly, the single-string case can be used for things like "First part", "Second part", where we wouldn't want a "First.2.5" section, which would be a nonsensical numbering. I suppose that we nevertheless do want subparts of these "grouper" parts to show up as actual subparts, not as sibblings.
from scribble.
Related Issues (20)
- Verbatim text not wrapped correctly in PDF output HOT 1
- Double underscore renders as single underscore HOT 5
- Why is `~` converted to `$\sim$` by the LaTeX renderer? HOT 6
- racket and code should highlight quote consistently
- autobib: support bbl file generation HOT 2
- Scribble examples fail to use `+` correctly
- figure: default-figure-* should be configurable
- Support #:index? in envvar HOT 1
- Hide heading buttons on non scribble/manual
- Inconsistent href
- scribble/llncs fails to download llncs.cls HOT 6
- racketblock can't typeset a vector with no source location
- Use syntax-span and syntax-position to compute the tail space in a list
- typeset: unmatched paren in expr? mode
- typeset: hashalw is not supported
- typeset: hash with no srcloc fails to render
- markdown: no title makes malformed output
- acmart.cls update HOT 6
- scribble/acmart + biblatex
- [Feature Request] Allow `math` to interpret content within `{}` as subscripts or superscripts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scribble.