E3SM icon indicating copy to clipboard operation
E3SM copied to clipboard

Fixes minor typos in referencing equations.

Open bishtgautam opened this issue 7 months ago • 1 comments

Changes \eqn{} to \eqref{}.

[BFB]

bishtgautam avatar Jun 04 '25 15:06 bishtgautam

PR Preview Action v1.6.1 :---: |

:rocket: View preview at
https://E3SM-Project.github.io/E3SM/pr-preview/pr-7415/

|
Built to branch gh-pages at 2025-06-04 16:34 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

github-actions[bot] avatar Jun 04 '25 15:06 github-actions[bot]

@peterdschwartz please approve and merge this.

rljacob avatar Aug 13 '25 17:08 rljacob

@bishtgautam I'm seeing a few error messages like: "Label 'eqn_xxx' multiply defined"

peterdschwartz avatar Aug 13 '25 20:08 peterdschwartz

@peterdschwartz Where are you seeing those errors? I looked at following locations, but could not find the error: https://github.com/E3SM-Project/E3SM/actions/runs/15447672354/job/43481586795 https://github.com/E3SM-Project/E3SM/actions/runs/15447672343/job/43481586787 https://github.com/E3SM-Project/E3SM/runs/43481742534

bishtgautam avatar Aug 15 '25 03:08 bishtgautam

Oh, I found those errors. They are showing up on the rendered page https://docs.e3sm.org/E3SM/pr-preview/pr-7415/ELM/tech-guide/shortwave_radiation. Let me try to fix them.

bishtgautam avatar Aug 15 '25 03:08 bishtgautam

This is the error message that I also got:

label_error

But, after refreshing the browser, the equations were rendered correctly:

no_label_error

@mahf708, any thoughts on what could be going on here? Is eqnarray not recommended?

bishtgautam avatar Aug 15 '25 04:08 bishtgautam

I think it is complaining about the fact that \label appears twice in this \begin...\end sequence:

$$
\begin{eqnarray}
\alpha_{gb,\Lambda} &=& \alpha_{b,\Lambda}^{soi} (1 -
f_{sno})  + \alpha_{b,\Lambda}^{sno} f_{sno}
\label{eqn_g_dir} \\[0.5em]
\alpha_{gd,\Lambda} &=& \alpha_{d,\Lambda}^{soi} (1 -
f_{sno})  + \alpha_{d,\Lambda}^{sno} f_{sno}
\label{eqn_g_dif}
\end{eqnarray}
$$

Up to you if you want to reformulate these eqs (by breaking them) or if you want to ignore and just rely on people refreshing the page.

Fwiw, I personally tend to not reference equations in docs I write. I tend to write docs less as a technical manuscript but more as a blog, for a friendly reader. I find equation numbering (and other formal stuff) to be a bit too formal for these types of docs. Obviously this is just a personal opinion. You can see how I tend to write docs in places like https://raw.githubusercontent.com/E3SM-Project/E3SM/refs/heads/master/components/eamxx/docs/user/diags/field_contraction.md and https://raw.githubusercontent.com/E3SM-Project/E3SM/refs/heads/master/components/eamxx/docs/technical/aerocom_cldtop.md. In other words, smaller pages targeting specific concepts, and nothing too complex/sprawling that would require careful eq referencing, etc.

mahf708 avatar Aug 15 '25 15:08 mahf708

@mahf708, thanks for the comments and links. However, they are two different labels: \label{eqn_g_dir} and \label{eqn_g_dif}. Refreshing the page is not a solution. I will do more Googling regarding this issue. If I can't find a fix for it, I will stop using eqnarray for equations that require labeling multiple equations.

bishtgautam avatar Aug 15 '25 15:08 bishtgautam

@mahf708, thanks for the comments and links. However, they are two different labels: \label{eqn_g_dir} and \label{eqn_g_dif}. Refreshing the page is not a solution. I will do more Googling regarding this issue. If I can't find a fix for it, I will stop using eqnarray for equations that require labeling multiple equations.

Yeah, I noticed that. However, I think the error is simply because \label itself is showing up twice (regardless of the content it's carrying --- the \label macro must be triggering some warning elsewhere ...) I will try to reproduce locally and see if there's a good solution besides breaking up the equations; I'd think this is ok, no?

One more thing, try to ensure your markdown renders correctly even in plain markdown... i.e., check this file:

https://github.com/E3SM-Project/E3SM/blob/8537409f7eb5988ed925be5c78bc895d2cb12722/components/elm/docs/tech-guide/shortwave_radiation.md

And you will find this:

Screenshot 2025-08-15 at 12 11 09

mahf708 avatar Aug 15 '25 16:08 mahf708

Making sure the plain markdown is rendered correctly is a great suggestion.

bishtgautam avatar Aug 15 '25 17:08 bishtgautam

@peterdschwartz, I'm going to switch all eqnarray to align in a separate PR. When you get a chance, please integrate this.

bishtgautam avatar Aug 20 '25 19:08 bishtgautam

merged to next and master

peterdschwartz avatar Aug 21 '25 17:08 peterdschwartz