Skip to content

fix(equation): quote rm, it and bold as identifiers, and read bare braces back - #360

Merged
airmang merged 3 commits into
mainfrom
fix/equation-font-words-and-brace-aliases
Oct 1, 2026
Merged

airmang merged 3 commits into
mainfrom
fix/equation-font-words-and-brace-aliases

Conversation

@airmang

@airmang airmang commented Oct 1, 2026

Copy link
Copy Markdown
Owner

바뀐 점

수식 변환(실험, latex_to_eqedit·eqedit_to_latex)의 남은 틈 셋을 메운다.

  • 글꼴 전환어와 같은 철자의 식별자
    • latex_to_eqedit가 e^{it}, x_{rm}, a_{bold}를 e ^{it}처럼 그대로 썼다.
    • 한/글은 rm·it·bold를 글꼴 전환으로 읽는다. 그래서 첨자에 홀로 오면 아무것도 그리지 않는다(e ^{it}는 e만 남는다).
    • 이제 다른 예약어(T _{"int"})처럼 따옴표로 감싼다(e ^{"it"}). 따옴표 글은 기울임으로 그려져 LaTeX의 글자와 같아 보인다.
    • eqedit_to_latex는 따옴표로 감싼 그 낱말을 다시 글자로 읽는다.
    • 예약어 목록(_RESERVED_WORDS)에 rm·it·bold(대문자 포함)를 더했다.
  • \lbrace·\rbrace
    • \{·\}처럼 LBRACE·RBRACE로 옮긴다. \left·\right 뒤에서도 그렇다.
    • 전에는 지원하지 않는 명령이라며 거부했다.
  • 맨 LBRACE·RBRACE 되읽기
    • eqedit_to_latex가 LEFT·RIGHT 밖의 LBRACE x RBRACE를 \{ x \}로 읽는다. 전에는 낱말 그대로 남았다.
    • latex_to_eqedit가 \{ x \}를 이렇게 쓰므로, 이제 되돌아온다.
  • 수식 상자 설명(measure.py 머리, estimate_equation_size)에 한 줄을 더한다. Windows의 한/글은 저장할 때 상자(hp:sz)와 baseLine을 그대로 두고, 그 상자로 쪽을 배치한다.
  • 변경 로그를 고친다.

테스트

  • tests/test_equation_authoring.py: e^{it}, x_{rm} + a_{bold}, \lbrace x \rbrace, \left\lbrace x \right\rbrace
  • tests/test_equation_converter.py
    • 따옴표로 감싼 "it"·"rm"·"bold"를 글자로 되읽기
    • 맨 LBRACE·RBRACE와 LEFT·RIGHT 안의 것
  • 고치기 전 코드에서는 새 테스트 일곱이 실패한다.

🤖 Generated with Claude Code

airmang and others added 2 commits October 1, 2026 20:52
…aces back

latex_to_eqedit wrote identifiers spelled rm, it or bold as they were (e^{it} as e ^{it}). Hancom reads
those words as font switches, so alone in a script they draw nothing; they are now quoted like the other
reserved words (e ^{"it"}), and eqedit_to_latex reads them back as letters. \lbrace and \rbrace convert
like \{ and \} (also after \left and \right), and eqedit_to_latex reads a bare LBRACE or RBRACE outside
LEFT/RIGHT as \{ or \}. The equation size notes say that Hancom on Windows keeps the stored box and
baseLine when it saves and lays the page out with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds-and-brace-aliases

# Conflicts:
#	CHANGELOG.md
@airmang

airmang commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

main(e64c194e, #340·#342 병합)을 합쳤습니다(e3ee312a). 충돌은 변경 로그뿐이었고, main의 [Unreleased] / ### 고침 목록에 이 PR 항목을 그대로 두었습니다. 코드는 바뀌지 않았고, 수식·쪽 수 추정 테스트와 게이트를 다시 통과했습니다.

@airmang
airmang merged commit edfba7a into main Oct 1, 2026
13 checks passed
@airmang
airmang deleted the fix/equation-font-words-and-brace-aliases branch October 1, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant