paulremo / NRPMHandbook

Repository to store and track the development on the ADS/Matrisk project for developing a jupyter book of the NRPM handbook.
Other
1 stars 1 forks source link

Change numbering and referencing in figures, equations, tables, and sections to auto #8

Closed csxADS closed 2 years ago

paulremo commented 2 years ago

Currently, all figures, equations, and tables are numbered and referenced manually. This is cumbersome, error-prone, and will lead to problems when new equations are inserted into the digital handbook in the future. We will therefore switch to automatic numbering and references wherever possible. Therefore, figures, tables, and equations should be inserted and referenced in the document in the following way:

Note

Figures

Tables

Equations

As it is not possible to automatically number admonition tiles, I suggest not to use equations inside admonitions extensively. Instead, the equation admonition class should be used to highlight certain important equations and then give them a meaningful title.

Sections/Chapters

Apparently, this only works until the H2 tag (##). The H3 tag (###) does not produce an automatically numbered reference.

csxADS commented 2 years ago

Changed all figure references (77 in 16 files)

csxADS commented 2 years ago
````{admonition} {eq}`misc_eq_14`
:class: equation
``
``  
```{math}
:label: misc_eq_14
R_{S}(t) = R_{A}(t) * R_{B}(t)

doesn't work (breaks the admonition) @paulremo

paulremo commented 2 years ago

Yes! You're right - I actually mentioned this right below the Equation section. You can't put references in titles/captions - we'll have to find a different way to do this 😄.

How about the following (to also summarize successive equations in one admonition):

````{admonition} Equation description
:class: equation
``
``  
```{math}
:label: misc_eq_14
R_{S}(t) = R_{A}(t) * R_{B}(t)
:label: misc_eq_15
R_{S}(t) = R_{A}(t) * R_{B}(t)
:label: misc_eq_16
R_{S}(t) = R_{A}(t) * R_{B}(t)

Can you test it?

csxADS commented 2 years ago

You mean removing the reference in the title and only put "Equation" instead ?

paulremo commented 2 years ago

Yes, either "Equation" or some meaningful two-word description of what the equation shows. The number should be shown automatically inside brackets next to the equation.

paulremo commented 2 years ago

@csxADS please also number section and chapter references with numref (see the updated main comment above)

csxADS commented 2 years ago

Done for tables miscellaneous, it will be very long for titles

paulremo commented 2 years ago

It will save a lot of time down the line 😄.

As I mentioned in the main note above, this will not work for H3 sections (###). For those sections, leave the current manual reference, but remove the number, i.e., change:

[Section 4.4.1](misc_4_4_1)

to anything that matches the sentence

as discussed in the [standard model section](misc_4_4_1)

But avoid using relative references like next section or previous section.

csxADS commented 2 years ago

Seems that it does not work for section titles

(Reliability Models for miscellaneous items)=

Reliability Models for miscellaneous items

appears like

(Reliability Models for miscellaneous items)= 5.4.4. Reliability Models for miscellaneous items

Seems that there is an issue with labeling titles, trying to get it

csxADS commented 2 years ago

Found the issue

csxADS commented 2 years ago

Done commit 27b52b99bfdce5534d8eba33756a6110b471a39f

paulremo commented 2 years ago

Thanks for that! It looks like you changed the hierarchy of certain sections - is that correct? If so, we should discuss this at today's meeting.

csxADS commented 2 years ago

There was just titles using too much # so that the build did not take it into account. That was a mistake during the copy of texts so I just removed useless #

paulremo commented 2 years ago

Okay, great! Did you take care of this in all chapters or just Miscellaneous?

csxADS commented 2 years ago

No but shouldn't we wait for the final decision to be taken on this subject ?

paulremo commented 2 years ago

@csxADS is this issue addressed for the Miscellaneous chapter?

csxADS commented 2 years ago

I'll have a check this morning and I keep you updated as soon as possible !

csxADS commented 2 years ago

Everything seems to be ok for miscellaneous @paulremo

paulremo commented 2 years ago

Thanks! I'll close this issue then.