# LaTeX and Mathematica

3 min readJun 16, 2023

Gene Surdutovich and I are hard at work on the 6th edition of Intermediate Physics for Medicine and Biology. So far, the main thrust of our work involves LaTeX and Mathematica.

Russ Hobbie and I wrote the 5th edition of IPMB using LaTeX, a computer program that is particularly useful for typesetting equations. Russ was our LaTeX guru. I merely read pdf documents that he created and sent him my suggested changes, and then he implemented those changes into the book. With Russ gone, I can no longer escape dealing with LaTeX commands. LaTeX is an extremely powerful piece of software, but mastering it requires a long learning curve. Fortunately, Gene has extensive experience with it.

Let me give you a little peek behind the curtain at typesetting an equation with LaTeX. Equation 4.74 in the 5th edition is the definition of the error function,

In LaTeX it looks like this:

\operatorname{erf}(z)=\frac{2}{\sqrt{\uppi}}\int_{0}^{z}e^{-t^{2}}dt.
\label{4.74}%

Kind of complicated, isn’t it? Sometimes I find myself getting LaTeX and html mixed up.

LaTeX numbers the equations automatically. They each get a label, such as “\label{4.74}” but this label does not specify the equation number, it’s just a pointer. If I want to refer to this equation later I can write “see Eq.~\ref{4.74}”. If I decide I want to add an equation before Eq. 4.74, I can just give it any label I want-say, “\label{4.73b}”- and then LaTeX will renumber all the equations properly. For a book like IPMB, which has hundreds of equations, this automatic numbering is wonderful.

The index is also created automatically. Whenever I use a term such as “error function” that I want included in the index, I add “\index{Error function}”. LaTeX will keep track of the page number where that code is placed and then include that term with the correct page number in the index. This same sort of internal labeling can be used to create the list of symbols at the end of each chapter, the list of homework problems, and the section and subsection numbering. In fact, I didn’t have to renumber anything when I added an entire new chapter about… more on that later. LaTeX is amazing. How did I write my PhD dissertation without it?

Also, LaTeX can number and label figures and illustrations, but you have to create the figures using another program. We’ve started using Mathematica for that job. (I’m ashamed to say, I’m not sure what software Russ used.) Mathematica, produced by Wolfram Research, is very powerful, and can do all sorts of symbolic computations. We don’t take advantage of those features, but mainly use the program to make beautiful plots. Fortunately, Gene is even better at Mathematica than at LaTeX, and he helps me a lot. IPMB’s publisher, Springer, says we can use as much color as we want for the 6th edition. Think of the 5th edition of IPMB as like when Dorothy is in Kansas. Publication of the 6th edition will correspond to that memorable scene when she opens the door of the farmhouse and finds herself in the colorful Land of Oz.

Preparing the 6th edition is going to be a long-term project, so don’t expect it anytime soon. Maybe it’ll be ready by the end of 2024, but maybe not. Thanks to all of you who responded to our recent survey. If you have further suggestions, there is still lots of time and we would appreciate hearing any ideas.

And now, back to work!

Originally published at http://hobbieroth.blogspot.com.

--

--

Professor of Physics at Oakland University and coauthor of the textbook Intermediate Physics for Medicine and Biology.