Help talk:Displaying a formula
{{User:MiszaBot/config
|maxarchivesize = 100K
|counter = 3
|algo = old(365d)
|archive = Help talk:Displaying a formula/Archive %(counter)d
}}
{{WikiProject banner shell|
{{Wikipedia Help Project|class=NA|importance=mid}}
}}
{{archives|search=yes}}
Slightly lost on Wikipedia formatting for an article, could someone show me the code to render this?
It's from this URL:
https://pubs.aip.org/aip/jap/article-abstract/82/6/2759/178858/Cross-relaxation-and-upconversion-coefficients-of
How do I render that Pr~ et al at the end? -- Very Polite Person (talk) 17:24, 14 May 2024 (UTC)
: I figured it out... "Cross relaxation and upconversion coefficients of the mid-infrared transitions of Pr3+:LaCl3". 17:39, 14 May 2024 (UTC)
Displaying the name of a set
In Mathematics upper case blackboard bold letters are used to refer to various sets, e.g., for Complex numbers, for Quaternions, for Naturals, for Rationals, for Integers. The article should discuss entering them as {{Stylized LaTeX}} either as
\C
etc. or as
\textbb{C}
etc. -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 14:31, 13 March 2025 (UTC)
:This has already been discussed, and the result is in MOS:MATH#Common sets of numbers. Any change to the present consensus must be discussed there. D.Lazard (talk) 14:51, 13 March 2025 (UTC)
::Shouldn't there be a link to that? Do you have a link to the discussion? Thanks. -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 15:38, 13 March 2025 (UTC)
:::The choice between {{tmath|\C}} and {{math|C}} is a question of style, not a question of display technique. For links to discussions, I have no time to spent searching the archives of MOS:MATH and WT:WPM. Every paragraph of MOS:MATH has been discussed many times before reaching its actual state. D.Lazard (talk) 16:04, 13 March 2025 (UTC)
math tag with display=block no longer doing so?
Apologies if this is reported somewhere already, cf. {{Special:Diff/1284223562|edits like these that seem necessary}} for the moment, given sometime recently the tags stopped displaying as anything but {{code|inline}}. I assume it's on the level of a CSS issue? Remsense ‥ 论 09:04, 6 April 2025 (UTC)
Only part of formula is displayed (with horiz slider). How display entire formula?
I'm looking at Periodic_continued_fraction#Generalized_continued_fraction, and there are a few formulas in that section. The bottom one is an issue: only a part of the formula is displayed (even when browser window is very, very wide), and the user must use sliders (both horizontal and vertical) to see the whole formula.
I thought "well, maybe that is inescapable", but the two formulas above the problematic formula are equally large, and yet they do not require (or display) slilders.
Questions Is there a way to improve the bottom formula so it displays the whole formula?
The configurations that exhibit the problem:
- Apple MacMini OS 15.1.1; Safari browser
- Apple MacMini OS 15.1.1; Firefox browser
- Windows OS 11 MS Edge browser
Configurations that do not exhibit the problem (that is, the full formula is displayed without sliders):
- Wikipedia app on Android phone.
- Windows OS 11 Firefox browser
Noleander (talk) 02:06, 7 April 2025 (UTC)
:BTW, here are those two formulas, copied verbatim from the above article. The problem shows up in the lower formula, but the upper formula is okay. If you do not see the sliders in the lower formula, refer to the configuration information in post immediately above.
::
:\begin{align}
:\sqrt{114} = \cfrac{\sqrt{1026}}{3} = \cfrac{\sqrt{32^2+2}}{3} &= \cfrac{32}{3}+\cfrac{2/3} {64+\cfrac{2} {64+\cfrac{2} {64+\cfrac{2} {64+\ddots}}}} \\
:&= \cfrac{32}{3}+\cfrac{2} {192+\cfrac{18} {192+\cfrac{18} {192+\ddots}}},
:\end{align}
:
:which is simply the aforementioned evaluated at every third term. Combining pairs of fractions produces
::
:\begin{align}
:\sqrt{114} = \cfrac{\sqrt{32^2+2}}{3} &= \cfrac{32}{3}+\cfrac{64/3} {2050-1-\cfrac{1} {2050-\cfrac{1} {2050-\ddots}}} \\
: &= \cfrac{32}{3}+\cfrac{64}{6150-3-\cfrac{9} {6150-\cfrac{9} {6150-\ddots}}},
:\end{align}
:
Indentation rules
The most used indentation rule for displaying math is to use a colon such that
:
however if I am reading MOS:INDENT and this page right, we should use two line breaks and
Is this right? This would require a lot of work to change everywhere. Is this recent? Is there anyway to revert to the previous convention? The colon is shorter and simpler, while the double line break and block display does not indent on mobile, and leads to other problems, specially if text is in the same line. ReyHahn (talk) 11:23, 7 April 2025 (UTC)
{align} vs {aligned}
Is {align} silently being converted to {aligned}? In amsmath LaTeX, {align} can only be used in text-mode, whereas on WP it works even in a sub-expression.
Is it ok to use {aligned}? It seems to work.
If so, should this be stated (for anybody wanting to use the same code for amsmath LaTeX and WP)? catslash (talk) 23:46, 14 May 2025 (UTC)
:The question is unclear. By {{tqq|{{brace|align}}}} and {{tqq|{{brace|aligned}}}} do you mean the align and aligned environments? please show the {{stylized LaTeX}} source inside {{tag|syntaxhighlight|attribs=lang=latex}} or the {{tag|math}} wikitext inside {{tag|syntaxhighlight|attribs=lang=wikitext}}. -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 11:44, 15 May 2025 (UTC)
::Yes, the align and aligned environments. The source:
:::
& = c \\
& = d \\
& \phantom = \vdots \\
& = z \end{aligned} \right\} 25 \text{ lines}
::works fine both as wikitext and {{stylized LaTeX}}:
:::
& = c \\
& = d \\
& \phantom = \vdots \\
& = z \end{aligned} \right\} 25 \text{ lines}
::Whereas, if aligned is changed to align, then while it still works as wikitext, as {{stylized LaTeX}} it gives the error ! Package amsmath Error: Erroneous nesting of equation structures;. catslash (talk) 16:06, 15 May 2025 (UTC)
:::Could {{tqq|One consequence is that the formula enclosed in the \left ... \right pair cannot have line breaks in the output.}} be the problem? Do you need anything from amsmath that is not already in {{stylized LaTeX|2}}? -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 17:14, 15 May 2025 (UTC)
::::It is the amsmath package which supplies the align and aligned environments. Without \usepackage{amsmath}
the above code results in ! LaTeX Error: Environment aligned undefined. or ! LaTeX Error: Environment align undefined.. The code works fine with or without the \left ... \right pair. The question is (1) why does it also work with align in wikitext, (2) is there any reason not to use aligned in wikitext, (3) should the help page say that's is ok to use aligned? catslash (talk) 21:11, 15 May 2025 (UTC)
:::::The {{qi|explanation}} for the message is circular. Have you tried, e.g., stack exchange? What hapens if you remove the NL (\\)? -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 13:35, 16 May 2025 (UTC)