Skip to content

Commit

Permalink
Prevent expansion of \text in literal units
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Aug 29, 2023
1 parent 33e99fe commit e108e45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[\#690](https://github.com/josephwright/siunitx/issues/690))
- Parse empty and zero exponents independently (see issue
[\#692](https://github.com/josephwright/siunitx/issues/692))
- Prevent expansion of `\text` in literal units (see issue
[\#691](https://github.com/josephwright/siunitx/issues/691))

## [v3.3.4] - 2023-08-24

Expand Down
1 change: 1 addition & 0 deletions siunitx-unit.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@
{ \token_to_str:N ^ } { ^ }
\tl_replace_all:Nnn \exp_not:N \l_@@_tmp_tl
{ \token_to_str:N _ } { \c_@@_math_subscript_tl }
\cs_set_eq:NN \exp_not:N \text \scan_stop:
\char_set_active_eq:NN ^
\exp_not:N \@@_format_literal_superscript:
\char_set_active_eq:NN _
Expand Down
2 changes: 1 addition & 1 deletion testfiles/siunitx-unit.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ l. ... }
{a}}^{2}\,\mathrm {K}^{-1}_{\mathrm {b}}.
<recently read> }
l. ... }
> \l_tmpa_tl=\mathrm {\protect \text {\protect \ensuremath {a}}}.
> \l_tmpa_tl=\mathrm {\text {\protect \ensuremath {a}}}.
<recently read> }
l. ... }
> \l_tmpa_tl=\mathrm {s{}}.
Expand Down

0 comments on commit e108e45

Please sign in to comment.