Open PaulWessel opened 1 year ago
In the case of e.g. km^2; should it be :math:km^2
or km :math:^2
?
Probably :math:^2
to not change the font of km
as comparing to a linear km
, but this is really a :math:^-100
issue.
My thought as well.
There is also some variation in examples; some are indented and some are not. What is the preferred way? Here an example from grdvolume.
I think indentation is nice and the others are just leftover things from initial text to RST translation I imagine.
Alright. Indention it is!
To keep track of the pages that are being worked on I would like to suggest a naming convention for the issues. Can we agree on naming the issues
DwM
For example:
DwM gshhg.rst
would indicate that I work on gshhg.rst
to use the :math:
syntax and maybe fix minor layout things while at it?
@PaulWessel while working on #7233 I found out that
:math:`^2`
breaks the docs if you use copy & paste.
:math:
The visual representation in the html page is as intended but when you copy the text and paste it somewhere else things go wild. See the following example:
RestructuredText:
the polygon area in km\ :math:`^2` while *f\_area* is the actual area
Result after copy & paste:
the polygon area in km
2
while f_area is the actual area
:sup:
With some reading around I found that :sup:
would give proper html syntax that is "copy & paste safe" and gives the required visual representation in html:
RestructuredText:
the polygon area in km\ :sup:`2` while *f\_area* is the actual area
Result after copy & paste:
area is the polygon area in km2 while f_area is the actual area
While km2 is not as good as km^2 it preserves the meaning and layout better than whatever happens when using :math:
.
While not exactly your initial proposal I would recommend using :sup:
instead of :math:
for all those inline "raised to the power" occasions.
Maybe there is an even better way to achieve this without breaking copy & paste?
Do @joa-quim or @GenericMappingTools/gmt-docs have an opinion on :math:
vs :sup:
?
Not in particular, but if it does it better for some purpose, I'm fine with it.
Do @joa-quim or @GenericMappingTools/gmt-docs have an opinion on
:math:
vs:sup:
?
Looks good to me (had to look it up).
Just looked at gmtmath after @KristofKoch work and it looks great! However, I also noticed we have a bunch of sub-scripts as well and these look odd as chi2, nu1
. In fact, they should be:math:
treated I think since we might as well use the Greek chi^2 and nu_1 when explaining what A and B are since statistics books and tables use those terms. Then for operators like BCDF the p and n should be italicised as variables. BITTEST seems to have a dangling n, The CHI ops need Greek, COMB* need subscripts on C, E distros need greek lambda and so it goes down the list.
Description of the desired feature
Given that our Restructured Text documentation fully support mathematics, it would be nice to try to use it when we do math. If I cd into the doc source directory and search for things like "raised to the second power" which we do for area units and simple math, I find lots of places that could be improved very simply:
For the uninitiated you can just
grep ':math:' *
to see how it is done with math. I post this here since it is a very simple thing that new wannabe collaborators could try out for, say, one module at the time and offer a pull request for us to consider. We all have to full on the oars if we want to documentation to shine,