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}

suarez
  • 182
  • 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

2 Answers2

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.

David Carlisle
  • 757,742
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.

daleif
  • 54,450
Gaussler
  • 12,801
  • 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. – David Carlisle 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:-) – David Carlisle Oct 11 '21 at 19:04
  • @DavidCarlisle The question is whether or not it is a spam user. There are signs of that. Why ask such a simple question with a very simple MWE where all you have to do is remove a few lines? It almost feels as if the user knows the problem already. – Gaussler Oct 11 '21 at 19:10
  • @Gaussler the code derives from an answer of egregs which was based on mnsymbol, having removed that package the numbers are all wrong (and the code is pointless as there is nothing to revert if you don't load the package that you were reverting) so it seems confused rather than spam. – David Carlisle Oct 11 '21 at 19:14