Inline math: $…$ vs. (…)

l2tabu, a text informing about obsolete packages and commands, recommends to replace $$…$$ by [...], but it doesn’t say a word about the difference between $…$ and (…). “Mathmode” by H. Voss does tell something, but it says in v2.40: “In general $…$ is the best choice”. I doubt it, and when I mentioned here some thoughts about that, the author noticed it without much comment. Because of a question on Matheboard today I’ve listed some reasons why I’m preferring the (…) environment:

  • With (…) you can easily distinguish opening and closing of the math mode, in contrary to $…$, mistakes in code could be harder to find with $.
  • LaTeX does additional error checks in (…), whereas $…$ is plain TeX and is used internally by (…).
  • (…) is working inside alltt-environments, $…$ is causing errors.
  • Both ( and ) could be redefined or extended easily.
  • Though ( and ) are not robust, possibly causing problems in sectioning for instance, that could be fixed by just loading the fixltx2e package.

In general I recommend to use LaTeX macros instead of corresponding plain TeX commands.

03. April 2009 by stefan
Categories: Mathematics | Leave a comment

Leave a Reply

Required fields are marked *