Drasil
Drasil copied to clipboard
HTML: Figures should have `Figure X: ` in their `figcaption` and references to figures should be prettier.
EDIT: Take Projectile's SRS for example. Specifically, the System Context Figure. We have ~2-3 issues:
- Figures are missing the
Figure:
text in their captions. - References to figures use the internal HTML IDs! For example, in the System Context section, we write
Fig:sysCxtDiag
. - Instead of writing the references, we should either use a short-caption (i.e., a short-title where available) OR use a numbering system.
@smiths Do you have any thoughts on whether this we should use a numbering system or a short-caption?
Original OP:
- LaTeX gets figure prefixes (i.e. "Figure xx: ") for free in captions, whereas HTML does not. This results in either the HTML not having "Figure xx:" prefixed to captions or LaTeX having "Figure xx: Figure xx: " prefixed to its captions.
- ~~HTML is not centering figures. LaTeX encloses figures in a
center
environment. ~~
A similar (but different) thing happened with tables (#833), and I think (at least for now) we're OK with it. This came up now because I'm removing a function that created a LabelledContent
for a figure (because it's only used a couple of times and isn't worth it), and it happened to hardcode these figure numbers.
@JacquesCarette I see I'm suppose to review this open issue and report back with what the current state of the problem is... I started and have already seen an instance of a missing "Fig:xx:" prefixing a caption. Would you like me to make a list of all the places that have an issue with the "Fig:xx:" prefix?
I'm also looking at the html side by side with the tex file and will report the inconsistencies together.
Yes, the first step is to report back. A list of all the problems would be excellent.
It seems that, at some point, things might have changed from Figure to Fig in the html. That's probably fine. It's shorter.
Okay I'll do that
SWHS_SRS
- under "Specific System Description" > "Physical System Description" there's a missing "Fig:Tank:" before the caption "Solar water heating tank, with heat flux into the water from the coil of qC and heat flux into the PCM from water of qP" (html)
DblPendulum_SRS
- under "Physical System Description" there's a missing "Fig:pendulum:" before the caption "The physical system"
GamePhysics_SRS
- under "General System Description" > "System Context" there's a missing "Fig:sysCtxDiag" before the caption "System Context"
GlassBR_SRS
- under "General System Description" > "System Context" there's a missing "Fig:sysCtxDiag" before the caption "System Context"
- under "Specific System Description" >"Physical System Description" there's a missing "Fig:physSystImage" before the caption "The physical system"
- under "Appendix" there's a missing "Fig:demandVSsod" and "Fig:dimlessloadVSaspect" beneath their respective graphs.
NoPCM_SRS
- under "Specific System Description" > "Physical System Description" there's a missing "Fig:Tank:" before the caption "Solar water heating tank, with heat flux from heating coil of qC" (html)
PDController_SRS
- under "General System Description" > "System Context" there's a missing "Fig:systemContextDiag" before the caption "System Context"
- under "Specific System Description" > "Physical System Description" there's a missing "Fig:pidSysDiagram" before the caption "The physical system"
Projectile_SRS
- under "Specific System Description" > "Physical System Description" there's a missing "Fig:Launch" before the caption "The physical system"
Should i go ahead and fix these? from looking at one of the fig:xx:caption that came out the right way i could edit the tex file
- another inconsistency i see is that in GamePhysics the "system context diagram" is"Fig:sysCtxDiag" but in PDController it is "Fig:systemContextDiag".
@JacquesCarette
You should never edit the tex file - it's generated. Something in the generator is always the real problem.
It is really weird that the html has something in it, that doesn't show up in the tex file. That would be the next thing to investigate. Maybe start with Projectile (it's the smallest), and let's see what HTML and what LaTeX is generated right around the "Fig:SystemContextDiag". It would be useful to see the Drasil that generates that too.
The difference in labels between GamePhysics and PDController is not a big deal, as those labels are human-generated. They can be fixed, but it's not a big concern.
Small note from our meeting:
On the LaTeX side, this is done for us by the compiler. For the HTML side, since we already use the figure tags, we might look into using the "counter" CSS properties in our SRS stylesheet to do the rest of the work (e.g., w3schools information, w3schools specific example), or, if we prefer Javascript, we can have a little snippet of Javascript code that, when the document is loaded in the web browser, scans the document for sections, subsections, and figures, and adds the numbering as appropriate. I think the better solution is to use CSS because it's a necessity to rendering the page (e.g., the page will show a spinner in the tab favicon in most web browsers until the page has been fully rendered).