spencermountain / wtf_wikipedia

a pretty-committed wikipedia markup parser
https://observablehq.com/@spencermountain/wtf_wikipedia
MIT License
775 stars 129 forks source link

lists are not placed in the correct document order nor indented properly #357

Closed waldenn closed 4 years ago

waldenn commented 4 years ago

Similar issue here (but the problem is not language specific): #262

Whenever there is a ordered or unordered list, the wtf parser removes the list (in case of no container section) OR moves the list to a position at the top of the section.

(side note: WRT to text without a section container, I have seen this issue also with other elements, eg. the math and chemical tags. This causes only the inline math-tags to be parsable as templates, not the free-standing ones. All content should be in a container section I feel.)

Example article original wiki-text:

{{Infobox number |number = 1729 | divisor = 1, 7, 13, 19, 91, 133, 247, 1729 | unicode = | greek prefix = | latin prefix = |factorization= }} '''1729''' is the [[natural number]] following [[1728 (number)|1728]] and preceding 1730. It is a [[taxicab number]], and is variously known as the Ramanujan's number and the Hardy–Ramanujan number, after an anecdote of the British mathematician [[G. H. Hardy]] when he visited Indian mathematician [[Srinivasa Ramanujan]] in hospital. He related their conversation:[http://www-gap.dcs.st-and.ac.uk/~history/Quotations/Hardy.html Quotations by Hardy] {{webarchive|url=https://web.archive.org/web/20120716185939/http://www-gap.dcs.st-and.ac.uk/~history/Quotations/Hardy.html |date=2012-07-16 }}{{cite news|url=https://www.bbc.co.uk/news/magazine-24459279|title=Why is the number 1,729 hidden in Futurama episodes?|work=BBC News Online|first=Simon|last=Singh|authorlink=Simon Singh|date=15 October 2013|accessdate=15 October 2013}}{{cite book |title=Ramanujan |url=https://archive.org/details/pli.kerala.rare.37877 |last=Hardy |first=G H |location=New York |publisher=Cambridge University Press (original) |year=1940 |page=[https://archive.org/details/pli.kerala.rare.37877/page/n17 12]}}{{citation|first=G. H.|last=Hardy |title=Srinivasa Ramanujan |journal=Proc. London Math. Soc. |year=1921|volume= s2-19 |issue=1|pages=xl–lviii|doi=10.1112/plms/s2-19.1.1-u|url=https://zenodo.org/record/1447788 }} The anecdote about 1729 occurs on pages lvii and lviii {{quote|I remember once going to see him when he was ill at Putney. I had ridden in taxi cab number 1729 and remarked that the number seemed to me rather a dull one, and that I hoped it was not an unfavourable omen. "No," he replied, "it is a very interesting number; it is the smallest number expressible as the sum of two cubes in two different ways."}}

The two different ways are:

: 1729 = 13 + 123 = 93 + 103

The quotation is sometimes expressed using the term "positive cubes", since allowing negative perfect cubes (the cube of a [[negative number|negative]] [[integer]]) gives the smallest solution as [[91 (number)|91]] (which is a [[divisor]] of 1729):

:91 = 63 + (−5)3 = 43 + 33

Numbers that are the smallest number that can be expressed as the sum of two cubes in ''n'' distinct ways{{cite book |title=Number Story: From Counting to Cryptography |last=Higgins |first=Peter |year=2008 |publisher=Copernicus |location=New York |isbn=978-1-84800-000-1 |page=13 }} have been dubbed "[[taxicab number]]s". The number was also found in one of Ramanujan's notebooks dated years before the incident, and was noted by [[Frénicle de Bessy]] in 1657. A commemorative plaque now appears at the site of the Hardy–Ramanujan incident, at 2 Colinette Road in [[Putney]].{{cite web |last1=Marshall |first1=Michael |title=A black plaque for Ramanujan, Hardy and 1,729 |url=https://goodthinkingsociety.org/a-black-plaque-for-ramanujan-hardy-and-1729/ |website=Good Thinking |accessdate=7 March 2019}}

The same expression defines 1729 as the first in the sequence of "Fermat near misses" {{OEIS|id=A050794}} defined, in reference to [[Fermat's Last Theorem]], as numbers of the form 1 + ''z''3 which are also expressible as the sum of two other cubes.

==Other properties== 1729 is also the third [[Carmichael number]], the first Chernick–Carmichael number {{OEIS|A033502}}, and the first absolute [[Euler pseudoprime]]. It is also a [[sphenic number]].

1729 is a [[Zeisel number]].{{Cite OEIS|1=A051015|2=Zeisel numbers|accessdate=2016-06-02}} It is a [[centered cube number]],{{Cite OEIS|1=A005898|2=Centered cube numbers|accessdate=2016-06-02}} as well as a [[dodecagonal number]],{{Cite OEIS|1=A051624|2=12-gonal (or dodecagonal) numbers|accessdate=2016-06-02}} a 24-[[polygonal number|gonal]]{{Cite OEIS|1=A051876|2=24-gonal numbers|accessdate=2016-06-02}} and 84-gonal number.

Investigating pairs of distinct integer-valued [[quadratic form]]s that represent every integer the same number of times, Schiemann found that such quadratic forms must be in four or more variables, and the least possible [[discriminant]] of a four-variable pair is 1729 {{Harv|Guy|2004}}.

Because in base 10 the number 1729 is divisible by the sum of its digits, it is a [[Harshad number]]. It also has this property in [[octal]] (1729 = 33018, 3 + 3 + 0 + 1 = 7) and [[hexadecimal]] (1729 = 6C116, 6 + C + 1 = 1910), but not in [[binary numeral system|binary]] and [[duodecimal]].

In [[duodecimal|base 12]], 1729 is written as [[1001 (number)|1001]], so its reciprocal has only [[period length|period]] 6 in that base.

1729 is the lowest number which can be represented by a [[Loeschian number|Loeschian]] quadratic form ''a² + ab + b²'' in four different ways with ''a'' and ''b'' positive integers. The integer pairs (''a'',''b'') are (25,23), (32,15), (37,8) and (40,3).{{cite web|url=https://latticelabyrinths.wordpress.com/2017/02/25/tessellating-the-hardy-ramanujan-taxicab-number-1729-bedrock-of-integer-sequence-a198775/|title=Tessellating the Hardy-Ramanujan Taxicab Number, 1729, Bedrock of Integer Sequence A198775|access-date=19 July 2018|date=25 February 2017|author=David Mitchell}}

1729 has another mildly interesting property: the 1729th digit is the beginning of the first consecutive occurrence of all ten digits without repetition in the decimal representation of the [[transcendental number]] [[e (mathematical constant)|''e'']].[http://www.mathpages.com/home/kmath028/kmath028.htm The Dullness of 1729]

[[Masahiko Fujiwara]] showed that 1729 is one of four positive integers (with the others being [[81 (number)|81]], [[1458 (number)|1458]], and the trivial case [[1 (number)|1]]) which, when its digits are added together, produces a sum which, when multiplied by its reversal, yields the original number:

: 1 + 7 + 2 + 9 = 19 : 19 × 91 = 1729

It suffices only to check sums congruent to 0 or 1 (mod 9) up to 19.

==See also==

  • ''[[A Disappearing Number]]'', a 2007 play about Ramanujan in England during World War I.
  • [[Berry paradox]]
  • [[Interesting number paradox]]
  • [[Taxicab number]]
  • [[4104 (number)|4104]], the second positive integer which can be expressed as the sum of two positive cubes in two different ways.

==References== {{Citation|last=Gardner|first=Martin|author-link=Martin Gardner|year=1973|title=Mathematical Puzzles and Diversions|publisher=Pelican / Penguin Books|edition=Paperback|isbn=0-14-020713-9}} {{Citation|last=Guy|first=Richard K.|author-link=Richard K. Guy|year=2004|title=Unsolved Problems in Number Theory|publisher=Springer|edition=3rd|series=Problem Books in Mathematics, Volume 1|isbn=0-387-20860-7|url=https://www.springer.com/mathematics/numbers/book/978-0-387-20860-2}} - D1 mentions the Hardy–Ramanujan number.

==Notes== {{reflist}}

==External links==

[[Category:Integers]] [[Category:Srinivasa Ramanujan]]

What wtf renders:

<title>1729 (number)</title>
<table class="infobox">
  <thead>
  </thead>
  <tbody>
    <tr>
      <td>Number</td>
      <td><span class="sentence">1729</span></td>
    </tr>
    <tr>
      <td>Divisor</td>
      <td><span class="sentence">1, 7, 13, 19, 91, 133, 247, 1729</span></td>
    </tr>
  </tbody>
</table>
<div class="section">
  <div class="text">
    <p class="paragraph">
      <span class="sentence"><b>1729</b> is the <a class="link" href="./natural_number">natural number</a> following <a class="link" href="./1728_(number)">1728</a> and preceding 1730.</span> <span class="sentence">It is a <a class="link" href="./taxicab_number">taxicab number</a>, and is variously known as the Ramanujan's number and the Hardy–Ramanujan number, after an anecdote of the British mathematician <a class="link" href="./G._H._Hardy">G. H. Hardy</a> when he visited Indian mathematician <a class="link" href="./Srinivasa_Ramanujan">Srinivasa Ramanujan</a> in hospital.</span> <span class="sentence">He related their conversation:</span> <span class="sentence">"I remember once going to see him when he was ill at Putney. I had ridden in taxi cab number 1729 and remarked that the number seemed to me rather a dull one, and that I hoped it was not an unfavourable omen. "No," he replied, "it is a very interesting number; it is the smallest number expressible as the sum of two cubes in two different ways.""</span>
    </p>
    <p class="paragraph">
      <span class="sentence">The two different ways are:</span>
    </p>
    <p class="paragraph">

    </p>
    <p class="paragraph">
      <span class="sentence">The quotation is sometimes expressed using the term "positive cubes", since allowing <a class="link" href="./negative_number">negative</a> perfect cubes (the cube of a negative <a class="link" href="./integer">integer</a>) gives the smallest solution as <a class="link" href="./91_(number)">91</a> (which is a <a class="link" href="./divisor">divisor</a> of 1729):</span>
    </p>
    <p class="paragraph">

    </p>
    <p class="paragraph">
      <span class="sentence">Numbers that are the smallest number that can be expressed as the sum of two cubes in <i>n</i> distinct ways have been dubbed "<a class="link" href="./taxicab_number">taxicab numbers</a>".</span> <span class="sentence">The number was also found in one of Ramanujan's notebooks dated years before the incident, and was noted by <a class="link" href="./Frénicle_de_Bessy">Frénicle de Bessy</a> in 1657.</span> <span class="sentence">A commemorative plaque now appears at the site of the Hardy–Ramanujan incident, at 2 Colinette Road in <a class="link" href="./Putney">Putney</a>.</span>
    </p>
    <p class="paragraph">
      <span class="sentence">The same expression defines 1729 as the first in the sequence of "Fermat near misses" defined, in reference to <a class="link" href="./Fermat's_Last_Theorem">Fermat's Last Theorem</a>, as numbers of the form 1 + <i>z</i> 3 which are also expressible as the sum of two other cubes.</span>
    </p>
  </div>
</div>

<div class="section">
  <h1>Other properties</h1>
  <ul class="list">
    <li><span class="sentence">1 + 7 + 2 + 9 = 19</span></li>
    <li><span class="sentence">19 × 91 = 1729</span></li>
  </ul>
  <div class="text">
    <p class="paragraph">
      <span class="sentence">1729 is also the third <a class="link" href="./Carmichael_number">Carmichael number</a>, the first Chernick–Carmichael number, and the first absolute <a class="link" href="./Euler_pseudoprime">Euler pseudoprime</a>.</span> <span class="sentence">It is also a <a class="link" href="./sphenic_number">sphenic number</a>.</span>
    </p>
    <p class="paragraph">
      <span class="sentence">1729 is a <a class="link" href="./Zeisel_number">Zeisel number</a>.</span> <span class="sentence">It is a <a class="link" href="./centered_cube_number">centered cube number</a>, as well as a <a class="link" href="./dodecagonal_number">dodecagonal number</a>, a 24-<a class="link" href="./polygonal_number">gonal</a> and 84-gonal number.</span>
    </p>
    <p class="paragraph">
      <span class="sentence">Investigating pairs of distinct integer-valued <a class="link" href="./quadratic_form">quadratic forms</a> that represent every integer the same number of times, Schiemann found that such quadratic forms must be in four or more variables, and the least possible <a class="link" href="./discriminant">discriminant</a> of a four-variable pair is 1729.</span>
    </p>
    <p class="paragraph">
      <span class="sentence">Because in base 10 the number 1729 is divisible by the sum of its digits, it is a <a class="link" href="./Harshad_number">Harshad number</a>.</span> <span class="sentence">It also has this property in <a class="link" href="./octal">octal</a> (1729 = 3301 8, 3 + 3 + 0 + 1 = 7) and <a class="link" href="./hexadecimal">hexadecimal</a> (1729 = 6C1 16 , 6 + C + 1 = 19 10 ), but not in <a class="link" href="./binary_numeral_system">binary</a> and <a class="link" href="./duodecimal">duodecimal</a>.</span>
    </p>
    <p class="paragraph">
      <span class="sentence">In <a class="link" href="./duodecimal">base 12</a>, 1729 is written as <a class="link" href="./1001_(number)">1001</a>, so its reciprocal has only <a class="link" href="./period_length">period</a> 6 in that base.</span>
    </p>
    <p class="paragraph">
      <span class="sentence">1729 is the lowest number which can be represented by <i>a</i> <a class="link" href="./Loeschian_number">Loeschian</a> quadratic form a² + ab + <i>b</i>² in four different ways with a and b positive integers.</span> <span class="sentence">The integer pairs (<i>a</i>,<i>b</i>) are (25,23), (32,15), (37,8) and (40,3).</span>
    </p>
    <p class="paragraph">
      <span class="sentence">1729 has another mildly interesting property: the 1729th digit is the beginning of the first consecutive occurrence of all ten digits without repetition in the decimal representation of the <a class="link" href="./transcendental_number">transcendental number</a> <i>e</i>.</span>
    </p>
    <p class="paragraph">
      <span class="sentence"><a class="link" href="./Masahiko_Fujiwara">Masahiko Fujiwara</a> showed that 1729 is one of four positive integers (with the others being <a class="link" href="./81_(number)">81</a>, <a class="link" href="./1458_(number)">1458</a>, and the trivial case <a class="link" href="./1_(number)">1</a>) which, when its digits are added together, produces a sum which, when multiplied by its reversal, yields the original number:</span>
    </p>
    <p class="paragraph">

    </p>
    <p class="paragraph">
      <span class="sentence">It suffices only to check sums congruent to 0 or 1 (mod 9) up to 19.</span>
    </p>
  </div>
</div>

<div class="section">
  <h1>See also</h1>
  <ul class="list">
    <li><span class="sentence"><a class="link" href="./A_Disappearing_Number"><i>A Disappearing Number</i></a>, a 2007 play about Ramanujan in England during World War I.</span></li>
    <li><span class="sentence"><a class="link" href="./Berry_paradox">Berry paradox</a></span></li>
    <li><span class="sentence"><a class="link" href="./Interesting_number_paradox">Interesting number paradox</a></span></li>
    <li><span class="sentence"><a class="link" href="./Taxicab_number">Taxicab number</a></span></li>
    <li><span class="sentence"><a class="link" href="./4104_(number)">4104</a>, the second positive integer which can be expressed as the sum of two positive cubes in two different ways.</span></li>
  </ul>
  <div class="text">
    <p class="paragraph">

    </p>
  </div>
</div>

<div class="section">
  <h1>References</h1>
  <ul class="list">
    <li><span class="sentence">- D1 mentions the Hardy–Ramanujan number.</span></li>
  </ul>
  <div class="text">
    <p class="paragraph">
      <span class="sentence">* - D1 mentions the Hardy–Ramanujan number.</span>
    </p>
  </div>
</div>

<div class="section">
  <h1>Notes</h1>
</div>

<div class="section">
  <h1>External links</h1>
  <ul class="list">
    <li><span class="sentence"><a class="link" href="http://mathworld.wolfram.com/Hardy-RamanujanNumber.html">MathWorld: Hardy–Ramanujan Number</a></span></li>
    <li><span class="sentence"><a class="link" href="http://www.bbc.co.uk/radio4/science/further5.shtml?rhppromo">BBC: A Further Five Numbers</a></span></li>
    <li><span class="sentence">Why does the number 1729 show up in so many Futurama episodes?, io9.com</span></li>
  </ul>
  <div class="text">
    <p class="paragraph">
      <span class="sentence">* Why does the number 1729 show up in so many Futurama episodes?, io9.com</span>
    </p>
  </div>
</div>

The first two lists are completely missing:

1729 = 13 + 123 = 93 + 103

and
91 = 63 + (−5)3 = 43 + 33

I suspect this issue is due to some lists not being contained in a section (as I mentioned earlier). And the other list is placed at the very top of the "Other properties" section, which is incorrect. An example of incorrect indentation can be seen in this [article](https://en.wikipedia.org/wiki/List_of_nerves_of_the_human_body). The number of "*" or ":" should be counted and used for the indentation depth. These two "list" issues are pretty serious IMHO, as they mess up the structure of the original text. Lets discuss the possible solutions and see how we can fix this. Thanks Spencer!
spencermountain commented 4 years ago

can you simplify this issue please? yeah, if the list is missing, that's a new issue.