Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

siunitx new macros are not recognized #282

Closed
joe6302413 opened this issue May 4, 2023 · 4 comments
Closed

siunitx new macros are not recognized #282

joe6302413 opened this issue May 4, 2023 · 4 comments

Comments

@joe6302413
Copy link
Contributor

joe6302413 commented May 4, 2023

Following the update of siunitx v3, new macros, such as \qty, \qtyrange and \qtylist, are introduced to replace the old macros starting with \SI. The current package does not recognize the new macros and provide \mbox protection.

The issue can be worked around by using --append-mboxsafecmd='qty,qtyrange,num,qtylist,qtyproduct...etc', but it would be easier to update the package behavior with siunitx since it is one of the most used package.

@joe6302413 joe6302413 changed the title siunitx new commands not recognized siunitx new macros are not recognized May 4, 2023
@ftilmann
Copy link
Owner

ftilmann commented May 4, 2023

Thanks for letting me know. I guess for many years latexdiff will have to support old and new syntaxes. As I am not an active user of siunitx, would you be able to provide the list of commands, patterns, which would need to be protected. You started making this list but the "..etc" suggest there are more. If you had a short test document with the new SIunitx commands would be great (my installation of texlive still has the old siunitx).

@joe6302413
Copy link
Contributor Author

Sorry for mispress the closing button, but hope my reply will make it closer to close.

I have tested all the combinations (not good at perl nor latex). It seems the current stable version can take care of some of the siunitx commands (see the "already safe cmd.txt"). I have no clue what makes a command safe or mbox safe, but I presume that a safecmd should not be in mboxsafecmd as they require less treatment. Here I have listed all the commands to my knowledge into safecmd and mbox safecmd (see the files).

My testing tex file is attached as siunitx_test and siunitx_test_old with random changes in the inputs.

Hope these are helpful. Thank you.

siunitx_safecmd.txt
siunitx_mboxsafecmd.txt
already safe cmd.txt

siunitx_test.txt
siunitx_test_old.txt

@ftilmann
Copy link
Owner

Thanks for contributing PR. This solves the issue

@snaunheim
Copy link

Dear @joe6302413 and @ftilmann,
First of all, thanks for solving this issue.

Sadly, I noticed that the solution does not work if the corresponding siunitx-command is using options, e.g.
\num[round-mode=places, round-precision=2, exponent-mode=scientific]{123456789}.

I've modified the testing files to make life easier, but I don't know how to fix this issue. Maybe you have an idea?

siunitx_test.txt
siunitx_test_old.txt

@ftilmann ftilmann reopened this Jul 19, 2023
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

No branches or pull requests

3 participants