Punctuation absorbed into mathematics is spaced as an ordinary symbol; \mathpunct would fix it
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 74/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- latex
- Área
- documentation
Línea de trabajo
El cambio está en la plantilla del modo get-clause-punctuation en xsl/pretext-common.xsl, donde la puntuación se envuelve como \text{...}. Cambia el envoltorio a \mathpunct{\text{...}} y comprueba que la salida del modo no cambie cuando $punctuation está vacío. Está terminado cuando el ejemplo del issue se renderiza en MathJax sin espacio antes de la coma o el punto y sin errores de MathJax.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- XSLT
- Estrellas
- 466
- Forks
- 251
- Merge medio
- 4 min
- PR fusionados (30 d)
- 13
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PreTeXtBook/pretext
-
The print preview leaves writing space short by the margins of hidden headers, footers and solutionsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PreTeXtBook/pretext#3329 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
PreTeXtBook/pretext#3305 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PreTeXtBook/pretext#3297 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
PreTeXtBook/pretext#3285 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PreTeXtBook/pretext#3283 ·
Los mantenedores suelen responder en 1 día
Todos los issues de PreTeXtBook/pretext
Issues similares
-
marketing
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
agent:WSL code-review documentation performance pri:medium tooling
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Feyisara2108/stellargive#1370 ·
Los mantenedores suelen responder en 1 día
-
Contribute example skillsAbiertodocumentation enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
documentation tool triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
can1357/oh-my-pi#19608 · 2 comentarios ·
Los mantenedores suelen responder en 1 día