5

I would like to have two macros that mimic \left( and \right), but limits the size of the parenthesis to \Bigl( and \Bigr) (allows smaller sizes), respectively. In the below MWE, one needs to extend two \newcommand lines. I am aware that this might be a difficult task, since you need to know the height of the object that you are enclosing.

MWE

\documentclass{article}

\newcommand{\leftc}[1]{ \left#1 }
\newcommand{\rightc}[1]{ \right#1 }

\begin{document}%

\begin{equation}%
\left( a/b \right), ~ \left( \prod_{i = 1}^{100} \right), ~ \Bigl( \prod_{i = 1}^{100} \Bigr)
\end{equation}%

\begin{equation}%
\leftc( a/b \rightc), ~ \leftc( \prod_{i = 1}^{100} \rightc), ~ \Bigl( \prod_{i = 1}^{100} \Bigr)
\end{equation}%

\end{document}%

Output of MWE

Current output

Desired output

Desired output

2
  • usually it's best simply not to use \left and \right which adds unwanted horizontal space and other effects. certainly I'd never use it here: \left( a/b \right) – David Carlisle Jan 4 '16 at 15:07
  • I would normally not use it in \left( a/b \right); this was done purely for demonstrative purposes. I have a different \newcommand, say \E, that uses \left( and \right) but sometimes creates parentheses that I feel are too large. So I would like to simply substitute \leftc( and \rightc) for the \left( and \right) in the definition of \E. – Ritz Jan 4 '16 at 15:16
8

You can play with the parameters as below but it is almost always better to avoid \left \right and to use specific sizes such as \bigl( \bigr) which gives more control and better spacing.

enter image description here

\documentclass{article}

\begin{document}

\begin{equation}
\left( a/b \right), ~ \left( \prod_{i = 1}^{100} \right), ~ \Bigl( \prod_{i = 1}^{100} \Bigr)
\end{equation}


\delimiterfactor=500
\delimitershortfall=20pt
\begin{equation}
\left( a/b \right), ~ \left( \prod_{i = 1}^{100} \right), ~ \Bigl( \prod_{i = 1}^{100} \Bigr)
\end{equation}

\end{document}
4
  • Thank you for the answer. However, this does not really answer the question. I tried to elaborate in my comment on the opening post. – Ritz Jan 4 '16 at 16:06
  • 1
    @Ritz setting \delimitershortfall larger will stop brackets growing too big, which seems to be the main intent of the question (even though the control is not quite as you suggested, that is the control that there is) – David Carlisle Jan 4 '16 at 16:09
  • Okay, I understand. The problem is that in your output, also the \Bigl and \Bigr have changed size, which is an unwanted consequence. – Ritz Jan 4 '16 at 16:33
  • @Ritz hmm you could define \big and friends to locally set them back to their normal values (901 and 5pt) – David Carlisle Jan 5 '16 at 9:46

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.