0

Why are the parentheses not showing? (I don't want to remove packages,how can i fix this problem?)

enter image description here

\documentclass[a4paper]{article}
\usepackage{physics}

\makeatletter
\DeclareSymbolFont{cmexlargesymbols}{OMX}{cmex}{m}{n}
\SetSymbolFont{cmexlargesymbols}{bold}{OMX}{cmex}{b}{n}
\DeclareMathDelimiter{(}{\mathopen}{letters}{46}{cmexlargesymbols}{0}
\DeclareMathDelimiter{)}{\mathclose}{letters}{47}{cmexlargesymbols}{1}
\makeatother


\begin{document}

\[e^{\qty(x)}\]

\end{document}
3
  • 3
    But the whole problem is that physics is a shitty package. Asking us to fix it without removing that package is like asking us to make water stop being wet.
    – Gaussler
    Oct 11 '21 at 13:16
  • The problem persists even if I uninstall the physics package @Gaussler
    – suarez
    Oct 11 '21 at 13:18
  • 2
    @suarez - What do you mean by "uninstall the physics package"? The physics package provides the macro called \qty. If you don't load the physics package, how is your sample code shown above supposed to compile?
    – Mico
    Oct 11 '21 at 13:48
7

You specified the () come from the font in positions 46 and 47 but if you look at the latex sources you will see they are the wrong numbers you get

enter image description here

from

\DeclareMathDelimiter{(}{\mathopen}{letters}{"28}{cmexlargesymbols}{0}
\DeclareMathDelimiter{)}{\mathclose}{letters}{"29}{cmexlargesymbols}{1}

or simpler, by deleting the entire block of code

makeatletter
\DeclareSymbolFont{cmexlargesymbols}{OMX}{cmex}{m}{n}
\SetSymbolFont{cmexlargesymbols}{bold}{OMX}{cmex}{b}{n}
\DeclareMathDelimiter{(}{\mathopen}{letters}{"28}{cmexlargesymbols}{0}
\DeclareMathDelimiter{)}{\mathclose}{letters}{"29}{cmexlargesymbols}{1}
\makeatother

You don't give any indication what you intended this to do, deleting it gives the presumably intended output.

3

Here is the general answer to all your questions. Normally this would probably be deleted, but I ask my fellow TeX.SE users to bear with me in this particular case.

  • Don't use nonstandard packages like physics (or my own package, semantex, for that matter) unless you know what they are and what they do. They change fundamental things about the way we type LaTeX. If this is not what your want, simply use LaTeX the standard way without trying to change it too much. That way, most things will look nice by default.

  • If you think that mathematical symbols such as the equality signs and parentheses do not have rounded enough corners, find a different font.

  • If you load mathastext, note that this is about making the math font resemble the text font. Conversely, if you don't want the math font to resemble the text font, don't load mathastext.

  • Read what packages do before you load them. In general, start from a clean document that only loads amsmathand add stuff when you need it.

  • Re-read the answers to your previous questions before asking an identical one.

7
  • 1
    Good answer. I fixed a spelling error in the last word
    – daleif
    Oct 11 '21 at 17:39
  • 1
    @daleif Thanks. I was swiping on my phone keyboard.
    – Gaussler
    Oct 11 '21 at 17:40
  • while this is all good general advice it might not be the best question to post it to as the problem here is unrelated to any package, it's just declarations in the docuement redefining () to produce triangles. You can remove all the usepackage and still have the same broken parentheses. Oct 11 '21 at 18:05
  • @DavidCarlisle I was referring generally to suarez’ questions (who I think is the same user as cufcuf. Compare this to this).
    – Gaussler
    Oct 11 '21 at 18:43
  • @Gaussler I know:-) Oct 11 '21 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.