Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

The command \frac{1}{2}(x+y) yields 1/2(x+1)^-1. Introducing a space before the parenthesis, \frac{1}{2} (x+y), gives the correct result 1/2(x+1).

in Bug reports by (340 points)

1 Answer

+2 votes

That is essentially because I used to write a lot of

1/a/b/c

type of things, and those then at first instance become

\frac{1}{a}{b}{c}

In general, the parser does not know about the meaning of operators, and so it cannot know whether \frac only takes 2 arguments, or more.

by (82.6k points)

That is counter intuitive:

  • a fraction with more than two arguments
  • space sensitive LaTeX parsing
  • round parentheses parsed as argument parentheses I would prefer a separate command for fractions with multiple arguments for your use case.

1/a/b/c = 1/(abc) ?

Parsing is space-sensitive in many places, e.g.

 a (b+c) versus  a(b+c)

and this also shows that arguments have round parenthesis. In general, LaTeX is simply not enough to determine what you really mean, you need to have some additional guidance.

I agree though, in principle, that there may be things that are not optimal. Maybe one day when all urgent issues are off the table I can go back and look at this, but at the moment there are more pressing things to worry about ;-)

...