<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse meta-comment
% File: thermodynamics.dtx Copyright (C) 2022-2024 Karl D. Hammond
%
% Karl D. Hammond
% Chemical Engineering Program
% University of Missouri
% Contact: hammondkd@missouri.edu
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is K. D. Hammond.
%
% This work consists of the files thermodynamics.dtx and thermodynamics.ins
% and the derived files thermodynamics.sty, thermodynamics.pdf,
% thermodynamics-examples.tex, and thermodynamics-examples.pdf.
% \fi
%
% \iffalse
%&lt;*driver&gt;
\ProvidesFile{thermodynamics.dtx}
%&lt;/driver&gt;
%
%&lt;package&gt;\NeedsTeXFormat{LaTeX2e}
%&lt;package&gt;\RequirePackage{expl3}
%&lt;package&gt;\ProvidesPackage{thermodynamics}
%&lt;*package&gt;
    [2024/06/14 v2.02 thermodynamics notation]
%&lt;/package&gt;
%&lt;*driver&gt;
\documentclass[11pt,letterpaper]{ltxdoc}
%^^X\bool_set_false:N \l__codedoc_allow_indexing_bool
\usepackage[margin=0.80in,left=2.05in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage{pxfonts}
\usepackage{array}
\usepackage{booktabs}
\usepackage{footmisc}
\usepackage{pdflscape}
\usepackage{supertabular}
\usepackage{graphicx} %^^A for \reflectbox
\usepackage{xcolor}
\usepackage[labelfont=bf,labelsep=period,font=small]{caption}
\usepackage{emf}
\GetFileInfo{thermodynamics.dtx}
\usepackage{thermodynamics}[\filedate\space\fileversion]
\DeclareMathAlphabet{\mathdutchcal}{U}{dutchcal}{m}{n}
\DisableCrossrefs
\CodelineIndex
\PageIndex
\CodelineNumbered
\RecordChanges
%^^X\OnlyDescription
%^^X Preparing to use l3doc.cls, but it's not quite mature yet....
%^^A\DisableDocumentation
%^^A\DisableImplementation
%^^X\ExplSyntaxOff
\let\tn\cs
\let\env\texttt
\let\pkg\textsf
\IndexPrologue{\section*{Index}%
                 \markboth{Index}{Index}%
                 Numbers written in italics refer to the page
                 where the corresponding entry is described;
                 numbers underlined refer to the
                 %^^A\ifcodeline@index
                   code line of the
                 %^^A\fi
                 definition.%^^A; numbers in Roman refer to the
                 %^^A\ifcodeline@index
                 %^^A  code lines
                 %^^A\else
                 %^^A  pages
                 %^^A\fi
                 %^^Awhere the entry is used.
                 }
\makeatother
\begin{document}
  \DocInput{thermodynamics.dtx}
\end{document}
%&lt;/driver&gt;
% \fi
%
% \CheckSum{3537}
%
% \CharacterTable
% {Upper-case   \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%  Lower-case   \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%  Digits       \0\1\2\3\4\5\6\7\8\9
%  Exclamation     \!      Double quote    \"      Hash (number)   \#
%  Dollar          \$      Percent         \%      Ampersand       \&amp;
%  Acute accent    \'      Left paren      \(      Right paren     \)
%  Asterisk        \*      Plus            \+      Comma           \,
%  Minus           \-      Point           \.      Solidus         \/
%  Colon           \:      Semicolon       \;      Less than       \&lt;
%  Equals          \=      Greater than    \&gt;      Question mark   \?
%  Commercial at   \@      Left bracket    \[      Backslash       \\
%  Right bracket   \]      Circumflex      \^      Underscore      \_
%  Grave accent    \`      Left brace      \{      Vertical bar    \|
%  Right brace     \}      Tilde           \~}
%
% \changes{v1.00}{2022/04/29}{Initial public release}
% \changes{v2.00}{2023/11/16}{Revision to use \LaTeX3
%       (\pkg{expl3}/\pkg{xparse}) syntax layer.}
%
% \newcommand*{\setmarginparsize}[1]
% {\bgroup
% \RenewExpandableDocumentCommand{\MacroFont}{}{\fontencoding\encodingdefault
%    \fontfamily\ttdefault
%    \fontseries\mddefault
%    \fontshape\shapedefault
%    #1}
% }
% \newcommand*{\restoremarginparsize}{\egroup}
%
% \GetFileInfo{thermodynamics.dtx}
%^^X \title{The \textsf{thermodynamics} package\thanks{This document
%^^X   corresponds to \textsf{thermodynamics}~\ExplFileVersion,
%^^X   dated \ExplFileDate.}}
% \title{The \textsf{thermodynamics} package\thanks{This document
%   corresponds to \textsf{thermodynamics}~\fileversion,
%   dated \filedate.}}
% \author{Karl D. Hammond \\ \texttt{hammondkd@missouri.edu}}
%^^X \date{\ExplFileDate}
% \date{\filedate}
% \maketitle
%
% \begin{abstract}
% A package, \textsf{thermodynamics}, is defined that makes typesetting
% quantities found in thermodynamics texts relatively simple. The commands are
% flexible and intended to be relatively intuitive. It handles several sets
% of notation for total, specific, and molar quantities; allows changes between
% symbols (e.g., $A$ vs.\ $F$ for Helmholtz free energy); and greatly
% simplifies the typesetting of symbols and partial derivatives commonly
% encountered in mixture thermodynamics. Changes of one's notes from one
% textbook to another can be achieved relatively easily by changing package
% options.
% \end{abstract}
%
%^^X \begin{documentation}
% \section{Introduction}
% The purpose of this package is to simplify the typesetting of equations in
% thermodynamics, particularly chemical engineering thermodynamics, which are
% often cumbersome to enter. For example, consider the following equation:
% \begin{equation}
%   d\Ut = \Partial*{\Ut}{\St}{\Vt,\allNs} \,d\St
%         + \Partial*{\Ut}{\Vt}{\St,\allNs} \,d\Vt
%         + \sumall_i \Partial*{\Ut}{\Nt_i}{\St,\Vt,\allNsbut{i}} d\Nt_i.
%   \label{eq:chain-rule-U}
% \end{equation}
% This equation is pretty basic, and equations like it occur all the time in
% thermodynamics. Without this package, you might typeset it like this:
% \begin{verbatim}
% \[ d\underline{U} =
%    \left(\frac{\partial\underline{U}}
%               {\partial\underline{S}}\right)_{\underline{V},\vec{n}}
%    d\underline{S}
%  + \left(\frac{\partial\underline{U}}
%               {\partial\underline{V}}\right)_{\underline{S},\vec{n}}
%    d\underline{V}
%  + \sum_{i=1}^C \left(\frac{\partial\underline{U}}
%       {\partial n_i}\right)_{\underline{S},\underline{V},n_{j\neq i}}
%    dn_i. \]
%\end{verbatim}
% This is a lot of code, and even then the output is slightly clunky:
% \[ d\underline{U} =
%     \left(\frac{\partial\underline{U}}
%                {\partial\underline{S}}\right)_{\underline{V},\vec{n}}
%     d\underline{S}
%   + \left(\frac{\partial\underline{U}}
%                {\partial\underline{V}}\right)_{\underline{S},\vec{n}}
%     d\underline{V}
%   + \sum_{i=1}^C \left(\frac{\partial\underline{U}}
%                {\partial n_i}\right)_{\underline{S},\underline{V},n_{j\neq i}}
%     dn_i.
% \]
% It is also frustratingly difficult to change one's notes or handouts from one
% textbook that uses, say, $n_1$ to denote moles of component 1 to another
% textbook that uses $N_1$ for the same quantity, or perhaps denotes the
% total internal energy as $U$ or $U^t$ rather than $\Ut$.
% For example, if you wanted it to be
% \[\begin{thermomolesrange}
%   \begin{thermoextensiveplain}
%   \RenewExpandableDocumentCommand{\Nt}{}{N}
%   \RenewExpandableDocumentCommand{\ncomponents}{}{\mathcal{C}}
%   d\Ut = \Partial*{\Ut}{\St}{\Vt,\allNs} \,d\St
%         + \Partial*{\Ut}{\Vt}{\St,\allNs} \,d\Vt
%         + \sumall_i \Partial*{\Ut}{\Nt_i}{\St,\Vt,\allNsbut{i}} d\Nt_i.
%   \end{thermoextensiveplain}
%   \end{thermomolesrange}
% \]
% without changing any of your code---to update it across all handouts, exams,
% and homework sets after changing textbooks, say---you would be out of luck
% (or in for a lot of work).
%
% With this package, you could reduce the code to typeset this equation to
% \begin{verbatim}
%  \begin{equation}
%     d\Ut = \Partial*{\Ut}{\St}{\Vt,\allNs} d\St
%       + \Partial*{\Ut}{\Vt}{\St,\allNs} d\Vt
%       + \sumall_i \Partial*{\Ut}{\Nt_i}{\St,\Vt,\allNsbut{i}} d\Nt_i
%  \end{equation}
%\end{verbatim}
% and it will render similarly to Equation~\eqref{eq:chain-rule-U}, including
% the shortened underscores and negative kerning.
% If you later decide to change the notation such that extensive properties are
% not underlined, you can do that without changing any of your code (just
% change a package option). Similarly, if you want $\vec{n}$ replaced by
% $n_1,\dots,n_C$, you can do that with a package option, too.
%
% The package handles second derivatives, too. For example,
% \begin{verbatim}
%  \[ \Partial*{\Hm}{T}{P} = T\Partial*{\Sm}{T}{P}
%                          = -T\PartialSecond*{\Gm}{T}{P} = \cP \]
%\end{verbatim}
% renders (using the default options)
%  \[ \Partial*{\Hm}{T}{P} = T\Partial*{\Sm}{T}{P}
%                          = -T\PartialSecond*{\Gm}{T}{P} = \cP. \]
% Similarly, macros are defined for mixed second partial derivatives that allow
% things like
% \begin{verbatim}
%  \[ \Partial*{\Gpm_i}{P}{T,\allNs}
%    = \PartialMixSecond*{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
%    = \PartialMixSecond*{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
%    = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}} = \Vpm_i \],
%\end{verbatim}
% which renders
% \[ \Partial*{\Gpm_i}{P}{T,\allNs}
%   = \PartialMixSecond*{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
%   = \PartialMixSecond*{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
%   = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}} = \Vpm_i
% \]
% using the defaults.
%
%^^A-------------------------------------------------------------------------
%
% \section{Using the Package} \label{sec:using}
% There are three categories of macros defined in this package: macros
% that produce symbols (or groups of them), macros that typeset derivatives,
% and macros that are used internally that the user need not know about.
% There are also several environments that allow the user to change notation
% temporarily.
%
% \subsection{Predefined Symbols}
% The macros used to produce symbols fall into five categories: extensive
% properties, molar properties, specific properties (i.e., per unit mass),
% partial molar properties, and shortcut macros (e.g., macros for the heat
% capacities, saturation pressure, and so forth). The macros corresponding to
% extensive, molar, and specific properties are shown in
% Table~\ref{table:symbols}. Examples using the enthalpy are
% \DescribeMacro{\Ht}
% \DescribeMacro{\Hm}
% \DescribeMacro{\Hs}
% \DescribeMacro{\Hpm}
% \begin{verbatim}
%   \[ \Ht \quad \Hm \quad \Hs \quad \Hpm_i. \]
%\end{verbatim}
% Using the default package options, the above renders as
%   \[ \Ht \quad \Hm \quad \hat H \quad \Hpm{i}. \]
% In addition, the properties in
% Table~\ref{table:conveniences} are defined for convenience. A more
% comprehensive list, including how those properties are represented in the
% various textbook-related options supported by this package, are shown in
% Appendix~\ref{sec:symbols}.
%
% \DescribeMacro{\Ut}
% \DescribeMacro{\Um}
% How these symbols are rendered can be customized by package options. As long
% as the user consistently uses \cs{Ut} to render the total internal energy,
% \cs{Um} to render the molar internal energy, and so forth, switching notation
% from, say, $\Ut$ to $U^t$ for extensive properties is trivial.
%
% \DescribeMacro{\cP}
% \DescribeMacro{\cV}
% \DescribeMacro{\cPt}
% \DescribeMacro{\cVt}
% \DescribeMacro{\cPs}
% \DescribeMacro{\cVs}
% \DescribeMacro{\cPpm}
% \DescribeMacro{\cVpm}
% The heat capacities (see Table~\ref{table:conveniences}) are generally
% assumed to be molar (e.g., \cs{cP} is interpreted to be the molar heat
% capacity). To get the specific heat capacities, the macros \cs{cPs} and
% \cs{cVs} are provided, which by default render as $\cPs$ and $\cVs$,
% respectively. There are also extensive versions, so \cs{cPt} and \cs{cVt}
% will render as $\cPt$ and $\cVt,$
% respectively.  Note that \cs{cP} and friends require you to surround
% \cs{text} with brackets.  For example, \verb"\cP_i^\text{A}" will not work,
% nor will \verb"\cP^\text{A}_i"; you need to use \verb"\cP_i^{\text{A}}" and
% \verb"\cP^{\text{A}}_i". Using \verb"\cP^\IG_i" will work as expected.
%
% You can also get partial molar heat capacities via \cs{cPpm} and \cs{cVpm},
% though the latter's mathematical definition is a bit hard to wrap one's head
% around:
% \begin{verbatim}
%   \[ \cVpm_i = \Partial*{\cVt}{\Nt_i}{T,P,\allNsbut{i}}
%              = \frac{\partial}{\partial\Nt_i}
%                \left[ -T\PartialSecond{\Ft}{T}{\Vt,\allNs}
%                \right]_{T,P,\allNsbut{i}} \]
%\end{verbatim}
% yields
%   \[ \cVpm{i} = \Partial*{\cVt}{\Nt_i}{T,P,\allNsbut{i}}
%               = \frac{\partial}{\partial\Nt_i}
%                 \left[ -T\PartialSecond{\Ft}{T}{\Vt,\allNs}
%                 \right]_{T,P,\allNsbut{i}}. \]
%
% \begin{table}
%   \caption{Commands defined in this package to represent extensive
%       thermodynamic quantities and their molar and specific analogs.
%       These macros should be used even if the symbol the user
%       wishes to use does not match the command used (e.g., \cs{Ft}
%       for total Helmholtz free energy even if it ends up being set as
%       $\Ft$)\@.
%   }
%   \label{table:symbols}
%^^A TODO The \leavevmode macro here is to prevent whitespace from building
%^^A      up due to a bug in old versions of hypdoc. It should be harmless to
%^^A      leave it in there, but consider removing it at some point.
%   \leavevmode
%   \SpecialMacroIndex{\Qt}\relax
%   \SpecialMacroIndex{\Qm}\relax
%   \SpecialMacroIndex{\Qs}\relax
%   \SpecialMacroIndex{\Wt}\relax
%   \SpecialMacroIndex{\Wm}\relax
%   \SpecialMacroIndex{\Ws}\relax
%   \SpecialMacroIndex{\Et}\relax
%   \SpecialMacroIndex{\Em}\relax
%   \SpecialMacroIndex{\Es}\relax
%   \SpecialMacroIndex{\Epm}\relax
%   \SpecialMacroIndex{\EEt}\relax
%   \SpecialMacroIndex{\EE}\relax
%   \SpecialMacroIndex{\EEs}\relax
%   \SpecialMacroIndex{\EEpm}\relax
%   \SpecialMacroIndex{\ERt}\relax
%   \SpecialMacroIndex{\ER}\relax
%   \SpecialMacroIndex{\ERs}\relax
%   \SpecialMacroIndex{\ERpm}\relax
%   \SpecialMacroIndex{\Ut}\relax
%   \SpecialMacroIndex{\Um}\relax
%   \SpecialMacroIndex{\Us}\relax
%   \SpecialMacroIndex{\Upm}\relax
%   \SpecialMacroIndex{\UEt}\relax
%   \SpecialMacroIndex{\UE}\relax
%   \SpecialMacroIndex{\UEs}\relax
%   \SpecialMacroIndex{\UEpm}\relax
%   \SpecialMacroIndex{\URt}\relax
%   \SpecialMacroIndex{\UR}\relax
%   \SpecialMacroIndex{\URs}\relax
%   \SpecialMacroIndex{\URpm}\relax
%   \SpecialMacroIndex{\Ht}\relax
%   \SpecialMacroIndex{\Hm}\relax
%   \SpecialMacroIndex{\Hs}\relax
%   \SpecialMacroIndex{\Hpm}\relax
%   \SpecialMacroIndex{\HEt}\relax
%   \SpecialMacroIndex{\HE}\relax
%   \SpecialMacroIndex{\HEs}\relax
%   \SpecialMacroIndex{\HEpm}\relax
%   \SpecialMacroIndex{\HRt}\relax
%   \SpecialMacroIndex{\HR}\relax
%   \SpecialMacroIndex{\HRs}\relax
%   \SpecialMacroIndex{\HRpm}\relax
%   \SpecialMacroIndex{\St}\relax
%   \SpecialMacroIndex{\Sm}\relax
%   \SpecialMacroIndex{\Ss}\relax
%   \SpecialMacroIndex{\Spm}\relax
%   \SpecialMacroIndex{\SEt}\relax
%   \SpecialMacroIndex{\SE}\relax
%   \SpecialMacroIndex{\SEs}\relax
%   \SpecialMacroIndex{\SEpm}\relax
%   \SpecialMacroIndex{\SRt}\relax
%   \SpecialMacroIndex{\SR}\relax
%   \SpecialMacroIndex{\SRs}\relax
%   \SpecialMacroIndex{\SRpm}\relax
%   \SpecialMacroIndex{\Ft}\relax
%   \SpecialMacroIndex{\Fm}\relax
%   \SpecialMacroIndex{\Fs}\relax
%   \SpecialMacroIndex{\Fpm}\relax
%   \SpecialMacroIndex{\FEt}\relax
%   \SpecialMacroIndex{\FE}\relax
%   \SpecialMacroIndex{\FEs}\relax
%   \SpecialMacroIndex{\FEpm}\relax
%   \SpecialMacroIndex{\FRt}\relax
%   \SpecialMacroIndex{\FR}\relax
%   \SpecialMacroIndex{\FRs}\relax
%   \SpecialMacroIndex{\FRpm}\relax
%   \SpecialMacroIndex{\Gt}\relax
%   \SpecialMacroIndex{\Gm}\relax
%   \SpecialMacroIndex{\Gs}\relax
%   \SpecialMacroIndex{\Gpm}\relax
%   \SpecialMacroIndex{\GEt}\relax
%   \SpecialMacroIndex{\GE}\relax
%   \SpecialMacroIndex{\GEs}\relax
%   \SpecialMacroIndex{\GEpm}\relax
%   \SpecialMacroIndex{\GRt}\relax
%   \SpecialMacroIndex{\GR}\relax
%   \SpecialMacroIndex{\GRs}\relax
%   \SpecialMacroIndex{\GRpm}\relax
%   \SpecialMacroIndex{\At}\relax
%   \SpecialMacroIndex{\Am}\relax
%   \SpecialMacroIndex{\As}\relax
%   \SpecialMacroIndex{\Apm}\relax
%   \SpecialMacroIndex{\Nt}\relax
%   \SpecialMacroIndex{\Lt}\relax
%   \SpecialMacroIndex{\Lm}\relax
%   \SpecialMacroIndex{\Ls}\relax
%   \SpecialMacroIndex{\Lpm}\relax
%   \SpecialMacroIndex{\LEt}\relax
%   \SpecialMacroIndex{\LE}\relax
%   \SpecialMacroIndex{\LEs}\relax
%   \SpecialMacroIndex{\LEpm}\relax
%   \SpecialMacroIndex{\LRt}\relax
%   \SpecialMacroIndex{\LR}\relax
%   \SpecialMacroIndex{\LRs}\relax
%   \SpecialMacroIndex{\LRpm}\relax
%   \centering
%   \begin{minipage}{\linewidth}\renewcommand*{\footnoterule}{\vskip-1.75ex}%
%   \centering\scriptsize\setlength{\tabcolsep}{0.05in}
%   \begin{tabular}{l l l l l l l l l l l l l}
%   \toprule
%     &amp; &amp; &amp; &amp; &amp; \multicolumn{4}{c}{Excess}
%       &amp; \multicolumn{4}{c}{Residual (Departure)} \\
%   \cmidrule(r{0.5ex}){6-9}
%   \cmidrule(l{0.5ex}){10-13}
%     Property &amp; Total &amp; Molar &amp; Specific &amp; \parbox[b]{0.45in}{Partial Molar}
%     &amp; T &amp; M &amp; S &amp; PM &amp; T &amp; M &amp; S &amp; PM \\
%   \midrule
%     Heat            &amp; \cs{Qt}  &amp; \cs{Qm} &amp; \cs{Qs}  &amp; \\
%     Work            &amp; \cs{Wt}  &amp; \cs{Wm} &amp; \cs{Ws}  &amp; \\
%     Total energy    &amp; \cs{Et}  &amp; \cs{Em} &amp; \cs{Es}  &amp; \cs{Epm}
%                     &amp; \cs{EEt} &amp; \cs{EE} &amp; \cs{EEs} &amp; \cs{EEpm}
%                     &amp; \cs{ERt} &amp; \cs{ER} &amp; \cs{ERs} &amp; \cs{ERpm} \\
%     Internal energy &amp; \cs{Ut} &amp; \cs{Um} &amp; \cs{Us} &amp; \cs{Upm}
%                     &amp; \cs{UEt} &amp; \cs{UE} &amp; \cs{UEs} &amp; \cs{UEpm}
%                     &amp; \cs{URt} &amp; \cs{UR} &amp; \cs{URs} &amp; \cs{URpm} \\
%     Enthalpy        &amp; \cs{Ht} &amp; \cs{Hm} &amp; \cs{Hs} &amp; \cs{Hpm}
%                     &amp; \cs{HEt} &amp; \cs{HE} &amp; \cs{HEs} &amp; \cs{HEpm}
%                     &amp; \cs{HRt} &amp; \cs{HR} &amp; \cs{HRs} &amp; \cs{HRpm} \\
%     Entropy         &amp; \cs{St} &amp; \cs{Sm} &amp; \cs{Ss} &amp; \cs{Spm}
%                     &amp; \cs{SEt} &amp; \cs{SE} &amp; \cs{SEs} &amp; \cs{SEpm} 
%                     &amp; \cs{SRt} &amp; \cs{SR} &amp; \cs{SRs} &amp; \cs{SRpm} \\
%     Volume          &amp; \cs{Vt} &amp; \cs{Vm} &amp; \cs{Vs} &amp; \cs{Vpm}
%                     &amp; \cs{VEt} &amp; \cs{VE} &amp; \cs{VEs} &amp; \cs{VEpm}
%                     &amp; \cs{VRt} &amp; \cs{VR} &amp; \cs{VRs} &amp; \cs{VRpm} \\
%     Helmholtz free energy &amp; \cs{Ft} &amp; \cs{Fm} &amp; \cs{Fs} &amp; \cs{Fpm}
%                     &amp; \cs{FEt} &amp; \cs{FE} &amp; \cs{FEs} &amp; \cs{FEpm}
%                     &amp; \cs{FRt} &amp; \cs{FR} &amp; \cs{FRs} &amp; \cs{FRpm} \\
%     Gibbs free energy &amp; \cs{Gt} &amp; \cs{Gm} &amp; \cs{Gs} &amp; \cs{Gpm}
%                     &amp; \cs{GEt} &amp; \cs{GE} &amp; \cs{GEs} &amp; \cs{GEpm}
%                     &amp; \cs{GRt} &amp; \cs{GR} &amp; \cs{GRs} &amp; \cs{GRpm} \\
%     Surface area    &amp; \cs{At} &amp; \cs{Am} &amp; \cs{As} &amp; \cs{Apm} \\
%     Grand potential\footnote{The grand potential,
%       $\begin{thermomolesrange}\Lt(T,\Vt,\allmus)\end{thermomolesrange}
%           = \Ut - T\St - \sumall_i \mu_i \Nt_i,$
%       is also called the Landau free energy by some authors.}
%                     &amp; \cs{Lt} &amp; \cs{Lm} &amp; \cs{Ls} &amp; \cs{Lpm}
%                     &amp; \cs{LEt} &amp; \cs{LE} &amp; \cs{LEs} &amp; \cs{LEpm}
%                     &amp; \cs{LRt} &amp; \cs{LR} &amp; \cs{LRs} &amp; \cs{LRpm} \\
%     Moles           &amp; \cs{Nt} &amp; \\
%   \bottomrule
%   \end{tabular}
%   \end{minipage}
% \end{table}
%
% \begin{table}
%   \caption{Convenience macros and their default symbols.
%       These are generally ``smart'': for example,
%       \texttt{\textbackslash cP\_i} renders as $C_{P,i}$, as expected, and
%       \texttt{\textbackslash cP\_i\^{}\textbackslash std} renders as
%       $C_{P,i}^\circ$, also as expected. You can also reverse it:
%       \texttt{\textbackslash cP\^{}\textbackslash std\_i} becomes
%       $C^\circ_{P,i}$.}\relax
%   \label{table:conveniences}\relax
%^^A TODO The \leavevmode macro here is to prevent whitespace from building
%^^A      up due to a bug in old versions of hypdoc. It should be harmless to
%^^A      leave it in there, but consider removing it at some point.
%   \leavevmode
%   \SpecialMacroIndex{\cP}\relax
%   \SpecialMacroIndex{\cV}\relax
%   \SpecialMacroIndex{\kappaT}\relax
%   \SpecialMacroIndex{\kappaS}\relax
%   \SpecialMacroIndex{\alphaP}\relax
%   \SpecialMacroIndex{\alphaS}\relax
%   \SpecialMacroIndex{\muJT}\relax
%   \SpecialMacroIndex{\heatcapacitysymbol}\relax
%   \SpecialMacroIndex{\compressibilitysymbol}\relax
%   \SpecialMacroIndex{\expansivitysymbol}\relax
%   \SpecialMacroIndex{\fpure}\relax
%   \SpecialMacroIndex{\fmix}\relax
%   \SpecialMacroIndex{\fsat}\relax
%   \SpecialMacroIndex{\phipure}\relax
%   \SpecialMacroIndex{\phimix}\relax
%   \SpecialMacroIndex{\phisat}\relax
%   \SpecialMacroIndex{\actrel}\relax
%   \SpecialMacroIndex{\Psat}\relax
%   \SpecialMacroIndex{\Pvap}\relax
%   \SpecialMacroIndex{\sat}\relax
%   \SpecialMacroIndex{\std}\relax
%   \SpecialMacroIndex{\Pstd}\relax
%   \SpecialMacroIndex{\Cstd}\relax
%   \SpecialMacroIndex{\fstd}\relax
%   \SpecialMacroIndex{\mustd}\relax
%   \SpecialMacroIndex{\Henryrat}\relax
%   \SpecialMacroIndex{\Henrymol}\relax
%   \SpecialMacroIndex{\gammarat}\relax
%   \SpecialMacroIndex{\gammamol}\relax
%   \SpecialMacroIndex{\Deltamix}\relax
%   \SpecialMacroIndex{\Deltarxn}\relax
%   \SpecialMacroIndex{\Deltavap}\relax
%   \SpecialMacroIndex{\Deltasub}\relax
%   \SpecialMacroIndex{\Deltafus}\relax
%   \SpecialMacroIndex{\mixing}\relax
%   \SpecialMacroIndex{\reaction}\relax
%   \SpecialMacroIndex{\fusion}\relax
%   \SpecialMacroIndex{\vaporization}\relax
%   \SpecialMacroIndex{\sublimation}\relax
%   \SpecialMacroIndex{\Epot}\relax
%   \SpecialMacroIndex{\xrxn}\relax
%   \begin{minipage}{\linewidth}\relax
%   \footnotesize
%   \addtolength{\tabcolsep}{-2.75pt}\relax
%   \addtolength{\extrarowheight}{0.50ex}\relax
%   \renewcommand*{\footnoterule}{\vskip-1.5ex}\relax
%   \begin{tabular}{l l l l l}
%   \toprule
%   \\[-1.5\normalbaselineskip]
%     Name &amp; Macro &amp; Sym. &amp; Definition &amp; Base Symbol Macro \\
%   \midrule
%     Isobaric heat capacity &amp; \cmd\cP\footnote{\relax
%         Extensive and specific (per-unit-mass) versions are available
%         as \cs{cPt} and \cmd\cPs, respectively, with similar macros for the
%         isochoric heat capacity.\label{fn:cP}}
%     &amp; \(\cP\) &amp; \(\displaystyle T\Partial{\Sm}{T}{P}\)
%     &amp; \cmd\heatcapacitysymbol \\[1.75ex]
%     Isochoric heat capacity &amp; \verb"\cV"\footref{fn:cP} &amp; \(\cV\)
%     &amp; \(\displaystyle T\Partial{\Sm}{T}{\Vm}\)
%     &amp; \cmd\heatcapacitysymbol \\[1.75ex]
%     Isothermal compressibility &amp; \cmd\kappaT &amp; $\kappaT$
%       &amp; \(\displaystyle -\frac{1}{\Vm} \Partial{\Vm}{P}{T} \)
%       &amp; {\footnotesize\cmd\compressibilitysymbol} \\[1.75ex]
%     Isentropic compressibility &amp; \cmd\kappaS &amp; $\kappaS$
%       &amp; \(\displaystyle -\frac{1}{\Vm} \Partial{\Vm}{P}{\Sm}\)
%       &amp; {\footnotesize\cmd\compressibilitysymbol} \\[1.75ex]
%     Isobaric expansivity &amp; \cmd\alphaP &amp; $\alphaP$
%       &amp; \(\displaystyle \frac{1}{\Vm} \Partial{\Vm}{T}{P}\)
%       &amp; \cmd\expansivitysymbol \\[1.75ex]
%     Isentropic expansivity &amp; \cmd\alphaS &amp; $\alphaS$
%       &amp; \(\displaystyle \frac{1}{\Vm} \Partial{\Vm}{T}{\Sm}\)
%       &amp; \cmd\expansivitysymbol \\[1.75ex]
%     Joule--Thomson coeff. &amp; \cmd\muJT &amp; $\muJT$
%       &amp; \(\displaystyle \Partial{T}{P}{\Hm}\) &amp; \cmd\JTsymbol \\
%     Pure fugacity &amp; \cmd\fpure &amp; $f$ &amp; $\phi P$ \\
%     Saturation fugacity &amp; \cmd\fsat &amp; $\fsat$
%       &amp; $\phisat \Psat$ &amp; \cmd\sat \\
%     Mixture fugacity &amp; \cmd\fmix &amp; $\fmix$
%       &amp; $\fmix_i = x_i\phimix_i P$ \\
%     Pure fugacity coefficient &amp; \cmd\phipure &amp; $\phipure$ &amp;
%       \multicolumn{2}{l}{\( \phipure_i
%         = \exp\left(\frac{1}{RT}\int_0^P \Vm_i(T,p)
%               - \frac{RT}{p}\,dp\right) \)} \\
%     Saturation fugacity coeff.\ &amp; \cmd\phisat &amp; $\phisat$
%       &amp; $\phipure(T,\Psat)$ &amp; \cmd\sat \\
%     Mixture fugacity coeff.\ &amp; \cmd\phimix &amp; $\phimix$
%       &amp; \multicolumn{2}{l}{\( \phimix_i
%          = \exp\left(\frac{1}{RT}\int_0^P \Vpm{i}(T,p,\allXs)
%                - \frac{RT}{p}\,dp\right) \)} \\[1.25ex]
%     Absolute activity &amp; \cmd\actabs &amp; $\actabs$
%       &amp; \multicolumn{2}{l}{\(\actabs_i = \exp(\mu_i/{RT})\)} \\
%     Relative activity &amp; \cmd\actrel &amp; $\actrel$
%       &amp; \multicolumn{2}{l}{\(\actrel_i = \exp\left(\frac{\mu_i - \mu_i^\std}{RT}\right) = \frac{\fmix_i(T,P,\allXs)}{\fstd_i(T)}\)} \\
%     Henry's constant (rational) &amp; \cmd\Henryrat &amp; $\Henryrat$
%       &amp; $\gamma_i^\infty f_i$ \\
%     Henry's constant (molal) &amp; \cmd\Henrymol &amp; $\Henrymol$
%       &amp; $M_s \gamma_i^\infty f_i$ \\
%     Rational activity coeff.\ &amp; \cmd\gammarat &amp; $\gammarat$
%       &amp; $\gamma/\gamma^\infty$ \\
%     Molal activity coeff.\ &amp; \cmd\gammamol &amp; $\gammamol$
%       &amp; $x_s \gamma/\gamma^\infty$ \\
%     Saturation pressure &amp; \cmd\Psat\footnote{\cs{Pvap} is a synonym for
%         \cs{Psat}; if you want it to produce $P^\text{vap}$, you should
%         redefine the \cs{sat} macro} &amp; $\Psat$ &amp;&amp; \cmd\sat \\
%     Standard state &amp; \cmd\std\footnote{Typical usage would be
%       \texttt{\$\cs{mu}\_i = \cs{mu}\textasciicircum\cs{std}\_i
%         + RT \cs{log} a\_i\$},
%       yielding $\mu_i = \mu_i^\std + RT \log a_i$.} &amp; $\std$ \\
%     Standard pressure &amp; \cmd\Pstd &amp; $\Pstd$ &amp; &amp; \cs{std} \\
%     Standard molality &amp; \cmd\Cstd &amp; $\Cstd$ &amp; &amp; \cs{std} \\
%     Standard fugacity &amp; \cmd\fstd &amp; $\fstd$
%           &amp; $\fstd_i = \fpure_i(T,\Pstd,x^\std)$ &amp; \cs{std} \\
%     Standard chemical potential &amp; \cmd\mustd &amp; $\mustd$
%           &amp; $\mustd_i = \mu(T,\Pstd,x^\std)$ &amp; \cs{std} \\
%     Change on mixing &amp; \cmd\Deltamix\footnote{The usual usage would be
%         something like
%         \texttt{\$\cs{Deltamix}\cs{Vm}\textasciicircum\cs{IGM} = 0\$}.\relax
%       \label{fn:Deltausage}}
%       &amp; $\Delta M$\textsubscript{mix}
%       &amp; $M - \sumall_i x_i M_i$ &amp; \cmd\mixing \\
%     Change on reaction &amp; \cmd\Deltarxn\footref{fn:Deltausage}
%       &amp; $\Deltarxn M$
%       &amp; $\sumall_i \nu_i M_i$ &amp; \cmd\reaction \\
%     Change on melting &amp; \cmd\Deltafus\footref{fn:Deltausage}
%       &amp; $\Deltafus M$ &amp; $M^L - M^S$ &amp; \cmd\fusion \\
%     Change on boiling &amp; \cmd\Deltavap\footref{fn:Deltausage}
%       &amp; $\Deltavap M$ &amp; $M^V - M^L$ &amp; \cmd\vaporization \\
%     Change on subliming &amp; \cmd\Deltasub\footref{fn:Deltausage}
%       &amp; $\Deltasub M$ &amp; $M^V - M^S$ &amp; \cmd\sublimation \\
%     Electric potential &amp; \cmd\Epot &amp; $\Epot$
%       &amp; $-n_e\mathscr{F}\Deltarxn\Gm$ \\
%     Extent of reaction &amp; \cmd\xrxn &amp; $\xrxn$ &amp; &amp; \\
%   \bottomrule
%   \end{tabular}
%   \end{minipage}
% \end{table}
%
% \subsection{Partial Molar Properties}
% \DescribeMacro{\Upm}
% \DescribeMacro{\Vpm}
% Partial molar quantities are defined with the suffix \verb"pm".
% For example, \cs{Upm} refers to the partial molar internal energy. There
% are two options for how to enter partial molar quantities: as commands or
% as super/subscripts. For example,
% \begin{verbatim}
%  \[ \Upm{i} \quad \Upm[\IG]{i} \quad \Vpm_i \quad \Vpm^\IG_i \]
%\end{verbatim}
% will typeset as
% \[ \Upm{i} \quad \Upm[\text{IG}]{i} \quad \Vpm{i} \quad \Vpm^{\text{IG}}_i.\]
% There are also partial molar heat capacities available via the macros
%  \cs{cPpm} and \cs{cVpm}.
% \textbf{Important}: The \tn{text} command defined by the \pkg{amstext}
% package is usually robust enough that something like \verb"\Um^\text{L}" will
% work as expected, without additional braces. This does \emph{not} work for
% partial molar properties; for example, \verb"\Hpm^\text{L}_i" will produce an
% error, as will \verb"\Hpm_i^\text{L}". The expression
% \verb"\Hpm_i^{\text{L}}" will work as expected.
%
% \DescribeMacro{\partialmolar}
% New partial molar properties can be defined for any ``simple'' symbol using
% the \cs{partialmolar} macro. ``Simple'' means it has no subscripts or
% superscripts. For example, the macro for the partial molar Gibbs free energy
% is effectively defined via the macro
% \DescribeMacro{\Gpm}
% \begin{verbatim}
%   \NewDocumentCommand{\Gpm}{}{\partialmolar{G}}.
%\end{verbatim}
% A list of pre-defined macros for total, molar, specific, and partial molar
% quantities commonly used in thermodynamics is included in
% Table~\ref{table:symbols}.
%
% \subsection{Defining New Properties}
% \DescribeMacro{\NewExtensiveProperty}
% Users can create new properties using a family of commands. Typically, a
% user would want to define at least the total, molar, and specific properties,
% which can be accomplished by the \cs{NewExtensiveProperty} command.
% For example,
% \begin{verbatim}
%  \NewExtensiveProperty{J}{K}
%\end{verbatim}
% \NewExtensiveProperty{J}{K}\relax
% would define the commands \cs{Jt}, \cs{Jm}, and \cs{Js}, which would produce
% (using the default package options) the symbols $\Jt$, $K$, and $\hat{K}$,
% respectively.
%
% \DescribeMacro{\NewPartialMolarProperty}%
% Partial molar properties can be created either with the \cs{partialmolar}
% macro directly as described above or with \cs{NewPartialMolarProperty}, which
% has the same argument style as \cs{NewExtensiveProperty}.
%
% \DescribeMacro{\NewExcessProperty}%
% \DescribeMacro{\NewResidualProperty}%
% Similarly, one can define commands for the total, molar, and specific excess
% properties using \cs{NewExcessProperty} in a similar manner, and similar
% commands for the residual properties with \cs{NewResidualProperty}.
%
% \setmarginparsize{\footnotesize}
% \DescribeMacro{\NewThermodynamicProperty}\relax
% \restoremarginparsize
% \NewThermodynamicProperty{B}{B}\relax
% \NewExtensiveProperty{M}{M}\relax
% It is common that a user wants the total, molar, specific, and partial molar
% commands for a new symbol, as well as excess and residual (departure)
% properties for each case.  Users can define such properties---common examples
% are $\Bt$ and $\Mt$ to represent uncommon or arbitrary properties---by using
% \cs{NewThermodynamicProperty}, which calls all four of the aforementioned
% declarations on the same command/\allowbreak{}symbol combinations. For
% example,
% \begin{verbatim}
%  \NewThermodynamicProperty{B}{B}
%\end{verbatim}
% defines the commands \cs{Bt}, \cs{Bm}, \cs{Bs}, and \cs{Bpm}, which define
% the total, molar, specific, and partial molar properties, respectively.
% It also defines \cs{BEt}, \cs{BE}, \cs{BEs}, and \cs{BEpm} for the
% corresponding excess properties, and \cs{BRt}, \cs{BR}, \cs{BRs}, and
% \cs{BRpm} for residual (departure) properties. These produce, respectively,
% $\Bt, \Bm, \Bs, \Bpm{i}, \BEt, \BE, \BEs, \BEpm{i}, \BRt, \BR, \BRs,$ and
% $\BRpm{i}$ using the defaults.
%
% \subsection{Other Predefined Symbols and Modifiers}
% There are a number of predefined symbols and modifiers.
% While these symbols could be defined or used without these macros, such use
% is not recommended: changing package options will result in inconsistencies
% if these macros are not used.
%
% \subsubsection{Heat Capacities, Compressibilities, and Expansivities}
% \DescribeMacro{\cP}
% \DescribeMacro{\cV}
% \DescribeMacro{\kappaS}
% \DescribeMacro{\kappaT}
% \DescribeMacro{\alphaP}
% \DescribeMacro{\alphaS}
% The isobaric and isochoric heat capacities are produced with \cs{cP} and
% \cs{cV}, respectively. Four other measurable quantities are defined: the
% isothermal and isentropic compressibilities, \cs{kappaT} and \cs{kappaS},
% respectively; and the isobaric and isentropic volume expansivities,
% \cs{alphaP} and \cs{alphaS}, respectively. Some textbooks use $\beta$ instead
% of $\alpha$ for the volume expansivity to differentiate it from the
% \emph{linear} expansivity; this can be changed by redefining
% \cs{expansivitysymbol}, which is done automatically by some of the
% package options that create notation specific to a particular textbook.
%
% \subsubsection{Joule--Thomson Coefficient}
% \changes{v2.00}{2023/11/16}{Added \cs{muJT} to represent Joule--Thomson
%   coefficients (which have different notation across textbooks).}
% \DescribeMacro{\muJT}
% The Joule--Thomson coefficient is produced with \cs{muJT}, which by default
% is rendered $\muJT$. Some books call this coefficient $\alpha_H$; this is
% handled automatically for books of which the package author is aware.
%
% \subsubsection{Chemical Potentials}
% \DescribeMacro{\mu}
% \DescribeMacro{\muit}
% The chemical potential is always produced by the macro \cs{mu}. Some
% textbook-related options use \(\muup\) instead of \(\mu\) for chemical
% potential; if so, the macro \cs{muit} will always produce \(\muit\).
%
% \subsubsection{Fugacities and Fugacity Coefficients}
% \DescribeMacro{\fpure}
% \DescribeMacro{\fmix}
% \DescribeMacro{\phipure}
% \DescribeMacro{\phimix}
% Different textbooks use different variations on the symbol $f$ for
% fugacity, so it is recommended to use the macro \cs{fpure} to denote the
% pure-component fugacity and \cs{fmix} to denote the mixture fugacity.
% Similarly, the pure-component fugacity coefficient should be generated with
% \cs{phipure}, and that in a mixture should be \cs{phimix}.
%
% For example, the following markup is an example of a common equation in
% mixture thermodynamics:
% \begin{verbatim}
%   \[ \fmix_j = x_j \phimix_j P = x_j \gamma_j \fpure_j
%              = x_j \gamma_j \phipure_j P. \]
%\end{verbatim}
% With the default package options, this produces
%   \[ \fmix_j = x_j \phimix_j P = x_j \gamma_j \fpure_j
%       = x_j \gamma_j \phipure_j P. \]
% With the |Thompson| package option, however, the same markup produces
%   \[ \hat f_j = x_j \hat\phi_j P = x_j \gamma_j f^\bullet_j
%       = x_j \gamma_j \phi^\bullet_j P. \]
% Similarly, the |Prausnitz| package option causes it to generate
%   \[ f_j = x_j \phi_j P = x_j \gamma_j f_{\text{pure},j}
%          = x_j \gamma_j \phi_{\text{pure},j} P, \]
% and the |Sandler| option causes it to generate
%   \[ \bar f_j = x_j \bar \phi_j P = x_j \gamma_j f_j
%          = x_j \gamma_j \phi_j  P. \]
%
% \subsubsection{Activity Coefficients and Henry's Constants}
% \DescribeMacro{\gamma}
% \DescribeMacro{\gammait}
% \DescribeMacro{\gammarat}
% \DescribeMacro{\gammamol}
% \DescribeMacro{\Henryrat}
% \DescribeMacro{\Henrymol}
% The activity coefficient based on the Lewis--Randall rule can be generated
% with \cs{gamma}, as usual. The symbol \cs{gammait} is provided just in case
% \cs{gamma} has been redefined by a package option and you want to use the
% original symbol for some reason. The Henry's Law activity coefficients should
% be produced with \cs{gammarat} (rational basis) and \cs{gammamol} (molal
% basis).  There are also macros to generate the Henry's law constants for both
% the rational basis (\cs{Henryrat}) and the molal basis (\cs{Henrymol}).
% These are interrelated:
% \begin{verbatim}
% \[ \fmix_i = x_i \gamma_i \fpure_i = x_i \gammarat_i \Henryrat_i
%            = C_i \gammamol_i \Henrymol_i \]
%\end{verbatim}
% produces
% \[ \fmix_i = x_i \gamma_i \fpure_i = x_i \gammarat_i \Henryrat_i
%            = C_i \gammamol_i \Henrymol_i \]
% using the default options.
% These symbols can be customized either directly or by using package options.
% For example, the |TesterModell| package option changes the equation
% above to
% \[ \hat f_i = x_i \gamma_i f_i = x_i \gamma_i^{**} f_i^{**}
%   = C_i \gamma_i^* f_i^* \]
% without any changes in markup.
%
% Note that some books (e.g., |ElliottLira|) prefer the atmospheric chemistry
% convention for the molal basis, namely
% \[ \fmix_i = x_i \gamma_i \fpure_i = x_i \gammarat_i \Henryrat_i
%            = C_i \gammamol_i / K_{H,i} \]
% (that is, using $1/K_{H,i}$ in place of $\Henrymol_i$).
% Unfortunately, this makes it impossible to change symbols without any edits
% to markup, so this convention is \emph{not} supported by this package.
%
% \subsubsection{Saturation Properties}
% \DescribeMacro{\Psat}
% \DescribeMacro{\Pvap}
% \DescribeMacro{\fsat}
% \DescribeMacro{\phisat}
% The saturation pressure is generated with \cs{Psat}. The macro \cs{Pvap} is
% an alias for \cs{Psat}. The fugacity and fugacity coefficient at saturation
% are accessed via \cs{fsat} and \cs{phisat}, respectively. Package options
% can be used to change some of these to match the notation of specific
% textbooks.
%
% \DescribeMacro{\sat}
% The \cs{sat} macro is used ``behind the scenes'' as part of
% \cs{Psat}, \cs{fsat}, and \cs{phisat}, which produce $\Psat$,
% $\fsat$, and $\phisat$, respectively (using the defaults). If you wanted to
% redefine them to be $P^\text{vap}$, $f^\text{vap}$, and $\phi^\text{vap}$,
% you could simply redefine \cs{sat} with
% \verb"\RenewDocumentCommand{\sat}{}{{\text{vap}}}".
% This is done automatically using package option |Sandler|.
%
% \subsubsection{Standard States and Chemical Reactions}
% \DescribeMacro{\std}
% \DescribeMacro{\Pstd}
% \DescribeMacro{\Cstd}
% \DescribeMacro{\fstd}
% \DescribeMacro{\mustd}
% The symbol $\circ$ (\cs{circ}) is used by default for standard states.
% This is intended to be easy to change should the user want to replace
% $P^\circ$ with $P^\ominus$, say. This is accessed via the \cs{std} macro.
% The macro \cs{Pstd} is defined as |P^\std| for convenience to denote
% standard pressure, \cs{Cstd} is defined as |C^\std| to denote standard
% molality, \cs{fstd} is defined for standard fugacities, and \cs{mustd} is
% defined for standard chemical potentials so as to ease implementation across
% textbooks.
%
% The usual usage would be something like this:
% \begin{verbatim}
% \[ \Deltarxn\Gm = \sumall_i \nu_i \mu_i = \sumall_i \left[ \nu_i \mustd_i
%    + \nu_i RT \log\left(\frac{\fmix_i}{\fstd_i}\right) \right]
%    = \Deltarxn\Gm^\std + RT \log\left[\prodall_i a_i^{\nu_i} \right] \],
%\end{verbatim}
% which produces
% \[ \Deltarxn\Gm = \sumall_i \nu_i \mu_i = \sumall_i \left[ \nu_i \mustd_i
%    + \nu_i RT \log\left(\frac{\fmix_i}{\fstd_i}\right) \right]
%    = \Deltarxn\Gm^\std + RT \log\left[\prodall_i a_i^{\nu_i} \right] \]
% with the default settings.
%
% The extent of reaction is generated by the macro \cs{xrxn}, which by default
% is printed as \(\xrxn\).
%
% \subsubsection{Changes on Mixing, Reaction, Fusion, Vaporization, and
%   Sublimation}
% \DescribeMacro{\Deltamix}
% Mixing properties are handled via the \cs{Deltamix} macro, and are used as in
% the following example:
% \begin{verbatim}
% \[ \Deltamix\Gm = \Gm - \sumall_i x_i \Gm_i
%                 = \Deltamix\Hm - T\Deltamix\Sm \],
%\end{verbatim}
% which yields, using the default options,
% \[ \Deltamix\Gm = \Gm - \sumall_i x_i \Gm_i = \Deltamix\Hm - T\Deltamix\Sm \]
% Some textbooks (|Sandler|, |Thompson|) choose to typeset these with the word
% ``mix'' \emph{before} the symbol, which is handled automatically by this
% package.
% \DescribeMacro{\mixing}
% The macro \cs{mixing} determines how the change in mixing label is rendered;
% the default is \verb"{\text{mix}}".
%
% \DescribeMacro{\Deltafus}
% \DescribeMacro{\Deltasub}
% \DescribeMacro{\Deltavap}
% The commands \cs{Deltafus}, \cs{Deltasub}, and \cs{Deltavap}
% typeset changes due to fusion (melting), sublimation (subliming), and
% vaporization (boiling), respectively. Their use is straightforward, viz.,
% \begin{verbatim}
%  \[ \Deltasub\Hm = \Hm^V - \Hm^S = \Hm^V - \Hm^L + (\Hm^L - \Hm^S)
%                  = \Deltafus\Hm + \Deltavap\Hm \],
%\end{verbatim}
% yielding
%  \[ \Deltasub\Hm = \Hm^V - \Hm^S = \Hm^V - \Hm^L + (\Hm^L - \Hm^S)
%                  = \Deltafus\Hm + \Deltavap\Hm \]
% with the default options. Note that some textbooks (e.g., |Sandler|) typeset
% these quantities quite differently; this is handled automatically. Other
% textbooks (e.g., |Koretsky|) typeset them as subscripts; this is also
% handled automatically.
%
% \DescribeMacro{\Deltaf}
% \DescribeMacro{\Deltarxn}
% The macros \cs{Deltaf} and \cs{Deltarxn} are intended to typeset the enthalpy
% or free energy of formation and reaction, respectively. For example,
% \begin{verbatim}
%  \[ \Deltarxn\Hm^\std = \sumall_i \nu_i \Deltaf\Hm_i^\std \]
%\end{verbatim}
% results in
% \[ \Deltarxn\Hm^\std = \sumall_i \nu_i \Deltaf\Hm_i^\std. \]
% It is not anticipated that this command will be combined with something like
% a heat capacity, which already has a (potentially double) subscript, but as
% there is no ``formation'' heat capacity, that should not present a problem.
%
% \subsection{Residual and Excess Properties}
% \DescribeMacro{\UR}
% \DescribeMacro{\URt}
% \DescribeMacro{\URs}
% \DescribeMacro{\URpm}
% \DescribeMacro{\UE}
% \DescribeMacro{\UEt}
% \DescribeMacro{\UEs}
% \DescribeMacro{\UEpm}
% Additional macros are defined that make it easy to typeset the residual
% (also called ``departure'') and excess total, molar, specific, and partial
% molar properties. These macros follow the same pattern: \cs{UR}, \cs{URt},
% \cs{URs}, and \cs{URpm} typeset the molar, total, specific, and partial molar
% residual internal energies, respectively, and by default expand to $U^R,$
% $\URt,$ $\URs, $ and $\smash[t]{\URpm{i}}$ (the last
% is called as \verb"\URpm{i}" or \verb"\URpm_i"). Similarly, \cs{UE},
% \cs{UEt}, \cs{UEs}, and \cs{UEpm} typeset the corresponding excess
% properties. The first character of the macros for other properties follow the
% same pattern as in Table~\ref{table:symbols}.
%
% The $R$ and $E$ characters are generated by the macros \cs{residual} and
% \cs{excess}, respectively. These macros can be redefined; for example, if you
% \DescribeMacro{\excess}
% \DescribeMacro{\residual}
% want \cs{SE}, which normally produces $\SE$, to give you $S^{EX}$---and let's
% be honest, who doesn't want that?\footnote{You knew that joke was
% coming.}---then you can redefine it with
% \begin{verbatim}
%   \RenewDocumentCommand{\excess}{}{{EX}},
%\end{verbatim}
% or possibly
% \begin{verbatim}
%   \RenewDocumentCommand{\excess}{}{{\mathrm{EX}}}
%\end{verbatim}
% or even
% \begin{verbatim}
%   \RenewDocumentCommand{\excess}{}{\text{EX}},
%\end{verbatim}
% which cause \cs{SE} to expand to $S^{EX},$ $S^\mathrm{EX},$ and
% $S^\text{EX},$ respectively.
%
% It is generally possible to use superscripts with the excess or residual
% properties; in the event this fails, the \cs{excess} and \cs{residual} macros
% can be used directly, viz.,
% \begin{verbatim}
%   \begin{gather*}
%     \HE^\std = \Hm^{\excess,\std} = \HE(T,\Pstd)
%       = \HR(T,\Pstd) - \HR^\IS(T,\Pstd) = \HR^\std - \HR^{\IS,\std} \\
%   \RenewDocumentCommand{\excess}{{EX}}
%     \HE^\std = \Hm^{\excess,\std} = \HE(T,\Pstd)
%       = \HR(T,\Pstd) - \HR^\IS(T,\Pstd)
%   \end{gather*},
%\end{verbatim}
% which yields
% \begin{gather*}
%     \HE^\std = \Hm^{\excess,\std} = \HE(T,\Pstd)
%       = \HR(T,\Pstd) - \HR^\IS(T,\Pstd) = \HR^\std - \HR^{\IS,\std} \\
%   \RenewDocumentCommand{\excess}{}{{EX}}
%     \HE^\std = \Hm^{\excess,\std} = \HE(T,\Pstd)
%       = \HR(T,\Pstd) - \HR^\IS(T,\Pstd)
% \end{gather*}
% using the default options.
%
% \subsection{Partial Derivatives}
% \DescribeMacro{\Partial}%
% \DescribeMacro{\Partial*}%
% Partial derivatives are easily rendered using the \cs{Partial} command.
% There is a starred form (\cs{Partial*}) that additionally adjusts the
% spacing after the closing symbol to remove some of the space, anticipating
% that the following binary operator will overhang the subscripts.
% Compare the following:
% \begin{verbatim}
%  \[ \Partial{\Hm}{T}{P} = \cP \qquad \Partial*{\Hm}{T}{P} = \cP \],
%\end{verbatim}
% which yields
%  \[ \Partial{\Hm}{T}{P} = \cP \qquad \Partial*{\Hm}{T}{P} = \cP. \]
%
% \DescribeMacro{\Partialinline}%
% Inline first derivatives\footnote{The ``inline'' versions of
%   partial derivatives are ``sticky'': if you issue \cs{Partialinline} or
%   its second-order equivalents anywhere in a line, all subsequent
%   \cs{Partial} and \cs{Partial[Mix]Second} macros on the same line
%    (technically, anywhere in the same \TeX\ ``group'') will
%   expand inline as well. To prevent this, enclose your \cs{Partialinline} and
%   associated arguments in its own group (i.e.,
%   \texttt{\{\cs{Partialinline}\dots\}}).%
%   \label{fn:inline}}
% can be entered the same way; compare:
% \begin{verbatim}
%  \[ \Partial*{\Hm}{T}{P} = \Partialinline{\Hm}{T}{P}
%       = T\Partial{\Sm}{T}{P} \],
%\end{verbatim}
% which results in
%   \[ \Partial*{\Hm}{T}{P} = \Partialinline{\Hm}{T}{P}
%       = T\Partial{\Sm}{T}{P}. \]
% There is no need for an inline starred form, as the subscripts do not
% extend far enough below the baseline.
%
% \subsubsection{Second-Order Partial Derivatives}
% \DescribeMacro{\PartialSecond}%
% \DescribeMacro{\PartialSecond*}%
% \DescribeMacro{\PartialMixSecond}%
% \DescribeMacro{\PartialMixSecond*}%
% Second partial derivatives and mixed-second partial derivatives are typeset
% with the commands \cs{PartialSecond} and \cs{PartialMixSecond}, respectively.
% Like the first-order variety, these also have starred versions that remove
% the space immediately following the closing symbols, anticipating that the
% equals sign or other binary operator following the derivative will overhang
% the elements held constant. For example,
% \begin{verbatim}
%   \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%             = \PartialMixSecond*{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
%             = \PartialMixSecond*{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
%             = \Partial{\Gpm_i}{P}{T,\allNs} \]
%\end{verbatim}
% looks like
%   \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%             = \PartialMixSecond*{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
%             = \PartialMixSecond*{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
%             = \Partial{\Gpm_i}{P}{T,\allNs}. \]
% \DescribeMacro{\PartialSecondinline}%
% \DescribeMacro{\PartialMixSecondinline}%
% Inline versions\footref{fn:inline} of second-order derivatives are handled
% with \cs{PartialSecondinline} and \cs{PartialMixSecondinline}, viz.,
% \begin{verbatim}
% \begin{equation}
%   \Vpm_i = \Partialinline{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%          = \PartialMixSecondinline{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
%          = \PartialMixSecondinline{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
%          = \Partialinline{\Gpm_i}{P}{T,\allNs} \]
% \end{equation}
%\end{verbatim}
% looks like
% \begin{equation}
%     \Vpm_i = \Partialinline{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%            = \PartialMixSecondinline{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
%            = \PartialMixSecondinline{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
%            = \Partialinline{\Gpm_i}{P}{T,\allNs}
%   \label{eq:Vpm-inline}
% \end{equation}
% with the default options.
% \pagebreak[0]%
%
% \subsubsection{Delimiter Sizing}
% \DescribeMacro{\PartialBigg}%
% \DescribeMacro{\PartialSecondBigg}%
% \DescribeMacro{\PartialMixSecondBigg}%
% \DescribeMacro{\Partialbigg}%
% \DescribeMacro{\PartialSecondbigg}%
% \DescribeMacro{\PartialMixSecondbigg}%
% There are instances (such as the line above) when \cs{Partial} causes
% parentheses that are slightly
% too tall but do not need to be---particularly when partial molar properties,
% specific quantities, or fugacities are involved. The macro \cs{PartialBigg}
% uses \pkg{amsmath}'s \tn{Biggl} and \tn{Biggr} macros in place of \tn{left}
% and \tn{right} to size the delimiters accordingly; \cs{Partialbigg} uses
% \tn{biggl} and \tn{biggr} in a similar fashion. For example, compare the
% following:
% \begin{verbatim}
%  \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%            = \Partial*{\Gpm_i}{P}{T,\allNs}
%            = \PartialBigg*{\Gpm_i}{P}{T,\allNs}
%            = RT\Partial*{\log\fmix_i}{P}{T,\allNs}
%            = RT\PartialBigg*{\log\fmix_i}{P}{T,\allNs}
%            = RT\Partialbigg{\log\fmix_i}{P}{T,\allNs} \],
%\end{verbatim}
% which typesets as
%  \[ \Vpm{i} = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%            = \Partial*{\Gpm{i}}{P}{T,\allNs}
%            = \PartialBigg*{\Gpm{i}}{P}{T,\allNs}
%            = RT\Partial*{\log\fmix_i}{P}{T,\allNs}
%            = RT\PartialBigg*{\log\fmix_i}{P}{T,\allNs}
%            = RT\Partialbigg{\log\fmix_i}{P}{T,\allNs}. \]
% Note that a similar effect---possibly with other side effects---can be
% achieved with \pkg{amsmath}'s \tn{smash} command, which has the effect of
% removing all vertical space associated with a particular character.
% Observe:
% \begin{verbatim}
%  \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%            = \Partial{\smash{\Gpm_i}}{P}{T,\allNs} \]
%\end{verbatim}
% produces
%  \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%            = \Partial{\smash{\Gpm_i}}{P}{T,\allNs}. \]
%
% \setmarginparsize{\footnotesize}%
% \DescribeMacro{\Partialinlinetext}%
% \DescribeMacro{\PartialSecondinlinetext}%
% \restoremarginparsize
% \setmarginparsize{\scriptsize}
% \DescribeMacro{\PartialMixSecondinlinetext}%
% \restoremarginparsize
% Similarly, there are times when \cs{Partialinline} causes parentheses that
% are too big for inline text, and they do not need to be---particularly for
% symbols with overlines, underlines, or other decorations. In this case, the
% macros \cs{Partialinlinetext}, \cs{PartialSecondinlinetext}, and
% \cs{PartialMixSecondinlinetext} come in handy; using these macros like so,
% \begin{verbatim}
% \[ \Vpm_i = \Partialinlinetext{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%           = \PartialMixSecondinlinetext{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
%           = \PartialMixSecondinlinetext{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
%           = \Partialinlinetext{\Gpm_i}{P}{T,\allNs} \],
%\end{verbatim}
% Equation~\eqref{eq:Vpm-inline} looks like
% \[ \Vpm{i} = \Partialinlinetext{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
%           = \PartialMixSecondinlinetext{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
%           = \PartialMixSecondinlinetext{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
%           = \Partialinlinetext{\Gpm{i}}{P}{T,\allNs}. \]
%
% \subsubsection{Higher-Order Derivatives}
% It is possible to ``fake'' higher-order derivatives via some trickery.
% For example,
% \begin{verbatim}
% \[ \cPpm_i = T\Partial*{\Spm_i}{T}{P,\allXs}
%            = T\PartialMixSecond*{\St}{T}{\Nt_i}{P,\allNsbut{i}}
%            = -T\Partial{^3\Gt}{T^2\partial\Nt_i}{P,\allNsbut{i}} \]
%\end{verbatim}
% gives
% \[ \cPpm{i} = T\Partial*{\Spm{i}}{T}{P,\allXs}
%             = T\PartialMixSecond*{\St}{T}{\Nt_i}{P,\allNsbut{i}}
%             = -T\Partial{^3\Gt}{T^2\partial\Nt_i}{P,\allNsbut{i}}, \]
% which is probably pretty close to what you wanted. Using this trickery with
% the package option \verb"nosubscripts" will not work, and the use of
% third- and higher-order derivatives with this package should generally be
% considered unsupported.
%
% \subsection{Holding Constant the Number of Moles of Several Species}
% \DescribeMacro{\allNs}%
% \DescribeMacro{\allNsbut}%
% \DescribeMacro{\allmus}%
% \DescribeMacro{\allmusbut}%
% \DescribeMacro{\allXs}%
% \DescribeMacro{\allXsbut}%
% \DescribeMacro{\allYs}%
% \DescribeMacro{\allYsbut}%
% \DescribeMacro{\allMs}%
% \DescribeMacro{\allMsbut}%
% \DescribeMacro{\allWs}%
% \DescribeMacro{\allWsbut}%
% It is common in thermodynamics to use notation such as
% \[ \Vpm_k = \Partial{\Vt}{\Nt_k}{T,P,\allNsbut{k}}, \]
% or perhaps
% \begin{thermomolesrange}
% \[ \Vpm{k} = \Partial{\Vt}{\Nt_k}{T,P,\allNsbut{k}} \]
% \end{thermomolesrange}
% or
% \[ \Vpm{k} = \left(\frac{\partial\Vt}{\partial\Nt_k}\right)_{T,P,\Nt_j[k]}, \]
% to mean partial derivatives that hold the number of moles of each species
% constant \emph{except} the one being changed.
% Similarly, a property determined with all mole fractions held
% constant might be written
% \[ \cP = \Partial{\Hm}{T}{P,\allXs}, \]
% or perhaps
% \begin{thermomolesrange}\relax
% \[ \cP = \Partial{\Hm}{T}{P,\allXs}. \]
% \end{thermomolesrange}\relax
% There are several macros that standardize such constructs.
% The \cs{allNs} macro expands to something meaning the number of moles of all
% species; by default, this is $\vec{n}$ (package option
% \verb"moles-index"), but can be changed to $n_1,\dotsc,n_C$ using the package
% option \verb"moles-range". Similarly, the macros \cs{allmus} and
% \cs{allmusbut} do the same but with $n$ replaced by $\mu$, and \cs{allMsbut}
% is the same with $m$ instead of $n$. There are analogous macros for mole
% fractions, namely \cs{allXs} and \cs{allXsbut} for $x$ and \cs{allYs} and
% \cs{allYsbut} for $y$, as well as \cs{allWs} and \cs{allWsbut} for mass
% fractions---these implicitly assume that all mole or mass fractions
% \emph{except} the last are used as variables.
% These macros all take an optional argument; for example,
% \begin{verbatim}
% \[ \Partial{\Ht}{\Nt_1}{T,P,\allNsbut{1}} =
%    \Partial{\Ht}{\Nt_1}{T,P,\allNsbut[m]{1}} = \Hpm_1 \]
%\end{verbatim}
% typesets as
% \[ \Partial{\Ht}{\Nt_1}{T,P,\allNsbut{1}} =
%    \Partial{\Ht}{\Nt_1}{T,P,\allNsbut[m]{1}} = \Hpm{1}. \]
% Similarly,
% \begin{verbatim}
% \[ \Partial{\Hm}{x_i}{T,P,\allXsbut{i}}
%   = \Partial{\Hm}{x_i}{T,P,\allXsbut[m]{i}}
%   = \Hpm_i - \Hpm_\ncomponents \]
%\end{verbatim}
% becomes
% \[ \Partial{\Hm}{x_i}{T,P,\allXsbut{i}}
%  = \Partial{\Hm}{x_i}{T,P,\allXsbut[m]{i}}
%  = \Hpm{i} - \Hpm{\ncomponents}. \]
% Users must supply their own redefinitions if they wish to hold something
% other than \cs{ncomponents} constant in addition to the argument for mole
% and mass fractions.
% Using the \verb"moles-range" package option, for which \verb"\allXsbut{k}"
% expands to
% \( \begin{thermomolesrange}\allXsbut{k}\end{thermomolesrange} \)
% rather than \( \allXsbut{k} \), the optional argument is ignored.
%
% The optional argument to \cs{allNs} and similar commands is ignored when
% using the default options; it is relevant for package options that redefine
% \cs{allNs} to make $N_i$, for example; in this case, one can enter
% \cs{allNs[j]} to make \TeX\ render $N_j$ instead of $N_i$. This is useful
% if you are using $i$ somewhere else in the equation.
%
% \DescribeMacro{\allbut}
% \DescribeMacro{\allbutlastand}
% Users can define new ``all but'' macros using the \cs{allbut} and
% \cs{allbutlastand} commands. For example,
% \begin{verbatim}
%   \NewDocumentCommand{\allNsbut}{O{j} m}{\allbut[#1]{#2}{\Nt}}
%   \NewDocumentCommand{\allXsbut}{O{j} m}{\allbutlastand[#1]{#2}{x}}
%\end{verbatim}
% are the definitions of \cs{allNsbut} and \cs{allXsbut}, respectively.
%
% \subsection{Jacobians}
% \DescribeMacro{\Jacobian}%
% \DescribeMacro{\Jacobiandet}%
% The Jacobian determinant is often denoted with Leibnitz-like notation, viz.,
% \begin{verbatim}
% \[ \Jacobian{K,L}{X,Y} = \Jacobiandet{K,L}{X,Y} \],
%\end{verbatim}
% which produces (assuming the \pkg{amsmath} package has been loaded)
% \[ \Jacobian{K,L}{X,Y} = \Jacobiandet{K,L}{X,Y}. \]
% There are two optional arguments to \cs{Jacobiandet}. The first will be
% pre-pended before every element of the matrix (typically \cs{textstyle} or
% \cs{displaystyle}); the second is the extra spacing added between rows
% (default is 1.25~ex for text-style fractions and 2.75~ex for display-style
% fractions).  More than two variables can be specified, viz.,
% \begin{verbatim}
% \[ \Jacobian{K,L,M}{X,Y,Z}
%   = \Jacobiandet[\displaystyle][3ex]{K,L,M}{X,Y,Z} \]
%\end{verbatim}
% will produce
% \[ \Jacobian{K,L,M}{X,Y,Z} = \Jacobiandet[\displaystyle][3ex]{K,L,M}{X,Y,Z}.
% \]
% The \cs{Jacobiandet} macro will understand implied multicomponent Jacobians,
% too, namely,
% \begin{verbatim}
% \[ \Jacobian{f_1,\dots,f_m}{x_1,\dots,x_m} =
%    \Jacobiandet{f_1,\dots,f_m}{x_1,\dots,x_m} \]
%\end{verbatim}
% typesets as
% \[ \Jacobian{f_1,\dots,f_m}{x_1,\dots,x_m} =
%    \Jacobiandet{f_1,\dots,f_m}{x_1,\dots,x_m}. \]
% If the option |moles-range| or the \env{thermomolesrange} environment is
% used, the same code produces
% \begin{thermomolesrange}
% \[ \Jacobian{f_1,\dots,f_m}{x_1,\dots,x_m} =
%    \Jacobiandet{f_1,\dots,f_m}{x_1,\dots,x_m}. \]
% \end{thermomolesrange}
%
% \subsection{Sums and Products}
% \DescribeMacro{\sumall}
% \DescribeMacro{\sumallbutlast}
% \DescribeMacro{\prodall}
% It is common to require sums and products such as
% \[ \sumall_i x_i = 1 \quad \text{or} \quad
%    x_\ncomponents = 1 - \sumallbutlast_i x_i \quad \text{or} \quad
%    \Gt = \sumall_j \mu_j\Nt_j \quad \text{and} \quad
%    K = \prodall_k a_k^{\nu_k}. \]
% This package defines shortcuts to typeset such terms thus:
% \begin{verbatim}
% \[ \sumall_i x_i = 1 \quad \text{or} \quad
%    x_\ncomponents = 1 - \sumallbutlast_i x_i \quad \text{or} \quad
%    \Gt = \sumall_j \mu_j\Nt_j \quad \text{and} \quad
%    K = \prodall_k a_k^{\nu_k} \].
%\end{verbatim}
% The symbol $C$ can be changed by redefining the expandable macro
% \cs{ncomponents}. This is done automatically by some package options (e.g.,
% |TesterModell| changes it to $n$; |Sandler| changes it to $\mathcal{C}$;
% |Thompson| changes it to $c$).
%
% \section{Loading the Package} \label{sec:loading}
% To load the package with the defaults enabled, load it the usual way:
% \begin{verbatim}
%   \usepackage{thermodynamics}
%\end{verbatim}
% The package options loaded by default are \verb"EUAGHan", \verb"subscripts",
% \verb"parentheses", \verb"intensive-plain", and \verb"moles-index".
% These define, respectively, the default symbols to use for total energy,
% internal energy, Helmholtz free energy, and so forth; the manner of writing
% partial derivatives; the delimiters around partial derivatives; the
% manner of denoting extensive, molar, and specific properties; and the
% manner of writing the number of moles of all or most species in partial
% derivatives. The default behavior can be altered by options in the following
% section.
%
% \subsection{Package Options}
% There are three categories of options: options that affect which symbols are
% used, options that affect how symbols are decorated, and options that affect
% how partial derivatives are displayed. These are presented in turn.
%
% \subsubsection{Options that Change Symbol Sets}
% There are several options that choose the set of symbols to use for total
% energy, internal energy, Helmholtz free energy, and so forth. These are
% summarized in Table~\ref{table:symbol-sets}. The default is \verb"EUAGHan".
%
% \NewExtensiveProperty{f}{F}
% \NewExtensiveProperty{a}{A}
% \NewExtensiveProperty{ee}{\mathcal{E}}
% \NewExtensiveProperty{aa}{\mathcal{A}}
% \begin{table}
%   \caption{Options controlling which symbols to use by default. The
%       macros \cs{Et}, \cs{Ut}, \cs{Ft}, \cs{Gt}, \cs{Ht}, \cs{At}, and
%       \cs{Nt} represent the total energy, internal energy,
%       Helmholtz free energy, Gibbs free energy, enthalpy, surface area,
%       and number of moles, respectively. Symbols are shown as they would
%       appear with the (default) option \texttt{intensive-plain}.
%   }
%   \label{table:symbol-sets}
%   \centering\small
%   \begin{tabular}{l l l l l l l l l}
%   \toprule
%   Option &amp; \verb"\Et" &amp; \verb"\Ut" &amp; \verb"\Ft" &amp; \verb"\Gt" &amp; \verb"\Ht"
%          &amp; \verb"\At" &amp; \verb"\Nt" \\
%   \midrule
%     |EUAGHan| &amp; $\Et$ &amp; $\Ut$ &amp; $\Ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\At$ &amp; $n$ \\
%     |EUAGHaN| &amp; $\Et$ &amp; $\Ut$ &amp; $\Ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\At$ &amp; $N$ \\
%     |EUHAGan| &amp; \multicolumn{7}{l}{(synonym for \texttt{EUAGHan})} \\
%     |EUHAGaN| &amp; \multicolumn{7}{l}{(synonym for \texttt{EUAGHaN})} \\
%     |EUFGHAn| &amp; $\Et$ &amp; $\Ut$ &amp; $\ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\at$ &amp; $n$ \\
%     |EUFGHAN| &amp; $\Et$ &amp; $\Ut$ &amp; $\ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\at$ &amp; $N$ \\
%     |EEFGHAn| &amp; $\eet$ &amp; $\Et$ &amp; $\ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\at$ &amp; $n$ \\
%     |EEFGHAN| &amp; $\eet$ &amp; $\Et$ &amp; $\ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\at$ &amp; $N$ \\
%     |EEFGHan| &amp; $\eet$ &amp; $\Et$ &amp; $\ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\At$ &amp; $n$ \\
%     |EEFGHaN| &amp; $\eet$ &amp; $\Et$ &amp; $\ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\At$ &amp; $N$ \\
%     |EEAGHaN| &amp; $\eet$ &amp; $\Et$ &amp; $\Ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\At$ &amp; $N$ \\
%     |EEAGHAN| &amp; $\eet$ &amp; $\Et$ &amp; $\Ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\aat$ &amp; $n$ \\
%     |EUAGHAN| &amp; $\Et$ &amp; $\Ut$ &amp; $\Ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\aat$ &amp; $N$ \\
%     |EUFGHan| &amp; $\Et$ &amp; $\Ut$ &amp; $\ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\At$ &amp; $n$ \\
%     |EUFGHaN| &amp; $\Et$ &amp; $\Ut$ &amp; $\ft$ &amp; $\Gt$ &amp; $\Ht$ &amp; $\At$ &amp; $N$ \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% Using \verb"EUAGHan" (the default), we might use the following markup:
% \begin{verbatim}
%   \[ \Ft = \Ut - T\St = -P\Vt + \sumall_i \mu_i \Nt_i + \sigma \At
%      \qquad \Hm = \Um + P\Vm \qquad \Et = \Ut + \frac12 mv^2 \],
%\end{verbatim}
% which would look like
%   \[ \Ft = \Ut - T\St = -P\Vt + \sumall_i \mu_i \Nt_i + \sigma \At
%      \qquad \Hm = \Um + P\Vm \qquad \Et = \Ut + \frac12 mv^2 \]
% Using the \verb"EEFGHAN" option, the same markup would yield
% \[ \ft
%    = \Et - T\St
%    = -P\Vt + \sumall_i \mu_i N_i + \sigma \at
%    \qquad H = U + PV
%    \qquad \eet = \Et + \frac12 mv^2. \]
%
% \subsubsection{Options for Extensive vs.\ Molar Properties}
% There are four sets of notation that define how extensive properties are
% represented, as shown in Table~\ref{table:extensive}.
% The default is \verb"intensive-plain", which (using the volume as an
% example) represents the total, molar, specific, and partial molar volumes,
% respectively, as $\Vt,$ $\Vm,$ $\Vs,$ and $\Vpm{j}$.
%
% For example, the definition of the partial molar enthalpy would be different
% depending on which set of notation is used. The markup
% \begin{verbatim}
% \[ \Hpm_i = \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
%           = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}} \]
%\end{verbatim}
% yields the following, depending on the package option loaded:
% \begin{align*}
%   \Hpm_i &amp;= \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
%           = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}}
%       &amp;&amp; \text{\texttt{intensive-plain}} \\
%   \Hpm_i &amp;=
% \begin{thermoextensiveplain}
%             \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
%           = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}}
% \end{thermoextensiveplain}
%       &amp;&amp; \text{\texttt{extensive-plain}} \\
%   \Hpm_i &amp;=
% \begin{thermoextensivesuperscript}
%             \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
%           = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}}
% \end{thermoextensivesuperscript}
%       &amp;&amp; \text{\texttt{extensive-superscript}} \\
% \begin{thermointensivelowercase}
%   \Hpm_i
% \end{thermointensivelowercase}
%          &amp;=
% \begin{thermointensivelowercase}
%             \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
%           = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}}
% \end{thermointensivelowercase}
%       &amp;&amp; \text{\texttt{intensive-lowercase}}
% \end{align*}
% The use of \verb"intensive-lowercase" is strongly discouraged.
%
% Note that the number of moles can be changed from $n$ to $N$ via the
% options in the previous section.
%
% \begin{table}
%   \caption{Notation sets that can be set using the options
%       \texttt{intensive-plain} (the default), \texttt{extensive-plain},
%       \texttt{extensive-superscript}, and \texttt{intensive-lowercase}.}
%   \label{table:extensive}
%   \centering\small
%   \begin{tabular}{l l l l l l}
%   \toprule
%     Option &amp; \verb"\Vt" &amp; \verb"\Vm" &amp; \verb"\Vs" &amp; \verb"\Vpm_i" \\
%   \midrule
%     \verb"intensive-plain" &amp; $\Vt$ &amp; $\Vm$ &amp; $\Vs$ &amp; $\Vpm{i}$ \\[2ex]
%     \verb"extensive-plain" &amp;
%       \begin{thermoextensiveplain}$\Vt$\end{thermoextensiveplain} &amp;
%       \begin{thermoextensiveplain}$\Vm$\end{thermoextensiveplain} &amp;
%       \begin{thermoextensiveplain}$\Vs$\end{thermoextensiveplain} &amp;
%       \begin{thermoextensiveplain}$\Vpm{i}$\end{thermoextensiveplain}
%     \\[2ex]
%     \verb"extensive-superscript" &amp;
%       \begin{thermoextensivesuperscript}$\Vt$\end{thermoextensivesuperscript} &amp;
%       \begin{thermoextensivesuperscript}$\Vm$\end{thermoextensivesuperscript} &amp;
%       \begin{thermoextensivesuperscript}$\Vs$\end{thermoextensivesuperscript} &amp;
%       \begin{thermoextensivesuperscript}$\Vpm{i}$\end{thermoextensivesuperscript} \\[2ex]
%     \verb"intensive-lowercase" &amp;
%       \begin{thermointensivelowercase}$\Vt$\end{thermointensivelowercase} &amp;
%       \begin{thermointensivelowercase}$\Vm$\end{thermointensivelowercase} &amp;
%       \begin{thermointensivelowercase}$\Vs$\end{thermointensivelowercase} &amp;
%       \begin{thermointensivelowercase}$\Vpm{i}$\end{thermointensivelowercase} 
%     \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \pagebreak[1]\relax
% \setmarginparsize{\footnotesize}
% \DescribeEnv{thermointensiveplain}
% \DescribeEnv{thermoextensiveplain}
% \DescribeEnv{thermoextensivesuperscript}
% \DescribeEnv{thermointensivelowercase}
% \restoremarginparsize
% It is possible to change notation locally, though there are very, very few
% good reasons why you would want to do this in a regular document---normally,
% one would use the corresponding package options. The environment
% \env{thermointensiveplain} means \cs{St} will become $\St$ and \cs{Sm} will
% become $\Sm$ in the text. Similarly, inside \env{thermoextensiveplain},
% \cs{St} will become $S$ and \cs{Sm} will become $\St$.
% Inside \env{thermoextensivesuperscript}, \cs{St} will become $S^t$ and
% \cs{Sm} will be $S$; and inside \env{thermointensivesubscript},
% \cs{St} will be $S$ and \cs{Sm} will be $s$.
%
% \subsubsection{Options Affecting Partial Molar Properties}
% There are two options that change how partial molar properties are typeset.
% For option |longpm| (the default), the subscript and superscript are
% considered part of the symbol, producing something like $\HEpm_i$.
% The option |shortpm| makes it display as
% \begin{thermoshortpm}
%   $\HEpm_i$.
% \end{thermoshortpm}
% The |shortpm| option is the default for several textbook-related options.
%
% \DescribeEnv{thermolongpm}
% \DescribeEnv{thermoshortpm}
% It is possible to change partial molar notation locally---this could be
% useful if you have a very, very long superscript or subscript and the
% default option looks silly, say. The environment \env{thermolongpm} sets
% the style equivalent to the |longpm| option, while the \env{thermoshortpm}
% environment sets the local style equivalent to the |shortpm| option.
% For example,
% \begin{verbatim}
% \[ \Spm_i = \Spm_i^\IGM + \SRpm_i
%     \begin{thermoshortpm}
%       = \Spm_i^\IGM + \SRpm_i
%     \end{thermoshortpm} \]
%\end{verbatim}
% produces
% \[ \Spm_i = \Spm_i^\IGM + \SRpm_i
%     \begin{thermoshortpm}
%       = \Spm_i^\IGM + \SRpm_i,
%     \end{thermoshortpm} \]
% assuming the default options are loaded.
%
% \subsubsection{Options Affecting Partial Derivatives}
% There are several options that change how partial derivatives are rendered.
% First are the options that affect the delimiters. We will use the following
% code as an example:
% \begin{verbatim}
%   \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
%                           = \PartialMixSecond{\Gm}{P}{T}{}
%                           = -\Partial{\Sm}{P}{T}. \]
%\end{verbatim}
% Using the |parentheses| option (the default), this gives
%   \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
%                           = \PartialMixSecond{\Gm}{P}{T}{}
%                           = -\Partial{\Sm}{P}{T}. \]
% The option |brackets| changes the output to
% \begin{thermobrackets}
%   \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
%                           = \PartialMixSecond{\Gm}{P}{T}{}
%                           = -\Partial{\Sm}{P}{T}. \]
% \end{thermobrackets}\relax
% The option \verb"bar" changes the output to
% \begin{thermobar}
%   \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
%                           = \PartialMixSecond{\Gm}{P}{T}{}
%                           = -\Partial{\Sm}{P}{T}. \]
% \end{thermobar}\relax
% The option \verb"plain-derivatives" eliminates all delimiters; this forces
% the \verb"nosubscripts" option. The output in this case is
% \begin{thermoplain}%
%   \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
%                           = \PartialMixSecond{\Gm}{P}{T}{}
%                           = -\Partial{\Sm}{P}{T}. \]
% \end{thermoplain}\relax
% Accompanying the \verb"plain-derivatives" option is the \verb"nosubscripts"
% option, which overrides the default option \verb"subscripts". This option
% makes partial derivatives such as
% \[ \begin{thermosubscripts}
%      \Partial{\Vm}{P}{T} \qquad \text{(\texttt{subscripts} option)},
%     \end{thermosubscripts}\relax \]
% and instead renders them
% \[ \begin{thermoNOsubscripts}
%       \Partial{\Vm}{P}{T} \qquad \text{(\texttt{nosubscripts} option)}.
%    \end{thermoNOsubscripts} \]
% Combined with \verb"plain-derivatives", this would give
% \[ \begin{thermoplain}
%      \Partial{\Vm}{P}{T} \qquad \text{(\texttt{nosubscripts} and
%                                        \texttt{plain-derivatives} options)}.
%    \end{thermoplain} \]
% The variables are sorted into an order defined by an internal constant,
% meaning $T$ will always be listed before $P$. The order by default is in
% the order that terms appear in the fundamental equations, that is,
% \begin{gather*}
%   d\Ut = T \,d\St - P \,d\Vt + \mu \,d\Nt \\
%   d\Ht = T \,d\St + \Vt \,dP + \mu \,d\Nt \\
%   d\Ft = -\St\,dT - P \,d\Vt + \mu \,d\Nt \\
%   \vdots \\
%   d\Lt = -\St\,dT - P \,d\Vt - \Nt\,d\mu,
% \end{gather*}
% with the exception that subscripted variables are (currently) not sortable.
% If \verb"\Nt_i" or some similar construct appears as a variable and
% \verb"\allNsbut{i}" appears in the held-constant list, the package will
% assume that the argument list \emph{should} contain all of the mole numbers.
% Symbols without subscripts that are not in the fundamental equation or one of
% its variants are sorted in alphabetical order.
%
% \DescribeEnv{thermoparentheses}
% \DescribeEnv{thermobrackets}
% \DescribeEnv{thermobraces}
% \DescribeEnv{thermobar}
% \DescribeEnv{thermoplain}
% If you want to use parentheses \emph{locally}, even though your overall
% document uses another delimiter, the \env{thermoparentheses} environment will
% do that. Similarly, \env{thermobrackets} will temporarily switch to brackets,
% \env{thermobar} will temporarily switch to a tailing vertical bar, and
% \env{thermoplain} will remove delimiters altogether.
%
% \DescribeEnv{thermosubscripts}
% \DescribeEnv{thermoNOsubscripts}
% The environments \env{thermosubscripts} and \env{thermoNOsubscripts}
% force the use or disuse of subscripts, respectively.
%
% \subsubsection{Options Regarding the Number of Moles}
% \DescribeMacro{\allNs}%
% \DescribeMacro{\allNsbut}%
% The default option \verb"moles-index" defines the macro \cs{allNs} to expand
% to $\allNs$ and the macro \verb"\allNsbut{i}" to expand to $\allNsbut{i}$.
% You can change the dummy index: \verb"\allNsbut[k]{i}" expands to
% $\allNsbut[k]{i}$ by default. This is typically not necessary, however: if
% you type \verb"\allNsbut{j}", the package will figure out that you want
% $\allNsbut{j}$ rather than $\Nt_{j\neq j}$. The time to use the optional
% argument is in situations such as
% \[ \Partial{\mu_j}{\Nt_k}{\allNsbut[i]{k}}, \]
% which is incorrect if the dummy index $j$ is used in place of the $i$.
%
% You can change these to expand to ranges using the \verb"moles-range"
% option, which renders \cs{allNs} as
% $\begin{thermomolesrange}\allNs\end{thermomolesrange}$ and
% \verb"\allNsbut{i}" as
% $\begin{thermomolesrange}\allNsbut{i}\end{thermomolesrange}.$
% The optional argument is ignored in this set of notation. Examples of these
% options are shown in Table~\ref{table:allNs}.
%
% \DescribeEnv{thermomolesrange}
% The environment \env{thermomolesrange} temporarily redefines \cs{allNs} and
% other range-oriented macros as though the |moles-range| package option had
% been invoked.
%
% \DescribeMacro{\ncomponents}%
% You can change the symbol for the number of components (default: $C$) by
% redefining the macro \cs{ncomponents}. This is done for you by some package
% options that define notation for particular textbooks.
%
% \begin{table}
%   \caption{Illustration of the \texttt{moles-index} and \texttt{moles-range}
%       options and their effects on \cs{allNs} and \cs{allNsbut}.}
%   \label{table:allNs}
%^^A TODO The \leavevmode macro here is to prevent whitespace from building
%^^A      up due to a bug in old versions of hypdoc. It should be harmless to
%^^A      leave it in there, but consider removing it at some point.
%   \leavevmode
%   \SpecialMacroIndex{\allNs}\relax
%   \SpecialMacroIndex{\allNsbut}\relax
%   \SpecialMacroIndex{\allXs}\relax
%   \SpecialMacroIndex{\allXsbut}\relax
%   \centering
%   \begin{minipage}{4.49in}\renewcommand*{\footnoterule}{\vskip-1.5ex}%
%   \small
%     \begin{tabular}{l l l}
%     \toprule
%       Macro\footnote{You may use $C$ directly instead of \cs{ncomponents}
%         here, but then it will not change to another symbol if you want to
%         switch to an option that redefines \cs{ncomponents} later.}
%       &amp; \verb"moles-index" &amp; \verb"moles-range" \\
%     \midrule
%       \verb"\allNs" &amp; $\allNs$
%           &amp; $\begin{thermomolesrange}\allNs\end{thermomolesrange}$ \\
%       \verb"\allNsbut{1}" &amp; $\allNsbut{1}$
%           &amp; $\begin{thermomolesrange}\allNsbut{1}\end{thermomolesrange}$ \\
%       \verb"\allNsbut{i}" &amp; $\allNsbut{i}$
%           &amp; $\begin{thermomolesrange}\allNsbut{i}\end{thermomolesrange}$ \\
%       \verb"\allNsbut{j}" &amp; $\allNsbut{j}$
%           &amp; $\begin{thermomolesrange}\allNsbut{j}\end{thermomolesrange}$ \\
%       \verb"\allNsbut{\ncomponents}" &amp; $\allNsbut{\ncomponents}$
%  &amp; $\begin{thermomolesrange}\allNsbut{\ncomponents}\end{thermomolesrange}$\\
%       \verb"\allNsbut[k]{i}" &amp; $\allNsbut[k]{i}$
%           &amp; $\begin{thermomolesrange}\allNsbut[k]{i}\end{thermomolesrange}$\\
%       \verb"\allXs" &amp; $\allXs$
%           &amp; $\begin{thermomolesrange}\allXs\end{thermomolesrange}$ \\
%       \verb"\allXsbut{1}" &amp; $\allXsbut{1}$
%           &amp; $\begin{thermomolesrange}\allXsbut{1}\end{thermomolesrange}$ \\
%       \verb"\allXsbut{i}" &amp; $\allXsbut{i}$
%           &amp; $\begin{thermomolesrange}\allXsbut{i}\end{thermomolesrange}$ \\
%       \verb"\allXsbut{j}" &amp; $\allXsbut{j}$
%           &amp; $\begin{thermomolesrange}\allXsbut{j}\end{thermomolesrange}$ \\
%       \verb"\allXsbut{\ncomponents-1}" &amp; $\allXsbut{\ncomponents-1}$
%           &amp; $\begin{thermomolesrange}\allXsbut{\ncomponents-1}
%               \end{thermomolesrange}$ \\
%       \verb"\allXsbut[k]{\ncomponents-1}" &amp; $\allXsbut[k]{\ncomponents-1}$
%           &amp; $\begin{thermomolesrange}\allXsbut[k]{\ncomponents-1}
%               \end{thermomolesrange}$ \\
%       \verb"\allXsbut{\ncomponents}"\footnote{This would typically be used
%           to denote something like
%           \( \begin{thermomolesrange}
%                \Gt(T,P,\Nt,\allXsbut{\ncomponents})
%               \end{thermomolesrange}
%           \) rather than in a subscript, but it looks silly if we do not
%           handle this case this way.}
%           &amp; $\allXsbut{\ncomponents}$
%           &amp; $\begin{thermomolesrange}\allXsbut{\ncomponents}
%              \end{thermomolesrange}$ \\
%     \bottomrule
%     \end{tabular}
%   \end{minipage}
% \end{table}
%
% \subsubsection{Other Options}
% \DescribeMacro{\dbar}%
% The default for path-dependent one-forms (often called ``inexact
% differentials'') is \cs{dbar}, which looks like $\dbar$. This can be changed,
% if desired, to a delta ($\delta$) with the \verb"delta" option to the
% package.
%
% It should be noted that the \cs{dbar} macro is context-dependent: changing
% the typeface to something not supported will probably ruin it, as the kerning
% is very font-specific. This package currently supports Computer Modern,
% Times, Palatino, Bitstream Charter, Garamond, and Utopia, but other typefaces
% may require a manual redefinition.
%
% \subsubsection{Options for Particular Textbooks} \label{sec:textbooks}
% There are several options that load package options and/or redefine
% particular commands to match the notation in a particular textbook.
% A table showing how various properties are typeset using each of these
% packages is included in Appendix~\ref{sec:symbols}.
% So far, the following textbooks are supported:
% \begin{description}
%   \item[Bejan] Notation used by Bejan, \emph{Advanced Engineering
%     Thermodynamics}, Third Edition. Wiley: Hoboken, 2006.
%   \item[CBK] Notation used by \c Cengel, Boles, and Kano\u glu,
%     \emph{Thermodynamics: An Engineering Approach}, Ninth Edition.
%     McGraw Hill: Singapore, 2020.  Their symbols for specific and
%     total volume, which appear to be from the font ITC Benguiat Gothic (and
%     reasonably approximated by Krub Italic), are not directly
%     supported.\footnote{%
%       \providecommand*{\XeTeX}{X\kern-0.125em \lower 0.5ex
%           \hbox{\reflectbox{\hbox{E}}}\kern-0.125em \TeX}
%       If you have ITC Benguiat Gothic installed and want to use it for the
%       volume symbol, you can use it through \XeTeX; try this:\\
%       \texttt{\textbackslash usepackage\{fontspec\}} \\
%       \texttt{\textbackslash setsansfont\{ITC Benguiat Gothic\}} \\
%       \texttt{\textbackslash ExplSyntaxOn} \\
%       \texttt{\mbox{}~~\textbackslash tl\_gset:Nn
%               \textbackslash g\_\_thermodynamics\_volume\_symbol
%            \{\{\textbackslash text\{\textbackslash
%                sffamily V\}\}\}} \\
%       \texttt{\textbackslash ExplSyntaxOff}
%       \label{fn:XeTeX}}
%   \item[ElliottLira] Notation used by Elliott and Lira, \emph{Introductory
%     Chemical Engineering Thermodynamics}, Second Edition. Prentice Hall:
%     Upper Saddle River, 2012. \emph{Note: these authors use
%     Henry's Law (molal basis) in the form \(y_i P = m_i/K_{H,i}\), which is
%     inconsistent with their notation for the rational basis, so that macro
%     is left set to its default.}
%   \item[KlotzRosenberg] Notation used by Klotz and Rosenberg, \emph{Chemical
%     Thermodynamics: Basic Concepts and Methods}, Seventh Edition.
%     Wiley: Hoboken, 2008.
%   \item[Koretsky] Notation used by Koretsky, \emph{Engineering and Chemical
%     Thermodynamics}, Second Edition. Wiley: New Caledonia, 2013.
%   \item[ModellReid] Alias for \verb"TesterModell" (the first and second
%     editions were by Modell and Reid; Reid died prior to the third edition).
%   \item[MSBB] Notation used by Moran, Shapiro, Boettner, and Bailey,
%     \emph{Fundamentals of Engineering Thermodynamics}, Eighth Edition.
%     Wiley: Kendallville, 2014.
%   \item[Prausnitz] Notation used by Prausnitz, Lichtenthaler, and de Azevedo,
%     \emph{Molecular Thermodynamics of Fluid-Phase Equilibria}, Third Edition,
%     Pearson, 1998.
%   \item[Sandler] Notation used by Sandler, \emph{Chemical, Biochemical, and
%     Engineering Thermodynamics}, Fifth Edition. Wiley: Hoboken, 2017.
%   \item[SVNAS] Notation used by Smith, Van Ness, Abbott, and Swihart,
%     \emph{Introduction to Chemical Engineering Thermodynamics}, Ninth
%     Edition. McGraw-Hill: Boston, 2021.
%   \item[TesterModell] Notation used by Tester and Modell,
%     \emph{Thermodynamics and Its Applications}, Third Edition, Prentice Hall:
%     Upper Saddle River, 1997.
%   \item[Thompson] Notation used by Thompson, \emph{A Unified Introduction to
%     Chemical Engineering Thermodynamics}, Stillwater Press: Orono, 2000.
%     Note that he uses $c$, $\mathrm{c}$, $n_C$, and $\mathrm{n}$ for the
%     number of components in various places in the book; I chose $c$ for the
%     definition of \cs{ncomponents}, but it is impossible to be completely
%     consistent with his notation.
% \end{description}
% There may well be some inconsistencies between the notation in these books
% and the symbols used here. I will fix such inconsistencies as I become aware
% of them.
%
% \textbf{Important}: Some textbooks use symbols other than \(\mu\) for
% chemical potential and \(\gamma\) for activity coefficients. For example,
% |KlotzRosenberg| uses $\muup$ for the chemical potential and $\gammaup$
% for the activity coefficient. In such cases,
% the macro \verb"\mu" will produce whatever symbol \emph{is} used for the
% chemical potential, and \verb"\gamma" will produce the activity coefficient.
% The original symbols will still be available as \cs{gammait} and \cs{muit},
% respectively.
%
% \appendix
% \section{Notation Across Textbooks} \label{sec:symbols}
% \changes{v2.02}{2024/06/14}{Improved consistency of package options for
%       textbooks and added a table of symbols organized by textbook option.}
% Some of the textbooks supported by this package use multiple symbols for the
% same quantity---for example, Sandler's textbook uses both \(P^\text{sat}\)
% and \(P^\text{vap}\) for vapor (saturation) pressure, and Elliott and Lira
% use both \(\Delta H^\circ\) and \(\Delta H_R^o\) for the standard enthalpy
% of reaction. This package may only support one of the two in such cases.
%
% Table~\ref{table:textbooks} gives a description of each symbol supported
% by the package, the corresponding command, and the way that command is
% rendered using each of the textbook-related options in
% Section~\ref{sec:textbooks}. Packages consisting of two names are shortened
% to one name in the headers for space considerations.
%
% \NewDocumentCommand{\inherit}{m}{\textcolor{gray}{#1}}
% \begin{landscape}\scriptsize
% \tablehead{%
%   \toprule
%   Quantity &amp; Macro &amp; Default &amp; Bejan &amp; CBK &amp; Elliott &amp; Klotz
%       &amp; Koretsky &amp; MSBB &amp; Prausnitz &amp; Sandler &amp; SVNAS &amp; Modell &amp; Thompson \\
%   \midrule
% }
% \tabletail{%
%   \midrule\multicolumn{13}{l}{\emph{continued on next page\dots}} \\
% }
% \tablelasttail{\bottomrule}
% \tablecaption{How symbols are typeset for various textbooks.
%   Entries in \inherit{gray} indicate quantities that are not directly or
%   indirectly defined in a particular textbook and are therefore inherited
%   fromthe defaults.
%   \emph{Note: Options with two authors, such as \texttt{ElliottLira},
%   only include one name so as to fit on one page.}
%   \label{table:textbooks}}
% \setlength{\extrarowheight}{3.5pt}%
% \begin{mpsupertabular}{l l l l l l l l l l l l l l}
%   \# components &amp; \verb"\ncomponents" &amp; $\ncomponents$ &amp; $n$ &amp; $\inherit{\ncomponents}$ &amp; $\inherit{\ncomponents}$ &amp; $\inherit{\ncomponents}$ &amp; $m$ &amp; $\inherit{\ncomponents}$ &amp; $m$ &amp; $\mathcal{C}$ &amp; $\inherit{\ncomponents}$ &amp; $n$ &amp; $c$ \\
%   activity (absolute) &amp; \verb"\actabs_i" &amp; $\actabs_i$ &amp; $\inherit{\lambda_i}$ &amp; $\inherit{\actabs_i}$ &amp; $\inherit{\actabs_i}$ &amp; $\inherit{\lambda_i}$ &amp; $\inherit{\lambda_i}$ &amp; $\inherit{\actabs_i}$ &amp; $\inherit{\actabs_i}$ &amp; $\inherit{\actabs_i}$ &amp; $\inherit{\actabs_i}$ &amp; $\inherit{\actabs_i}$ &amp; $\inherit{\actabs_i}$ \\
%   activity (relative) &amp; \verb"\actrel_i" &amp; $\actrel_i$ &amp; $\inherit{\actrel_i}$ &amp; $\inherit{\actrel_i}$ &amp; $a_i$ &amp; $a_i$ &amp; $\inherit{a_i}$ &amp; $\inherit{\actrel_i}$ &amp; $\mathdutchcal{a}_i$\relax
%    \footnote{The symbol $\mathdutchcal{a}$ requires the |dutchcal| fonts to be installed,
%      though the package itself is not loaded. This symbol is an approximation to the one
%      the book actually uses.} &amp; $a_i$ &amp; $a_i$ &amp; $a_i$ &amp; $\widehat a_i$ \\
%   activity coefficient (ordinary) &amp; \verb"\gamma_i" &amp; $\gamma_i$ &amp; $\inherit{\gamma_i}$ &amp; $\inherit{\gamma_i}$ &amp; $\gamma_i$ &amp; $\gammaup_i$ &amp; $\gamma_i$ &amp; $\inherit{\gamma_i}$ &amp; $\gamma_i$ &amp; $\gamma_i$ &amp; $\gamma_i$ &amp; $\gammaup_i$ &amp; $\gamma_i$ \\
%   activity coefficient (Henry, rational) &amp; \verb"\gammarat_i" &amp; $\gammarat_i$ &amp; $\inherit{\gammarat_i}$ &amp; $\inherit{\gammarat_i}$ &amp; $\gamma_i^\ast$ &amp; $\gammaup_i$ &amp; $\gamma_i^\text{Henry's}$ &amp; $\inherit{\gammarat_i}$ &amp; $\inherit{\gammarat_i}$ &amp; $\gamma_i^\ast$ &amp; $\inherit{\gammarat_i}$ &amp; $\gammaup_i^{\ast\ast}$ &amp; $\inherit{\gammarat_i}$ \\
%   activity coefficient (Henry, molal) &amp; \verb"\gammamol_i" &amp; $\gammamol_i$ &amp; $\inherit{\gammamol_i}$ &amp; $\inherit{\gammamol_i}$ &amp; $\gamma_i^\square$ &amp; $\gammaup_i$ &amp; $\gamma_i^m$ &amp; $\inherit{\gammamol_i}$ &amp; $\inherit{\gammamol_i}$ &amp; $\gamma_i^\square$ &amp; $\gammarat_i$ &amp; $\gammaup_i^\ast$ &amp; $\inherit{\gammamol_i}$ \\
%   adiabatic compressibility &amp; \multicolumn{13}{l}{\emph{See} isentropic compressibility} \\
%   adiabatic expansivity &amp; \multicolumn{13}{l}{\emph{See} isentropic expansivity} \\
%   area (total) &amp; \verb"\At" &amp; $\At$ &amp; $A$ &amp; $A$ &amp; $\inherit{\At}$ &amp; $\inherit{a}$ &amp; $A$ &amp; $A$ &amp; $\inherit{A}$ &amp; $\inherit{a}$ &amp; $\inherit{a^t}$ &amp; {\large$\underline{a}$} &amp; $\inherit{\mkern2mu\underline{\mkern-2mu\mathcal{A}\mkern-2mu}\mkern2mu}$  \\
%   chemical potential &amp; \verb"\mu" &amp; $\mu$ &amp; $\mu$ &amp; $\mu$ &amp; $\mu$ &amp; $\muup$ &amp; $\mu$ &amp; $\mu$ &amp; $\mu$ &amp; $\mu$ &amp; $\mu$ &amp; $\muup$ &amp; $\mu$ \\
%   electric potential &amp; \verb"\Epot" &amp; $\Epot$ &amp; $\inherit{\Epot}$ &amp; $\inherit{\Epot}$ &amp; $E$ &amp; $\emf$\footnote{The
%       symbol $\emf$ requires the \pkg{emf} package. If that package is not
%       loaded, $\mathcal{E}$ is used instead.\label{fn:emf}}
%     &amp; $E$ &amp; $\inherit{\Epot}$ &amp; $\emf$\footref{fn:emf} &amp; $E$ &amp; $E$ &amp; $\exists$ &amp; $E$ \\
%   electric potential (standard) &amp; \verb"\Epot^\std" &amp; $\Epot^\std$ &amp; $\inherit{\Epot^\std}$ &amp; $\inherit{\Epot^\std}$ &amp; $E^\circ$ &amp; $\emf^\circ$ &amp; $E^o$ &amp; $\inherit{\Epot^\std}$ &amp; $\emf^0$ &amp; $\inherit{E^\circ}$ &amp; $E^\circ$ &amp; $\exists^o$ &amp; $E^\circ$ \\
%   energy (total) &amp; \verb"\Et" &amp; $\Et$ &amp; $E$ &amp; $E$ &amp; $\inherit{\Et}$ &amp; $\inherit{E}$ &amp; $E$ &amp; $E$ &amp; $E$ &amp; $\inherit{E}$ &amp; $\inherit{E^t}$ &amp; $\Et$ &amp; $\inherit{\Et}$ \\
%   energy (molar) &amp; \verb"\Em" &amp; $\Em$ &amp; $\overline{e}$ &amp; $\overline{e}$ &amp; $\inherit{\Em}$ &amp; $\inherit{E_{\textrm{m}}}$ &amp; $e$ &amp; $\overline{e}$ &amp; $\inherit{e}$ &amp; \begin{thermoextensiveplain}$\inherit{\Em}$\end{thermoextensiveplain} &amp; $\inherit{E}$ &amp; $\Em$ &amp; $\inherit{\Em}$ \\
%   energy (specific) &amp; \verb"\Es" &amp; $\Es$ &amp; $e$ &amp; $e$ &amp; $\inherit{E}$ &amp; $\inherit{\hat E}$ &amp; $\hat e$ &amp; $e$ &amp; $\inherit{\hat e}$ &amp; $\hat E$ &amp; $\inherit{E}$ &amp; $\Es$ &amp; $\inherit{\Em}$ \\
%   enthalpy (total) &amp; \verb"\Ht" &amp; $\Ht$ &amp; $H$ &amp; $H$ &amp; $\Ht$ &amp; $H$ &amp; $H$ &amp; $H$ &amp; $H$ &amp; $H$ &amp; $H^t$ &amp; $\Ht$ &amp; $\Ht$ \\
%   enthalpy (molar) &amp; \verb"\Hm" &amp; $\Hm$ &amp; $\overline{h}$ &amp; $\overline{h}$ &amp; $H$ &amp; $H_{\textrm{m}}$ &amp; $h$ &amp; $\overline{h}$ &amp; $h$ &amp; \begin{thermoextensiveplain}$\Hm$\end{thermoextensiveplain} &amp; $H$ &amp; $\Hm$ &amp; $\Hm$ \\
%   enthalpy (specific) &amp; \verb"\Hs" &amp; $\Hs$ &amp; $h$ &amp; $h$ &amp; $H$ &amp; $\inherit{\Hs}$ &amp; $\hat h$ &amp; $h$ &amp; $\inherit{\hat h}$ &amp; $\hat H$ &amp; $H$ &amp; $\Hs$ &amp; $\inherit{\Hs}$ \\
%   enthalpy (partial molar) of $i$ &amp; \verb"\Hpm_i" &amp; $\Hpm_i$ &amp; $\inherit{\overline{h}_i}$ &amp; $\widetilde{h}_i$ &amp; $\overline{H}_i$ &amp; $H_{\mathrm{m}i}$ &amp; $\overline{H}_i$ &amp; $\Hpm_i$ &amp; $\overline{h}_i$ &amp; \begin{thermoshortpm}$\Hpm_i$\end{thermoshortpm} &amp; $\overline{H}_i$ &amp; $\Hpm_i$ &amp; $\Hpm_i$ \\
%   enthalpy of reaction &amp; \verb"\Deltarxn\Hm" &amp; $\Deltarxn\Hm$ &amp; $\inherit{\Delta\overline{h}_\text{rxn}}$ &amp; $\overline{h}_R$ &amp; $\Delta H$ &amp; $\Delta H_{\mathrm{m}}$ &amp; $\Delta h_\text{rxn}$ &amp; $\inherit{\Delta\overline{h}_\text{rxn}}$ &amp; $\inherit{\Delta h_\text{rxn}}$ &amp; \begin{thermoextensiveplain}$\Delta_{\text{rxn}}\Hm$\end{thermoextensiveplain} &amp; $\Delta H$ &amp; $\Delta H_{rx}$ &amp; $\Delta H_R$ \\
%   enthalpy of fusion &amp; \verb"\Deltafus\Hm" &amp; $\Deltafus\Hm$ &amp; $\overline{h}_{sf}$ &amp; $\overline{h}_{sf}$ &amp; $\Delta H^{fus}$ &amp; $\Delta H_{\mathrm{m}}$ &amp; $\Delta h_\text{fus}$ &amp; $\inherit{\overline{h}^\text{fus}}$ &amp; $\inherit{\Delta h^\text{fus}}$ &amp; \begin{thermoextensiveplain}$\Delta_\text{fus}\Hm$\end{thermoextensiveplain} &amp; $\Delta H^{sl}$ &amp; $\inherit{\Deltafus H}$ &amp; $\Delta H^{SL}$ \\
%   enthalpy of vaporization &amp; \verb"\Deltavap\Hm" &amp; $\Deltavap\Hm$ &amp; $\overline{h}_{sf}$ &amp; $\overline{h}_{fg}$ &amp; $\Delta H^{vap}$ &amp; $\Delta H_{\mathrm{m}}$ &amp; $\Delta h_\text{vap}$ &amp; $\inherit{\overline{h}^\text{vap}}$ &amp; $\inherit{\Delta h^\text{vap}}$ &amp; \begin{thermoextensiveplain}$\Delta_\text{vap}\Hm$\end{thermoextensiveplain} &amp; $\Delta H^{vl}$ &amp; $\inherit{\Deltavap H}$ &amp; $\Delta H^{LV}$ \\
%   enthalpy of sublimation &amp; \verb"\Deltasub\Hm" &amp; $\Deltasub\Hm$ &amp; $\overline{h}_{sg}$ &amp; $\overline{h}_{sg}$ &amp; $\inherit{\Delta H^{sub}}$ &amp; $\Delta H_{\mathrm{m}}$ &amp; $\Delta h_\text{sub}$ &amp; $\inherit{\overline{h}^\text{sub}}$ &amp; $\inherit{\Delta h^\text{sub}}$ &amp; $\Delta_\text{sub}\Ht$ &amp; $\Delta H^{vs}$ &amp; $\inherit{\Deltasub H}$ &amp; $\inherit{\Delta H^{SV}}$ \\
%   entropy (total) &amp; \verb"\St" &amp; $\St$ &amp; $S$ &amp; $S$ &amp; $\St$ &amp; $S$ &amp; $S$ &amp; $S$ &amp; $S$ &amp; $S$ &amp; $S^t$ &amp; $\St$ &amp; $\St$ \\
%   entropy (molar) &amp; \verb"\Sm" &amp; $\Sm$ &amp; $\overline{s}$ &amp; $\overline{s}$ &amp; $S$ &amp; $S_{\mathrm{m}}$ &amp; $s$ &amp; $\overline{s}$ &amp; $s$ &amp; $\St$ &amp; $S$ &amp; $S$ &amp; $S$ \\
%   entropy (specific) &amp; \verb"\Ss" &amp; $\Ss$ &amp; $s$ &amp; $s$ &amp; $S$ &amp; $\inherit{\Ss}$ &amp; $\hat s$ &amp; $s$ &amp; $\inherit{\hat s}$ &amp; $\hat S$ &amp; $S$ &amp; $\hat S$ &amp; $\inherit{\Ss}$ \\
%   entropy (partial molar) of $i$ &amp; \verb"\Spm_i" &amp; $\Spm_i$ &amp; $\overline{S}_i$ &amp; $\widetilde{s}_i$ &amp; $\overline{S}_i$ &amp; $S_{\mathrm{m}i}$ &amp; $\overline{S}_i$ &amp; $\Spm_i$ &amp; $\overline{s}_i$ &amp; \begin{thermoshortpm}$\Spm_i$\end{thermoshortpm} &amp; $\overline{S}_i$ &amp; $\Spm_i$ &amp; $\Spm_i$ \\
%   extent of reaction &amp; \verb"\xrxn" &amp; $\xrxn$ &amp; $\zeta$ &amp; $\inherit{\xrxn}$ &amp; $\xi$ &amp; $\xiup$ &amp; $\xi$ &amp; $\varepsilon$ &amp; $\inherit{\xi}$ &amp; $X$ &amp; $\varepsilon$ &amp; $\xiup$ &amp; $\xi$ \\
%   fugacity of pure substance &amp; \verb"\fpure" &amp; $\fpure$ &amp; $f$ &amp; $\inherit{\fpure}$ &amp; $f$ &amp; $f$ &amp; $f$ &amp; $f$ &amp; $f_\text{pure}$ &amp; $f$ &amp; $f$ &amp; $f$ &amp; $f$ \\
%   fugacity of pure $i$ &amp; \verb"\fpure_i" &amp; $\fpure_i$ &amp; $\inherit{f_i^\bullet}$ &amp; $\inherit{\fpure_i}$ &amp; $f_i$ &amp; $f_i^\bullet$ &amp; $f_i$ &amp; $f_i$ &amp; $f_{\text{pure}\,i}$ &amp; $f_i$ &amp; $f_i$ &amp; $f_i$ &amp; $f_i^\bullet$ \\
%   fugacity of $i$ in mixture &amp; \verb"\fmix_i" &amp; $\fmix_i$ &amp; $f_i$ &amp; $\inherit{\fmix_i}$ &amp; $\hat f_i$ &amp; $f_i$ &amp; $\hat f_i$ &amp; $\bar f_i$ &amp; $f_i$ &amp; $\bar f_i$ &amp; $\hat f_i$ &amp; $\hat f_i$ &amp; $\widehat{f}_i$ \\
%   fugacity at saturation &amp; \verb"\fsat" &amp; $\fsat$ &amp; $\inherit{f^\sat}$ &amp; $\inherit{\fsat}$ &amp; $f^{sat}$ &amp; $\inherit{f^\text{sat}}$ &amp; $\inherit{f^\text{sat}}$ &amp; $\inherit{f^\text{sat}}$ &amp; $f^s_\text{pure}$ &amp; $f^\text{sat}$ &amp; $f^\text{sat}$ &amp; $\inherit{\fsat}$ &amp; $f^\text{sat}$ \\
%   fugacity coefficient of pure substance &amp; \verb"\phipure" &amp; $\phipure$ &amp; $\inherit{\phi}$ &amp; $\inherit{\phipure}$ &amp; $\phi$ &amp; $\gamma$ &amp; $\varphi$ &amp; $\inherit{\phi}$ &amp; $\varphi_{\text{pure}}$ &amp; $\phi$ &amp; $\phi$ &amp; $\phiup$ &amp; $\phi$ \\
%   fugacity coefficient of pure $i$ &amp; \verb"\phipure_i" &amp; $\phipure_i$ &amp; $\inherit{\phi_i^\bullet}$ &amp; $\inherit{\phipure_i}$ &amp; $\phi_i$ &amp; $\gamma_i^\bullet$ &amp; $\varphi_i$ &amp; $\inherit{\phi_i}$ &amp; $\varphi_{\text{pure}\,i}$ &amp; $\phi_i$ &amp; $\phi_i$ &amp; $\phiup_i$ &amp; $\phi_i^\bullet$ \\
%   fugacity coefficient of $i$ in mixture &amp; \verb"\phimix_i" &amp; $\phimix_i$ &amp; $\inherit{\phi_i}$ &amp; $\inherit{\phimix_i}$ &amp; $\hat\phi_i$ &amp; $\gamma_i$ &amp; $\hat\varphi_i$ &amp; $\bar\phi_i$ &amp; $\varphi_i$ &amp; $\bar\phi_i$ &amp; $\hat\phi_i$ &amp; $\hat\phiup_i$ &amp; $\widehat{\phi}_i$ \\
%   fugacity coefficient at saturation &amp; \verb"\phisat" &amp; $\phisat$ &amp; $\inherit{\phisat}$ &amp; $\inherit{\phisat}$ &amp; $\phi^{sat}$ &amp; $\inherit{\gamma^\text{sat}}$ &amp; $\varphi^\text{sat}$ &amp; $\inherit{\phi^\text{sat}}$ &amp; $\varphi^s$ &amp; $\phi^\text{sat}$ &amp; $\phi^\text{sat}$ &amp; $\inherit{\phiup^\sat}$ &amp; $\phi^\text{sat}$ \\
%   Gibbs free energy (total) &amp; \verb"\Gt" &amp; $\Gt$ &amp; $G$ &amp; $G$ &amp; $\Gt$ &amp; $G$ &amp; $G$ &amp; $G$ &amp; $G$ &amp; $G$ &amp; $G^t$ &amp; $\Gt$ &amp; $\Gt$ \\
%   Gibbs free energy (molar) &amp; \verb"\Gm" &amp; $\Gm$ &amp; $\overline{g}$ &amp; $\overline{g}$ &amp; $G$ &amp; $G_{\mathrm{m}}$ &amp; $g$ &amp; $\overline{g}$ &amp; $g$ &amp; $\Gt$ &amp; $G$ &amp; $G$ &amp; $G$ \\
%   Gibbs free energy (specific) &amp; \verb"\Gs" &amp; $\Gs$ &amp; $g$ &amp; $g$ &amp; $G$ &amp; $\inherit{\Gs}$ &amp; $\hat g$ &amp; $g$ &amp; $\inherit{\hat g}$ &amp; $\hat G$ &amp; $G$ &amp; $\Gs$ &amp; $\inherit{\Gs}$ \\
%   Gibbs free energy (partial molar) &amp; \verb"\Gpm_i" &amp; $\Gpm_i$ &amp; $\overline{G}_i$ &amp; $\widetilde{g}_i$ &amp; $\Gpm_i$ &amp; $G_{\mathrm{m}i}$ &amp; $\overline{G}_i$ &amp; $\Gpm_i$ &amp; $\partialmolar{g}_i$ &amp; \begin{thermoshortpm}$\Gpm_i$\end{thermoshortpm} &amp; $\Gpm_i$ &amp; $\Gpm_i$ &amp; $\partialmolar{G}_i$ \\
%   Gibbs free energy of mixing &amp; \verb"\Deltamix\Gt" &amp; $\Deltamix\Gt$ &amp; $\inherit{\Deltamix G}$ &amp; $\inherit{\Deltamix G}$ &amp; $\Delta\Gt_\text{mix}$ &amp; $\Delta G_\text{mix}$ &amp; $\Delta G_\text{mix}$ &amp; $\inherit{\Deltamix G}$ &amp; $\Delta G_\text{mixing}$ &amp; $\Delta_\text{mix}G$ &amp; $\Delta G^t$ &amp; $\Deltamix\Gt$ &amp; $\Delta_{MIX}\Gt$ \\
%   Gibbs free energy of reaction &amp; \verb"\Deltarxn\Gm" &amp; $\Deltarxn\Gm$ &amp; $\inherit{\Deltarxn{\bar{g}}}$ &amp; $\overline{g}_R$ &amp; $\Delta G$ &amp; $\Delta G_{\mathrm{m}}$ &amp; $\Delta g_\text{rxn}$ &amp; $\inherit{\Deltarxn{\overline{g}}}$ &amp; $\inherit{\Delta g_\text{rxn}}$ &amp; $\Delta_\text{rxn}\Gt$ &amp; $\Delta G$ &amp; $\Delta G_{rx}$ &amp; $\Delta G_R$ \\
%   grand potential (total) &amp; \verb"\Lt" &amp; $\Lt$ &amp; $F_\mu$ &amp; $\inherit{\Omega}$ &amp; $\inherit{\Lt}$ &amp; $\inherit{\Omega}$ &amp; $\inherit{\Omega}$ &amp; $\inherit{\Omega}$ &amp; $\inherit{\Omega}$ &amp; $\inherit{\Omega}$ &amp; $\inherit{\Lt}$ &amp; $\inherit{\Lt}$ &amp; $\inherit{\Lt}$ \\
%   grand potential (molar) &amp; \verb"\Lm" &amp; $\Lm$ &amp; $\overline{f}_\mu$ &amp; $\inherit{\overline{\omega}}$ &amp; $\inherit{\Lm}$ &amp; $\inherit{\Omega_{\mathrm{m}}}$ &amp; $\inherit{\omega}$ &amp; $\inherit{\overline{\omega}}$ &amp; $\inherit{\omega}$ &amp; $\inherit{\Lt}$ &amp; $\inherit{\Lm}$ &amp; $\inherit{\Lm}$ &amp; $\inherit{\Lm}$ \\
%   grand potential (specific) &amp; \verb"\Ls" &amp; $\Ls$ &amp; $f_\mu$ &amp; $\inherit{\omega}$ &amp; $\inherit{\Ls}$ &amp; $\inherit{\Ls}$ &amp; $\inherit{\hat\omega}$ &amp; $\inherit{\omega}$ &amp; $\inherit{\hat\omega}$ &amp; $\inherit{\Ls}$ &amp; $\inherit{\Lm}$ &amp; $\inherit{\Ls}$ &amp; $\inherit{\Ls}$ \\
%   heat (total) &amp; \verb"\Qt" &amp; $\Qt$ &amp; $Q$ &amp; $Q$ &amp; $\Qt$ &amp; $Q$ &amp; $Q$ &amp; $Q$ &amp; $Q$ &amp; $Q$ &amp; $Q^t$ &amp; $\inherit{\Qt}$ &amp; $\inherit{\Qt}$ \\
%   heat (molar) &amp; \verb"\Qm" &amp; $\Qm$ &amp; $\overline{q}$ &amp; $\overline{q}$ &amp; $Q$ &amp; $\inherit{Q_{\mathrm{m}}}$ &amp; $q$ &amp; $\overline{q}$ &amp; $\inherit{q}$ &amp; $\inherit{\Qt}$ &amp; $Q$ &amp; $Q$ &amp; $Q$ \\
%   heat (specific) &amp; \verb"\Qs" &amp; $\Qs$ &amp; $q$ &amp; $q$ &amp; $Q$ &amp; $\inherit{\Qs}$ &amp; $\hat q$ &amp; $q$ &amp; $\inherit{\hat q}$ &amp; $\inherit{\Qs}$ &amp; $Q$ &amp; $\inherit{\hat Q}$ &amp; $\inherit{\Qs}$ \\
%   heat capacity (isobaric, total) &amp; \verb"\cPt" &amp; $\cPt$ &amp; $C_P$ &amp; $\inherit{C_p}$ &amp; $\underline{C}_P$ &amp; $C_P$ &amp; $\inherit{C_P}$ &amp; $\inherit{C_p}$ &amp; $C_p$ &amp; $NC_P$ &amp; $nC_P$ &amp; $\inherit{\underline{C}_p}$ &amp; $\inherit{\cPt}$ \\
%   heat capacity (isobaric, molar) &amp; \verb"\cP"  &amp; $\cP$ &amp; $\overline{c}_P$ &amp; $\overline{c}_p$ &amp; $C_P$ &amp; $C_{P\mathrm{m}}$ &amp; $c_P$ &amp; $\overline{c}_p$ &amp; $c_p$ &amp; $C_P$ &amp; $C_P$ &amp; $C_p$ &amp; $C_P$ \\
%   heat capacity of $i$ (isobaric, molar) &amp; \verb"\cP_i" &amp; $\cP_i$ &amp; $\overline{c}_{P,i}$ &amp; $\overline{c}_{p,i}$ &amp; $C_{P,i}$ &amp; $C_{P\mathrm{m}i}^\bullet$ &amp; $C_{P,i}$ &amp; $\overline{c}_{p,i}$ &amp; $c_{p\,i}$ &amp; $C_{P,i}$ &amp; ${C_P}_i$ &amp; $C_{pi}$ &amp; $C_{P,i}$ \\
%   heat capacity (isobaric, specific) &amp; \verb"\cPs" &amp; $\cPs$ &amp; $c_P$ &amp; $c_p$ &amp; $C_P$ &amp; $\inherit{\cPs}$ &amp; $\hat c_P$ &amp; $c_p$ &amp; $\inherit{\hat c_p}$ &amp; $\hat C_P$ &amp; $C_P$ &amp; $\inherit{\hat C_p}$ &amp; $\inherit{\hat C_p}$ \\
%   heat capacity (isobaric, partial molar) &amp; \verb"\cPpm_i" &amp; $\cPpm_i$ &amp; $\overline{c}_{P,i}$ &amp; $\inherit{\widetilde{C}_{p,i}}$ &amp; $\overline{C}_{P,i}$ &amp; $C_{P\mathrm{m}i}$ &amp; $\overline{C}_{P,i}$ &amp; \begin{thermoshortpm}$\partialmolar{C}_{p,i}$\end{thermoshortpm} &amp; $\inherit{\bar c_{p\,i}}$ &amp; \begin{thermoshortpm}$\cPpm_i$\end{thermoshortpm} &amp; ${\overline{C}_P}_i$ &amp; $\overline{C}_{pi}$ &amp; \begin{thermoshortpm}$\inherit{\cPpm_i}$\end{thermoshortpm} \\
%   heat capacity (isochoric, total) &amp; \verb"\cVt" &amp; $\cVt$ &amp; $C_V$ &amp; $\inherit{C_V}$\footref{fn:XeTeX} &amp; $\underline{C}_V$ &amp; $C_V$ &amp; $C_V$ &amp; $C_v$ &amp; $C_v$ &amp; $NC_V$ &amp; $nC_V$ &amp; $\inherit{\underline{C}_v}$ &amp; $\inherit{\cVt}$ \\
%   heat capacity (isochoric, molar) &amp; \verb"\cV"  &amp; $\cV$ &amp; $\overline{c}_v$ &amp; $\overline{c}_V$\footref{fn:XeTeX} &amp; $C_V$ &amp; $C_{V\mathrm{m}}$ &amp; $c_V$ &amp; $\overline c_v$ &amp; $c_v$ &amp; $C_V$ &amp; $C_V$ &amp; $C_v$ &amp; $C_V$ \\
%   heat capacity (isochoric, specific) &amp; \verb"\cVs" &amp; $\cVs$ &amp; $c_v$ &amp; $c_V$\footref{fn:XeTeX} &amp; $C_V$ &amp; $\inherit{\cVs}$ &amp; $\hat c_v$ &amp; $c_v$ &amp; $\inherit{\hat c_p}$ &amp; $\hat C_V$ &amp; $C_V$ &amp; $\inherit{\hat C_v}$ &amp; $\inherit{\cVs}$ \\
%   heat capacity (isochoric, partial molar) &amp; \verb"\cVpm_i" &amp; $\cVpm_i$ &amp; $\overline{c}_{v,i}$ &amp; $\widetilde{C}_{V,i}$\footref{fn:XeTeX} &amp; $\overline{C}_{V,i}$ &amp; $C_{V\mathrm{m}i}$ &amp; $\overline{C}_V$ &amp; \begin{thermoshortpm}$\partialmolar{C}_{v,i}$\end{thermoshortpm} &amp; $\inherit{\bar c_{v\,i}}$ &amp; \begin{thermoshortpm}$\cVpm_i$\end{thermoshortpm} &amp; ${\overline{C}_V}_i$ &amp; $\overline{C}_{vi}$ &amp; \begin{thermoshortpm}$\inherit{\cVpm_i}$\end{thermoshortpm} \\
%   Helmholtz free energy (total) &amp; \verb"\Ft" &amp; $\Ft$ &amp; $F$ &amp; $A$ &amp; $\underline{A}$ &amp; $A$ &amp; $A$ &amp; $\Psi$ &amp; $A$ &amp; $A$ &amp; $A^t$ &amp; $\Ft$ &amp; $\Ft$ \\
%   Helmholtz free energy (molar) &amp; \verb"\Fm" &amp; $\Fm$ &amp; $\bar{f}$ &amp; $\overline{a}$ &amp; $A$ &amp; $A_{\mathrm{m}}$ &amp; $a$ &amp; $\overline{\psi}$ &amp; $a$ &amp; $\Ft$ &amp; $A$ &amp; $A$ &amp; $A$ \\
%   Helmholtz free energy (specific) &amp; \verb"\Fs" &amp; $\Fs$ &amp; $f$ &amp; $a$ &amp; $A$ &amp; $\inherit{\Fs}$ &amp; $\hat a$ &amp; $\psi$ &amp; $\inherit{\hat a}$ &amp; $\hat A$ &amp; $A$ &amp; $\Fs$ &amp; $\inherit{\Fs}$ \\
%   Helmholtz free energy (partial molar) &amp; \verb"\Fpm_i" &amp; $\Fpm_i$ &amp; $\overline{f}_i$ &amp; $\widetilde{a}_i$ &amp; $\overline{A}_i$ &amp; $A_{\mathrm{m}i}$ &amp; $\overline{A}_i$ &amp; $\overline{\Psi}_i$ &amp; $\overline a_i$ &amp; \begin{thermoshortpm}$\Fpm_i$\end{thermoshortpm} &amp; $\begin{thermoshortpm}\Fpm_i\end{thermoshortpm}$ &amp; $\partialmolar{A}_i$ &amp; \begin{thermoshortpm}$\partialmolar{A}_i$\end{thermoshortpm} \\
%   Henry's constant (rational basis) &amp; \verb"\Henryrat_i" &amp; $\Henryrat_i$ &amp; $\inherit{\Henryrat_i}$ &amp; $\inherit{\Henryrat_i}$ &amp; $h_i$ &amp; $k_i$ &amp; $\mathcal{H}_i$ &amp; $\inherit{\Henryrat_i}$ &amp; $H_i$ &amp; $H_i$ &amp; $\mathcal{H}_i$ &amp; $f^{**}$ &amp; $k_{H,i}$ \\
%   Henry's constant (molal basis) &amp; \verb"\Henrymol_i" &amp; $\Henrymol_i$ &amp; $\inherit{\Henrymol_i}$ &amp; $\inherit{\Henrymol_i}$ &amp; $\inherit{\Henrymol_i}$ &amp; $k''_i$ &amp; $\inherit{\Henrymol_i}$ &amp; $\inherit{\Henrymol_i}$ &amp; $\inherit{\Henrymol_i}$ &amp; $\mathcal{H}_i$ &amp; $\inherit{\Henrymol_i}$ &amp; $f^*$ &amp; $k_{H,i}$ \\
%   ideal gas enthalpy &amp; \verb"\Hm^\IG" &amp; $\Hm^\IG$ &amp; $\inherit{\bar{h}^\IG}$ &amp; $\inherit{\overline{h}^\IG}$ &amp; $H^{ig}$ &amp; $\inherit{H_{\mathrm{m}}^\IG}$ &amp; $h^\text{ideal~gas}$ &amp; $\smash{\overline{h}}^\ast$ &amp; $h^\text{id}$ &amp; $H^\text{IG}$ &amp; $H^{ig}$ &amp; $H^o$ &amp; $H^{IG}$ \\
%   ideal gas mixture enthalpy &amp; \verb"\Hm^\IGM" &amp; $\Hm^\IGM$ &amp; $\inherit{\bar{h}^\IG}$ &amp; $\inherit{\overline{h}^\IGM}$ &amp; $H^{ig}$ &amp; $\inherit{H_{\mathrm{m}}^\IGM}$ &amp; $h^\text{ideal}$ &amp; $\smash{\overline{h}}^\ast$ &amp; $h^\text{id}$ &amp; $H^\text{IGM}$ &amp; $H^{ig}$ &amp; $H^o$ &amp; $H^{IG}$ \\
%   ideal solution enthalpy &amp; \verb"\Hm^\IS" &amp; $\Hm^\IS$ &amp; $\inherit{\bar{h}^\IS}$ &amp; $\inherit{\overline{h}^\IS}$ &amp; $H^{is}$ &amp; $\inherit{H_{\mathrm{m}}^\IS}$ &amp; $h^\text{ideal}$ &amp; $\inherit{\smash{\overline{h}}^\IS}$ &amp; $h^\text{(ideal)}$ &amp; $H^\text{IM}$ &amp; $H^{id}$ &amp; $H^{ID}$ &amp; $H^{IS}$ \\
%   inexact differential &amp; \verb"\dbar" &amp; $\dbar$ &amp; $\delta$ &amp; $\delta$ &amp; $d$ &amp; $d$ &amp; $\delta$ &amp; $\delta$ &amp; $\inherit{\dbar}$ &amp; $\inherit{\dbar}$ &amp; $\dbar$ &amp; $\delta$ &amp; $\delta$ \\
%   internal energy (total) &amp; \verb"\Ut" &amp; $\Ut$ &amp; $U$ &amp; $U$ &amp; $\underline{U}$ &amp; $U$ &amp; $U$ &amp; $U$ &amp; $U$ &amp; $U$ &amp; $U^t$ &amp; $\Ut$ &amp; $\Ut$ \\
%   internal energy (molar) &amp; \verb"\Um" &amp; $\Ut$ &amp; $\bar{u}$ &amp; $\overline{u}$ &amp; $U$ &amp; $U_{\mathrm{m}}$ &amp; $u$ &amp; $\overline{u}$ &amp; $u$ &amp; $\Ut$ &amp; $U$ &amp; $U$ &amp; $U$ \\
%   internal energy (specific) &amp; \verb"\Us" &amp; $\Us$ &amp; $u$ &amp; $u$ &amp; $U$ &amp; $\inherit{\Us}$ &amp; $\hat u$ &amp; $u$ &amp; $\inherit{\hat u}$ &amp; $\hat U$ &amp; $U$ &amp; $u$ &amp; $\inherit{\Us}$ \\
%   internal energy (partial molar) &amp; \verb"\Upm_i" &amp; $\Upm_i$ &amp; $\overline{u}_i$ &amp; $\widetilde{u}_i$ &amp; $\overline{U}_i$ &amp; $U_{\mathrm{m}i}$ &amp; $\overline{U}_i$ &amp; $\Upm_i$ &amp; $\overline{u}_i$ &amp; \begin{thermoshortpm}$\Upm_i$\end{thermoshortpm} &amp; \begin{thermoshortpm}$\Upm_i$\end{thermoshortpm} &amp; $\Upm_i$ &amp; $\Upm_i$ \\
%   isothermal compressibility &amp; \verb"\kappaT" &amp; $\kappaT$ &amp; $\kappa$ &amp; $\alpha$ &amp; $\kappa_T$ &amp; $\betaup$ &amp; $\kappa$ &amp; $\kappa$ &amp; $\beta$ &amp; $\kappa_T$ &amp; $\kappa$ &amp; $\kappa_T$ &amp; $\inherit{\kappaT}$ \\
%   isentropic compressibility &amp; \verb"\kappaS" &amp; $\kappaS$ &amp; $\inherit{\kappaS}$ &amp; $\inherit{\alpha_S}$ &amp; $\inherit{\kappa_S}$ &amp; $\inherit{\beta_S}$ &amp; $\inherit{\kappaS}$ &amp; $\alpha$ &amp; $\inherit{\beta_S}$ &amp; $\inherit{\kappaS}$ &amp; $\inherit{\kappaS}$ &amp; $\inherit{\kappaS}$ &amp; $\inherit{\kappaS}$ \\
%   isobaric expansivity &amp; \verb"\alphaP" &amp; $\alphaP$ &amp; $\beta$ &amp; $\beta$ &amp; $\alpha_P$ &amp; $\alpha$ &amp; $\beta$ &amp; $\beta$ &amp; $\alpha$ &amp; $\alpha$ &amp; $\beta$ &amp; $\alpha_P$ &amp; $\inherit{\alphaP}$ \\
%   isentropic expansivity &amp; \verb"\alphaS" &amp; $\alphaS$ &amp; $\inherit{\beta_S}$ &amp; $\inherit{\beta_S}$ &amp; $\inherit{\alpha_S}$ &amp; $\inherit{\alpha_S}$ &amp; $\inherit{\beta_S}$ &amp; $\inherit{\beta_S}$ &amp; $\alpha_S$ &amp; $\inherit{\alphaS}$ &amp; $\inherit{\beta_S}$ &amp; $\inherit{\alphaS}$ &amp; $\inherit{\alphaS}$ \\
%   Joule--Thomson coefficient &amp; \verb"\muJT" &amp; $\muJT$ &amp; $\mu_J$ &amp; $\mu_\text{JT}$ &amp; $\mu_{JT}$ &amp; $\mu_\text{J.T.}$ &amp; $\mu_\text{JT}$ &amp; $\mu_J$ &amp; $\inherit{\muJT}$ &amp; $\mu$ &amp; $\mu$ &amp; $\alpha_H$ &amp; $\alpha_H$ \\
%   moles &amp; \verb"\Nt" &amp; $\Nt$ &amp; $N$ &amp; $N$ &amp; $n$ &amp; $n$ &amp; $n$ &amp; $n$ &amp; $n$ &amp; $N$ &amp; $n$ &amp; $N$ &amp; $n$ \\
%   saturation pressure &amp; \verb"\Psat" &amp; $\Psat$ &amp; $\inherit{\Psat}$ &amp; $P^v$ &amp; $P^{sat}$ &amp; $p$ &amp; $P^\text{sat}$ &amp; $\inherit{P^\text{sat}}$ &amp; $P^s$ &amp; $P^\text{sat}$ &amp; $P^\text{sat}$ &amp; $P^\text{sat}$ &amp; $P^\text{sat}$ \\
%   saturation pressure of $i$ &amp; \verb"\Psat_i" &amp; $\Psat_i$ &amp; $\inherit{\Psat_i}$ &amp; $P^v_i$ &amp; $P^{sat}_i$ &amp; $p^\bullet_i$ &amp; $P^\text{sat}_i$ &amp; $\inherit{P^\text{sat}_i}$ &amp; $P^s_i$ &amp; $P^\text{sat}_i$ &amp; $P^\text{sat}_i$ &amp; $P^\text{sat}_i$ &amp; $P^\text{sat}_i$ \\
%   standard molality &amp; \verb"\Cstd_i" &amp; $\Cstd_i$ &amp; $\inherit{\Cstd_i}$ &amp; $\inherit{\Cstd_i}$ &amp; $m_i^\circ$ &amp; $m_i^\circ$ &amp; $\inherit{C_i^o}$ &amp; $\inherit{\Cstd_i}$ &amp; $C_i^0$ &amp; \text{1~molal} &amp; $m^\circ$ &amp; $m^+$ &amp; $m_i^\circ$ \\
%   standard chemical potential &amp; \verb"\mustd" &amp; $\mustd$ &amp; $\inherit{\mustd}$ &amp; $\inherit{\mustd}$ &amp; $\mu^\circ$ &amp; $\muup^\circ$ &amp; $\mu^o$ &amp; $\overline{g}^\circ$ &amp; $\mu^0$ &amp; $\mu^\circ$ &amp; $G^\circ$ &amp; $\muup^o$ &amp; $\Gamma$ \\
%   standard enthalpy &amp; \verb"\Hm^\std" &amp; $\Hm^\std$ &amp; $\bar{h}^\circ$ &amp; $\smash{\overline{h}}^\circ$ &amp; $H^\circ$ &amp; $H^\circ_{\mathrm{m}}$ &amp; $h^o$ &amp; $\overline{h}^\circ$ &amp; $h^0$ &amp; $\Ht^\circ$ &amp; $H^\circ$ &amp; $H^o$ &amp; $H^\circ$ \\
%   standard enthalphy of formation &amp; \verb"\Deltaf\Hm^std" &amp; $\Deltaf\Hm^\std$ &amp; $\bar{h}^\circ_f$ &amp; $\smash{\overline{h}}_f^\circ$ &amp; $\Delta H_f^\circ$ &amp; $\Delta_f H^\circ_{\mathrm{m}}$ &amp; $\Delta h_f^o$ &amp; $\bar{h}^\circ_{\mathrm{f}}$ &amp; $\Delta h_f^0$ &amp; $\Delta_{\mathrm{f}}\Ht^\circ$ &amp; $\Delta H^\circ_{f298}$ &amp; $\Delta H_f^o$ &amp; $\Delta H_F^\circ$ \\
%   standard enthalphy of formation of $i$ &amp; \verb"\Deltaf\Hm^std_i" &amp; $\Deltaf\Hm^\std_i$ &amp; $\bar{h}^\circ_{f,i}$ &amp; $\smash{\overline{h}}_{f,i}^\circ$ &amp; $\Delta H_{f,i}^\circ$ &amp; $\Delta_f H^\circ_{\mathrm{m}i}$ &amp; $(\Delta h_f^o)_i$ &amp; $(\bar{h}^\circ_{\mathrm{f}})_i$ &amp; $\Delta h_{f\,i}^0$ &amp; $\Delta_{\mathrm{f}}\Ht^\circ_i$ &amp; $\Delta H^\circ_{f298i}$ &amp; $\Delta H^o_{fi}$ &amp; $\Delta H_{F,i}^\circ$ \\
%   standard enthalphy of reaction &amp; \verb"\Deltarxn\Hm^std" &amp; $\Deltarxn\Hm^\std$ &amp; $\inherit{\bar{h}^\circ_\reaction}$ &amp; $\smash{\overline{h}}_R^\circ$ &amp; $\Delta H^\circ$ &amp; $\Delta H_{\mathrm{m}}$ &amp; $\Delta h^o_\text{rxn}$ &amp; $\inherit{\Delta\bar{h}^\circ_\text{rxn}}$ &amp; $\Delta h^0_\text{rxn}$ &amp; $\Delta_\text{rxn}\Ht^\circ$ &amp; $\Delta H^\circ$ &amp; $\Delta H_{rx}^o$ &amp; $\Delta H_R^\circ$ \\
%   standard free energy of formation &amp; \verb"\Deltaf\Gm^std" &amp; $\Deltaf\Gm^\std$ &amp; $\bar{g}^\circ$ &amp; $\smash{\bar{g}}_f^\circ$ &amp; $\Delta G_f^\circ$ &amp; $\Delta_f G^\circ_{\mathrm{m}}$ &amp; $\Delta g_f^o$ &amp; $\bar{g}^\circ_{\mathrm{f}}$ &amp; $\Delta g_f^0$ &amp; $\Delta_{\mathrm{f}}\Gt^\circ$ &amp; $\Delta G^\circ_{f298}$ &amp; $\Delta G_f^o$ &amp; $\Delta G_F^\circ$ \\
%   standard free energy of formation of $i$ &amp; \verb"\Deltaf\Gm_i^std" &amp; $\Deltaf\Gm_i^\std$ &amp; $\bar{g}^\circ_{f,i}$ &amp; $\smash{\bar{g}}_{f,i}^\circ$ &amp; $\Delta G_{f,i}^\circ$ &amp; $\Delta_f G^\circ_{\mathrm{m}i}$ &amp; $(\Delta g_f^o)_i$ &amp; $(\bar{g}^\circ_{\mathrm{f}})_i$ &amp; $\Delta g_{f\,i}^0$ &amp; $\Delta_{\mathrm{f}}\Gt^\circ_i$ &amp; $\Delta G^\circ_{f298i}$ &amp; $\Delta G^o_{fi}$ &amp; $\Delta G_{F,i}^\circ$ \\
%   standard free energy of reaction &amp; \verb"\Deltarxn\Gm^std" &amp; $\Deltarxn\Gm^\std$ &amp; $\inherit{\bar{g}^\circ_\reaction}$ &amp; $\smash{\bar{g}}^\circ_R$ &amp; $\Delta G^\circ$ &amp; $\Delta G_{\mathrm{m}}$ &amp; $\Delta g^o_\text{rxn}$ &amp; $\inherit{\Delta\bar{g}^\circ_\text{rxn}}$ &amp; $\Delta g_\text{rxn}^0$ &amp; $\Delta_\text{rxn}\Gt^\std$ &amp; $\Delta G^\circ$ &amp; $\Delta G^o_{rx}$ &amp; $\Delta G_R^\circ$ \\
%   standard fugacity &amp; \verb"\fstd" &amp; $\fstd$ &amp; $\inherit{f^\circ}$ &amp; $\inherit{f^\circ}$ &amp; $f^\circ$ &amp; $f^\circ$ &amp; $f^o$ &amp; $\inherit{f^\circ}$ &amp; $f^0$ &amp; $\bar f^\circ$ &amp; $f^\circ$ &amp; $\inherit{\fstd}$ &amp; $f^\circ$ \\
%   standard Gibbs free energy &amp; \verb"\Gm^\std" &amp; $\Gm^\std$ &amp; $\bar{g}^\circ$ &amp; $\bar{g}^\circ$ &amp; $G^\circ$ &amp; $G^\circ_{\mathrm{m}}$ &amp; $g^o$ &amp; $\overline{g}^\circ$ &amp; $g^0$ &amp; $\Gt^\circ$ &amp; $G^\circ$ &amp; $G^o$ &amp; $G^\circ$ \\
%   standard Gibbs free energy of $i$ &amp; \verb"\Gm^\std_i" &amp; $\Gm^\std_i$ &amp; $\bar{g}^\circ_i$ &amp; $\bar{g}_i^\circ$ &amp; $G^\circ_i$ &amp; $G^\circ_{\mathrm{m}i}$ &amp; $g_i^o$ &amp; $\overline{g}^\circ_i$ &amp; $g^0_i$ &amp; $\Gt^\circ_i$ &amp; $G^\circ_i$ &amp; $G^o_i$ &amp; $G^\circ_i$ \\
%   standard pressure &amp; \verb"\Pstd" &amp; $\Pstd$ &amp; $P_0$ &amp; $P_0$ &amp; $P^\circ$ &amp; $P^\circ$ &amp; $\inherit{P^o}$ &amp; $p_\text{ref}$ &amp; $P^0$ &amp; \text{1~bar} &amp; $P^\circ$ &amp; $P^\ast$ &amp; $P^\circ$ \\
%   vapor pressure &amp; \verb"\Pvap" &amp; $\Pvap$ &amp; $\inherit{\Pvap}$ &amp; $P^v$ &amp; $P^{std}$ &amp; $p$ &amp; $\inherit{P^\text{sat}}$ &amp; $p_\text{ref}$ &amp; $P^s$ &amp; $P^\text{vap}$ &amp; $P^\text{sat}$ &amp; $P^\text{sat}$ &amp; $P^\text{sat}$ \\
%   volume (total) &amp; \verb"\Vt" &amp; $\Vt$ &amp; $V$ &amp; $V$\footref{fn:XeTeX} &amp; $\Vt$ &amp; $V$ &amp; $V$ &amp; $V$ &amp; $V$ &amp; $V$ &amp; $V^t$ &amp; $\Vt$ &amp; $\Vt$ \\
%   volume (molar) &amp; \verb"\Vm" &amp; $\Vm$ &amp; $\bar{v}$ &amp; $\overline{v}$\footref{fn:XeTeX} &amp; $V$ &amp; $V_{\mathrm{m}}$ &amp; $v$ &amp; $\overline{v}$ &amp; $v$ &amp; $\Vt$ &amp; $V$ &amp; $V$ &amp; $V$ \\
%   volume (specific) &amp; \verb"\Vs" &amp; $\Vs$ &amp; $v$ &amp; $v$\footref{fn:XeTeX} &amp; $V$ &amp; $\inherit{\Vs}$ &amp; $\hat v$ &amp; $v$ &amp; $\inherit{\hat v}$ &amp; $\hat V$ &amp; $V$ &amp; $\inherit{v}$ &amp; $\inherit{\Vs}$ \\
%   volume (molar, residual) &amp; \verb"\VR" &amp; $\VR$ &amp; $\inherit{\bar{v}^\residual}$ &amp; $\inherit{\overline{v}^\residual}$\footref{fn:XeTeX} &amp; $\inherit{V^R}$ &amp; $\inherit{V^{\mathrm{R}}_{\mathrm{m}}}$ &amp; $v^\text{dep}$ &amp; $\inherit{\overline{v}^R}$ &amp; $v^R$ &amp; $\Vt^r$ &amp; $V^R$ &amp; $\inherit{\VR}$ &amp; $V^R$ \\
%   volume (molar, excess) &amp; \verb"\VE" &amp; $\VE$ &amp; $\inherit{\bar{v}^\excess}$ &amp; $\inherit{\overline{v}^\excess}$\footref{fn:XeTeX} &amp; $V^E$ &amp; $V^{\mathrm{E}}_{\mathrm{m}}$ &amp; $v^E$ &amp; $\inherit{\overline{v}^E}$ &amp; $v^E$ &amp; $\Vt^\text{ex}$ &amp; $V^E$ &amp; $V^{EX}$ &amp; $V^{EX}$ \\
%   volume (partial molar, excess) &amp; \verb"\VEpm_i" &amp; $\VEpm_i$ &amp; $\inherit{\overline{v}_i^\excess}$ &amp; $\inherit{\widetilde{v}^\excess}$\footref{fn:XeTeX} &amp; $\smash{\overline{V}}^E_i$ &amp; $V^{\mathrm{E}}_{\mathrm{m}i}$ &amp; $\smash{\overline{V}}^E_i$ &amp; $\inherit{\overline{V}^E_i}$ &amp; $\overline{v}^E_i$ &amp; \begin{thermoshortpm}$\Vpm^{\text{ex}}_i$\end{thermoshortpm} &amp; \begin{thermoshortpm}$\VEpm_i$\end{thermoshortpm} &amp; \begin{thermoshortpm}$\Vpm^{EX}_i$\end{thermoshortpm} &amp; \begin{thermoshortpm}$\Vpm^{EX}_i$\end{thermoshortpm} \\
%   work (total) &amp; \verb"\Wt" &amp; $\Wt$ &amp; $W$ &amp; $W$ &amp; $\underline{W}$ &amp; $W$ &amp; $W$ &amp; $W$ &amp; $W$ &amp; $W$ &amp; $\inherit{W^t}$ &amp; $\inherit{\Wt}$ &amp; $\inherit{\Wt}$ \\
%   work (molar) &amp; \verb"\Wm" &amp; $\Wm$ &amp; $\bar{w}$ &amp; $\overline{w}$ &amp; $W$ &amp; $\inherit{W_{\mathrm{m}}}$ &amp; $w$ &amp; $\inherit{\overline{w}}$ &amp; $\inherit{w}$ &amp; $\inherit{\Wt}$ &amp; $W$ &amp; $W$ &amp; $W$ \\
%   work (specific) &amp; \verb"\Ws" &amp; $\Ws$ &amp; $w$ &amp; $w$ &amp; $W$ &amp; $\inherit{\Ws}$ &amp; $\hat w$ &amp; $\inherit{w}$ &amp; $\inherit{\hat w}$ &amp; $\inherit{\hat W}$ &amp; $\inherit{W}$ &amp; $w$ &amp; $\inherit{\Ws}$ \\
% \end{mpsupertabular}
% \end{landscape}
%
%^^X \end{documentation}
%
% \setcounter{IndexColumns}{2}
% \StopEventually{\PrintChanges\PrintIndex}
%
% ^^A--------------------------------------------------------------------------
% \iffalse
%&lt;*package&gt;
%&lt;@@=thermodynamics&gt;
% \fi
%
%^^X\begin{implementation}
% \section{Implementation}
% We set up some non-standard token comparison variants; these are designed
% to catch both \cs{ncomponents}=\cs{ncomponents} and \cs{ncomponents}=$C$
% (using the default options); we have to define \cs{ncomponents} to be
% expandable to make these work at all.
%    \begin{macrocode}
\ExplSyntaxOn
\cs_generate_variant:Nn \tl_if_eq:nnTF { xxTF }
%    \end{macrocode}
%
% This package requires the \pkg{amstext} package, as \tn{text} is used to
% handle \cs{sat}, \cs{IS}, \cs{IG}, \cs{IGM}, \cs{Henrymol}, \cs{fusion},
% \cs{reaction}, \cs{vaporization}, and \cs{sublimation} by default, as well
% as several other macros defined by package options.
%    \begin{macrocode}
\RequirePackage{amstext}
%    \end{macrocode}
%
% \subsection{Symbols Controlled by Package Options}
% We set some symbols prior to declaring the package options. The default
% symbols follow package option |EUAGHan|, even though the macros follow
% the option |EUFGHAN|.
%
% \begin{macro}{\dbar}
% The way \cs{dbar} is defined depends on the typeface you are using.
% We try to determine, at \verb"\begin{document}", which typeface you chose
% based on the packages that are loaded and some of their internal definitions.
% The \textsf{thermodynamics} package currently supports
% Computer Modern (the default or through \pkg{lmodern}),
% Palatino (through \pkg{pxfonts} or \pkg{newpxmath}),
% Times (through \pkg{txfonts}, \pkg{mathptmx}, or \pkg{newtxmath}),
% Utopia (through \pkg{mathdesign}),
% Bitstream Charter (through \pkg{mathdesign}), and
% Garamond (through \pkg{mathdesign}).
% Definitions of \cs{dbar} (with \cs{newcommand*}, \cs{providecommand*},
% \cs{NewDocumentCommand}, or \cs{ProvideDocumentCommand})
% in the preamble will override the ones here.
%    \begin{macrocode}
\AtBeginDocument{
    \@ifpackageloaded{pxfonts}{%
        \ProvideDocumentCommand{\dbar}{}
            {\mkern5mu\mathchar'26\mkern-10mu d}
    }{}
    \@ifpackageloaded{newpxmath}{%
        \ProvideDocumentCommand{\dbar}{}
            {\mkern5mu\mathchar'26\mkern-10mu d}
    }{}
    \@ifpackageloaded{txfonts}{%
        \ProvideDocumentCommand{\dbar}{}
            {\mkern5mu\mathchar'26\mkern-11mu d}
    }{}
    \@ifpackageloaded{mathptmx}{%
        \ProvideDocumentCommand{\dbar}{}
            {\mkern5mu\mathchar'26\mkern-10mu d}
    }{}
    \@ifpackageloaded{newtxmath}{%
        \ProvideDocumentCommand{\dbar}{}
            {\mkern5mu\mathchar'26\mkern-11mu d}
    }{}
    \@ifpackageloaded{mathdesign}{%
        \tl_const:Nn \c_@@_charter_tl {mdbch}
        \tl_const:Nn \c_@@_utopia_tl {mdput}
        \tl_const:Nn \c_@@_garamond_tl {mdugm}
        \tl_if_eq:NNT \MD@default@family \c_@@_utopia_tl
        { \ProvideDocumentCommand{\dbar}{}
            {\mkern5mu\mathchar'26\mkern-20mu d}
        }
        \tl_if_eq:NNT \MD@default@family \c_@@_charter_tl
        { \ProvideDocumentCommand{\dbar}{}
            {\mkern5mu\mathchar'26\mkern-15mu d}
        }
        \tl_if_eq:NNT \MD@default@family \c_@@_garamond_tl
        { \ProvideDocumentCommand{\dbar}{}
            {\mkern5mu\mathchar'26\mkern-17mu d}
        }
    }{}
    % Defaults to Computer Modern
    \ProvideDocumentCommand{\dbar}{}
        {\mkern3mu\mathchar'26\mkern-12mu d}
}
%    \end{macrocode}
% \end{macro}
%
% Symbols are defined for the total energy, internal energy, Helmholtz free
% energy, Gibbs free energy, grand potential (Landau free energy), enthalpy,
% entropy, surface area, volume, number of moles, heat, and work; these are
% $E$, $U$, $A$, $G$, $\Omega$, $H$, $S$, $a$, $V$, $n$, $Q$, and $W$,
% respectively. These commands should not be used on their own, but rather
% accessed through the macros \cs{Ut}, \cs{Um}, and \cs{Us} (using the internal
% energy as an example).
%
% The default symbols are not intended to be easy to change---the intended
% mechanism is through package options. If you want to use a non-standard
% symbol that is not available through one of the package options, you can
% redefine the internal token lists inside
% \cs{ExplSyntaxOn}\,\dots\!\cs{ExplSyntaxOff}. For example,
% \begin{verbatim}
%    \ExplSyntaxOn
%       \tl_gset:Nn \g__thermodynamics_Helmholtz_symbol {H}
%       \tl_gset:Nn \g__thermodynamics_enthalpy_symbol {h}
%    \ExplSyntaxOff
%\end{verbatim}
% would define the ill-advised notation that I have nonetheless heard of
% that uses $H$ for Helmholtz free energy and $h$ for enthalpy.
% Note that the macros for temperature and pressure are only used inside
% the definitions of the compressibilities, expansivities, and heat
% capacities; there is no user-level macro for the temperature or the pressure,
% so it is up to the user to use consistent symbols for those properties.
%    \begin{macrocode}
\tl_new:N \g_@@_total_energy_symbol
\tl_new:N \g_@@_internal_energy_symbol
\tl_new:N \g_@@_Helmholtz_symbol
\tl_new:N \g_@@_Gibbs_symbol
\tl_new:N \g_@@_Landau_symbol
\tl_new:N \g_@@_enthalpy_symbol
\tl_new:N \g_@@_entropy_symbol
\tl_new:N \g_@@_area_symbol
\tl_new:N \g_@@_volume_symbol
\tl_new:N \g_@@_mole_symbol
\tl_new:N \g_@@_heat_symbol
\tl_new:N \g_@@_work_symbol
\tl_new:N \g_@@_temperature_symbol
\tl_new:N \g_@@_pressure_symbol

\tl_gset:Nn \g_@@_total_energy_symbol E
\tl_gset:Nn \g_@@_internal_energy_symbol U
\tl_gset:Nn \g_@@_Helmholtz_symbol A
\tl_gset:Nn \g_@@_Gibbs_symbol G
\cs_if_exist:NTF \Omegait
{ \tl_gset:Nn \g_@@_Landau_symbol \Omegait }
{ \tl_gset:Nn \g_@@_Landau_symbol \Omega }
\tl_gset:Nn \g_@@_enthalpy_symbol H
\tl_gset:Nn \g_@@_entropy_symbol S
\tl_gset:Nn \g_@@_area_symbol a
\tl_gset:Nn \g_@@_volume_symbol V
\tl_gset:Nn \g_@@_mole_symbol n
\tl_gset:Nn \g_@@_heat_symbol Q
\tl_gset:Nn \g_@@_work_symbol W
\tl_gset:Nn \g_@@_temperature_symbol T
\tl_gset:Nn \g_@@_pressure_symbol P
%    \end{macrocode}
%
% We then define two functions and several lengths that we shall use when
% drawing rules above or below a symbol. The default is to use underlined
% symbols for extensive quantities, plain symbols for molar quantities, and
% carets for specific quantities, but this can be changed using package
% options.
%^^A TODO these might work better as kern 0.1*width, symbol, kern 0.2*width
%    \begin{macrocode}
\cs_new:Nn \@@_underline:n
{ \mkern1mu\underline{\mkern-1mu #1\mkern-4mu}\mkern4mu }
\cs_new:Nn \@@_overline:n
{ \mkern2mu\overline{\mkern-2mu #1\mkern-1mu}\mkern1mu }
%    \end{macrocode}
%
% \begin{macro}{\PartialOpen,\PartialClose,\PartialEmptyClose}
% We define three commands to use to denote the beginning and end of partial
% derivatives. These symbols can be customized by package options. Default
% is |parentheses|, meaning that \verb"\[ \Partial{f}{x}{y} \]" renders as
% \[ \left(\frac{\partial f}{\partial x}\right)_y \]
% with the defaults. The macro \cs{PartialEmptyClose} is used when the last
% argument to \cs{Partial} is empty, which is important for the |bar|
% option to the document class or inside the \env{thermobar} environment.
%    \begin{macrocode}
\tl_new:N \l_@@_PartialOpen_tl
\tl_new:N \l_@@_PartialEmptyClose_tl
\tl_new:N \l_@@_PartialClose_tl

\tl_set:Nn \l_@@_PartialOpen_tl {(}
\tl_set:Nn \l_@@_PartialClose_tl {)}
\tl_set:Nn \l_@@_PartialEmptyClose_tl {)}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Package Options}
% We declare a bunch of options for which sets of symbols to use.
% These are summarized in Table~\ref{table:symbol-sets}.
% \changes{v1.01}{2023/09/15}{Changed options with two $E$ or two $A$
%    variables to use calligraphic letters for the less-common of the two.}
%    \begin{macrocode}
\DeclareOption{EUAGHan}{}% the default
\DeclareOption{EUAGHaN}{\tl_gset:Nn \g_@@_mole_symbol N}%
\DeclareOption{EUHAGan}{\ExecuteOptions{EUAGHan}}
\DeclareOption{EUHAGaN}{\ExecuteOptions{EUAGHaN}}
\DeclareOption{EUFGHAn}{%
  \tl_gset:Nn \g_@@_Helmholtz_symbol F
  \tl_gset:Nn \g_@@_area_symbol A
}
\DeclareOption{EUFGHAN}{%
  \tl_gset:Nn \g_@@_Helmholtz_symbol F
  \tl_gset:Nn \g_@@_area_symbol A
  \tl_gset:Nn \g_@@_mole_symbol N
}
\DeclareOption{EEFGHAn}{%
  \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
  \tl_gset:Nn \g_@@_internal_energy_symbol E
  \tl_gset:Nn \g_@@_Helmholtz_symbol F
  \tl_gset:Nn \g_@@_area_symbol A
}
\DeclareOption{EEFGHAN}{%
  \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
  \tl_gset:Nn \g_@@_internal_energy_symbol E
  \tl_gset:Nn \g_@@_Helmholtz_symbol F
  \tl_gset:Nn \g_@@_area_symbol A
  \tl_gset:Nn \g_@@_mole_symbol N
}
\DeclareOption{EEFGHan}{%
  \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
  \tl_gset:Nn \g_@@_internal_energy_symbol E
  \tl_gset:Nn \g_@@_Helmholtz_symbol F
}
\DeclareOption{EEFGHaN}{%
  \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
  \tl_gset:Nn \g_@@_internal_energy_symbol E
  \tl_gset:Nn \g_@@_Helmholtz_symbol F
  \tl_gset:Nn \g_@@_mole_symbol N
}
\DeclareOption{EEAGHan}{%
  \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
  \tl_gset:Nn \g_@@_internal_energy_symbol E
}
\DeclareOption{EEAGHaN}{%
  \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
  \tl_gset:Nn \g_@@_internal_energy_symbol E
  \tl_gset:Nn \g_@@_mole_symbol N
}
\DeclareOption{EUAGHAn}{%
  \tl_gset:Nn \g_@@_area_symbol {\mathcal{A}}
}
\DeclareOption{EUAGHAN}{%
  \tl_gset:Nn \g_@@_area_symbol {\mathcal{A}}
  \tl_gset:Nn \g_@@_mole_symbol N
}
\DeclareOption{EUFGHan}{%
  \tl_gset:Nn \g_@@_Helmholtz_symbol F
}
\DeclareOption{EUFGHaN}{%
  \tl_gset:Nn \g_@@_Helmholtz_symbol F
  \tl_gset:Nn \g_@@_mole_symbol N
}
%    \end{macrocode}
% The |delta| option redefines \cs{dbar} to produce the symbol $\delta$.
% The default is to use a $d$ with a slash through it ($\dbar$) for inexact
% differentials unless the user overrides it with this option. The macro could
% also be redefined manually, of course.
%    \begin{macrocode}
\DeclareOption{delta}{ \cs_set_eq:NN \dbar \delta }
%    \end{macrocode}
%
% Next, we define options for the set of notation. The default is
% |intensive-plain|, which produces things like $V$ for molar volume,
% $\Vt$ for total volume, and $\hat V$ for specific volume.
% The symbols themselves are produced via internal (non-user-facing) macros.
%    \begin{macrocode}
\cs_new:Nn \@@_extensive:n {#1}
\cs_new:Nn \@@_intensive:n {#1}
\cs_new:Nn \@@_specific:n {\hat{#1}}

\cs_new:Npn \@@_set_intensive_plain
{
  \cs_set:Nn \@@_extensive:n {\@@_underline:n{##1}}
  \cs_set:Nn \@@_intensive:n {##1}
}
\cs_new:Npn \@@_set_extensive_plain
{
  \cs_set:Nn \@@_extensive:n {##1}
  \cs_set:Nn \@@_intensive:n {\@@_underline:n{##1}}
}
\cs_new:Npn \@@_set_lowercase_pms
{
  \RenewDocumentCommand{\partialmolar}{m}
  {
    \tl_set:Nn \l_@@_pm_symbol_tl {\text_lowercase:n {##1}}
    \@@_generic_pm:
  }
}
\cs_new:Npn \@@_set_intensive_lowercase
{
  \cs_set:Nn \@@_extensive:n {\text_uppercase:n {##1}}
  \cs_set:Nn \@@_intensive:n {\text_lowercase:n {##1}}
  \cs_set:Nn \@@_specific:n {\hat{\text_lowercase:n {##1}}}
}
\cs_new:Npn \@@_set_extensive_superscripts
{
  \cs_set:Nn \@@_extensive_one:n
  { \c_math_superscript_token {##1\l_@@_super_separator_tl t} }
  \cs_set:Nn \@@_extensive:n
  {
     \peek_catcode_remove:NTF \c_math_superscript_token
     { ##1 \@@_extensive_one:n }
     { ##1 \c_math_superscript_token t }
  }
  \cs_set:Nn \@@_intensive:n {##1}
}
\DeclareOption{extensive-plain}{\@@_set_extensive_plain}
\DeclareOption{intensive-plain}{\@@_set_intensive_plain} % the default
\DeclareOption{intensive-lowercase}{% PLEASE don't use this!
  \@@_set_intensive_lowercase
  \AtEndOfPackage{
    \@@_set_lowercase_pms
  }
}
\DeclareOption{extensive-superscript}{%
  \@@_set_extensive_superscripts
%^^A  \AtEndOfPackage{%
%^^A    \RenewDocumentCommand{\URt}{}{\g_@@_internal_energy_symbol
%^^A      \c_math_superscript_token{\residual,t}}
%^^A    \RenewDocumentCommand{\HRt}{}{\g_@@_enthalpy_symbol
%^^A      \c_math_superscript_token{\residual,t}}
%^^A    \RenewDocumentCommand{\FRt}{}{\g_@@_Helmoholtz_symbol
%^^A      \c_math_superscript_token{\residual,t}}
%^^A    \RenewDocumentCommand{\GRt}{}{\g_@@_Gibbs_symbol
%^^A      \c_math_superscript_token{\residual,t}}
%^^A    \RenewDocumentCommand{\VRt}{}{\g_@@_volume_symbol
%^^A      \c_math_superscript_token{\residual,t}}
%^^A    \RenewDocumentCommand{\SRt}{}{\g_@@_entropy_symbol
%^^A      \c_math_superscript_token{\residual,t}}
%^^A    \RenewDocumentCommand{\UEt}{}{\g_@@_internal_energy_symbol
%^^A      \c_math_superscript_token{\excess,t}}
%^^A    \RenewDocumentCommand{\HEt}{}{\g_@@_enthalpy_symbol
%^^A      \c_math_superscript_token{\excess,t}}
%^^A    \RenewDocumentCommand{\FEt}{}{\g_@@_Helmoholtz_symbol
%^^A      \c_math_superscript_token{\excess,t}}
%^^A    \RenewDocumentCommand{\GEt}{}{\g_@@_Gibbs_symbol
%^^A      \c_math_superscript_token{\excess,t}}
%^^A    \RenewDocumentCommand{\VEt}{}{\g_@@_volume_symbol
%^^A      \c_math_superscript_token{\excess,t}}
%^^A    \RenewDocumentCommand{\SEt}{}{\g_@@_entropy_symbol
%^^A      \c_math_superscript_token{\excess,t}}
%^^A  }
}
%    \end{macrocode}
% \begin{environment}{thermolongpm,thermoshortpm}
% The |longpm| option (the default) makes partial molar quantities that
% look like \(\UEpm_i\). The |shortpm| option (which is used by several
% textbooks) makes partial molar quantities look like
% \(\smash{\mkern2mu\overline{\mkern-2mu U}}_i^E\).
% The environments \env{thermolongpm} and \env{thermoshortpm} do the same
% thing locally.
% \changes{v2.02}{2024/06/14}{Added ``longpm'' and ``shortpm'' options to
%   control how partial molar properties are rendered along with the
%   environments \env{thermolongpm} and \env{thermoshortpm} to change them
%   locally.}
%    \begin{macrocode}
\bool_new:N \l_@@_longpm_bool
\DeclareOption{longpm}{\bool_set_true:N \l_@@_longpm_bool}
\cs_set_eq:NN \@@_overline_copy:n \@@_overline:n
\DeclareOption{shortpm}{
  \bool_set_false:N \l_@@_longpm_bool
  \AtEndOfPackage{
    \RenewDocumentCommand{\cPpm}{}
    {
      \cs_set:Nn \@@_overline:n {##1}
      \partialmolar{\cPpmshort}
    }
    \RenewDocumentCommand{\cVpm}{}
    {
      \cs_set:Nn \@@_overline:n {##1}
      \partialmolar{\cVpmshort}
    }
  }
}
\NewDocumentEnvironment{thermolongpm}{}{%
  \bool_set_true:N \l_@@_longpm_bool
}{}
\NewDocumentEnvironment{thermoshortpm}{}{%
  \bool_set_false:N \l_@@_longpm_bool
     \RenewSubscriptedSymbol{\cPpm}{\@@_overline:n \heatcapacitysymbol}
        {\g_@@_pressure_symbol}
     \RenewSubscriptedSymbol{\cVpm}{\@@_overline:n \heatcapacitysymbol}
        {\g_@@_volume_symbol}
}{}
%    \end{macrocode}
% \end{environment}
%
% The next two options choose whether variables held constant are subscripted
% (the default) or placed next to the function. The difference is
%  \[ \Partial{\Um}{\Sm}{\Vm} \quad\text{versus}\quad
%     \begin{thermoNOsubscripts}
%       \Partial{\Um}{\Sm}{\Vm}
%     \end{thermoNOsubscripts} \]
% for \verb"subscripts" and \verb"nosubscripts", respectively.
%    \begin{macrocode}
\bool_new:N \l_@@_subscripted_bool
\bool_set_true:N \l_@@_subscripted_bool
\DeclareOption{subscripts}{\bool_set_true:N \l_@@_subscripted_bool}
\DeclareOption{nosubscripts}{\bool_set_false:N \l_@@_subscripted_bool}
%    \end{macrocode}
% These options change how \cs{Partial} and friends render derivatives.
% The default is parentheses, but other options include brackets, braces,
% a vertical bar on the right side, or plain (undecorated) derivatives.
%    \begin{macrocode}
\DeclareOption{parentheses}{}
\DeclareOption{brackets}{%
  \tl_set:Nn \l_@@_PartialOpen_tl {[}
  \tl_set:Nn \l_@@_PartialClose_tl {]}
  \tl_set:Nn \l_@@_PartialEmptyClose_tl {]}
}
\DeclareOption{braces}{%
  \tl_set:Nn \l_@@_PartialOpen_t1 {\{}
  \tl_set:Nn \l_@@_PartialClose_t1 {\}}
  \tl_set:Nn \l_@@_PartialEmptyClose_tl {\}}
}
\DeclareOption{bar}{%
  \tl_set:Nn \l_@@_PartialOpen_tl {.}
  \tl_set:Nn \l_@@_PartialClose_tl {\rvert}
  \tl_set:Nn \l_@@_PartialEmptyClose_tl {.}
}
\DeclareOption{plain-derivatives}{% This implies dU(S,V,N)/dS notation
  \tl_set:Nn \l_@@_PartialOpen_tl {.}
  \tl_set:Nn \l_@@_PartialClose_tl {.}
  \tl_set:Nn \l_@@_PartialEmptyClose_tl {.}
  \ExecuteOptions{nosubscripts}
}
%    \end{macrocode}
% \subsection{The Number of Moles Macros}
% \begin{macro}{\ncomponents}
% We define the number of components, default $C$, for use in the ``all moles''
% and related macros. The command is expandable so we can perform comparisons
% to user-entered values.
%    \begin{macrocode}
\NewExpandableDocumentCommand \ncomponents {} {C}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\allNs,\allXs,\allYs,\allmus,\allMs,\allWs}
% Several macros define a shorthand for ``moles of all species'' (\cs{allNs})
% and ``moles of all species except'' (\cs{allNsbut}), as well as similar
% quantities for masses (\cs{allMs}, \cs{allMsbut}) and chemical potentials
% (\cs{allmus}, \cs{allmusbut}), which occur frequently in mixture
% thermodynamics. The default is for \cs{allNs} to become $\vec{n}$ and
% \verb"allNsbut{i}" to become $n_{j\neq i}$. The optional argument changes
% which index (default: $j$) to use in the left side of the inequality.\relax
% \footnote{The index \!$j$ is automatically replaced with $k$ if the user
%   issues \texttt{\textbackslash allNsbut\{j\}}.}
% Essentially identical commands are defined for chemical potentials and
% masses: \cs{allmus} and \cs{allmusbut} and \cs{allMs} and \cs{allMsbut},
% respectively.
%    \begin{macrocode}
\NewDocumentCommand{\allNs}{O{i}}{\allcomponents[#1]{\Nt}}
\NewDocumentCommand{\allXs}{O{i}}{\allcomponents[#1]{x}}
\NewDocumentCommand{\allYs}{O{i}}{\allcomponents[#1]{y}}
\NewDocumentCommand{\allmus}{O{i}}{\allcomponents[#1]{\mu}}
\NewDocumentCommand{\allMs}{O{i}}{\allcomponents[#1]{m}}
\NewDocumentCommand{\allWs}{O{i}}{\allcomponents[#1]{w}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\allNsbut,\allXsbut,\allYsbut,\allMsbut,\allWsbut}
% Similar commands are defined for mole fractions (\cs{allXs}, \cs{allYs},
% etc.), but these assume the last mole fraction is \emph{not} one of the
% variables---that is, \cs{allXsbut} and \cs{allYsbut} assume the argument
% \emph{and} \cs{ncomponents} are held constant. For example,
% \begin{verbatim}
%   \[ \Partial{\Gm}{T}{P,\allXs} = -\Sm \qquad
%      \Partial{\Gm}{x_i}{T,P,\allXsbut{i}} \neq \Gpm_i \]
%\end{verbatim}
% yields
% \[ \Partial{G}{T}{P,\allXs} = -S \qquad
%    \Partial{G}{x_i}{T,P,x_{j\neq i,C}} \neq \Gpm{i}. \]
%    \begin{macrocode}
\NewDocumentCommand{\allNsbut}{O{j} m} {\allbut[#1]{#2}{\Nt}}
\NewDocumentCommand{\allXsbut}{O{j} m} {\allbutlastand[#1]{#2}{x}}
\NewDocumentCommand{\allYsbut}{O{j} m} {\allbutlastand[#1]{#2}{y}}
\NewDocumentCommand{\allmusbut}{O{j} m} {\allbut[#1]{#2}{\mu}}
\NewDocumentCommand{\allMsbut}{O{j} m} {\allbut[#1]{#2}{m}}
\NewDocumentCommand{\allWsbut}{O{j} m} {\allbutlastand[#1]{#2}{w}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\allbutlastand,\allbut,\allcomponents}
% \changes{v1.01}{10/04/2023}{Updated \cs{allcomponents} to include an
%   optional argument that changes $N_i$ to $N_j$, say, when using
%   TesterModell or other options that denote moles of all components that
%   way. Similar updates to \cs{allNs} and friends.}
% The \cs{allcomponents}, \cs{allbut}, and \cs{allbutlastand} macros can be
% used to define new entities; say, if you want to use $z_i$ as a mole
% fraction, then use
% \begin{verbatim}
%   \NewDocumentCommand{\allZsbut}{O{j} m}{\allbutlastand[#1]{#2}{z}}
%\end{verbatim}
% Similarly, something meaning the concentrations of every species could be
% defined via
% \begin{verbatim}
%   \NewDocumentCommand{\allCs}{O{}}{\allcomponents{C}}
%\end{verbatim}
%    \begin{macrocode}
\NewDocumentCommand{\allcomponents}{O{} m}{\vec{#2}}
\NewDocumentCommand{\allbut}{O{j} m m}
{ \tl_if_eq:nnTF {#1} {#2}
  { {#3}\c_math_subscript_token{k \neq #2} }
  { {#3}\c_math_subscript_token{#1 \neq #2} }
}
\NewDocumentCommand{\allbutlastand}{O{j} m m}
{ \tl_if_eq:xxTF {#2} {\ncomponents}
  { {#3}\c_math_subscript_token{#1 \neq #2} }
  { \tl_if_eq:nnTF {#1} {#2}
    { {#3}\c_math_subscript_token{k \neq #2,\ncomponents} }
    { {#3}\c_math_subscript_token{#1 \neq #2,\ncomponents} }
  }
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Package Options}
% We define two package options that change how to render \cs{allNs} and
% friends.\relax
% \changes{v1.01}{2022/05/04}{Fixed bug in \cs{allbutlastand} when using the
%   |moles-range| option ($C$ should have been $C-1$ in the last option).}
%    \begin{macrocode}
\DeclareOption{moles-index}{}
\DeclareOption{moles-range}{ \@@_set_moles_range }
\cs_new:Npn \@@_set_moles_range {%
  \RenewDocumentCommand{\allcomponents}{O{} m}
  { {##2}\c_math_subscript_token 1,\dots,
        {##2}\c_math_subscript_token{\ncomponents} }
  \RenewDocumentCommand{\allbut}{O{j} m m}
  { \tl_if_eq:nnTF {##2} {1}
    { {##3}\c_math_subscript_token 2,\dots,
        {##3}\c_math_subscript_token{\ncomponents} }
    { \tl_if_eq:xxTF {##2} {\ncomponents}
      { {##3}\c_math_subscript_token 1,\dots,
          {##3}\c_math_subscript_token{\ncomponents-1} }
      { {##3}\c_math_subscript_token 1,\dots,
            [{##3}\c_math_subscript_token{##2}],
            \dots,{##3}\c_math_subscript_token{\ncomponents} }
    }
  }
  \RenewDocumentCommand{\allbutlastand}{O{j} m m}
  { \tl_if_eq:nnTF {##2} {1}
    { {##3}\c_math_subscript_token 2,\dots,
        {##3}\c_math_subscript_token{\ncomponents-1} }
    { \tl_if_eq:xxTF {##2} {\ncomponents}
      { {##3}\c_math_subscript_token 1,\dots,
        {##3}\c_math_subscript_token{\ncomponents-1}
      }
      { \tl_if_eq:xxTF {##2} {\ncomponents-1}
        { {##3}\c_math_subscript_token 1,\dots,
          {##3}\c_math_subscript_token{\ncomponents-2} }
        {
          {##3}\c_math_subscript_token 1,\dots,
          [{##3}\c_math_subscript_token{##2}],\dots,
           {##3}\c_math_subscript_token{\ncomponents-1}
        }
      }
    }
  }
}
%    \end{macrocode}
% The remaining options define textbook-specific notation.
% \changes{v2.02}{2024/06/14}{Added \texttt{KlotzRosenberg} option.}
%    \begin{macrocode}
\DeclareOption{Bejan}{
  \ExecuteOptions{EUFGHAN,intensive-lowercase,delta,shortpm}
  \AtEndOfPackage{
    \cs_set:Nn \@@_specific:n {\text_lowercase:n {#1}}
    \cs_set:Nn \@@_intensive:n {\bar{\text_lowercase:n {#1}}}
    \cs_set:Nn \@@_extensive:n {\text_uppercase:n {#1}}
    \tl_gset:Nn \g_@@_volume_symbol v
    \RenewExpandableDocumentCommand{\ncomponents}{}{n}
    \RenewSubscriptedSymbol{\Lt}{\g_@@_Helmholtz_symbol}{\mu}
    \RenewSubscriptedSymbol{\Lm}
        {\bar{\text_lowercase:n \g_@@_Helmholtz_symbol}}{\mu}
    \RenewSubscriptedSymbol{\Ls}
        {\text_lowercase:n \g_@@_Helmholtz_symbol}{\mu}
    \cs_new:Npn \Delta_vap_sym {} {}
    \NewSubscriptedSymbol{\Delta_vap}{\Delta_vap_sym}{{fg}}
    \RenewDocumentCommand{\Deltavap}{m}{
      \cs_set:Npn \Delta_vap_sym {} {#1}
      \Delta_vap
    }
    \cs_new:Npn \Delta_fus_sym {} {}
    \NewSubscriptedSymbol{\Delta_fus}{\Delta_fus_sym}{{sf}}
    \RenewDocumentCommand{\Deltafus}{m}{
      \cs_set:Npn \Delta_fus_sym {} {#1}
      \Delta_fus
    }
    \cs_new:Npn \Delta_sub_sym {} {}
    \NewSubscriptedSymbol{\Delta_sub}{\Delta_sub_sym}{{sg}}
    \RenewDocumentCommand{\Deltasub}{m}{
      \cs_set:Npn \Delta_sub_sym {} {#1}
      \Delta_sub
    }
    \RenewExpandableDocumentCommand{\heatcapacitysymbol}{}{c}
    \RenewSubscriptedSymbol{\cV}{\@@_intensive:n {\heatcapacitysymbol}}
        {\text_lowercase:n \g_@@_volume_symbol}
    \RenewSubscriptedSymbol{\cVt}{\@@_extensive:n {\heatcapacitysymbol}}
        {\text_uppercase:n \g_@@_volume_symbol}
    \RenewSubscriptedSymbol{\cVpm}{\heatcapacitysymbol}
        {\text_lowercase:n \g_@@_volume_symbol}
    \RenewSubscriptedSymbol{\cPpm}{\heatcapacitysymbol}
        {\text_lowercase:n \g_@@_pressure_symbol}
    \RenewExpandableDocumentCommand{\xrxn}{}{\zeta}
    \RenewDocumentCommand{\fmix}{}{f}
    \RenewDocumentCommand{\Qm}{}{Q}
    \RenewDocumentCommand{\Qs}{}{Q}
    \RenewExpandableDocumentCommand{\kappaT}{}{\compressibilitysymbol}
    \RenewExpandableDocumentCommand{\expansivitysymbol}{}{\beta}
    \RenewExpandableDocumentCommand{\alphaP}{}{\expansivitysymbol}
    \RenewSubscriptedSymbol{\muJT}{\JTsymbol}{J}
    \RenewDocumentCommand{\Deltaf}{m}
    { \tl_set:Nn \l_@@_Deltaf_sym_tl {#1} \@@_Deltaf }
    \RenewDocumentCommand{\Pstd}{}{P\c_math_subscript_token 0}
    \RenewDocumentCommand{\Wm}{}{W}
    \RenewDocumentCommand{\Ws}{}{W}
    \cs_new:Nn \@@_fpure_one:n
    {
      f\c_math_subscript_token{#1}
      \peek_catcode_remove:NF \c_math_superscript_token
      { \c_math_superscript_token\bullet }
    }
    \RenewDocumentCommand{\fpure}{}
    {
      \peek_catcode_remove:NTF \c_math_subscript_token
      { \@@_fpure_one:n }
      { f }
    }
    \cs_new:Nn \@@_phipure_one:n
    {
      \phi\c_math_subscript_token{#1}
      \peek_catcode:NF \c_math_superscript_token
      { \c_math_superscript_token\bullet }
    }
    \RenewDocumentCommand{\phipure}{}
    {
      \peek_catcode_remove:NTF \c_math_subscript_token
      {
        \@@_phipure_one:n
      }
      {\phi}
    }
    \RenewDocumentCommand{\phimix}{}{\phi}
  }
}
\DeclareOption{CBK}{
  \ExecuteOptions{EUAGHAN,intensive-lowercase,delta,shortpm}
  \AtEndOfPackage{
    \cs_set:Nn \@@_overline:n {\widetilde #1}
    \cs_set:Nn \@@_overline_copy:n {\widetilde #1}
    \cs_set:Nn \@@_specific:n {\text_lowercase:n {#1}}
    \cs_set:Nn \@@_intensive:n {\bar{\text_lowercase:n{#1}}}
    \tl_gset:Nn \g_@@_area_symbol A
    \RenewExpandableDocumentCommand{\reaction}{}{R}
    \cs_new:Npn \Delta_vap_sym {} {}
    \NewSubscriptedSymbol{\Delta_vap}{\Delta_vap_sym}{{fg}}
    \RenewDocumentCommand{\Deltavap}{m}{
      \cs_set:Npn \Delta_vap_sym {} {#1}
      \Delta_vap
    }
    \cs_new:Npn \Delta_fus_sym {} {}
    \NewSubscriptedSymbol{\Delta_fus}{\Delta_fus_sym}{{sf}}
    \RenewDocumentCommand{\Deltafus}{m}{
      \cs_set:Npn \Delta_fus_sym {} {#1}
      \Delta_fus
    }
    \cs_new:Npn \Delta_sub_sym {} {}
    \NewSubscriptedSymbol{\Delta_sub}{\Delta_sub_sym}{{sg}}
    \RenewDocumentCommand{\Deltasub}{m}{
      \cs_set:Npn \Delta_sub_sym {} {#1}
      \Delta_sub
    }
    \tl_gset:Nn \g_@@_pressure_symbol p
    \RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\alpha}
    \RenewExpandableDocumentCommand{\expansivitysymbol}{}{\beta}
    \RenewExpandableDocumentCommand{\kappaT}{}{\compressibilitysymbol}
    \RenewExpandableDocumentCommand{\alphaP}{}{\expansivitysymbol}
    \RenewSuperscriptedSymbol{\Psat}{P}{v}
    \RenewDocumentCommand{\Deltaf}{m}
    { \tl_set:Nn \l_@@_Deltaf_sym_tl {#1}
      \@@_Deltaf
    }
    \RenewDocumentCommand{\Pstd}{}{P\c_math_subscript_token 0}
    \RenewDocumentCommand{\Lm}{}{\@@_intensive:n\omega}
    \RenewDocumentCommand{\Ls}{}{\@@_specific:n\omega}
  }
}
\DeclareOption{ElliottLira}{
  \ExecuteOptions{shortpm}
  \AtEndOfPackage{
    \cs_gset_eq:NN \@@_specific:n \@@_intensive:n
    %^^A\RenewDocumentCommand{\partialmolar}{m}{\@@_overline:n #1}
    \RenewDocumentCommand{\allcomponents}{O{} m}{#2}
    \RenewDocumentCommand{\Deltarxn}{m}{\Delta #1}
    \RenewDocumentCommand{\fusion}{}{{fus}}
    \RenewDocumentCommand{\sublimation}{}{{sub}}
    \RenewDocumentCommand{\vaporization}{}{{vap}}
    \RenewDocumentCommand{\sat}{}{{sat}}
    %^^A\RenewSubscriptedSymbol{\Henrymol}{/K}{H} %^^A FIXME
    \RenewDocumentCommand{\IG}{}{{ig}}
    \RenewDocumentCommand{\IGM}{}{{ig}}
    \RenewDocumentCommand{\IS}{}{{is}}
    \RenewDocumentCommand{\Cstd}{}{m\c_math_superscript_token \std}
    \RenewDocumentCommand{\muJT}{}{\mu\c_math_subscript_token{JT}}
  }
}
\DeclareOption{KlotzRosenberg}{
  \ExecuteOptions{delta}
  \AtEndOfPackage{
    \tl_set:Nn \l_@@_sub_separator_tl {}
    \cs_set:Nn \@@_extensive:n {#1}
    \cs_new:Nn \@@_intensive_one:n
    {
      \c_math_superscript_token {#1}
      \peek_catcode_remove:NTF \c_math_subscript_token
      { \@@_intensive_three:n }
      { \c_math_subscript_token{\mathrm{m}} }
    }
    \cs_new:Nn \@@_intensive_three:n
    { \c_math_subscript_token{\mathrm{m}\l_@@_sub_separator_tl #1} }
    \cs_new:Nn \@@_intensive_two:n
    {
      \c_math_subscript_token{\mathrm{m}\l_@@_sub_separator_tl #1}
      \peek_catcode:NF \c_math_superscript_token
      { \c_math_superscript_token\bullet }
    }
    \cs_set:Nn \@@_intensive:n
    {
      #1
      \peek_catcode_remove:NTF \c_math_superscript_token
      { \@@_intensive_one:n }
      { \peek_catcode_remove:NTF \c_math_subscript_token
        { \@@_intensive_two:n }
        { \c_math_subscript_token{\mathrm{m}} }
      }
    }
    \cs_new:Nn \@@_fpure_one:n
    {
      f\c_math_subscript_token{#1}
      \peek_catcode_remove:NF \c_math_superscript_token
      { \c_math_superscript_token\bullet }
    }
    \RenewDocumentCommand{\fpure}{}
    {
      \peek_catcode_remove:NTF \c_math_subscript_token
      { \@@_fpure_one:n }
      { f }
    }
    \cs_new:Nn \@@_phipure_one:n
    {
      \gamma\c_math_subscript_token{#1}
      \peek_catcode_remove:NF \c_math_superscript_token
      { \c_math_superscript_token\bullet }
    }
    \RenewDocumentCommand{\phipure}{}
    {
      \peek_catcode_remove:NTF \c_math_subscript_token
      { \@@_phipure_one:n }
      { \gamma }
    }
    \RenewDocumentCommand{\fmix}{}{f}
    \RenewDocumentCommand{\phimix}{}{\gamma}
    \RenewDocumentCommand{\phisat}{}{\gamma^\sat}
    \cs_if_exist:NTF \gammaup
    { \RenewDocumentCommand{\gamma}{}{\gammaup} }
    { \cs_if_exist:NT \upgamma
        { \RenewDocumentCommand{\gamma}{}{\upgamma} }
    }
    \RenewDocumentCommand{\gammarat}{}{\gamma}
    \RenewDocumentCommand{\gammamol}{}{\gamma}
    \cs_if_exist:NTF \muup
      {\RenewDocumentCommand{\mu}{}{\muup}}
      {\cs_if_exist:NT \upmu
          {\RenewDocumentCommand{\mu}{}{\upmu}}
      }
    \cs_if_exist:NTF \alphaup
      {\RenewExpandableDocumentCommand{\expansivitysymbol}{}{\alphaup}}
      {\cs_if_exist:NTF \upalpha
        {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\alphaup}}
        {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\alpha}}
      }
    \cs_if_exist:NTF \betaup
      {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\betaup}}
      {\cs_if_exist:NTF \upbeta
        {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\betaup}}
        {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\beta}}
      }
    \cs_if_exist:NTF \xiup
      {\RenewDocumentCommand{\xrxn}{}{\xiup}}
      {\cs_if_exist:NT \upxi
          {\RenewDocumentCommand{\xrxn}{}{\upxi}}
      }
    \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
    \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
    \RenewSubscriptedSymbol{\muJT}{\JTsymbol}{\text{J.T.}}
    \RenewDocumentCommand{\Deltarxn}{m}{\Delta #1}
    \RenewDocumentCommand{\Deltaf}{}{\Delta\c_math_subscript_token\formation}
    \RenewDocumentCommand{\Deltafus}{}{\Delta}
    \RenewDocumentCommand{\Deltavap}{}{\Delta}
    \RenewDocumentCommand{\Deltasub}{}{\Delta}
%^^A FIXME: should be \Delta G_{\text{mix},\mathrm{m}} not other way around
    \RenewDocumentCommand{\Deltamix}{m}{
      \tl_set:Nn \l_@@_sub_separator_tl {,}
      \Delta #1\c_math_subscript_token{\mixing}
    }
    \RenewDocumentCommand{\excess}{}{{\mathrm{E}}}
    \RenewDocumentCommand{\residual}{}{{\mathrm{R}}}
    \cs_set:Nn \@@_overline:n {#1}
    \RenewDocumentCommand{\IS}{}{{\mathrm{I}}}
    \RenewDocumentCommand{\Psat}{}
    {
      \peek_catcode:NTF \c_math_subscript_token
        {p\c_math_superscript_token\bullet}
        {p}
    }
    \RenewDocumentCommand{\Cstd}{}{m^\std}
    \RenewDocumentCommand{\Henryrat}{}{k}
    \RenewDocumentCommand{\Henrymol}{}{k''}

    % Fix partial molar properties
    \cs_set:Npn \@@_pm_case_one #1
    {
      \l_@@_pm_symbol_tl\c_math_subscript_token{\mathrm{m}#1}
    }
    \cs_set:Npn \@@_pm_case_two [#1]#2
    {
      \l_@@_pm_symbol_tl
        \c_math_superscript_token{#1}\c_math_subscript_token{\mathrm{m}#2}
    }
    \cs_set:Npn \@@_pm_case_three_part_two #1
    {
      \l_@@_pm_symbol_tl
        \c_math_superscript_token{\l_@@_pm_arg_tl}
        \c_math_subscript_token{\mathrm{m}#1}
    }
    \cs_set:Npn \@@_pm_case_four #1
    {
      \l_@@_pm_symbol_tl\c_math_superscript_token{#1}
        \c_math_subscript_token{\mathrm{m}\l_@@_pm_arg_tl}
    }
    \cs_set:Npn \@@_pm_case_five
    {
      \l_@@_pm_symbol_tl
        \c_math_subscript_token{\mathrm{m}\l_@@_pm_arg_tl}
    }

    % fix heat capacities
    \RenewSubscriptedSymbol{\cP}{\heatcapacitysymbol}
        {\g_@@_pressure_symbol\mathrm{m}}
    \RenewSubscriptedSymbol{\cV}{\heatcapacitysymbol}
        {\g_@@_volume_symbol\mathrm{m}}
    \RenewDocumentCommand{\cPpm}{}{\partialmolar{\cPt}}
    \RenewDocumentCommand{\cVpm}{}{\partialmolar{\cVt}}

    \cs_set:Npn \cP_two:n #1
    { \heatcapacitysymbol
      \c_math_subscript_token{\g_@@_pressure_symbol\mathrm{m}
        \l_@@_sub_separator_tl #1}
      \peek_catcode:NF \c_math_superscript_token
      { \c_math_superscript_token\bullet }
    }
    \cs_set:Npn \cV_two:n #1
    { \heatcapacitysymbol
      \c_math_subscript_token{\g_@@_volume_symbol\mathrm{m}
        \l_@@_sub_separator_tl #1}
      \peek_catcode:NF \c_math_superscript_token
      { \c_math_superscript_token\bullet }
    }
  }
  \AtBeginDocument{
    \@ifpackageloaded{emf}{\RenewDocumentCommand{\Epot}{}{\emf}}
    {%
      \PackageWarningNoLine{thermodynamics}
        {Package~emf~not~loaded;~load~to~make~Epot~match~Klotz~
         and~Rosenberg's~notation}%
    }
  }
}
\DeclareOption{Koretsky}{
  \ExecuteOptions{EUAGHAn,brackets,intensive-lowercase,delta,shortpm}
  \AtEndOfPackage{
    \tl_gset:Nn \g_@@_area_symbol {A}
    \RenewExpandableDocumentCommand{\std}{}{o}
    \RenewExpandableDocumentCommand{\ncomponents}{}{m}
    \RenewDocumentCommand{\partialmolar}{m}
    {
      \tl_set:Nn \l_@@_pm_symbol_tl {#1}
      \@@_generic_pm:
    }
    \RenewDocumentCommand{\expansivitysymbol}{}{\beta}
    \RenewDocumentCommand{\IS}{}{{\text{ideal}}}
    \RenewDocumentCommand{\residual}{}{{\text{dep}}}
    \RenewDocumentCommand{\IG}{}{{\text{ideal~gas}}}
    \RenewDocumentCommand{\IGM}{}{{\text{ideal}}}
    \RenewDocumentCommand{\Henryrat}{}{{\mathcal{H}}}
    \RenewDocumentCommand{\gammarat}{}
        {\gamma\c_math_superscript_token\text{Henry's}}
    \RenewDocumentCommand{\gammamol}{}{\gamma\c_math_superscript_token{m}}
    \RenewDocumentCommand{\phipure}{}{\varphi}
    \RenewDocumentCommand{\phimix}{}{\hat\varphi}
    \RenewDocumentCommand{\phisat}{}{\varphi\c_math_superscript_token\sat}
    \cs_new:Npn \Delta_fus_sym {} {}
    \NewSubscriptedSymbol{\Delta_fus}{\Delta_fus_sym}{\fusion}
    \RenewDocumentCommand{\Deltafus}{m}{
      \cs_set:Npn \Delta_fus_sym {} { \Delta #1 }
      \Delta_fus
    }
    \cs_new:Npn \Delta_vap_sym {} {}
    \NewSubscriptedSymbol{\Delta_vap}{\Delta_vap_sym}{\vaporization}
    \RenewDocumentCommand{\Deltavap}{m}{
      \cs_set:Npn \Delta_vap_sym {} { \Delta #1 }
      \Delta_vap
    }
    \cs_new:Npn \Delta_sub_sym {} {}
    \NewSubscriptedSymbol{\Delta_sub}{\Delta_sub_sym}{\sublimation}
    \RenewDocumentCommand{\Deltasub}{m}{
      \cs_set:Npn \Delta_sub_sym {} { \Delta #1 }
      \Delta_sub
    }
    \tl_new:N \l_@@_Deltaf_superscript_tl
    \tl_new:N \l_@@_Deltaf_subscript_tl
    \bool_new:N \l_@@_Deltaf_parentheses_bool
    \tl_new:N \l_@@_Deltaf_entity_tl
    \cs_set:Nn \@@_Deltaf_one:n
    {
      \tl_set:Nn \l_@@_Deltaf_superscript_tl {#1}
      \peek_catcode_remove:NTF \c_math_subscript_token
      {
        \bool_set_true:N \l_@@_Deltaf_parentheses_bool
        \@@_Deltaf_two:n
      }
      {
        \bool_if:NTF \l_@@_Deltaf_parentheses_bool
        {
          (\Delta\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
            \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
            { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
          )
          \tl_if_empty:NF \l_@@_Deltaf_subscript_tl
          { \c_math_subscript_token\l_@@_Deltaf_subscript_tl }
        }
        {
          \Delta\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
            \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
            { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
        }
      }
    }
    \cs_set:Nn \@@_Deltaf_two:n
    {
      \tl_set:Nn \l_@@_Deltaf_subscript_tl {#1}
      % check for case 4
      \peek_catcode_remove:NTF \c_math_superscript_token
      { \@@_Deltaf_one:n }
      {
        \bool_if:NTF \l_@@_Deltaf_parentheses_bool
        {
          (\Delta\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
            \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
              {\c_math_superscript_token\l_@@_Deltaf_superscript_tl}
          )
          \tl_if_empty:NF \l_@@_Deltaf_subscript_tl
            \c_math_subscript_token\l_@@_Deltaf_subscript_tl
        }
        {
          \Delta\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
            \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
              {\c_math_superscript_token\l_@@_Deltaf_superscript_tl}
        }
      }
    }
    \RenewDocumentCommand{\Deltaf}{m}
    {
      \tl_clear:N \l_@@_Deltaf_superscript_tl
      \tl_clear:N \l_@@_Deltaf_subscript_tl
      \tl_set:Nn \l_@@_Deltaf_entity_tl {#1}
      \bool_set_false:N \l_@@_Deltaf_parentheses_bool
      \peek_catcode_remove:NTF \c_math_superscript_token
      {
        \@@_Deltaf_one:n
      }
      {
        \peek_catcode_remove:NTF \c_math_subscript_token
        {
          \bool_set_true:N \l_@@_Deltaf_parentheses_bool
          \@@_Deltaf_two:n
        }
        {
          \Delta #1\c_math_subscript_token \formation
        }
      }
    }
    \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
    \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
    \RenewSubscriptedSymbol{\cV}{\@@_intensive:n \heatcapacitysymbol}
        {\@@_intensive:n \g_@@_volume_symbol}
    \RenewSubscriptedSymbol{\cVs}{\@@_specific:n \heatcapacitysymbol}
        {\@@_intensive:n \g_@@_volume_symbol}
    \RenewDocumentCommand{\Lm}{}{\omega}
    \RenewDocumentCommand{\Ls}{}{\hat\omega}
  }
}
\DeclareOption{MSBB}{
  \ExecuteOptions{EUFGHAn,intensive-lowercase,delta,shortpm}
  \AtEndOfPackage{
    \RenewDocumentCommand{\IGM}{}{\ast} % FIXME: is this * or \circ?
    \RenewDocumentCommand{\IG}{}{\ast}
    \RenewDocumentCommand{\expansivitysymbol}{}{\beta}
    \RenewDocumentCommand{\muJT}{}{\mu\c_math_subscript_token J}
    \RenewDocumentCommand{\allcomponents}{O{} m}{#2}
    \RenewDocumentCommand{\allbut}{O{j} m m}
    {
      \tl_if_eq:nnTF {#1} {#2}
      { {#3}\c_math_subscript_token k }
      { {#3}\c_math_subscript_token{#1} }
    }
    \tl_gset_eq:NN \g_@@_Helmholtz_symbol \psi
    \RenewDocumentCommand{\Ft}{}{\Psi}
    \RenewDocumentCommand{\Fpm}{}{\partialmolar{\Psi}}
    \cs_set:Nn \@@_intensive:n {\@@_overline:n{\text_lowercase:n{#1}}}
    \cs_set:Nn \@@_specific:n {\text_lowercase:n{#1}}
    \RenewDocumentCommand{\fmix}{}{\bar f}
    \RenewDocumentCommand{\phimix}{}{\bar\phi}
    \RenewDocumentCommand{\phimix}{}{\bar\phi}
    \tl_gset:Nn \g_@@_pressure_symbol p
    \tl_gset:Nn \g_@@_volume_symbol v
    \RenewDocumentCommand{\partialmolar}{m}
    {
      \tl_set:Nn \l_@@_pm_symbol_tl {\text_uppercase:n #1}
      \@@_generic_pm:
    }
    \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
    \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
    \RenewDocumentCommand{\mustd}{}{\Gm^\std}
    \RenewExpandableDocumentCommand{\formation}{}{{\mathrm{f}}}
    \RenewDocumentCommand{\Pstd}{}
      {\g_@@_pressure_symbol\c_math_subscript_token\text{ref}}
    \RenewExpandableDocumentCommand{\xrxn}{}{\varepsilon}
    \RenewExpandableDocumentCommand{\Lm}{}{\@@_intensive:n \omega}
    \RenewExpandableDocumentCommand{\Ls}{}{\@@_specific:n \omega}
    \RenewExpandableDocumentCommand{\heatcapacitysymbol}{}{C}
    \tl_new:N \l_@@_Deltaf_superscript_tl
    \tl_new:N \l_@@_Deltaf_subscript_tl
    \bool_new:N \l_@@_Deltaf_parentheses_bool
    \tl_new:N \l_@@_Deltaf_entity_tl
    \cs_set:Nn \@@_Deltaf_one:n
    {
      \tl_set:Nn \l_@@_Deltaf_superscript_tl {#1}
      \peek_catcode_remove:NTF \c_math_subscript_token
      {
        \bool_set_true:N \l_@@_Deltaf_parentheses_bool
        \@@_Deltaf_two:n
      }
      {
        \bool_if:NTF \l_@@_Deltaf_parentheses_bool
        {
          (\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
            \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
            { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
          )
          \tl_if_empty:NF \l_@@_Deltaf_subscript_tl
          { \c_math_subscript_token\l_@@_Deltaf_subscript_tl }
        }
        {
          \l_@@_Deltaf_entity_tl\c_math_subscript_token{\formation}
            \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
            { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
        }
      }
    }
    \cs_set:Nn \@@_Deltaf_two:n
    {
      \tl_set:Nn \l_@@_Deltaf_subscript_tl {#1}
      % check for case 4
      \peek_catcode_remove:NTF \c_math_superscript_token
      { \@@_Deltaf_one:n }
      {
        \bool_if:NTF \l_@@_Deltaf_parentheses_bool
        {
          (\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
            \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
            { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
          )
          \tl_if_empty:NF \l_@@_Deltaf_subscript_tl
          { \c_math_subscript_token\l_@@_Deltaf_subscript_tl }
        }
        {
          \l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
            \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
            { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
        }
      }
    }
    \RenewDocumentCommand{\Deltaf}{m}
    {
      \tl_clear:N \l_@@_Deltaf_superscript_tl
      \tl_clear:N \l_@@_Deltaf_subscript_tl
      \tl_set:Nn \l_@@_Deltaf_entity_tl {#1}
      \bool_set_false:N \l_@@_Deltaf_parentheses_bool
      \peek_catcode_remove:NTF \c_math_superscript_token
      {
        \@@_Deltaf_one:n
      }
      {
        \peek_catcode_remove:NTF \c_math_subscript_token
        {
          \bool_set_true:N \l_@@_Deltaf_parentheses_bool
          \@@_Deltaf_two:n
        }
        {
          \Delta #1\c_math_subscript_token \formation
        }
      }
    }
  }
}
\DeclareOption{Prausnitz}{
  \ExecuteOptions{intensive-lowercase,shortpm}
  \AtEndOfPackage{
    \RenewExpandableDocumentCommand{\ncomponents}{}{m}
    \RenewDocumentCommand{\fmix}{}{f}
    \RenewDocumentCommand{\fsat}{}{\fpure\c_math_superscript_token\sat}
    % TODO: this should pick up H_2 and make it into H_{2,1} (assuming
    % the solvent is always 1...?)
    \RenewDocumentCommand{\Henryrat}{}{H}
    %^^A\RenewDocumentCommand{\residual}{}{{{\mathcal{R}}}}
    \RenewDocumentCommand{\allcomponents}{O{i} m}
      { {#2}\c_math_subscript_token{#1} }
    \RenewDocumentCommand{\allbut}{O{i} m m}
    { \tl_if_eq:nnTF {#1} {#2}
        { {#3}\c_math_subscript_token k }
        { {#3}\c_math_subscript_token{#1} }
    }
    \tl_set:Nn \l_@@_sub_separator_tl {\,}
    \tl_gset:Nn \g_@@_pressure_symbol {p}
    \tl_gset:Nn \g_@@_volume_symbol {v}
    \RenewSubscriptedSymbol{\fpure}{f}{{\text{pure}}}
    \RenewDocumentCommand{\phimix}{}{\varphi}
    \RenewDocumentCommand{\phisat}{}{\varphi^\sat}
    \RenewDocumentCommand{\sat}{}{s}
    \RenewDocumentCommand{\mixing}{}{\text{mixing}}
    \RenewDocumentCommand{\Lm}{}{\omega}
    \RenewDocumentCommand{\Ls}{}{\@@_specific:n \omega}
    \RenewSubscriptedSymbol{\phipure}{\varphi}{{\text{pure}}}
    \RenewDocumentCommand{\IG}{}{{\text{id}}}
    \RenewDocumentCommand{\IGM}{}{{\text{id}}}
    \RenewDocumentCommand{\IS}{}{{\text{(ideal)}}}
    \RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\beta}
    \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
    \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
    \RenewExpandableDocumentCommand{\std}{}{0}
    \@ifpackageloaded{emf}
      {\RenewDocumentCommand{\Epot}{}{\emf}}
      {\RenewDocumentCommand{\Epot}{}{\mathcal{E}}}
    \DeclareMathAlphabet{\mathdutchcal}{U}{dutchcal}{m}{n}
    \RenewExpandableDocumentCommand{\actrel}{}{\mathdutchcal{a}}
  }
}
\DeclareOption{Sandler}{
  \ExecuteOptions{EUAGHaN,extensive-plain,shortpm}
  \AtEndOfPackage{
    \RenewDocumentCommand{\Pvap}{}
        {{P\c_math_superscript_token{\text{vap}}}}
    \RenewDocumentCommand{\excess}{}{{\text{ex}}}
    \RenewDocumentCommand{\residual}{}{{\text{r}}}
    \RenewExpandableDocumentCommand{\ncomponents}{}{\mathcal{C}}
    \RenewDocumentCommand{\fmix}{}{\bar f}
    \RenewDocumentCommand{\fstd}{}{\bar f\c_math_superscript_token\std}
    \RenewDocumentCommand{\phimix}{}{\bar\phi}
    \RenewDocumentCommand{\allcomponents}{O{} m}{\@@_underline:n{#2}}
    \RenewDocumentCommand{\IG}{}{{\text{IG}}}
    \RenewDocumentCommand{\IGM}{}{{\text{IGM}}}
    \RenewDocumentCommand{\IS}{}{{\text{IM}}}
    \RenewDocumentCommand{\Deltamix}{m}
        {\Delta\c_math_subscript_token\mixing #1}
    \RenewDocumentCommand{\Deltarxn}{m}
        {\Delta\c_math_subscript_token\reaction #1}
    \RenewDocumentCommand{\Deltasub}{m}
        {\Delta\c_math_subscript_token\sublimation #1}
    \RenewDocumentCommand{\Deltafus}{m}
        {\Delta\c_math_subscript_token\fusion #1}
    \RenewDocumentCommand{\Deltavap}{m}
        {\Delta\c_math_subscript_token\vaporization #1}
    \RenewDocumentCommand{\Pstd}{}{\text{1~bar}
      \peek_catcode_remove:NT \c_math_subscript_token {\use_none:n}
    }
    \RenewDocumentCommand{\Cstd}{}{\text{1~molal}
      \peek_catcode_remove:NT \c_math_subscript_token {\use_none:n}
    }
    \RenewDocumentCommand{\Henryrat}{}{H}
    \RenewSubscriptedSymbol{\cV}
        {\heatcapacitysymbol}{\g_@@_volume_symbol}
    \RenewSubscriptedSymbol{\cP}
        {\heatcapacitysymbol}{\g_@@_pressure_symbol}
    \RenewSubscriptedSymbol{\cVt}
        {\Nt\heatcapacitysymbol}{\g_@@_volume_symbol}
    \RenewSubscriptedSymbol{\cPt}
        {\Nt\heatcapacitysymbol}{\g_@@_pressure_symbol}
    \RenewDocumentCommand{\formation}{}{\mathrm{f}}
    \RenewDocumentCommand{\Deltaf}{}
        {\Delta\c_math_subscript_token\formation}
    \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
    \RenewDocumentCommand{\muJT}{}{\mu}
    \RenewDocumentCommand{\xrxn}{}{X}
  }
}
\DeclareOption{SVNAS}{
  \ExecuteOptions{extensive-superscript,shortpm}
  \AtEndOfPackage{
    \RenewDocumentCommand{\allcomponents}{O{} m}{#2}
    \RenewDocumentCommand{\allbut}{O{j} m m}
    {
      \tl_if_eq:nnTF {#1} {#2}
      { {#3}\c_math_subscript_token k }
      { {#3}\c_math_subscript_token{#1} }
    }
    \RenewDocumentCommand{\IG}{}{{ig}}
    \RenewDocumentCommand{\IGM}{}{{ig}}
    \RenewDocumentCommand{\IS}{}{{id}}
    \RenewDocumentCommand{\IS}{}{{id}}
    \RenewDocumentCommand{\fusion}{}{{sl}}
    \RenewDocumentCommand{\vaporization}{}{{vl}}
    \RenewDocumentCommand{\sublimation}{}{{vs}}
    \RenewDocumentCommand{\expansivitysymbol}{}{\beta}
    \RenewDocumentCommand{\xrxn}{}{\varepsilon}
    \RenewDocumentCommand{\Deltarxn}{m}{\Delta #1}
    \RenewDocumentCommand{\Deltamix}{m}{\Delta #1}
    \RenewSubscriptedSymbol{\cVt}
        {\Nt\heatcapacitysymbol}{\g_@@_volume_symbol}
    \RenewSubscriptedSymbol{\cPt}
        {\Nt\heatcapacitysymbol}{\g_@@_pressure_symbol}
    % FIXME
    \RenewDocumentCommand{\cP}{}
        {{\heatcapacitysymbol\c_math_subscript_token\g_@@_pressure_symbol}}
    \RenewDocumentCommand{\cV}{}
        {{\heatcapacitysymbol\c_math_subscript_token\g_@@_volume_symbol}}
    \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
    \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
    \RenewDocumentCommand{\muJT}{}{\mu}
    \RenewDocumentCommand{\Cstd}{}{m\c_math_superscript_token\std
      \peek_catcode_remove:NT \c_math_subscript_token {\use_none:n}
    }
    \RenewDocumentCommand{\mustd}{}{\Gm\c_math_superscript_token\std}
    \RenewDocumentCommand{\Henryrat}{}{\mathcal{H}}
    \RenewDocumentCommand{\formation}{}
    {
      \tl_set:Nn \l_@@_sub_separator_tl {}
      f298
    }
    \cs_set:Nn \@@_specific:n {#1}
  }
}
\DeclareOption{ModellReid}{\ExecuteOptions{TesterModell}}
\DeclareOption{TesterModell}{
  \ExecuteOptions{EUAGHaN,delta,shortpm}
  \AtEndOfPackage{
    \cs_set:Nn \@@_specific:n {\text_lowercase:n{#1}}
    \RenewExpandableDocumentCommand{\ncomponents}{}{n}
    \RenewDocumentCommand{\allcomponents}{O{i} m}
    {
      {#2}\c_math_subscript_token{#1}
    }
    \RenewDocumentCommand{\allbut}{O{i} m m}
    { \tl_if_eq:nnTF {#1} {#2}
      { {#3}\c_math_subscript_token{k}[#2] }
      { {#3}\c_math_subscript_token{#1}[#2] }
    }
    \RenewDocumentCommand{\allbutlastand}{O{j} m m}
    { \tl_if_eq:xxTF {#2} {\ncomponents}
      { {#3}\c_math_subscript_token{#1}\relax[#2] }
      { \tl_if_eq:nnTF {#1} {#2}
        { {#3}\c_math_subscript_token{k}[#2,\ncomponents] }
        { {#3}\c_math_subscript_token{#1}[#2,\ncomponents] }
      }
    }
    \RenewDocumentCommand{\IG}{}{{o}}
    \RenewDocumentCommand{\IGM}{}{{o}}
    \RenewDocumentCommand{\IS}{}{{ID}}
    \RenewDocumentCommand{\excess}{}{{EX}}
    \RenewDocumentCommand{\reaction}{}{{rx}}
    \RenewDocumentCommand{\Henryrat}{}
        {f\c_math_superscript_token{\ast\ast}}
    \RenewDocumentCommand{\Henrymol}{}{f\c_math_superscript_token\ast}
    \cs_if_exist:NTF \gammaup
    { \RenewDocumentCommand{\gamma}{}{\gammaup} }
    { \cs_if_exist:NT \upgamma
        { \RenewDocumentCommand{\gamma}{}{\upgamma} }
    }
    \RenewDocumentCommand{\gammarat}{}
        {\gamma\c_math_superscript_token{\ast\ast}}
    \RenewDocumentCommand{\gammamol}{}
        {\gamma\c_math_superscript_token\ast}
    \RenewExpandableDocumentCommand{\JTsymbol}{}{\alpha}
    \RenewSubscriptedSymbol{\muJT}{\JTsymbol}{H}
    \cs_if_exist:NTF \xiup
    { \RenewDocumentCommand{\xrxn}{}{\xiup} }
    { \cs_if_exist:NT \upxi
        { \RenewDocumentCommand{\xrxn}{}{\upxi} }
    }
    \cs_if_exist:NTF \phiup
    {
      \RenewDocumentCommand{\phipure}{}{\phiup}
      \RenewDocumentCommand{\phimix}{}{\hat\phiup}
      \RenewDocumentCommand{\phisat}{}{\phiup\c_math_superscript_token\sat}
    }
    { \cs_if_exist:NT \upphi
      {
        \RenewDocumentCommand{\phipure}{}{\upphi}
        \RenewDocumentCommand{\phimix}{}{\hat\upphi}
        \RenewDocumentCommand{\phisat}{}{\upphi\c_math_superscript_token\sat}
      }
    }
    \RenewDocumentCommand{\Cstd}{}{m\c_math_superscript_token+
      \peek_catcode_remove:NT \c_math_subscript_token {\use_none:n}
    }
    \cs_if_exist:NTF \muup
    { \RenewDocumentCommand{\mu}{}{\muup} }
    { \cs_if_exist:NT \upmu
      { \RenewDocumentCommand{\mu}{}{\upmu} }
    }
    \RenewDocumentCommand{\std}{}{o}
    \RenewDocumentCommand{\Pstd}{}{P^\ast}
    \tl_gset:Nn \g_@@_area_symbol {\text{\large\(\mathit{a}\)}}
    \RenewDocumentCommand{\Epot}{}{\exists}
    \tl_set:Nn \l_@@_sub_separator_tl {}
    \tl_gset:Nn \g_@@_pressure_symbol {p}
    \RenewSubscriptedSymbol{\cVt}{\@@_extensive:n {\heatcapacitysymbol}}{v}
    \RenewSubscriptedSymbol{\cV}{\@@_intensive:n {\heatcapacitysymbol}}{v}
    \RenewSubscriptedSymbol{\cVs}{\@@_specific:n {\heatcapacitysymbol}}{v}
  }
}
\DeclareOption{Thompson}{
  \ExecuteOptions{EUAGHAn,delta,shortpm}
  \AtEndOfPackage
  {
    \RenewDocumentCommand{\excess}{}{{EX}}
    \RenewDocumentCommand{\residual}{}{{R}}
    \RenewDocumentCommand{\actrel}{}{\widehat{a}}
    \RenewSubscriptedSymbol{\Henryrat}{k}{H}
    \RenewSubscriptedSymbol{\Henrymol}{k}{H}
    \RenewDocumentCommand{\allcomponents}{O{j} m}
    {
      {#2}\c_math_subscript_token{#1}
    }
    \RenewDocumentCommand{\allNs}{O{j}}{\allcomponents[#1]{\Nt}}
    \RenewDocumentCommand{\allXs}{O{j}}{\allcomponents[#1]{x}}
    \RenewDocumentCommand{\allYs}{O{j}}{\allcomponents[#1]{y}}
    \RenewDocumentCommand{\allmus}{O{j}}{\allcomponents[#1]{\mu}}
    \RenewDocumentCommand{\allMs}{O{j}}{\allcomponents[#1]{m}}
    \RenewDocumentCommand{\allWs}{O{j}}{\allcomponents[#1]{w}}
    \RenewExpandableDocumentCommand{\ncomponents}{}{c}
    \RenewDocumentCommand{\IS}{}{{IS}}
    \RenewDocumentCommand{\IG}{}{{IG}}
    \RenewDocumentCommand{\IGM}{}{{IG}}
    \cs_new:Nn \@@_fpure_one:n
    {
      f\c_math_subscript_token{#1}
      \peek_catcode_remove:NF \c_math_superscript_token
      { \c_math_superscript_token\bullet }
    }
    \RenewDocumentCommand{\fpure}{}
    {
      \peek_catcode_remove:NTF \c_math_subscript_token
      { \@@_fpure_one:n }
      { f }
    }
    \cs_new:Nn \@@_intensive_two:n
    {
      \c_math_subscript_token{#1}
      \peek_catcode:NF \c_math_superscript_token
      {
        \c_math_superscript_token\bullet
      }
    }
    \cs_set:Nn \@@_intensive:n
    {
      #1
      \peek_catcode_remove:NT \c_math_subscript_token
      { \@@_intensive_two:n }
    }
    \cs_new:Nn \@@_phipure_one:n
    {
      \phi\c_math_subscript_token{#1}
      \peek_catcode:NF \c_math_superscript_token
      { \c_math_superscript_token\bullet }
    }
    \RenewDocumentCommand{\phipure}{}
    {
      \peek_catcode_remove:NTF \c_math_subscript_token
      {
        \@@_phipure_one:n
      }
      {\phi}
    }
    \RenewDocumentCommand{\phimix}{}{\widehat\phi}
    \RenewDocumentCommand{\fmix}{}{\widehat f}
    \RenewDocumentCommand{\mixing}{}{{MIX}}
    \RenewDocumentCommand{\muJT}{}{\alpha\c_math_subscript_token H}
    \RenewDocumentCommand{\Deltamix}{m}
        {\Delta\c_math_subscript_token\mixing #1}
    \RenewDocumentCommand{\reaction}{}{R}
    \RenewDocumentCommand{\fusion}{}{{SL}}
    \RenewDocumentCommand{\vaporization}{}{{LV}}
    \RenewDocumentCommand{\sublimation}{}{{SV}}
    \RenewDocumentCommand{\allbut}{O{j} m m}
    { \tl_if_eq:nnTF {#1} {#2}
      {
        {#3}\c_math_subscript_token k\neq{#3}\c_math_subscript_token{#2}
      }
      {
        {#3}\c_math_subscript_token{#1}\neq{#3}\c_math_subscript_token{#2}
      }
    }
    \RenewDocumentCommand{\Cstd}{}{m^\std}
    \RenewDocumentCommand{\mustd}{}{\Gamma}
    \RenewDocumentCommand{\formation}{}{F}
%^^A    \RenewDocumentCommand{\Deltarxn}{}{\Delta}
  }
}
%    \end{macrocode}
% We execute the default options below.
%    \begin{macrocode}
\ExecuteOptions{EUAGHan,subscripts,parentheses,intensive-plain,
    moles-index,longpm}
\ProcessOptions
%    \end{macrocode}
% \subsection{Variable Order}
% We next encode a routine to sort non-subscripted variables into a consistent
% order. It currently does not sort variables with subscripts.
% \changes{v2.00}{2023/11/16}{Added a sorting routine to make function
%       arguments be in a consistent order using the \texttt{nosubscripts}
%       option.}
%    \begin{macrocode}
\tl_const:Nn \c_@@_sort_order_tl
    {\Et\Em\Es\Ut\Um\Us\Ht\Hm\Hs\Ft\Fm\Fs\Gt\Gm\Gs\Lt\Lm\Ls T\St\Sm\Ss
        P\Vt\Vm\Vs\mu\Nt mwxyz\At\Am\As\sigma
        ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklnopqrstuvwxyz}
\clist_new:N \l_@@_in_list_clist
\clist_new:N \l_@@_sorted_list_clist
\clist_new:N \l_@@_remaining_list_clist
\cs_new:Nn \@@_sort_clist:n
{% Sort the list in the order of \c_@@_sort_order_tl

  % Wipe out any remnants from the last sort
  \clist_clear:N \l_@@_in_list_clist
  \clist_clear:N \l_@@_sorted_list_clist

  % Make a copy of the list
  \clist_set:Nn \l_@@_remaining_list_clist {#1}

  % Make a list of everything that's in the known sort order list
  % and put everything else in the "not in sort order list" list.
  \tl_map_inline:Nn \c_@@_sort_order_tl
  {
    \clist_if_in:NnT \l_@@_remaining_list_clist {##1}
    { \clist_put_right:Nn \l_@@_in_list_clist {##1} }

    \clist_remove_all:Nn \l_@@_remaining_list_clist {##1}
  }

  % Then merge the lists back together again.
  \clist_if_empty:NF \l_@@_in_list_clist
  {
    \clist_put_right:Nn \l_@@_sorted_list_clist \l_@@_in_list_clist
  }
  \clist_if_empty:NF \l_@@_remaining_list_clist
  {
    \clist_put_right:Nn \l_@@_sorted_list_clist \l_@@_remaining_list_clist
  }
  \clist_use:Nn \l_@@_sorted_list_clist ,
}
%    \end{macrocode}
%
% \subsection{Commands for Partial Derivatives}
% The \cs{Partial} command and its second-order siblings are defined as below.
% They typeset partial derivatives of the first argument with respect to
% the second (and third, in the case of mixed second partial derivatives)
% arguments, holding the last argument constant.
%
% The starred forms adjust the spacing after the partial derivative so the
% trailing binary operator (assumed to be the same width as an equals sign)
% overhangs the variables held constant.
% We thus set \verb"operator_width" to be \emph{just} greater than the width of
% an equals sign.
%    \begin{macrocode}
\dim_new:N \l_@@_Partial_const_dim
\dim_new:N \l_@@_operator_width_dim
\dim_new:N \l_@@_adjust_width_dim
\settowidth{\l_@@_operator_width_dim}{=}
\dim_set:Nn \l_@@_adjust_width_dim {0.1\l_@@_operator_width_dim}
\dim_add:Nn \l_@@_operator_width_dim \l_@@_adjust_width_dim
%    \end{macrocode}
% \begin{macro}{\Partial}
% The command \cs{Partial} and its friends drastically simplify the creation
% of partial derivatives. The command \cs{Partial*} is the same as
% \cs{Partial} except that it adjusts the spacing so the (presumably) binary
% operator that follows it slightly overlaps the subscripts.
% \changes{v1.01}{2022/03/01}{Changed \cs{adjust@width} to 2pt (up from 1pt).}
% \changes{v1.01}{2022/04/21}{Changed \cs{adjust@width} 0.1\cs{operator@width}
%   (from 2pt).}
% \changes{v2.00}{2023/11/16}{Changed length added to
% \ExplSyntaxOn
%   \cs{l_@@_Partial_const_dim}~
% \ExplSyntaxOff
% from $-0.15$ to $-0.20$.}
%    \begin{macrocode}
\tl_new:N \l_@@_Partial_start_tl
\tl_new:N \l_@@_Partial_end_tl
\tl_new:N \l_@@_Partial_empty_end_tl
\tl_new:N \l_@@_Partial_middle_tl
\tl_set:Nn \l_@@_Partial_start_tl {\left\l_@@_PartialOpen_tl}
\tl_set:Nn \l_@@_Partial_end_tl {\right\l_@@_PartialClose_tl}
\tl_set:Nn \l_@@_Partial_empty_end_tl {\right\l_@@_PartialEmptyClose_tl}
\tl_set:Nn \l_@@_Partial_middle_tl {\middle}
\cs_set_eq:NN \@@_frac:nn \frac
\NewDocumentCommand{\Partial}{s m m m}
{ \bool_if:nTF {#1}
  {% Starred form (recursive)
    \settowidth{\l_@@_Partial_const_dim}{\ensuremath{#4}}%
    \dim_add:Nn \l_@@_Partial_const_dim {-0.20\l_@@_Partial_const_dim}%
    \Partial{#2}{#3}{#4}%
    \bool_if:NT \l_@@_subscripted_bool
    { \dim_compare:nNnTF \l_@@_operator_width_dim
                       &lt; \l_@@_Partial_const_dim
      { \kern -\l_@@_operator_width_dim }
      { \kern -\l_@@_Partial_const_dim }
    }
  }
  {% Unstarred form
    \bool_if:NTF \l_@@_subscripted_bool
    {% Handle case of empty variables held constant
      \tl_if_eq:nnTF {#4} {}
      { \l_@@_Partial_start_tl
        \@@_frac:nn{\partial #2}{\partial #3}\l_@@_Partial_empty_end_tl
      }
      { \l_@@_Partial_start_tl\@@_frac:nn{\partial #2}
                                         {\partial #3}\l_@@_Partial_end_tl
        \c_math_subscript_token{#4}%
      }
    }
    {% Check whether #4 contains \allNsbut{i} and #3 is \Nt_i
      \tl_if_in:nnTF {#3} {\Nt}
      { \RenewDocumentCommand{\allbut}{O{j} m m}{\allcomponents{##3}}
        \l_@@_Partial_start_tl
        \@@_frac:nn{\partial #2(\@@_sort_clist:n{#4})}
                   {\partial #3}\l_@@_Partial_end_tl
      }
      { \l_@@_Partial_start_tl
        \@@_frac:nn{\partial #2(\@@_sort_clist:n{#3,#4})}
                   {\partial #3}\l_@@_Partial_end_tl
      }
    }
  }
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PartialBigg}
% The \cs{PartialBigg} macro (and its starred form) replace the \tn{left}
% and \tn{right} commands in \cs{Partial} with \pkg{amsmath}'s \tn{Biggl}
% and \tn{Biggr} variants. The starred form is inherited from \cs{Partial}
% without modification.
%    \begin{macrocode}
\NewDocumentCommand{\PartialBigg}{}
  { \tl_set:Nn \l_@@_Partial_start_tl {\Biggl\l_@@_PartialOpen_tl}
    \tl_set:Nn \l_@@_Partial_end_tl {\Biggr\l_@@_PartialClose_tl}
    \tl_set:Nn \l_@@_Partial_Empty_end_tl
        {\Biggr\l_@@_PartialEmptyClose_tl}
    \Partial
  }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Partialbigg}
% The \cs{Partialbigg} macro does the same thing as \cs{PartialBigg}, except
% using \pkg{amsmath}'s \tn{biggl}/\tn{biggr} variants.
%    \begin{macrocode}
\NewDocumentCommand{\Partialbigg}{}
  { \tl_set:Nn \l_@@_Partial_start_tl {\biggl\l_@@_PartialOpen_tl}
    \tl_set:Nn \l_@@_Partial_end_tl {\biggr\l_@@_PartialClose_tl}
    \tl_set:Nn \l_@@_Partial_empty_end_tl
        {\biggr\l_@@_PartialEmptyClose_tl}
    \Partial
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PartialSecond}
% The second partial derivatives are defined similarly to \cs{Partial}.
%    \begin{macrocode}
\NewDocumentCommand{\PartialSecond}{s m m m}
{
  \bool_if:nTF {#1}
  {% Starred form
    \settowidth{\l_@@_Partial_const_dim}{\ensuremath{#4}}%
    \dim_add:Nn \l_@@_Partial_const_dim {-0.20\l_@@_Partial_const_dim}
    \PartialSecond{#2}{#3}{#4}%
    \bool_if:nT \l_@@_subscripted_bool
    {  \dim_compare:nNnTF {\l_@@_operator_width_dim}
                        &lt; {\l_@@_Partial_const_dim}
      { \kern -\l_@@_operator_width_dim }
      { \kern -\l_@@_Partial_const_dim }
    }
  }
  {% Unstarred form
    \bool_if:NTF \l_@@_subscripted_bool
    {% Handles case of empty variables held constant
      \tl_if_eq:nnTF {#4} {}
      { \l_@@_Partial_start_tl
            \@@_frac:nn{\partial\c_math_superscript_token 2 #2}
        {\partial #3\c_math_superscript_token 2}\l_@@_Partial_empty_end_tl
      }
      { \l_@@_Partial_start_tl
        \@@_frac:nn{\partial\c_math_superscript_token 2 #2}
            {\partial #3\c_math_superscript_token 2}\l_@@_Partial_end_tl
            \c_math_subscript_token{#4}%
      }
    }
    {% Check whether #4 contains \allNsbut{i} and #3 is \Nt_i
      \tl_if_in:nnTF {#2} {\Nt}
      { \RenewDocumentCommand{\allbut}{O{j} m m}{\allcomponents{##3}}
        \l_@@_Partial_start_tl
        \@@_frac:nn{\partial\c_math_superscript_token 2 #2(#4)}
            {\partial\c_math_superscript_token 2 #3}\l_@@_Partial_end_tl
      }
      { \l_@@_Partial_start_tl
        \@@_frac:nn{\partial\c_math_superscript_token 2
                      #2(\@@_sort_clist:n{#3,#4})}
            {\partial #3\c_math_superscript_token 2}\l_@@_Partial_end_tl
      }
    }
  }
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\PartialSecondBigg}
% The \cs{PartialSecondBigg} macro and its starred variant replace \cs{left}
% and \tn{right} with \pkg{amsmath}'s \cs{Biggl} and
% \cs{Biggr}.
%    \begin{macrocode}
\NewDocumentCommand{\PartialSecondBigg}{}
{ \tl_set:Nn \l_@@_Partial_start_tl {\biggl\l_@@_PartialOpen_tl}
  \tl_set:Nn \l_@@_Partial_end_tl {\biggl\l_@@_PartialClose_tl}
  \tl_set:Nn \l_@@_Partial_empty_end_tl {\biggl\l_@@_PartialClose_tl}
  \PartialSecond
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\PartialSecondbigg}
% The \cs{PartialSecondbigg} macro and its starred variant replace \tn{left}
% and \tn{right} with \pkg{amsmath}'s \cs{biggl} and
% \cs{biggr}.
%    \begin{macrocode}
\NewDocumentCommand{\PartialSecondbigg}{}
{ \tl_set:Nn \l_@@_Partial_start_tl {\biggl\l_@@_PartialOpen_tl}
  \tl_set:Nn \l_@@_Partial_end_tl {\biggl\l_@@_PartialClose_tl}
  \tl_set:Nn \l_@@_Partial_empty_end_tl {\biggl\l_@@_PartialClose_tl}
  \PartialSecond
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PartialMixSecond}
% The macro \cs{PartialMixSecond} takes an extra argument, but is otherwise
% the same as its same-variable cousin.
%    \begin{macrocode}
\bool_new:N \l_@@_has_x_or_y_bool
\NewDocumentCommand{\PartialMixSecond}{s m m m m}
{
  \bool_if:nTF {#1}
  {% Starred version
    \settowidth{\l_@@_Partial_const_dim}{\ensuremath{#4}}%
    \dim_add:Nn \l_@@_Partial_const_dim {-0.20\l_@@_Partial_const_dim}
    \PartialMixSecond{#2}{#3}{#4}{#5}
    \bool_if:nT \l_@@_subscripted_bool
    { \dim_compare:nNnTF {\l_@@_operator_width_dim}
                       &lt; {\l_@@_Partial_const_dim}
      { \kern -\l_@@_operator_width_dim }
      { \kern -\l_@@_Partial_const_dim }
    }
  }
  {% Unstarred version
    \bool_if:nTF \l_@@_subscripted_bool
    {% subscripted version
      \tl_if_eq:nnTF {#5} {}
      {% Handle case of empty variables held constant
        \l_@@_Partial_start_tl
        \@@_frac:nn{\partial\c_math_superscript_token 2 #2}
            {\partial #3\partial #4}\l_@@_Partial_empty_end_tl
      }
      { \l_@@_Partial_start_tl
        \@@_frac:nn{\partial\c_math_superscript_token 2 #2}
            {\partial #3\partial #4}\l_@@_Partial_end_tl
            \c_math_subscript_token{#5}
      }
    }
    {% not subscripted
      \tl_if_eq:nnTF {#5} {}
      {% empty argument
        \l_@@_Partial_start_tl
        \@@_frac:nn{\partial\c_math_superscript_token 2
                        #2(\@@_sort_clist:n{#3,#4,#5})}
                   {\partial #3\partial #4}\l_@@_Partial_empty_end_tl
      }
      {% Check whether #3 OR #4 are \Nt_i/etc.
        \tl_if_in:nnTF {#3} {\Nt}
        { \RenewDocumentCommand{\allbut}{O{j} m m}{\allcomponents{##3}}%
          \l_@@_Partial_start_tl
          \@@_frac:nn{\partial\c_math_superscript_token 2
                        #2(\@@_sort_clist:n{#4,#5})}
                     {\partial #3\partial #4}\l_@@_Partial_end_tl
        }
        { \tl_if_in:nnTF {#4} {\Nt}
          { \RenewDocumentCommand{\allbut}{O{j} m m}{\allcomponents{##3}}%
            \l_@@_Partial_start_tl
            \@@_frac:nn{\partial\c_math_superscript_token 2
                            #2(\@@_sort_clist:n{#3,#5})}
                       {\partial #3\partial #4}\l_@@_Partial_end_tl
          }
          {% Check for x, y, or w
            \bool_set_false:N \l_@@_has_x_or_y_bool
            \tl_if_in:nnT {#3} {x}
            { \l_@@_has_x_or_y_bool }
            \tl_if_in:nnT {#3} {y}
            { \l_@@_has_x_or_y_bool }
            \tl_if_in:nnT {#3} {w}
            { \l_@@_has_x_or_y_bool }
            \bool_if:NTF \l_@@_has_x_or_y_bool
            { \RenewDocumentCommand{\allbutlastand}{O{j} m m}
                {\allcomponents{##3}}
              \l_@@_Partial_start_tl
              \@@_frac:nn{\partial\c_math_superscript_token 2
                            #2(\@@_sort_clist:n{#4,#5})}
                         {\partial #3\partial #4}\l_@@_Partial_end_tl
            }
            {
              \l_@@_Partial_start_tl
              \@@_frac:nn{\partial\c_math_superscript_token 2
                            #2(\@@_sort_clist:n{#3,#4,#5})}
                         {\partial #3\partial #4}\l_@@_Partial_end_tl
            }
          }
        }
      }
    }
  }
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\PartialMixSecondBigg,\PartialMixSecondbigg}
% The macro \cs{PartialMixSecondBigg} is analogous to the aforementioned macros
% \cs{PartialBigg} and \cs{PartialSecondBigg}. \cs{PartialMixSecondbigg} is
% analogous to \cs{Partialbigg} and \cs{PartialSecondbigg}.
%    \begin{macrocode}
\NewDocumentCommand{\PartialMixSecondBigg}{}
{ \tl_set:Nn \l_@@_Partial_start_tl {\Biggl\l_@@_PartialOpen_tl}
  \tl_set:Nn \l_@@_Partial_end_tl {\Biggl\l_@@_PartialClose_tl}
  \tl_set:Nn \l_@@_Partial_empty_end_tl {\Biggl\l_@@_PartialClose_tl}
  \PartialMixSecond
}
\NewDocumentCommand{\PartialMixSecondbigg}{}
{ \tl_set:Nn \l_@@_Partial_start_tl {\biggl\l_@@_PartialOpen_tl}
  \tl_set:Nn \l_@@_Partial_end_tl {\biggl\l_@@_PartialClose_tl}
  \tl_set:Nn \l_@@_Partial_empty_end_tl {\biggl\l_@@_PartialClose_tl}
  \PartialMixSecond
}
%    \end{macrocode}
%
% If the user does not load the \pkg{amsmath} package, we will not have access
% to \cs{Biggl}, \cs{Biggr}, \cs{biggl}, and \cs{biggr}, so we revert them back
% to the ordinary \cs{left} and \cs{right} versions and warn the user.
%    \begin{macrocode}
\AtBeginDocument{%
  \@ifpackageloaded{amsmath}{}{%
      \PackageWarningNoLine{thermodynamics}
        {Package~amsmath~not~loaded;~load~to~make~PartialBigg~and~friends~
            work~correctly}%
      \cs_set_eq:NN \PartialBigg \Partial
      \cs_set_eq:NN \Partialbigg \Partial
      \cs_set_eq:NN \PartialSecondBigg \PartialSecond
      \cs_set_eq:NN \PartialSecondbigg \PartialSecond
      \cs_set_eq:NN \PartialMixSecondBigg \PartialMixSecond
      \cs_set_eq:NN \PartialMixSecondbigg \PartialMixSecond
      \ProvideDocumentCommand{\rvert}{}{|}
      \ProvideDocumentCommand{\lvert}{}{|}
  }%
}
%    \end{macrocode}
% \end{macro}
% \changes{v1.01}{2023/09/15}{Added \cs{Partialinline} and friends to
%   facilitate in-line (non-display-mode) partial derivatives, with
%   corresponding changes to \cs{Partial} and friends for ease of
%   implementation. Also added \cs{Partialinlinetext} and friends for
%   non-expanding delimiters.}
% \begin{macro}{\Partialinline,\PartialSecondinline,\PartialMixSecondinline}
% Inline partial derivatives.
%    \begin{macrocode}
\NewDocumentCommand{\Partialinline}{}
{
  \cs_set:Nn \@@_frac:nn { ##1 \l_@@_Partial_middle_tl / ##2 }
  \Partial
}
\NewDocumentCommand{\PartialSecondinline}{}
{
  \cs_set:Nn \@@_frac:nn { ##1 \l_@@_Partial_middle_tl / ##2 }
  \PartialSecond
}
\NewDocumentCommand{\PartialMixSecondinline}{}
{
  \cs_set:Nn \@@_frac:nn { ##1 \l_@@_Partial_middle_tl / ##2 }
  \PartialMixSecond
}
%    \end{macrocode}
% \end{macro}
% \pagebreak[1]
% \setmarginparsize{\footnotesize}
% \begin{macro}{\Partialinlinetext}
% \begin{macro}{\PartialSecondinlinetext}
% \begin{macro}{\PartialMixSecondinlinetext}
% Text-only (non-extensible delimiter) versions of \cs{Partialinline}
% and friends.
%^^A TODO: These currently "pollute" other partial derivatives until the end
%^^A       of the line (i.e., \Partialinline{z}{x}{y} = \Partial{z}{x}{y} will
%^^A       produce identical things on both sides). For now, it's a "feature."
%   \begin{macrocode}
\NewDocumentCommand{\Partialinlinetext}{}
{ \cs_set_eq:NN \l_@@_Partial_start_tl \l_@@_PartialOpen_tl
  \cs_set_eq:NN \l_@@_Partial_end_tl \l_@@_PartialClose_tl
  \cs_set_eq:NN \l_@@_Partial_empty_end_tl \l_@@_PartialEmptyClose_tl
  \cs_set_eq:NN \l_@@_Partial_middle_tl \relax
  \Partialinline
}
\NewDocumentCommand{\PartialSecondinlinetext}{}
{ \cs_set_eq:NN \l_@@_Partial_start_tl \l_@@_PartialOpen_tl
  \cs_set_eq:NN \l_@@_Partial_end_tl \l_@@_PartialClose_tl
  \cs_set_eq:NN \l_@@_Partial_empty_end_tl \l_@@_PartialEmptyClose_tl
  \cs_set_eq:NN \l_@@_Partial_middle_tl \relax
  \PartialSecondinline
}
\NewDocumentCommand{\PartialMixSecondinlinetext}{}
{ \cs_set_eq:NN \l_@@_Partial_start_tl \l_@@_PartialOpen_tl
  \cs_set_eq:NN \l_@@_Partial_end_tl \l_@@_PartialClose_tl
  \cs_set_eq:NN \l_@@_Partial_empty_end_tl \l_@@_PartialEmptyClose_tl
  \cs_set_eq:NN \l_@@_Partial_middle_tl \relax
  \PartialMixSecondinline
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \restoremarginparsize
%
% \subsection{Local Override of Delimiters}
% We define several environments that \emph{locally} override the delimiters on
% partial derivatives generated with \cs{Partial} and friends, the
% subscript notation for partial derivatives, and/or the definitions of
% range-oriented macros such as \cs{allNs}. These environments can be nested;
% the inner-most one will be honored if conflicts occur.
% \begin{environment}{thermoparentheses}
% Inside this environment, partial derivatives will have parentheses around
% them, regardless of package options.
%    \begin{macrocode}
\NewDocumentEnvironment{thermoparentheses}{}
{ \cs_set:Nn \l_@@_PartialOpen_tl {(}
  \cs_set:Nn \l_@@_PartialClose_tl {)}
  \cs_set:Nn \l_@@_PartialEmptyClose_tl {)}
}{}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{thermobrackets}
% Inside this environment, partial derivatives will have brackets around
% them, regardless of package options.
%    \begin{macrocode}
\NewDocumentEnvironment{thermobrackets}{}
{ \tl_set:Nn \l_@@_PartialOpen_tl {[}
  \tl_set:Nn \l_@@_PartialClose_tl {]}
  \tl_set:Nn \l_@@_PartialEmptyClose_tl {]}
}{}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{thermobraces}
% Inside this environment, partial derivatives will have braces around
% them, regardless of package options.
%    \begin{macrocode}
\NewDocumentEnvironment{thermobraces}{}
{ \tl_set:Nn \l_@@_PartialOpen_tl {\{}
  \tl_set:Nn \l_@@_PartialClose_tl {\}}
  \tl_set:Nn \l_@@_PartialEmptyClose_tl {\}}
}{}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{thermobar}
% Inside this environment, partial derivatives will have a trailing vertical
% bar, regardless of package options.
%    \begin{macrocode}
\NewDocumentEnvironment{thermobar}{}
{ \tl_set:Nn \l_@@_PartialOpen_tl {.}
  \tl_set:Nn \l_@@_PartialClose_tl {\rvert}
  \tl_set:Nn \l_@@_PartialEmptyClose_tl {.}
}{}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{thermoplain}
% Inside this environment, partial derivatives will have no decorations
% around them, regardless of package options.
%    \begin{macrocode}
\NewDocumentEnvironment{thermoplain}{}
{ \tl_set:Nn \l_@@_PartialOpen_tl {.}
  \tl_set:Nn \l_@@_PartialClose_tl {.}
  \tl_set:Nn \l_@@_PartialEmptyClose_tl {.}
  \bool_set_false:N \l_@@_subscripted_bool
}{}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{thermoNOsubscripts}
% Inside this environment, subscripts will not be displayed to the right of
% partial derivatives, regardless of package options.
%    \begin{macrocode}
\NewDocumentEnvironment{thermoNOsubscripts}{}
    {\bool_set_false:N \l_@@_subscripted_bool}
    {}
%    \end{macrocode}
% \begin{environment}{thermosubscripts}
% Inside this environment, subscripts will be displayed to the right of
% partial derivatives, regardless of package options.
% \end{environment}
%    \begin{macrocode}
\NewDocumentEnvironment{thermosubscripts}{}
    {\bool_set_true:N \l_@@_subscripted_bool}
    {}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{thermomolesrange}
% Inside this environment, the macro \cs{allNs} will expand to
% $n_1,\dotsc,n_C$ (or equivalent symbols if \cs{Nt} and/or \cs{ncomponents}
% have been redefined), regardless of package options. Similar expansions will
% result for \cs{allXs}, \cs{allYs}, \cs{allMs}, and so on.
% \changes{v2.00}{2023/11/16}{Added environment to invoke the ``moles-range''
%     definitions of \cs{allNs} and friends locally.}
%    \begin{macrocode}
\NewDocumentEnvironment{thermomolesrange}{}
    { \@@_set_moles_range }
    {}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{thermointensiveplain}
% \changes{v2.00}{2023/11/16}{Added environment to invoke the
%     ``intensive-plain'' option locally.}
%    \begin{macrocode}
%    \begin{macrocode}
\NewDocumentEnvironment{thermointensiveplain}{}
    { \@@_set_intensive_plain }
    {}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{thermoextensiveplain}
% \changes{v2.00}{2023/11/16}{Added environment to invoke the
%     ``extensive-plain'' option locally.}
%    \begin{macrocode}
\NewDocumentEnvironment{thermoextensiveplain}{}
    { \@@_set_extensive_plain }
    {}
%    \end{macrocode}
% \end{environment}
% \setmarginparsize{\scriptsize}
% \begin{environment}{thermointensivelowercase}
% \changes{v2.00}{2023/11/16}{Added environment to invoke the
%     ``intensive-lowercase'' option locally.}
%    \begin{macrocode}
\NewDocumentEnvironment{thermointensivelowercase}{}
    {% {
% \RenewExpandableDocumentCommand{\MacroFont}{}{
%   \fontencoding\encodingdefault
%   \fontfamily\ttdefault
%   \fontseries\mddefault
%   \fontshape\shapedefault
%   \footnotesize}

      \@@_set_intensive_lowercase
      \@@_set_lowercase_pms
    }
    {}
%    \end{macrocode}
% \end{environment}
% \begin{environment}{thermoextensivesuperscript}
% \changes{v2.00}{2023/11/16}{Added environment to invoke the
%     ``extensive-superscript'' option locally.}
%    \begin{macrocode}
\NewDocumentEnvironment{thermoextensivesuperscript}{}
    {
      \@@_set_extensive_superscripts
    }
    {}
%    \end{macrocode}
% \end{environment}
% \restoremarginparsize
%
% \subsection{User-Interface Macros to Define Symbols}
% \begin{macro}{\NewSubscriptedSymbol}
% First, we define a command that serves to create ``subscripted''
% symbols; for example, typing \verb"\cP_i" should yield $C_{P,i}$ rather
% than $C_{Pi}$, ${C_P}_i$, or ${C_{P_i}}$. Superscripts are also handled
% properly and can be in either order.
% \changes{v2.00}{2023/11/16}{Deleted \cs{DeclareSubscriptedSymbol} in favor
%   of \pkg{xparse}-based \cs{NewSubscriptedSymbol} and
%   \cs{RenewSubscriptedSymbol}.}
%    \begin{macrocode}
\str_new:N \l_@@_tmp_str
\cs_new:Npn \@@_check_definable:nN #1#2
{
  \tl_trim_spaces_apply:nN {#1} \tl_if_single_token:nTF
  {
    \str_set:Nx \l_@@_tmp_str {\tl_to_str:n {#1}}
    \int_compare:nNnT {\str_count:N \l_@@_tmp_str} = 1
    { \PackageError{thermodynamics}
        {First~argument~of~'\tl_trim_spaces:o {\tl_to_str:n {#2}}'~
         must~be~a~command}
        {The~first~argument~of~'\tl_trim_spaces:o {\tl_to_str:n {#2}}'~
         should~be~the~macro~that~will~be~used~to~refer~to~the~symbol.~
         The~provided~argument~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~
         is~a~single~character.
         \MessageBreak Perhaps~a~backslash~is~missing?}
    }
  }
  { \PackageError{thermodynamics}
      {First~argument~of~'\tl_trim_spaces:o {\tl_to_str:n {#2}}'~
       must~be~a~command}
      {The~first~argument~of~'\tl_trim_spaces:o {\tl_to_str:n {#2}}'~
       should~be~the~macro~that~will~be~used~to~refer~to~the~symbol.~
       The~provided~argument~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~
       contains~more~than~one~token.
       \MessageBreak Perhaps~a~backslash~is~missing?}
  }
} 
\tl_new:N \l_@@_super_separator_tl
\tl_new:N \l_@@_sub_separator_tl
\tl_set:Nn \l_@@_super_separator_tl {,}
\tl_set:Nn \l_@@_sub_separator_tl {,}
\NewDocumentCommand{\NewSubscriptedSymbol}{m m m}
{
  \@@_check_definable:nN {#1} \NewSubscriptedSymbol
  \cs_if_exist:NT #1
  { \PackageError{thermodynamics}
      {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~already~defined}
      {You~have~used~
       '\tl_trim_spaces:o {\tl_to_str:n {\NewSubscriptedSymbol}}'~
       with~a~command~that~already~has~a~definition}
  }
  \cs_new:cpn {\cs_to_str:N #1_one:n} ##1
  {
    {#2}\c_math_superscript_token{##1}
    \peek_catcode_remove:NTF \c_math_subscript_token
    { \use:c {\cs_to_str:N #1_three:n} }
    { \c_math_subscript_token{#3} }
  }

  \cs_new:cpn {\cs_to_str:N #1_two:n} ##1
  { {#2}\c_math_subscript_token{#3\l_@@_sub_separator_tl ##1} }

  \cs_new:cpn {\cs_to_str:N #1_three:n} ##1
  { \c_math_subscript_token{#3\l_@@_sub_separator_tl ##1} }

  \NewDocumentCommand{#1}{}
  {% @branch
    \peek_catcode_remove:NTF \c_math_superscript_token
    { \use:c {\cs_to_str:N #1_one:n} }
    { \peek_catcode_remove:NTF \c_math_subscript_token
      { \use:c {\cs_to_str:N #1_two:n} }
      { {#2}\c_math_subscript_token{#3} }
    }
  }
}
\NewDocumentCommand{\RenewSubscriptedSymbol}{m m m}
{
  \@@_check_definable:nN {#1} \RenewSubscriptedSymbol
  \cs_if_exist:NF #1
  { \PackageError{thermodynamics}
      {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~not~defined}
      {You~have~used~
       '\tl_trim_spaces:o {\tl_to_str:n {\RenewSubscriptedSymbol}}'~
       with~a~command~that~does~not~have~a~definition}
  }
  \cs_set:cpn {\cs_to_str:N #1_one:n} ##1
  {
    {#2}\c_math_superscript_token{##1}
    \peek_catcode_remove:NTF \c_math_subscript_token
    { \use:c {\cs_to_str:N #1_three:n} }
    { \c_math_subscript_token{#3} }
  }

  \cs_set:cpn {\cs_to_str:N #1_two:n} ##1
  { {#2}\c_math_subscript_token{#3\l_@@_sub_separator_tl ##1} }

  \cs_set:cpn {\cs_to_str:N #1_three:n} ##1
  { \c_math_subscript_token{#3\l_@@_sub_separator_tl ##1} }

  \RenewDocumentCommand{#1}{}
  {% @branch
    \peek_catcode_remove:NTF \c_math_superscript_token
    { \use:c {\cs_to_str:N #1_one:n} }
    { \peek_catcode_remove:NTF \c_math_subscript_token
      { \use:c {\cs_to_str:N #1_two:n} }
      { {#2}\c_math_subscript_token{#3} }
    }
  }
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\NewSuperscriptedSymbol}
% \changes{v2.00}{2023/11/16}{Created \cs{NewSuperscriptedSymbol} to handle
%   superscripted excess and residual properties without intervention.}
% \changes{v2.01}{2023/12/05}{Fixed two typos in \cs{NewSuperscriptedSymbol}.}
%    \begin{macrocode}
\NewDocumentCommand{\NewSuperscriptedSymbol}{m m m}
{
  \@@_check_definable:nN {#1} \NewSuperscriptedSymbol
  \cs_if_exist:NT #1
  { \PackageError{thermodynamics}
      {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~already~defined}
      {You~have~used~
       '\tl_trim_spaces:o {\tl_to_str:n {\NewSuperscriptedSymbol}}'~
       with~a~command~that~already~has~a~definition}
  }
  \cs_new:cpn {\cs_to_str:N #1_one:n} ##1
  {
    {#2}\c_math_subscript_token{##1}
    \peek_catcode_remove:NTF \c_math_superscript_token
    { \use:c {\cs_to_str:N #1_three:n} }
    { \c_math_superscript_token{#3} }
  }

  \cs_new:cpn {\cs_to_str:N #1_two:n} ##1
  { {#2}\c_math_superscript_token{#3\l_@@_super_separator_tl ##1} }

  \cs_new:cpn {\cs_to_str:N #1_three:n} ##1
  { {#2}\c_math_superscript_token{#3\l_@@_super_separator_tl ##1} }

  \NewDocumentCommand{#1}{}
  {
    \peek_catcode_remove:NTF \c_math_subscript_token
    { \use:c {\cs_to_str:N #1_one:n} }
    { \peek_catcode_remove:NTF \c_math_superscript_token
      { \use:c {\cs_to_str:N #1_two:n} }
      { {#2}\c_math_superscript_token{#3} }
    }
  }
}
\NewDocumentCommand{\RenewSuperscriptedSymbol}{m m m}
{
  \@@_check_definable:nN {#1} \RenewSuperscriptedSymbol
  \cs_if_exist:NF #1
  { \PackageError{thermodynamics}
      {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~not~defined}
      {You~have~used~
       '\tl_trim_spaces:o {\tl_to_str:n {\RenewSuperscriptedSymbol}}'~
       with~a~command~that~does~not~have~a~definition}
  }
  \cs_set:cpn {\cs_to_str:N #1_one:n} ##1
  {
    {#2}\c_math_subscript_token{##1}
    \peek_catcode_remove:NTF \c_math_superscript_token
    { \use:c {\cs_to_str:N #1_three:n} }
    { \c_math_superscript_token{#3} }
  }

  \cs_set:cpn {\cs_to_str:N #1_two:n} ##1
  { {#2}\c_math_superscript_token{#3\l_@@_super_separator_tl ##1} }

  \cs_set:cpn {\cs_to_str:N #1_three:n} ##1
  { \c_math_superscript_token{#3\l_@@_super_separator_tl ##1} }

  \RenewDocumentCommand{#1}{}
  {% @branch
    \peek_catcode_remove:NTF \c_math_subscript_token
    { \use:c {\cs_to_str:N #1_one:n} }
    { \peek_catcode_remove:NTF \c_math_superscript_token
      { \use:c {\cs_to_str:N #1_two:n} }
      { {#2}\c_math_superscript_token{#3} }
    }
  }
}
\cs_new:Nn \@@_subscripted_and_superscripted_core:nnnn
{
  \cs_set:cpn {\cs_to_str:N #1_one:n} ##1
  {
    {#2}\c_math_superscript_token{##1}
    \peek_catcode_remove:NTF \c_math_subscript_token
    { \use:c {\cs_to_str:N #1_three:n} }
    { \c_math_subscript_token{#3} }
  }
  \cs_set:cpn {\cs_to_str:N #1_two:n} ##1
  {
    {#2}\c_math_subscript_token{#3 ##1}
    \peek_catcode_remove:NTF \c_math_superscript_token
    { \use:c {\cs_to_str:N #1_four:n} }
    { \c_math_superscript_token{#4 \bullet} }
  }
  \cs_set:cpn {\cs_to_str:N #1_three:n} ##1
  { \c_math_subscript_token{#3 ##1} }
  \cs_set:cpn {\cs_to_str:N #1_four:n} ##1
  { \c_math_superscript_token{#4 ##1} }
}
\NewDocumentCommand{\NewSubscriptedandSuperscriptedSymbol}{m m m m}
{
  \@@_check_definable:nN {#1} \NewSubscriptedandSuperscriptedSymbol
  \cs_if_exist:NT #1
  { \PackageError{thermodynamics}
      {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~already~defined}
      {You~have~used~
       '\tl_trim_spaces:o
          {\tl_to_str:n {\NewSubscriptedandSuperScriptedSymbol}}'~
           with~a~command~that~already~has~a~definition}
  }
  \@@_subscripted_and_superscripted_core:nnnn {#1} {#2} {#3} {#4}
  \NewDocumentCommand{#1}{}
  {
    \peek_catcode_remove:NTF \c_math_superscript_token
    { \use:c {\cs_to_str:N #1_one:n} }
    { \peek_catcode_remove:NTF \c_math_subscript_token
      { \use:c {\cs_to_str:N #1_two:n} }
      { {#2}\c_math_subscript_token{#3}\c_math_superscript_token{#4} }
    }
  }
}
\NewDocumentCommand{\RenewSubscriptedandSuperscriptedSymbol}{m m m m}
{
  \@@_check_definable:nN {#1} \RenewSubscriptedandSuperscriptedSymbol
%^^A  \cs_if_exist:NF #1
%^^A  { \PackageError{thermodynamics}
%^^A      {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~not~already~defined}
%^^A      {You~have~used~
%^^A       '\tl_trim_spaces:o
%^^A          {\tl_to_str:n {\RenewSubscriptedandSuperScriptedSymbol}}'~
%^^A           with~a~command~that~does~not~have~a~definition}
%^^A  }
%^^A  \@@_subscripted_and_superscripted_core:nnnn {#1} {#2} {#3} {#4}
%^^A  \RenewDocumentCommand{#1}{}
%^^A  {
%^^A    \peek_catcode_remove:NTF \c_math_superscript_token
%^^A    { \use:c {\cs_to_str:N #1_one:n} }
%^^A    { \peek_catcode_remove:NTF \c_math_subscript_token
%^^A      { \use:c {\cs_to_str:N #1_two:n} }
%^^A      { {#2}\c_math_subscript_token{#3}\c_math_superscript_token{#4} }
%^^A    }
%^^A  }
}
%    \end{macrocode}
% \end{macro}
% \subsection{Symbol Definitions}
% \begin{macro}{\heatcapacitysymbol,\compressibilitysymbol,\expansivitysymbol}
% We define symbols for the heat capacities, compressibilities, and so forth.
%    \begin{macrocode}
\NewExpandableDocumentCommand{\heatcapacitysymbol}{}{C}
\NewExpandableDocumentCommand{\compressibilitysymbol}{}{\kappa}
\NewExpandableDocumentCommand{\expansivitysymbol}{}{\alpha}
\NewExpandableDocumentCommand{\JTsymbol}{}{\mu}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\cV,\cP}
% The heat capacities are molar by default; we also declare extensive and
% specific heat capacities.
% The heat capacities themselves are defined to be ``smart'': \verb"\cV_i" will
% recognize the subscript appropriately and render $C_{V,i}$ rather than
% ${C_V}_i$ or some other unintended symbol. Superscripts are also handled
% appropriately and can be in either order.
%    \begin{macrocode}
\NewSubscriptedSymbol{\cV}{\@@_intensive:n \heatcapacitysymbol}
    {\g_@@_volume_symbol}
\NewSubscriptedSymbol{\cP}{\@@_intensive:n \heatcapacitysymbol}
    {\g_@@_pressure_symbol}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\cVt,\cPt}
% We also introduce \emph{extensive} (rather than molar) heat capacity macros.
%    \begin{macrocode}
\NewSubscriptedSymbol{\cVt}{\@@_extensive:n \heatcapacitysymbol}
    {\g_@@_volume_symbol}
\NewSubscriptedSymbol{\cPt}{\@@_extensive:n \heatcapacitysymbol}
    {\g_@@_pressure_symbol}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\cVs,\cPs}
% \cs{cPs} and \cs{cVs} are the specific heat capacities.
%    \begin{macrocode}
\NewSubscriptedSymbol{\cVs}{\@@_specific:n \heatcapacitysymbol}
    {\g_@@_volume_symbol}
\NewSubscriptedSymbol{\cPs}{\@@_specific:n \heatcapacitysymbol}
    {\g_@@_pressure_symbol}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\kappaT,\kappaS}
% The isothermal and adiabatic compressibilities are defined similarly, but
% those do not have extensive versions for obvious reasons.
%    \begin{macrocode}
\NewSubscriptedSymbol{\kappaT}{\compressibilitysymbol}
    {\g_@@_temperature_symbol}
\NewSubscriptedSymbol{\kappaS}{\compressibilitysymbol}
    {\g_@@_entropy_symbol}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\alphaP,\alphaS}
% The macro \cs{alphaP} is intended to refer to the isobaric volume
% expansivity, while \cs{alphaS} is the isentropic volume expansivity.
%    \begin{macrocode}
\NewSubscriptedSymbol{\alphaP}{\expansivitysymbol}{\g_@@_pressure_symbol}
\NewSubscriptedSymbol{\alphaS}{\expansivitysymbol}{\g_@@_entropy_symbol}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\muJT}
% The macro \cs{muJT} renders the Joule--Thomson coefficient.
%    \begin{macrocode}
\NewSubscriptedSymbol{\muJT}{\JTsymbol}{\text{JT}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\Psat,\Pvap,\phisat,\fsat,\sat}
% The \cs{Psat} macro (and its clone, the \cs{Pvap} macro) should be used for
% the saturation pressure.
% Similarly, a \cs{phisat} macro typesets the fugacity coefficient at
% saturation. The \cs{fsat} macro similarly renders the fugacity at saturation.
% Other saturation properties should use \verb"M^\sat" or similar, preferably
% by defining another macro such as \verb"\Gmsat".
%    \begin{macrocode}
\NewDocumentCommand{\sat}{}{{\text{sat}}}
\NewDocumentCommand{\Psat}{}{P\c_math_superscript_token\sat}
\NewDocumentCommand{\Pvap}{}{\Psat}
\NewDocumentCommand{\phisat}{}{\phi\c_math_superscript_token\sat}
\NewDocumentCommand{\fsat}{}{\fpure\c_math_superscript_token\sat}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\std,\Pstd,\fstd,\Cstd,\mustd}
% The \cs{std} macro denotes standard properties. \cs{Pstd}, \cs{Cstd},
% \cs{fstd}, and \cs{mustd} are defined for convenience and for consistency
% across textbooks.
% \changes{v2.02}{2024/06/14}{Added \cs{Cstd} and \cs{mustd} to standardize
%   standard molalities and chemical potentials across textbooks.}
%    \begin{macrocode}
\NewDocumentCommand{\std}{}{\circ}
\NewDocumentCommand{\Pstd}{}{P\c_math_superscript_token \std}
\NewDocumentCommand{\Cstd}{}{C\c_math_superscript_token \std}
\NewDocumentCommand{\fstd}{}{f\c_math_superscript_token \std}
\NewDocumentCommand{\mustd}{}{\mu\c_math_superscript_token \std}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\xrxn}
% The \cs{xrxn} macro denotes the extent of reaction.
% \changes{v2.02}{2024/06/14}{Added \cs{xrxn} macro to standardize the
%   extent of reaction macro across textbooks.}
%    \begin{macrocode}
\NewDocumentCommand{\xrxn}{}{\xi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\fmix}
% The \cs{fmix} command is intended to describe fugacities in mixtures.
% It renders as $\hat f$ by default, and would be used as \verb"\fmix_i" or
% the like, producing $\hat f_i$; some authors like to use $\bar f_i$ or
% just $f_i$, and this command creates a consistent way to change between
% such options.
%    \begin{macrocode}
\NewDocumentCommand{\fmix}{}{\hat{f}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\phimix}
% A similar command, \cs{phimix}, renders $\hat\phi$ by default to represent
% the fugacity coefficient in a mixture.
%    \begin{macrocode}
\NewDocumentCommand{\phimix}{}{\hat\phi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\fpure}
% The \cs{fpure} command is intended to describe fugacities in pure substances.
% It renders as $f$ by default, and would be used as \verb"\fpure" or
% \verb"\fpure_i" or the like, producing $f_i$; some authors like to use
% $f_{\text{pure}\,i}$, and others like to use $f_i^\bullet$; this command
% creates a consistent way to change between the these options. A similar
% command for $\phi$ is given, \cs{phipure}, for fugacity coefficients.
%    \begin{macrocode}
\NewDocumentCommand{\fpure}{}{f}
\NewDocumentCommand{\phipure}{}{\phi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\actabs,\actrel}
% The \cs{actabs} and \cs{actrel} macros are intended to standardize the macro
% for the absolute and relative activities, respectively, across textbooks.
% The defaults are \(\actabs\) and \(\actrel\), respectively.
% \changes{v2.02}{2024/06/14}{Added \cs{actabs} and \cs{actrel} to make
%   absolute and relative activity symbols consistent.}
%    \begin{macrocode}
\NewExpandableDocumentCommand{\actabs}{}{\lambda}
\NewExpandableDocumentCommand{\actrel}{}{a}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Property Changes}
% \begin{macro}{\Deltamix,\mixing}
% Mixing properties, such as $\Deltamix\Gm$, should be accessed using
% \verb"\Deltamix\Gm" and similar constructions---this construct will typeset
% as $\Delta_{MIX}G$ using the |Thompson| package option, for example,
% and as $\Delta_\text{mix}\Gt$ using the |Sandler| package option.
%    \begin{macrocode}
\NewDocumentCommand{\mixing}{}{{\text{mix}}}
\NewDocumentCommand{\Deltamix}{m}
    {\Delta{#1}\c_math_subscript_token\mixing}
%    \end{macrocode}
% \end{macro}
%
% \pagebreak[2]%
% \begin{macro}{\formation,\fusion,\reaction,\sublimation,\vaporization}
% Macros for subscripts/superscripts on property changes,
%    \begin{macrocode}
\NewDocumentCommand{\formation}{}{f}
\NewDocumentCommand{\fusion}{}{{\text{fus}}}
\NewDocumentCommand{\reaction}{}{{\text{rxn}}}
\NewDocumentCommand{\sublimation}{}{{\text{sub}}}
\NewDocumentCommand{\vaporization}{}{{\text{vap}}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Deltafus,\Deltasub,\Deltavap,\Deltarxn}
% and similar macros for the property changes themselves. Some of these may
% be redefined by package options that select a particular textbook.
% \changes{v2.02}{2024/06/14}{Changed implementation of \cs{Deltarxn} to
%   handle subscripts.}
%    \begin{macrocode}
\NewDocumentCommand{\Deltafus}{m}
    {\Delta #1\c_math_superscript_token\fusion}
\NewDocumentCommand{\Deltasub}{m}
    {\Delta #1\c_math_superscript_token\sublimation}
\NewDocumentCommand{\Deltavap}{m}
    {\Delta #1\c_math_superscript_token\vaporization}
\NewDocumentCommand{\Deltarxn}{m}
{
  \cs_set:Npn \@@_Deltarxn_one ##1
  {
      \Delta #1\c_math_subscript_token{\reaction,##1}
  }
  \peek_catcode_remove:NTF \c_math_subscript_token
  {
    \@@_Deltarxn_one
  }
  {
    \Delta #1\c_math_subscript_token{\reaction}
  }
}
\tl_new:N \l_@@_Deltaf_sym_tl
\NewSubscriptedSymbol{\@@_Deltaf}{\l_@@_Deltaf_sym_tl}{\formation}
\NewDocumentCommand{\Deltaf}{m}
{ \tl_set:Nn \l_@@_Deltaf_sym_tl {\Delta #1}
  \@@_Deltaf
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Partial Molar Quantities}
% \begin{macro}{\partialmolar}
% Partial molar quantities with superscripts appear as $\Gpm[\IG]{i}$ or
% $\GRpm{i}$ (or, with the |shortpm| option, as
% \begin{thermoshortpm}$\Gpm[\IG]{i}$ or $\GRpm{i}$\end{thermoshortpm}),
% rather than something like $\overline{G}^\IG_i$ or $\overline{G}_i^R$; the
% former looks better but is harder to implement for obvious reasons. Their
% definitions allow them to be used as symbols, something like \verb"\Gpm_i",
% \verb"\Gpm^{\IGM}_i", \verb"\Gpm^{\IGM}_i", and even \verb"\Gpm_i^{\IGM}";
% they can also be treated as commands: \verb"\Gpm{i}" is equivalent to
% \verb"\Gpm_i" and \verb"\Gpm[\IGM]{i}" is equivalent to \verb"\Gpm_i^{\IGM}".
% The macro \cs{partialmolar} can be used to create an arbitrary partial
% molar symbol.
%    \begin{macrocode}
\tl_new:N \l_@@_pm_symbol_tl
\tl_new:N \l_@@_pm_arg_tl
\NewDocumentCommand{\partialmolar}{m}
{
  \tl_set:Nn \l_@@_pm_symbol_tl {#1}
  \@@_generic_pm:
}
%% cases to consider:
%% (1) \Mpm{i}
%% (2) \Mpm[S]{i}
%% (3) \Mpm^S_i
%% (4) \Mpm_i^S
%% (5) \Mpm_i
%% note that \Mpm^S with no subscript makes no sense and is thus forbidden
\cs_new:Nn \@@_generic_pm:
{
  \peek_catcode_remove:NTF \c_math_subscript_token
  {% case 4 or case 5
    \@@_pm_case_four_or_five
  }
  {% look for superscript token
    \peek_catcode_remove:NTF \c_math_superscript_token
    {% case 3: \Mpm^{#1}_{#2} or \Mpm^{#1}{#2}
      \@@_pm_case_three
    }
    {% Look for optional argument [...]
      \peek_charcode:NTF [
      {% case 2: \Mpm[S]{i}
        \@@_pm_case_two
      }
      {% case 1: \Mpm{i}
        \@@_pm_case_one
      }
    }
  }
}
\cs_new:Npn \@@_pm_case_one #1
{
  \bool_if:NTF \l_@@_longpm_bool
  { \@@_overline:n {\l_@@_pm_symbol_tl\c_math_subscript_token{#1}} }
  {
    \@@_overline:n {\l_@@_pm_symbol_tl}\c_math_subscript_token{#1}
  }
}
\cs_new:Npn \@@_pm_case_two [#1]#2
{
  \bool_if:NTF \l_@@_longpm_bool
  {  \@@_overline:n {\l_@@_pm_symbol_tl
       \c_math_superscript_token{#1}\c_math_subscript_token{#2}}
  }
  {  \@@_overline:n {\l_@@_pm_symbol_tl}
       \c_math_superscript_token{#1}\c_math_subscript_token{#2}
  }
}
\cs_new:Npn \@@_pm_case_three #1
{
  \tl_set:Nn \l_@@_pm_arg_tl {#1}
  \peek_catcode_remove:NTF \c_math_subscript_token
  { \@@_pm_case_three_part_two }
  { \@@_pm_case_three_part_two }
}
\cs_new:Npn \@@_pm_case_three_part_two #1
{
  \bool_if:NTF \l_@@_longpm_bool
  { \@@_overline:n {\l_@@_pm_symbol_tl
      \c_math_superscript_token{\l_@@_pm_arg_tl}
      \c_math_subscript_token{#1}}
  }
  { \@@_overline:n {\l_@@_pm_symbol_tl}
      \c_math_superscript_token{\l_@@_pm_arg_tl}
      \c_math_subscript_token{#1}
  }
}
\cs_new:Npn \@@_pm_case_four_or_five #1
{
  \tl_set:Nn \l_@@_pm_arg_tl {#1}
  \peek_catcode_remove:NTF \c_math_superscript_token
  { \@@_pm_case_four }
  { \@@_pm_case_five }
}
\cs_new:Npn \@@_pm_case_four #1
{
  \bool_if:NTF \l_@@_longpm_bool
  { \@@_overline:n {\l_@@_pm_symbol_tl\c_math_superscript_token{#1}
      \c_math_subscript_token{\l_@@_pm_arg_tl}}
  }
  { \@@_overline:n {\l_@@_pm_symbol_tl}\c_math_superscript_token{#1}
      \c_math_subscript_token{\l_@@_pm_arg_tl}
  }
}
\cs_new:Npn \@@_pm_case_five
{
  \bool_if:NTF \l_@@_longpm_bool
  { \@@_overline:n {\l_@@_pm_symbol_tl
      \c_math_subscript_token{\l_@@_pm_arg_tl}}
  }
  { \@@_overline:n {\l_@@_pm_symbol_tl}
      \c_math_subscript_token{\l_@@_pm_arg_tl}
  }
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Thermodynamic Property Definitions}
% These macros define the user interface to the symbols for energy, volume,
% and so forth. There are five commands that define thermodynamic properties.
%
% \begin{macro}{\NewExtensiveProperty}
% The command \cs{NewExtensiveProperty} declares macros for a total, molar, and
% specific version of the symbol; for example, a second heat-like property
% could be defined via
% \begin{verbatim}
%  \NewExtensiveProperty{R}{\mathcal{Q}}
%\end{verbatim}
% \NewExtensiveProperty{R}{\mathcal{Q}}\relax
% The command above would declare the macros \cs{Rt}, \cs{Rm}, and \cs{Rs}
% that expand to $\Rt$, $\Rm$, and $\Rs$, respectively, using the default
% package options.
% \end{macro}
%
% \begin{macro}{\NewPartialMolarProperty}
% The command \cs{NewPartialMolarProperty} declares a macro for the partial
% molar quantity. For example,
% \begin{verbatim}
%  \NewPartialMolarProperty{I}{\Psi}
%\end{verbatim}
% \NewPartialMolarProperty{I}{\Psi}\relax
% would create the command \cs{Ipm}, which would typeset a partial molar
% command with the base symbol $\Psi$, yielding $\Ipm{i}$.
% \end{macro}
%
% \begin{macro}{\NewThermodynamicProperty}
% Declaring a new potential is handled by the
% \cs{NewThermodynamicProperty} macro, which takes two arguments. The first
% is the base of the name, and the second is the base of the symbol. This
% declares four new commands for the extensive, molar, specific, and partial
% molar properties. These commands consist of the first argument followed by
% \verb"t", \verb"m", \verb"s", and \verb"pm", respectively. For example, one
% might define the entropy via
% \begin{verbatim}
%  \NewThermodynamicProperty{S}{S}
%\end{verbatim}
% and it would define the macros \cs{St}, \cs{Sm}, \cs{Ss}, and \cs{Spm} that
% yield, respectively, $\St$, S, $\hat S$, and $\Spm{i}$ (assuming the
% subscript to the partial molar quantity was $i$).
% It would also declare residual and excess properties for that base symbol.
% Note that the actual definition of the entropy and the other standard
% properties is slightly more complicated so as to allow for different symbols
% to be used in different textbooks.
%    \begin{macrocode}
\NewDocumentCommand{\NewThermodynamicProperty}{m m}
{
  \NewExtensiveProperty{#1}{#2}
  \NewPartialMolarProperty{#1}{#2}
  \NewResidualProperty{#1}{#2}
  \NewExcessProperty{#1}{#2}
}
\ProvideDocumentCommand{\NewExtensiveProperty}{m m}
{
  % Extensive property
  \exp_after:wN \NewDocumentCommand \exp_after:wN
    {\cs:w #1t\cs_end:}{}{\@@_extensive:n {#2}}
  % Molar property
  \exp_after:wN \NewDocumentCommand \exp_after:wN
    {\cs:w #1m\cs_end:}{}{\@@_intensive:n {#2}}
  % Specific property
  \exp_after:wN \NewDocumentCommand \exp_after:wN
    {\cs:w #1s\cs_end:}{}{\@@_specific:n {#2}}
}
\NewDocumentCommand{\NewPartialMolarProperty}{m m}
{
  % Partial molar property
  \exp_after:wN \NewDocumentCommand \exp_after:wN
    {\cs:w #1pm\cs_end:}{}{\partialmolar{#2}}
}
\ProvideDocumentCommand{\NewExcessProperty}{m m}
{
  \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
    {\cs:w #1 Et\cs_end:}{\@@_extensive:n{#2}}{\excess}
  \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
    {\cs:w #1 E\cs_end:}{\@@_intensive:n{#2}}{\excess}
  \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
    {\cs:w #1 Es\cs_end:}{\@@_specific:n{#2}}{\excess}

  % Excess partial molar property
  \exp_after:wN \NewDocumentCommand \exp_after:wN
    {\cs:w #1Epm\cs_end:}{}{\partialmolar{#2}
       \c_math_superscript_token\excess}
}
\ProvideDocumentCommand{\NewResidualProperty}{m m}
{
  \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
    {\cs:w #1 Rt\cs_end:}{\@@_extensive:n{#2}}{\residual}
  \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
    {\cs:w #1 R\cs_end:}{\@@_intensive:n{#2}}{\residual}
  \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
    {\cs:w #1 Rs\cs_end:}{\@@_specific:n{#2}}{\residual}

  % Residual partial molar property
  \exp_after:wN \NewDocumentCommand \exp_after:wN
    {\cs:w #1Rpm\cs_end:}{}{\partialmolar{#2}
        \c_math_superscript_token\residual}
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Nt,\Et,\Em,\Es,\Epm}
% \penalty-600%
% We define \cs{Nt} as the number of moles, as that changes between books a
% lot, but it does not have extensive, molar, and specific equivalents.
% Heat and work are defined, but lack partial molar properties. Area does not
% have excess or residual properties.
%    \begin{macrocode}
\NewDocumentCommand{\Nt}{}{\g_@@_mole_symbol}
\NewThermodynamicProperty{E}{\g_@@_total_energy_symbol}
\NewThermodynamicProperty{U}{\g_@@_internal_energy_symbol}
\NewThermodynamicProperty{F}{\g_@@_Helmholtz_symbol}
\NewThermodynamicProperty{G}{\g_@@_Gibbs_symbol}
\NewThermodynamicProperty{H}{\g_@@_enthalpy_symbol}
\NewThermodynamicProperty{L}{\g_@@_Landau_symbol}
\NewThermodynamicProperty{V}{\g_@@_volume_symbol}
\NewThermodynamicProperty{S}{\g_@@_entropy_symbol}
\NewExtensiveProperty{A}{\g_@@_area_symbol}
\NewPartialMolarProperty{A}{\g_@@_area_symbol}
\NewExtensiveProperty{Q}{\g_@@_heat_symbol}
\NewExtensiveProperty{W}{\g_@@_work_symbol}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\cVpm,\cPpm}
% Partial molar heat capacities are \emph{hard}, but the following
% implementation seems to work flawlessly\dots so far.
% \changes{v2.02}{2024/06/14}{Simplified implementations of partial molar
%   heat capacities that take advantage of \cs{NewPartialMolarProperty} and
%   \cs{NewSubscriptedProperty}. This fixes the issue of the subscripts being
%   ``persistent'' after \cs{cPpm} is used in a line. Also declared alternative
%   symbols for use with the \texttt{shortpm} option.}
%    \begin{macrocode}
\NewPartialMolarProperty{cP}{\cP}
\NewPartialMolarProperty{cV}{\cV}
\NewSubscriptedSymbol{\cPpmshort}{\@@_overline_copy:n{\heatcapacitysymbol}}
    {\g_@@_pressure_symbol}
\NewSubscriptedSymbol{\cVpmshort}{\@@_overline_copy:n{\heatcapacitysymbol}}
    {\g_@@_volume_symbol}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Electrochemistry}
% \begin{macro}{\Epot}
% \changes{v2.02}{2024/06/14}{Added \cs{Epot} to standardize the electric
%   potential across textbooks for electrochemistry.}
% The \cs{Epot} command can be used for the electric potential.
%    \begin{macrocode}
\NewExpandableDocumentCommand{\Epot}{}{E}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Residual and Excess Properties}
% \begin{macro}{\residual,\excess}
% Macros are defined for residual properties (departure from ideal gases)
% and excess properties (departure from ideal solutions). We begin with two
% macros to use for defining generic residual and excess properties that are
% not already defined.
%    \begin{macrocode}
\NewDocumentCommand{\residual}{}{R}
\NewDocumentCommand{\excess}{}{E}
%    \end{macrocode}
% \end{macro}
%
% \pagebreak[1]\relax
% \begin{macro}{\prodall,\sumall,\summallbutlast}
% The \cs{sumall} macro and its cousin, \cs{sumallbutlast}, simplify the
% typesetting of commonly-used sums; the command \cs{prodall} does the same
% thing for products, viz.,
% \begin{verbatim}
%   \[ \sumall_i x_i = 1 \qquad \sumallbutlast_i x_i = 1 - x_\ncomponents
%       \qquad K = \exp\left(\frac{-\Deltarxn\Gm^\std}{RT}\right)
%                = \prodall_i a_i^{\nu_i} \]
%\end{verbatim}
% gives
%   \[ \sumall_i x_i = 1 \qquad \sumallbutlast_i x_i = 1 - x_\ncomponents
%       \qquad K = \exp\left(\frac{-\Deltarxn\Gm^\std}{RT}\right)
%                = \prodall_i a_i^{\nu_i} \]
%    \begin{macrocode}
\NewDocumentCommand{\sumall}{m m}
  { \sum\c_math_subscript_token{#2=1}
      \c_math_superscript_token{\ncomponents} }
\NewDocumentCommand{\sumallbutlast}{m m}
  { \sum\c_math_subscript_token{#2=1}
      \c_math_superscript_token{\ncomponents-1} }
\NewDocumentCommand{\prodall}{m m}
  { \prod\c_math_subscript_token{#2=1}
       \c_math_superscript_token{\ncomponents} }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\IG,\IGM,\IS}
% The \cs{IG}, \cs{IGM}, and \cs{IS} macros (meaning ``ideal gas,'' ``ideal
% gas mixture,'' and ``ideal solution,'' respectively) should be used to
% make clean transitions between textbooks---some use ``IM'' or ``ID'' rather
% than ``IS,'' for example.
%    \begin{macrocode}
\NewDocumentCommand{\IG}{}{{\text{IG}}}
\NewDocumentCommand{\IGM}{}{{\text{IGM}}}
\NewDocumentCommand{\IS}{}{{\text{IS}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\Henryrat,\Henrymol}
% \subsubsection{Henry's Law Constants and Activity Coefficients}
% The Henry's Law constants for the rational basis ($y_i P = x_i h_i$) and
% the molal basis ($y_i P = C_i \mathcal{H}_i$) are given by the macros
% \cs{Henryrat} and \cs{Henrymol}, respectively. Using them this way
% consistently allows for easy switching back and forth.
%    \begin{macrocode}
\NewDocumentCommand{\Henryrat}{}{h}
\NewDocumentCommand{\Henrymol}{}{\mathcal{H}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\gammait,\muit}
% \changes{v2.02}{2024/06/14}{Added \cs{muit} and \cs{gammait} to preserve
%       symbols in case the base macros are redefined by a package.}
% \begin{macro}{\gammarat,\gammamol}
% The ordinary activity coefficient is typically denoted $\gamma$ or
% $\gammaup$, so the base symbol will still be \cs{gamma}. The macro
% \cs{gammait} is defined just in case \cs{gamma} is redefined by a package
% option. However, symbols for the Henry's Law activity coefficients are far
% from universal, so I have defined macros to make their use consistent. The
% defaults render \cs{gammarat} as $\gamma^\ast$ and \cs{gammamol} as
% $\gamma^\square$. \cs{gammamol} will use \cs{square} from packages if it is
% defined; if not, it ``fakes it'' with the definition below.
% The symbol for the chemical potential is \cs{mu}, but \cs{muit} is defined
% so the symbol is still available, should \cs{mu} be redefined later.
%^^A Backup for \square adapted from amsthm.sty with tweaks to make it
%^^A look reasonably similar to that from newpx (i.e., smaller than the
%^^A amsfonts version)
%    \begin{macrocode}
\cs_gset_eq:NN \gammait \gamma
\cs_gset_eq:NN \muit \mu
\AtBeginDocument{%
  \ProvideDocumentCommand{\square}{}{%
    \text{\leavevmode
      \hbox to.65em{%
      \hfil\vrule
      \vbox to.53em{\hrule width.45em\vfil\hrule}%
      \vrule\hfil}%
    }%
  }%
}
\NewDocumentCommand{\gammarat}{}{\gamma\c_math_superscript_token\ast}
\NewDocumentCommand{\gammamol}{}{\gamma\c_math_superscript_token\square}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \subsection{Jacobians}
% \begin{environment}{thermovmatrix}
% This is a non-user-interface wrapper environment used to detect, in
% effect, whether \pkg{amsmath} has been loaded. If so, it uses its
% \env{vmatrix} environment for Jacobians; if not, it fakes it with
% \env{array} (which does not look nearly as good).
%    \begin{macrocode}
\NewDocumentEnvironment{thermovmatrix}{}
{ \cs_if_exist:NTF \vmatrix
  { \begin{vmatrix} }
  { \left|\begin{array}{c c c c c c c c c c} }
}
{ \cs_if_exist:NTF \endvmatrix
  {  \end{vmatrix} }
  {  \end{array}\right| }
}
%    \end{macrocode}
% \end{environment}
% \begin{macro}{Jacobian}
% The \cs{Jacobian} command typesets the Leibnitz notation for the Jacobian
% determinant.\relax
% \changes{v2.00}{2023/11/16}{Reimplemented \cs{Jacobian} to handle an
%     arbitary number of variables and implemented \cs{Jacobiandet} to
%     handle the matrix representation of the Jacobian.}
%    \begin{macrocode}
\NewDocumentCommand{\Jacobian}{m m}
    {\@@_frac:nn{\partial(#1)}{\partial{(#2)}}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{Jacobiandet}
% Similarly, the \cs{Jacobiandet} macro typesets the actual determinant that
% the Jacobian notation represents.
%    \begin{macrocode}
\NewDocumentCommand{\Jacobiandet}{O{} O{} m m}
{
  \@@_Jacobian_set_ncomponents:nn {#3} {#4}
  \begin{thermovmatrix}
    \@@_Jacobianmatrix:nnnn {#1} {#2} {#3} {#4}
  \end{thermovmatrix}
}
\seq_new:N \l_@@_row_seq
\seq_new:N \l_@@_matrix_seq
\clist_new:N \l_@@_other_vars_clist
\clist_new:N \l_@@_other_vars_copy_clist
\tl_new:N \l_@@_Jacobian_x_tl
\tl_new:N \l_@@_Jacobian_n_tl
\tl_new:N \l_@@_Jacobian_temp_tl
\bool_new:N \l_@@_found_dots_bool
\cs_new:Nn \@@_Jacobian_set_ncomponents:nn
{
  % If any entry is \dots, we assume the Jacobian is of the form
  % d(f_1,\dots,f_n)/d(x_1,\dots,x_n) where f is some function
  % (any symbol) and x is some variable (any symbol).
  \tl_if_in:nnTF {#1} {\dots}
  {% Has dots
    \bool_set_true:N \l_@@_found_dots_bool
    % look for what "x" is
    \tl_set:Nn \l_@@_Jacobian_x_tl {\tl_head:n {#2}}
    % look for what "n" is and set \ncomponents to it
    \tl_set:Nx \l_@@_Jacobian_n_tl {\tl_item:nn {#2} {-1}}
    \RenewExpandableDocumentCommand{\ncomponents}{}{\l_@@_Jacobian_n_tl}
  }
  {% Does not have dots; proceed accordingly
    \bool_set_false:N \l_@@_found_dots_bool
  }
}
\cs_new_protected:Nn \@@_Jacobianmatrix:nnnn
{
  \seq_clear:N \l_@@_matrix_seq
  \clist_set:Nn \l_@@_other_vars_clist {#4}
  \clist_set_eq:NN \l_@@_other_vars_copy_clist \l_@@_other_vars_clist

  \clist_map_inline:nn {#3}
  {
    \seq_clear:N \l_@@_row_seq
    \tl_if_in:nnTF {##1} {\dots}
    {% The current row has "dots" =&gt; row is \vdots &amp;&amp; \vdots
      \seq_put_right:Nn \l_@@_matrix_seq
        { \vdots \c_alignment_token \c_alignment_token \vdots }
    }
    {% Ordinary row
      \clist_map_inline:nn {#4}
      {
        \tl_if_in:nnTF {####1} {\dots}
        {% this column has "dots" in it
          \seq_put_right:Nn \l_@@_row_seq \dots
        }
        {% Normal column
          \clist_set_eq:NN \l_@@_other_vars_clist
                           \l_@@_other_vars_copy_clist
          \clist_remove_all:Nn \l_@@_other_vars_clist {####1}
          \bool_if:NTF \l_@@_found_dots_bool
          { \tl_set:Nn \l_@@_Jacobian_temp_tl {\tl_item:nn {####1} {-1}}
            \seq_put_right:Nx \l_@@_row_seq
            {
              #1\Partial{##1}{####1}
                  {\allbut{\l_@@_Jacobian_temp_tl}{\l_@@_Jacobian_x_tl}}
            }
          }
          { \seq_put_right:Nx \l_@@_row_seq
            {
              #1\Partial{##1}{####1}
                        {\clist_use:Nn \l_@@_other_vars_clist ,}
            }
          }
        }
      }
      \seq_put_right:Nx \l_@@_matrix_seq
      {
        \seq_use:Nn \l_@@_row_seq { \c_alignment_token }
      }
    }
  }
  \tl_if_empty:nTF {#2}
  {
    \tl_if_eq:nnTF {#1} {\displaystyle}
    { \seq_use:Nn \l_@@_matrix_seq { \\[2.75ex] } }
    { \seq_use:Nn \l_@@_matrix_seq { \\[1.25ex] } }
  }
  {
    \seq_use:Nn \l_@@_matrix_seq { \\[#2] }
  }
}
%    \end{macrocode}
% \end{macro}
%^^X\end{implementation}
%
% \Finale
% \iffalse
%&lt;/package&gt;
%&lt;*example&gt;
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{thermodynamics}
\title{Examples to Accompany the \textsf{thermodynamics} Package}
\author{Karl D. Hammond}
\date{}
\begin{document}
\NewThermodynamicProperty{B}{B}
\maketitle\noindent
The combined laws:
\begin{align*}
  d\Et &amp;= d\Ut + d\left(\frac12 m v^2\right) - d(m\phi) \\
  d\Ut &amp;= \dbar\Qt + \dbar\Wt + \Um d\Nt
        = \dbar\Qt - P d\Vt + \Hm d\Nt
    \\ &amp;= \Partial*{\Ut}{\St}{\Vt,\allNs} d\St
        + \Partial*{\Ut}{\Vt}{\St,\allNs} d\Vt
        + \sumall_i \Partial*{\Ut}{\Nt_i}{\Vt,\St,\allNsbut{i}} d\Nt_i
    \\ &amp;= T d\St - P d\Vt + \sumall_i \mu_i d\Nt_i
\end{align*}
With surfaces present:
\begin{gather*}
   d\Ut = T d\St - P d\Vt  + \sigma d\At + \sumall_i \mu_i d\Nt_i \\
   d\Ht = T d\St + \Vt dP  + \sigma d\At + \sumall_i \mu_i d\Nt_i \\
   d\Ft = -\St dT - P d\Vt + \sigma d\At + \sumall_i \mu_i d\Nt_i \\
   d\Gt = -\St dT + \Vt dP + \sigma d\At + \sumall_i \mu_i d\Nt_i \\
   d\Lt = -\St dT - P d\Vt + \sigma d\At - \sumall_i \Nt_i d\mu_i \\
    \Bt = \Ut + P\Vt - T\St - \sigma\At \\
   d\Bt = -\St dT + \Vt dP - \At d\sigma + \sumall_i \mu_i d\Nt_i \\
   \mu_i = \Bpm_i = \Gpm_i + \sigma \Apm_i
\end{gather*}
Some Maxwell reciprocity relations:
\begin{gather*}
  \Partial*{\Vt}{T}{P,\allNs}
    = \PartialMixSecond*{\Gt}{T}{P}{\allNs}
    = \PartialMixSecond*{\Gt}{P}{T}{\allNs}
    = -\Partial{\St}{P}{T,\allNs}
\\
    \Partial*{\Gpm_i}{T}{P,\allXs}
    = \PartialMixSecond*{\Gt}{T}{\Nt_i}{P,\allNsbut{i}}
    = \PartialMixSecond*{\Gt}{\Nt_i}{T}{P,\allNsbut{i}}
    = -\Partial*{\St}{\Nt_i}{T,P,\allNsbut{i}}
    = -\Spm_i
\end{gather*}
Temporary changes of derivative delimiters:
\begin{gather*}
  \begin{thermobrackets}
    \Partial*{\Vt}{T}{P,\allNs}
  \end{thermobrackets}
  \begin{thermobar}
    = \PartialMixSecond*{\Gt}{T}{P}{\allNs}
  \end{thermobar}
  \begin{thermomolesrange}
    = \PartialMixSecond*{\Gt}{P}{T}{\allNs}
  \end{thermomolesrange}
  \begin{thermobraces}
      = -\Partial*{\St}{P}{T,\allNs}
    \begin{thermoNOsubscripts}
      \begin{thermomolesrange}
        = -\Partial{\St}{P}{T,\allNs}
      \end{thermomolesrange}
    \end{thermoNOsubscripts}
  \end{thermobraces}
\end{gather*}
Inline derivatives:
\begin{gather*}
  \mu_i = \Partialinline{\Gt}{\Nt_i}{T,P,\allNsbut{i}}
        = \Partialinline{\Ft}{\Nt_i}{T,\Vt,\allNsbut{i}}
        = \Partialinline{\Ht}{\Nt_i}{\St,P,\allNsbut{i}}
        = \Partialinline{\Ut}{\Nt_i}{\St,\Vt,\allNsbut{i}}
\end{gather*}
The heat capacities:
\begin{gather*}
  \cV = T \Partial*{\Sm}{T}{\Vm,\allXs} = \Partial*{\Um}{T}{\Vm,\allXs}
      = -T\PartialSecond{\Fm}{T}{\Vm,\allXs}
  \\
  \cP^\IGM = T \Partial*{\Sm^\IGM}{T}{P,\allYs}
           = \Partial*{\Hm^\IGM}{T}{P,\allYs}
    \begin{thermobrackets}
      = -T\PartialSecond{\Gm^\IGM}{T}{P,\allYs}
    \end{thermobrackets}
  \\
  \cVt = T \Partial*{\St}{T}{\Vt,\allNs} = \Partial*{\Ut}{T}{\Vt,\allNs}
    \begin{thermobraces}
       = -T\PartialSecond{\Ft}{T}{\Vm,\allNs}
    \end{thermobraces}
  \\
    \begin{thermobar}
  \cPt = T \Partial*{\St}{T}{P,\allNs} = \Partial*{\Ht}{T}{P,\allNs}
       = -T\PartialSecond{\Gt}{T}{P,\allNs}
    \end{thermobar}
  \\
  \cVs = T \Partial*{\Ss}{T}{\Vs,\allWs} = \Partial*{\Us}{T}{\Vs,\allWs}
    \begin{thermoplain}
       = -T\PartialSecond{\Fs}{T}{\Vs,\allWs}
    \end{thermoplain}
  \\
  \cPs = T \Partialbigg*{\Ss}{T}{P,\allWs} = \Partialbigg*{\Hs}{T}{P,\allWs}
       = -T\PartialSecondbigg{\Gs}{T}{P,\allWs}
  \\
\begin{split}
  \cPpm_i &amp;= \Partial*{\cPt}{\Nt_i}{T,P,\allNsbut{i}}
           = T \PartialMixSecond*{\St}{\Nt_i}{T}{P,\allNsbut{i}}
           = T \PartialMixSecond*{\St}{T}{\Nt_i}{P,\allNsbut{i}}
       \\ &amp;= T \Partial*{\Spm_i}{T}{P,\allXs}
           = \Partial*{\Hpm_i}{T}{P,\allXs}
           = \PartialMixSecond*{\Ht}{T}{\Nt_i}{P,\allNsbut{i}}
           = \PartialMixSecond*{\Ht}{\Nt_i}{T}{P,\allNsbut{i}}
       \\ &amp;= -T\PartialSecond*{\Gpm_i}{T}{P,\allXs}
           = -T\Partial{{}^3 \Gt}{T^2\partial \Nt_i}{P,\allNsbut{i}}
\end{split}
\end{gather*}
Other measurable quantities:
\begin{align*}
  \alphaS &amp;= \frac{1}{\Vm} \Partial{\Vm}{T}{\Sm} &amp;
  \alphaP &amp;= \frac{1}{\Vm} \Partial{\Vm}{T}{P} \\
  \kappaS &amp;= -\frac{1}{\Vm} \Partial{\Vm}{P}{\Sm} &amp;
  \kappaT &amp;= -\frac{1}{\Vm} \Partial{\Vm}{P}{T}
\end{align*}
The chemical potential, fugacity, and activity:
\[ \mu_i = \Gpm_i = \Gm_i^\std + RT \ln a_i
         = \Gm_i^\std + RT\ln\left(\frac{\fmix_i}{\fstd_i}\right) \]
Equilibrium in a chemical reaction:
\[ \sumall_i \nu_i \mu_i = 0
    \Rightarrow
    \exp\left(\frac{-\Delta\Gm^\std}{RT}\right) = K = \prodall_i a_i^{\nu_i} \]
Partial molar quantities:
\begin{align*}
  \Hpm{i} &amp;= \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
           = \Hm + \Nt \Partial*{\Hm}{\Nt_i}{T,P,\allNsbut{i}}
       \\ &amp;= \Hm + \Partial*{\Hm}{x_i}{T,P,\allXsbut{i}}
                 - \sumallbutlast_j x_j \Partial*{\Hm}{x_j}{T,P,\allXsbut{j}}
           = \Partial*{\Hm}{x_i}{T,P,\allXsbut{i}} + \Hpm_\ncomponents
\end{align*}
\[ \Vpm_i = \Partial{\Vt}{\Nt_i}{T,P,\allNsbut{i}} \]
Fugacity and related properties:
\begin{gather*}
  \Gpm_i = \mu_i
         = \Gm_i^\std(T) + RT\ln a_i
         = \Gm_i^\std(T) + RT\ln\left(\frac{\fmix_i}{\fstd_i}\right)
  \\
  a_i = \frac{\fmix_i}{\fstd_i}
      = x_i \gamma_i
                \exp\left(\frac{1}{RT} \int_{\Pstd}^P \Vm_i(T,p)\,dp\right)
      \approx x_i \gamma_i
  \\
  \begin{split}
  \fmix_i &amp;= x_i \phimix_i P
           = x_i \gamma_i \fpure_i = x_i \gamma_i \phipure_i P
           = x_i \gammarat_i \Henryrat_i
           = C_i \gammamol_i \Henrymol_i
           = x_i \gamma_i \fsat_i
                 \exp\left(\frac{1}{RT} \int_{\Psat_i}^P \Vm_i(T,p)\,dp\right)
       \\ &amp;= x_i \gamma_i \Psat_i \phisat_i
                \exp\left(\frac{1}{RT} \int_{\Psat_i}^P \Vm_i(T,p)\,dp\right)
          \approx x_i \gamma_i \Psat_i
  \end{split}
\end{gather*}
Chemical Equilibria:
\begin{gather*}
  \Deltarxn\Hm^\std = \sumall_i \nu_i \Deltaf\Hm_i^\std \\
  \Deltarxn\Gm^\std = \sumall_i \nu_i \Deltaf\Gm_i^\std
                    = \sumall_i \nu_i \mu_i^\std \\
  \Deltarxn\cP^\std = \sumall_i \nu_i \cP_i^\std \\
  \mu_i = \mu_i^\std + RT\ln a_i \\
  a_i = \begin{cases}
\displaystyle
     \frac{y_i \phimix_i P}{\Pstd} \approx \frac{y_i P}{\Pstd}
        &amp; \text{(gases)} \\
\rule{0pt}{5ex}%
\displaystyle
     x_i \gamma_i \exp\left(\frac{1}{RT} \int_{\Pstd}^P \Vm_i(T,p)\,dp\right)
     \approx
     x_i \gamma_i \exp\left(\frac{\Vm_i(P-\Pstd)}{RT}\right)
     \approx x_i \gamma_i \approx 1
        &amp; \text{(solids, solvents)} \\
\displaystyle
\rule{0pt}{5ex}%
     \frac{C_i \gammamol_i}{C_i^\std}
        \exp\left(\frac{1}{RT}
        \int_{\Pstd}^P \Vpm_i^\infty(T,p,\allXs)\,dp\right)
     \approx
     \frac{C_i \gammamol_i}{C_i^\std} \approx \frac{C_i}{C_i^\std}
        &amp; \text{(solutes)}
        \end{cases}
\end{gather*}
Phase change properties:
\begin{gather*}
  \Deltafus\Sm = \Sm^L - \Sm^S \\
  \Deltasub\Vm = \Vm^V - \Vm^S \\
  \Deltavap\Gm = \Gm^V - \Gm^L
\end{gather*}
Specific properties:
\newcommand*{\Btilde}[2][]{\widetilde{B}_{#2}^{#1}}
\[ \Btilde{j} \equiv \Partial{\Bt}{m_j}{T,\Vs,\allMsbut[i]{j}} \]
and thus
\[ \Btilde{i}
    = \frac{\Bpm{i}}{M_i}
        + \Biggl(\Vs - \frac{\Vpm_i}{M_i}\Biggr)
          \Partial*{\Bs}{\Vs}{T,\allMs}
    = \frac{\Bpm{i}}{M_i}
        + \Biggl(\Vs - \frac{\Vpm_i}{M_i}\Biggr)
          \Partial{\Bs}{\Vs}{T,m,\allWs} \]
and
\[ \Bs = \sumall_i w_i \Btilde{i}. \]
Excess and Residual (Departure) Properties:
\begin{align*}
  \HR &amp;= \Hm - \Hm^\IG &amp;
  \FR &amp;= \Fm - \Fm^\IGM \\
  \SE &amp;= \Sm - \Sm^\IS &amp;
  \VRpm_k &amp;= \Vpm_k - \Vpm_k^\IGM
\end{align*}
Jacobians:
\begin{gather*}
  \Jacobian{\St,\Vt}{T,P} = \Jacobiandet{\St,\Vt}{T,P} \\
  \Jacobian{f,g,h}{x,y,z} = \Jacobiandet[\displaystyle]{f,g,h}{x,y,z} \\
  \Jacobian{h_1,\dots,h_k}{z_1,\dots,z_k} =
      \Jacobiandet{h_1,\dots,h_k}{z_1,\dots,z_k} \\
  \cP = T\Partial{\Sm}{T}{P}
      = T\Jacobian{\Sm,P}{T,P}
      = -T\Jacobian{\Sm,P}{T,\Vm} \Jacobian{T,\Vm}{T,P}
      = -T\Jacobian{P,\Sm}{\Vm,\Sm} \Jacobian{\Vm,\Sm}{T,\Vm}
          \Jacobian{T,\Vm}{T,P}
      = \gamma \cV
\end{gather*}
\end{document}
%&lt;/example&gt;
% \fi
%
% \Finale
\endinput
</pre></body></html>