-
Hi again Omikhleia, I wanted to set the font size and style for image captions, so I had to dig into
Would it be any easier way to change the settings from within the document source code in the future? Cheers. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 17 replies
-
That's a good question - and I'm going to leave it "Unanswered" here, just providing some ideas and my current line of reasoning.
So something else is needed. But before going on with the reasoning, let me clarify a point:
So we are back to the brainstorming table, but with a little additional assumption: As far as concerned, I wouldn't involve much efforts into the "fallback" methods for other classes than my "resilient" ones... That's a small price to pay ("Use my base classes, and styling will be fully customizable eventually). This is also, obviously, because I have been concerned with the styling paradigm there ;) While in infancy (I don't like the current API and there are still bugs or bogus things, as of yet in Nov. 2022), the styling feature has served me well in a real book (its "fireproof"). You might think to it in terms of "CSS-like idea, but simpler", with styles being defined in a consistent way (via a "style specification") This doesn't tell us, though, how it could be used here in the context of Markdown processing.
|
Beta Was this translation helpful? Give feedback.
-
@no-vici I have finally moved forward on the "resilient.sile" classes to implement the third point I was alluding to in my previous answer. That is, loading styles from a separate file (in YAML for readility), as part of (in-progress) PR there: Omikhleia/resilient.sile#13 There's a bit of work and tests required to complete the implementation, but at least the basic system is now nearly there. Perhaps you'll find the (in-progress too) documentation in PDF worth checking: Resilient Manual WIP -- The good stuff is in "Part II" (in that draft version). To summarize: When using the figure-caption:
style:
font:
size: "0.95em" # <-------------- Here!
(... rest of style details skipped ...) But actually, there's a lot more configuration possible. Since everything (almost) is "styled", say you want the caption label ("Figure N.") to be in red color, and actually be rather labelled "Illustration N." There's a style for it too, by default: figure-caption-main-number:
inherit: "figure-caption-base-number"
style:
font:
features: "+smcp"
numbering:
after:
kern: "iwsp"
text: "."
before:
text: "Figure " Which could be tuned to figure-caption-main-number:
inherit: "figure-caption-base-number"
style:
color: "red" # <--- Added!
font:
features: "+smcp"
numbering:
after:
kern: "iwsp"
text: "."
before:
text: "Illustration " # <--- Changed! One can tweak nearly everything, without having to dabble into the code, from skips to spacing, text labels, etc. And there's also a similar style for table captions, obviously. I do think it will address nicely customization aspects (provided one uses the resilient classes). I am quite convinced this is the way to go, with external style files which I also commit to Git along my Markdown or SILE sources, to keep my preferred styling for a given project. Yet, I wanted to share it here -- Comments are welcome. N.B. For Markdown processed directly from the CLI, of course, one would have to force the class, i.e.
|
Beta Was this translation helpful? Give feedback.
-
The style package is a very beautiful concept and approach, I think that the best way forward and it makes the settings for styles closer to the users' end. Hopefully, the documentation will be updated in the next version of the SILE book. Thanks again for all the hard-word invested in there. |
Beta Was this translation helpful? Give feedback.
The style package is a very beautiful concept and approach, I think that the best way forward and it makes the settings for styles closer to the users' end. Hopefully, the documentation will be updated in the next version of the SILE book.
Thanks again for all the hard-word invested in there.