Don't use minus sign in text block in math mode

Aperta
#168 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
julia, latex

Direzione di ricerca

Inizia dal punto di ingresso generate_tex_elements e riproduci i tre esempi Julia per L"A_\text{1-2}" usando le varianti Unicode fornite. Segui la conversione del trattino all’interno di \text{} in un TeXChar, quindi verifica che il trattino ordinario venga visualizzato come un trattino breve, mentre il comportamento esistente del segno meno rimanga corretto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When writing text in math mode using \text{}, the usual - symbol gets rendered as a minus instead of a short hyphen. Possibly related to https://github.com/Kolaru/MathTeXEngine.jl/issues/128 as it defines the exception for not using the minus symbol outside $...$ delimiters, but even when in math mode usual LaTeX renders hyphens correctly when typesetting math using the 2 envs above.

Short way of reproducing it is to directly insert the hyphen unicode, which also serves as a workaround:

# normal way of writing using the - symbol
julia> generate_tex_elements(L"A_\text{1-2}")
4-element Vector{Any}:
 (TeXChar 'A' [index 34 in NewComputerModern - 10 Italic], [0.0, 0.0], 1.0)
 (TeXChar '1' [index 18 in NewComputerModern Math - Regular], [0.7429999709129333, -0.20000000298023224], 0.6)
 (TeXChar '−' [index 853 in NewComputerModern Math - Regular], [1.0909999698400499, -0.20000000298023224], 0.6)
 (TeXChar '2' [index 19 in NewComputerModern Math - Regular], [1.605799949169159, -0.20000000298023224], 0.6)

# using minus unicode symbol
julia> generate_tex_elements(L"$A_\text{1−2}$")
4-element Vector{Any}:
 (TeXChar 'A' [index 34 in NewComputerModern - 10 Italic], [0.0, 0.0], 1.0)
 (TeXChar '1' [index 18 in NewComputerModern Math - Regular], [0.7429999709129333, -0.20000000298023224], 0.6)
 (TeXChar '−' [index 853 in NewComputerModern Math - Regular], [1.0909999698400499, -0.20000000298023224], 0.6)
 (TeXChar '2' [index 19 in NewComputerModern Math - Regular], [1.605799949169159, -0.20000000298023224], 0.6)

# using the hyphen unicode symbol
julia> generate_tex_elements(L"$A_\text{1‐2}$")
4-element Vector{Any}:
 (TeXChar 'A' [index 34 in NewComputerModern - 10 Italic], [0.0, 0.0], 1.0)
 (TeXChar '1' [index 18 in NewComputerModern Math - Regular], [0.7429999709129333, -0.20000000298023224], 0.6)
 (TeXChar '‐' [index 535 in NewComputerModern Math - Regular], [1.0429999709129334, -0.20000000298023224], 0.6)
 (TeXChar '2' [index 19 in NewComputerModern Math - Regular], [1.242799973487854, -0.20000000298023224], 0.6)
Lingua principale
Julia
Stelle
106
Fork
25
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Kolaru/MathTeXEngine.jl

Tutte le issue di Kolaru/MathTeXEngine.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.