14

The physics package is useful

A lot of my LaTeX documents make heavy use of the physics package. Aside from it overloading several standard commands (e.g. \sin, \abs, etc.), it also makes a few abbreviations very convenient (e.g. \order). It also makes typesetting vector calculus, ordinary/partial/variational derivatives, linear algebra (bra-ket notation and matrices), and other areas much less painful. I think it's safe to say it fills a gap in the market.

The physics package is unpopular

Despite the advantages I've listed from using the package, there are some short comings. It makes use of \xparse which can give several spacing issues (these are usually edge cases but aren't too uncommon), and the syntax can be counter-intuitive. Because of this, whenever I (or others) post a problem that involves the package, a frequent theme is to give physics a wide berth:

(I am sure there are likely more unfavourable reviews of the package out there).

What alternatives are there?

I am curious to know what people think good alternatives are? Off the top of my head:

  • Keep on using physics and hope the macros are improved (unlikely?).
  • Try to re-write the few macros I use most often, but better (I doubt my implementation would be great).
  • There is another equivalent package already which addresses these issues which I haven't found yet.
  • Type it all out in full and abandon all hope of convenient math macros.

While the last option is a bit melodramatic, I think the overarching question of: "Is it preferable to use a supported package which is not ideal/buggy, or should I try and re-invent the wheel?" is one I encounter a fair bit when considering packages. My current ethos is to always use a package/module, and never re-invent the wheel. What would more proficient/experienced users recommend?

  • 7
    You have a very good point. I for myself have decided to write a few macros on my own, and not to use the physics package. Yet I would love to see a package that really does what physics promises to do. – marmot Jan 23 at 17:12
  • 3
    I've never looked at the code or used it, but the documentation left me feeling this was more "a collection of stuff that seemed like a good idea when we wrote it" rather than a coherent solution to a well defined problem. When I have produced "physics-like" documents, I've just defined a few simple macros to save repetition, and never really felt the need for more than that. – alephzero Jan 23 at 17:26
  • 1
    For everybody interested in a (hopefully eventually) viable alternative to physics: You are welcome to contribute to physics replacement effort. Also it was brought to my attention that the diffcoeff package might fill the gap partly. – Skillmon Jan 24 at 8:33
  • 1
    Additionally to the diffcoeff package, there is also the braket package, which provides macros for Dirac bra-ket notation. – Skillmon Jan 24 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.