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

Is there some way to type parenthesis () in \num? #531

Closed
syvshc opened this issue Aug 15, 2021 · 3 comments
Closed

Is there some way to type parenthesis () in \num? #531

syvshc opened this issue Aug 15, 2021 · 3 comments
Assignees
Labels
bug Something isn't working hotfix A change that will be addressed in a hotfix

Comments

@syvshc
Copy link

syvshc commented Aug 15, 2021

Here I have two demands about this question

  1. when negetive number in \numproduct:
\documentclass{article}
\usepackage{siunitx}
\begin{document}
    \numproduct{-4d-2 x (-3)}
\end{document}
  1. when I don't want to give the answer straightly:
\documentclass{article}
\usepackage{siunitx}
\begin{document}
    \num{(40-10)d-3}
\end{document}

They raise the same error:

./main.tex:4: Package siunitx Error: Invalid number `()'.

For immediate help type H <return>.
 ...

l.4     \num{(40-10)d-3}
@josephwright josephwright self-assigned this Aug 15, 2021
@josephwright josephwright added bug Something isn't working hotfix A change that will be addressed in a hotfix labels Aug 15, 2021
@josephwright
Copy link
Owner

The first part can be handled by input-ignore, except it turned out there's a bug there: I'll fix shortly, and you'll be able to use

\documentclass{article}
\usepackage{siunitx}
\begin{document}
    \numproduct[input-ignore = (),input-open-uncertainty=,input-close-uncertainty=]
      {-4d-2 x (-3)}
\end{document}

@josephwright
Copy link
Owner

On the second part, siunitx does not attempt to parse full math mode expressions. Assuming you don't want to treat as an equation, set parse-numbers = false.

@syvshc
Copy link
Author

syvshc commented Aug 16, 2021

On the second part, siunitx does not attempt to parse full math mode expressions. Assuming you don't want to treat as an equation, set parse-numbers = false.

Sorry I didn't describe my demand clearly, the second part I wang to output
image
parse-numbers = false will give
image
It's still not what I want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hotfix A change that will be addressed in a hotfix
Projects
None yet
Development

No branches or pull requests

2 participants