Punctuation absorbed into mathematics is spaced as an ordinary symbol; \mathpunct would fix it
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 74/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- latex
- Ambito
- documentation
Direzione di ricerca
La modifica riguarda il template per la modalità get-clause-punctuation in xsl/pretext-common.xsl, dove la punteggiatura è racchiusa in \text{...}. Cambia il wrapper in \mathpunct{\text{...}} e verifica che l'output della modalità resti invariato quando $punctuation è vuoto. È completato quando l'esempio della issue viene visualizzato in MathJax senza spazio prima della virgola o del punto e senza errori di MathJax.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Punctuation absorbed into mathematics is spaced as an ordinary symbol
Summary
When PreTeXt moves clause-ending punctuation into mathematics, it wraps the mark as \text{,}. TeX, and MathJax following TeX's spacing rules, treats \text{...} as an ordinary symbol, so the space between the last item of the mathematics and the punctuation is whatever TeX puts before an ordinary symbol. After an operator name, or after a relation, that is a visible space. For example,
<p>... on its restriction to the Brunnian group <m>\operatorname{Brun}_4</m>, then it is faithful ...</p>
becomes \operatorname{Brun}_4\text{,} and renders in HTML as "Brun₄ , then", with a gap before the comma. Likewise <m>a \le</m>. renders with a gap before the period.
Proposed change
Mark the punctuation as punctuation: \mathpunct{\text{,}}. TeX puts no space between an operator, a relation, or an ordinary symbol and a following punctuation atom. The space TeX adds after punctuation does not arise, since the mark ends the mathematics.
The wrapping is written by the template in mode get-clause-punctuation in xsl/pretext-common.xsl:
<xsl:if test="not($punctuation = '')">
<xsl:text>\text{</xsl:text>
<xsl:value-of select="$punctuation" />
<xsl:text>}</xsl:text>
</xsl:if>
The change would be \mathpunct{\text{ and }}.
Checked
Rendered in a browser with MathJax 3.2.2 and MathJax 4.1.3 (the CDN builds), each with CHTML and with SVG output, the current form against the proposed form:
| last item of the mathematics | \text{,} |
\mathpunct{\text{,}} |
|---|---|---|
operator: \operatorname{Brun}_4 |
space before the comma | no space |
relation: a \le |
space before the period | no space |
ordinary: x |
no space | no space (unchanged) |
None of the four configurations reported an error. In 4.1.3, the version under script/mjsre, \mathpunct is in the base TeX package (BaseMappings, a TeXAtom of class PUNCT).
Not checked: LaTeX itself (\mathpunct is a TeX primitive, and the LaTeX conversion absorbs punctuation into display mathematics, so displays would get the new wrapping), and the change inside PreTeXt. Observed at 352a11ea.
- Lingua principale
- XSLT
- Stelle
- 466
- Fork
- 251
- Merge medio
- 4m
- PR unite (30g)
- 13
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PreTeXtBook/pretext
-
The print preview leaves writing space short by the margins of hidden headers, footers and solutionsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PreTeXtBook/pretext#3329 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
PreTeXtBook/pretext#3305 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PreTeXtBook/pretext#3297 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
PreTeXtBook/pretext#3285 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PreTeXtBook/pretext#3283 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PreTeXtBook/pretext
Issue simili
-
Feature Request
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
spotDL/spotify-downloader#2839 ·
I maintainer di solito rispondono entro 1 giorno
-
Missing license fileAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 83/100
gofish-graphics/gofish-graphics#1384 ·
I maintainer di solito rispondono entro 1 giorno
-
seed-request
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
camp-registry/camp-index#777 ·
I maintainer di solito rispondono entro 1 giorno
-
Add Text to History PageApertaPROJECT: website-redesign volunteers
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
thewca/worldcubeassociation.org#16616 ·
I maintainer di solito rispondono entro 1 giorno