<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts | Roy Goodman</title><link>https://roygoodman.net/post/</link><atom:link href="https://roygoodman.net/post/index.xml" rel="self" type="application/rss+xml"/><description>Posts</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><image><url>https://roygoodman.net/media/logo.svg</url><title>Posts</title><link>https://roygoodman.net/post/</link></image><item><title>How should we LaTeX?</title><link>https://roygoodman.net/post/how-to-latex/</link><pubDate>Fri, 02 Jul 2021 22:22:55 -0400</pubDate><guid>https://roygoodman.net/post/how-to-latex/</guid><description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Start from
, then read the style guide below.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Last updated October 2026. I first wrote this post in 2021 around the&lt;/em&gt; &lt;strong&gt;physics&lt;/strong&gt; &lt;em&gt;package. That package hasn&amp;rsquo;t been updated since 2012 and has some
, so I now recommend two maintained replacements:&lt;/em&gt; &lt;strong&gt;physics2&lt;/strong&gt; &lt;em&gt;(delimiters, bra–ket notation, matrices) and&lt;/em&gt; &lt;strong&gt;derivative&lt;/strong&gt; &lt;em&gt;(derivatives and differentials).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;\(\LaTeX\) can be intimidating for students who are just learning it, but never fear: this document will help. If we’re going to publish something together, it will eventually have to meet my standards. By following this document, you’ll learn my approach to writing in \(\LaTeX\) and hopefully avoid having to do things twice.&lt;/p&gt;
&lt;p&gt;Some ideas from this document were taken from other documents I found on the web such as
from Stephen Boyd at Stanford,
from Neil Lawrence at Cambridge, and
from Robert Dale at Macquarie. I started writing this thinking it was a guide to help students do things my way, but in the process of getting my thoughts down, I had to look things up. I learned a few things that I will be adopting in my own writing.&lt;/p&gt;
&lt;h2 id="basic-principles"&gt;Basic principles&lt;/h2&gt;
&lt;p&gt;In my mind, there are two basic principles in writing good \(\LaTeX\).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Separate meaning from formatting&lt;/li&gt;
&lt;li&gt;Use packages and class files written by other people.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These two principles are related.&lt;/p&gt;
&lt;h3 id="separating-meaning-from-formatting"&gt;Separating meaning from formatting&lt;/h3&gt;
&lt;p&gt;My limited understanding of the history is that Knuth created \(\TeX\) to enable computers to typeset mathematics and to do so consistently regardless of the computer being used. Lamport then built \(\LaTeX\) on top of Knuth&amp;rsquo;s foundation in order to &lt;em&gt;separate presentation from content.&lt;/em&gt; A primary example is given by the way fractions are represented in the two systems. In \(\TeX\), the fraction \(\frac12\) is written as &lt;code&gt;${1}\over{2}$&lt;/code&gt;. That is a typesetting command: it states that the numeral &amp;ldquo;one&amp;rdquo; is placed &amp;ldquo;over&amp;rdquo; the numeral &amp;ldquo;two.&amp;rdquo; While most plain \(\TeX\) code is still legal in \(\LaTeX\), in the latter system the preferred form is &lt;code&gt;$\frac{1}{2}$&lt;/code&gt; which is easier for a human reader to interpret as a fraction.&lt;/p&gt;
&lt;p&gt;Well-constructed \(\LaTeX\) should be easy to read, and should be focused on representing meaning, not simply formatting.&lt;/p&gt;
&lt;h3 id="macros"&gt;Macros&lt;/h3&gt;
&lt;p&gt;Good \(\LaTeX\) writing should make extensive use of macros. In writing computer programs, whenever there is a piece of code that gets re-used multiple times and accomplishes a specific task, it makes sense to define a function and to call that function each time you need to accomplish that task. In writing \(\LaTeX\), the equivalent idea is to use macros to replace frequently used snippets. There are a number of important reasons for this (how we do so will be discussed later):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Macros help you to encode meaning rather than typesetting instructions. For example the absolute value of \(x\) should appear as &lt;code&gt;$\abs{x}$&lt;/code&gt;, not as &lt;code&gt;$|x|$&lt;/code&gt;. (See below for two good ways to define &lt;code&gt;\abs&lt;/code&gt;.)&lt;/li&gt;
&lt;li&gt;Long strings of typesetting are hard for you to parse and to type exactly the same every time. Suppose you define a complicated mathematical object that you decide to name \({{\mathcal C}^\infty_{\mathrm{c}}}\). Do you want to type &lt;code&gt;{\mathcal C}^\infty_{\mathrm{c}}&lt;/code&gt; every time you use it and have to have that expression repeatedly taking up half a line of your .tex document? Or would you rather define a macro &lt;code&gt;\CIc&lt;/code&gt; that you can use repeatedly?&lt;/li&gt;
&lt;li&gt;Macros make it easier to change the document. Suppose that you decide instead to change your notation to \({{\mathfrak C}^\infty_{\mathrm{c}}}\). If you define a macro, you change it once and the change appears everywhere. Otherwise, you have to carefully comb through your document to find every occurrence of this expression.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In general, if you are trying to typeset a common mathematical function, such as a derivative, norm, or absolute value, &lt;em&gt;you should find a package that contains the macro you need.&lt;/em&gt; If, on the other hand, your paper contains a vector-valued variable named \(\mathbf{p}\), you should define a macro, rather than typing &lt;code&gt;\mathbf{p}&lt;/code&gt; dozens of times.&lt;/p&gt;
&lt;p&gt;I have used four methods to declare macros:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;\newcommand&lt;/code&gt; can take arguments. Examples:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;\newcommand{\p}{\mathbf{p}}&lt;/code&gt; Now you can type &lt;code&gt;$\p$&lt;/code&gt; to get \(\mathbf{p}\).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\newcommand{\CIc}{{\mathcal C}^\infty_{\mathrm{c}}}&lt;/code&gt; for the above example&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\newcommand{\diff}[2]{\frac{d #1}{d #2}}&lt;/code&gt; defines a basic derivative macro. Example: &lt;code&gt;\diff{y}{x}&lt;/code&gt; would give \(\frac{dy}{dx}\). (Better: use &lt;code&gt;\odv&lt;/code&gt; from the &lt;strong&gt;derivative&lt;/strong&gt; package.)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\renewcommand&lt;/code&gt; is just like &lt;code&gt;\newcommand&lt;/code&gt; but you use it if the command you want to assign is already assigned to something else.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\DeclareMathOperator&lt;/code&gt; (requires the &lt;strong&gt;amsmath&lt;/strong&gt; package; note the capitalization). You&amp;rsquo;ll note that functions such as sine and cosine are written in Roman characters and are defined as operators, which affects the spacing between them and their argument. For example the standard way to write \(\sin{\theta}\) is &lt;code&gt;\sin{\theta}&lt;/code&gt;. However there&amp;rsquo;s no hyperbolic secant built in so you could define &lt;code&gt;\DeclareMathOperator{\sech}{sech}&lt;/code&gt;, which you&amp;rsquo;d call using &lt;code&gt;\sech{x}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\DeclarePairedDelimiter&lt;/code&gt; (from &lt;strong&gt;mathtools&lt;/strong&gt;). Here is how my approach to absolute values has evolved:
&lt;ol&gt;
&lt;li&gt;Basic: &lt;code&gt;|x|&lt;/code&gt;. The bars don&amp;rsquo;t grow to fit tall contents such as fractions, and the code says nothing about what the bars &lt;em&gt;mean&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Better: a macro built with &lt;strong&gt;mathtools&lt;/strong&gt;: &lt;code&gt;\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}&lt;/code&gt;. Now &lt;code&gt;\abs{x}&lt;/code&gt; says what you mean, and &lt;code&gt;\abs*{\frac{p(x)}{q(x)}}&lt;/code&gt; (with the star) scales the bars to fit.&lt;/li&gt;
&lt;li&gt;Also good: the &lt;strong&gt;physics2&lt;/strong&gt; package&amp;rsquo;s &lt;code&gt;\ab&lt;/code&gt; command (from its &lt;strong&gt;ab&lt;/strong&gt; module; see below) sizes any pair of delimiters automatically: &lt;code&gt;\ab|\frac{p(x)}{q(x)}|&lt;/code&gt; gives \(\left\lvert \frac{p(x)}{q(x)} \right\rvert\), and &lt;code&gt;\ab*|x|&lt;/code&gt; turns the sizing off. To keep the meaning in your source, wrap it in a macro: &lt;code&gt;\newcommand{\abs}[1]{\ab|#1|}&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;The same tools handle other paired delimiters. For an inner product, either define &lt;code&gt;\DeclarePairedDelimiterX{\innerp}[2]{\langle}{\rangle}{#1,#2}&lt;/code&gt; so that &lt;code&gt;\innerp*{\frac{p}{q}}{f}&lt;/code&gt; gives \(\left\langle \frac{p}{q},f \right\rangle\), or write &lt;code&gt;\ab&amp;lt;\frac{p}{q}, f&amp;gt;&lt;/code&gt; with the &lt;strong&gt;ab&lt;/strong&gt; module of &lt;strong&gt;physics2&lt;/strong&gt;. Bonus tip: use &lt;code&gt;\langle&lt;/code&gt; and &lt;code&gt;\rangle&lt;/code&gt;, not &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt;, for inner products.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="using-packages"&gt;Using packages&lt;/h2&gt;
&lt;p&gt;Here are the packages that are called in my template. In some cases, the order they&amp;rsquo;re called matters, as package B may depend on package A. Each is fully documented, so I&amp;rsquo;ll just say why I like it and the major ways I use it.&lt;/p&gt;
&lt;h3 id="fixing-outdated-things-about"&gt;Fixing outdated things about \(\LaTeX\)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;csquotes&lt;/strong&gt; is a sophisticated package for handling quotes that does lots of things. I use it to do one thing. In order to get nice curly quotation marks like &amp;ldquo;Happy Birthday&amp;rdquo; in \(\LaTeX\) you have to write &lt;code&gt;``Happy Birthday'' &lt;/code&gt; with two single left-hand quotes on the left and two single right-hand quotes on the right. The package allows you to use plain old straight quotes like &lt;code&gt;&amp;quot;Happy Birthday&amp;quot;&lt;/code&gt; and still get curly quotes.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;csquotes&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\MakeOuterQuote&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;&amp;#34;&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Accented characters (inputenc and fontenc).&lt;/strong&gt; When \(\LaTeX\) was written, computers had access to a much smaller character set and could not natively display accented characters like é, ñ, ö, so you had to enter these as &lt;code&gt;\'{e}&lt;/code&gt;, &lt;code&gt;\~{n}&lt;/code&gt;, and &lt;code&gt;\&amp;quot;{o}&lt;/code&gt;. A more modern character-encoding standard is &lt;em&gt;UTF-8&lt;/em&gt;. Since 2018, \(\LaTeX\) reads UTF-8 input by default, so you can type Schrödinger and Poincaré directly; the old &lt;code&gt;\usepackage[utf8]{inputenc}&lt;/code&gt; line is no longer needed (it&amp;rsquo;s harmless if you keep it). Your file does need to be saved as UTF-8: Overleaf does this automatically, and in TeXShop you can set it in the preferences or add the line &lt;code&gt;% !TEX encoding = UTF-8 Unicode&lt;/code&gt; at the top of the main .tex file. Separately, load &lt;strong&gt;fontenc&lt;/strong&gt; so that accented words hyphenate properly and copy correctly from the PDF:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[T1]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;fontenc&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;
&lt;/strong&gt; These are packages from the American Mathematical Society that have lots of features that make writing math easier and better: from their names, you can guess that they introduce (i) general math stuff, (ii) environments for defining theorems, and (iii) additional math symbols. It&amp;rsquo;s worth reading the documentation to learn all the features. When I was writing my dissertation, the postdoc in the next office told me to stop using the &lt;code&gt;eqnarray&lt;/code&gt; environment and to learn about the equation alignment features. He was right. Other important features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use the AMS defined &lt;code&gt;\eqref&lt;/code&gt; command to reference equations rather than the basic &lt;code&gt;\ref&lt;/code&gt;. This puts parentheses around each reference.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\DeclareMathOperator&lt;/code&gt; as described above&lt;/li&gt;
&lt;li&gt;a &lt;code&gt;cases&lt;/code&gt; environment&lt;/li&gt;
&lt;li&gt;the &lt;code&gt;pmatrix&lt;/code&gt; and &lt;code&gt;bmatrix&lt;/code&gt; environments are the standard way to define matrices.&lt;/li&gt;
&lt;li&gt;the &lt;code&gt;\text&lt;/code&gt; command for text in the middle of an equation. To get
\[
a = b \quad \text{and} \quad c=d
\]
write &lt;code&gt;a = b \quad \text{and} \quad c=d&lt;/code&gt;. If you do this often, define a macro such as &lt;code&gt;\newcommand{\qand}{\quad\text{and}\quad}&lt;/code&gt; and write &lt;code&gt;a = b \qand c = d&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;mathtools&lt;/strong&gt; builds on top of the AMS packages. It provides the &lt;code&gt;\DeclarePairedDelimiter&lt;/code&gt; construct I used to build the absolute value and inner product macros. Another useful command: regular \(\LaTeX\) renders &lt;code&gt;:=&lt;/code&gt; with poor vertical alignment. &lt;strong&gt;mathtools&lt;/strong&gt; provides &lt;code&gt;\coloneqq&lt;/code&gt;, which fixes this.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;physics2&lt;/strong&gt; is a modern, maintained replacement for the old &lt;strong&gt;physics&lt;/strong&gt; package. Loading the package by itself gives you almost nothing: each feature lives in a &lt;em&gt;module&lt;/em&gt; that you must enable with &lt;code&gt;\usephysicsmodule&lt;/code&gt;, after &lt;code&gt;\usepackage{physics2}&lt;/code&gt;. List only the modules you need, separated by commas:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;physics2&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usephysicsmodule&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;ab,ab.braket,diagmat,xmat&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ab&lt;/strong&gt; module: the &lt;code&gt;\ab&lt;/code&gt; command, which sizes a pair of delimiters automatically: &lt;code&gt;\ab(\frac{x}{2})&lt;/code&gt;, &lt;code&gt;\ab[\dots]&lt;/code&gt;, &lt;code&gt;\ab\{\dots\}&lt;/code&gt;, &lt;code&gt;\ab|x|&lt;/code&gt;, &lt;code&gt;\ab\|x\|&lt;/code&gt;, and &lt;code&gt;\ab&amp;lt;f, g&amp;gt;&lt;/code&gt;. Use it for function arguments too, as in &lt;code&gt;\sin\ab(\frac{x}{2})&lt;/code&gt;. A star, &lt;code&gt;\ab*|x|&lt;/code&gt;, turns the automatic sizing off.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ab.braket&lt;/strong&gt; module: Dirac notation with &lt;code&gt;\bra&amp;lt;\phi|&lt;/code&gt;, &lt;code&gt;\ket|\psi&amp;gt;&lt;/code&gt;, &lt;code&gt;\braket&amp;lt;\phi|A|\psi&amp;gt;&lt;/code&gt;, and &lt;code&gt;\ketbra&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;diagmat&lt;/strong&gt; module: diagonal matrices, e.g. &lt;code&gt;\pdiagmat{1,2,3}&lt;/code&gt; for a diagonal matrix in parentheses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;xmat&lt;/strong&gt; module: matrices with patterned entries, e.g. &lt;code&gt;\bxmat{a}{3}{3}&lt;/code&gt; for a \(3\times3\) matrix with entries \(a_{ij}\) in brackets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;doubleprod&lt;/strong&gt; module: the double-dot and double-cross products used with tensors.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;derivative&lt;/strong&gt; handles derivatives and differentials, with many options for order and style.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;\odv{y}{x}&lt;/code&gt; gives an ordinary derivative, &lt;code&gt;\odv[order=2]{y}{x}&lt;/code&gt; a second derivative, &lt;code&gt;\pdv{f}{x,y}&lt;/code&gt; a mixed partial derivative, and &lt;code&gt;\fdv{F}{u}&lt;/code&gt; a functional derivative.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\odif{x}&lt;/code&gt; gives the upright \(\mathrm{d}x\) in an integral, with the right spacing: &lt;code&gt;\int_0^1 f(x) \odif{x}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;natbib&lt;/strong&gt; is a package for working with BibTeX. In particular calling the command as&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[numbers,sort&amp;amp;compress]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;natbib&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;turns a citation that would have rendered as \([6,1,2]\) into \([1,2,6]\), and turns \([1,2,3,4]\) into \([1-4]\). Saves space and looks better!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;breqn&lt;/strong&gt; breaks long displayed equations across lines automatically, and allows matched delimiters such as &lt;code&gt;\left(&lt;/code&gt; and &lt;code&gt;\right)&lt;/code&gt; to match across line breaks. It can clash with other packages, so load it last and remove it if you see strange errors.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;fullpage&lt;/strong&gt; reduces margins so that you can see what you&amp;rsquo;re writing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;todonotes&lt;/strong&gt; does two things: (1) allows you to create to-do items and list them at the front of the document and (2) creates placeholders for figures that aren&amp;rsquo;t ready yet.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;showlabels&lt;/strong&gt; shows the labels next to equations and figures so it&amp;rsquo;s easier to recall their names when you want to reference them.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="my-style-guide"&gt;My style guide&lt;/h2&gt;
&lt;p&gt;Some reasons to have a style guide are for consistency and to conform to professional conventions. On top of that, poor style can be distracting to the reader. I learned a bunch of things while preparing this document, so this style guide represents how I intend to use \(\LaTeX\) in the future, rather than how I have always used it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This is a hard one. &lt;code&gt;$...$&lt;/code&gt; and &lt;code&gt;$$...$$&lt;/code&gt; are plain \(\TeX\). The \(\LaTeX\) equivalents are &lt;code&gt;\( \)&lt;/code&gt; and &lt;code&gt;\[ \]&lt;/code&gt;. Does this make a difference? I don&amp;rsquo;t know, but it&amp;rsquo;s
and is supposed to improve spacing before and after equations, so I&amp;rsquo;m going to try to do it from now on. You can download a python script called
that will convert this for you.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vectors: bold, usually lowercase. Don&amp;rsquo;t use arrows. Use &lt;code&gt;\mathbf{v}&lt;/code&gt; for Latin letters, and &lt;code&gt;\bm{\xi}&lt;/code&gt; from the &lt;strong&gt;bm&lt;/strong&gt; package for Greek letters (or &lt;code&gt;\bm&lt;/code&gt; for everything, if you prefer bold italic). Define a macro for each vector you use.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Matrices: Uppercase, bold.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Derivatives: Use the &lt;code&gt;\odv&lt;/code&gt; command from the &lt;strong&gt;derivative&lt;/strong&gt; package, &lt;code&gt;\pdv&lt;/code&gt; for partials and &lt;code&gt;\fdv&lt;/code&gt; for functional or Fréchet derivatives.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The \(\mathrm{d}\) in an integral is typeset using the &lt;code&gt;\odif{x}&lt;/code&gt; command from the &lt;strong&gt;derivative&lt;/strong&gt; package. This will automatically handle the spacing before the letter.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Bibliography &amp;amp; References:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use BibTeX. This is one area where I have especially strong opinions. Specific guidelines:
&lt;ul&gt;
&lt;li&gt;BibTeX is reusable between documents. Reuse prevents new mistakes. Try to download the BibTeX from the journal&amp;rsquo;s website for an article rather than entering by hand, e.g., click on the &amp;ldquo;download citation&amp;rdquo; button
.&lt;/li&gt;
&lt;li&gt;While a BibTeX file is plain text, it&amp;rsquo;s better not to have to edit it directly. Even if you use Overleaf, I find it preferable to edit on my own computer using the BibDesk app. That way I don&amp;rsquo;t mess up all the brackets.&lt;/li&gt;
&lt;li&gt;Use the appropriate document type.&lt;/li&gt;
&lt;li&gt;Make sure that letters in article titles that must stay capitalized (proper nouns, e.g., &lt;code&gt;{S}chrödinger&lt;/code&gt;) are surrounded by &lt;code&gt;{}&lt;/code&gt;. Otherwise they&amp;rsquo;ll get converted to lowercase.&lt;/li&gt;
&lt;li&gt;Author names should be consistent. First and middle names should be shortened to initials. You don&amp;rsquo;t have to actually edit the BibTeX file. Choose a bibliography style that automatically abbreviates for you, such as &lt;code&gt;\bibliographystyle{abbrv}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Leave the &amp;ldquo;number&amp;rdquo; field and the &amp;ldquo;month&amp;rdquo; field blank.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;\eqref&lt;/code&gt; to reference equations. Use a nonbreaking space (denoted with a &lt;code&gt;~&lt;/code&gt;) before the reference commands &lt;code&gt;\ref&lt;/code&gt;, &lt;code&gt;\eqref&lt;/code&gt;, and &lt;code&gt;\cite&lt;/code&gt;. For example &lt;code&gt;A graph of Eq.~\eqref{equation1} is shown in Fig.~\ref{thisfigure}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The words Figure and Equation should always be abbreviated in references. As above, the word &amp;ldquo;Fig.&amp;rdquo; should always appear before a figure reference. Referenced equation numbers should always be preceded by a word: usually &amp;ldquo;Eq.&amp;rdquo; but sometimes it&amp;rsquo;s more natural to say something like &amp;ldquo;Inequality (5)&amp;rdquo; or &amp;ldquo;Hamiltonian (6)&amp;rdquo;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If a word appears in a subscript or superscript, it should be in Roman script. \(X_{\mathrm{max}}\) not \(X_{max}\), written as &lt;code&gt;$X_{\mathrm{max}}$&lt;/code&gt;. Make a macro &lt;code&gt;\Xmax&lt;/code&gt; and call that.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use &amp;ldquo;we,&amp;rdquo; not &amp;ldquo;I.&amp;rdquo; Mathematical writing conventionally uses &amp;ldquo;we&amp;rdquo; to bring the reader along (&amp;ldquo;we now show that…&amp;rdquo;). Prefer it to the passive voice, which tends to hide who is doing what (&amp;ldquo;it is shown that…&amp;rdquo;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Equations are part of sentences and need to be punctuated.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Don&amp;rsquo;t start a sentence with a symbol. Say &amp;ldquo;The norm \(\lVert x\rVert\) is finite,&amp;rdquo; not &amp;ldquo;\(\lVert x\rVert\) is finite.&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Let \(\TeX\) do the spacing. If you&amp;rsquo;re reaching for &lt;code&gt;\,&lt;/code&gt; or &lt;code&gt;\;&lt;/code&gt;, the real fix is usually to tell \(\TeX\) what the symbol is: &lt;code&gt;\{x \mid x&amp;gt;0\}&lt;/code&gt;, not &lt;code&gt;\{x \;|\; x&amp;gt;0\}&lt;/code&gt;; &lt;code&gt;f \colon X \to Y&lt;/code&gt;, not &lt;code&gt;f:X\to Y&lt;/code&gt;; &lt;code&gt;\DeclareMathOperator{\tr}{tr}&lt;/code&gt;, not &lt;code&gt;\mathrm{tr}\,A&lt;/code&gt;. Hand-spacing belongs in only a few places: &lt;code&gt;\quad&lt;/code&gt; before a side condition (&lt;code&gt;f(x)=0, \quad x&amp;gt;0&lt;/code&gt;), &lt;code&gt;~&lt;/code&gt; before references and citations, and &lt;code&gt;\ &lt;/code&gt; (backslash-space) after a period that doesn&amp;rsquo;t end a sentence (&lt;code&gt;e.g.\ &lt;/code&gt;, &lt;code&gt;et al.\ &lt;/code&gt;). When you inherit a file full of hand-spacing, delete it all, recompile, and add back only what visibly needs fixing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Figures:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If making figures in MATLAB, use my startup.m file to get better defaults, in particular thicker lines, larger text in labels, and the \(\LaTeX\) interpreter in all text. Thin lines disappear, especially when projected as slides.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Don&amp;rsquo;t ever use the MATLAB green represented by &lt;code&gt;'g'&lt;/code&gt;. Especially not in talks. It shows up very poorly on the screen.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Align subfigures and avoid too much whitespace between and around them.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Don&amp;rsquo;t get me started on colormaps! The old default MATLAB colormap, called &lt;strong&gt;jet,&lt;/strong&gt; used in commands like &lt;code&gt;pcolor&lt;/code&gt; and &lt;code&gt;surf &lt;/code&gt; is &lt;em&gt;bad, bad, bad&lt;/em&gt; and should never be used. The new default colormap &lt;strong&gt;parula&lt;/strong&gt; is better but still not optimal. A lot of perceptual research has gone into the design of the colormaps for the Python library &lt;strong&gt;matplotlib&lt;/strong&gt; and has been ported over to
. The link contains a video with an explanation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The
document recommends against using the &lt;code&gt;\begin{center}...\end{center}&lt;/code&gt; syntax in a figure; use &lt;code&gt;\centering&lt;/code&gt; instead, i.e.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;figure&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\centering&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\includegraphics&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;imagename&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;figure&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;is preferred over&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-latex" data-lang="latex"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;figure&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;center&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\includegraphics&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;imagename&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;center&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;figure&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="getting-help"&gt;Getting help&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;In TeXShop on a Mac, under help, click on &amp;ldquo;Show help on package&amp;rdquo; and enter the name of a package to read more about it.&lt;/li&gt;
&lt;li&gt;If you are running \(\LaTeX\) on a Mac, you most likely have a program installed called &lt;em&gt;TeX Live Utility&lt;/em&gt;. It has three tabs. The first allows you to keep your \(\TeX\) installation up to date. It usually takes a minute to load while it checks for all the updates. The second tab &amp;ldquo;Packages&amp;rdquo; contains a list of all the installed packages. You can search for useful installed packages. For example, search for &amp;ldquo;Exam&amp;rdquo; and you&amp;rsquo;ll find the Exam package, which is the right way to write an exam. (I have never clicked on the third tab &amp;ldquo;Backups&amp;rdquo;)&lt;/li&gt;
&lt;li&gt;Google &amp;ldquo;How do I &amp;hellip; in LaTeX?&amp;rdquo; This will usually take you to a discussion on the
. Somebody has already asked the thing you want to know.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="overleaf"&gt;Overleaf&lt;/h2&gt;
&lt;p&gt;Do not email documents back and forth. Do not create a sequence of documents named &lt;code&gt;document1.tex&lt;/code&gt;, &lt;code&gt;document2.tex&lt;/code&gt;, etc. This can only lead to mistakes. Online tools such as
handle shared documents much more elegantly.&lt;/p&gt;
&lt;p&gt;If you prefer to edit locally, then set up Dropbox integration under Account \(\rightarrow\) Account settings on Overleaf. Edit on your personal device. Syncing isn&amp;rsquo;t instantaneous, but it prevents versioning hell. Sadly, this requires a premium or institutional Overleaf account.&lt;/p&gt;
&lt;h2 id="my-template-and-abbreviations-files"&gt;My template and abbreviations files&lt;/h2&gt;
&lt;p&gt;At
there are three \(\LaTeX\) files: a master template file and two include files, one containing all the packages I use and the other containing the macros. I have also included a &lt;strong&gt;startup.m&lt;/strong&gt; file for MATLAB. It should go in the search path and will run automatically when MATLAB starts. This changes the behavior of MATLAB&amp;rsquo;s text annotation functions such as &lt;code&gt;xlabel&lt;/code&gt; and &lt;code&gt;title&lt;/code&gt;. Any math that appears in such a command must now be enclosed in dollar signs, such as in &lt;code&gt;xlabel('$\omega$')&lt;/code&gt;. This allows for both better looking text in your figures and opens up the possibility of much more complex math in the labels.&lt;/p&gt;</description></item><item><title>matdfield &amp; matpplane (2021, now superseded)</title><link>https://roygoodman.net/post/relaunching-pplane/</link><pubDate>Tue, 02 Feb 2021 22:06:58 -0500</pubDate><guid>https://roygoodman.net/post/relaunching-pplane/</guid><description>
&lt;div class="callout flex px-4 py-3 mb-6 rounded-md border-l-4 bg-blue-100 dark:bg-blue-900 border-blue-500"
data-callout="note"
data-callout-metadata=""&gt;
&lt;span class="callout-icon pr-3 pt-1 text-blue-600 dark:text-blue-300"&gt;
&lt;svg height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"&gt;&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m16.862 4.487l1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125"/&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;div class="callout-content dark:text-neutral-300"&gt;
&lt;div class="callout-title font-semibold mb-1"&gt;Note&lt;/div&gt;
&lt;div class="callout-body"&gt;&lt;p&gt;&lt;strong&gt;Use these instead:&lt;/strong&gt;
. I&amp;rsquo;m happy to report that my work here has been rendered obsolete. Brian Hong at MathWorks has written new programs that are sleek, modern, documented, and in every way superior. The rest of this post describes my 2021 update of the old programs and is kept for the record.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I have written a new front end and made &lt;em&gt;many, many&lt;/em&gt; fixes to the old MATLAB programs &lt;strong&gt;dfield&lt;/strong&gt; and &lt;strong&gt;pplane&lt;/strong&gt; that make them compatible with MATLAB Release 2020b. To distinguish these new working programs, I&amp;rsquo;ve renamed them:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;matdfield&lt;/strong&gt; draws direction fields for (possibly nonautonomous) first-order scalar ordinary differential equations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;matpplane&lt;/strong&gt; draws phase plane portraits for autonomous first-order systems of two ordinary differential equations.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve also created a simple launcher packaged as a &lt;em&gt;MATLAB App&lt;/em&gt;, so all a student needs to do is click a button.&lt;/p&gt;
&lt;p&gt;The best place to download them is the
.&lt;/p&gt;
&lt;p&gt;They have lots of nice features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;drawing level sets&lt;/li&gt;
&lt;li&gt;finding equilibria and linearizing about them.&lt;/li&gt;
&lt;li&gt;finding stable &amp;amp; unstable manifolds&lt;/li&gt;
&lt;li&gt;saving user generated equation definitions to files and galleries.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These programs were originally copyrighted by John Polking between 1995 and 2003. The textbook &lt;em&gt;Ordinary Differential Equations Using MATLAB&lt;/em&gt;, 3rd edition, contains a manual for the programs, but they are pretty self-explanatory.&lt;/p&gt;
&lt;p&gt;The codes were last properly updated in 2003 for MATLAB 6.5. The MATLAB File Exchange contains many submissions that got the codes running again on some release or other, but none that systematically attempted to fix &lt;em&gt;all&lt;/em&gt; the broken components.&lt;/p&gt;
&lt;p&gt;I have tried to fix all the errors but have not managed to fix everything. I have examined every warning produced by the Code Compatibility Report and the Code Analyzer Report features in MATLAB. I have been able to fix almost all of these. Where I could not, I suppressed the warning and left a comment. Most of the remaining warnings are due to arrays that change size over iterations, and there&amp;rsquo;s not much to do about them. Many came from an overuse of the &lt;code&gt;eval&lt;/code&gt; and &lt;code&gt;feval&lt;/code&gt; commands, which I have replaced by more modern coding constructs.&lt;/p&gt;
&lt;p&gt;As far as I can tell everything works except for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &amp;lsquo;Revert&amp;rsquo; button&lt;/li&gt;
&lt;li&gt;The &amp;lsquo;Zoom Back&amp;rsquo; feature in pplane (works in dfield, should be able to fix in pplane).&lt;/li&gt;
&lt;li&gt;&amp;ldquo;Find a nearly closed orbit&amp;rdquo; in pplane.&lt;/li&gt;
&lt;li&gt;The message section at the bottom of the display is garbled in pplane (again, it works in dfield so should be fixable.)&lt;/li&gt;
&lt;li&gt;Certain forms of complicated ODE cause crashes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Under the hood, the program is a mess. &lt;em&gt;There is a lot I would like to fix, but the structure of the original function would make modernization nearly impossible.&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Each program (pplane &amp;amp; dfield) uses a structure where each callback, instead of being a separate function, is given by a recursive call to the main program (matdfield) or (matpplane), determined by a very long &lt;code&gt;if-then-else&lt;/code&gt; structure. I have tried breaking out the contents of individual &lt;code&gt;elseif&lt;/code&gt; blocks into separate functions, in their own m-files. This has generally led to strange and hard-to-trace errors, so I abandoned the effort. This structure makes understanding the scope of variables very challenging.&lt;/li&gt;
&lt;li&gt;The function of each &lt;code&gt;elseif&lt;/code&gt; block is rarely documented, although I added some documentation in my attempt to understand what each does.&lt;/li&gt;
&lt;li&gt;A lot of code is dedicated to fiddling with window dimensions and similar display issues. The variable names used to do this are not self-explanatory and contain lots of magic numbers.&lt;/li&gt;
&lt;li&gt;A lot of code is dedicated to string manipulation. Either this was written before MATLAB added straightforward string-handling features, or else the authors didn&amp;rsquo;t know about these features. To be fair, &lt;em&gt;the original programs were written before Google existed(!)&lt;/em&gt;, so discovering MATLAB functionality would have involved searching in books!&lt;/li&gt;
&lt;li&gt;There are a lot of calls to &lt;code&gt;eval&lt;/code&gt; and &lt;code&gt;feval&lt;/code&gt; which leads to hard-to-decipher codes. I have corrected this in the cases where such constructions confused the Code Analyzer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nonetheless, there are a lot of simple cleanups that might make this more maintainable, including lots of repeated code that should be moved to separate m-files and made into functions. I will continue to maintain this code and make sure that it remains compatible with future MATLAB releases. If anyone would like to help out, or finds an error they&amp;rsquo;d like to fix, the code is available on
. Any other bugs you find, please let me know.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Acknowledgments&lt;/strong&gt;: The current codes are based on revisions by Nathanael Kazmierczak (pplane) and Giampiero Campa (dfield). I gratefully acknowledge their efforts and those of others who posted fixes to the MATLAB File Exchange. Several other people sent me partially working codes including Mac Hyman, Hil Meijer, Joceline Lega, Ross Parker, and Björn Sandstede. I got lots of help by posting questions to MATLAB Answers. These were usually answered (within minutes) by Walter Roberson, of MathWorks. Div Tiwari, also of MathWorks, provided additional useful suggestions.&lt;/p&gt;</description></item><item><title>Summary of Responses to my post to the SIAG-DS mailing list</title><link>https://roygoodman.net/post/siag-ds-responses/</link><pubDate>Tue, 02 Feb 2021 22:05:43 -0500</pubDate><guid>https://roygoodman.net/post/siag-ds-responses/</guid><description>
&lt;div class="callout flex px-4 py-3 mb-6 rounded-md border-l-4 bg-blue-100 dark:bg-blue-900 border-blue-500"
data-callout="note"
data-callout-metadata=""&gt;
&lt;span class="callout-icon pr-3 pt-1 text-blue-600 dark:text-blue-300"&gt;
&lt;svg height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"&gt;&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m16.862 4.487l1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125"/&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;div class="callout-content dark:text-neutral-300"&gt;
&lt;div class="callout-title font-semibold mb-1"&gt;Note&lt;/div&gt;
&lt;div class="callout-body"&gt;&lt;p&gt;Written in January 2021. Several of the tools below have changed since then, and the best option for MATLAB users is now
.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="the-email"&gt;The email&lt;/h2&gt;
&lt;p&gt;On January 5 I sent
to the SIAG-DS mailing list about the old MATLAB programs dfield and pplane. I posted the same question to the Facebook group &lt;em&gt;STEM faculty blundering through remote teaching in a pandemic&lt;/em&gt;. My goal was to see if I could get the programs running again to use in my undergrad ODE classes, and, in the longer term, to rewrite them from scratch.&lt;/p&gt;
&lt;h2 id="the-responses"&gt;The responses&lt;/h2&gt;
&lt;p&gt;Over the next two weeks I received about 30 response emails. I learned a lot from these emails and I thought the best thing I could do is share them.&lt;/p&gt;
&lt;p&gt;The main thing I learned is that a lot of people still like these programs and would like to be able to use them. A second thing I learned is that lots of people have managed to fix just enough bugs to keep the program hobbling along. A few people have uploaded these partial fixes but nobody, as far as I was able to tell, had made an attempt to systematically go through the code and fix everything. One person who had made some fixes, and had the forethought to take notes on it as he went, is Nathanael Kazmierczak, now a grad student at Caltech. He sent me his updates and his notes, and patiently answered my questions via email. I decided to run this code, &amp;ldquo;push all the buttons,&amp;rdquo; and try to fix all the errors. I believe I have done this. Also, &lt;em&gt;I hereby appoint myself maintainer of these codes for the near future or until we can get something better in MATLAB.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="my-requirements"&gt;My requirements&lt;/h2&gt;
&lt;p&gt;Lots of people wrote me to tell me about other options for graphing direction fields and phase planes and more. I knew about a lot of these and have even used a few of them myself for research and teaching. In my opinion, none of them suits my particular needs as well as dfield and pplane, which meet three requirements:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;It should be in MATLAB.&lt;/strong&gt; Our undergrads use MATLAB throughout the curriculum. Using dfield and pplane allows me to assign as the first assignment: &lt;em&gt;get MATLAB running and run this pre-written program,&lt;/em&gt; without asking students to learn any programming.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It should be really, really simple.&lt;/strong&gt; Our 200-level ODE course typically runs 10 sections and 300 students per semester, many taught by adjuncts and lecturers, who aren&amp;rsquo;t necessarily experts in programming. Many of the students have just transferred from two-year colleges that don&amp;rsquo;t use MATLAB as much as we do. I just want it to work.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It should have a GUI&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="other-options"&gt;Other options&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ll arrange these by suitable audience and purpose:&lt;/p&gt;
&lt;h3 id="dfieldpplane-equivalents"&gt;Dfield/pplane equivalents&lt;/h3&gt;
&lt;p&gt;Good for teaching undergraduates&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
This is a terrific app for iOS and Android devices, written by a group of students and faculty at Pepperdine University led by Timothy Lucas. It is great to use on an iPad during remote lectures and the graphics are stunning compared to pplane and dfield. The Android version is new and not yet full-featured. I don&amp;rsquo;t think that robust numerical libraries for these devices exist, so they have had to write a lot of the numerical guts of the code themselves. As such, I have managed to break the code on several occasions while trying out exercises and examples I wanted to use. Tim has been very responsive to my inquiries and is aware of the issues.&lt;/li&gt;
&lt;li&gt;
Authorized clone of the original dfield/pplane programs. Requires a Java Runtime Environment. Works fine, bad graphics export.&lt;/li&gt;
&lt;li&gt;
An open-source reimplementation of pplane and dfield written in Python. It appears to be under active development but to run it on Mac or Windows, you need to clone a GitHub repo, so that&amp;rsquo;s too hard for a big undergraduate class. Someday there may be binaries&amp;hellip;&lt;/li&gt;
&lt;li&gt;
On the webpage of Darryl Nester of Bluffton University, h/t
&lt;/li&gt;
&lt;li&gt;
From the LibreTexts free textbook website. h/t
&lt;/li&gt;
&lt;li&gt;
an R package for exploring one and two dimensional autonomous ODE systems, by Michael Grayling et al. Not a GUI, so not for an intro class. h/t
.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="writing-your-own"&gt;Writing your own&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
has a basic equivalent of dfield on his
&lt;/li&gt;
&lt;li&gt;
shared some codes with me. I didn&amp;rsquo;t get his permission to share them, but what impressed me was that the documentation was many times longer than the codes themselves. I commented on how thoughtfully done this was and he responded, &amp;ldquo;As to documentation, this is something I place a premium on, also in my development of more sophisticated tools. I have often found that it actually helps tighten up the software implementation as well, especially when a mathematical notation and a logical flow can be developed in parallel with the encoding and both made to mirror one another.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;
is using
for a similar purpose, with what sounds like significant technical support from Brown University.&lt;/li&gt;
&lt;li&gt;Beyond heavy reliance on the Slopes app, I made extensive use of MATLAB Live Scripts the last time I taught out of Strogatz&amp;rsquo;s book. I wanted to show how, with today&amp;rsquo;s tools, it is straightforward to reproduce all the classical results Strogatz discusses and introduce students to the interplay between theoretical and numerical studies that leads to insights. I ended up writing something of a
.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="more-advanced-students-and-research"&gt;More Advanced Students and Research&lt;/h3&gt;
&lt;p&gt;I like these but they don&amp;rsquo;t fit the bill for big intro classes. These are just the ideas people sent me. For a more complete list, look at the
at DSWeb, h/t Andrew Bernoff.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
MATLAB package for continuation and bifurcation in discrete and continuous systems. I have used this in my own research and in a graduate class. Highly recommended.&lt;/li&gt;
&lt;li&gt;
I&amp;rsquo;ve been meaning to learn Julia for years! Somehow it always seems easier to stick with MATLAB. In particular, Isaia Nisoli pointed out
.&lt;/li&gt;
&lt;li&gt;
from Nick Trefethen and company in Oxford.&lt;/li&gt;
&lt;li&gt;
is a nice program that is no longer in active development, h/t John Tyson&lt;/li&gt;
&lt;li&gt;
, from Stuart Heitmann, is an open MATLAB toolbox for simulating dynamical systems and plotting phase planes etc. It was designed for computational neuroscience but can be applied to dynamical systems in any domain (ODEs, SDEs, DDEs, PDEs). Students can implement their own models (often less than 100 lines of code) and run them in the graphical interface without any graphical programming effort. The latest version uses the modern MATLAB uitools graphical interface. It requires MATLAB R2019b or newer.&lt;/li&gt;
&lt;li&gt;
from Bard Ermentrout remains very popular.&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>