In a Scribble document, I'm using subsubsection , but don't want numbering - and the line above the title.
If I add style="border: none; padding-top: 0px; margin-top: 1em;"
to the generated HTML in the h5
tag, this has the wanted effect.
I've read about styles what I could find in the Scribble documentation and this section seems to be the closest to what I want.
In my Scribble document, I have
@(define (entry-subsection text)
(subsubsection
#:style
(style
#f
(list 'unnumbered
; (alt-tag "h5")
(attributes '((style . "border: none; padding-top: 0px; margin-top: 1em;")))))
text))
and
@entry-subsection{``Technical'' number types}
but the custom style information isn't included in the generated HTML. (The 'unnumbered
style is applied, though.) I've tried the code with and without the (alt-tag "h5")
.
Do you have any suggestions on how to get the custom style information included?
There seems to be a bug in subsubsection
. (The above code works with elem
.)
I entered a Scribble issue:
opened 05:52PM - 18 Sep 22 UTC
The following Scribble file,
```
#lang scribble/manual
@(require
scribb… le/html-properties
scribble/core)
@(define red-style
(make-style #f (list (attributes '((style . "color: red"))))))
@elem[#:style red-style]{red elem}
@section[#:style red-style]{red section}
@subsection[#:style red-style]{red subsection}
@subsection[#:style red-style]{red subsubsection}
```
is supposed to display all the text in the `elem` and `*section`s in red.
However, the style isn't applied to the `*section`s. The HTML is
```
...
<p><span style="color: red">red elem</span></p>
<h3>1<tt> </tt><a name="(part._red_section)"></a>red section</h3>
<h4>1.1<tt> </tt><a name="(part._red_subsection)"></a>red subsection</h4>
<h5>1.1.1<tt> </tt><a name="(part._red_subsubsection)"></a>red subsubsection</h5>
...
```
This problem might also occur for other functions apart from `*section`.
Given the described bug, it's currently impossible to add a style attribute to a subsubsection. However , it's possible to go the other way around and add an alt-tag
property to an elem
/element
.
Therefore, my workaround now is:
@(define entry-subsection-style
(make-style
#f
(list (alt-tag "h5")
(attributes '((style . "border: none;
padding-top: 0px;
margin-top: 1em;
font-size: 1.4rem;"))))))
@(define (entry-subsection text)
(elem #:style entry-subsection-style text)))
1 Like