0

I am adding puntuctuation to my equations such as

\documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} abc. \end{align} \begin{align} \left(abc\right). \end{align} % Update: Here, the spacing between the parentheses is ok: \begin{align} \left(abc\right)\left(def\right) \end{align} And here, the spacing between the parentheses is ok, but the final spacing before the dot is not \begin{align} \left(abc\right)\left(def\right). \end{align} Intended result is similar to: \begin{align} \left(abc\right)\left(def\right)\!. \end{align} \end{document} 

Clearly, in the generated PDF, the spacing in the two equations above is uneven: There is more space after \right) than simply abc:

abc dot. Next line: (abc) half-space dot.

How can I automatically fix this spacing? I know I could manually insert \! before the dot, but that gets tedious and I might miss some instances. Also, it is not enough to simply redefine \right) to leave out the space because if it appears inside an equation it should be kept. I want to keep this space.

10
  • 1
    See also Is it ever bad to use \left and \right?. Note that the only result of \left/\right in this case is the spacing that you don't want. So a larger question would be if you really need this in the first place, and if so, what is it you are enclosing. You can often get a better result manually sizing the fences. Commented Nov 5, 2024 at 15:12
  • the only affect of left-right here is to add the bad space so just not using it is the best option. Commented Nov 5, 2024 at 15:41
  • 1
    I'm confused about your distinction of "inside an equation". I would say {align*} is an equation, so your example is inside an equation. Could you explain that a bit? Commented Nov 5, 2024 at 15:50
  • 1
    @HerpDerpington Why using \left(abc\right) to begin with? It does nothing else than adding the unwanted space. Commented Nov 5, 2024 at 16:03
  • 1
    So it's not whether the \left/\right is in an equation that matters, it's that you want the space to be there unless it precedes a comma. Regarding everyone saying you shouldn't use \left/\right in this example and you saying you have other macros: could you give us an example where you think \left/\right is necessary? Commented Nov 5, 2024 at 16:16

1 Answer 1

3

You can try with the mleftright package.

\documentclass{article} \usepackage{amsmath,mleftright} \begin{document} \begin{align} abc. \end{align} \begin{align} \left(abc\right). \end{align} \begin{align} \mleft(abc\mright). \end{align} \end{document} 

mleftright

1
  • 1
    Also include ` \bigl(abc\bigr).` Commented Nov 5, 2024 at 15:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.