Debian Codegraph @

texmf-dist/source/latex/thermodynamics/thermodynamics.dtx

raw
1 % \iffalse meta-comment
2 % File: thermodynamics.dtx Copyright (C) 2022-2026 Karl D. Hammond
3 %
4 % Karl D. Hammond
5 % CTAN and TeX StackExchange user karlh
6 % Contact: kaiserkarl31 at yahoo.com
7 %
8 % This work may be distributed and/or modified under the
9 % conditions of the LaTeX Project Public License, either version 1.3
10 % of this license or (at your option) any later version.
11 % The latest version of this license is in
12 % http://www.latex-project.org/lppl.txt
13 % and version 1.3 or later is part of all distributions of LaTeX
14 % version 2005/12/01 or later.
15 %
16 % This work has the LPPL maintenance status `maintained'.
17 %
18 % The Current Maintainer of this work is K. D. Hammond.
19 %
20 % This work consists of the files thermodynamics.dtx and thermodynamics.ins
21 % and the derived files thermodynamics.sty, thermodynamics.pdf,
22 % thermodynamics-examples.tex, and thermodynamics-examples.pdf.
23 % \fi
24 %
25 % \iffalse
26 %<*driver>
27 \ProvidesFile{thermodynamics.dtx}
28 %</driver>
29 %
30 %<package>\NeedsTeXFormat{LaTeX2e}
31 %<package>\RequirePackage{expl3}
32 %<package>\ProvidesPackage{thermodynamics}
33 %<*package>
34 [2026/03/22 v2.04 thermodynamics notation]
35 %</package>
36 %<*driver>
37 \documentclass[11pt,letterpaper]{ltxdoc}
38 %^^X\bool_set_false:N \l__codedoc_allow_indexing_bool
39 \usepackage[margin=0.80in,left=2.05in]{geometry}
40 \usepackage[T1]{fontenc}
41 \usepackage{textcomp}
42 \usepackage{amsmath}
43 \usepackage{mathrsfs}
44 \usepackage{pxfonts}
45 \usepackage{array}
46 \usepackage{booktabs}
47 \usepackage{footmisc}
48 \usepackage{pdflscape}
49 \usepackage{supertabular}
50 \usepackage{graphicx} %^^A for \reflectbox
51 \usepackage{xcolor}
52 \usepackage[labelfont=bf,labelsep=period,font=small]{caption}
53 \usepackage{emf}
54 \GetFileInfo{thermodynamics.dtx}
55 \usepackage{thermodynamics}[\filedate\space\fileversion]
56 \DeclareMathAlphabet{\mathdutchcal}{U}{dutchcal}{m}{n}
57 \DisableCrossrefs
58 \CodelineIndex
59 \PageIndex
60 \CodelineNumbered
61 \RecordChanges
62 %^^X\OnlyDescription
63 %^^X Preparing to use l3doc.cls, but it's not quite mature yet....
64 %^^A\DisableDocumentation
65 %^^A\DisableImplementation
66 %^^X\ExplSyntaxOff
67 \let\tn\cs
68 \let\env\texttt
69 \let\pkg\textsf
70 \IndexPrologue{\section*{Index}%
71 \markboth{Index}{Index}%
72 Numbers written in italics refer to the page
73 where the corresponding entry is described;
74 numbers underlined refer to the
75 %^^A\ifcodeline@index
76 code line of the
77 %^^A\fi
78 definition.%^^A; numbers in Roman refer to the
79 %^^A\ifcodeline@index
80 %^^A code lines
81 %^^A\else
82 %^^A pages
83 %^^A\fi
84 %^^Awhere the entry is used.
85 }
86 \makeatother
87 \begin{document}
88 \DocInput{thermodynamics.dtx}
89 \end{document}
90 %</driver>
91 % \fi
92 %
93 % \CheckSum{3555}
94 %
95 % \CharacterTable
96 % {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
97 % 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
98 % Digits \0\1\2\3\4\5\6\7\8\9
99 % Exclamation \! Double quote \" Hash (number) \#
100 % Dollar \$ Percent \% Ampersand \&
101 % Acute accent \' Left paren \( Right paren \)
102 % Asterisk \* Plus \+ Comma \,
103 % Minus \- Point \. Solidus \/
104 % Colon \: Semicolon \; Less than \<
105 % Equals \= Greater than \> Question mark \?
106 % Commercial at \@ Left bracket \[ Backslash \\
107 % Right bracket \] Circumflex \^ Underscore \_
108 % Grave accent \` Left brace \{ Vertical bar \|
109 % Right brace \} Tilde \~}
110 %
111 % \changes{v1.00}{2022/04/29}{Initial public release}
112 % \changes{v2.00}{2023/11/16}{Revision to use \LaTeX3
113 % (\pkg{expl3}/\pkg{xparse}) syntax layer.}
114 % \changes{v2.03}{2026/01/06}{Changed contact information; typo fixes}
115 %
116 % \newcommand*{\setmarginparsize}[1]
117 % {\bgroup
118 % \RenewExpandableDocumentCommand{\MacroFont}{}{\fontencoding\encodingdefault
119 % \fontfamily\ttdefault
120 % \fontseries\mddefault
121 % \fontshape\shapedefault
122 % #1}
123 % }
124 % \newcommand*{\restoremarginparsize}{\egroup}
125 %
126 % \GetFileInfo{thermodynamics.dtx}
127 %^^X \title{The \textsf{thermodynamics} package\thanks{This document
128 %^^X corresponds to \textsf{thermodynamics}~\ExplFileVersion,
129 %^^X dated \ExplFileDate.}}
130 % \title{The \textsf{thermodynamics} package\thanks{This document
131 % corresponds to \textsf{thermodynamics}~\fileversion,
132 % dated \filedate.}}
133 % \author{Karl D. Hammond \\ \texttt{[email protected]}}
134 %^^X \date{\ExplFileDate}
135 % \date{\filedate}
136 % \maketitle
137 %
138 % \begin{abstract}
139 % A package, \textsf{thermodynamics}, is defined that makes typesetting
140 % quantities found in thermodynamics texts relatively simple. The commands are
141 % flexible and intended to be relatively intuitive. It handles several sets
142 % of notation for total, specific, and molar quantities; allows changes between
143 % symbols (e.g., $A$ vs.\ $F$ for Helmholtz free energy); and greatly
144 % simplifies the typesetting of symbols and partial derivatives commonly
145 % encountered in mixture thermodynamics. Changes of one's notes from one
146 % textbook to another can be achieved relatively easily by changing package
147 % options.
148 % \end{abstract}
149 %
150 %^^X \begin{documentation}
151 % \section{Introduction}
152 % The purpose of this package is to simplify the typesetting of equations in
153 % thermodynamics, particularly chemical engineering thermodynamics, which are
154 % often cumbersome to enter. For example, consider the following equation:
155 % \begin{equation}
156 % d\Ut = \Partial*{\Ut}{\St}{\Vt,\allNs} \,d\St
157 % + \Partial*{\Ut}{\Vt}{\St,\allNs} \,d\Vt
158 % + \sumall_i \Partial*{\Ut}{\Nt_i}{\St,\Vt,\allNsbut{i}} d\Nt_i.
159 % \label{eq:chain-rule-U}
160 % \end{equation}
161 % This equation is pretty basic, and equations like it occur all the time in
162 % thermodynamics. Without this package, you might typeset it like this:
163 % \begin{verbatim}
164 % \[ d\underline{U} =
165 % \left(\frac{\partial\underline{U}}
166 % {\partial\underline{S}}\right)_{\underline{V},\vec{n}}
167 % d\underline{S}
168 % + \left(\frac{\partial\underline{U}}
169 % {\partial\underline{V}}\right)_{\underline{S},\vec{n}}
170 % d\underline{V}
171 % + \sum_{i=1}^C \left(\frac{\partial\underline{U}}
172 % {\partial n_i}\right)_{\underline{S},\underline{V},n_{j\neq i}}
173 % dn_i. \]
174 %\end{verbatim}
175 % This is a lot of code, and even then the output is slightly clunky:
176 % \[ d\underline{U} =
177 % \left(\frac{\partial\underline{U}}
178 % {\partial\underline{S}}\right)_{\underline{V},\vec{n}}
179 % d\underline{S}
180 % + \left(\frac{\partial\underline{U}}
181 % {\partial\underline{V}}\right)_{\underline{S},\vec{n}}
182 % d\underline{V}
183 % + \sum_{i=1}^C \left(\frac{\partial\underline{U}}
184 % {\partial n_i}\right)_{\underline{S},\underline{V},n_{j\neq i}}
185 % dn_i.
186 % \]
187 % It is also frustratingly difficult to change one's notes or handouts from one
188 % textbook that uses, say, $n_1$ to denote moles of component 1 to another
189 % textbook that uses $N_1$ for the same quantity, or perhaps denotes the
190 % total internal energy as $U$ or $U^t$ rather than $\Ut$.
191 % For example, if you wanted it to be
192 % \[\begin{thermomolesrange}
193 % \begin{thermoextensiveplain}
194 % \RenewExpandableDocumentCommand{\Nt}{}{N}
195 % \RenewExpandableDocumentCommand{\ncomponents}{}{\mathcal{C}}
196 % d\Ut = \Partial*{\Ut}{\St}{\Vt,\allNs} \,d\St
197 % + \Partial*{\Ut}{\Vt}{\St,\allNs} \,d\Vt
198 % + \sumall_i \Partial*{\Ut}{\Nt_i}{\St,\Vt,\allNsbut{i}} d\Nt_i.
199 % \end{thermoextensiveplain}
200 % \end{thermomolesrange}
201 % \]
202 % without changing any of your code---to update it across all handouts, exams,
203 % and homework sets after changing textbooks, say---you would be out of luck
204 % (or in for a lot of work).
205 %
206 % With this package, you could reduce the code to typeset this equation to
207 % \begin{verbatim}
208 % \begin{equation}
209 % d\Ut = \Partial*{\Ut}{\St}{\Vt,\allNs} d\St
210 % + \Partial*{\Ut}{\Vt}{\St,\allNs} d\Vt
211 % + \sumall_i \Partial*{\Ut}{\Nt_i}{\St,\Vt,\allNsbut{i}} d\Nt_i
212 % \end{equation}
213 %\end{verbatim}
214 % and it will render similarly to Equation~\eqref{eq:chain-rule-U}, including
215 % the shortened underscores and negative kerning.
216 % If you later decide to change the notation such that extensive properties are
217 % not underlined, you can do that without changing any of your code (just
218 % change a package option). Similarly, if you want $\vec{n}$ replaced by
219 % $n_1,\dots,n_C$, you can do that with a package option, too.
220 %
221 % The package handles second derivatives, too. For example,
222 % \begin{verbatim}
223 % \[ \Partial*{\Hm}{T}{P} = T\Partial*{\Sm}{T}{P}
224 % = -T\PartialSecond*{\Gm}{T}{P} = \cP \]
225 %\end{verbatim}
226 % renders (using the default options)
227 % \[ \Partial*{\Hm}{T}{P} = T\Partial*{\Sm}{T}{P}
228 % = -T\PartialSecond*{\Gm}{T}{P} = \cP. \]
229 % Similarly, macros are defined for mixed second partial derivatives that allow
230 % things like
231 % \begin{verbatim}
232 % \[ \Partial*{\Gpm_i}{P}{T,\allNs}
233 % = \PartialMixSecond*{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
234 % = \PartialMixSecond*{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
235 % = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}} = \Vpm_i \],
236 %\end{verbatim}
237 % which renders
238 % \[ \Partial*{\Gpm_i}{P}{T,\allNs}
239 % = \PartialMixSecond*{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
240 % = \PartialMixSecond*{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
241 % = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}} = \Vpm_i
242 % \]
243 % using the defaults.
244 %
245 %^^A-------------------------------------------------------------------------
246 %
247 % \section{Using the Package} \label{sec:using}
248 % There are three categories of macros defined in this package: macros
249 % that produce symbols (or groups of them), macros that typeset derivatives,
250 % and macros that are used internally that the user need not know about.
251 % There are also several environments that allow the user to change notation
252 % temporarily.
253 %
254 % \subsection{Predefined Symbols}
255 % The macros used to produce symbols fall into five categories: extensive
256 % properties, molar properties, specific properties (i.e., per unit mass),
257 % partial molar properties, and shortcut macros (e.g., macros for the heat
258 % capacities, saturation pressure, and so forth). The macros corresponding to
259 % extensive, molar, and specific properties are shown in
260 % Table~\ref{table:symbols}. Examples using the enthalpy are
261 % \DescribeMacro{\Ht}
262 % \DescribeMacro{\Hm}
263 % \DescribeMacro{\Hs}
264 % \DescribeMacro{\Hpm}
265 % \begin{verbatim}
266 % \[ \Ht \quad \Hm \quad \Hs \quad \Hpm_i. \]
267 %\end{verbatim}
268 % Using the default package options, the above renders as
269 % \[ \Ht \quad \Hm \quad \hat H \quad \Hpm{i}. \]
270 % In addition, the properties in
271 % Table~\ref{table:conveniences} are defined for convenience. A more
272 % comprehensive list, including how those properties are represented in the
273 % various textbook-related options supported by this package, are shown in
274 % Appendix~\ref{sec:symbols}.
275 %
276 % \DescribeMacro{\Ut}
277 % \DescribeMacro{\Um}
278 % How these symbols are rendered can be customized by package options. As long
279 % as the user consistently uses \cs{Ut} to render the total internal energy,
280 % \cs{Um} to render the molar internal energy, and so forth, switching notation
281 % from, say, $\Ut$ to $U^t$ for extensive properties is trivial.
282 %
283 % \DescribeMacro{\cP}
284 % \DescribeMacro{\cV}
285 % \DescribeMacro{\cPt}
286 % \DescribeMacro{\cVt}
287 % \DescribeMacro{\cPs}
288 % \DescribeMacro{\cVs}
289 % \DescribeMacro{\cPpm}
290 % \DescribeMacro{\cVpm}
291 % The heat capacities (see Table~\ref{table:conveniences}) are generally
292 % assumed to be molar (e.g., \cs{cP} is interpreted to be the molar heat
293 % capacity). To get the specific heat capacities, the macros \cs{cPs} and
294 % \cs{cVs} are provided, which by default render as $\cPs$ and $\cVs$,
295 % respectively. There are also extensive versions, so \cs{cPt} and \cs{cVt}
296 % will render as $\cPt$ and $\cVt,$
297 % respectively. Note that \cs{cP} and friends require you to surround
298 % \cs{text} with brackets. For example, \verb"\cP_i^\text{A}" will not work,
299 % nor will \verb"\cP^\text{A}_i"; you need to use \verb"\cP_i^{\text{A}}" and
300 % \verb"\cP^{\text{A}}_i". Using \verb"\cP^\IG_i" will work as expected.
301 %
302 % You can also get partial molar heat capacities via \cs{cPpm} and \cs{cVpm},
303 % though the latter's mathematical definition is a bit hard to wrap one's head
304 % around:
305 % \begin{verbatim}
306 % \[ \cVpm_i = \Partial*{\cVt}{\Nt_i}{T,P,\allNsbut{i}}
307 % = \frac{\partial}{\partial\Nt_i}
308 % \left[ -T\PartialSecond{\Ft}{T}{\Vt,\allNs}
309 % \right]_{T,P,\allNsbut{i}} \]
310 %\end{verbatim}
311 % yields
312 % \[ \cVpm{i} = \Partial*{\cVt}{\Nt_i}{T,P,\allNsbut{i}}
313 % = \frac{\partial}{\partial\Nt_i}
314 % \left[ -T\PartialSecond{\Ft}{T}{\Vt,\allNs}
315 % \right]_{T,P,\allNsbut{i}}. \]
316 %
317 % \begin{table}
318 % \caption{Commands defined in this package to represent extensive
319 % thermodynamic quantities and their molar and specific analogs.
320 % These macros should be used even if the symbol the user
321 % wishes to use does not match the command used (e.g., \cs{Ft}
322 % for total Helmholtz free energy even if it ends up being set as
323 % $\Ft$)\@.
324 % }
325 % \label{table:symbols}
326 %^^A TODO The \leavevmode macro here is to prevent white space from building
327 %^^A up due to a bug in old versions of hypdoc. It should be harmless to
328 %^^A leave it in there, but consider removing it at some point.
329 % \leavevmode
330 % \SpecialMacroIndex{\Qt}\relax
331 % \SpecialMacroIndex{\Qm}\relax
332 % \SpecialMacroIndex{\Qs}\relax
333 % \SpecialMacroIndex{\Wt}\relax
334 % \SpecialMacroIndex{\Wm}\relax
335 % \SpecialMacroIndex{\Ws}\relax
336 % \SpecialMacroIndex{\Et}\relax
337 % \SpecialMacroIndex{\Em}\relax
338 % \SpecialMacroIndex{\Es}\relax
339 % \SpecialMacroIndex{\Epm}\relax
340 % \SpecialMacroIndex{\EEt}\relax
341 % \SpecialMacroIndex{\EE}\relax
342 % \SpecialMacroIndex{\EEs}\relax
343 % \SpecialMacroIndex{\EEpm}\relax
344 % \SpecialMacroIndex{\ERt}\relax
345 % \SpecialMacroIndex{\ER}\relax
346 % \SpecialMacroIndex{\ERs}\relax
347 % \SpecialMacroIndex{\ERpm}\relax
348 % \SpecialMacroIndex{\Ut}\relax
349 % \SpecialMacroIndex{\Um}\relax
350 % \SpecialMacroIndex{\Us}\relax
351 % \SpecialMacroIndex{\Upm}\relax
352 % \SpecialMacroIndex{\UEt}\relax
353 % \SpecialMacroIndex{\UE}\relax
354 % \SpecialMacroIndex{\UEs}\relax
355 % \SpecialMacroIndex{\UEpm}\relax
356 % \SpecialMacroIndex{\URt}\relax
357 % \SpecialMacroIndex{\UR}\relax
358 % \SpecialMacroIndex{\URs}\relax
359 % \SpecialMacroIndex{\URpm}\relax
360 % \SpecialMacroIndex{\Ht}\relax
361 % \SpecialMacroIndex{\Hm}\relax
362 % \SpecialMacroIndex{\Hs}\relax
363 % \SpecialMacroIndex{\Hpm}\relax
364 % \SpecialMacroIndex{\HEt}\relax
365 % \SpecialMacroIndex{\HE}\relax
366 % \SpecialMacroIndex{\HEs}\relax
367 % \SpecialMacroIndex{\HEpm}\relax
368 % \SpecialMacroIndex{\HRt}\relax
369 % \SpecialMacroIndex{\HR}\relax
370 % \SpecialMacroIndex{\HRs}\relax
371 % \SpecialMacroIndex{\HRpm}\relax
372 % \SpecialMacroIndex{\St}\relax
373 % \SpecialMacroIndex{\Sm}\relax
374 % \SpecialMacroIndex{\Ss}\relax
375 % \SpecialMacroIndex{\Spm}\relax
376 % \SpecialMacroIndex{\SEt}\relax
377 % \SpecialMacroIndex{\SE}\relax
378 % \SpecialMacroIndex{\SEs}\relax
379 % \SpecialMacroIndex{\SEpm}\relax
380 % \SpecialMacroIndex{\SRt}\relax
381 % \SpecialMacroIndex{\SR}\relax
382 % \SpecialMacroIndex{\SRs}\relax
383 % \SpecialMacroIndex{\SRpm}\relax
384 % \SpecialMacroIndex{\Ft}\relax
385 % \SpecialMacroIndex{\Fm}\relax
386 % \SpecialMacroIndex{\Fs}\relax
387 % \SpecialMacroIndex{\Fpm}\relax
388 % \SpecialMacroIndex{\FEt}\relax
389 % \SpecialMacroIndex{\FE}\relax
390 % \SpecialMacroIndex{\FEs}\relax
391 % \SpecialMacroIndex{\FEpm}\relax
392 % \SpecialMacroIndex{\FRt}\relax
393 % \SpecialMacroIndex{\FR}\relax
394 % \SpecialMacroIndex{\FRs}\relax
395 % \SpecialMacroIndex{\FRpm}\relax
396 % \SpecialMacroIndex{\Gt}\relax
397 % \SpecialMacroIndex{\Gm}\relax
398 % \SpecialMacroIndex{\Gs}\relax
399 % \SpecialMacroIndex{\Gpm}\relax
400 % \SpecialMacroIndex{\GEt}\relax
401 % \SpecialMacroIndex{\GE}\relax
402 % \SpecialMacroIndex{\GEs}\relax
403 % \SpecialMacroIndex{\GEpm}\relax
404 % \SpecialMacroIndex{\GRt}\relax
405 % \SpecialMacroIndex{\GR}\relax
406 % \SpecialMacroIndex{\GRs}\relax
407 % \SpecialMacroIndex{\GRpm}\relax
408 % \SpecialMacroIndex{\At}\relax
409 % \SpecialMacroIndex{\Am}\relax
410 % \SpecialMacroIndex{\As}\relax
411 % \SpecialMacroIndex{\Apm}\relax
412 % \SpecialMacroIndex{\Nt}\relax
413 % \SpecialMacroIndex{\Lt}\relax
414 % \SpecialMacroIndex{\Lm}\relax
415 % \SpecialMacroIndex{\Ls}\relax
416 % \SpecialMacroIndex{\Lpm}\relax
417 % \SpecialMacroIndex{\LEt}\relax
418 % \SpecialMacroIndex{\LE}\relax
419 % \SpecialMacroIndex{\LEs}\relax
420 % \SpecialMacroIndex{\LEpm}\relax
421 % \SpecialMacroIndex{\LRt}\relax
422 % \SpecialMacroIndex{\LR}\relax
423 % \SpecialMacroIndex{\LRs}\relax
424 % \SpecialMacroIndex{\LRpm}\relax
425 % \centering
426 % \begin{minipage}{\linewidth}\renewcommand*{\footnoterule}{\vskip-1.75ex}%
427 % \centering\scriptsize\setlength{\tabcolsep}{0.05in}
428 % \begin{tabular}{l l l l l l l l l l l l l}
429 % \toprule
430 % & & & & & \multicolumn{4}{c}{Excess}
431 % & \multicolumn{4}{c}{Residual (Departure)} \\
432 % \cmidrule(r{0.5ex}){6-9}
433 % \cmidrule(l{0.5ex}){10-13}
434 % Property & Total & Molar & Specific & \parbox[b]{0.45in}{Partial Molar}
435 % & T & M & S & PM & T & M & S & PM \\
436 % \midrule
437 % Heat & \cs{Qt} & \cs{Qm} & \cs{Qs} & \\
438 % Work & \cs{Wt} & \cs{Wm} & \cs{Ws} & \\
439 % Total energy & \cs{Et} & \cs{Em} & \cs{Es} & \cs{Epm}
440 % & \cs{EEt} & \cs{EE} & \cs{EEs} & \cs{EEpm}
441 % & \cs{ERt} & \cs{ER} & \cs{ERs} & \cs{ERpm} \\
442 % Internal energy & \cs{Ut} & \cs{Um} & \cs{Us} & \cs{Upm}
443 % & \cs{UEt} & \cs{UE} & \cs{UEs} & \cs{UEpm}
444 % & \cs{URt} & \cs{UR} & \cs{URs} & \cs{URpm} \\
445 % Enthalpy & \cs{Ht} & \cs{Hm} & \cs{Hs} & \cs{Hpm}
446 % & \cs{HEt} & \cs{HE} & \cs{HEs} & \cs{HEpm}
447 % & \cs{HRt} & \cs{HR} & \cs{HRs} & \cs{HRpm} \\
448 % Entropy & \cs{St} & \cs{Sm} & \cs{Ss} & \cs{Spm}
449 % & \cs{SEt} & \cs{SE} & \cs{SEs} & \cs{SEpm}
450 % & \cs{SRt} & \cs{SR} & \cs{SRs} & \cs{SRpm} \\
451 % Volume & \cs{Vt} & \cs{Vm} & \cs{Vs} & \cs{Vpm}
452 % & \cs{VEt} & \cs{VE} & \cs{VEs} & \cs{VEpm}
453 % & \cs{VRt} & \cs{VR} & \cs{VRs} & \cs{VRpm} \\
454 % Helmholtz free energy & \cs{Ft} & \cs{Fm} & \cs{Fs} & \cs{Fpm}
455 % & \cs{FEt} & \cs{FE} & \cs{FEs} & \cs{FEpm}
456 % & \cs{FRt} & \cs{FR} & \cs{FRs} & \cs{FRpm} \\
457 % Gibbs free energy & \cs{Gt} & \cs{Gm} & \cs{Gs} & \cs{Gpm}
458 % & \cs{GEt} & \cs{GE} & \cs{GEs} & \cs{GEpm}
459 % & \cs{GRt} & \cs{GR} & \cs{GRs} & \cs{GRpm} \\
460 % Surface area & \cs{At} & \cs{Am} & \cs{As} & \cs{Apm} \\
461 % Grand potential\footnote{The grand potential,
462 % $\begin{thermomolesrange}\Lt(T,\Vt,\allmus)\end{thermomolesrange}
463 % = \Ut - T\St - \sumall_i \mu_i \Nt_i,$
464 % is also called the Landau free energy by some authors.}
465 % & \cs{Lt} & \cs{Lm} & \cs{Ls} & \cs{Lpm}
466 % & \cs{LEt} & \cs{LE} & \cs{LEs} & \cs{LEpm}
467 % & \cs{LRt} & \cs{LR} & \cs{LRs} & \cs{LRpm} \\
468 % Moles & \cs{Nt} & \\
469 % \bottomrule
470 % \end{tabular}
471 % \end{minipage}
472 % \end{table}
473 %
474 % \begin{table}
475 % \caption{Convenience macros and their default symbols.
476 % These are generally ``smart'': for example,
477 % \texttt{\textbackslash cP\_i} renders as $C_{P,i}$, as expected, and
478 % \texttt{\textbackslash cP\_i\^{}\textbackslash std} renders as
479 % $C_{P,i}^\circ$, also as expected. You can also reverse it:
480 % \texttt{\textbackslash cP\^{}\textbackslash std\_i} becomes
481 % $C^\circ_{P,i}$.}\relax
482 % \label{table:conveniences}\relax
483 %^^A TODO The \leavevmode macro here is to prevent white space from building
484 %^^A up due to a bug in old versions of hypdoc. It should be harmless to
485 %^^A leave it in there, but consider removing it at some point.
486 % \leavevmode
487 % \SpecialMacroIndex{\cP}\relax
488 % \SpecialMacroIndex{\cV}\relax
489 % \SpecialMacroIndex{\kappaT}\relax
490 % \SpecialMacroIndex{\kappaS}\relax
491 % \SpecialMacroIndex{\alphaP}\relax
492 % \SpecialMacroIndex{\alphaS}\relax
493 % \SpecialMacroIndex{\muJT}\relax
494 % \SpecialMacroIndex{\heatcapacitysymbol}\relax
495 % \SpecialMacroIndex{\compressibilitysymbol}\relax
496 % \SpecialMacroIndex{\expansivitysymbol}\relax
497 % \SpecialMacroIndex{\fpure}\relax
498 % \SpecialMacroIndex{\fmix}\relax
499 % \SpecialMacroIndex{\fsat}\relax
500 % \SpecialMacroIndex{\phipure}\relax
501 % \SpecialMacroIndex{\phimix}\relax
502 % \SpecialMacroIndex{\phisat}\relax
503 % \SpecialMacroIndex{\actrel}\relax
504 % \SpecialMacroIndex{\Psat}\relax
505 % \SpecialMacroIndex{\Pvap}\relax
506 % \SpecialMacroIndex{\sat}\relax
507 % \SpecialMacroIndex{\std}\relax
508 % \SpecialMacroIndex{\Pstd}\relax
509 % \SpecialMacroIndex{\Cstd}\relax
510 % \SpecialMacroIndex{\fstd}\relax
511 % \SpecialMacroIndex{\mustd}\relax
512 % \SpecialMacroIndex{\Henryrat}\relax
513 % \SpecialMacroIndex{\Henrymol}\relax
514 % \SpecialMacroIndex{\gammarat}\relax
515 % \SpecialMacroIndex{\gammamol}\relax
516 % \SpecialMacroIndex{\Deltamix}\relax
517 % \SpecialMacroIndex{\Deltarxn}\relax
518 % \SpecialMacroIndex{\Deltavap}\relax
519 % \SpecialMacroIndex{\Deltasub}\relax
520 % \SpecialMacroIndex{\Deltafus}\relax
521 % \SpecialMacroIndex{\mixing}\relax
522 % \SpecialMacroIndex{\reaction}\relax
523 % \SpecialMacroIndex{\fusion}\relax
524 % \SpecialMacroIndex{\vaporization}\relax
525 % \SpecialMacroIndex{\sublimation}\relax
526 % \SpecialMacroIndex{\Epot}\relax
527 % \SpecialMacroIndex{\xrxn}\relax
528 % \begin{minipage}{\linewidth}\relax
529 % \footnotesize
530 % \addtolength{\tabcolsep}{-2.75pt}\relax
531 % \addtolength{\extrarowheight}{0.50ex}\relax
532 % \renewcommand*{\footnoterule}{\vskip-1.5ex}\relax
533 % \begin{tabular}{l l l l l}
534 % \toprule
535 % \\[-1.5\normalbaselineskip]
536 % Name & Macro & Sym. & Definition & Base Symbol Macro \\
537 % \midrule
538 % Isobaric heat capacity & \cmd\cP\footnote{\relax
539 % Extensive and specific (per-unit-mass) versions are available
540 % as \cs{cPt} and \cmd\cPs, respectively, with similar macros for the
541 % isochoric heat capacity.\label{fn:cP}}
542 % & \(\cP\) & \(\displaystyle T\Partial{\Sm}{T}{P}\)
543 % & \cmd\heatcapacitysymbol \\[1.75ex]
544 % Isochoric heat capacity & \verb"\cV"\footref{fn:cP} & \(\cV\)
545 % & \(\displaystyle T\Partial{\Sm}{T}{\Vm}\)
546 % & \cmd\heatcapacitysymbol \\[1.75ex]
547 % Isothermal compressibility & \cmd\kappaT & $\kappaT$
548 % & \(\displaystyle -\frac{1}{\Vm} \Partial{\Vm}{P}{T} \)
549 % & {\footnotesize\cmd\compressibilitysymbol} \\[1.75ex]
550 % Isentropic compressibility & \cmd\kappaS & $\kappaS$
551 % & \(\displaystyle -\frac{1}{\Vm} \Partial{\Vm}{P}{\Sm}\)
552 % & {\footnotesize\cmd\compressibilitysymbol} \\[1.75ex]
553 % Isobaric expansivity & \cmd\alphaP & $\alphaP$
554 % & \(\displaystyle \frac{1}{\Vm} \Partial{\Vm}{T}{P}\)
555 % & \cmd\expansivitysymbol \\[1.75ex]
556 % Isentropic expansivity & \cmd\alphaS & $\alphaS$
557 % & \(\displaystyle \frac{1}{\Vm} \Partial{\Vm}{T}{\Sm}\)
558 % & \cmd\expansivitysymbol \\[1.75ex]
559 % Joule--Thomson coeff. & \cmd\muJT & $\muJT$
560 % & \(\displaystyle \Partial{T}{P}{\Hm}\) & \cmd\JTsymbol \\
561 % Pure fugacity & \cmd\fpure & $f$ & $\phi P$ \\
562 % Saturation fugacity & \cmd\fsat & $\fsat$
563 % & $\phisat \Psat$ & \cmd\sat \\
564 % Mixture fugacity & \cmd\fmix & $\fmix$
565 % & $\fmix_i = x_i\phimix_i P$ \\
566 % Pure fugacity coefficient & \cmd\phipure & $\phipure$ &
567 % \multicolumn{2}{l}{\( \phipure_i
568 % = \exp\left(\frac{1}{RT}\int_0^P \Vm_i(T,p)
569 % - \frac{RT}{p}\,dp\right) \)} \\
570 % Saturation fugacity coeff.\ & \cmd\phisat & $\phisat$
571 % & $\phipure(T,\Psat)$ & \cmd\sat \\
572 % Mixture fugacity coeff.\ & \cmd\phimix & $\phimix$
573 % & \multicolumn{2}{l}{\( \phimix_i
574 % = \exp\left(\frac{1}{RT}\int_0^P \Vpm{i}(T,p,\allXs)
575 % - \frac{RT}{p}\,dp\right) \)} \\[1.25ex]
576 % Absolute activity & \cmd\actabs & $\actabs$
577 % & \multicolumn{2}{l}{\(\actabs_i = \exp(\mu_i/{RT})\)} \\
578 % Relative activity & \cmd\actrel & $\actrel$
579 % & \multicolumn{2}{l}{\(\actrel_i = \exp\left(\frac{\mu_i - \mu_i^\std}{RT}\right) = \frac{\fmix_i(T,P,\allXs)}{\fstd_i(T)}\)} \\
580 % Henry's constant (rational) & \cmd\Henryrat & $\Henryrat$
581 % & $\gamma_i^\infty f_i$ \\
582 % Henry's constant (molal) & \cmd\Henrymol & $\Henrymol$
583 % & $M_s \gamma_i^\infty f_i$ \\
584 % Rational activity coeff.\ & \cmd\gammarat & $\gammarat$
585 % & $\gamma/\gamma^\infty$ \\
586 % Molal activity coeff.\ & \cmd\gammamol & $\gammamol$
587 % & $x_s \gamma/\gamma^\infty$ \\
588 % Saturation pressure & \cmd\Psat\footnote{\cs{Pvap} is a synonym for
589 % \cs{Psat}; if you want it to produce $P^\text{vap}$, you should
590 % redefine the \cs{sat} macro} & $\Psat$ && \cmd\sat \\
591 % Standard state & \cmd\std\footnote{Typical usage:
592 % \texttt{\$\cs{Deltarxn}\cs{Gm}\textasciicircum\cs{std}
593 % = \cs{sumall}\_i\cs{Deltaf}\cs{Gm}\textasciicircum\cs{std}\_i}
594 % yielding $\Deltarxn\Gm^\std = \sumall_i\Deltaf\Gm^\std_i$} \\
595 % Standard pressure & \cmd\Pstd & $\Pstd$ & & \cs{std} \\
596 % Standard molality & \cmd\Cstd & $\Cstd$ & & \cs{std} \\
597 % Standard fugacity & \cmd\fstd & $\fstd$
598 % & $\fstd_i = \fpure_i(T,\Pstd,x^\std)$ & \cs{std} \\
599 % Standard chemical potential & \cmd\mustd & $\mustd$
600 % & $\mustd_i = \mu(T,\Pstd,x^\std)$ & \cs{std} \\
601 % Change on mixing & \cmd\Deltamix\footnote{The usual usage would be
602 % something like
603 % \texttt{\$\cs{Deltamix}\cs{Vm}\textasciicircum\cs{IGM} = 0\$}.\relax
604 % \label{fn:Deltausage}}
605 % & $\Delta M$\textsubscript{mix}
606 % & $M - \sumall_i x_i M_i$ & \cmd\mixing \\
607 % Change on reaction & \cmd\Deltarxn\footref{fn:Deltausage}
608 % & $\Deltarxn M$
609 % & $\sumall_i \nu_i M_i$ & \cmd\reaction \\
610 % Change on melting & \cmd\Deltafus\footref{fn:Deltausage}
611 % & $\Deltafus M$ & $M^L - M^S$ & \cmd\fusion \\
612 % Change on boiling & \cmd\Deltavap\footref{fn:Deltausage}
613 % & $\Deltavap M$ & $M^V - M^L$ & \cmd\vaporization \\
614 % Change on subliming & \cmd\Deltasub\footref{fn:Deltausage}
615 % & $\Deltasub M$ & $M^V - M^S$ & \cmd\sublimation \\
616 % Electric potential & \cmd\Epot & $\Epot$
617 % & $-n_e\mathscr{F}\Deltarxn\Gm$ \\
618 % Extent of reaction & \cmd\xrxn & $\xrxn$ & & \\
619 % \bottomrule
620 % \end{tabular}
621 % \end{minipage}
622 % \end{table}
623 %
624 % \subsection{Partial Molar Properties}
625 % \DescribeMacro{\Upm}
626 % \DescribeMacro{\Vpm}
627 % Partial molar quantities are defined with the suffix \verb"pm".
628 % For example, \cs{Upm} refers to the partial molar internal energy. There
629 % are two options for how to enter partial molar quantities: as commands or
630 % as super/subscripts. For example,
631 % \begin{verbatim}
632 % \[ \Upm{i} \quad \Upm[\IG]{i} \quad \Vpm_i \quad \Vpm^\IG_i \]
633 %\end{verbatim}
634 % will typeset as
635 % \[ \Upm{i} \quad \Upm[\text{IG}]{i} \quad \Vpm{i} \quad \Vpm^{\text{IG}}_i.\]
636 % There are also partial molar heat capacities available via the macros
637 % \cs{cPpm} and \cs{cVpm}.
638 % \textbf{Important}: The \tn{text} command defined by the \pkg{amstext}
639 % package is usually robust enough that something like \verb"\Um^\text{L}" will
640 % work as expected, without additional braces. This does \emph{not} work for
641 % partial molar properties; for example, \verb"\Hpm^\text{L}_i" will produce an
642 % error, as will \verb"\Hpm_i^\text{L}". The expression
643 % \verb"\Hpm_i^{\text{L}}" will work as expected.
644 %
645 % \DescribeMacro{\partialmolar}
646 % New partial molar properties can be defined for any ``simple'' symbol using
647 % the \cs{partialmolar} macro. ``Simple'' means it has no subscripts or
648 % superscripts. For example, the macro for the partial molar Gibbs free energy
649 % is effectively defined via the macro
650 % \DescribeMacro{\Gpm}
651 % \begin{verbatim}
652 % \NewDocumentCommand{\Gpm}{}{\partialmolar{G}}.
653 %\end{verbatim}
654 % A list of pre-defined macros for total, molar, specific, and partial molar
655 % quantities commonly used in thermodynamics is included in
656 % Table~\ref{table:symbols}.
657 %
658 % \subsection{Defining New Properties}
659 % \DescribeMacro{\NewExtensiveProperty}
660 % Users can create new properties using a family of commands. Typically, a
661 % user would want to define at least the total, molar, and specific properties,
662 % which can be accomplished by the \cs{NewExtensiveProperty} command.
663 % For example,
664 % \begin{verbatim}
665 % \NewExtensiveProperty{J}{K}
666 %\end{verbatim}
667 % \NewExtensiveProperty{J}{K}\relax
668 % would define the commands \cs{Jt}, \cs{Jm}, and \cs{Js}, which would produce
669 % (using the default package options) the symbols $\Jt$, $K$, and $\hat{K}$,
670 % respectively.
671 %
672 % \DescribeMacro{\NewPartialMolarProperty}%
673 % Partial molar properties can be created either with the \cs{partialmolar}
674 % macro directly as described above or with \cs{NewPartialMolarProperty}, which
675 % has the same argument style as \cs{NewExtensiveProperty}.
676 %
677 % \DescribeMacro{\NewExcessProperty}%
678 % \DescribeMacro{\NewResidualProperty}%
679 % Similarly, one can define commands for the total, molar, and specific excess
680 % properties using \cs{NewExcessProperty} in a similar manner, and similar
681 % commands for the residual properties with \cs{NewResidualProperty}.
682 %
683 % \setmarginparsize{\footnotesize}
684 % \DescribeMacro{\NewThermodynamicProperty}\relax
685 % \restoremarginparsize
686 % \NewThermodynamicProperty{B}{B}\relax
687 % \NewExtensiveProperty{M}{M}\relax
688 % It is common that a user wants the total, molar, specific, and partial molar
689 % commands for a new symbol, as well as excess and residual (departure)
690 % properties for each case. Users can define such properties---common examples
691 % are $\Bt$ and $\Mt$ to represent uncommon or arbitrary properties---by using
692 % \cs{NewThermodynamicProperty}, which calls all four of the aforementioned
693 % declarations on the same command/\allowbreak{}symbol combinations. For
694 % example,
695 % \begin{verbatim}
696 % \NewThermodynamicProperty{B}{B}
697 %\end{verbatim}
698 % defines the commands \cs{Bt}, \cs{Bm}, \cs{Bs}, and \cs{Bpm}, which define
699 % the total, molar, specific, and partial molar properties, respectively.
700 % It also defines \cs{BEt}, \cs{BE}, \cs{BEs}, and \cs{BEpm} for the
701 % corresponding excess properties, and \cs{BRt}, \cs{BR}, \cs{BRs}, and
702 % \cs{BRpm} for residual (departure) properties. These produce, respectively,
703 % $\Bt, \Bm, \Bs, \Bpm{i}, \BEt, \BE, \BEs, \BEpm{i}, \BRt, \BR, \BRs,$ and
704 % $\BRpm{i}$ using the defaults.
705 %
706 % \subsection{Other Predefined Symbols and Modifiers}
707 % There are a number of predefined symbols and modifiers.
708 % While these symbols could be defined or used without these macros, such use
709 % is not recommended: changing package options will result in inconsistencies
710 % if these macros are not used.
711 %
712 % \subsubsection{Heat Capacities, Compressibilities, and Expansivities}
713 % \DescribeMacro{\cP}
714 % \DescribeMacro{\cV}
715 % \DescribeMacro{\kappaS}
716 % \DescribeMacro{\kappaT}
717 % \DescribeMacro{\alphaP}
718 % \DescribeMacro{\alphaS}
719 % The isobaric and isochoric heat capacities are produced with \cs{cP} and
720 % \cs{cV}, respectively. Four other measurable quantities are defined: the
721 % isothermal and isentropic compressibilities, \cs{kappaT} and \cs{kappaS},
722 % respectively; and the isobaric and isentropic volume expansivities,
723 % \cs{alphaP} and \cs{alphaS}, respectively. Some textbooks use $\beta$ instead
724 % of $\alpha$ for the volume expansivity to differentiate it from the
725 % \emph{linear} expansivity; this can be changed by redefining
726 % \cs{expansivitysymbol}, which is done automatically by some of the
727 % package options that create notation specific to a particular textbook.
728 %
729 % \subsubsection{Joule--Thomson Coefficient}
730 % \changes{v2.00}{2023/11/16}{Added \cs{muJT} to represent Joule--Thomson
731 % coefficients (which have different notation across textbooks).}
732 % \DescribeMacro{\muJT}
733 % The Joule--Thomson coefficient is produced with \cs{muJT}, which by default
734 % is rendered $\muJT$. Some books call this coefficient $\alpha_H$; this is
735 % handled automatically for books of which the package author is aware.
736 %
737 % \subsubsection{Chemical Potentials}
738 % \DescribeMacro{\mu}
739 % \DescribeMacro{\muit}
740 % The chemical potential is always produced by the macro \cs{mu}. Some
741 % textbook-related options use \(\muup\) instead of \(\mu\) for chemical
742 % potential; if so, the macro \cs{muit} will always produce \(\muit\).
743 %
744 % \subsubsection{Fugacities and Fugacity Coefficients}
745 % \DescribeMacro{\fpure}
746 % \DescribeMacro{\fmix}
747 % \DescribeMacro{\phipure}
748 % \DescribeMacro{\phimix}
749 % Different textbooks use different variations on the symbol $f$ for
750 % fugacity, so it is recommended to use the macro \cs{fpure} to denote the
751 % pure-component fugacity and \cs{fmix} to denote the mixture fugacity.
752 % Similarly, the pure-component fugacity coefficient should be generated with
753 % \cs{phipure}, and that in a mixture should be \cs{phimix}.
754 %
755 % For example, the following markup is an example of a common equation in
756 % mixture thermodynamics:
757 % \begin{verbatim}
758 % \[ \fmix_j = x_j \phimix_j P = x_j \gamma_j \fpure_j
759 % = x_j \gamma_j \phipure_j P. \]
760 %\end{verbatim}
761 % With the default package options, this produces
762 % \[ \fmix_j = x_j \phimix_j P = x_j \gamma_j \fpure_j
763 % = x_j \gamma_j \phipure_j P. \]
764 % With the |Thompson| package option, however, the same markup produces
765 % \[ \hat f_j = x_j \hat\phi_j P = x_j \gamma_j f^\bullet_j
766 % = x_j \gamma_j \phi^\bullet_j P. \]
767 % Similarly, the |Prausnitz| package option causes it to generate
768 % \[ f_j = x_j \phi_j P = x_j \gamma_j f_{\text{pure},j}
769 % = x_j \gamma_j \phi_{\text{pure},j} P, \]
770 % and the |Sandler| option causes it to generate
771 % \[ \bar f_j = x_j \bar \phi_j P = x_j \gamma_j f_j
772 % = x_j \gamma_j \phi_j P. \]
773 %
774 % \subsubsection{Activity Coefficients and Henry's Constants}
775 % \DescribeMacro{\gamma}
776 % \DescribeMacro{\gammait}
777 % \DescribeMacro{\gammarat}
778 % \DescribeMacro{\gammamol}
779 % \DescribeMacro{\Henryrat}
780 % \DescribeMacro{\Henrymol}
781 % The activity coefficient based on the Lewis--Randall rule can be generated
782 % with \cs{gamma}, as usual. The symbol \cs{gammait} is provided just in case
783 % \cs{gamma} has been redefined by a package option and you want to use the
784 % original symbol for some reason. The Henry's Law activity coefficients should
785 % be produced with \cs{gammarat} (rational basis) and \cs{gammamol} (molal
786 % basis). There are also macros to generate the Henry's law constants for both
787 % the rational basis (\cs{Henryrat}) and the molal basis (\cs{Henrymol}).
788 % These are interrelated:
789 % \begin{verbatim}
790 % \[ \fmix_i = x_i \gamma_i \fpure_i = x_i \gammarat_i \Henryrat_i
791 % = C_i \gammamol_i \Henrymol_i \]
792 %\end{verbatim}
793 % produces
794 % \[ \fmix_i = x_i \gamma_i \fpure_i = x_i \gammarat_i \Henryrat_i
795 % = C_i \gammamol_i \Henrymol_i \]
796 % using the default options.
797 % These symbols can be customized either directly or by using package options.
798 % For example, the |TesterModell| package option changes the equation
799 % above to
800 % \[ \hat f_i = x_i \gamma_i f_i = x_i \gamma_i^{**} f_i^{**}
801 % = C_i \gamma_i^* f_i^* \]
802 % without any changes in markup.
803 %
804 % Note that some books (e.g., |ElliottLira|) prefer the atmospheric chemistry
805 % convention for the molal basis, namely
806 % \[ \fmix_i = x_i \gamma_i \fpure_i = x_i \gammarat_i \Henryrat_i
807 % = C_i \gammamol_i / K_{H,i} \]
808 % (that is, using $1/K_{H,i}$ in place of $\Henrymol_i$).
809 % Unfortunately, this makes it impossible to change symbols without any edits
810 % to markup, so this convention is \emph{not} supported by this package.
811 %
812 % \subsubsection{Saturation Properties}
813 % \DescribeMacro{\Psat}
814 % \DescribeMacro{\Pvap}
815 % \DescribeMacro{\fsat}
816 % \DescribeMacro{\phisat}
817 % The saturation pressure is generated with \cs{Psat}. The macro \cs{Pvap} is
818 % an alias for \cs{Psat}. The fugacity and fugacity coefficient at saturation
819 % are accessed via \cs{fsat} and \cs{phisat}, respectively. Package options
820 % can be used to change some of these to match the notation of specific
821 % textbooks.
822 %
823 % \DescribeMacro{\sat}
824 % The \cs{sat} macro is used ``behind the scenes'' as part of
825 % \cs{Psat}, \cs{fsat}, and \cs{phisat}, which produce $\Psat$,
826 % $\fsat$, and $\phisat$, respectively (using the defaults). If you wanted to
827 % redefine them to be $P^\text{vap}$, $f^\text{vap}$, and $\phi^\text{vap}$,
828 % you could simply redefine \cs{sat} with
829 % \verb"\RenewDocumentCommand{\sat}{}{{\text{vap}}}".
830 % This is done automatically using package option |Sandler|.
831 %
832 % \subsubsection{Standard States and Chemical Reactions}
833 % \DescribeMacro{\std}
834 % \DescribeMacro{\Pstd}
835 % \DescribeMacro{\Cstd}
836 % \DescribeMacro{\fstd}
837 % \DescribeMacro{\mustd}
838 % The symbol $\circ$ (\cs{circ}) is used by default for standard states.
839 % This is intended to be easy to change should the user want to replace
840 % $P^\circ$ with $P^\ominus$, say. This is accessed via the \cs{std} macro.
841 % The macro \cs{Pstd} is defined as |P^\std| for convenience to denote
842 % standard pressure, \cs{Cstd} is defined as |C^\std| to denote standard
843 % molality, \cs{fstd} is defined for standard fugacities, and \cs{mustd} is
844 % defined for standard chemical potentials so as to ease implementation across
845 % textbooks.
846 %
847 % The usual usage would be something like this:
848 % \begin{verbatim}
849 % \[ \Deltarxn\Gm = \sumall_i \nu_i \mu_i = \sumall_i \left[ \nu_i \mustd_i
850 % + \nu_i RT \log\left(\frac{\fmix_i}{\fstd_i}\right) \right]
851 % = \Deltarxn\Gm^\std + RT \log\left[\prodall_i a_i^{\nu_i} \right] \],
852 %\end{verbatim}
853 % which produces
854 % \[ \Deltarxn\Gm = \sumall_i \nu_i \mu_i = \sumall_i \left[ \nu_i \mustd_i
855 % + \nu_i RT \log\left(\frac{\fmix_i}{\fstd_i}\right) \right]
856 % = \Deltarxn\Gm^\std + RT \log\left[\prodall_i a_i^{\nu_i} \right] \]
857 % with the default settings.
858 %
859 % The extent of reaction is generated by the macro \cs{xrxn}, which by default
860 % is printed as \(\xrxn\).
861 %
862 % \subsubsection{Changes on Mixing, Reaction, Fusion, Vaporization, and
863 % Sublimation}
864 % \DescribeMacro{\Deltamix}
865 % Mixing properties are handled via the \cs{Deltamix} macro, and are used as in
866 % the following example:
867 % \begin{verbatim}
868 % \[ \Deltamix\Gm = \Gm - \sumall_i x_i \Gm_i
869 % = \Deltamix\Hm - T\Deltamix\Sm \],
870 %\end{verbatim}
871 % which yields, using the default options,
872 % \[ \Deltamix\Gm = \Gm - \sumall_i x_i \Gm_i = \Deltamix\Hm - T\Deltamix\Sm \]
873 % Some textbooks (|Sandler|, |Thompson|) choose to typeset these with the word
874 % ``mix'' \emph{before} the symbol, which is handled automatically by this
875 % package.
876 % \DescribeMacro{\mixing}
877 % The macro \cs{mixing} determines how the change in mixing label is rendered;
878 % the default is \verb"{\text{mix}}".
879 %
880 % \DescribeMacro{\Deltafus}
881 % \DescribeMacro{\Deltasub}
882 % \DescribeMacro{\Deltavap}
883 % The commands \cs{Deltafus}, \cs{Deltasub}, and \cs{Deltavap}
884 % typeset changes due to fusion (melting), sublimation (subliming), and
885 % vaporization (boiling), respectively. Their use is straightforward, viz.,
886 % \begin{verbatim}
887 % \[ \Deltasub\Hm = \Hm^V - \Hm^S = \Hm^V - \Hm^L + (\Hm^L - \Hm^S)
888 % = \Deltafus\Hm + \Deltavap\Hm \],
889 %\end{verbatim}
890 % yielding
891 % \[ \Deltasub\Hm = \Hm^V - \Hm^S = \Hm^V - \Hm^L + (\Hm^L - \Hm^S)
892 % = \Deltafus\Hm + \Deltavap\Hm \]
893 % with the default options. Note that some textbooks (e.g., |Sandler|) typeset
894 % these quantities quite differently; this is handled automatically. Other
895 % textbooks (e.g., |Koretsky|) typeset them as subscripts; this is also
896 % handled automatically.
897 %
898 % \DescribeMacro{\Deltaf}
899 % \DescribeMacro{\Deltarxn}
900 % The macros \cs{Deltaf} and \cs{Deltarxn} are intended to typeset the enthalpy
901 % or free energy of formation and reaction, respectively. For example,
902 % \begin{verbatim}
903 % \[ \Deltarxn\Hm^\std = \sumall_i \nu_i \Deltaf\Hm_i^\std \]
904 %\end{verbatim}
905 % results in
906 % \[ \Deltarxn\Hm^\std = \sumall_i \nu_i \Deltaf\Hm_i^\std. \]
907 % It is not anticipated that this command will be combined with something like
908 % a heat capacity, which already has a (potentially double) subscript, but as
909 % there is no ``formation'' heat capacity, that should not present a problem.
910 %
911 % \subsection{Residual and Excess Properties}
912 % \DescribeMacro{\UR}
913 % \DescribeMacro{\URt}
914 % \DescribeMacro{\URs}
915 % \DescribeMacro{\URpm}
916 % \DescribeMacro{\UE}
917 % \DescribeMacro{\UEt}
918 % \DescribeMacro{\UEs}
919 % \DescribeMacro{\UEpm}
920 % Additional macros are defined that make it easy to typeset the residual
921 % (also called ``departure'') and excess total, molar, specific, and partial
922 % molar properties. These macros follow the same pattern: \cs{UR}, \cs{URt},
923 % \cs{URs}, and \cs{URpm} typeset the molar, total, specific, and partial molar
924 % residual internal energies, respectively, and by default expand to $U^R,$
925 % $\URt,$ $\URs, $ and $\smash[t]{\URpm{i}}$ (the last
926 % is called as \verb"\URpm{i}" or \verb"\URpm_i"). Similarly, \cs{UE},
927 % \cs{UEt}, \cs{UEs}, and \cs{UEpm} typeset the corresponding excess
928 % properties. The first character of the macros for other properties follow the
929 % same pattern as in Table~\ref{table:symbols}.
930 %
931 % The $R$ and $E$ characters are generated by the macros \cs{residual} and
932 % \cs{excess}, respectively. These macros can be redefined; for example, if you
933 % \DescribeMacro{\excess}
934 % \DescribeMacro{\residual}
935 % want \cs{SE}, which normally produces $\SE$, to give you $S^{EX}$---and let's
936 % be honest, who doesn't want that?\footnote{You knew that joke was
937 % coming.}---then you can redefine it with
938 % \begin{verbatim}
939 % \RenewDocumentCommand{\excess}{}{{EX}},
940 %\end{verbatim}
941 % or possibly
942 % \begin{verbatim}
943 % \RenewDocumentCommand{\excess}{}{{\mathrm{EX}}}
944 %\end{verbatim}
945 % or even
946 % \begin{verbatim}
947 % \RenewDocumentCommand{\excess}{}{\text{EX}},
948 %\end{verbatim}
949 % which cause \cs{SE} to expand to $S^{EX},$ $S^\mathrm{EX},$ and
950 % $S^\text{EX},$ respectively.
951 %
952 % It is generally possible to use superscripts with the excess or residual
953 % properties; in the event this fails, the \cs{excess} and \cs{residual} macros
954 % can be used directly, viz.,
955 % \begin{verbatim}
956 % \begin{gather*}
957 % \HE^\std = \Hm^{\excess,\std} = \HE(T,\Pstd)
958 % = \HR(T,\Pstd) - \HR^\IS(T,\Pstd) = \HR^\std - \HR^{\IS,\std} \\
959 % \RenewDocumentCommand{\excess}{{EX}}
960 % \HE^\std = \Hm^{\excess,\std} = \HE(T,\Pstd)
961 % = \HR(T,\Pstd) - \HR^\IS(T,\Pstd)
962 % \end{gather*},
963 %\end{verbatim}
964 % which yields
965 % \begin{gather*}
966 % \HE^\std = \Hm^{\excess,\std} = \HE(T,\Pstd)
967 % = \HR(T,\Pstd) - \HR^\IS(T,\Pstd) = \HR^\std - \HR^{\IS,\std} \\
968 % \RenewDocumentCommand{\excess}{}{{EX}}
969 % \HE^\std = \Hm^{\excess,\std} = \HE(T,\Pstd)
970 % = \HR(T,\Pstd) - \HR^\IS(T,\Pstd)
971 % \end{gather*}
972 % using the default options.
973 %
974 % \subsection{Partial Derivatives}
975 % \DescribeMacro{\Partial}%
976 % \DescribeMacro{\Partial*}%
977 % Partial derivatives are easily rendered using the \cs{Partial} command.
978 % There is a starred form (\cs{Partial*}) that additionally adjusts the
979 % spacing after the closing symbol to remove some of the space, anticipating
980 % that the following binary operator will overhang the subscripts.
981 % Compare the following:
982 % \begin{verbatim}
983 % \[ \Partial{\Hm}{T}{P} = \cP \qquad \Partial*{\Hm}{T}{P} = \cP \],
984 %\end{verbatim}
985 % which yields
986 % \[ \Partial{\Hm}{T}{P} = \cP \qquad \Partial*{\Hm}{T}{P} = \cP. \]
987 %
988 % \DescribeMacro{\Partialinline}%
989 % Inline first derivatives\footnote{The ``inline'' versions of
990 % partial derivatives are ``sticky'': if you issue \cs{Partialinline} or
991 % its second-order equivalents anywhere in a line, all subsequent
992 % \cs{Partial} and \cs{Partial[Mix]Second} macros on the same line
993 % (technically, anywhere in the same \TeX\ ``group'') will
994 % expand inline as well. To prevent this, enclose your \cs{Partialinline} and
995 % associated arguments in its own group (i.e.,
996 % \texttt{\{\cs{Partialinline}\dots\}}).%
997 % \label{fn:inline}}
998 % can be entered the same way; compare:
999 % \begin{verbatim}
1000 % \[ \Partial*{\Hm}{T}{P} = \Partialinline{\Hm}{T}{P}
1001 % = T\Partial{\Sm}{T}{P} \],
1002 %\end{verbatim}
1003 % which results in
1004 % \[ \Partial*{\Hm}{T}{P} = \Partialinline{\Hm}{T}{P}
1005 % = T\Partial{\Sm}{T}{P}. \]
1006 % There is no need for an inline starred form, as the subscripts do not
1007 % extend far enough below the baseline.
1008 %
1009 % \subsubsection{Second-Order Partial Derivatives}
1010 % \DescribeMacro{\PartialSecond}%
1011 % \DescribeMacro{\PartialSecond*}%
1012 % \DescribeMacro{\PartialMixSecond}%
1013 % \DescribeMacro{\PartialMixSecond*}%
1014 % Second partial derivatives and mixed-second partial derivatives are typeset
1015 % with the commands \cs{PartialSecond} and \cs{PartialMixSecond}, respectively.
1016 % Like the first-order variety, these also have starred versions that remove
1017 % the space immediately following the closing symbols, anticipating that the
1018 % equals sign or other binary operator following the derivative will overhang
1019 % the elements held constant. For example,
1020 % \begin{verbatim}
1021 % \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1022 % = \PartialMixSecond*{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
1023 % = \PartialMixSecond*{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
1024 % = \Partial{\Gpm_i}{P}{T,\allNs} \]
1025 %\end{verbatim}
1026 % looks like
1027 % \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1028 % = \PartialMixSecond*{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
1029 % = \PartialMixSecond*{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
1030 % = \Partial{\Gpm_i}{P}{T,\allNs}. \]
1031 % \DescribeMacro{\PartialSecondinline}%
1032 % \DescribeMacro{\PartialMixSecondinline}%
1033 % Inline versions\footref{fn:inline} of second-order derivatives are handled
1034 % with \cs{PartialSecondinline} and \cs{PartialMixSecondinline}, viz.,
1035 % \begin{verbatim}
1036 % \begin{equation}
1037 % \Vpm_i = \Partialinline{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1038 % = \PartialMixSecondinline{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
1039 % = \PartialMixSecondinline{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
1040 % = \Partialinline{\Gpm_i}{P}{T,\allNs} \]
1041 % \end{equation}
1042 %\end{verbatim}
1043 % looks like
1044 % \begin{equation}
1045 % \Vpm_i = \Partialinline{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1046 % = \PartialMixSecondinline{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
1047 % = \PartialMixSecondinline{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
1048 % = \Partialinline{\Gpm_i}{P}{T,\allNs}
1049 % \label{eq:Vpm-inline}
1050 % \end{equation}
1051 % with the default options.
1052 % \pagebreak[0]%
1053 %
1054 % \subsubsection{Delimiter Sizing}
1055 % \DescribeMacro{\PartialBigg}%
1056 % \DescribeMacro{\PartialSecondBigg}%
1057 % \DescribeMacro{\PartialMixSecondBigg}%
1058 % \DescribeMacro{\Partialbigg}%
1059 % \DescribeMacro{\PartialSecondbigg}%
1060 % \DescribeMacro{\PartialMixSecondbigg}%
1061 % There are instances (such as the line above) when \cs{Partial} causes
1062 % parentheses that are slightly
1063 % too tall but do not need to be---particularly when partial molar properties,
1064 % specific quantities, or fugacities are involved. The macro \cs{PartialBigg}
1065 % uses \pkg{amsmath}'s \tn{Biggl} and \tn{Biggr} macros in place of \tn{left}
1066 % and \tn{right} to size the delimiters accordingly; \cs{Partialbigg} uses
1067 % \tn{biggl} and \tn{biggr} in a similar fashion. For example, compare the
1068 % following:
1069 % \begin{verbatim}
1070 % \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1071 % = \Partial*{\Gpm_i}{P}{T,\allNs}
1072 % = \PartialBigg*{\Gpm_i}{P}{T,\allNs}
1073 % = RT\Partial*{\log\fmix_i}{P}{T,\allNs}
1074 % = RT\PartialBigg*{\log\fmix_i}{P}{T,\allNs}
1075 % = RT\Partialbigg{\log\fmix_i}{P}{T,\allNs} \],
1076 %\end{verbatim}
1077 % which typesets as
1078 % \[ \Vpm{i} = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1079 % = \Partial*{\Gpm{i}}{P}{T,\allNs}
1080 % = \PartialBigg*{\Gpm{i}}{P}{T,\allNs}
1081 % = RT\Partial*{\log\fmix_i}{P}{T,\allNs}
1082 % = RT\PartialBigg*{\log\fmix_i}{P}{T,\allNs}
1083 % = RT\Partialbigg{\log\fmix_i}{P}{T,\allNs}. \]
1084 % Note that a similar effect---possibly with other side effects---can be
1085 % achieved with \pkg{amsmath}'s \tn{smash} command, which has the effect of
1086 % removing all vertical space associated with a particular character.
1087 % Observe:
1088 % \begin{verbatim}
1089 % \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1090 % = \Partial{\smash{\Gpm_i}}{P}{T,\allNs} \]
1091 %\end{verbatim}
1092 % produces
1093 % \[ \Vpm_i = \Partial*{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1094 % = \Partial{\smash{\Gpm_i}}{P}{T,\allNs}. \]
1095 %
1096 % \setmarginparsize{\footnotesize}%
1097 % \DescribeMacro{\Partialinlinetext}%
1098 % \DescribeMacro{\PartialSecondinlinetext}%
1099 % \restoremarginparsize
1100 % \setmarginparsize{\scriptsize}
1101 % \DescribeMacro{\PartialMixSecondinlinetext}%
1102 % \restoremarginparsize
1103 % Similarly, there are times when \cs{Partialinline} causes parentheses that
1104 % are too big for inline text, and they do not need to be---particularly for
1105 % symbols with overlines, underlines, or other decorations. In this case, the
1106 % macros \cs{Partialinlinetext}, \cs{PartialSecondinlinetext}, and
1107 % \cs{PartialMixSecondinlinetext} come in handy; using these macros like so,
1108 % \begin{verbatim}
1109 % \[ \Vpm_i = \Partialinlinetext{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1110 % = \PartialMixSecondinlinetext{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
1111 % = \PartialMixSecondinlinetext{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
1112 % = \Partialinlinetext{\Gpm_i}{P}{T,\allNs} \],
1113 %\end{verbatim}
1114 % Equation~\eqref{eq:Vpm-inline} looks like
1115 % \[ \Vpm{i} = \Partialinlinetext{\Vt}{\Nt_i}{T,P,\allNsbut{i}}
1116 % = \PartialMixSecondinlinetext{\Gt}{\Nt_i}{P}{T,\allNsbut{i}}
1117 % = \PartialMixSecondinlinetext{\Gt}{P}{\Nt_i}{T,\allNsbut{i}}
1118 % = \Partialinlinetext{\Gpm{i}}{P}{T,\allNs}. \]
1119 %
1120 % \subsubsection{Higher-Order Derivatives}
1121 % It is possible to ``fake'' higher-order derivatives via some trickery.
1122 % For example,
1123 % \begin{verbatim}
1124 % \[ \cPpm_i = T\Partial*{\Spm_i}{T}{P,\allXs}
1125 % = T\PartialMixSecond*{\St}{T}{\Nt_i}{P,\allNsbut{i}}
1126 % = -T\Partial{^3\Gt}{T^2\partial\Nt_i}{P,\allNsbut{i}} \]
1127 %\end{verbatim}
1128 % gives
1129 % \[ \cPpm{i} = T\Partial*{\Spm{i}}{T}{P,\allXs}
1130 % = T\PartialMixSecond*{\St}{T}{\Nt_i}{P,\allNsbut{i}}
1131 % = -T\Partial{^3\Gt}{T^2\partial\Nt_i}{P,\allNsbut{i}}, \]
1132 % which is probably pretty close to what you wanted. Using this trickery with
1133 % the package option \verb"nosubscripts" will not work, and the use of
1134 % third- and higher-order derivatives with this package should generally be
1135 % considered unsupported.
1136 %
1137 % \subsection{Holding Constant the Number of Moles of Several Species}
1138 % \DescribeMacro{\allNs}%
1139 % \DescribeMacro{\allNsbut}%
1140 % \DescribeMacro{\allmus}%
1141 % \DescribeMacro{\allmusbut}%
1142 % \DescribeMacro{\allXs}%
1143 % \DescribeMacro{\allXsbut}%
1144 % \DescribeMacro{\allYs}%
1145 % \DescribeMacro{\allYsbut}%
1146 % \DescribeMacro{\allMs}%
1147 % \DescribeMacro{\allMsbut}%
1148 % \DescribeMacro{\allWs}%
1149 % \DescribeMacro{\allWsbut}%
1150 % It is common in thermodynamics to use notation such as
1151 % \[ \Vpm_k = \Partial{\Vt}{\Nt_k}{T,P,\allNsbut{k}}, \]
1152 % or perhaps
1153 % \begin{thermomolesrange}
1154 % \[ \Vpm{k} = \Partial{\Vt}{\Nt_k}{T,P,\allNsbut{k}} \]
1155 % \end{thermomolesrange}
1156 % or
1157 % \[ \Vpm{k} = \left(\frac{\partial\Vt}{\partial\Nt_k}\right)_{T,P,\Nt_j[k]}, \]
1158 % to mean partial derivatives that hold the number of moles of each species
1159 % constant \emph{except} the one being changed.
1160 % Similarly, a property determined with all mole fractions held
1161 % constant might be written
1162 % \[ \cP = \Partial{\Hm}{T}{P,\allXs}, \]
1163 % or perhaps
1164 % \begin{thermomolesrange}\relax
1165 % \[ \cP = \Partial{\Hm}{T}{P,\allXs}. \]
1166 % \end{thermomolesrange}\relax
1167 % There are several macros that standardize such constructs.
1168 % The \cs{allNs} macro expands to something meaning the number of moles of all
1169 % species; by default, this is $\vec{n}$ (package option
1170 % \verb"moles-index"), but can be changed to $n_1,\dotsc,n_C$ using the package
1171 % option \verb"moles-range". Similarly, the macros \cs{allmus} and
1172 % \cs{allmusbut} do the same but with $n$ replaced by $\mu$, and \cs{allMsbut}
1173 % is the same with $m$ instead of $n$. There are analogous macros for mole
1174 % fractions, namely \cs{allXs} and \cs{allXsbut} for $x$ and \cs{allYs} and
1175 % \cs{allYsbut} for $y$, as well as \cs{allWs} and \cs{allWsbut} for mass
1176 % fractions---these implicitly assume that all mole or mass fractions
1177 % \emph{except} the last are used as variables.
1178 % These macros all take an optional argument; for example,
1179 % \begin{verbatim}
1180 % \[ \Partial{\Ht}{\Nt_1}{T,P,\allNsbut{1}} =
1181 % \Partial{\Ht}{\Nt_1}{T,P,\allNsbut[m]{1}} = \Hpm_1 \]
1182 %\end{verbatim}
1183 % typesets as
1184 % \[ \Partial{\Ht}{\Nt_1}{T,P,\allNsbut{1}} =
1185 % \Partial{\Ht}{\Nt_1}{T,P,\allNsbut[m]{1}} = \Hpm{1}. \]
1186 % Similarly,
1187 % \begin{verbatim}
1188 % \[ \Partial{\Hm}{x_i}{T,P,\allXsbut{i}}
1189 % = \Partial{\Hm}{x_i}{T,P,\allXsbut[m]{i}}
1190 % = \Hpm_i - \Hpm_\ncomponents \]
1191 %\end{verbatim}
1192 % becomes
1193 % \[ \Partial{\Hm}{x_i}{T,P,\allXsbut{i}}
1194 % = \Partial{\Hm}{x_i}{T,P,\allXsbut[m]{i}}
1195 % = \Hpm{i} - \Hpm{\ncomponents}. \]
1196 % Users must supply their own redefinitions if they wish to hold something
1197 % other than \cs{ncomponents} constant in addition to the argument for mole
1198 % and mass fractions.
1199 % Using the \verb"moles-range" package option, for which \verb"\allXsbut{k}"
1200 % expands to
1201 % \( \begin{thermomolesrange}\allXsbut{k}\end{thermomolesrange} \)
1202 % rather than \( \allXsbut{k} \), the optional argument is ignored.
1203 %
1204 % The optional argument to \cs{allNs} and similar commands is ignored when
1205 % using the default options; it is relevant for package options that redefine
1206 % \cs{allNs} to make $N_i$, for example; in this case, one can enter
1207 % \cs{allNs[j]} to make \TeX\ render $N_j$ instead of $N_i$. This is useful
1208 % if you are using $i$ somewhere else in the equation.
1209 %
1210 % \DescribeMacro{\allbut}
1211 % \DescribeMacro{\allbutlastand}
1212 % Users can define new ``all but'' macros using the \cs{allbut} and
1213 % \cs{allbutlastand} commands. For example,
1214 % \begin{verbatim}
1215 % \NewDocumentCommand{\allNsbut}{O{j} m}{\allbut[#1]{#2}{\Nt}}
1216 % \NewDocumentCommand{\allXsbut}{O{j} m}{\allbutlastand[#1]{#2}{x}}
1217 %\end{verbatim}
1218 % are the definitions of \cs{allNsbut} and \cs{allXsbut}, respectively.
1219 %
1220 % \subsection{Jacobians}
1221 % \DescribeMacro{\Jacobian}%
1222 % \DescribeMacro{\Jacobiandet}%
1223 % The Jacobian determinant is often denoted with Leibnitz-like notation, viz.,
1224 % \begin{verbatim}
1225 % \[ \Jacobian{K,L}{X,Y} = \Jacobiandet{K,L}{X,Y} \],
1226 %\end{verbatim}
1227 % which produces (assuming the \pkg{amsmath} package has been loaded)
1228 % \[ \Jacobian{K,L}{X,Y} = \Jacobiandet{K,L}{X,Y}. \]
1229 % There are two optional arguments to \cs{Jacobiandet}. The first will be
1230 % pre-pended before every element of the matrix (typically \cs{textstyle} or
1231 % \cs{displaystyle}); the second is the extra spacing added between rows
1232 % (default is 1.25~ex for text-style fractions and 2.75~ex for display-style
1233 % fractions). More than two variables can be specified, viz.,
1234 % \begin{verbatim}
1235 % \[ \Jacobian{K,L,M}{X,Y,Z}
1236 % = \Jacobiandet[\displaystyle][3ex]{K,L,M}{X,Y,Z} \]
1237 %\end{verbatim}
1238 % will produce
1239 % \[ \Jacobian{K,L,M}{X,Y,Z} = \Jacobiandet[\displaystyle][3ex]{K,L,M}{X,Y,Z}.
1240 % \]
1241 % The \cs{Jacobiandet} macro will understand implied multicomponent Jacobians,
1242 % too, namely,
1243 % \begin{verbatim}
1244 % \[ \Jacobian{f_1,\dots,f_m}{x_1,\dots,x_m} =
1245 % \Jacobiandet{f_1,\dots,f_m}{x_1,\dots,x_m} \]
1246 %\end{verbatim}
1247 % typesets as
1248 % \[ \Jacobian{f_1,\dots,f_m}{x_1,\dots,x_m} =
1249 % \Jacobiandet{f_1,\dots,f_m}{x_1,\dots,x_m}. \]
1250 % If the option |moles-range| or the \env{thermomolesrange} environment is
1251 % used, the same code produces
1252 % \begin{thermomolesrange}
1253 % \[ \Jacobian{f_1,\dots,f_m}{x_1,\dots,x_m} =
1254 % \Jacobiandet{f_1,\dots,f_m}{x_1,\dots,x_m}. \]
1255 % \end{thermomolesrange}
1256 %
1257 % \subsection{Sums and Products}
1258 % \DescribeMacro{\sumall}
1259 % \DescribeMacro{\sumallbutlast}
1260 % \DescribeMacro{\prodall}
1261 % It is common to require sums and products such as
1262 % \[ \sumall_i x_i = 1 \quad \text{or} \quad
1263 % x_\ncomponents = 1 - \sumallbutlast_i x_i \quad \text{or} \quad
1264 % \Gt = \sumall_j \mu_j\Nt_j \quad \text{and} \quad
1265 % K = \prodall_k a_k^{\nu_k}. \]
1266 % This package defines shortcuts to typeset such terms thus:
1267 % \begin{verbatim}
1268 % \[ \sumall_i x_i = 1 \quad \text{or} \quad
1269 % x_\ncomponents = 1 - \sumallbutlast_i x_i \quad \text{or} \quad
1270 % \Gt = \sumall_j \mu_j\Nt_j \quad \text{and} \quad
1271 % K = \prodall_k a_k^{\nu_k} \].
1272 %\end{verbatim}
1273 % The symbol $C$ can be changed by redefining the expandable macro
1274 % \cs{ncomponents}. This is done automatically by some package options (e.g.,
1275 % |TesterModell| changes it to $n$; |Sandler| changes it to $\mathcal{C}$;
1276 % |Thompson| changes it to $c$).
1277 %
1278 % \section{Loading the Package} \label{sec:loading}
1279 % To load the package with the defaults enabled, load it the usual way:
1280 % \begin{verbatim}
1281 % \usepackage{thermodynamics}
1282 %\end{verbatim}
1283 % The package options loaded by default are \verb"EUAGHan", \verb"subscripts",
1284 % \verb"parentheses", \verb"intensive-plain", and \verb"moles-index".
1285 % These define, respectively, the default symbols to use for total energy,
1286 % internal energy, Helmholtz free energy, and so forth; the manner of writing
1287 % partial derivatives; the delimiters around partial derivatives; the
1288 % manner of denoting extensive, molar, and specific properties; and the
1289 % manner of writing the number of moles of all or most species in partial
1290 % derivatives. The default behavior can be altered by options in the following
1291 % section.
1292 %
1293 % \subsection{Package Options}
1294 % There are three categories of options: options that affect which symbols are
1295 % used, options that affect how symbols are decorated, and options that affect
1296 % how partial derivatives are displayed. These are presented in turn.
1297 %
1298 % \subsubsection{Options that Change Symbol Sets}
1299 % There are several options that choose the set of symbols to use for total
1300 % energy, internal energy, Helmholtz free energy, and so forth. These are
1301 % summarized in Table~\ref{table:symbol-sets}. The default is \verb"EUAGHan".
1302 %
1303 % \NewExtensiveProperty{f}{F}
1304 % \NewExtensiveProperty{a}{A}
1305 % \NewExtensiveProperty{ee}{\mathcal{E}}
1306 % \NewExtensiveProperty{aa}{\mathcal{A}}
1307 % \begin{table}
1308 % \caption{Options controlling which symbols to use by default. The
1309 % macros \cs{Et}, \cs{Ut}, \cs{Ft}, \cs{Gt}, \cs{Ht}, \cs{At}, and
1310 % \cs{Nt} represent the total energy, internal energy,
1311 % Helmholtz free energy, Gibbs free energy, enthalpy, surface area,
1312 % and number of moles, respectively. Symbols are shown as they would
1313 % appear with the (default) option \texttt{intensive-plain}.
1314 % }
1315 % \label{table:symbol-sets}
1316 % \centering\small
1317 % \begin{tabular}{l l l l l l l l l}
1318 % \toprule
1319 % Option & \verb"\Et" & \verb"\Ut" & \verb"\Ft" & \verb"\Gt" & \verb"\Ht"
1320 % & \verb"\At" & \verb"\Nt" \\
1321 % \midrule
1322 % |EUAGHan| & $\Et$ & $\Ut$ & $\Ft$ & $\Gt$ & $\Ht$ & $\At$ & $n$ \\
1323 % |EUAGHaN| & $\Et$ & $\Ut$ & $\Ft$ & $\Gt$ & $\Ht$ & $\At$ & $N$ \\
1324 % |EUHAGan| & \multicolumn{7}{l}{(synonym for \texttt{EUAGHan})} \\
1325 % |EUHAGaN| & \multicolumn{7}{l}{(synonym for \texttt{EUAGHaN})} \\
1326 % |EUFGHAn| & $\Et$ & $\Ut$ & $\ft$ & $\Gt$ & $\Ht$ & $\at$ & $n$ \\
1327 % |EUFGHAN| & $\Et$ & $\Ut$ & $\ft$ & $\Gt$ & $\Ht$ & $\at$ & $N$ \\
1328 % |EEFGHAn| & $\eet$ & $\Et$ & $\ft$ & $\Gt$ & $\Ht$ & $\at$ & $n$ \\
1329 % |EEFGHAN| & $\eet$ & $\Et$ & $\ft$ & $\Gt$ & $\Ht$ & $\at$ & $N$ \\
1330 % |EEFGHan| & $\eet$ & $\Et$ & $\ft$ & $\Gt$ & $\Ht$ & $\At$ & $n$ \\
1331 % |EEFGHaN| & $\eet$ & $\Et$ & $\ft$ & $\Gt$ & $\Ht$ & $\At$ & $N$ \\
1332 % |EEAGHaN| & $\eet$ & $\Et$ & $\Ft$ & $\Gt$ & $\Ht$ & $\At$ & $N$ \\
1333 % |EEAGHAN| & $\eet$ & $\Et$ & $\Ft$ & $\Gt$ & $\Ht$ & $\aat$ & $n$ \\
1334 % |EUAGHAN| & $\Et$ & $\Ut$ & $\Ft$ & $\Gt$ & $\Ht$ & $\aat$ & $N$ \\
1335 % |EUFGHan| & $\Et$ & $\Ut$ & $\ft$ & $\Gt$ & $\Ht$ & $\At$ & $n$ \\
1336 % |EUFGHaN| & $\Et$ & $\Ut$ & $\ft$ & $\Gt$ & $\Ht$ & $\At$ & $N$ \\
1337 % \bottomrule
1338 % \end{tabular}
1339 % \end{table}
1340 %
1341 % Using \verb"EUAGHan" (the default), we might use the following markup:
1342 % \begin{verbatim}
1343 % \[ \Ft = \Ut - T\St = -P\Vt + \sumall_i \mu_i \Nt_i + \sigma \At
1344 % \qquad \Hm = \Um + P\Vm \qquad \Et = \Ut + \frac12 mv^2 \],
1345 %\end{verbatim}
1346 % which would look like
1347 % \[ \Ft = \Ut - T\St = -P\Vt + \sumall_i \mu_i \Nt_i + \sigma \At
1348 % \qquad \Hm = \Um + P\Vm \qquad \Et = \Ut + \frac12 mv^2 \]
1349 % Using the \verb"EEFGHAN" option, the same markup would yield
1350 % \[ \ft
1351 % = \Et - T\St
1352 % = -P\Vt + \sumall_i \mu_i N_i + \sigma \at
1353 % \qquad H = U + PV
1354 % \qquad \eet = \Et + \frac12 mv^2. \]
1355 %
1356 % \subsubsection{Options for Extensive vs.\ Molar Properties}
1357 % There are four sets of notation that define how extensive properties are
1358 % represented, as shown in Table~\ref{table:extensive}.
1359 % The default is \verb"intensive-plain", which (using the volume as an
1360 % example) represents the total, molar, specific, and partial molar volumes,
1361 % respectively, as $\Vt,$ $\Vm,$ $\Vs,$ and $\Vpm{j}$.
1362 %
1363 % For example, the definition of the partial molar enthalpy would be different
1364 % depending on which set of notation is used. The markup
1365 % \begin{verbatim}
1366 % \[ \Hpm_i = \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
1367 % = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}} \]
1368 %\end{verbatim}
1369 % yields the following, depending on the package option loaded:
1370 % \begin{align*}
1371 % \Hpm_i &= \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
1372 % = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}}
1373 % && \text{\texttt{intensive-plain}} \\
1374 % \Hpm_i &=
1375 % \begin{thermoextensiveplain}
1376 % \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
1377 % = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}}
1378 % \end{thermoextensiveplain}
1379 % && \text{\texttt{extensive-plain}} \\
1380 % \Hpm_i &=
1381 % \begin{thermoextensivesuperscript}
1382 % \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
1383 % = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}}
1384 % \end{thermoextensivesuperscript}
1385 % && \text{\texttt{extensive-superscript}} \\
1386 % \begin{thermointensivelowercase}
1387 % \Hpm_i
1388 % \end{thermointensivelowercase}
1389 % &=
1390 % \begin{thermointensivelowercase}
1391 % \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
1392 % = \Partial{\Nt\Hm}{\Nt_i}{T,P,\allNsbut{i}}
1393 % \end{thermointensivelowercase}
1394 % && \text{\texttt{intensive-lowercase}}
1395 % \end{align*}
1396 % The use of \verb"intensive-lowercase" is strongly discouraged.
1397 %
1398 % Note that the number of moles can be changed from $n$ to $N$ via the
1399 % options in the previous section.
1400 %
1401 % \begin{table}
1402 % \caption{Notation sets that can be set using the options
1403 % \texttt{intensive-plain} (the default), \texttt{extensive-plain},
1404 % \texttt{extensive-superscript}, and \texttt{intensive-lowercase}.}
1405 % \label{table:extensive}
1406 % \centering\small
1407 % \begin{tabular}{l l l l l l}
1408 % \toprule
1409 % Option & \verb"\Vt" & \verb"\Vm" & \verb"\Vs" & \verb"\Vpm_i" \\
1410 % \midrule
1411 % \verb"intensive-plain" & $\Vt$ & $\Vm$ & $\Vs$ & $\Vpm{i}$ \\[2ex]
1412 % \verb"extensive-plain" &
1413 % \begin{thermoextensiveplain}$\Vt$\end{thermoextensiveplain} &
1414 % \begin{thermoextensiveplain}$\Vm$\end{thermoextensiveplain} &
1415 % \begin{thermoextensiveplain}$\Vs$\end{thermoextensiveplain} &
1416 % \begin{thermoextensiveplain}$\Vpm{i}$\end{thermoextensiveplain}
1417 % \\[2ex]
1418 % \verb"extensive-superscript" &
1419 % \begin{thermoextensivesuperscript}$\Vt$\end{thermoextensivesuperscript} &
1420 % \begin{thermoextensivesuperscript}$\Vm$\end{thermoextensivesuperscript} &
1421 % \begin{thermoextensivesuperscript}$\Vs$\end{thermoextensivesuperscript} &
1422 % \begin{thermoextensivesuperscript}$\Vpm{i}$\end{thermoextensivesuperscript} \\[2ex]
1423 % \verb"intensive-lowercase" &
1424 % \begin{thermointensivelowercase}$\Vt$\end{thermointensivelowercase} &
1425 % \begin{thermointensivelowercase}$\Vm$\end{thermointensivelowercase} &
1426 % \begin{thermointensivelowercase}$\Vs$\end{thermointensivelowercase} &
1427 % \begin{thermointensivelowercase}$\Vpm{i}$\end{thermointensivelowercase}
1428 % \\
1429 % \bottomrule
1430 % \end{tabular}
1431 % \end{table}
1432 %
1433 % \pagebreak[1]\relax
1434 % \setmarginparsize{\footnotesize}
1435 % \DescribeEnv{thermointensiveplain}
1436 % \DescribeEnv{thermoextensiveplain}
1437 % \DescribeEnv{thermoextensivesuperscript}
1438 % \DescribeEnv{thermointensivelowercase}
1439 % \restoremarginparsize
1440 % It is possible to change notation locally, though there are very, very few
1441 % good reasons why you would want to do this in a regular document---normally,
1442 % one would use the corresponding package options. The environment
1443 % \env{thermointensiveplain} means \cs{St} will become $\St$ and \cs{Sm} will
1444 % become $\Sm$ in the text. Similarly, inside \env{thermoextensiveplain},
1445 % \cs{St} will become $S$ and \cs{Sm} will become $\St$.
1446 % Inside \env{thermoextensivesuperscript}, \cs{St} will become $S^t$ and
1447 % \cs{Sm} will be $S$; and inside \env{thermointensivesubscript},
1448 % \cs{St} will be $S$ and \cs{Sm} will be $s$.
1449 %
1450 % \subsubsection{Options Affecting Partial Molar Properties}
1451 % There are two options that change how partial molar properties are typeset.
1452 % For option |longpm| (the default), the subscript and superscript are
1453 % considered part of the symbol, producing something like $\HEpm_i$.
1454 % The option |shortpm| makes it display as
1455 % \begin{thermoshortpm}
1456 % $\HEpm_i$.
1457 % \end{thermoshortpm}
1458 % The |shortpm| option is the default for several textbook-related options.
1459 %
1460 % \DescribeEnv{thermolongpm}
1461 % \DescribeEnv{thermoshortpm}
1462 % It is possible to change partial molar notation locally---this could be
1463 % useful if you have a very, very long superscript or subscript and the
1464 % default option looks silly, say. The environment \env{thermolongpm} sets
1465 % the style equivalent to the |longpm| option, while the \env{thermoshortpm}
1466 % environment sets the local style equivalent to the |shortpm| option.
1467 % For example,
1468 % \begin{verbatim}
1469 % \[ \Spm_i = \Spm_i^\IGM + \SRpm_i
1470 % \begin{thermoshortpm}
1471 % = \Spm_i^\IGM + \SRpm_i
1472 % \end{thermoshortpm} \]
1473 %\end{verbatim}
1474 % produces
1475 % \[ \Spm_i = \Spm_i^\IGM + \SRpm_i
1476 % \begin{thermoshortpm}
1477 % = \Spm_i^\IGM + \SRpm_i,
1478 % \end{thermoshortpm} \]
1479 % assuming the default options are loaded.
1480 %
1481 % \subsubsection{Options Affecting Partial Derivatives}
1482 % There are several options that change how partial derivatives are rendered.
1483 % First are the options that affect the delimiters. We will use the following
1484 % code as an example:
1485 % \begin{verbatim}
1486 % \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
1487 % = \PartialMixSecond{\Gm}{P}{T}{}
1488 % = -\Partial{\Sm}{P}{T}. \]
1489 %\end{verbatim}
1490 % Using the |parentheses| option (the default), this gives
1491 % \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
1492 % = \PartialMixSecond{\Gm}{P}{T}{}
1493 % = -\Partial{\Sm}{P}{T}. \]
1494 % The option |brackets| changes the output to
1495 % \begin{thermobrackets}
1496 % \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
1497 % = \PartialMixSecond{\Gm}{P}{T}{}
1498 % = -\Partial{\Sm}{P}{T}. \]
1499 % \end{thermobrackets}\relax
1500 % The option \verb"bar" changes the output to
1501 % \begin{thermobar}
1502 % \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
1503 % = \PartialMixSecond{\Gm}{P}{T}{}
1504 % = -\Partial{\Sm}{P}{T}. \]
1505 % \end{thermobar}\relax
1506 % The option \verb"plain-derivatives" eliminates all delimiters; this forces
1507 % the \verb"nosubscripts" option. The output in this case is
1508 % \begin{thermoplain}%
1509 % \[ \Partial*{\Vm}{T}{P} = \PartialMixSecond{\Gm}{T}{P}{}
1510 % = \PartialMixSecond{\Gm}{P}{T}{}
1511 % = -\Partial{\Sm}{P}{T}. \]
1512 % \end{thermoplain}\relax
1513 % Accompanying the \verb"plain-derivatives" option is the \verb"nosubscripts"
1514 % option, which overrides the default option \verb"subscripts". This option
1515 % makes partial derivatives such as
1516 % \[ \begin{thermosubscripts}
1517 % \Partial{\Vm}{P}{T} \qquad \text{(\texttt{subscripts} option)},
1518 % \end{thermosubscripts}\relax \]
1519 % and instead renders them
1520 % \[ \begin{thermoNOsubscripts}
1521 % \Partial{\Vm}{P}{T} \qquad \text{(\texttt{nosubscripts} option)}.
1522 % \end{thermoNOsubscripts} \]
1523 % Combined with \verb"plain-derivatives", this would give
1524 % \[ \begin{thermoplain}
1525 % \Partial{\Vm}{P}{T} \qquad \text{(\texttt{nosubscripts} and
1526 % \texttt{plain-derivatives} options)}.
1527 % \end{thermoplain} \]
1528 % The variables are sorted into an order defined by an internal constant,
1529 % meaning $T$ will always be listed before $P$. The order by default is in
1530 % the order that terms appear in the fundamental equations, that is,
1531 % \begin{gather*}
1532 % d\Ut = T \,d\St - P \,d\Vt + \mu \,d\Nt \\
1533 % d\Ht = T \,d\St + \Vt \,dP + \mu \,d\Nt \\
1534 % d\Ft = -\St\,dT - P \,d\Vt + \mu \,d\Nt \\
1535 % \vdots \\
1536 % d\Lt = -\St\,dT - P \,d\Vt - \Nt\,d\mu,
1537 % \end{gather*}
1538 % with the exception that subscripted variables are (currently) not sortable.
1539 % If \verb"\Nt_i" or some similar construct appears as a variable and
1540 % \verb"\allNsbut{i}" appears in the held-constant list, the package will
1541 % assume that the argument list \emph{should} contain all of the mole numbers.
1542 % Symbols without subscripts that are not in the fundamental equation or one of
1543 % its variants are sorted in alphabetical order.
1544 %
1545 % \DescribeEnv{thermoparentheses}
1546 % \DescribeEnv{thermobrackets}
1547 % \DescribeEnv{thermobraces}
1548 % \DescribeEnv{thermobar}
1549 % \DescribeEnv{thermoplain}
1550 % If you want to use parentheses \emph{locally}, even though your overall
1551 % document uses another delimiter, the \env{thermoparentheses} environment will
1552 % do that. Similarly, \env{thermobrackets} will temporarily switch to brackets,
1553 % \env{thermobar} will temporarily switch to a tailing vertical bar, and
1554 % \env{thermoplain} will remove delimiters altogether.
1555 %
1556 % \DescribeEnv{thermosubscripts}
1557 % \DescribeEnv{thermoNOsubscripts}
1558 % The environments \env{thermosubscripts} and \env{thermoNOsubscripts}
1559 % force the use or disuse of subscripts, respectively.
1560 %
1561 % \subsubsection{Options Regarding the Number of Moles}
1562 % \DescribeMacro{\allNs}%
1563 % \DescribeMacro{\allNsbut}%
1564 % The default option \verb"moles-index" defines the macro \cs{allNs} to expand
1565 % to $\allNs$ and the macro \verb"\allNsbut{i}" to expand to $\allNsbut{i}$.
1566 % You can change the dummy index: \verb"\allNsbut[k]{i}" expands to
1567 % $\allNsbut[k]{i}$ by default. This is typically not necessary, however: if
1568 % you type \verb"\allNsbut{j}", the package will figure out that you want
1569 % $\allNsbut{j}$ rather than $\Nt_{j\neq j}$. The time to use the optional
1570 % argument is in situations such as
1571 % \[ \Partial{\mu_j}{\Nt_k}{\allNsbut[i]{k}}, \]
1572 % which is incorrect if the dummy index $j$ is used in place of the $i$.
1573 %
1574 % You can change these to expand to ranges using the \verb"moles-range"
1575 % option, which renders \cs{allNs} as
1576 % $\begin{thermomolesrange}\allNs\end{thermomolesrange}$ and
1577 % \verb"\allNsbut{i}" as
1578 % $\begin{thermomolesrange}\allNsbut{i}\end{thermomolesrange}.$
1579 % The optional argument is ignored in this set of notation. Examples of these
1580 % options are shown in Table~\ref{table:allNs}.
1581 %
1582 % \DescribeEnv{thermomolesrange}
1583 % The environment \env{thermomolesrange} temporarily redefines \cs{allNs} and
1584 % other range-oriented macros as though the |moles-range| package option had
1585 % been invoked.
1586 %
1587 % \DescribeMacro{\ncomponents}%
1588 % You can change the symbol for the number of components (default: $C$) by
1589 % redefining the macro \cs{ncomponents}. This is done for you by some package
1590 % options that define notation for particular textbooks.
1591 %
1592 % \begin{table}
1593 % \caption{Illustration of the \texttt{moles-index} and \texttt{moles-range}
1594 % options and their effects on \cs{allNs} and \cs{allNsbut}.}
1595 % \label{table:allNs}
1596 %^^A TODO The \leavevmode macro here is to prevent white space from building
1597 %^^A up due to a bug in old versions of hypdoc. It should be harmless to
1598 %^^A leave it in there, but consider removing it at some point.
1599 % \leavevmode
1600 % \SpecialMacroIndex{\allNs}\relax
1601 % \SpecialMacroIndex{\allNsbut}\relax
1602 % \SpecialMacroIndex{\allXs}\relax
1603 % \SpecialMacroIndex{\allXsbut}\relax
1604 % \centering
1605 % \begin{minipage}{4.49in}\renewcommand*{\footnoterule}{\vskip-1.5ex}%
1606 % \small
1607 % \begin{tabular}{l l l}
1608 % \toprule
1609 % Macro\footnote{You may use $C$ directly instead of \cs{ncomponents}
1610 % here, but then it will not change to another symbol if you want to
1611 % switch to an option that redefines \cs{ncomponents} later.}
1612 % & \verb"moles-index" & \verb"moles-range" \\
1613 % \midrule
1614 % \verb"\allNs" & $\allNs$
1615 % & $\begin{thermomolesrange}\allNs\end{thermomolesrange}$ \\
1616 % \verb"\allNsbut{1}" & $\allNsbut{1}$
1617 % & $\begin{thermomolesrange}\allNsbut{1}\end{thermomolesrange}$ \\
1618 % \verb"\allNsbut{i}" & $\allNsbut{i}$
1619 % & $\begin{thermomolesrange}\allNsbut{i}\end{thermomolesrange}$ \\
1620 % \verb"\allNsbut{j}" & $\allNsbut{j}$
1621 % & $\begin{thermomolesrange}\allNsbut{j}\end{thermomolesrange}$ \\
1622 % \verb"\allNsbut{\ncomponents}" & $\allNsbut{\ncomponents}$
1623 % & $\begin{thermomolesrange}\allNsbut{\ncomponents}\end{thermomolesrange}$\\
1624 % \verb"\allNsbut[k]{i}" & $\allNsbut[k]{i}$
1625 % & $\begin{thermomolesrange}\allNsbut[k]{i}\end{thermomolesrange}$\\
1626 % \verb"\allXs" & $\allXs$
1627 % & $\begin{thermomolesrange}\allXs\end{thermomolesrange}$ \\
1628 % \verb"\allXsbut{1}" & $\allXsbut{1}$
1629 % & $\begin{thermomolesrange}\allXsbut{1}\end{thermomolesrange}$ \\
1630 % \verb"\allXsbut{i}" & $\allXsbut{i}$
1631 % & $\begin{thermomolesrange}\allXsbut{i}\end{thermomolesrange}$ \\
1632 % \verb"\allXsbut{j}" & $\allXsbut{j}$
1633 % & $\begin{thermomolesrange}\allXsbut{j}\end{thermomolesrange}$ \\
1634 % \verb"\allXsbut{\ncomponents-1}" & $\allXsbut{\ncomponents-1}$
1635 % & $\begin{thermomolesrange}\allXsbut{\ncomponents-1}
1636 % \end{thermomolesrange}$ \\
1637 % \verb"\allXsbut[k]{\ncomponents-1}" & $\allXsbut[k]{\ncomponents-1}$
1638 % & $\begin{thermomolesrange}\allXsbut[k]{\ncomponents-1}
1639 % \end{thermomolesrange}$ \\
1640 % \verb"\allXsbut{\ncomponents}"\footnote{This would typically be used
1641 % to denote something like
1642 % \( \begin{thermomolesrange}
1643 % \Gt(T,P,\Nt,\allXsbut{\ncomponents})
1644 % \end{thermomolesrange}
1645 % \) rather than in a subscript, but it looks silly if we do not
1646 % handle this case this way.}
1647 % & $\allXsbut{\ncomponents}$
1648 % & $\begin{thermomolesrange}\allXsbut{\ncomponents}
1649 % \end{thermomolesrange}$ \\
1650 % \bottomrule
1651 % \end{tabular}
1652 % \end{minipage}
1653 % \end{table}
1654 %
1655 % \subsubsection{Other Options}
1656 % \DescribeMacro{\dbar}%
1657 % The default for path-dependent one-forms (often called ``inexact
1658 % differentials'') is \cs{dbar}, which looks like $\dbar$. This can be changed,
1659 % if desired, to a delta ($\delta$) with the \verb"delta" option to the
1660 % package.
1661 %
1662 % It should be noted that the \cs{dbar} macro is context-dependent: changing
1663 % the typeface to something not supported will probably ruin it, as the kerning
1664 % is very font-specific. This package currently supports Computer Modern,
1665 % Times, Palatino, Bitstream Charter, Garamond, and Utopia, but other typefaces
1666 % may require a manual redefinition.
1667 %
1668 % \subsubsection{Options for Particular Textbooks} \label{sec:textbooks}
1669 % There are several options that load package options and/or redefine
1670 % particular commands to match the notation in a particular textbook.
1671 % A table showing how various properties are typeset using each of these
1672 % packages is included in Appendix~\ref{sec:symbols}.
1673 % So far, the following textbooks are supported:
1674 % \begin{description}
1675 % \item[Bejan] Notation used by Bejan, \emph{Advanced Engineering
1676 % Thermodynamics}, Third Edition. Wiley: Hoboken, 2006.
1677 % \item[CBK] Notation used by \c Cengel, Boles, and Kano\u glu,
1678 % \emph{Thermodynamics: An Engineering Approach}, Ninth Edition.
1679 % McGraw Hill: Singapore, 2020. Their symbols for specific and
1680 % total volume, which appear to be from the font ITC Benguiat Gothic (and
1681 % reasonably approximated by Krub Italic), are not directly
1682 % supported.\footnote{%
1683 % \providecommand*{\XeTeX}{X\kern-0.125em \lower 0.5ex
1684 % \hbox{\reflectbox{\hbox{E}}}\kern-0.125em \TeX}
1685 % If you have ITC Benguiat Gothic installed and want to use it for the
1686 % volume symbol, you can use it through \XeTeX; try this:\\
1687 % \texttt{\textbackslash usepackage\{fontspec\}} \\
1688 % \texttt{\textbackslash setsansfont\{ITC Benguiat Gothic\}} \\
1689 % \texttt{\textbackslash ExplSyntaxOn} \\
1690 % \texttt{\mbox{}~~\textbackslash tl\_gset:Nn
1691 % \textbackslash g\_\_thermodynamics\_volume\_symbol
1692 % \{\{\textbackslash text\{\textbackslash
1693 % sffamily V\}\}\}} \\
1694 % \texttt{\textbackslash ExplSyntaxOff}
1695 % \label{fn:XeTeX}}
1696 % \item[ElliottLira] Notation used by Elliott and Lira, \emph{Introductory
1697 % Chemical Engineering Thermodynamics}, Second Edition. Prentice Hall:
1698 % Upper Saddle River, 2012. \emph{Note: these authors use
1699 % Henry's Law (molal basis) in the form \(y_i P = m_i/K_{H,i}\), which is
1700 % inconsistent with their notation for the rational basis, so that macro
1701 % is left set to its default.}
1702 % \item[KlotzRosenberg] Notation used by Klotz and Rosenberg, \emph{Chemical
1703 % Thermodynamics: Basic Concepts and Methods}, Seventh Edition.
1704 % Wiley: Hoboken, 2008.
1705 % \item[Koretsky] Notation used by Koretsky, \emph{Engineering and Chemical
1706 % Thermodynamics}, Second Edition. Wiley: New Caledonia, 2013.
1707 % \item[ModellReid] Alias for \verb"TesterModell" (the first and second
1708 % editions were by Modell and Reid; Reid died prior to the third edition).
1709 % \item[MSBB] Notation used by Moran, Shapiro, Boettner, and Bailey,
1710 % \emph{Fundamentals of Engineering Thermodynamics}, Eighth Edition.
1711 % Wiley: Kendallville, 2014.
1712 % \item[Prausnitz] Notation used by Prausnitz, Lichtenthaler, and de Azevedo,
1713 % \emph{Molecular Thermodynamics of Fluid-Phase Equilibria}, Third Edition,
1714 % Pearson, 1998.
1715 % \item[Sandler] Notation used by Sandler, \emph{Chemical, Biochemical, and
1716 % Engineering Thermodynamics}, Fifth Edition. Wiley: Hoboken, 2017.
1717 % \item[SVNAS] Notation used by Smith, Van Ness, Abbott, and Swihart,
1718 % \emph{Introduction to Chemical Engineering Thermodynamics}, Ninth
1719 % Edition. McGraw-Hill: Boston, 2021.
1720 % \item[TesterModell] Notation used by Tester and Modell,
1721 % \emph{Thermodynamics and Its Applications}, Third Edition, Prentice Hall:
1722 % Upper Saddle River, 1997.
1723 % \item[Thompson] Notation used by Thompson, \emph{A Unified Introduction to
1724 % Chemical Engineering Thermodynamics}, Stillwater Press: Orono, 2000.
1725 % Note that he uses $c$, $\mathrm{c}$, $n_C$, and $\mathrm{n}$ for the
1726 % number of components in various places in the book; I chose $c$ for the
1727 % definition of \cs{ncomponents}, but it is impossible to be completely
1728 % consistent with his notation.
1729 % \end{description}
1730 % There may well be some inconsistencies between the notation in these books
1731 % and the symbols used here. I will fix such inconsistencies as I become aware
1732 % of them.
1733 %
1734 % \textbf{Important}: Some textbooks use symbols other than \(\mu\) for
1735 % chemical potential and \(\gamma\) for activity coefficients. For example,
1736 % |KlotzRosenberg| uses $\muup$ for the chemical potential and $\gammaup$
1737 % for the activity coefficient. In such cases,
1738 % the macro \verb"\mu" will produce whatever symbol \emph{is} used for the
1739 % chemical potential, and \verb"\gamma" will produce the activity coefficient.
1740 % The original symbols will still be available as \cs{gammait} and \cs{muit},
1741 % respectively.
1742 %
1743 % \appendix
1744 % \section{Notation Across Textbooks} \label{sec:symbols}
1745 % \changes{v2.02}{2024/06/14}{Improved consistency of package options for
1746 % textbooks and added a table of symbols organized by textbook option.}
1747 % Some of the textbooks supported by this package use multiple symbols for the
1748 % same quantity---for example, Sandler's textbook uses both \(P^\text{sat}\)
1749 % and \(P^\text{vap}\) for vapor (saturation) pressure, and Elliott and Lira
1750 % use both \(\Delta H^\circ\) and \(\Delta H_R^o\) for the standard enthalpy
1751 % of reaction. This package may only support one of the two in such cases.
1752 %
1753 % Table~\ref{table:textbooks} gives a description of each symbol supported
1754 % by the package, the corresponding command, and the way that command is
1755 % rendered using each of the textbook-related options in
1756 % Section~\ref{sec:textbooks}. Packages consisting of two names are shortened
1757 % to one name in the headers for space considerations.
1758 %
1759 % \NewDocumentCommand{\inherit}{m}{\textcolor{gray}{#1}}
1760 % \begin{landscape}\scriptsize
1761 % \tablehead{%
1762 % \toprule
1763 % Quantity & Macro & Default & Bejan & CBK & Elliott & Klotz
1764 % & Koretsky & MSBB & Prausnitz & Sandler & SVNAS & Modell & Thompson \\
1765 % \midrule
1766 % }
1767 % \tabletail{%
1768 % \midrule\multicolumn{13}{l}{\emph{continued on next page\dots}} \\
1769 % }
1770 % \tablelasttail{\bottomrule}
1771 % \tablecaption{How symbols are typeset for various textbooks.
1772 % Entries in \inherit{gray} indicate quantities that are not directly or
1773 % indirectly defined in a particular textbook and are therefore inherited
1774 % from the defaults.
1775 % \emph{Note: Options with two authors, such as \texttt{ElliottLira},
1776 % only include one name so as to fit on one page.}
1777 % \label{table:textbooks}}
1778 % \setlength{\extrarowheight}{3.5pt}%
1779 % \begin{mpsupertabular}{l l l l l l l l l l l l l l}
1780 % \# components & \verb"\ncomponents" & $\ncomponents$ & $n$ & $\inherit{\ncomponents}$ & $\inherit{\ncomponents}$ & $\inherit{\ncomponents}$ & $m$ & $\inherit{\ncomponents}$ & $m$ & $\mathcal{C}$ & $\inherit{\ncomponents}$ & $n$ & $c$ \\
1781 % activity (absolute) & \verb"\actabs_i" & $\actabs_i$ & $\inherit{\lambda_i}$ & $\inherit{\actabs_i}$ & $\inherit{\actabs_i}$ & $\inherit{\lambda_i}$ & $\inherit{\lambda_i}$ & $\inherit{\actabs_i}$ & $\inherit{\actabs_i}$ & $\inherit{\actabs_i}$ & $\inherit{\actabs_i}$ & $\inherit{\actabs_i}$ & $\inherit{\actabs_i}$ \\
1782 % activity (relative) & \verb"\actrel_i" & $\actrel_i$ & $\inherit{\actrel_i}$ & $\inherit{\actrel_i}$ & $a_i$ & $a_i$ & $\inherit{a_i}$ & $\inherit{\actrel_i}$ & $\mathdutchcal{a}_i$\relax
1783 % \footnote{The symbol $\mathdutchcal{a}$ requires the |dutchcal| fonts to be installed,
1784 % though the package itself is not loaded. This symbol is an approximation to the one
1785 % the book actually uses.} & $a_i$ & $a_i$ & $a_i$ & $\widehat a_i$ \\
1786 % activity coefficient (ordinary) & \verb"\gamma_i" & $\gamma_i$ & $\inherit{\gamma_i}$ & $\inherit{\gamma_i}$ & $\gamma_i$ & $\gammaup_i$ & $\gamma_i$ & $\inherit{\gamma_i}$ & $\gamma_i$ & $\gamma_i$ & $\gamma_i$ & $\gammaup_i$ & $\gamma_i$ \\
1787 % activity coefficient (Henry, rational) & \verb"\gammarat_i" & $\gammarat_i$ & $\inherit{\gammarat_i}$ & $\inherit{\gammarat_i}$ & $\gamma_i^\ast$ & $\gammaup_i$ & $\gamma_i^\text{Henry's}$ & $\inherit{\gammarat_i}$ & $\inherit{\gammarat_i}$ & $\gamma_i^\ast$ & $\inherit{\gammarat_i}$ & $\gammaup_i^{\ast\ast}$ & $\inherit{\gammarat_i}$ \\
1788 % activity coefficient (Henry, molal) & \verb"\gammamol_i" & $\gammamol_i$ & $\inherit{\gammamol_i}$ & $\inherit{\gammamol_i}$ & $\gamma_i^\square$ & $\gammaup_i$ & $\gamma_i^m$ & $\inherit{\gammamol_i}$ & $\inherit{\gammamol_i}$ & $\gamma_i^\square$ & $\gammarat_i$ & $\gammaup_i^\ast$ & $\inherit{\gammamol_i}$ \\
1789 % adiabatic compressibility & \multicolumn{13}{l}{\emph{See} isentropic compressibility} \\
1790 % adiabatic expansivity & \multicolumn{13}{l}{\emph{See} isentropic expansivity} \\
1791 % area (total) & \verb"\At" & $\At$ & $A$ & $A$ & $\inherit{\At}$ & $\inherit{a}$ & $A$ & $A$ & $\inherit{A}$ & $\inherit{a}$ & $\inherit{a^t}$ & {\large$\underline{a}$} & $\inherit{\mkern2mu\underline{\mkern-2mu\mathcal{A}\mkern-2mu}\mkern2mu}$ \\
1792 % chemical potential & \verb"\mu" & $\mu$ & $\mu$ & $\mu$ & $\mu$ & $\muup$ & $\mu$ & $\mu$ & $\mu$ & $\mu$ & $\mu$ & $\muup$ & $\mu$ \\
1793 % electric potential & \verb"\Epot" & $\Epot$ & $\inherit{\Epot}$ & $\inherit{\Epot}$ & $E$ & $\emf$\footnote{The
1794 % symbol $\emf$ requires the \pkg{emf} package. If that package is not
1795 % loaded, $\mathcal{E}$ is used instead.\label{fn:emf}}
1796 % & $E$ & $\inherit{\Epot}$ & $\emf$\footref{fn:emf} & $E$ & $E$ & $\exists$ & $E$ \\
1797 % electric potential (standard) & \verb"\Epot^\std" & $\Epot^\std$ & $\inherit{\Epot^\std}$ & $\inherit{\Epot^\std}$ & $E^\circ$ & $\emf^\circ$ & $E^o$ & $\inherit{\Epot^\std}$ & $\emf^0$ & $\inherit{E^\circ}$ & $E^\circ$ & $\exists^o$ & $E^\circ$ \\
1798 % energy (total) & \verb"\Et" & $\Et$ & $E$ & $E$ & $\inherit{\Et}$ & $\inherit{E}$ & $E$ & $E$ & $E$ & $\inherit{E}$ & $\inherit{E^t}$ & $\Et$ & $\inherit{\Et}$ \\
1799 % energy (molar) & \verb"\Em" & $\Em$ & $\overline{e}$ & $\overline{e}$ & $\inherit{\Em}$ & $\inherit{E_{\textrm{m}}}$ & $e$ & $\overline{e}$ & $\inherit{e}$ & \begin{thermoextensiveplain}$\inherit{\Em}$\end{thermoextensiveplain} & $\inherit{E}$ & $\Em$ & $\inherit{\Em}$ \\
1800 % energy (specific) & \verb"\Es" & $\Es$ & $e$ & $e$ & $\inherit{E}$ & $\inherit{\hat E}$ & $\hat e$ & $e$ & $\inherit{\hat e}$ & $\hat E$ & $\inherit{E}$ & $\Es$ & $\inherit{\Em}$ \\
1801 % enthalpy (total) & \verb"\Ht" & $\Ht$ & $H$ & $H$ & $\Ht$ & $H$ & $H$ & $H$ & $H$ & $H$ & $H^t$ & $\Ht$ & $\Ht$ \\
1802 % enthalpy (molar) & \verb"\Hm" & $\Hm$ & $\overline{h}$ & $\overline{h}$ & $H$ & $H_{\textrm{m}}$ & $h$ & $\overline{h}$ & $h$ & \begin{thermoextensiveplain}$\Hm$\end{thermoextensiveplain} & $H$ & $\Hm$ & $\Hm$ \\
1803 % enthalpy (specific) & \verb"\Hs" & $\Hs$ & $h$ & $h$ & $H$ & $\inherit{\Hs}$ & $\hat h$ & $h$ & $\inherit{\hat h}$ & $\hat H$ & $H$ & $\Hs$ & $\inherit{\Hs}$ \\
1804 % enthalpy (partial molar) of $i$ & \verb"\Hpm_i" & $\Hpm_i$ & $\inherit{\overline{h}_i}$ & $\widetilde{h}_i$ & $\overline{H}_i$ & $H_{\mathrm{m}i}$ & $\overline{H}_i$ & $\Hpm_i$ & $\overline{h}_i$ & \begin{thermoshortpm}$\Hpm_i$\end{thermoshortpm} & $\overline{H}_i$ & $\Hpm_i$ & $\Hpm_i$ \\
1805 % enthalpy of reaction & \verb"\Deltarxn\Hm" & $\Deltarxn\Hm$ & $\inherit{\Delta\overline{h}_\text{rxn}}$ & $\overline{h}_R$ & $\Delta H$ & $\Delta H_{\mathrm{m}}$ & $\Delta h_\text{rxn}$ & $\inherit{\Delta\overline{h}_\text{rxn}}$ & $\inherit{\Delta h_\text{rxn}}$ & \begin{thermoextensiveplain}$\Delta_{\text{rxn}}\Hm$\end{thermoextensiveplain} & $\Delta H$ & $\Delta H_{rx}$ & $\Delta H_R$ \\
1806 % enthalpy of fusion & \verb"\Deltafus\Hm" & $\Deltafus\Hm$ & $\overline{h}_{sf}$ & $\overline{h}_{sf}$ & $\Delta H^{fus}$ & $\Delta H_{\mathrm{m}}$ & $\Delta h_\text{fus}$ & $\inherit{\overline{h}^\text{fus}}$ & $\inherit{\Delta h^\text{fus}}$ & \begin{thermoextensiveplain}$\Delta_\text{fus}\Hm$\end{thermoextensiveplain} & $\Delta H^{sl}$ & $\inherit{\Deltafus H}$ & $\Delta H^{SL}$ \\
1807 % enthalpy of vaporization & \verb"\Deltavap\Hm" & $\Deltavap\Hm$ & $\overline{h}_{sf}$ & $\overline{h}_{fg}$ & $\Delta H^{vap}$ & $\Delta H_{\mathrm{m}}$ & $\Delta h_\text{vap}$ & $\inherit{\overline{h}^\text{vap}}$ & $\inherit{\Delta h^\text{vap}}$ & \begin{thermoextensiveplain}$\Delta_\text{vap}\Hm$\end{thermoextensiveplain} & $\Delta H^{vl}$ & $\inherit{\Deltavap H}$ & $\Delta H^{LV}$ \\
1808 % enthalpy of sublimation & \verb"\Deltasub\Hm" & $\Deltasub\Hm$ & $\overline{h}_{sg}$ & $\overline{h}_{sg}$ & $\inherit{\Delta H^{sub}}$ & $\Delta H_{\mathrm{m}}$ & $\Delta h_\text{sub}$ & $\inherit{\overline{h}^\text{sub}}$ & $\inherit{\Delta h^\text{sub}}$ & $\Delta_\text{sub}\Ht$ & $\Delta H^{vs}$ & $\inherit{\Deltasub H}$ & $\inherit{\Delta H^{SV}}$ \\
1809 % entropy (total) & \verb"\St" & $\St$ & $S$ & $S$ & $\St$ & $S$ & $S$ & $S$ & $S$ & $S$ & $S^t$ & $\St$ & $\St$ \\
1810 % entropy (molar) & \verb"\Sm" & $\Sm$ & $\overline{s}$ & $\overline{s}$ & $S$ & $S_{\mathrm{m}}$ & $s$ & $\overline{s}$ & $s$ & $\St$ & $S$ & $S$ & $S$ \\
1811 % entropy (specific) & \verb"\Ss" & $\Ss$ & $s$ & $s$ & $S$ & $\inherit{\Ss}$ & $\hat s$ & $s$ & $\inherit{\hat s}$ & $\hat S$ & $S$ & $\hat S$ & $\inherit{\Ss}$ \\
1812 % entropy (partial molar) of $i$ & \verb"\Spm_i" & $\Spm_i$ & $\overline{S}_i$ & $\widetilde{s}_i$ & $\overline{S}_i$ & $S_{\mathrm{m}i}$ & $\overline{S}_i$ & $\Spm_i$ & $\overline{s}_i$ & \begin{thermoshortpm}$\Spm_i$\end{thermoshortpm} & $\overline{S}_i$ & $\Spm_i$ & $\Spm_i$ \\
1813 % extent of reaction & \verb"\xrxn" & $\xrxn$ & $\zeta$ & $\inherit{\xrxn}$ & $\xi$ & $\xiup$ & $\xi$ & $\varepsilon$ & $\inherit{\xi}$ & $X$ & $\varepsilon$ & $\xiup$ & $\xi$ \\
1814 % fugacity of pure substance & \verb"\fpure" & $\fpure$ & $f$ & $\inherit{\fpure}$ & $f$ & $f$ & $f$ & $f$ & $f_\text{pure}$ & $f$ & $f$ & $f$ & $f$ \\
1815 % fugacity of pure $i$ & \verb"\fpure_i" & $\fpure_i$ & $\inherit{f_i^\bullet}$ & $\inherit{\fpure_i}$ & $f_i$ & $f_i^\bullet$ & $f_i$ & $f_i$ & $f_{\text{pure}\,i}$ & $f_i$ & $f_i$ & $f_i$ & $f_i^\bullet$ \\
1816 % fugacity of $i$ in mixture & \verb"\fmix_i" & $\fmix_i$ & $f_i$ & $\inherit{\fmix_i}$ & $\hat f_i$ & $f_i$ & $\hat f_i$ & $\bar f_i$ & $f_i$ & $\bar f_i$ & $\hat f_i$ & $\hat f_i$ & $\widehat{f}_i$ \\
1817 % fugacity at saturation & \verb"\fsat" & $\fsat$ & $\inherit{f^\sat}$ & $\inherit{\fsat}$ & $f^{sat}$ & $\inherit{f^\text{sat}}$ & $\inherit{f^\text{sat}}$ & $\inherit{f^\text{sat}}$ & $f^s_\text{pure}$ & $f^\text{sat}$ & $f^\text{sat}$ & $\inherit{\fsat}$ & $f^\text{sat}$ \\
1818 % fugacity coefficient of pure substance & \verb"\phipure" & $\phipure$ & $\inherit{\phi}$ & $\inherit{\phipure}$ & $\phi$ & $\gamma$ & $\varphi$ & $\inherit{\phi}$ & $\varphi_{\text{pure}}$ & $\phi$ & $\phi$ & $\phiup$ & $\phi$ \\
1819 % fugacity coefficient of pure $i$ & \verb"\phipure_i" & $\phipure_i$ & $\inherit{\phi_i^\bullet}$ & $\inherit{\phipure_i}$ & $\phi_i$ & $\gamma_i^\bullet$ & $\varphi_i$ & $\inherit{\phi_i}$ & $\varphi_{\text{pure}\,i}$ & $\phi_i$ & $\phi_i$ & $\phiup_i$ & $\phi_i^\bullet$ \\
1820 % fugacity coefficient of $i$ in mixture & \verb"\phimix_i" & $\phimix_i$ & $\inherit{\phi_i}$ & $\inherit{\phimix_i}$ & $\hat\phi_i$ & $\gamma_i$ & $\hat\varphi_i$ & $\bar\phi_i$ & $\varphi_i$ & $\bar\phi_i$ & $\hat\phi_i$ & $\hat\phiup_i$ & $\widehat{\phi}_i$ \\
1821 % fugacity coefficient at saturation & \verb"\phisat" & $\phisat$ & $\inherit{\phisat}$ & $\inherit{\phisat}$ & $\phi^{sat}$ & $\inherit{\gamma^\text{sat}}$ & $\varphi^\text{sat}$ & $\inherit{\phi^\text{sat}}$ & $\varphi^s$ & $\phi^\text{sat}$ & $\phi^\text{sat}$ & $\inherit{\phiup^\sat}$ & $\phi^\text{sat}$ \\
1822 % Gibbs free energy (total) & \verb"\Gt" & $\Gt$ & $G$ & $G$ & $\Gt$ & $G$ & $G$ & $G$ & $G$ & $G$ & $G^t$ & $\Gt$ & $\Gt$ \\
1823 % Gibbs free energy (molar) & \verb"\Gm" & $\Gm$ & $\overline{g}$ & $\overline{g}$ & $G$ & $G_{\mathrm{m}}$ & $g$ & $\overline{g}$ & $g$ & $\Gt$ & $G$ & $G$ & $G$ \\
1824 % Gibbs free energy (specific) & \verb"\Gs" & $\Gs$ & $g$ & $g$ & $G$ & $\inherit{\Gs}$ & $\hat g$ & $g$ & $\inherit{\hat g}$ & $\hat G$ & $G$ & $\Gs$ & $\inherit{\Gs}$ \\
1825 % Gibbs free energy (partial molar) & \verb"\Gpm_i" & $\Gpm_i$ & $\overline{G}_i$ & $\widetilde{g}_i$ & $\Gpm_i$ & $G_{\mathrm{m}i}$ & $\overline{G}_i$ & $\Gpm_i$ & $\partialmolar{g}_i$ & \begin{thermoshortpm}$\Gpm_i$\end{thermoshortpm} & $\Gpm_i$ & $\Gpm_i$ & $\partialmolar{G}_i$ \\
1826 % Gibbs free energy of mixing & \verb"\Deltamix\Gt" & $\Deltamix\Gt$ & $\inherit{\Deltamix G}$ & $\inherit{\Deltamix G}$ & $\Delta\Gt_\text{mix}$ & $\Delta G_\text{mix}$ & $\Delta G_\text{mix}$ & $\inherit{\Deltamix G}$ & $\Delta G_\text{mixing}$ & $\Delta_\text{mix}G$ & $\Delta G^t$ & $\Deltamix\Gt$ & $\Delta_{MIX}\Gt$ \\
1827 % Gibbs free energy of reaction & \verb"\Deltarxn\Gm" & $\Deltarxn\Gm$ & $\inherit{\Deltarxn{\bar{g}}}$ & $\overline{g}_R$ & $\Delta G$ & $\Delta G_{\mathrm{m}}$ & $\Delta g_\text{rxn}$ & $\inherit{\Deltarxn{\overline{g}}}$ & $\inherit{\Delta g_\text{rxn}}$ & $\Delta_\text{rxn}\Gt$ & $\Delta G$ & $\Delta G_{rx}$ & $\Delta G_R$ \\
1828 % grand potential (total) & \verb"\Lt" & $\Lt$ & $F_\mu$ & $\inherit{\Omega}$ & $\inherit{\Lt}$ & $\inherit{\Omega}$ & $\inherit{\Omega}$ & $\inherit{\Omega}$ & $\inherit{\Omega}$ & $\inherit{\Omega}$ & $\inherit{\Lt}$ & $\inherit{\Lt}$ & $\inherit{\Lt}$ \\
1829 % grand potential (molar) & \verb"\Lm" & $\Lm$ & $\overline{f}_\mu$ & $\inherit{\overline{\omega}}$ & $\inherit{\Lm}$ & $\inherit{\Omega_{\mathrm{m}}}$ & $\inherit{\omega}$ & $\inherit{\overline{\omega}}$ & $\inherit{\omega}$ & $\inherit{\Lt}$ & $\inherit{\Lm}$ & $\inherit{\Lm}$ & $\inherit{\Lm}$ \\
1830 % grand potential (specific) & \verb"\Ls" & $\Ls$ & $f_\mu$ & $\inherit{\omega}$ & $\inherit{\Ls}$ & $\inherit{\Ls}$ & $\inherit{\hat\omega}$ & $\inherit{\omega}$ & $\inherit{\hat\omega}$ & $\inherit{\Ls}$ & $\inherit{\Lm}$ & $\inherit{\Ls}$ & $\inherit{\Ls}$ \\
1831 % heat (total) & \verb"\Qt" & $\Qt$ & $Q$ & $Q$ & $\Qt$ & $Q$ & $Q$ & $Q$ & $Q$ & $Q$ & $Q^t$ & $\inherit{\Qt}$ & $\inherit{\Qt}$ \\
1832 % heat (molar) & \verb"\Qm" & $\Qm$ & $\overline{q}$ & $\overline{q}$ & $Q$ & $\inherit{Q_{\mathrm{m}}}$ & $q$ & $\overline{q}$ & $\inherit{q}$ & $\inherit{\Qt}$ & $Q$ & $Q$ & $Q$ \\
1833 % heat (specific) & \verb"\Qs" & $\Qs$ & $q$ & $q$ & $Q$ & $\inherit{\Qs}$ & $\hat q$ & $q$ & $\inherit{\hat q}$ & $\inherit{\Qs}$ & $Q$ & $\inherit{\hat Q}$ & $\inherit{\Qs}$ \\
1834 % heat capacity (isobaric, total) & \verb"\cPt" & $\cPt$ & $C_P$ & $\inherit{C_p}$ & $\underline{C}_P$ & $C_P$ & $\inherit{C_P}$ & $\inherit{C_p}$ & $C_p$ & $NC_P$ & $nC_P$ & $\inherit{\underline{C}_p}$ & $\inherit{\cPt}$ \\
1835 % heat capacity (isobaric, molar) & \verb"\cP" & $\cP$ & $\overline{c}_P$ & $\overline{c}_p$ & $C_P$ & $C_{P\mathrm{m}}$ & $c_P$ & $\overline{c}_p$ & $c_p$ & $C_P$ & $C_P$ & $C_p$ & $C_P$ \\
1836 % heat capacity of $i$ (isobaric, molar) & \verb"\cP_i" & $\cP_i$ & $\overline{c}_{P,i}$ & $\overline{c}_{p,i}$ & $C_{P,i}$ & $C_{P\mathrm{m}i}^\bullet$ & $C_{P,i}$ & $\overline{c}_{p,i}$ & $c_{p\,i}$ & $C_{P,i}$ & ${C_P}_i$ & $C_{pi}$ & $C_{P,i}$ \\
1837 % heat capacity (isobaric, specific) & \verb"\cPs" & $\cPs$ & $c_P$ & $c_p$ & $C_P$ & $\inherit{\cPs}$ & $\hat c_P$ & $c_p$ & $\inherit{\hat c_p}$ & $\hat C_P$ & $C_P$ & $\inherit{\hat C_p}$ & $\inherit{\hat C_p}$ \\
1838 % heat capacity (isobaric, partial molar) & \verb"\cPpm_i" & $\cPpm_i$ & $\overline{c}_{P,i}$ & $\inherit{\widetilde{C}_{p,i}}$ & $\overline{C}_{P,i}$ & $C_{P\mathrm{m}i}$ & $\overline{C}_{P,i}$ & \begin{thermoshortpm}$\partialmolar{C}_{p,i}$\end{thermoshortpm} & $\inherit{\bar c_{p\,i}}$ & \begin{thermoshortpm}$\cPpm_i$\end{thermoshortpm} & ${\overline{C}_P}_i$ & $\overline{C}_{pi}$ & \begin{thermoshortpm}$\inherit{\cPpm_i}$\end{thermoshortpm} \\
1839 % heat capacity (isochoric, total) & \verb"\cVt" & $\cVt$ & $C_V$ & $\inherit{C_V}$\footref{fn:XeTeX} & $\underline{C}_V$ & $C_V$ & $C_V$ & $C_v$ & $C_v$ & $NC_V$ & $nC_V$ & $\inherit{\underline{C}_v}$ & $\inherit{\cVt}$ \\
1840 % heat capacity (isochoric, molar) & \verb"\cV" & $\cV$ & $\overline{c}_v$ & $\overline{c}_V$\footref{fn:XeTeX} & $C_V$ & $C_{V\mathrm{m}}$ & $c_V$ & $\overline c_v$ & $c_v$ & $C_V$ & $C_V$ & $C_v$ & $C_V$ \\
1841 % heat capacity (isochoric, specific) & \verb"\cVs" & $\cVs$ & $c_v$ & $c_V$\footref{fn:XeTeX} & $C_V$ & $\inherit{\cVs}$ & $\hat c_v$ & $c_v$ & $\inherit{\hat c_p}$ & $\hat C_V$ & $C_V$ & $\inherit{\hat C_v}$ & $\inherit{\cVs}$ \\
1842 % heat capacity (isochoric, partial molar) & \verb"\cVpm_i" & $\cVpm_i$ & $\overline{c}_{v,i}$ & $\widetilde{C}_{V,i}$\footref{fn:XeTeX} & $\overline{C}_{V,i}$ & $C_{V\mathrm{m}i}$ & $\overline{C}_V$ & \begin{thermoshortpm}$\partialmolar{C}_{v,i}$\end{thermoshortpm} & $\inherit{\bar c_{v\,i}}$ & \begin{thermoshortpm}$\cVpm_i$\end{thermoshortpm} & ${\overline{C}_V}_i$ & $\overline{C}_{vi}$ & \begin{thermoshortpm}$\inherit{\cVpm_i}$\end{thermoshortpm} \\
1843 % Helmholtz free energy (total) & \verb"\Ft" & $\Ft$ & $F$ & $A$ & $\underline{A}$ & $A$ & $A$ & $\Psi$ & $A$ & $A$ & $A^t$ & $\Ft$ & $\Ft$ \\
1844 % Helmholtz free energy (molar) & \verb"\Fm" & $\Fm$ & $\bar{f}$ & $\overline{a}$ & $A$ & $A_{\mathrm{m}}$ & $a$ & $\overline{\psi}$ & $a$ & $\Ft$ & $A$ & $A$ & $A$ \\
1845 % Helmholtz free energy (specific) & \verb"\Fs" & $\Fs$ & $f$ & $a$ & $A$ & $\inherit{\Fs}$ & $\hat a$ & $\psi$ & $\inherit{\hat a}$ & $\hat A$ & $A$ & $\Fs$ & $\inherit{\Fs}$ \\
1846 % Helmholtz free energy (partial molar) & \verb"\Fpm_i" & $\Fpm_i$ & $\overline{f}_i$ & $\widetilde{a}_i$ & $\overline{A}_i$ & $A_{\mathrm{m}i}$ & $\overline{A}_i$ & $\overline{\Psi}_i$ & $\overline a_i$ & \begin{thermoshortpm}$\Fpm_i$\end{thermoshortpm} & $\begin{thermoshortpm}\Fpm_i\end{thermoshortpm}$ & $\partialmolar{A}_i$ & \begin{thermoshortpm}$\partialmolar{A}_i$\end{thermoshortpm} \\
1847 % Henry's constant (rational basis) & \verb"\Henryrat_i" & $\Henryrat_i$ & $\inherit{\Henryrat_i}$ & $\inherit{\Henryrat_i}$ & $h_i$ & $k_i$ & $\mathcal{H}_i$ & $\inherit{\Henryrat_i}$ & $H_i$ & $H_i$ & $\mathcal{H}_i$ & $f^{**}$ & $k_{H,i}$ \\
1848 % Henry's constant (molal basis) & \verb"\Henrymol_i" & $\Henrymol_i$ & $\inherit{\Henrymol_i}$ & $\inherit{\Henrymol_i}$ & $\inherit{\Henrymol_i}$ & $k''_i$ & $\inherit{\Henrymol_i}$ & $\inherit{\Henrymol_i}$ & $\inherit{\Henrymol_i}$ & $\mathcal{H}_i$ & $\inherit{\Henrymol_i}$ & $f^*$ & $k_{H,i}$ \\
1849 % ideal gas enthalpy & \verb"\Hm^\IG" & $\Hm^\IG$ & $\inherit{\bar{h}^\IG}$ & $\inherit{\overline{h}^\IG}$ & $H^{ig}$ & $\inherit{H_{\mathrm{m}}^\IG}$ & $h^\text{ideal~gas}$ & $\smash{\overline{h}}^\ast$ & $h^\text{id}$ & $H^\text{IG}$ & $H^{ig}$ & $H^o$ & $H^{IG}$ \\
1850 % ideal gas mixture enthalpy & \verb"\Hm^\IGM" & $\Hm^\IGM$ & $\inherit{\bar{h}^\IG}$ & $\inherit{\overline{h}^\IGM}$ & $H^{ig}$ & $\inherit{H_{\mathrm{m}}^\IGM}$ & $h^\text{ideal}$ & $\smash{\overline{h}}^\ast$ & $h^\text{id}$ & $H^\text{IGM}$ & $H^{ig}$ & $H^o$ & $H^{IG}$ \\
1851 % ideal solution enthalpy & \verb"\Hm^\IS" & $\Hm^\IS$ & $\inherit{\bar{h}^\IS}$ & $\inherit{\overline{h}^\IS}$ & $H^{is}$ & $\inherit{H_{\mathrm{m}}^\IS}$ & $h^\text{ideal}$ & $\inherit{\smash{\overline{h}}^\IS}$ & $h^\text{(ideal)}$ & $H^\text{IM}$ & $H^{id}$ & $H^{ID}$ & $H^{IS}$ \\
1852 % inexact differential & \verb"\dbar" & $\dbar$ & $\delta$ & $\delta$ & $d$ & $d$ & $\delta$ & $\delta$ & $\inherit{\dbar}$ & $\inherit{\dbar}$ & $\dbar$ & $\delta$ & $\delta$ \\
1853 % internal energy (total) & \verb"\Ut" & $\Ut$ & $U$ & $U$ & $\underline{U}$ & $U$ & $U$ & $U$ & $U$ & $U$ & $U^t$ & $\Ut$ & $\Ut$ \\
1854 % internal energy (molar) & \verb"\Um" & $\Ut$ & $\bar{u}$ & $\overline{u}$ & $U$ & $U_{\mathrm{m}}$ & $u$ & $\overline{u}$ & $u$ & $\Ut$ & $U$ & $U$ & $U$ \\
1855 % internal energy (specific) & \verb"\Us" & $\Us$ & $u$ & $u$ & $U$ & $\inherit{\Us}$ & $\hat u$ & $u$ & $\inherit{\hat u}$ & $\hat U$ & $U$ & $u$ & $\inherit{\Us}$ \\
1856 % internal energy (partial molar) & \verb"\Upm_i" & $\Upm_i$ & $\overline{u}_i$ & $\widetilde{u}_i$ & $\overline{U}_i$ & $U_{\mathrm{m}i}$ & $\overline{U}_i$ & $\Upm_i$ & $\overline{u}_i$ & \begin{thermoshortpm}$\Upm_i$\end{thermoshortpm} & \begin{thermoshortpm}$\Upm_i$\end{thermoshortpm} & $\Upm_i$ & $\Upm_i$ \\
1857 % isothermal compressibility & \verb"\kappaT" & $\kappaT$ & $\kappa$ & $\alpha$ & $\kappa_T$ & $\betaup$ & $\kappa$ & $\kappa$ & $\beta$ & $\kappa_T$ & $\kappa$ & $\kappa_T$ & $\inherit{\kappaT}$ \\
1858 % isentropic compressibility & \verb"\kappaS" & $\kappaS$ & $\inherit{\kappaS}$ & $\inherit{\alpha_S}$ & $\inherit{\kappa_S}$ & $\inherit{\beta_S}$ & $\inherit{\kappaS}$ & $\alpha$ & $\inherit{\beta_S}$ & $\inherit{\kappaS}$ & $\inherit{\kappaS}$ & $\inherit{\kappaS}$ & $\inherit{\kappaS}$ \\
1859 % isobaric expansivity & \verb"\alphaP" & $\alphaP$ & $\beta$ & $\beta$ & $\alpha_P$ & $\alpha$ & $\beta$ & $\beta$ & $\alpha$ & $\alpha$ & $\beta$ & $\alpha_P$ & $\inherit{\alphaP}$ \\
1860 % isentropic expansivity & \verb"\alphaS" & $\alphaS$ & $\inherit{\beta_S}$ & $\inherit{\beta_S}$ & $\inherit{\alpha_S}$ & $\inherit{\alpha_S}$ & $\inherit{\beta_S}$ & $\inherit{\beta_S}$ & $\alpha_S$ & $\inherit{\alphaS}$ & $\inherit{\beta_S}$ & $\inherit{\alphaS}$ & $\inherit{\alphaS}$ \\
1861 % Joule--Thomson coefficient & \verb"\muJT" & $\muJT$ & $\mu_J$ & $\mu_\text{JT}$ & $\mu_{JT}$ & $\mu_\text{J.T.}$ & $\mu_\text{JT}$ & $\mu_J$ & $\inherit{\muJT}$ & $\mu$ & $\mu$ & $\alpha_H$ & $\alpha_H$ \\
1862 % moles & \verb"\Nt" & $\Nt$ & $N$ & $N$ & $n$ & $n$ & $n$ & $n$ & $n$ & $N$ & $n$ & $N$ & $n$ \\
1863 % saturation pressure & \verb"\Psat" & $\Psat$ & $\inherit{\Psat}$ & $P^v$ & $P^{sat}$ & $p$ & $P^\text{sat}$ & $\inherit{P^\text{sat}}$ & $P^s$ & $P^\text{sat}$ & $P^\text{sat}$ & $P^\text{sat}$ & $P^\text{sat}$ \\
1864 % saturation pressure of $i$ & \verb"\Psat_i" & $\Psat_i$ & $\inherit{\Psat_i}$ & $P^v_i$ & $P^{sat}_i$ & $p^\bullet_i$ & $P^\text{sat}_i$ & $\inherit{P^\text{sat}_i}$ & $P^s_i$ & $P^\text{sat}_i$ & $P^\text{sat}_i$ & $P^\text{sat}_i$ & $P^\text{sat}_i$ \\
1865 % standard molality & \verb"\Cstd_i" & $\Cstd_i$ & $\inherit{\Cstd_i}$ & $\inherit{\Cstd_i}$ & $m_i^\circ$ & $m_i^\circ$ & $\inherit{C_i^o}$ & $\inherit{\Cstd_i}$ & $C_i^0$ & \text{1~molal} & $m^\circ$ & $m^+$ & $m_i^\circ$ \\
1866 % standard chemical potential & \verb"\mustd" & $\mustd$ & $\inherit{\mustd}$ & $\inherit{\mustd}$ & $\mu^\circ$ & $\muup^\circ$ & $\mu^o$ & $\overline{g}^\circ$ & $\mu^0$ & $\mu^\circ$ & $G^\circ$ & $\muup^o$ & $\Gamma$ \\
1867 % standard enthalpy & \verb"\Hm^\std" & $\Hm^\std$ & $\bar{h}^\circ$ & $\smash{\overline{h}}^\circ$ & $H^\circ$ & $H^\circ_{\mathrm{m}}$ & $h^o$ & $\overline{h}^\circ$ & $h^0$ & $\Ht^\circ$ & $H^\circ$ & $H^o$ & $H^\circ$ \\
1868 % standard enthalphy of formation & \verb"\Deltaf\Hm^std" & $\Deltaf\Hm^\std$ & $\bar{h}^\circ_f$ & $\smash{\overline{h}}_f^\circ$ & $\Delta H_f^\circ$ & $\Delta_f H^\circ_{\mathrm{m}}$ & $\Delta h_f^o$ & $\bar{h}^\circ_{\mathrm{f}}$ & $\Delta h_f^0$ & $\Delta_{\mathrm{f}}\Ht^\circ$ & $\Delta H^\circ_{f298}$ & $\Delta H_f^o$ & $\Delta H_F^\circ$ \\
1869 % standard enthalphy of formation of $i$ & \verb"\Deltaf\Hm^std_i" & $\Deltaf\Hm^\std_i$ & $\bar{h}^\circ_{f,i}$ & $\smash{\overline{h}}_{f,i}^\circ$ & $\Delta H_{f,i}^\circ$ & $\Delta_f H^\circ_{\mathrm{m}i}$ & $(\Delta h_f^o)_i$ & $(\bar{h}^\circ_{\mathrm{f}})_i$ & $\Delta h_{f\,i}^0$ & $\Delta_{\mathrm{f}}\Ht^\circ_i$ & $\Delta H^\circ_{f298i}$ & $\Delta H^o_{fi}$ & $\Delta H_{F,i}^\circ$ \\
1870 % standard enthalphy of reaction & \verb"\Deltarxn\Hm^std" & $\Deltarxn\Hm^\std$ & $\inherit{\bar{h}^\circ_\reaction}$ & $\smash{\overline{h}}_R^\circ$ & $\Delta H^\circ$ & $\Delta H_{\mathrm{m}}$ & $\Delta h^o_\text{rxn}$ & $\inherit{\Delta\bar{h}^\circ_\text{rxn}}$ & $\Delta h^0_\text{rxn}$ & $\Delta_\text{rxn}\Ht^\circ$ & $\Delta H^\circ$ & $\Delta H_{rx}^o$ & $\Delta H_R^\circ$ \\
1871 % standard free energy of formation & \verb"\Deltaf\Gm^std" & $\Deltaf\Gm^\std$ & $\bar{g}^\circ$ & $\smash{\bar{g}}_f^\circ$ & $\Delta G_f^\circ$ & $\Delta_f G^\circ_{\mathrm{m}}$ & $\Delta g_f^o$ & $\bar{g}^\circ_{\mathrm{f}}$ & $\Delta g_f^0$ & $\Delta_{\mathrm{f}}\Gt^\circ$ & $\Delta G^\circ_{f298}$ & $\Delta G_f^o$ & $\Delta G_F^\circ$ \\
1872 % standard free energy of formation of $i$ & \verb"\Deltaf\Gm_i^std" & $\Deltaf\Gm_i^\std$ & $\bar{g}^\circ_{f,i}$ & $\smash{\bar{g}}_{f,i}^\circ$ & $\Delta G_{f,i}^\circ$ & $\Delta_f G^\circ_{\mathrm{m}i}$ & $(\Delta g_f^o)_i$ & $(\bar{g}^\circ_{\mathrm{f}})_i$ & $\Delta g_{f\,i}^0$ & $\Delta_{\mathrm{f}}\Gt^\circ_i$ & $\Delta G^\circ_{f298i}$ & $\Delta G^o_{fi}$ & $\Delta G_{F,i}^\circ$ \\
1873 % standard free energy of reaction & \verb"\Deltarxn\Gm^std" & $\Deltarxn\Gm^\std$ & $\inherit{\bar{g}^\circ_\reaction}$ & $\smash{\bar{g}}^\circ_R$ & $\Delta G^\circ$ & $\Delta G_{\mathrm{m}}$ & $\Delta g^o_\text{rxn}$ & $\inherit{\Delta\bar{g}^\circ_\text{rxn}}$ & $\Delta g_\text{rxn}^0$ & $\Delta_\text{rxn}\Gt^\std$ & $\Delta G^\circ$ & $\Delta G^o_{rx}$ & $\Delta G_R^\circ$ \\
1874 % standard fugacity & \verb"\fstd" & $\fstd$ & $\inherit{f^\circ}$ & $\inherit{f^\circ}$ & $f^\circ$ & $f^\circ$ & $f^o$ & $\inherit{f^\circ}$ & $f^0$ & $\bar f^\circ$ & $f^\circ$ & $\inherit{\fstd}$ & $f^\circ$ \\
1875 % standard Gibbs free energy & \verb"\Gm^\std" & $\Gm^\std$ & $\bar{g}^\circ$ & $\bar{g}^\circ$ & $G^\circ$ & $G^\circ_{\mathrm{m}}$ & $g^o$ & $\overline{g}^\circ$ & $g^0$ & $\Gt^\circ$ & $G^\circ$ & $G^o$ & $G^\circ$ \\
1876 % standard Gibbs free energy of $i$ & \verb"\Gm^\std_i" & $\Gm^\std_i$ & $\bar{g}^\circ_i$ & $\bar{g}_i^\circ$ & $G^\circ_i$ & $G^\circ_{\mathrm{m}i}$ & $g_i^o$ & $\overline{g}^\circ_i$ & $g^0_i$ & $\Gt^\circ_i$ & $G^\circ_i$ & $G^o_i$ & $G^\circ_i$ \\
1877 % standard pressure & \verb"\Pstd" & $\Pstd$ & $P_0$ & $P_0$ & $P^\circ$ & $P^\circ$ & $\inherit{P^o}$ & $p_\text{ref}$ & $P^0$ & \text{1~bar} & $P^\circ$ & $P^\ast$ & $P^\circ$ \\
1878 % vapor pressure & \verb"\Pvap" & $\Pvap$ & $\inherit{\Pvap}$ & $P^v$ & $P^{std}$ & $p$ & $\inherit{P^\text{sat}}$ & $p_\text{ref}$ & $P^s$ & $P^\text{vap}$ & $P^\text{sat}$ & $P^\text{sat}$ & $P^\text{sat}$ \\
1879 % volume (total) & \verb"\Vt" & $\Vt$ & $V$ & $V$\footref{fn:XeTeX} & $\Vt$ & $V$ & $V$ & $V$ & $V$ & $V$ & $V^t$ & $\Vt$ & $\Vt$ \\
1880 % volume (molar) & \verb"\Vm" & $\Vm$ & $\bar{v}$ & $\overline{v}$\footref{fn:XeTeX} & $V$ & $V_{\mathrm{m}}$ & $v$ & $\overline{v}$ & $v$ & $\Vt$ & $V$ & $V$ & $V$ \\
1881 % volume (specific) & \verb"\Vs" & $\Vs$ & $v$ & $v$\footref{fn:XeTeX} & $V$ & $\inherit{\Vs}$ & $\hat v$ & $v$ & $\inherit{\hat v}$ & $\hat V$ & $V$ & $\inherit{v}$ & $\inherit{\Vs}$ \\
1882 % volume (molar, residual) & \verb"\VR" & $\VR$ & $\inherit{\bar{v}^\residual}$ & $\inherit{\overline{v}^\residual}$\footref{fn:XeTeX} & $\inherit{V^R}$ & $\inherit{V^{\mathrm{R}}_{\mathrm{m}}}$ & $v^\text{dep}$ & $\inherit{\overline{v}^R}$ & $v^R$ & $\Vt^r$ & $V^R$ & $\inherit{\VR}$ & $V^R$ \\
1883 % volume (molar, excess) & \verb"\VE" & $\VE$ & $\inherit{\bar{v}^\excess}$ & $\inherit{\overline{v}^\excess}$\footref{fn:XeTeX} & $V^E$ & $V^{\mathrm{E}}_{\mathrm{m}}$ & $v^E$ & $\inherit{\overline{v}^E}$ & $v^E$ & $\Vt^\text{ex}$ & $V^E$ & $V^{EX}$ & $V^{EX}$ \\
1884 % volume (partial molar, excess) & \verb"\VEpm_i" & $\VEpm_i$ & $\inherit{\overline{v}_i^\excess}$ & $\inherit{\widetilde{v}^\excess}$\footref{fn:XeTeX} & $\smash{\overline{V}}^E_i$ & $V^{\mathrm{E}}_{\mathrm{m}i}$ & $\smash{\overline{V}}^E_i$ & $\inherit{\overline{V}^E_i}$ & $\overline{v}^E_i$ & \begin{thermoshortpm}$\Vpm^{\text{ex}}_i$\end{thermoshortpm} & \begin{thermoshortpm}$\VEpm_i$\end{thermoshortpm} & \begin{thermoshortpm}$\Vpm^{EX}_i$\end{thermoshortpm} & \begin{thermoshortpm}$\Vpm^{EX}_i$\end{thermoshortpm} \\
1885 % work (total) & \verb"\Wt" & $\Wt$ & $W$ & $W$ & $\underline{W}$ & $W$ & $W$ & $W$ & $W$ & $W$ & $\inherit{W^t}$ & $\inherit{\Wt}$ & $\inherit{\Wt}$ \\
1886 % work (molar) & \verb"\Wm" & $\Wm$ & $\bar{w}$ & $\overline{w}$ & $W$ & $\inherit{W_{\mathrm{m}}}$ & $w$ & $\inherit{\overline{w}}$ & $\inherit{w}$ & $\inherit{\Wt}$ & $W$ & $W$ & $W$ \\
1887 % work (specific) & \verb"\Ws" & $\Ws$ & $w$ & $w$ & $W$ & $\inherit{\Ws}$ & $\hat w$ & $\inherit{w}$ & $\inherit{\hat w}$ & $\inherit{\hat W}$ & $\inherit{W}$ & $w$ & $\inherit{\Ws}$ \\
1888 % \end{mpsupertabular}
1889 % \end{landscape}
1890 %
1891 %^^X \end{documentation}
1892 %
1893 % \setcounter{IndexColumns}{2}
1894 % \StopEventually{\PrintChanges\PrintIndex}
1895 %
1896 % ^^A--------------------------------------------------------------------------
1897 % \iffalse
1898 %<*package>
1899 %<@@=thermodynamics>
1900 % \fi
1901 %
1902 %^^X\begin{implementation}
1903 % \section{Implementation}
1904 % We set up some non-standard token comparison variants; these are designed
1905 % to catch both \cs{ncomponents}=\cs{ncomponents} and \cs{ncomponents}=$C$
1906 % (using the default options); we have to define \cs{ncomponents} to be
1907 % expandable to make these work at all.
1908 % \begin{macrocode}
1909 \ExplSyntaxOn
1910 \cs_generate_variant:Nn \tl_if_eq:nnTF { xxTF }
1911 % \end{macrocode}
1912 %
1913 % This package requires the \pkg{amstext} package, as \tn{text} is used to
1914 % handle \cs{sat}, \cs{IS}, \cs{IG}, \cs{IGM}, \cs{Henrymol}, \cs{fusion},
1915 % \cs{reaction}, \cs{vaporization}, and \cs{sublimation} by default, as well
1916 % as several other macros defined by package options.
1917 % \begin{macrocode}
1918 \RequirePackage{amstext}
1919 % \end{macrocode}
1920 %
1921 % \subsection{Symbols Controlled by Package Options}
1922 % We set some symbols prior to declaring the package options. The default
1923 % symbols follow package option |EUAGHan|, even though the macros follow
1924 % the option |EUFGHAN|.
1925 %
1926 % \begin{macro}{\dbar}
1927 % The way \cs{dbar} is defined depends on the typeface you are using.
1928 % We try to determine, at \verb"\begin{document}", which typeface you chose
1929 % based on the packages that are loaded and some of their internal definitions.
1930 % The \textsf{thermodynamics} package currently supports
1931 % Computer Modern (the default or through \pkg{lmodern}),
1932 % Palatino (through \pkg{pxfonts} or \pkg{newpxmath}),
1933 % Times (through \pkg{txfonts}, \pkg{mathptmx}, or \pkg{newtxmath}),
1934 % Utopia (through \pkg{mathdesign}),
1935 % Bitstream Charter (through \pkg{mathdesign}), and
1936 % Garamond (through \pkg{mathdesign}).
1937 % Definitions of \cs{dbar} (with \cs{newcommand*}, \cs{providecommand*},
1938 % \cs{NewDocumentCommand}, or \cs{ProvideDocumentCommand})
1939 % in the preamble will override the ones here.
1940 % \begin{macrocode}
1941 \AtBeginDocument{
1942 \@ifpackageloaded{pxfonts}{%
1943 \ProvideDocumentCommand{\dbar}{}
1944 {\mkern5mu\mathchar'26\mkern-10mu d}
1945 }{}
1946 \@ifpackageloaded{newpxmath}{%
1947 \ProvideDocumentCommand{\dbar}{}
1948 {\mkern5mu\mathchar'26\mkern-10mu d}
1949 }{}
1950 \@ifpackageloaded{txfonts}{%
1951 \ProvideDocumentCommand{\dbar}{}
1952 {\mkern5mu\mathchar'26\mkern-11mu d}
1953 }{}
1954 \@ifpackageloaded{mathptmx}{%
1955 \ProvideDocumentCommand{\dbar}{}
1956 {\mkern5mu\mathchar'26\mkern-10mu d}
1957 }{}
1958 \@ifpackageloaded{newtxmath}{%
1959 \ProvideDocumentCommand{\dbar}{}
1960 {\mkern5mu\mathchar'26\mkern-11mu d}
1961 }{}
1962 \@ifpackageloaded{mathdesign}{%
1963 \tl_const:Nn \c_@@_charter_tl {mdbch}
1964 \tl_const:Nn \c_@@_utopia_tl {mdput}
1965 \tl_const:Nn \c_@@_garamond_tl {mdugm}
1966 \tl_if_eq:NNT \MD@default@family \c_@@_utopia_tl
1967 { \ProvideDocumentCommand{\dbar}{}
1968 {\mkern5mu\mathchar'26\mkern-20mu d}
1969 }
1970 \tl_if_eq:NNT \MD@default@family \c_@@_charter_tl
1971 { \ProvideDocumentCommand{\dbar}{}
1972 {\mkern5mu\mathchar'26\mkern-15mu d}
1973 }
1974 \tl_if_eq:NNT \MD@default@family \c_@@_garamond_tl
1975 { \ProvideDocumentCommand{\dbar}{}
1976 {\mkern5mu\mathchar'26\mkern-17mu d}
1977 }
1978 }{}
1979 % Defaults to Computer Modern
1980 \ProvideDocumentCommand{\dbar}{}
1981 {\mkern3mu\mathchar'26\mkern-12mu d}
1982 }
1983 % \end{macrocode}
1984 % \end{macro}
1985 %
1986 % Symbols are defined for the total energy, internal energy, Helmholtz free
1987 % energy, Gibbs free energy, grand potential (Landau free energy), enthalpy,
1988 % entropy, surface area, volume, number of moles, heat, and work; these are
1989 % $E$, $U$, $A$, $G$, $\Omega$, $H$, $S$, $a$, $V$, $n$, $Q$, and $W$,
1990 % respectively. These commands should not be used on their own, but rather
1991 % accessed through the macros \cs{Ut}, \cs{Um}, and \cs{Us} (using the internal
1992 % energy as an example).
1993 %
1994 % The default symbols are not intended to be easy to change---the intended
1995 % mechanism is through package options. If you want to use a non-standard
1996 % symbol that is not available through one of the package options, you can
1997 % redefine the internal token lists inside
1998 % \cs{ExplSyntaxOn}\,\dots\!\cs{ExplSyntaxOff}. For example,
1999 % \begin{verbatim}
2000 % \ExplSyntaxOn
2001 % \tl_gset:Nn \g__thermodynamics_Helmholtz_symbol {H}
2002 % \tl_gset:Nn \g__thermodynamics_enthalpy_symbol {h}
2003 % \ExplSyntaxOff
2004 %\end{verbatim}
2005 % would define the ill-advised notation that I have nonetheless heard of
2006 % that uses $H$ for Helmholtz free energy and $h$ for enthalpy.
2007 % Note that the macros for temperature and pressure are only used inside
2008 % the definitions of the compressibilities, expansivities, and heat
2009 % capacities; there is no user-level macro for the temperature or the pressure,
2010 % so it is up to the user to use consistent symbols for those properties.
2011 % \begin{macrocode}
2012 \tl_new:N \g_@@_total_energy_symbol
2013 \tl_new:N \g_@@_internal_energy_symbol
2014 \tl_new:N \g_@@_Helmholtz_symbol
2015 \tl_new:N \g_@@_Gibbs_symbol
2016 \tl_new:N \g_@@_Landau_symbol
2017 \tl_new:N \g_@@_enthalpy_symbol
2018 \tl_new:N \g_@@_entropy_symbol
2019 \tl_new:N \g_@@_area_symbol
2020 \tl_new:N \g_@@_volume_symbol
2021 \tl_new:N \g_@@_mole_symbol
2022 \tl_new:N \g_@@_heat_symbol
2023 \tl_new:N \g_@@_work_symbol
2024 \tl_new:N \g_@@_temperature_symbol
2025 \tl_new:N \g_@@_pressure_symbol
2026
2027 \tl_gset:Nn \g_@@_total_energy_symbol E
2028 \tl_gset:Nn \g_@@_internal_energy_symbol U
2029 \tl_gset:Nn \g_@@_Helmholtz_symbol A
2030 \tl_gset:Nn \g_@@_Gibbs_symbol G
2031 \cs_if_exist:NTF \Omegait
2032 { \tl_gset:Nn \g_@@_Landau_symbol \Omegait }
2033 { \tl_gset:Nn \g_@@_Landau_symbol \Omega }
2034 \tl_gset:Nn \g_@@_enthalpy_symbol H
2035 \tl_gset:Nn \g_@@_entropy_symbol S
2036 \tl_gset:Nn \g_@@_area_symbol a
2037 \tl_gset:Nn \g_@@_volume_symbol V
2038 \tl_gset:Nn \g_@@_mole_symbol n
2039 \tl_gset:Nn \g_@@_heat_symbol Q
2040 \tl_gset:Nn \g_@@_work_symbol W
2041 \tl_gset:Nn \g_@@_temperature_symbol T
2042 \tl_gset:Nn \g_@@_pressure_symbol P
2043 % \end{macrocode}
2044 %
2045 % We then define two functions and several lengths that we shall use when
2046 % drawing rules above or below a symbol. The default is to use underlined
2047 % symbols for extensive quantities, plain symbols for molar quantities, and
2048 % carets for specific quantities, but this can be changed using package
2049 % options.
2050 %^^A TODO these might work better as kern 0.1*width, symbol, kern 0.2*width
2051 % \begin{macrocode}
2052 \cs_new:Nn \@@_underline:n
2053 { \mkern1mu\underline{\mkern-1mu #1\mkern-4mu}\mkern4mu }
2054 \cs_new:Nn \@@_overline:n
2055 { \mkern2mu\overline{\mkern-2mu #1\mkern-1mu}\mkern1mu }
2056 % \end{macrocode}
2057 %
2058 % \begin{macro}{\PartialOpen,\PartialClose,\PartialEmptyClose}
2059 % We define three commands to use to denote the beginning and end of partial
2060 % derivatives. These symbols can be customized by package options. Default
2061 % is |parentheses|, meaning that \verb"\[ \Partial{f}{x}{y} \]" renders as
2062 % \[ \left(\frac{\partial f}{\partial x}\right)_y \]
2063 % with the defaults. The macro \cs{PartialEmptyClose} is used when the last
2064 % argument to \cs{Partial} is empty, which is important for the |bar|
2065 % option to the document class or inside the \env{thermobar} environment.
2066 % \begin{macrocode}
2067 \tl_new:N \l_@@_PartialOpen_tl
2068 \tl_new:N \l_@@_PartialEmptyClose_tl
2069 \tl_new:N \l_@@_PartialClose_tl
2070
2071 \tl_set:Nn \l_@@_PartialOpen_tl {(}
2072 \tl_set:Nn \l_@@_PartialClose_tl {)}
2073 \tl_set:Nn \l_@@_PartialEmptyClose_tl {)}
2074 % \end{macrocode}
2075 % \end{macro}
2076 %
2077 % \subsection{Package Options}
2078 % We declare a bunch of options for which sets of symbols to use.
2079 % These are summarized in Table~\ref{table:symbol-sets}.
2080 % \changes{v1.01}{2023/09/15}{Changed options with two $E$ or two $A$
2081 % variables to use calligraphic letters for the less-common of the two.}
2082 % \begin{macrocode}
2083 \DeclareOption{EUAGHan}{}% the default
2084 \DeclareOption{EUAGHaN}{\tl_gset:Nn \g_@@_mole_symbol N}%
2085 \DeclareOption{EUHAGan}{\ExecuteOptions{EUAGHan}}
2086 \DeclareOption{EUHAGaN}{\ExecuteOptions{EUAGHaN}}
2087 \DeclareOption{EUFGHAn}{%
2088 \tl_gset:Nn \g_@@_Helmholtz_symbol F
2089 \tl_gset:Nn \g_@@_area_symbol A
2090 }
2091 \DeclareOption{EUFGHAN}{%
2092 \tl_gset:Nn \g_@@_Helmholtz_symbol F
2093 \tl_gset:Nn \g_@@_area_symbol A
2094 \tl_gset:Nn \g_@@_mole_symbol N
2095 }
2096 \DeclareOption{EEFGHAn}{%
2097 \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
2098 \tl_gset:Nn \g_@@_internal_energy_symbol E
2099 \tl_gset:Nn \g_@@_Helmholtz_symbol F
2100 \tl_gset:Nn \g_@@_area_symbol A
2101 }
2102 \DeclareOption{EEFGHAN}{%
2103 \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
2104 \tl_gset:Nn \g_@@_internal_energy_symbol E
2105 \tl_gset:Nn \g_@@_Helmholtz_symbol F
2106 \tl_gset:Nn \g_@@_area_symbol A
2107 \tl_gset:Nn \g_@@_mole_symbol N
2108 }
2109 \DeclareOption{EEFGHan}{%
2110 \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
2111 \tl_gset:Nn \g_@@_internal_energy_symbol E
2112 \tl_gset:Nn \g_@@_Helmholtz_symbol F
2113 }
2114 \DeclareOption{EEFGHaN}{%
2115 \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
2116 \tl_gset:Nn \g_@@_internal_energy_symbol E
2117 \tl_gset:Nn \g_@@_Helmholtz_symbol F
2118 \tl_gset:Nn \g_@@_mole_symbol N
2119 }
2120 \DeclareOption{EEAGHan}{%
2121 \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
2122 \tl_gset:Nn \g_@@_internal_energy_symbol E
2123 }
2124 \DeclareOption{EEAGHaN}{%
2125 \tl_gset:Nn \g_@@_total_energy_symbol {\mathcal{E}}
2126 \tl_gset:Nn \g_@@_internal_energy_symbol E
2127 \tl_gset:Nn \g_@@_mole_symbol N
2128 }
2129 \DeclareOption{EUAGHAn}{%
2130 \tl_gset:Nn \g_@@_area_symbol {\mathcal{A}}
2131 }
2132 \DeclareOption{EUAGHAN}{%
2133 \tl_gset:Nn \g_@@_area_symbol {\mathcal{A}}
2134 \tl_gset:Nn \g_@@_mole_symbol N
2135 }
2136 \DeclareOption{EUFGHan}{%
2137 \tl_gset:Nn \g_@@_Helmholtz_symbol F
2138 }
2139 \DeclareOption{EUFGHaN}{%
2140 \tl_gset:Nn \g_@@_Helmholtz_symbol F
2141 \tl_gset:Nn \g_@@_mole_symbol N
2142 }
2143 % \end{macrocode}
2144 % The |delta| option redefines \cs{dbar} to produce the symbol $\delta$.
2145 % The default is to use a $d$ with a slash through it ($\dbar$) for inexact
2146 % differentials unless the user overrides it with this option. The macro could
2147 % also be redefined manually, of course.
2148 % \begin{macrocode}
2149 \DeclareOption{delta}{ \cs_set_eq:NN \dbar \delta }
2150 % \end{macrocode}
2151 %
2152 % Next, we define options for the set of notation. The default is
2153 % |intensive-plain|, which produces things like $V$ for molar volume,
2154 % $\Vt$ for total volume, and $\hat V$ for specific volume.
2155 % The symbols themselves are produced via internal (non-user-facing) macros.
2156 % \begin{macrocode}
2157 \cs_new:Nn \@@_extensive:n {#1}
2158 \cs_new:Nn \@@_intensive:n {#1}
2159 \cs_new:Nn \@@_specific:n {\hat{#1}}
2160
2161 \cs_new:Npn \@@_set_intensive_plain
2162 {
2163 \cs_set:Nn \@@_extensive:n {\@@_underline:n{##1}}
2164 \cs_set:Nn \@@_intensive:n {##1}
2165 }
2166 \cs_new:Npn \@@_set_extensive_plain
2167 {
2168 \cs_set:Nn \@@_extensive:n {##1}
2169 \cs_set:Nn \@@_intensive:n {\@@_underline:n{##1}}
2170 }
2171 \cs_new:Npn \@@_set_lowercase_pms
2172 {
2173 \RenewDocumentCommand{\partialmolar}{m}
2174 {
2175 \tl_set:Nn \l_@@_pm_symbol_tl {\text_lowercase:n {##1}}
2176 \@@_generic_pm:
2177 }
2178 }
2179 \cs_new:Npn \@@_set_intensive_lowercase
2180 {
2181 \cs_set:Nn \@@_extensive:n {\text_uppercase:n {##1}}
2182 \cs_set:Nn \@@_intensive:n {\text_lowercase:n {##1}}
2183 \cs_set:Nn \@@_specific:n {\hat{\text_lowercase:n {##1}}}
2184 }
2185 \cs_new:Npn \@@_set_extensive_superscripts
2186 {
2187 \cs_set:Nn \@@_extensive_one:n
2188 { \c_math_superscript_token {##1\l_@@_super_separator_tl t} }
2189 \cs_set:Nn \@@_extensive:n
2190 {
2191 \peek_catcode_remove:NTF \c_math_superscript_token
2192 { ##1 \@@_extensive_one:n }
2193 { ##1 \c_math_superscript_token t }
2194 }
2195 \cs_set:Nn \@@_intensive:n {##1}
2196 }
2197 \DeclareOption{extensive-plain}{\@@_set_extensive_plain}
2198 \DeclareOption{intensive-plain}{\@@_set_intensive_plain} % the default
2199 \DeclareOption{intensive-lowercase}{% PLEASE don't use this!
2200 \@@_set_intensive_lowercase
2201 \AtEndOfPackage{
2202 \@@_set_lowercase_pms
2203 }
2204 }
2205 \DeclareOption{extensive-superscript}{%
2206 \@@_set_extensive_superscripts
2207 %^^A \AtEndOfPackage{%
2208 %^^A \RenewDocumentCommand{\URt}{}{\g_@@_internal_energy_symbol
2209 %^^A \c_math_superscript_token{\residual,t}}
2210 %^^A \RenewDocumentCommand{\HRt}{}{\g_@@_enthalpy_symbol
2211 %^^A \c_math_superscript_token{\residual,t}}
2212 %^^A \RenewDocumentCommand{\FRt}{}{\g_@@_Helmoholtz_symbol
2213 %^^A \c_math_superscript_token{\residual,t}}
2214 %^^A \RenewDocumentCommand{\GRt}{}{\g_@@_Gibbs_symbol
2215 %^^A \c_math_superscript_token{\residual,t}}
2216 %^^A \RenewDocumentCommand{\VRt}{}{\g_@@_volume_symbol
2217 %^^A \c_math_superscript_token{\residual,t}}
2218 %^^A \RenewDocumentCommand{\SRt}{}{\g_@@_entropy_symbol
2219 %^^A \c_math_superscript_token{\residual,t}}
2220 %^^A \RenewDocumentCommand{\UEt}{}{\g_@@_internal_energy_symbol
2221 %^^A \c_math_superscript_token{\excess,t}}
2222 %^^A \RenewDocumentCommand{\HEt}{}{\g_@@_enthalpy_symbol
2223 %^^A \c_math_superscript_token{\excess,t}}
2224 %^^A \RenewDocumentCommand{\FEt}{}{\g_@@_Helmoholtz_symbol
2225 %^^A \c_math_superscript_token{\excess,t}}
2226 %^^A \RenewDocumentCommand{\GEt}{}{\g_@@_Gibbs_symbol
2227 %^^A \c_math_superscript_token{\excess,t}}
2228 %^^A \RenewDocumentCommand{\VEt}{}{\g_@@_volume_symbol
2229 %^^A \c_math_superscript_token{\excess,t}}
2230 %^^A \RenewDocumentCommand{\SEt}{}{\g_@@_entropy_symbol
2231 %^^A \c_math_superscript_token{\excess,t}}
2232 %^^A }
2233 }
2234 % \end{macrocode}
2235 % \begin{environment}{thermolongpm,thermoshortpm}
2236 % The |longpm| option (the default) makes partial molar quantities that
2237 % look like \(\UEpm_i\). The |shortpm| option (which is used by several
2238 % textbooks) makes partial molar quantities look like
2239 % \(\smash{\mkern2mu\overline{\mkern-2mu U}}_i^E\).
2240 % The environments \env{thermolongpm} and \env{thermoshortpm} do the same
2241 % thing locally.
2242 % \changes{v2.02}{2024/06/14}{Added ``longpm'' and ``shortpm'' options to
2243 % control how partial molar properties are rendered along with the
2244 % environments \env{thermolongpm} and \env{thermoshortpm} to change them
2245 % locally.}
2246 % \begin{macrocode}
2247 \bool_new:N \l_@@_longpm_bool
2248 \DeclareOption{longpm}{\bool_set_true:N \l_@@_longpm_bool}
2249 \cs_set_eq:NN \@@_overline_copy:n \@@_overline:n
2250 \DeclareOption{shortpm}{
2251 \bool_set_false:N \l_@@_longpm_bool
2252 \AtEndOfPackage{
2253 \RenewDocumentCommand{\cPpm}{}
2254 {
2255 \cs_set:Nn \@@_overline:n {##1}
2256 \partialmolar{\cPpmshort}
2257 }
2258 \RenewDocumentCommand{\cVpm}{}
2259 {
2260 \cs_set:Nn \@@_overline:n {##1}
2261 \partialmolar{\cVpmshort}
2262 }
2263 }
2264 }
2265 \NewDocumentEnvironment{thermolongpm}{}{%
2266 \bool_set_true:N \l_@@_longpm_bool
2267 }{}
2268 \NewDocumentEnvironment{thermoshortpm}{}{%
2269 \bool_set_false:N \l_@@_longpm_bool
2270 \RenewSubscriptedSymbol{\cPpm}{\@@_overline:n \heatcapacitysymbol}
2271 {\g_@@_pressure_symbol}
2272 \RenewSubscriptedSymbol{\cVpm}{\@@_overline:n \heatcapacitysymbol}
2273 {\g_@@_volume_symbol}
2274 }{}
2275 % \end{macrocode}
2276 % \end{environment}
2277 %
2278 % The next two options choose whether variables held constant are subscripted
2279 % (the default) or placed next to the function. The difference is
2280 % \[ \Partial{\Um}{\Sm}{\Vm} \quad\text{versus}\quad
2281 % \begin{thermoNOsubscripts}
2282 % \Partial{\Um}{\Sm}{\Vm}
2283 % \end{thermoNOsubscripts} \]
2284 % for \verb"subscripts" and \verb"nosubscripts", respectively.
2285 % \begin{macrocode}
2286 \bool_new:N \l_@@_subscripted_bool
2287 \bool_set_true:N \l_@@_subscripted_bool
2288 \DeclareOption{subscripts}{\bool_set_true:N \l_@@_subscripted_bool}
2289 \DeclareOption{nosubscripts}{\bool_set_false:N \l_@@_subscripted_bool}
2290 % \end{macrocode}
2291 % These options change how \cs{Partial} and friends render derivatives.
2292 % The default is parentheses, but other options include brackets, braces,
2293 % a vertical bar on the right side, or plain (undecorated) derivatives.
2294 % \begin{macrocode}
2295 \DeclareOption{parentheses}{}
2296 \DeclareOption{brackets}{%
2297 \tl_set:Nn \l_@@_PartialOpen_tl {[}
2298 \tl_set:Nn \l_@@_PartialClose_tl {]}
2299 \tl_set:Nn \l_@@_PartialEmptyClose_tl {]}
2300 }
2301 \DeclareOption{braces}{%
2302 \tl_set:Nn \l_@@_PartialOpen_t1 {\{}
2303 \tl_set:Nn \l_@@_PartialClose_t1 {\}}
2304 \tl_set:Nn \l_@@_PartialEmptyClose_tl {\}}
2305 }
2306 \DeclareOption{bar}{%
2307 \tl_set:Nn \l_@@_PartialOpen_tl {.}
2308 \tl_set:Nn \l_@@_PartialClose_tl {\rvert}
2309 \tl_set:Nn \l_@@_PartialEmptyClose_tl {.}
2310 }
2311 \DeclareOption{plain-derivatives}{% This implies dU(S,V,N)/dS notation
2312 \tl_set:Nn \l_@@_PartialOpen_tl {.}
2313 \tl_set:Nn \l_@@_PartialClose_tl {.}
2314 \tl_set:Nn \l_@@_PartialEmptyClose_tl {.}
2315 \ExecuteOptions{nosubscripts}
2316 }
2317 % \end{macrocode}
2318 % \subsection{The Number of Moles Macros}
2319 % \begin{macro}{\ncomponents}
2320 % We define the number of components, default $C$, for use in the ``all moles''
2321 % and related macros. The command is expandable so we can perform comparisons
2322 % to user-entered values.
2323 % \begin{macrocode}
2324 \NewExpandableDocumentCommand \ncomponents {} {C}
2325 % \end{macrocode}
2326 % \end{macro}
2327 %
2328 % \begin{macro}{\allNs,\allXs,\allYs,\allmus,\allMs,\allWs}
2329 % Several macros define a shorthand for ``moles of all species'' (\cs{allNs})
2330 % and ``moles of all species except'' (\cs{allNsbut}), as well as similar
2331 % quantities for masses (\cs{allMs}, \cs{allMsbut}) and chemical potentials
2332 % (\cs{allmus}, \cs{allmusbut}), which occur frequently in mixture
2333 % thermodynamics. The default is for \cs{allNs} to become $\vec{n}$ and
2334 % \verb"allNsbut{i}" to become $n_{j\neq i}$. The optional argument changes
2335 % which index (default: $j$) to use in the left side of the inequality.\relax
2336 % \footnote{The index \!$j$ is automatically replaced with $k$ if the user
2337 % issues \texttt{\textbackslash allNsbut\{j\}}.}
2338 % Essentially identical commands are defined for chemical potentials and
2339 % masses: \cs{allmus} and \cs{allmusbut} and \cs{allMs} and \cs{allMsbut},
2340 % respectively.
2341 % \begin{macrocode}
2342 \NewDocumentCommand{\allNs}{O{i}}{\allcomponents[#1]{\Nt}}
2343 \NewDocumentCommand{\allXs}{O{i}}{\allcomponents[#1]{x}}
2344 \NewDocumentCommand{\allYs}{O{i}}{\allcomponents[#1]{y}}
2345 \NewDocumentCommand{\allmus}{O{i}}{\allcomponents[#1]{\mu}}
2346 \NewDocumentCommand{\allMs}{O{i}}{\allcomponents[#1]{m}}
2347 \NewDocumentCommand{\allWs}{O{i}}{\allcomponents[#1]{w}}
2348 % \end{macrocode}
2349 % \end{macro}
2350 % \begin{macro}{\allNsbut,\allXsbut,\allYsbut,\allMsbut,\allWsbut}
2351 % Similar commands are defined for mole fractions (\cs{allXs}, \cs{allYs},
2352 % etc.), but these assume the last mole fraction is \emph{not} one of the
2353 % variables---that is, \cs{allXsbut} and \cs{allYsbut} assume the argument
2354 % \emph{and} \cs{ncomponents} are held constant. For example,
2355 % \begin{verbatim}
2356 % \[ \Partial{\Gm}{T}{P,\allXs} = -\Sm \qquad
2357 % \Partial{\Gm}{x_i}{T,P,\allXsbut{i}} \neq \Gpm_i \]
2358 %\end{verbatim}
2359 % yields
2360 % \[ \Partial{G}{T}{P,\allXs} = -S \qquad
2361 % \Partial{G}{x_i}{T,P,x_{j\neq i,C}} \neq \Gpm{i}. \]
2362 % \begin{macrocode}
2363 \NewDocumentCommand{\allNsbut}{O{j} m} {\allbut[#1]{#2}{\Nt}}
2364 \NewDocumentCommand{\allXsbut}{O{j} m} {\allbutlastand[#1]{#2}{x}}
2365 \NewDocumentCommand{\allYsbut}{O{j} m} {\allbutlastand[#1]{#2}{y}}
2366 \NewDocumentCommand{\allmusbut}{O{j} m} {\allbut[#1]{#2}{\mu}}
2367 \NewDocumentCommand{\allMsbut}{O{j} m} {\allbut[#1]{#2}{m}}
2368 \NewDocumentCommand{\allWsbut}{O{j} m} {\allbutlastand[#1]{#2}{w}}
2369 % \end{macrocode}
2370 % \end{macro}
2371 % \begin{macro}{\allbutlastand,\allbut,\allcomponents}
2372 % \changes{v1.01}{10/04/2023}{Updated \cs{allcomponents} to include an
2373 % optional argument that changes $N_i$ to $N_j$, say, when using
2374 % TesterModell or other options that denote moles of all components that
2375 % way. Similar updates to \cs{allNs} and friends.}
2376 % The \cs{allcomponents}, \cs{allbut}, and \cs{allbutlastand} macros can be
2377 % used to define new entities; say, if you want to use $z_i$ as a mole
2378 % fraction, then use
2379 % \begin{verbatim}
2380 % \NewDocumentCommand{\allZsbut}{O{j} m}{\allbutlastand[#1]{#2}{z}}
2381 %\end{verbatim}
2382 % Similarly, something meaning the concentrations of every species could be
2383 % defined via
2384 % \begin{verbatim}
2385 % \NewDocumentCommand{\allCs}{O{}}{\allcomponents{C}}
2386 %\end{verbatim}
2387 % \begin{macrocode}
2388 \NewDocumentCommand{\allcomponents}{O{} m}{\vec{#2}}
2389 \NewDocumentCommand{\allbut}{O{j} m m}
2390 { \tl_if_eq:nnTF {#1} {#2}
2391 { {#3}\c_math_subscript_token{k \neq #2} }
2392 { {#3}\c_math_subscript_token{#1 \neq #2} }
2393 }
2394 \NewDocumentCommand{\allbutlastand}{O{j} m m}
2395 { \tl_if_eq:xxTF {#2} {\ncomponents}
2396 { {#3}\c_math_subscript_token{#1 \neq #2} }
2397 { \tl_if_eq:nnTF {#1} {#2}
2398 { {#3}\c_math_subscript_token{k \neq #2,\ncomponents} }
2399 { {#3}\c_math_subscript_token{#1 \neq #2,\ncomponents} }
2400 }
2401 }
2402 % \end{macrocode}
2403 % \end{macro}
2404 %
2405 % \subsection{Package Options}
2406 % We define two package options that change how to render \cs{allNs} and
2407 % friends.\relax
2408 % \changes{v1.01}{2022/05/04}{Fixed bug in \cs{allbutlastand} when using the
2409 % |moles-range| option ($C$ should have been $C-1$ in the last option).}
2410 % \begin{macrocode}
2411 \DeclareOption{moles-index}{}
2412 \DeclareOption{moles-range}{ \@@_set_moles_range }
2413 \cs_new:Npn \@@_set_moles_range {%
2414 \RenewDocumentCommand{\allcomponents}{O{} m}
2415 { {##2}\c_math_subscript_token 1,\dots,
2416 {##2}\c_math_subscript_token{\ncomponents} }
2417 \RenewDocumentCommand{\allbut}{O{j} m m}
2418 { \tl_if_eq:nnTF {##2} {1}
2419 { {##3}\c_math_subscript_token 2,\dots,
2420 {##3}\c_math_subscript_token{\ncomponents} }
2421 { \tl_if_eq:xxTF {##2} {\ncomponents}
2422 { {##3}\c_math_subscript_token 1,\dots,
2423 {##3}\c_math_subscript_token{\ncomponents-1} }
2424 { {##3}\c_math_subscript_token 1,\dots,
2425 [{##3}\c_math_subscript_token{##2}],
2426 \dots,{##3}\c_math_subscript_token{\ncomponents} }
2427 }
2428 }
2429 \RenewDocumentCommand{\allbutlastand}{O{j} m m}
2430 { \tl_if_eq:nnTF {##2} {1}
2431 { {##3}\c_math_subscript_token 2,\dots,
2432 {##3}\c_math_subscript_token{\ncomponents-1} }
2433 { \tl_if_eq:xxTF {##2} {\ncomponents}
2434 { {##3}\c_math_subscript_token 1,\dots,
2435 {##3}\c_math_subscript_token{\ncomponents-1}
2436 }
2437 { \tl_if_eq:xxTF {##2} {\ncomponents-1}
2438 { {##3}\c_math_subscript_token 1,\dots,
2439 {##3}\c_math_subscript_token{\ncomponents-2} }
2440 {
2441 {##3}\c_math_subscript_token 1,\dots,
2442 [{##3}\c_math_subscript_token{##2}],\dots,
2443 {##3}\c_math_subscript_token{\ncomponents-1}
2444 }
2445 }
2446 }
2447 }
2448 }
2449 % \end{macrocode}
2450 % The remaining options define textbook-specific notation.
2451 % \changes{v2.02}{2024/06/14}{Added \texttt{KlotzRosenberg} option.}
2452 % \begin{macrocode}
2453 \DeclareOption{Bejan}{
2454 \ExecuteOptions{EUFGHAN,intensive-lowercase,delta,shortpm}
2455 \AtEndOfPackage{
2456 \cs_set:Nn \@@_specific:n {\text_lowercase:n {#1}}
2457 \cs_set:Nn \@@_intensive:n {\bar{\text_lowercase:n {#1}}}
2458 \cs_set:Nn \@@_extensive:n {\text_uppercase:n {#1}}
2459 \tl_gset:Nn \g_@@_volume_symbol v
2460 \RenewExpandableDocumentCommand{\ncomponents}{}{n}
2461 \RenewSubscriptedSymbol{\Lt}{\g_@@_Helmholtz_symbol}{\mu}
2462 \RenewSubscriptedSymbol{\Lm}
2463 {\bar{\text_lowercase:n \g_@@_Helmholtz_symbol}}{\mu}
2464 \RenewSubscriptedSymbol{\Ls}
2465 {\text_lowercase:n \g_@@_Helmholtz_symbol}{\mu}
2466 \cs_new:Npn \Delta_vap_sym {} {}
2467 \NewSubscriptedSymbol{\Delta_vap}{\Delta_vap_sym}{{fg}}
2468 \RenewDocumentCommand{\Deltavap}{m}{
2469 \cs_set:Npn \Delta_vap_sym {} {#1}
2470 \Delta_vap
2471 }
2472 \cs_new:Npn \Delta_fus_sym {} {}
2473 \NewSubscriptedSymbol{\Delta_fus}{\Delta_fus_sym}{{sf}}
2474 \RenewDocumentCommand{\Deltafus}{m}{
2475 \cs_set:Npn \Delta_fus_sym {} {#1}
2476 \Delta_fus
2477 }
2478 \cs_new:Npn \Delta_sub_sym {} {}
2479 \NewSubscriptedSymbol{\Delta_sub}{\Delta_sub_sym}{{sg}}
2480 \RenewDocumentCommand{\Deltasub}{m}{
2481 \cs_set:Npn \Delta_sub_sym {} {#1}
2482 \Delta_sub
2483 }
2484 \RenewExpandableDocumentCommand{\heatcapacitysymbol}{}{c}
2485 \RenewSubscriptedSymbol{\cV}{\@@_intensive:n {\heatcapacitysymbol}}
2486 {\text_lowercase:n \g_@@_volume_symbol}
2487 \RenewSubscriptedSymbol{\cVt}{\@@_extensive:n {\heatcapacitysymbol}}
2488 {\text_uppercase:n \g_@@_volume_symbol}
2489 \RenewSubscriptedSymbol{\cVpm}{\heatcapacitysymbol}
2490 {\text_lowercase:n \g_@@_volume_symbol}
2491 \RenewSubscriptedSymbol{\cPpm}{\heatcapacitysymbol}
2492 {\text_lowercase:n \g_@@_pressure_symbol}
2493 \RenewExpandableDocumentCommand{\xrxn}{}{\zeta}
2494 \RenewDocumentCommand{\fmix}{}{f}
2495 \RenewDocumentCommand{\Qm}{}{Q}
2496 \RenewDocumentCommand{\Qs}{}{Q}
2497 \RenewExpandableDocumentCommand{\kappaT}{}{\compressibilitysymbol}
2498 \RenewExpandableDocumentCommand{\expansivitysymbol}{}{\beta}
2499 \RenewExpandableDocumentCommand{\alphaP}{}{\expansivitysymbol}
2500 \RenewSubscriptedSymbol{\muJT}{\JTsymbol}{J}
2501 \RenewDocumentCommand{\Deltaf}{m}
2502 { \tl_set:Nn \l_@@_Deltaf_sym_tl {#1} \@@_Deltaf }
2503 \RenewDocumentCommand{\Pstd}{}{P\c_math_subscript_token 0}
2504 \RenewDocumentCommand{\Wm}{}{W}
2505 \RenewDocumentCommand{\Ws}{}{W}
2506 \cs_new:Nn \@@_fpure_one:n
2507 {
2508 f\c_math_subscript_token{#1}
2509 \peek_catcode_remove:NF \c_math_superscript_token
2510 { \c_math_superscript_token\bullet }
2511 }
2512 \RenewDocumentCommand{\fpure}{}
2513 {
2514 \peek_catcode_remove:NTF \c_math_subscript_token
2515 { \@@_fpure_one:n }
2516 { f }
2517 }
2518 \cs_new:Nn \@@_phipure_one:n
2519 {
2520 \phi\c_math_subscript_token{#1}
2521 \peek_catcode:NF \c_math_superscript_token
2522 { \c_math_superscript_token\bullet }
2523 }
2524 \RenewDocumentCommand{\phipure}{}
2525 {
2526 \peek_catcode_remove:NTF \c_math_subscript_token
2527 {
2528 \@@_phipure_one:n
2529 }
2530 {\phi}
2531 }
2532 \RenewDocumentCommand{\phimix}{}{\phi}
2533 }
2534 }
2535 \DeclareOption{CBK}{
2536 \ExecuteOptions{EUAGHAN,intensive-lowercase,delta,shortpm}
2537 \AtEndOfPackage{
2538 \cs_set:Nn \@@_overline:n {\widetilde #1}
2539 \cs_set:Nn \@@_overline_copy:n {\widetilde #1}
2540 \cs_set:Nn \@@_specific:n {\text_lowercase:n {#1}}
2541 \cs_set:Nn \@@_intensive:n {\bar{\text_lowercase:n{#1}}}
2542 \tl_gset:Nn \g_@@_area_symbol A
2543 \RenewExpandableDocumentCommand{\reaction}{}{R}
2544 \cs_new:Npn \Delta_vap_sym {} {}
2545 \NewSubscriptedSymbol{\Delta_vap}{\Delta_vap_sym}{{fg}}
2546 \RenewDocumentCommand{\Deltavap}{m}{
2547 \cs_set:Npn \Delta_vap_sym {} {#1}
2548 \Delta_vap
2549 }
2550 \cs_new:Npn \Delta_fus_sym {} {}
2551 \NewSubscriptedSymbol{\Delta_fus}{\Delta_fus_sym}{{sf}}
2552 \RenewDocumentCommand{\Deltafus}{m}{
2553 \cs_set:Npn \Delta_fus_sym {} {#1}
2554 \Delta_fus
2555 }
2556 \cs_new:Npn \Delta_sub_sym {} {}
2557 \NewSubscriptedSymbol{\Delta_sub}{\Delta_sub_sym}{{sg}}
2558 \RenewDocumentCommand{\Deltasub}{m}{
2559 \cs_set:Npn \Delta_sub_sym {} {#1}
2560 \Delta_sub
2561 }
2562 \tl_gset:Nn \g_@@_pressure_symbol p
2563 \RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\alpha}
2564 \RenewExpandableDocumentCommand{\expansivitysymbol}{}{\beta}
2565 \RenewExpandableDocumentCommand{\kappaT}{}{\compressibilitysymbol}
2566 \RenewExpandableDocumentCommand{\alphaP}{}{\expansivitysymbol}
2567 \RenewSuperscriptedSymbol{\Psat}{P}{v}
2568 \RenewDocumentCommand{\Deltaf}{m}
2569 { \tl_set:Nn \l_@@_Deltaf_sym_tl {#1}
2570 \@@_Deltaf
2571 }
2572 \RenewDocumentCommand{\Pstd}{}{P\c_math_subscript_token 0}
2573 \RenewDocumentCommand{\Lm}{}{\@@_intensive:n\omega}
2574 \RenewDocumentCommand{\Ls}{}{\@@_specific:n\omega}
2575 }
2576 }
2577 \DeclareOption{ElliottLira}{
2578 \ExecuteOptions{shortpm}
2579 \AtEndOfPackage{
2580 \cs_gset_eq:NN \@@_specific:n \@@_intensive:n
2581 %^^A\RenewDocumentCommand{\partialmolar}{m}{\@@_overline:n #1}
2582 \RenewDocumentCommand{\allcomponents}{O{} m}{#2}
2583 \RenewDocumentCommand{\Deltarxn}{m}{\Delta #1}
2584 \RenewDocumentCommand{\fusion}{}{{fus}}
2585 \RenewDocumentCommand{\sublimation}{}{{sub}}
2586 \RenewDocumentCommand{\vaporization}{}{{vap}}
2587 \RenewDocumentCommand{\sat}{}{{sat}}
2588 %^^A\RenewSubscriptedSymbol{\Henrymol}{/K}{H} %^^A FIXME
2589 \RenewDocumentCommand{\IG}{}{{ig}}
2590 \RenewDocumentCommand{\IGM}{}{{ig}}
2591 \RenewDocumentCommand{\IS}{}{{is}}
2592 \RenewDocumentCommand{\Cstd}{}{m\c_math_superscript_token \std}
2593 \RenewDocumentCommand{\muJT}{}{\mu\c_math_subscript_token{JT}}
2594 }
2595 }
2596 \DeclareOption{KlotzRosenberg}{
2597 \ExecuteOptions{delta}
2598 \AtEndOfPackage{
2599 \tl_set:Nn \l_@@_sub_separator_tl {}
2600 \cs_set:Nn \@@_extensive:n {#1}
2601 \cs_new:Nn \@@_intensive_one:n
2602 {
2603 \c_math_superscript_token {#1}
2604 \peek_catcode_remove:NTF \c_math_subscript_token
2605 { \@@_intensive_three:n }
2606 { \c_math_subscript_token{\mathrm{m}} }
2607 }
2608 \cs_new:Nn \@@_intensive_three:n
2609 { \c_math_subscript_token{\mathrm{m}\l_@@_sub_separator_tl #1} }
2610 \cs_new:Nn \@@_intensive_two:n
2611 {
2612 \c_math_subscript_token{\mathrm{m}\l_@@_sub_separator_tl #1}
2613 \peek_catcode:NF \c_math_superscript_token
2614 { \c_math_superscript_token\bullet }
2615 }
2616 \cs_set:Nn \@@_intensive:n
2617 {
2618 #1
2619 \peek_catcode_remove:NTF \c_math_superscript_token
2620 { \@@_intensive_one:n }
2621 { \peek_catcode_remove:NTF \c_math_subscript_token
2622 { \@@_intensive_two:n }
2623 { \c_math_subscript_token{\mathrm{m}} }
2624 }
2625 }
2626 \cs_new:Nn \@@_fpure_one:n
2627 {
2628 f\c_math_subscript_token{#1}
2629 \peek_catcode_remove:NF \c_math_superscript_token
2630 { \c_math_superscript_token\bullet }
2631 }
2632 \RenewDocumentCommand{\fpure}{}
2633 {
2634 \peek_catcode_remove:NTF \c_math_subscript_token
2635 { \@@_fpure_one:n }
2636 { f }
2637 }
2638 \cs_new:Nn \@@_phipure_one:n
2639 {
2640 \gamma\c_math_subscript_token{#1}
2641 \peek_catcode_remove:NF \c_math_superscript_token
2642 { \c_math_superscript_token\bullet }
2643 }
2644 \RenewDocumentCommand{\phipure}{}
2645 {
2646 \peek_catcode_remove:NTF \c_math_subscript_token
2647 { \@@_phipure_one:n }
2648 { \gamma }
2649 }
2650 \RenewDocumentCommand{\fmix}{}{f}
2651 \RenewDocumentCommand{\phimix}{}{\gamma}
2652 \RenewDocumentCommand{\phisat}{}{\gamma^\sat}
2653 \cs_if_exist:NTF \gammaup
2654 { \RenewDocumentCommand{\gamma}{}{\gammaup} }
2655 { \cs_if_exist:NT \upgamma
2656 { \RenewDocumentCommand{\gamma}{}{\upgamma} }
2657 }
2658 \RenewDocumentCommand{\gammarat}{}{\gamma}
2659 \RenewDocumentCommand{\gammamol}{}{\gamma}
2660 \cs_if_exist:NTF \muup
2661 {\RenewDocumentCommand{\mu}{}{\muup}}
2662 {\cs_if_exist:NT \upmu
2663 {\RenewDocumentCommand{\mu}{}{\upmu}}
2664 }
2665 \cs_if_exist:NTF \alphaup
2666 {\RenewExpandableDocumentCommand{\expansivitysymbol}{}{\alphaup}}
2667 {\cs_if_exist:NTF \upalpha
2668 {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\alphaup}}
2669 {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\alpha}}
2670 }
2671 \cs_if_exist:NTF \betaup
2672 {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\betaup}}
2673 {\cs_if_exist:NTF \upbeta
2674 {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\betaup}}
2675 {\RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\beta}}
2676 }
2677 \cs_if_exist:NTF \xiup
2678 {\RenewDocumentCommand{\xrxn}{}{\xiup}}
2679 {\cs_if_exist:NT \upxi
2680 {\RenewDocumentCommand{\xrxn}{}{\upxi}}
2681 }
2682 \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
2683 \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
2684 \RenewSubscriptedSymbol{\muJT}{\JTsymbol}{\text{J.T.}}
2685 \RenewDocumentCommand{\Deltarxn}{m}{\Delta #1}
2686 \RenewDocumentCommand{\Deltaf}{}{\Delta\c_math_subscript_token\formation}
2687 \RenewDocumentCommand{\Deltafus}{}{\Delta}
2688 \RenewDocumentCommand{\Deltavap}{}{\Delta}
2689 \RenewDocumentCommand{\Deltasub}{}{\Delta}
2690 %^^A FIXME: should be \Delta G_{\text{mix},\mathrm{m}} not other way around
2691 \RenewDocumentCommand{\Deltamix}{m}{
2692 \tl_set:Nn \l_@@_sub_separator_tl {,}
2693 \Delta #1\c_math_subscript_token{\mixing}
2694 }
2695 \RenewDocumentCommand{\excess}{}{{\mathrm{E}}}
2696 \RenewDocumentCommand{\residual}{}{{\mathrm{R}}}
2697 \cs_set:Nn \@@_overline:n {#1}
2698 \RenewDocumentCommand{\IS}{}{{\mathrm{I}}}
2699 \RenewDocumentCommand{\Psat}{}
2700 {
2701 \peek_catcode:NTF \c_math_subscript_token
2702 {p\c_math_superscript_token\bullet}
2703 {p}
2704 }
2705 \RenewDocumentCommand{\Cstd}{}{m^\std}
2706 \RenewDocumentCommand{\Henryrat}{}{k}
2707 \RenewDocumentCommand{\Henrymol}{}{k''}
2708
2709 % Fix partial molar properties
2710 \cs_set:Npn \@@_pm_case_one #1
2711 {
2712 \l_@@_pm_symbol_tl\c_math_subscript_token{\mathrm{m}#1}
2713 }
2714 \cs_set:Npn \@@_pm_case_two [#1]#2
2715 {
2716 \l_@@_pm_symbol_tl
2717 \c_math_superscript_token{#1}\c_math_subscript_token{\mathrm{m}#2}
2718 }
2719 \cs_set:Npn \@@_pm_case_three_part_two #1
2720 {
2721 \l_@@_pm_symbol_tl
2722 \c_math_superscript_token{\l_@@_pm_arg_tl}
2723 \c_math_subscript_token{\mathrm{m}#1}
2724 }
2725 \cs_set:Npn \@@_pm_case_four #1
2726 {
2727 \l_@@_pm_symbol_tl\c_math_superscript_token{#1}
2728 \c_math_subscript_token{\mathrm{m}\l_@@_pm_arg_tl}
2729 }
2730 \cs_set:Npn \@@_pm_case_five
2731 {
2732 \l_@@_pm_symbol_tl
2733 \c_math_subscript_token{\mathrm{m}\l_@@_pm_arg_tl}
2734 }
2735
2736 % fix heat capacities
2737 \RenewSubscriptedSymbol{\cP}{\heatcapacitysymbol}
2738 {\g_@@_pressure_symbol\mathrm{m}}
2739 \RenewSubscriptedSymbol{\cV}{\heatcapacitysymbol}
2740 {\g_@@_volume_symbol\mathrm{m}}
2741 \RenewDocumentCommand{\cPpm}{}{\partialmolar{\cPt}}
2742 \RenewDocumentCommand{\cVpm}{}{\partialmolar{\cVt}}
2743
2744 \cs_set:Npn \cP_two:n #1
2745 { \heatcapacitysymbol
2746 \c_math_subscript_token{\g_@@_pressure_symbol\mathrm{m}
2747 \l_@@_sub_separator_tl #1}
2748 \peek_catcode:NF \c_math_superscript_token
2749 { \c_math_superscript_token\bullet }
2750 }
2751 \cs_set:Npn \cV_two:n #1
2752 { \heatcapacitysymbol
2753 \c_math_subscript_token{\g_@@_volume_symbol\mathrm{m}
2754 \l_@@_sub_separator_tl #1}
2755 \peek_catcode:NF \c_math_superscript_token
2756 { \c_math_superscript_token\bullet }
2757 }
2758 }
2759 \AtBeginDocument{
2760 \@ifpackageloaded{emf}{\RenewDocumentCommand{\Epot}{}{\emf}}
2761 {%
2762 \PackageWarningNoLine{thermodynamics}
2763 {Package~emf~not~loaded;~load~to~make~Epot~match~Klotz~
2764 and~Rosenberg's~notation}%
2765 }
2766 }
2767 }
2768 \DeclareOption{Koretsky}{
2769 \ExecuteOptions{EUAGHAn,brackets,intensive-lowercase,delta,shortpm}
2770 \AtEndOfPackage{
2771 \tl_gset:Nn \g_@@_area_symbol {A}
2772 \RenewExpandableDocumentCommand{\std}{}{o}
2773 \RenewExpandableDocumentCommand{\ncomponents}{}{m}
2774 \RenewDocumentCommand{\partialmolar}{m}
2775 {
2776 \tl_set:Nn \l_@@_pm_symbol_tl {#1}
2777 \@@_generic_pm:
2778 }
2779 \RenewDocumentCommand{\expansivitysymbol}{}{\beta}
2780 \RenewDocumentCommand{\IS}{}{{\text{ideal}}}
2781 \RenewDocumentCommand{\residual}{}{{\text{dep}}}
2782 \RenewDocumentCommand{\IG}{}{{\text{ideal~gas}}}
2783 \RenewDocumentCommand{\IGM}{}{{\text{ideal}}}
2784 \RenewDocumentCommand{\Henryrat}{}{{\mathcal{H}}}
2785 \RenewDocumentCommand{\gammarat}{}
2786 {\gamma\c_math_superscript_token\text{Henry's}}
2787 \RenewDocumentCommand{\gammamol}{}{\gamma\c_math_superscript_token{m}}
2788 \RenewDocumentCommand{\phipure}{}{\varphi}
2789 \RenewDocumentCommand{\phimix}{}{\hat\varphi}
2790 \RenewDocumentCommand{\phisat}{}{\varphi\c_math_superscript_token\sat}
2791 \cs_new:Npn \Delta_fus_sym {} {}
2792 \NewSubscriptedSymbol{\Delta_fus}{\Delta_fus_sym}{\fusion}
2793 \RenewDocumentCommand{\Deltafus}{m}{
2794 \cs_set:Npn \Delta_fus_sym {} { \Delta #1 }
2795 \Delta_fus
2796 }
2797 \cs_new:Npn \Delta_vap_sym {} {}
2798 \NewSubscriptedSymbol{\Delta_vap}{\Delta_vap_sym}{\vaporization}
2799 \RenewDocumentCommand{\Deltavap}{m}{
2800 \cs_set:Npn \Delta_vap_sym {} { \Delta #1 }
2801 \Delta_vap
2802 }
2803 \cs_new:Npn \Delta_sub_sym {} {}
2804 \NewSubscriptedSymbol{\Delta_sub}{\Delta_sub_sym}{\sublimation}
2805 \RenewDocumentCommand{\Deltasub}{m}{
2806 \cs_set:Npn \Delta_sub_sym {} { \Delta #1 }
2807 \Delta_sub
2808 }
2809 \tl_new:N \l_@@_Deltaf_superscript_tl
2810 \tl_new:N \l_@@_Deltaf_subscript_tl
2811 \bool_new:N \l_@@_Deltaf_parentheses_bool
2812 \tl_new:N \l_@@_Deltaf_entity_tl
2813 \cs_set:Nn \@@_Deltaf_one:n
2814 {
2815 \tl_set:Nn \l_@@_Deltaf_superscript_tl {#1}
2816 \peek_catcode_remove:NTF \c_math_subscript_token
2817 {
2818 \bool_set_true:N \l_@@_Deltaf_parentheses_bool
2819 \@@_Deltaf_two:n
2820 }
2821 {
2822 \bool_if:NTF \l_@@_Deltaf_parentheses_bool
2823 {
2824 (\Delta\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
2825 \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
2826 { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
2827 )
2828 \tl_if_empty:NF \l_@@_Deltaf_subscript_tl
2829 { \c_math_subscript_token\l_@@_Deltaf_subscript_tl }
2830 }
2831 {
2832 \Delta\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
2833 \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
2834 { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
2835 }
2836 }
2837 }
2838 \cs_set:Nn \@@_Deltaf_two:n
2839 {
2840 \tl_set:Nn \l_@@_Deltaf_subscript_tl {#1}
2841 % check for case 4
2842 \peek_catcode_remove:NTF \c_math_superscript_token
2843 { \@@_Deltaf_one:n }
2844 {
2845 \bool_if:NTF \l_@@_Deltaf_parentheses_bool
2846 {
2847 (\Delta\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
2848 \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
2849 {\c_math_superscript_token\l_@@_Deltaf_superscript_tl}
2850 )
2851 \tl_if_empty:NF \l_@@_Deltaf_subscript_tl
2852 \c_math_subscript_token\l_@@_Deltaf_subscript_tl
2853 }
2854 {
2855 \Delta\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
2856 \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
2857 {\c_math_superscript_token\l_@@_Deltaf_superscript_tl}
2858 }
2859 }
2860 }
2861 \RenewDocumentCommand{\Deltaf}{m}
2862 {
2863 \tl_clear:N \l_@@_Deltaf_superscript_tl
2864 \tl_clear:N \l_@@_Deltaf_subscript_tl
2865 \tl_set:Nn \l_@@_Deltaf_entity_tl {#1}
2866 \bool_set_false:N \l_@@_Deltaf_parentheses_bool
2867 \peek_catcode_remove:NTF \c_math_superscript_token
2868 {
2869 \@@_Deltaf_one:n
2870 }
2871 {
2872 \peek_catcode_remove:NTF \c_math_subscript_token
2873 {
2874 \bool_set_true:N \l_@@_Deltaf_parentheses_bool
2875 \@@_Deltaf_two:n
2876 }
2877 {
2878 \Delta #1\c_math_subscript_token \formation
2879 }
2880 }
2881 }
2882 \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
2883 \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
2884 \RenewSubscriptedSymbol{\cV}{\@@_intensive:n \heatcapacitysymbol}
2885 {\@@_intensive:n \g_@@_volume_symbol}
2886 \RenewSubscriptedSymbol{\cVs}{\@@_specific:n \heatcapacitysymbol}
2887 {\@@_intensive:n \g_@@_volume_symbol}
2888 \RenewDocumentCommand{\Lm}{}{\omega}
2889 \RenewDocumentCommand{\Ls}{}{\hat\omega}
2890 }
2891 }
2892 \DeclareOption{MSBB}{
2893 \ExecuteOptions{EUFGHAn,intensive-lowercase,delta,shortpm}
2894 \AtEndOfPackage{
2895 \RenewDocumentCommand{\IGM}{}{\ast} % FIXME: is this * or \circ?
2896 \RenewDocumentCommand{\IG}{}{\ast}
2897 \RenewDocumentCommand{\expansivitysymbol}{}{\beta}
2898 \RenewDocumentCommand{\muJT}{}{\mu\c_math_subscript_token J}
2899 \RenewDocumentCommand{\allcomponents}{O{} m}{#2}
2900 \RenewDocumentCommand{\allbut}{O{j} m m}
2901 {
2902 \tl_if_eq:nnTF {#1} {#2}
2903 { {#3}\c_math_subscript_token k }
2904 { {#3}\c_math_subscript_token{#1} }
2905 }
2906 \tl_gset_eq:NN \g_@@_Helmholtz_symbol \psi
2907 \RenewDocumentCommand{\Ft}{}{\Psi}
2908 \RenewDocumentCommand{\Fpm}{}{\partialmolar{\Psi}}
2909 \cs_set:Nn \@@_intensive:n {\@@_overline:n{\text_lowercase:n{#1}}}
2910 \cs_set:Nn \@@_specific:n {\text_lowercase:n{#1}}
2911 \RenewDocumentCommand{\fmix}{}{\bar f}
2912 \RenewDocumentCommand{\phimix}{}{\bar\phi}
2913 \RenewDocumentCommand{\phimix}{}{\bar\phi}
2914 \tl_gset:Nn \g_@@_pressure_symbol p
2915 \tl_gset:Nn \g_@@_volume_symbol v
2916 \RenewDocumentCommand{\partialmolar}{m}
2917 {
2918 \tl_set:Nn \l_@@_pm_symbol_tl {\text_uppercase:n #1}
2919 \@@_generic_pm:
2920 }
2921 \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
2922 \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
2923 \RenewDocumentCommand{\mustd}{}{\Gm^\std}
2924 \RenewExpandableDocumentCommand{\formation}{}{{\mathrm{f}}}
2925 \RenewDocumentCommand{\Pstd}{}
2926 {\g_@@_pressure_symbol\c_math_subscript_token\text{ref}}
2927 \RenewExpandableDocumentCommand{\xrxn}{}{\varepsilon}
2928 \RenewExpandableDocumentCommand{\Lm}{}{\@@_intensive:n \omega}
2929 \RenewExpandableDocumentCommand{\Ls}{}{\@@_specific:n \omega}
2930 \RenewExpandableDocumentCommand{\heatcapacitysymbol}{}{C}
2931 \tl_new:N \l_@@_Deltaf_superscript_tl
2932 \tl_new:N \l_@@_Deltaf_subscript_tl
2933 \bool_new:N \l_@@_Deltaf_parentheses_bool
2934 \tl_new:N \l_@@_Deltaf_entity_tl
2935 \cs_set:Nn \@@_Deltaf_one:n
2936 {
2937 \tl_set:Nn \l_@@_Deltaf_superscript_tl {#1}
2938 \peek_catcode_remove:NTF \c_math_subscript_token
2939 {
2940 \bool_set_true:N \l_@@_Deltaf_parentheses_bool
2941 \@@_Deltaf_two:n
2942 }
2943 {
2944 \bool_if:NTF \l_@@_Deltaf_parentheses_bool
2945 {
2946 (\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
2947 \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
2948 { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
2949 )
2950 \tl_if_empty:NF \l_@@_Deltaf_subscript_tl
2951 { \c_math_subscript_token\l_@@_Deltaf_subscript_tl }
2952 }
2953 {
2954 \l_@@_Deltaf_entity_tl\c_math_subscript_token{\formation}
2955 \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
2956 { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
2957 }
2958 }
2959 }
2960 \cs_set:Nn \@@_Deltaf_two:n
2961 {
2962 \tl_set:Nn \l_@@_Deltaf_subscript_tl {#1}
2963 % check for case 4
2964 \peek_catcode_remove:NTF \c_math_superscript_token
2965 { \@@_Deltaf_one:n }
2966 {
2967 \bool_if:NTF \l_@@_Deltaf_parentheses_bool
2968 {
2969 (\l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
2970 \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
2971 { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
2972 )
2973 \tl_if_empty:NF \l_@@_Deltaf_subscript_tl
2974 { \c_math_subscript_token\l_@@_Deltaf_subscript_tl }
2975 }
2976 {
2977 \l_@@_Deltaf_entity_tl\c_math_subscript_token\formation
2978 \tl_if_empty:NF \l_@@_Deltaf_superscript_tl
2979 { \c_math_superscript_token\l_@@_Deltaf_superscript_tl }
2980 }
2981 }
2982 }
2983 \RenewDocumentCommand{\Deltaf}{m}
2984 {
2985 \tl_clear:N \l_@@_Deltaf_superscript_tl
2986 \tl_clear:N \l_@@_Deltaf_subscript_tl
2987 \tl_set:Nn \l_@@_Deltaf_entity_tl {#1}
2988 \bool_set_false:N \l_@@_Deltaf_parentheses_bool
2989 \peek_catcode_remove:NTF \c_math_superscript_token
2990 {
2991 \@@_Deltaf_one:n
2992 }
2993 {
2994 \peek_catcode_remove:NTF \c_math_subscript_token
2995 {
2996 \bool_set_true:N \l_@@_Deltaf_parentheses_bool
2997 \@@_Deltaf_two:n
2998 }
2999 {
3000 \Delta #1\c_math_subscript_token \formation
3001 }
3002 }
3003 }
3004 }
3005 }
3006 \DeclareOption{Prausnitz}{
3007 \ExecuteOptions{intensive-lowercase,shortpm}
3008 \AtEndOfPackage{
3009 \RenewExpandableDocumentCommand{\ncomponents}{}{m}
3010 \RenewDocumentCommand{\fmix}{}{f}
3011 \RenewDocumentCommand{\fsat}{}{\fpure\c_math_superscript_token\sat}
3012 % TODO: this should pick up H_2 and make it into H_{2,1} (assuming
3013 % the solvent is always 1...?)
3014 \RenewDocumentCommand{\Henryrat}{}{H}
3015 %^^A\RenewDocumentCommand{\residual}{}{{{\mathcal{R}}}}
3016 \RenewDocumentCommand{\allcomponents}{O{i} m}
3017 { {#2}\c_math_subscript_token{#1} }
3018 \RenewDocumentCommand{\allbut}{O{i} m m}
3019 { \tl_if_eq:nnTF {#1} {#2}
3020 { {#3}\c_math_subscript_token k }
3021 { {#3}\c_math_subscript_token{#1} }
3022 }
3023 \tl_set:Nn \l_@@_sub_separator_tl {\,}
3024 \tl_gset:Nn \g_@@_pressure_symbol {p}
3025 \tl_gset:Nn \g_@@_volume_symbol {v}
3026 \RenewSubscriptedSymbol{\fpure}{f}{{\text{pure}}}
3027 \RenewDocumentCommand{\phimix}{}{\varphi}
3028 \RenewDocumentCommand{\phisat}{}{\varphi^\sat}
3029 \RenewDocumentCommand{\sat}{}{s}
3030 \RenewDocumentCommand{\mixing}{}{\text{mixing}}
3031 \RenewDocumentCommand{\Lm}{}{\omega}
3032 \RenewDocumentCommand{\Ls}{}{\@@_specific:n \omega}
3033 \RenewSubscriptedSymbol{\phipure}{\varphi}{{\text{pure}}}
3034 \RenewDocumentCommand{\IG}{}{{\text{id}}}
3035 \RenewDocumentCommand{\IGM}{}{{\text{id}}}
3036 \RenewDocumentCommand{\IS}{}{{\text{(ideal)}}}
3037 \RenewExpandableDocumentCommand{\compressibilitysymbol}{}{\beta}
3038 \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
3039 \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
3040 \RenewExpandableDocumentCommand{\std}{}{0}
3041 \@ifpackageloaded{emf}
3042 {\RenewDocumentCommand{\Epot}{}{\emf}}
3043 {\RenewDocumentCommand{\Epot}{}{\mathcal{E}}}
3044 \DeclareMathAlphabet{\mathdutchcal}{U}{dutchcal}{m}{n}
3045 \RenewExpandableDocumentCommand{\actrel}{}{\mathdutchcal{a}}
3046 }
3047 }
3048 \DeclareOption{Sandler}{
3049 \ExecuteOptions{EUAGHaN,extensive-plain,shortpm}
3050 \AtEndOfPackage{
3051 \RenewDocumentCommand{\Pvap}{}
3052 {{P\c_math_superscript_token{\text{vap}}}}
3053 \RenewDocumentCommand{\excess}{}{{\text{ex}}}
3054 \RenewDocumentCommand{\residual}{}{{\text{r}}}
3055 \RenewExpandableDocumentCommand{\ncomponents}{}{\mathcal{C}}
3056 \RenewDocumentCommand{\fmix}{}{\bar f}
3057 \RenewDocumentCommand{\fstd}{}{\bar f\c_math_superscript_token\std}
3058 \RenewDocumentCommand{\phimix}{}{\bar\phi}
3059 \RenewDocumentCommand{\allcomponents}{O{} m}{\@@_underline:n{#2}}
3060 \RenewDocumentCommand{\IG}{}{{\text{IG}}}
3061 \RenewDocumentCommand{\IGM}{}{{\text{IGM}}}
3062 \RenewDocumentCommand{\IS}{}{{\text{IM}}}
3063 \RenewDocumentCommand{\Deltamix}{m}
3064 {\Delta\c_math_subscript_token\mixing #1}
3065 \RenewDocumentCommand{\Deltarxn}{m}
3066 {\Delta\c_math_subscript_token\reaction #1}
3067 \RenewDocumentCommand{\Deltasub}{m}
3068 {\Delta\c_math_subscript_token\sublimation #1}
3069 \RenewDocumentCommand{\Deltafus}{m}
3070 {\Delta\c_math_subscript_token\fusion #1}
3071 \RenewDocumentCommand{\Deltavap}{m}
3072 {\Delta\c_math_subscript_token\vaporization #1}
3073 \RenewDocumentCommand{\Pstd}{}{\text{1~bar}
3074 \peek_catcode_remove:NT \c_math_subscript_token {\use_none:n}
3075 }
3076 \RenewDocumentCommand{\Cstd}{}{\text{1~molal}
3077 \peek_catcode_remove:NT \c_math_subscript_token {\use_none:n}
3078 }
3079 \RenewDocumentCommand{\Henryrat}{}{H}
3080 \RenewSubscriptedSymbol{\cV}
3081 {\heatcapacitysymbol}{\g_@@_volume_symbol}
3082 \RenewSubscriptedSymbol{\cP}
3083 {\heatcapacitysymbol}{\g_@@_pressure_symbol}
3084 \RenewSubscriptedSymbol{\cVt}
3085 {\Nt\heatcapacitysymbol}{\g_@@_volume_symbol}
3086 \RenewSubscriptedSymbol{\cPt}
3087 {\Nt\heatcapacitysymbol}{\g_@@_pressure_symbol}
3088 \RenewDocumentCommand{\formation}{}{\mathrm{f}}
3089 \RenewDocumentCommand{\Deltaf}{}
3090 {\Delta\c_math_subscript_token\formation}
3091 \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
3092 \RenewDocumentCommand{\muJT}{}{\mu}
3093 \RenewDocumentCommand{\xrxn}{}{X}
3094 }
3095 }
3096 \DeclareOption{SVNAS}{
3097 \ExecuteOptions{extensive-superscript,shortpm}
3098 \AtEndOfPackage{
3099 \RenewDocumentCommand{\allcomponents}{O{} m}{#2}
3100 \RenewDocumentCommand{\allbut}{O{j} m m}
3101 {
3102 \tl_if_eq:nnTF {#1} {#2}
3103 { {#3}\c_math_subscript_token k }
3104 { {#3}\c_math_subscript_token{#1} }
3105 }
3106 \RenewDocumentCommand{\IG}{}{{ig}}
3107 \RenewDocumentCommand{\IGM}{}{{ig}}
3108 \RenewDocumentCommand{\IS}{}{{id}}
3109 \RenewDocumentCommand{\IS}{}{{id}}
3110 \RenewDocumentCommand{\fusion}{}{{sl}}
3111 \RenewDocumentCommand{\vaporization}{}{{vl}}
3112 \RenewDocumentCommand{\sublimation}{}{{vs}}
3113 \RenewDocumentCommand{\expansivitysymbol}{}{\beta}
3114 \RenewDocumentCommand{\xrxn}{}{\varepsilon}
3115 \RenewDocumentCommand{\Deltarxn}{m}{\Delta #1}
3116 \RenewDocumentCommand{\Deltamix}{m}{\Delta #1}
3117 \RenewSubscriptedSymbol{\cVt}
3118 {\Nt\heatcapacitysymbol}{\g_@@_volume_symbol}
3119 \RenewSubscriptedSymbol{\cPt}
3120 {\Nt\heatcapacitysymbol}{\g_@@_pressure_symbol}
3121 % FIXME
3122 \RenewDocumentCommand{\cP}{}
3123 {{\heatcapacitysymbol\c_math_subscript_token\g_@@_pressure_symbol}}
3124 \RenewDocumentCommand{\cV}{}
3125 {{\heatcapacitysymbol\c_math_subscript_token\g_@@_volume_symbol}}
3126 \RenewDocumentCommand{\kappaT}{}{\compressibilitysymbol}
3127 \RenewDocumentCommand{\alphaP}{}{\expansivitysymbol}
3128 \RenewDocumentCommand{\muJT}{}{\mu}
3129 \RenewDocumentCommand{\Cstd}{}{m\c_math_superscript_token\std
3130 \peek_catcode_remove:NT \c_math_subscript_token {\use_none:n}
3131 }
3132 \RenewDocumentCommand{\mustd}{}{\Gm\c_math_superscript_token\std}
3133 \RenewDocumentCommand{\Henryrat}{}{\mathcal{H}}
3134 \RenewDocumentCommand{\formation}{}
3135 {
3136 \tl_set:Nn \l_@@_sub_separator_tl {}
3137 f298
3138 }
3139 \cs_set:Nn \@@_specific:n {#1}
3140 }
3141 }
3142 \DeclareOption{ModellReid}{\ExecuteOptions{TesterModell}}
3143 \DeclareOption{TesterModell}{
3144 \ExecuteOptions{EUAGHaN,delta,shortpm}
3145 \AtEndOfPackage{
3146 \cs_set:Nn \@@_specific:n {\text_lowercase:n{#1}}
3147 \RenewExpandableDocumentCommand{\ncomponents}{}{n}
3148 \RenewDocumentCommand{\allcomponents}{O{i} m}
3149 {
3150 {#2}\c_math_subscript_token{#1}
3151 }
3152 \RenewDocumentCommand{\allbut}{O{i} m m}
3153 { \tl_if_eq:nnTF {#1} {#2}
3154 { {#3}\c_math_subscript_token{k}[#2] }
3155 { {#3}\c_math_subscript_token{#1}[#2] }
3156 }
3157 \RenewDocumentCommand{\allbutlastand}{O{j} m m}
3158 { \tl_if_eq:xxTF {#2} {\ncomponents}
3159 { {#3}\c_math_subscript_token{#1}\relax[#2] }
3160 { \tl_if_eq:nnTF {#1} {#2}
3161 { {#3}\c_math_subscript_token{k}[#2,\ncomponents] }
3162 { {#3}\c_math_subscript_token{#1}[#2,\ncomponents] }
3163 }
3164 }
3165 \RenewDocumentCommand{\IG}{}{{o}}
3166 \RenewDocumentCommand{\IGM}{}{{o}}
3167 \RenewDocumentCommand{\IS}{}{{ID}}
3168 \RenewDocumentCommand{\excess}{}{{EX}}
3169 \RenewDocumentCommand{\reaction}{}{{rx}}
3170 \RenewDocumentCommand{\Henryrat}{}
3171 {f\c_math_superscript_token{\ast\ast}}
3172 \RenewDocumentCommand{\Henrymol}{}{f\c_math_superscript_token\ast}
3173 \cs_if_exist:NTF \gammaup
3174 { \RenewDocumentCommand{\gamma}{}{\gammaup} }
3175 { \cs_if_exist:NT \upgamma
3176 { \RenewDocumentCommand{\gamma}{}{\upgamma} }
3177 }
3178 \RenewDocumentCommand{\gammarat}{}
3179 {\gamma\c_math_superscript_token{\ast\ast}}
3180 \RenewDocumentCommand{\gammamol}{}
3181 {\gamma\c_math_superscript_token\ast}
3182 \RenewExpandableDocumentCommand{\JTsymbol}{}{\alpha}
3183 \RenewSubscriptedSymbol{\muJT}{\JTsymbol}{H}
3184 \cs_if_exist:NTF \xiup
3185 { \RenewDocumentCommand{\xrxn}{}{\xiup} }
3186 { \cs_if_exist:NT \upxi
3187 { \RenewDocumentCommand{\xrxn}{}{\upxi} }
3188 }
3189 \cs_if_exist:NTF \phiup
3190 {
3191 \RenewDocumentCommand{\phipure}{}{\phiup}
3192 \RenewDocumentCommand{\phimix}{}{\hat\phiup}
3193 \RenewDocumentCommand{\phisat}{}{\phiup\c_math_superscript_token\sat}
3194 }
3195 { \cs_if_exist:NT \upphi
3196 {
3197 \RenewDocumentCommand{\phipure}{}{\upphi}
3198 \RenewDocumentCommand{\phimix}{}{\hat\upphi}
3199 \RenewDocumentCommand{\phisat}{}{\upphi\c_math_superscript_token\sat}
3200 }
3201 }
3202 \RenewDocumentCommand{\Cstd}{}{m\c_math_superscript_token+
3203 \peek_catcode_remove:NT \c_math_subscript_token {\use_none:n}
3204 }
3205 \cs_if_exist:NTF \muup
3206 { \RenewDocumentCommand{\mu}{}{\muup} }
3207 { \cs_if_exist:NT \upmu
3208 { \RenewDocumentCommand{\mu}{}{\upmu} }
3209 }
3210 \RenewDocumentCommand{\std}{}{o}
3211 \RenewDocumentCommand{\Pstd}{}{P^\ast}
3212 \tl_gset:Nn \g_@@_area_symbol {\text{\large\(\mathit{a}\)}}
3213 \RenewDocumentCommand{\Epot}{}{\exists}
3214 \tl_set:Nn \l_@@_sub_separator_tl {}
3215 \tl_gset:Nn \g_@@_pressure_symbol {p}
3216 \RenewSubscriptedSymbol{\cVt}{\@@_extensive:n {\heatcapacitysymbol}}{v}
3217 \RenewSubscriptedSymbol{\cV}{\@@_intensive:n {\heatcapacitysymbol}}{v}
3218 \RenewSubscriptedSymbol{\cVs}{\@@_specific:n {\heatcapacitysymbol}}{v}
3219 }
3220 }
3221 \DeclareOption{Thompson}{
3222 \ExecuteOptions{EUAGHAn,delta,shortpm}
3223 \AtEndOfPackage
3224 {
3225 \RenewDocumentCommand{\excess}{}{{EX}}
3226 \RenewDocumentCommand{\residual}{}{{R}}
3227 \RenewDocumentCommand{\actrel}{}{\widehat{a}}
3228 \RenewSubscriptedSymbol{\Henryrat}{k}{H}
3229 \RenewSubscriptedSymbol{\Henrymol}{k}{H}
3230 \RenewDocumentCommand{\allcomponents}{O{j} m}
3231 {
3232 {#2}\c_math_subscript_token{#1}
3233 }
3234 \RenewDocumentCommand{\allNs}{O{j}}{\allcomponents[#1]{\Nt}}
3235 \RenewDocumentCommand{\allXs}{O{j}}{\allcomponents[#1]{x}}
3236 \RenewDocumentCommand{\allYs}{O{j}}{\allcomponents[#1]{y}}
3237 \RenewDocumentCommand{\allmus}{O{j}}{\allcomponents[#1]{\mu}}
3238 \RenewDocumentCommand{\allMs}{O{j}}{\allcomponents[#1]{m}}
3239 \RenewDocumentCommand{\allWs}{O{j}}{\allcomponents[#1]{w}}
3240 \RenewExpandableDocumentCommand{\ncomponents}{}{c}
3241 \RenewDocumentCommand{\IS}{}{{IS}}
3242 \RenewDocumentCommand{\IG}{}{{IG}}
3243 \RenewDocumentCommand{\IGM}{}{{IG}}
3244 \cs_new:Nn \@@_fpure_one:n
3245 {
3246 f\c_math_subscript_token{#1}
3247 \peek_catcode_remove:NF \c_math_superscript_token
3248 { \c_math_superscript_token\bullet }
3249 }
3250 \RenewDocumentCommand{\fpure}{}
3251 {
3252 \peek_catcode_remove:NTF \c_math_subscript_token
3253 { \@@_fpure_one:n }
3254 { f }
3255 }
3256 \cs_new:Nn \@@_intensive_two:n
3257 {
3258 \c_math_subscript_token{#1}
3259 \peek_catcode:NF \c_math_superscript_token
3260 {
3261 \c_math_superscript_token\bullet
3262 }
3263 }
3264 \cs_set:Nn \@@_intensive:n
3265 {
3266 #1
3267 \peek_catcode_remove:NT \c_math_subscript_token
3268 { \@@_intensive_two:n }
3269 }
3270 \cs_new:Nn \@@_phipure_one:n
3271 {
3272 \phi\c_math_subscript_token{#1}
3273 \peek_catcode:NF \c_math_superscript_token
3274 { \c_math_superscript_token\bullet }
3275 }
3276 \RenewDocumentCommand{\phipure}{}
3277 {
3278 \peek_catcode_remove:NTF \c_math_subscript_token
3279 {
3280 \@@_phipure_one:n
3281 }
3282 {\phi}
3283 }
3284 \RenewDocumentCommand{\phimix}{}{\widehat\phi}
3285 \RenewDocumentCommand{\fmix}{}{\widehat f}
3286 \RenewDocumentCommand{\mixing}{}{{MIX}}
3287 \RenewDocumentCommand{\muJT}{}{\alpha\c_math_subscript_token H}
3288 \RenewDocumentCommand{\Deltamix}{m}
3289 {\Delta\c_math_subscript_token\mixing #1}
3290 \RenewDocumentCommand{\reaction}{}{R}
3291 \RenewDocumentCommand{\fusion}{}{{SL}}
3292 \RenewDocumentCommand{\vaporization}{}{{LV}}
3293 \RenewDocumentCommand{\sublimation}{}{{SV}}
3294 \RenewDocumentCommand{\allbut}{O{j} m m}
3295 { \tl_if_eq:nnTF {#1} {#2}
3296 {
3297 {#3}\c_math_subscript_token k\neq{#3}\c_math_subscript_token{#2}
3298 }
3299 {
3300 {#3}\c_math_subscript_token{#1}\neq{#3}\c_math_subscript_token{#2}
3301 }
3302 }
3303 \RenewDocumentCommand{\Cstd}{}{m^\std}
3304 \RenewDocumentCommand{\mustd}{}{\Gamma}
3305 \RenewDocumentCommand{\formation}{}{F}
3306 %^^A \RenewDocumentCommand{\Deltarxn}{}{\Delta}
3307 }
3308 }
3309 % \end{macrocode}
3310 % We execute the default options below.
3311 % \begin{macrocode}
3312 \ExecuteOptions{EUAGHan,subscripts,parentheses,intensive-plain,
3313 moles-index,longpm}
3314 \ProcessOptions
3315 % \end{macrocode}
3316 % \subsection{Variable Order}
3317 % We next encode a routine to sort non-subscripted variables into a consistent
3318 % order. It currently does not sort variables with subscripts.
3319 % \changes{v2.00}{2023/11/16}{Added a sorting routine to make function
3320 % arguments be in a consistent order using the \texttt{nosubscripts}
3321 % option.}
3322 % \begin{macrocode}
3323 \tl_const:Nn \c_@@_sort_order_tl
3324 {\Et\Em\Es\Ut\Um\Us\Ht\Hm\Hs\Ft\Fm\Fs\Gt\Gm\Gs\Lt\Lm\Ls T\St\Sm\Ss
3325 P\Vt\Vm\Vs\mu\Nt mwxyz\At\Am\As\sigma
3326 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklnopqrstuvwxyz}
3327 \clist_new:N \l_@@_in_list_clist
3328 \clist_new:N \l_@@_sorted_list_clist
3329 \clist_new:N \l_@@_remaining_list_clist
3330 \cs_new:Nn \@@_sort_clist:n
3331 {% Sort the list in the order of \c_@@_sort_order_tl
3332
3333 % Wipe out any remnants from the last sort
3334 \clist_clear:N \l_@@_in_list_clist
3335 \clist_clear:N \l_@@_sorted_list_clist
3336
3337 % Make a copy of the list
3338 \clist_set:Nn \l_@@_remaining_list_clist {#1}
3339
3340 % Make a list of everything that's in the known sort order list
3341 % and put everything else in the "not in sort order list" list.
3342 \tl_map_inline:Nn \c_@@_sort_order_tl
3343 {
3344 \clist_if_in:NnT \l_@@_remaining_list_clist {##1}
3345 { \clist_put_right:Nn \l_@@_in_list_clist {##1} }
3346
3347 \clist_remove_all:Nn \l_@@_remaining_list_clist {##1}
3348 }
3349
3350 % Then merge the lists back together again.
3351 \clist_if_empty:NF \l_@@_in_list_clist
3352 {
3353 \clist_put_right:Nn \l_@@_sorted_list_clist \l_@@_in_list_clist
3354 }
3355 \clist_if_empty:NF \l_@@_remaining_list_clist
3356 {
3357 \clist_put_right:Nn \l_@@_sorted_list_clist \l_@@_remaining_list_clist
3358 }
3359 \clist_use:Nn \l_@@_sorted_list_clist ,
3360 }
3361 % \end{macrocode}
3362 %
3363 % \subsection{Commands for Partial Derivatives}
3364 % The \cs{Partial} command and its second-order siblings are defined as below.
3365 % They typeset partial derivatives of the first argument with respect to
3366 % the second (and third, in the case of mixed second partial derivatives)
3367 % arguments, holding the last argument constant.
3368 %
3369 % The starred forms adjust the spacing after the partial derivative so the
3370 % trailing binary operator (assumed to be the same width as an equals sign)
3371 % overhangs the variables held constant.
3372 % We thus set \verb"operator_width" to be \emph{just} greater than the width of
3373 % an equals sign.
3374 % \begin{macrocode}
3375 \dim_new:N \l_@@_Partial_const_dim
3376 \dim_new:N \l_@@_operator_width_dim
3377 \dim_new:N \l_@@_adjust_width_dim
3378 \settowidth{\l_@@_operator_width_dim}{=}
3379 \dim_set:Nn \l_@@_adjust_width_dim {0.1\l_@@_operator_width_dim}
3380 \dim_add:Nn \l_@@_operator_width_dim \l_@@_adjust_width_dim
3381 % \end{macrocode}
3382 % \begin{macro}{\Partial}
3383 % The command \cs{Partial} and its friends drastically simplify the creation
3384 % of partial derivatives. The command \cs{Partial*} is the same as
3385 % \cs{Partial} except that it adjusts the spacing so the (presumably) binary
3386 % operator that follows it slightly overlaps the subscripts.
3387 % \changes{v1.01}{2022/03/01}{Changed \cs{adjust@width} to 2pt (up from 1pt).}
3388 % \changes{v1.01}{2022/04/21}{Changed \cs{adjust@width} 0.1\cs{operator@width}
3389 % (from 2pt).}
3390 % \changes{v2.00}{2023/11/16}{Changed length added to
3391 % \ExplSyntaxOn
3392 % \cs{l_@@_Partial_const_dim}~
3393 % \ExplSyntaxOff
3394 % from $-0.15$ to $-0.20$.}
3395 % \changes{v2.04}{2026/03/22}{Refactored \cs{Partial} and friends to avoid
3396 % having \pkg{expl3} code inside \pkg{xparse} definitions (which probably
3397 % was fine, but just to be safe\dots).}
3398 % \begin{macrocode}
3399 \tl_new:N \l_@@_Partial_start_tl
3400 \tl_new:N \l_@@_Partial_end_tl
3401 \tl_new:N \l_@@_Partial_empty_end_tl
3402 \tl_new:N \l_@@_Partial_middle_tl
3403 \tl_set:Nn \l_@@_Partial_start_tl {\left\l_@@_PartialOpen_tl}
3404 \tl_set:Nn \l_@@_Partial_end_tl {\right\l_@@_PartialClose_tl}
3405 \tl_set:Nn \l_@@_Partial_empty_end_tl {\right\l_@@_PartialEmptyClose_tl}
3406 \tl_set:Nn \l_@@_Partial_middle_tl {\middle}
3407 \cs_set_eq:NN \@@_frac:nn \frac
3408 \cs_new:Npn \PartialStar #1#2#3
3409 { \settowidth{\l_@@_Partial_const_dim}{\ensuremath{#3}}%
3410 \dim_add:Nn \l_@@_Partial_const_dim {-0.20\l_@@_Partial_const_dim}%
3411 \PartialNoStar{#1}{#2}{#3}%
3412 \bool_if:NT \l_@@_subscripted_bool
3413 { \dim_compare:nNnTF \l_@@_operator_width_dim
3414 < \l_@@_Partial_const_dim
3415 { \kern -\l_@@_operator_width_dim }
3416 { \kern -\l_@@_Partial_const_dim }
3417 }
3418 }
3419 \cs_new:Npn \PartialNoStar #1#2#3
3420 { \bool_if:NTF \l_@@_subscripted_bool
3421 {% Handle case of empty variables held constant
3422 \tl_if_eq:nnTF {#3} {}
3423 { \l_@@_Partial_start_tl
3424 \@@_frac:nn{\partial #1}{\partial #2}\l_@@_Partial_empty_end_tl
3425 }
3426 { \l_@@_Partial_start_tl\@@_frac:nn{\partial #1}
3427 {\partial #2}\l_@@_Partial_end_tl
3428 \c_math_subscript_token{#3}%
3429 }
3430 }
3431 {% Check whether #3 contains \allNsbut{i} and #2 is \Nt_i
3432 \tl_if_in:nnTF {#2} {\Nt}
3433 { \RenewDocumentCommand{\allbut}{O{j} m m}{\allcomponents{##3}}
3434 \l_@@_Partial_start_tl
3435 \@@_frac:nn{\partial #1(\@@_sort_clist:n{#3})}
3436 {\partial #2}\l_@@_Partial_end_tl
3437 }
3438 { \l_@@_Partial_start_tl
3439 \@@_frac:nn{\partial #1(\@@_sort_clist:n{#2,#3})}
3440 {\partial #2}\l_@@_Partial_end_tl
3441 }
3442 }
3443 }
3444 \NewDocumentCommand{\Partial}{s m m m}
3445 { \IfBooleanTF {#1}
3446 { \PartialStar{#2}{#3}{#4} }
3447 { \PartialNoStar{#2}{#3}{#4} }
3448 }
3449 % \end{macrocode}
3450 % \end{macro}
3451 %
3452 % \begin{macro}{\PartialBigg}
3453 % The \cs{PartialBigg} macro (and its starred form) replace the \tn{left}
3454 % and \tn{right} commands in \cs{Partial} with \pkg{amsmath}'s \tn{Biggl}
3455 % and \tn{Biggr} variants. The starred form is inherited from \cs{Partial}
3456 % without modification.
3457 % \begin{macrocode}
3458 \NewDocumentCommand{\PartialBigg}{}
3459 { \tl_set:Nn \l_@@_Partial_start_tl {\Biggl\l_@@_PartialOpen_tl}
3460 \tl_set:Nn \l_@@_Partial_end_tl {\Biggr\l_@@_PartialClose_tl}
3461 \tl_set:Nn \l_@@_Partial_Empty_end_tl
3462 {\Biggr\l_@@_PartialEmptyClose_tl}
3463 \Partial
3464 }
3465 % \end{macrocode}
3466 % \end{macro}
3467 % \begin{macro}{\Partialbigg}
3468 % The \cs{Partialbigg} macro does the same thing as \cs{PartialBigg}, except
3469 % using \pkg{amsmath}'s \tn{biggl}/\tn{biggr} variants.
3470 % \begin{macrocode}
3471 \NewDocumentCommand{\Partialbigg}{}
3472 { \tl_set:Nn \l_@@_Partial_start_tl {\biggl\l_@@_PartialOpen_tl}
3473 \tl_set:Nn \l_@@_Partial_end_tl {\biggr\l_@@_PartialClose_tl}
3474 \tl_set:Nn \l_@@_Partial_empty_end_tl
3475 {\biggr\l_@@_PartialEmptyClose_tl}
3476 \Partial
3477 }
3478 % \end{macrocode}
3479 % \end{macro}
3480 %
3481 % \begin{macro}{\PartialSecond}
3482 % The second partial derivatives are defined similarly to \cs{Partial}.
3483 % \begin{macrocode}
3484 \cs_new:Npn \PartialSecondStar #1#2#3
3485 { \settowidth{\l_@@_Partial_const_dim}{\ensuremath{#3}}%
3486 \dim_add:Nn \l_@@_Partial_const_dim {-0.20\l_@@_Partial_const_dim}
3487 \PartialSecondNoStar{#1}{#2}{#3}%
3488 \bool_if:nT \l_@@_subscripted_bool
3489 { \dim_compare:nNnTF {\l_@@_operator_width_dim}
3490 < {\l_@@_Partial_const_dim}
3491 { \kern -\l_@@_operator_width_dim }
3492 { \kern -\l_@@_Partial_const_dim }
3493 }
3494 }
3495 \cs_new:Npn \PartialSecondNoStar #1#2#3
3496 { \bool_if:NTF \l_@@_subscripted_bool
3497 {% Handles case of empty variables held constant
3498 \tl_if_eq:nnTF {#3} {}
3499 { \l_@@_Partial_start_tl
3500 \@@_frac:nn{\partial\c_math_superscript_token 2 #1}
3501 {\partial #2\c_math_superscript_token 2}\l_@@_Partial_empty_end_tl
3502 }
3503 { \l_@@_Partial_start_tl
3504 \@@_frac:nn{\partial\c_math_superscript_token 2 #1}
3505 {\partial #2\c_math_superscript_token 2}\l_@@_Partial_end_tl
3506 \c_math_subscript_token{#3}%
3507 }
3508 }
3509 {% Check whether #3 contains \allNsbut{i} and #2 is \Nt_i
3510 \tl_if_in:nnTF {#1} {\Nt}
3511 { \RenewDocumentCommand{\allbut}{O{j} m m}{\allcomponents{##3}}
3512 \l_@@_Partial_start_tl
3513 \@@_frac:nn{\partial\c_math_superscript_token 2 #1(#3)}
3514 {\partial\c_math_superscript_token 2 #2}\l_@@_Partial_end_tl
3515 }
3516 { \l_@@_Partial_start_tl
3517 \@@_frac:nn{\partial\c_math_superscript_token 2
3518 #1(\@@_sort_clist:n{#2,#3})}
3519 {\partial #2\c_math_superscript_token 2}\l_@@_Partial_end_tl
3520 }
3521 }
3522 }
3523 \NewDocumentCommand{\PartialSecond}{s m m m}
3524 {
3525 \IfBooleanTF {#1}
3526 { \PartialSecondStar{#2}{#3}{#4} }
3527 { \PartialSecondNoStar{#2}{#3}{#4} }
3528 }
3529 % \end{macrocode}
3530 % \end{macro}
3531 % \begin{macro}{\PartialSecondBigg}
3532 % The \cs{PartialSecondBigg} macro and its starred variant replace \cs{left}
3533 % and \tn{right} with \pkg{amsmath}'s \cs{Biggl} and
3534 % \cs{Biggr}.
3535 % \begin{macrocode}
3536 \NewDocumentCommand{\PartialSecondBigg}{}
3537 { \tl_set:Nn \l_@@_Partial_start_tl {\biggl\l_@@_PartialOpen_tl}
3538 \tl_set:Nn \l_@@_Partial_end_tl {\biggl\l_@@_PartialClose_tl}
3539 \tl_set:Nn \l_@@_Partial_empty_end_tl {\biggl\l_@@_PartialClose_tl}
3540 \PartialSecond
3541 }
3542 % \end{macrocode}
3543 % \end{macro}
3544 % \begin{macro}{\PartialSecondbigg}
3545 % The \cs{PartialSecondbigg} macro and its starred variant replace \tn{left}
3546 % and \tn{right} with \pkg{amsmath}'s \cs{biggl} and
3547 % \cs{biggr}.
3548 % \begin{macrocode}
3549 \NewDocumentCommand{\PartialSecondbigg}{}
3550 { \tl_set:Nn \l_@@_Partial_start_tl {\biggl\l_@@_PartialOpen_tl}
3551 \tl_set:Nn \l_@@_Partial_end_tl {\biggl\l_@@_PartialClose_tl}
3552 \tl_set:Nn \l_@@_Partial_empty_end_tl {\biggl\l_@@_PartialClose_tl}
3553 \PartialSecond
3554 }
3555 % \end{macrocode}
3556 % \end{macro}
3557 %
3558 % \begin{macro}{\PartialMixSecond}
3559 % The macro \cs{PartialMixSecond} takes an extra argument, but is otherwise
3560 % the same as its same-variable cousin.
3561 % \begin{macrocode}
3562 \bool_new:N \l_@@_has_x_or_y_bool
3563 \cs_new:Npn \PartialMixSecondStar #1#2#3#4
3564 { \settowidth{\l_@@_Partial_const_dim}{\ensuremath{#3}}%
3565 \dim_add:Nn \l_@@_Partial_const_dim {-0.20\l_@@_Partial_const_dim}
3566 \PartialMixSecond{#1}{#2}{#3}{#4}
3567 \bool_if:nT \l_@@_subscripted_bool
3568 { \dim_compare:nNnTF {\l_@@_operator_width_dim}
3569 < {\l_@@_Partial_const_dim}
3570 { \kern -\l_@@_operator_width_dim }
3571 { \kern -\l_@@_Partial_const_dim }
3572 }
3573 }
3574 \cs_new:Npn \PartialMixSecondNoStar #1#2#3#4
3575 { \bool_if:nTF \l_@@_subscripted_bool
3576 {% subscripted version
3577 \tl_if_eq:nnTF {#4} {}
3578 {% Handle case of empty variables held constant
3579 \l_@@_Partial_start_tl
3580 \@@_frac:nn{\partial\c_math_superscript_token 2 #1}
3581 {\partial #2\partial #3}\l_@@_Partial_empty_end_tl
3582 }
3583 { \l_@@_Partial_start_tl
3584 \@@_frac:nn{\partial\c_math_superscript_token 2 #1}
3585 {\partial #2\partial #3}\l_@@_Partial_end_tl
3586 \c_math_subscript_token{#4}
3587 }
3588 }
3589 {% not subscripted
3590 \tl_if_eq:nnTF {#4} {}
3591 {% empty argument
3592 \l_@@_Partial_start_tl
3593 \@@_frac:nn{\partial\c_math_superscript_token 2
3594 #1(\@@_sort_clist:n{#2,#3,#4})}
3595 {\partial #2\partial #3}\l_@@_Partial_empty_end_tl
3596 }
3597 {% Check whether #2 OR #3 are \Nt_i/etc.
3598 \tl_if_in:nnTF {#2} {\Nt}
3599 { \RenewDocumentCommand{\allbut}{O{j} m m}{\allcomponents{##3}}%
3600 \l_@@_Partial_start_tl
3601 \@@_frac:nn{\partial\c_math_superscript_token 2
3602 #1(\@@_sort_clist:n{#3,#4})}
3603 {\partial #2\partial #3}\l_@@_Partial_end_tl
3604 }
3605 { \tl_if_in:nnTF {#3} {\Nt}
3606 { \RenewDocumentCommand{\allbut}{O{j} m m}{\allcomponents{##3}}%
3607 \l_@@_Partial_start_tl
3608 \@@_frac:nn{\partial\c_math_superscript_token 2
3609 #1(\@@_sort_clist:n{#2,#4})}
3610 {\partial #2\partial #3}\l_@@_Partial_end_tl
3611 }
3612 {% Check for x, y, or w
3613 \bool_set_false:N \l_@@_has_x_or_y_bool
3614 \tl_if_in:nnT {#2} {x}
3615 { \l_@@_has_x_or_y_bool }
3616 \tl_if_in:nnT {#2} {y}
3617 { \l_@@_has_x_or_y_bool }
3618 \tl_if_in:nnT {#2} {w}
3619 { \l_@@_has_x_or_y_bool }
3620 \bool_if:NTF \l_@@_has_x_or_y_bool
3621 { \RenewDocumentCommand{\allbutlastand}{O{j} m m}
3622 {\allcomponents{##3}}
3623 \l_@@_Partial_start_tl
3624 \@@_frac:nn{\partial\c_math_superscript_token 2
3625 #1(\@@_sort_clist:n{#3,#4})}
3626 {\partial #2\partial #3}\l_@@_Partial_end_tl
3627 }
3628 {
3629 \l_@@_Partial_start_tl
3630 \@@_frac:nn{\partial\c_math_superscript_token 2
3631 #1(\@@_sort_clist:n{#2,#3,#4})}
3632 {\partial #2\partial #3}\l_@@_Partial_end_tl
3633 }
3634 }
3635 }
3636 }
3637 }
3638 }
3639 \NewDocumentCommand{\PartialMixSecond}{s m m m m}
3640 {
3641 \IfBooleanTF {#1}
3642 { \PartialMixSecondStar{#2}{#3}{#4}{#5} }
3643 { \PartialMixSecondNoStar{#2}{#3}{#4}{#5} }
3644 }
3645 % \end{macrocode}
3646 % \end{macro}
3647 % \begin{macro}{\PartialMixSecondBigg,\PartialMixSecondbigg}
3648 % The macro \cs{PartialMixSecondBigg} is analogous to the aforementioned macros
3649 % \cs{PartialBigg} and \cs{PartialSecondBigg}. \cs{PartialMixSecondbigg} is
3650 % analogous to \cs{Partialbigg} and \cs{PartialSecondbigg}.
3651 % \begin{macrocode}
3652 \NewDocumentCommand{\PartialMixSecondBigg}{}
3653 { \tl_set:Nn \l_@@_Partial_start_tl {\Biggl\l_@@_PartialOpen_tl}
3654 \tl_set:Nn \l_@@_Partial_end_tl {\Biggl\l_@@_PartialClose_tl}
3655 \tl_set:Nn \l_@@_Partial_empty_end_tl {\Biggl\l_@@_PartialClose_tl}
3656 \PartialMixSecond
3657 }
3658 \NewDocumentCommand{\PartialMixSecondbigg}{}
3659 { \tl_set:Nn \l_@@_Partial_start_tl {\biggl\l_@@_PartialOpen_tl}
3660 \tl_set:Nn \l_@@_Partial_end_tl {\biggl\l_@@_PartialClose_tl}
3661 \tl_set:Nn \l_@@_Partial_empty_end_tl {\biggl\l_@@_PartialClose_tl}
3662 \PartialMixSecond
3663 }
3664 % \end{macrocode}
3665 %
3666 % If the user does not load the \pkg{amsmath} package, we will not have access
3667 % to \cs{Biggl}, \cs{Biggr}, \cs{biggl}, and \cs{biggr}, so we revert them back
3668 % to the ordinary \cs{left} and \cs{right} versions and warn the user.
3669 % \begin{macrocode}
3670 \AtBeginDocument{%
3671 \@ifpackageloaded{amsmath}{}{%
3672 \PackageWarningNoLine{thermodynamics}
3673 {Package~amsmath~not~loaded;~load~to~make~PartialBigg~and~friends~
3674 work~correctly}%
3675 \cs_set_eq:NN \PartialBigg \Partial
3676 \cs_set_eq:NN \Partialbigg \Partial
3677 \cs_set_eq:NN \PartialSecondBigg \PartialSecond
3678 \cs_set_eq:NN \PartialSecondbigg \PartialSecond
3679 \cs_set_eq:NN \PartialMixSecondBigg \PartialMixSecond
3680 \cs_set_eq:NN \PartialMixSecondbigg \PartialMixSecond
3681 \ProvideDocumentCommand{\rvert}{}{|}
3682 \ProvideDocumentCommand{\lvert}{}{|}
3683 }%
3684 }
3685 % \end{macrocode}
3686 % \end{macro}
3687 % \changes{v1.01}{2023/09/15}{Added \cs{Partialinline} and friends to
3688 % facilitate in-line (non-display-mode) partial derivatives, with
3689 % corresponding changes to \cs{Partial} and friends for ease of
3690 % implementation. Also added \cs{Partialinlinetext} and friends for
3691 % non-expanding delimiters.}
3692 % \begin{macro}{\Partialinline,\PartialSecondinline,\PartialMixSecondinline}
3693 % Inline partial derivatives.
3694 % \begin{macrocode}
3695 \NewDocumentCommand{\Partialinline}{}
3696 {
3697 \cs_set:Nn \@@_frac:nn { ##1 \l_@@_Partial_middle_tl / ##2 }
3698 \Partial
3699 }
3700 \NewDocumentCommand{\PartialSecondinline}{}
3701 {
3702 \cs_set:Nn \@@_frac:nn { ##1 \l_@@_Partial_middle_tl / ##2 }
3703 \PartialSecond
3704 }
3705 \NewDocumentCommand{\PartialMixSecondinline}{}
3706 {
3707 \cs_set:Nn \@@_frac:nn { ##1 \l_@@_Partial_middle_tl / ##2 }
3708 \PartialMixSecond
3709 }
3710 % \end{macrocode}
3711 % \end{macro}
3712 % \pagebreak[1]
3713 % \setmarginparsize{\footnotesize}
3714 % \begin{macro}{\Partialinlinetext}
3715 % \begin{macro}{\PartialSecondinlinetext}
3716 % \begin{macro}{\PartialMixSecondinlinetext}
3717 % Text-only (non-extensible delimiter) versions of \cs{Partialinline}
3718 % and friends.
3719 %^^A TODO: These currently "pollute" other partial derivatives until the end
3720 %^^A of the line (i.e., \Partialinline{z}{x}{y} = \Partial{z}{x}{y} will
3721 %^^A produce identical things on both sides). For now, it's a "feature."
3722 % \begin{macrocode}
3723 \NewDocumentCommand{\Partialinlinetext}{}
3724 { \cs_set_eq:NN \l_@@_Partial_start_tl \l_@@_PartialOpen_tl
3725 \cs_set_eq:NN \l_@@_Partial_end_tl \l_@@_PartialClose_tl
3726 \cs_set_eq:NN \l_@@_Partial_empty_end_tl \l_@@_PartialEmptyClose_tl
3727 \cs_set_eq:NN \l_@@_Partial_middle_tl \relax
3728 \Partialinline
3729 }
3730 \NewDocumentCommand{\PartialSecondinlinetext}{}
3731 { \cs_set_eq:NN \l_@@_Partial_start_tl \l_@@_PartialOpen_tl
3732 \cs_set_eq:NN \l_@@_Partial_end_tl \l_@@_PartialClose_tl
3733 \cs_set_eq:NN \l_@@_Partial_empty_end_tl \l_@@_PartialEmptyClose_tl
3734 \cs_set_eq:NN \l_@@_Partial_middle_tl \relax
3735 \PartialSecondinline
3736 }
3737 \NewDocumentCommand{\PartialMixSecondinlinetext}{}
3738 { \cs_set_eq:NN \l_@@_Partial_start_tl \l_@@_PartialOpen_tl
3739 \cs_set_eq:NN \l_@@_Partial_end_tl \l_@@_PartialClose_tl
3740 \cs_set_eq:NN \l_@@_Partial_empty_end_tl \l_@@_PartialEmptyClose_tl
3741 \cs_set_eq:NN \l_@@_Partial_middle_tl \relax
3742 \PartialMixSecondinline
3743 }
3744 % \end{macrocode}
3745 % \end{macro}
3746 % \end{macro}
3747 % \end{macro}
3748 % \restoremarginparsize
3749 %
3750 % \subsection{Local Override of Delimiters}
3751 % We define several environments that \emph{locally} override the delimiters on
3752 % partial derivatives generated with \cs{Partial} and friends, the
3753 % subscript notation for partial derivatives, and/or the definitions of
3754 % range-oriented macros such as \cs{allNs}. These environments can be nested;
3755 % the inner-most one will be honored if conflicts occur.
3756 % \begin{environment}{thermoparentheses}
3757 % Inside this environment, partial derivatives will have parentheses around
3758 % them, regardless of package options.
3759 % \begin{macrocode}
3760 \NewDocumentEnvironment{thermoparentheses}{}
3761 { \cs_set:Nn \l_@@_PartialOpen_tl {(}
3762 \cs_set:Nn \l_@@_PartialClose_tl {)}
3763 \cs_set:Nn \l_@@_PartialEmptyClose_tl {)}
3764 }{}
3765 % \end{macrocode}
3766 % \end{environment}
3767 % \begin{environment}{thermobrackets}
3768 % Inside this environment, partial derivatives will have brackets around
3769 % them, regardless of package options.
3770 % \begin{macrocode}
3771 \NewDocumentEnvironment{thermobrackets}{}
3772 { \tl_set:Nn \l_@@_PartialOpen_tl {[}
3773 \tl_set:Nn \l_@@_PartialClose_tl {]}
3774 \tl_set:Nn \l_@@_PartialEmptyClose_tl {]}
3775 }{}
3776 % \end{macrocode}
3777 % \end{environment}
3778 % \begin{environment}{thermobraces}
3779 % Inside this environment, partial derivatives will have braces around
3780 % them, regardless of package options.
3781 % \begin{macrocode}
3782 \NewDocumentEnvironment{thermobraces}{}
3783 { \tl_set:Nn \l_@@_PartialOpen_tl {\{}
3784 \tl_set:Nn \l_@@_PartialClose_tl {\}}
3785 \tl_set:Nn \l_@@_PartialEmptyClose_tl {\}}
3786 }{}
3787 % \end{macrocode}
3788 % \end{environment}
3789 % \begin{environment}{thermobar}
3790 % Inside this environment, partial derivatives will have a trailing vertical
3791 % bar, regardless of package options.
3792 % \begin{macrocode}
3793 \NewDocumentEnvironment{thermobar}{}
3794 { \tl_set:Nn \l_@@_PartialOpen_tl {.}
3795 \tl_set:Nn \l_@@_PartialClose_tl {\rvert}
3796 \tl_set:Nn \l_@@_PartialEmptyClose_tl {.}
3797 }{}
3798 % \end{macrocode}
3799 % \end{environment}
3800 % \begin{environment}{thermoplain}
3801 % Inside this environment, partial derivatives will have no decorations
3802 % around them, regardless of package options.
3803 % \begin{macrocode}
3804 \NewDocumentEnvironment{thermoplain}{}
3805 { \tl_set:Nn \l_@@_PartialOpen_tl {.}
3806 \tl_set:Nn \l_@@_PartialClose_tl {.}
3807 \tl_set:Nn \l_@@_PartialEmptyClose_tl {.}
3808 \bool_set_false:N \l_@@_subscripted_bool
3809 }{}
3810 % \end{macrocode}
3811 % \end{environment}
3812 % \begin{environment}{thermoNOsubscripts}
3813 % Inside this environment, subscripts will not be displayed to the right of
3814 % partial derivatives, regardless of package options.
3815 % \begin{macrocode}
3816 \NewDocumentEnvironment{thermoNOsubscripts}{}
3817 {\bool_set_false:N \l_@@_subscripted_bool}
3818 {}
3819 % \end{macrocode}
3820 % \begin{environment}{thermosubscripts}
3821 % Inside this environment, subscripts will be displayed to the right of
3822 % partial derivatives, regardless of package options.
3823 % \end{environment}
3824 % \begin{macrocode}
3825 \NewDocumentEnvironment{thermosubscripts}{}
3826 {\bool_set_true:N \l_@@_subscripted_bool}
3827 {}
3828 % \end{macrocode}
3829 % \end{environment}
3830 % \begin{environment}{thermomolesrange}
3831 % Inside this environment, the macro \cs{allNs} will expand to
3832 % $n_1,\dotsc,n_C$ (or equivalent symbols if \cs{Nt} and/or \cs{ncomponents}
3833 % have been redefined), regardless of package options. Similar expansions will
3834 % result for \cs{allXs}, \cs{allYs}, \cs{allMs}, and so on.
3835 % \changes{v2.00}{2023/11/16}{Added environment to invoke the ``moles-range''
3836 % definitions of \cs{allNs} and friends locally.}
3837 % \begin{macrocode}
3838 \NewDocumentEnvironment{thermomolesrange}{}
3839 { \@@_set_moles_range }
3840 {}
3841 % \end{macrocode}
3842 % \end{environment}
3843 % \begin{environment}{thermointensiveplain}
3844 % \changes{v2.00}{2023/11/16}{Added environment to invoke the
3845 % ``intensive-plain'' option locally.}
3846 % \begin{macrocode}
3847 % \begin{macrocode}
3848 \NewDocumentEnvironment{thermointensiveplain}{}
3849 { \@@_set_intensive_plain }
3850 {}
3851 % \end{macrocode}
3852 % \end{environment}
3853 % \begin{environment}{thermoextensiveplain}
3854 % \changes{v2.00}{2023/11/16}{Added environment to invoke the
3855 % ``extensive-plain'' option locally.}
3856 % \begin{macrocode}
3857 \NewDocumentEnvironment{thermoextensiveplain}{}
3858 { \@@_set_extensive_plain }
3859 {}
3860 % \end{macrocode}
3861 % \end{environment}
3862 % \setmarginparsize{\scriptsize}
3863 % \begin{environment}{thermointensivelowercase}
3864 % \changes{v2.00}{2023/11/16}{Added environment to invoke the
3865 % ``intensive-lowercase'' option locally.}
3866 % \begin{macrocode}
3867 \NewDocumentEnvironment{thermointensivelowercase}{}
3868 {% {
3869 % \RenewExpandableDocumentCommand{\MacroFont}{}{
3870 % \fontencoding\encodingdefault
3871 % \fontfamily\ttdefault
3872 % \fontseries\mddefault
3873 % \fontshape\shapedefault
3874 % \footnotesize}
3875
3876 \@@_set_intensive_lowercase
3877 \@@_set_lowercase_pms
3878 }
3879 {}
3880 % \end{macrocode}
3881 % \end{environment}
3882 % \begin{environment}{thermoextensivesuperscript}
3883 % \changes{v2.00}{2023/11/16}{Added environment to invoke the
3884 % ``extensive-superscript'' option locally.}
3885 % \begin{macrocode}
3886 \NewDocumentEnvironment{thermoextensivesuperscript}{}
3887 {
3888 \@@_set_extensive_superscripts
3889 }
3890 {}
3891 % \end{macrocode}
3892 % \end{environment}
3893 % \restoremarginparsize
3894 %
3895 % \subsection{User-Interface Macros to Define Symbols}
3896 % \begin{macro}{\NewSubscriptedSymbol}
3897 % First, we define a command that serves to create ``subscripted''
3898 % symbols; for example, typing \verb"\cP_i" should yield $C_{P,i}$ rather
3899 % than $C_{Pi}$, ${C_P}_i$, or ${C_{P_i}}$. Superscripts are also handled
3900 % properly and can be in either order.
3901 % \changes{v2.00}{2023/11/16}{Deleted \cs{DeclareSubscriptedSymbol} in favor
3902 % of \pkg{xparse}-based \cs{NewSubscriptedSymbol} and
3903 % \cs{RenewSubscriptedSymbol}.}
3904 % \begin{macrocode}
3905 \str_new:N \l_@@_tmp_str
3906 \cs_new:Npn \@@_check_definable:nN #1#2
3907 {
3908 \tl_trim_spaces_apply:nN {#1} \tl_if_single_token:nTF
3909 {
3910 \str_set:Nx \l_@@_tmp_str {\tl_to_str:n {#1}}
3911 \int_compare:nNnT {\str_count:N \l_@@_tmp_str} = 1
3912 { \PackageError{thermodynamics}
3913 {First~argument~of~'\tl_trim_spaces:o {\tl_to_str:n {#2}}'~
3914 must~be~a~command}
3915 {The~first~argument~of~'\tl_trim_spaces:o {\tl_to_str:n {#2}}'~
3916 should~be~the~macro~that~will~be~used~to~refer~to~the~symbol.~
3917 The~provided~argument~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~
3918 is~a~single~character.
3919 \MessageBreak Perhaps~a~backslash~is~missing?}
3920 }
3921 }
3922 { \PackageError{thermodynamics}
3923 {First~argument~of~'\tl_trim_spaces:o {\tl_to_str:n {#2}}'~
3924 must~be~a~command}
3925 {The~first~argument~of~'\tl_trim_spaces:o {\tl_to_str:n {#2}}'~
3926 should~be~the~macro~that~will~be~used~to~refer~to~the~symbol.~
3927 The~provided~argument~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~
3928 contains~more~than~one~token.
3929 \MessageBreak Perhaps~a~backslash~is~missing?}
3930 }
3931 }
3932 \tl_new:N \l_@@_super_separator_tl
3933 \tl_new:N \l_@@_sub_separator_tl
3934 \tl_set:Nn \l_@@_super_separator_tl {,}
3935 \tl_set:Nn \l_@@_sub_separator_tl {,}
3936 \NewDocumentCommand{\NewSubscriptedSymbol}{m m m}
3937 {
3938 \@@_check_definable:nN {#1} \NewSubscriptedSymbol
3939 \cs_if_exist:NT #1
3940 { \PackageError{thermodynamics}
3941 {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~already~defined}
3942 {You~have~used~
3943 '\tl_trim_spaces:o {\tl_to_str:n {\NewSubscriptedSymbol}}'~
3944 with~a~command~that~already~has~a~definition}
3945 }
3946 \cs_new:cpn {\cs_to_str:N #1_one:n} ##1
3947 {
3948 {#2}\c_math_superscript_token{##1}
3949 \peek_catcode_remove:NTF \c_math_subscript_token
3950 { \use:c {\cs_to_str:N #1_three:n} }
3951 { \c_math_subscript_token{#3} }
3952 }
3953
3954 \cs_new:cpn {\cs_to_str:N #1_two:n} ##1
3955 { {#2}\c_math_subscript_token{#3\l_@@_sub_separator_tl ##1} }
3956
3957 \cs_new:cpn {\cs_to_str:N #1_three:n} ##1
3958 { \c_math_subscript_token{#3\l_@@_sub_separator_tl ##1} }
3959
3960 \NewDocumentCommand{#1}{}
3961 {% @branch
3962 \peek_catcode_remove:NTF \c_math_superscript_token
3963 { \use:c {\cs_to_str:N #1_one:n} }
3964 { \peek_catcode_remove:NTF \c_math_subscript_token
3965 { \use:c {\cs_to_str:N #1_two:n} }
3966 { {#2}\c_math_subscript_token{#3} }
3967 }
3968 }
3969 }
3970 \NewDocumentCommand{\RenewSubscriptedSymbol}{m m m}
3971 {
3972 \@@_check_definable:nN {#1} \RenewSubscriptedSymbol
3973 \cs_if_exist:NF #1
3974 { \PackageError{thermodynamics}
3975 {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~not~defined}
3976 {You~have~used~
3977 '\tl_trim_spaces:o {\tl_to_str:n {\RenewSubscriptedSymbol}}'~
3978 with~a~command~that~does~not~have~a~definition}
3979 }
3980 \cs_set:cpn {\cs_to_str:N #1_one:n} ##1
3981 {
3982 {#2}\c_math_superscript_token{##1}
3983 \peek_catcode_remove:NTF \c_math_subscript_token
3984 { \use:c {\cs_to_str:N #1_three:n} }
3985 { \c_math_subscript_token{#3} }
3986 }
3987
3988 \cs_set:cpn {\cs_to_str:N #1_two:n} ##1
3989 { {#2}\c_math_subscript_token{#3\l_@@_sub_separator_tl ##1} }
3990
3991 \cs_set:cpn {\cs_to_str:N #1_three:n} ##1
3992 { \c_math_subscript_token{#3\l_@@_sub_separator_tl ##1} }
3993
3994 \RenewDocumentCommand{#1}{}
3995 {% @branch
3996 \peek_catcode_remove:NTF \c_math_superscript_token
3997 { \use:c {\cs_to_str:N #1_one:n} }
3998 { \peek_catcode_remove:NTF \c_math_subscript_token
3999 { \use:c {\cs_to_str:N #1_two:n} }
4000 { {#2}\c_math_subscript_token{#3} }
4001 }
4002 }
4003 }
4004 % \end{macrocode}
4005 % \end{macro}
4006 % \begin{macro}{\NewSuperscriptedSymbol}
4007 % \changes{v2.00}{2023/11/16}{Created \cs{NewSuperscriptedSymbol} to handle
4008 % superscripted excess and residual properties without intervention.}
4009 % \changes{v2.01}{2023/12/05}{Fixed two typos in \cs{NewSuperscriptedSymbol}.}
4010 % \begin{macrocode}
4011 \NewDocumentCommand{\NewSuperscriptedSymbol}{m m m}
4012 {
4013 \@@_check_definable:nN {#1} \NewSuperscriptedSymbol
4014 \cs_if_exist:NT #1
4015 { \PackageError{thermodynamics}
4016 {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~already~defined}
4017 {You~have~used~
4018 '\tl_trim_spaces:o {\tl_to_str:n {\NewSuperscriptedSymbol}}'~
4019 with~a~command~that~already~has~a~definition}
4020 }
4021 \cs_new:cpn {\cs_to_str:N #1_one:n} ##1
4022 {
4023 {#2}\c_math_subscript_token{##1}
4024 \peek_catcode_remove:NTF \c_math_superscript_token
4025 { \use:c {\cs_to_str:N #1_three:n} }
4026 { \c_math_superscript_token{#3} }
4027 }
4028
4029 \cs_new:cpn {\cs_to_str:N #1_two:n} ##1
4030 { {#2}\c_math_superscript_token{#3\l_@@_super_separator_tl ##1} }
4031
4032 \cs_new:cpn {\cs_to_str:N #1_three:n} ##1
4033 { {#2}\c_math_superscript_token{#3\l_@@_super_separator_tl ##1} }
4034
4035 \NewDocumentCommand{#1}{}
4036 {
4037 \peek_catcode_remove:NTF \c_math_subscript_token
4038 { \use:c {\cs_to_str:N #1_one:n} }
4039 { \peek_catcode_remove:NTF \c_math_superscript_token
4040 { \use:c {\cs_to_str:N #1_two:n} }
4041 { {#2}\c_math_superscript_token{#3} }
4042 }
4043 }
4044 }
4045 \NewDocumentCommand{\RenewSuperscriptedSymbol}{m m m}
4046 {
4047 \@@_check_definable:nN {#1} \RenewSuperscriptedSymbol
4048 \cs_if_exist:NF #1
4049 { \PackageError{thermodynamics}
4050 {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~not~defined}
4051 {You~have~used~
4052 '\tl_trim_spaces:o {\tl_to_str:n {\RenewSuperscriptedSymbol}}'~
4053 with~a~command~that~does~not~have~a~definition}
4054 }
4055 \cs_set:cpn {\cs_to_str:N #1_one:n} ##1
4056 {
4057 {#2}\c_math_subscript_token{##1}
4058 \peek_catcode_remove:NTF \c_math_superscript_token
4059 { \use:c {\cs_to_str:N #1_three:n} }
4060 { \c_math_superscript_token{#3} }
4061 }
4062
4063 \cs_set:cpn {\cs_to_str:N #1_two:n} ##1
4064 { {#2}\c_math_superscript_token{#3\l_@@_super_separator_tl ##1} }
4065
4066 \cs_set:cpn {\cs_to_str:N #1_three:n} ##1
4067 { \c_math_superscript_token{#3\l_@@_super_separator_tl ##1} }
4068
4069 \RenewDocumentCommand{#1}{}
4070 {% @branch
4071 \peek_catcode_remove:NTF \c_math_subscript_token
4072 { \use:c {\cs_to_str:N #1_one:n} }
4073 { \peek_catcode_remove:NTF \c_math_superscript_token
4074 { \use:c {\cs_to_str:N #1_two:n} }
4075 { {#2}\c_math_superscript_token{#3} }
4076 }
4077 }
4078 }
4079 \cs_new:Nn \@@_subscripted_and_superscripted_core:nnnn
4080 {
4081 \cs_set:cpn {\cs_to_str:N #1_one:n} ##1
4082 {
4083 {#2}\c_math_superscript_token{##1}
4084 \peek_catcode_remove:NTF \c_math_subscript_token
4085 { \use:c {\cs_to_str:N #1_three:n} }
4086 { \c_math_subscript_token{#3} }
4087 }
4088 \cs_set:cpn {\cs_to_str:N #1_two:n} ##1
4089 {
4090 {#2}\c_math_subscript_token{#3 ##1}
4091 \peek_catcode_remove:NTF \c_math_superscript_token
4092 { \use:c {\cs_to_str:N #1_four:n} }
4093 { \c_math_superscript_token{#4 \bullet} }
4094 }
4095 \cs_set:cpn {\cs_to_str:N #1_three:n} ##1
4096 { \c_math_subscript_token{#3 ##1} }
4097 \cs_set:cpn {\cs_to_str:N #1_four:n} ##1
4098 { \c_math_superscript_token{#4 ##1} }
4099 }
4100 \NewDocumentCommand{\NewSubscriptedandSuperscriptedSymbol}{m m m m}
4101 {
4102 \@@_check_definable:nN {#1} \NewSubscriptedandSuperscriptedSymbol
4103 \cs_if_exist:NT #1
4104 { \PackageError{thermodynamics}
4105 {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~already~defined}
4106 {You~have~used~
4107 '\tl_trim_spaces:o
4108 {\tl_to_str:n {\NewSubscriptedandSuperScriptedSymbol}}'~
4109 with~a~command~that~already~has~a~definition}
4110 }
4111 \@@_subscripted_and_superscripted_core:nnnn {#1} {#2} {#3} {#4}
4112 \NewDocumentCommand{#1}{}
4113 {
4114 \peek_catcode_remove:NTF \c_math_superscript_token
4115 { \use:c {\cs_to_str:N #1_one:n} }
4116 { \peek_catcode_remove:NTF \c_math_subscript_token
4117 { \use:c {\cs_to_str:N #1_two:n} }
4118 { {#2}\c_math_subscript_token{#3}\c_math_superscript_token{#4} }
4119 }
4120 }
4121 }
4122 \NewDocumentCommand{\RenewSubscriptedandSuperscriptedSymbol}{m m m m}
4123 {
4124 \@@_check_definable:nN {#1} \RenewSubscriptedandSuperscriptedSymbol
4125 %^^A \cs_if_exist:NF #1
4126 %^^A { \PackageError{thermodynamics}
4127 %^^A {Command~'\tl_trim_spaces:o {\tl_to_str:n {#1}}'~not~already~defined}
4128 %^^A {You~have~used~
4129 %^^A '\tl_trim_spaces:o
4130 %^^A {\tl_to_str:n {\RenewSubscriptedandSuperScriptedSymbol}}'~
4131 %^^A with~a~command~that~does~not~have~a~definition}
4132 %^^A }
4133 %^^A \@@_subscripted_and_superscripted_core:nnnn {#1} {#2} {#3} {#4}
4134 %^^A \RenewDocumentCommand{#1}{}
4135 %^^A {
4136 %^^A \peek_catcode_remove:NTF \c_math_superscript_token
4137 %^^A { \use:c {\cs_to_str:N #1_one:n} }
4138 %^^A { \peek_catcode_remove:NTF \c_math_subscript_token
4139 %^^A { \use:c {\cs_to_str:N #1_two:n} }
4140 %^^A { {#2}\c_math_subscript_token{#3}\c_math_superscript_token{#4} }
4141 %^^A }
4142 %^^A }
4143 }
4144 % \end{macrocode}
4145 % \end{macro}
4146 % \subsection{Symbol Definitions}
4147 % \begin{macro}{\heatcapacitysymbol,\compressibilitysymbol,\expansivitysymbol}
4148 % We define symbols for the heat capacities, compressibilities, and so forth.
4149 % \begin{macrocode}
4150 \NewExpandableDocumentCommand{\heatcapacitysymbol}{}{C}
4151 \NewExpandableDocumentCommand{\compressibilitysymbol}{}{\kappa}
4152 \NewExpandableDocumentCommand{\expansivitysymbol}{}{\alpha}
4153 \NewExpandableDocumentCommand{\JTsymbol}{}{\mu}
4154 % \end{macrocode}
4155 % \end{macro}
4156 % \begin{macro}{\cV,\cP}
4157 % The heat capacities are molar by default; we also declare extensive and
4158 % specific heat capacities.
4159 % The heat capacities themselves are defined to be ``smart'': \verb"\cV_i" will
4160 % recognize the subscript appropriately and render $C_{V,i}$ rather than
4161 % ${C_V}_i$ or some other unintended symbol. Superscripts are also handled
4162 % appropriately and can be in either order.
4163 % \begin{macrocode}
4164 \NewSubscriptedSymbol{\cV}{\@@_intensive:n \heatcapacitysymbol}
4165 {\g_@@_volume_symbol}
4166 \NewSubscriptedSymbol{\cP}{\@@_intensive:n \heatcapacitysymbol}
4167 {\g_@@_pressure_symbol}
4168 % \end{macrocode}
4169 % \end{macro}
4170 % \begin{macro}{\cVt,\cPt}
4171 % We also introduce \emph{extensive} (rather than molar) heat capacity macros.
4172 % \begin{macrocode}
4173 \NewSubscriptedSymbol{\cVt}{\@@_extensive:n \heatcapacitysymbol}
4174 {\g_@@_volume_symbol}
4175 \NewSubscriptedSymbol{\cPt}{\@@_extensive:n \heatcapacitysymbol}
4176 {\g_@@_pressure_symbol}
4177 % \end{macrocode}
4178 % \end{macro}
4179 % \begin{macro}{\cVs,\cPs}
4180 % \cs{cPs} and \cs{cVs} are the specific heat capacities.
4181 % \begin{macrocode}
4182 \NewSubscriptedSymbol{\cVs}{\@@_specific:n \heatcapacitysymbol}
4183 {\g_@@_volume_symbol}
4184 \NewSubscriptedSymbol{\cPs}{\@@_specific:n \heatcapacitysymbol}
4185 {\g_@@_pressure_symbol}
4186 % \end{macrocode}
4187 % \end{macro}
4188 %
4189 % \begin{macro}{\kappaT,\kappaS}
4190 % The isothermal and adiabatic compressibilities are defined similarly, but
4191 % those do not have extensive versions for obvious reasons.
4192 % \begin{macrocode}
4193 \NewSubscriptedSymbol{\kappaT}{\compressibilitysymbol}
4194 {\g_@@_temperature_symbol}
4195 \NewSubscriptedSymbol{\kappaS}{\compressibilitysymbol}
4196 {\g_@@_entropy_symbol}
4197 % \end{macrocode}
4198 % \end{macro}
4199 % \begin{macro}{\alphaP,\alphaS}
4200 % The macro \cs{alphaP} is intended to refer to the isobaric volume
4201 % expansivity, while \cs{alphaS} is the isentropic volume expansivity.
4202 % \begin{macrocode}
4203 \NewSubscriptedSymbol{\alphaP}{\expansivitysymbol}{\g_@@_pressure_symbol}
4204 \NewSubscriptedSymbol{\alphaS}{\expansivitysymbol}{\g_@@_entropy_symbol}
4205 % \end{macrocode}
4206 % \end{macro}
4207 % \begin{macro}{\muJT}
4208 % The macro \cs{muJT} renders the Joule--Thomson coefficient.
4209 % \begin{macrocode}
4210 \NewSubscriptedSymbol{\muJT}{\JTsymbol}{\text{JT}}
4211 % \end{macrocode}
4212 % \end{macro}
4213 %
4214 % \begin{macro}{\Psat,\Pvap,\phisat,\fsat,\sat}
4215 % The \cs{Psat} macro (and its clone, the \cs{Pvap} macro) should be used for
4216 % the saturation pressure.
4217 % Similarly, a \cs{phisat} macro typesets the fugacity coefficient at
4218 % saturation. The \cs{fsat} macro similarly renders the fugacity at saturation.
4219 % Other saturation properties should use \verb"M^\sat" or similar, preferably
4220 % by defining another macro such as \verb"\Gmsat".
4221 % \begin{macrocode}
4222 \NewDocumentCommand{\sat}{}{{\text{sat}}}
4223 \NewDocumentCommand{\Psat}{}{P\c_math_superscript_token\sat}
4224 \NewDocumentCommand{\Pvap}{}{\Psat}
4225 \NewDocumentCommand{\phisat}{}{\phi\c_math_superscript_token\sat}
4226 \NewDocumentCommand{\fsat}{}{\fpure\c_math_superscript_token\sat}
4227 % \end{macrocode}
4228 % \end{macro}
4229 % \begin{macro}{\std,\Pstd,\fstd,\Cstd,\mustd}
4230 % The \cs{std} macro denotes standard properties. \cs{Pstd}, \cs{Cstd},
4231 % \cs{fstd}, and \cs{mustd} are defined for convenience and for consistency
4232 % across textbooks.
4233 % \changes{v2.02}{2024/06/14}{Added \cs{Cstd} and \cs{mustd} to standardize
4234 % standard molalities and chemical potentials across textbooks.}
4235 % \begin{macrocode}
4236 \NewDocumentCommand{\std}{}{\circ}
4237 \NewDocumentCommand{\Pstd}{}{P\c_math_superscript_token \std}
4238 \NewDocumentCommand{\Cstd}{}{C\c_math_superscript_token \std}
4239 \NewDocumentCommand{\fstd}{}{f\c_math_superscript_token \std}
4240 \NewDocumentCommand{\mustd}{}{\mu\c_math_superscript_token \std}
4241 % \end{macrocode}
4242 % \end{macro}
4243 % \begin{macro}{\xrxn}
4244 % The \cs{xrxn} macro denotes the extent of reaction.
4245 % \changes{v2.02}{2024/06/14}{Added \cs{xrxn} macro to standardize the
4246 % extent of reaction macro across textbooks.}
4247 % \begin{macrocode}
4248 \NewDocumentCommand{\xrxn}{}{\xi}
4249 % \end{macrocode}
4250 % \end{macro}
4251 %
4252 % \begin{macro}{\fmix}
4253 % The \cs{fmix} command is intended to describe fugacities in mixtures.
4254 % It renders as $\hat f$ by default, and would be used as \verb"\fmix_i" or
4255 % the like, producing $\hat f_i$; some authors like to use $\bar f_i$ or
4256 % just $f_i$, and this command creates a consistent way to change between
4257 % such options.
4258 % \begin{macrocode}
4259 \NewDocumentCommand{\fmix}{}{\hat{f}}
4260 % \end{macrocode}
4261 % \end{macro}
4262 % \begin{macro}{\phimix}
4263 % A similar command, \cs{phimix}, renders $\hat\phi$ by default to represent
4264 % the fugacity coefficient in a mixture.
4265 % \begin{macrocode}
4266 \NewDocumentCommand{\phimix}{}{\hat\phi}
4267 % \end{macrocode}
4268 % \end{macro}
4269 % \begin{macro}{\fpure}
4270 % The \cs{fpure} command is intended to describe fugacities in pure substances.
4271 % It renders as $f$ by default, and would be used as \verb"\fpure" or
4272 % \verb"\fpure_i" or the like, producing $f_i$; some authors like to use
4273 % $f_{\text{pure}\,i}$, and others like to use $f_i^\bullet$; this command
4274 % creates a consistent way to change between the these options. A similar
4275 % command for $\phi$ is given, \cs{phipure}, for fugacity coefficients.
4276 % \begin{macrocode}
4277 \NewDocumentCommand{\fpure}{}{f}
4278 \NewDocumentCommand{\phipure}{}{\phi}
4279 % \end{macrocode}
4280 % \end{macro}
4281 % \begin{macro}{\actabs,\actrel}
4282 % The \cs{actabs} and \cs{actrel} macros are intended to standardize the macro
4283 % for the absolute and relative activities, respectively, across textbooks.
4284 % The defaults are \(\actabs\) and \(\actrel\), respectively.
4285 % \changes{v2.02}{2024/06/14}{Added \cs{actabs} and \cs{actrel} to make
4286 % absolute and relative activity symbols consistent.}
4287 % \begin{macrocode}
4288 \NewExpandableDocumentCommand{\actabs}{}{\lambda}
4289 \NewExpandableDocumentCommand{\actrel}{}{a}
4290 % \end{macrocode}
4291 % \end{macro}
4292 %
4293 % \subsubsection{Property Changes}
4294 % \begin{macro}{\Deltamix,\mixing}
4295 % Mixing properties, such as $\Deltamix\Gm$, should be accessed using
4296 % \verb"\Deltamix\Gm" and similar constructions---this construct will typeset
4297 % as $\Delta_{MIX}G$ using the |Thompson| package option, for example,
4298 % and as $\Delta_\text{mix}\Gt$ using the |Sandler| package option.
4299 % \begin{macrocode}
4300 \NewDocumentCommand{\mixing}{}{{\text{mix}}}
4301 \NewDocumentCommand{\Deltamix}{m}
4302 {\Delta{#1}\c_math_subscript_token\mixing}
4303 % \end{macrocode}
4304 % \end{macro}
4305 %
4306 % \pagebreak[2]%
4307 % \begin{macro}{\formation,\fusion,\reaction,\sublimation,\vaporization}
4308 % Macros for subscripts/superscripts on property changes,
4309 % \begin{macrocode}
4310 \NewDocumentCommand{\formation}{}{f}
4311 \NewDocumentCommand{\fusion}{}{{\text{fus}}}
4312 \NewDocumentCommand{\reaction}{}{{\text{rxn}}}
4313 \NewDocumentCommand{\sublimation}{}{{\text{sub}}}
4314 \NewDocumentCommand{\vaporization}{}{{\text{vap}}}
4315 % \end{macrocode}
4316 % \end{macro}
4317 % \begin{macro}{\Deltafus,\Deltasub,\Deltavap,\Deltarxn}
4318 % and similar macros for the property changes themselves. Some of these may
4319 % be redefined by package options that select a particular textbook.
4320 % \changes{v2.02}{2024/06/14}{Changed implementation of \cs{Deltarxn} to
4321 % handle subscripts.}
4322 % \begin{macrocode}
4323 \NewDocumentCommand{\Deltafus}{m}
4324 {\Delta #1\c_math_superscript_token\fusion}
4325 \NewDocumentCommand{\Deltasub}{m}
4326 {\Delta #1\c_math_superscript_token\sublimation}
4327 \NewDocumentCommand{\Deltavap}{m}
4328 {\Delta #1\c_math_superscript_token\vaporization}
4329 \NewDocumentCommand{\Deltarxn}{m}
4330 {
4331 \cs_set:Npn \@@_Deltarxn_one ##1
4332 {
4333 \Delta #1\c_math_subscript_token{\reaction,##1}
4334 }
4335 \peek_catcode_remove:NTF \c_math_subscript_token
4336 {
4337 \@@_Deltarxn_one
4338 }
4339 {
4340 \Delta #1\c_math_subscript_token{\reaction}
4341 }
4342 }
4343 \tl_new:N \l_@@_Deltaf_sym_tl
4344 \NewSubscriptedSymbol{\@@_Deltaf}{\l_@@_Deltaf_sym_tl}{\formation}
4345 \NewDocumentCommand{\Deltaf}{m}
4346 { \tl_set:Nn \l_@@_Deltaf_sym_tl {\Delta #1}
4347 \@@_Deltaf
4348 }
4349 % \end{macrocode}
4350 % \end{macro}
4351 %
4352 % \subsubsection{Partial Molar Quantities}
4353 % \begin{macro}{\partialmolar}
4354 % Partial molar quantities with superscripts appear as $\Gpm[\IG]{i}$ or
4355 % $\GRpm{i}$ (or, with the |shortpm| option, as
4356 % \begin{thermoshortpm}$\Gpm[\IG]{i}$ or $\GRpm{i}$\end{thermoshortpm}),
4357 % rather than something like $\overline{G}^\IG_i$ or $\overline{G}_i^R$; the
4358 % former looks better but is harder to implement for obvious reasons. Their
4359 % definitions allow them to be used as symbols, something like \verb"\Gpm_i",
4360 % \verb"\Gpm^{\IGM}_i", \verb"\Gpm^{\IGM}_i", and even \verb"\Gpm_i^{\IGM}";
4361 % they can also be treated as commands: \verb"\Gpm{i}" is equivalent to
4362 % \verb"\Gpm_i" and \verb"\Gpm[\IGM]{i}" is equivalent to \verb"\Gpm_i^{\IGM}".
4363 % The macro \cs{partialmolar} can be used to create an arbitrary partial
4364 % molar symbol.
4365 % \begin{macrocode}
4366 \tl_new:N \l_@@_pm_symbol_tl
4367 \tl_new:N \l_@@_pm_arg_tl
4368 \NewDocumentCommand{\partialmolar}{m}
4369 {
4370 \tl_set:Nn \l_@@_pm_symbol_tl {#1}
4371 \@@_generic_pm:
4372 }
4373 %% cases to consider:
4374 %% (1) \Mpm{i}
4375 %% (2) \Mpm[S]{i}
4376 %% (3) \Mpm^S_i
4377 %% (4) \Mpm_i^S
4378 %% (5) \Mpm_i
4379 %% note that \Mpm^S with no subscript makes no sense and is thus forbidden
4380 \cs_new:Nn \@@_generic_pm:
4381 {
4382 \peek_catcode_remove:NTF \c_math_subscript_token
4383 {% case 4 or case 5
4384 \@@_pm_case_four_or_five
4385 }
4386 {% look for superscript token
4387 \peek_catcode_remove:NTF \c_math_superscript_token
4388 {% case 3: \Mpm^{#1}_{#2} or \Mpm^{#1}{#2}
4389 \@@_pm_case_three
4390 }
4391 {% Look for optional argument [...]
4392 \peek_charcode:NTF [
4393 {% case 2: \Mpm[S]{i}
4394 \@@_pm_case_two
4395 }
4396 {% case 1: \Mpm{i}
4397 \@@_pm_case_one
4398 }
4399 }
4400 }
4401 }
4402 \cs_new:Npn \@@_pm_case_one #1
4403 {
4404 \bool_if:NTF \l_@@_longpm_bool
4405 { \@@_overline:n {\l_@@_pm_symbol_tl\c_math_subscript_token{#1}} }
4406 {
4407 \@@_overline:n {\l_@@_pm_symbol_tl}\c_math_subscript_token{#1}
4408 }
4409 }
4410 \cs_new:Npn \@@_pm_case_two [#1]#2
4411 {
4412 \bool_if:NTF \l_@@_longpm_bool
4413 { \@@_overline:n {\l_@@_pm_symbol_tl
4414 \c_math_superscript_token{#1}\c_math_subscript_token{#2}}
4415 }
4416 { \@@_overline:n {\l_@@_pm_symbol_tl}
4417 \c_math_superscript_token{#1}\c_math_subscript_token{#2}
4418 }
4419 }
4420 \cs_new:Npn \@@_pm_case_three #1
4421 {
4422 \tl_set:Nn \l_@@_pm_arg_tl {#1}
4423 \peek_catcode_remove:NTF \c_math_subscript_token
4424 { \@@_pm_case_three_part_two }
4425 { \@@_pm_case_three_part_two }
4426 }
4427 \cs_new:Npn \@@_pm_case_three_part_two #1
4428 {
4429 \bool_if:NTF \l_@@_longpm_bool
4430 { \@@_overline:n {\l_@@_pm_symbol_tl
4431 \c_math_superscript_token{\l_@@_pm_arg_tl}
4432 \c_math_subscript_token{#1}}
4433 }
4434 { \@@_overline:n {\l_@@_pm_symbol_tl}
4435 \c_math_superscript_token{\l_@@_pm_arg_tl}
4436 \c_math_subscript_token{#1}
4437 }
4438 }
4439 \cs_new:Npn \@@_pm_case_four_or_five #1
4440 {
4441 \tl_set:Nn \l_@@_pm_arg_tl {#1}
4442 \peek_catcode_remove:NTF \c_math_superscript_token
4443 { \@@_pm_case_four }
4444 { \@@_pm_case_five }
4445 }
4446 \cs_new:Npn \@@_pm_case_four #1
4447 {
4448 \bool_if:NTF \l_@@_longpm_bool
4449 { \@@_overline:n {\l_@@_pm_symbol_tl\c_math_superscript_token{#1}
4450 \c_math_subscript_token{\l_@@_pm_arg_tl}}
4451 }
4452 { \@@_overline:n {\l_@@_pm_symbol_tl}\c_math_superscript_token{#1}
4453 \c_math_subscript_token{\l_@@_pm_arg_tl}
4454 }
4455 }
4456 \cs_new:Npn \@@_pm_case_five
4457 {
4458 \bool_if:NTF \l_@@_longpm_bool
4459 { \@@_overline:n {\l_@@_pm_symbol_tl
4460 \c_math_subscript_token{\l_@@_pm_arg_tl}}
4461 }
4462 { \@@_overline:n {\l_@@_pm_symbol_tl}
4463 \c_math_subscript_token{\l_@@_pm_arg_tl}
4464 }
4465 }
4466 % \end{macrocode}
4467 % \end{macro}
4468 %
4469 % \subsubsection{Thermodynamic Property Definitions}
4470 % These macros define the user interface to the symbols for energy, volume,
4471 % and so forth. There are five commands that define thermodynamic properties.
4472 %
4473 % \begin{macro}{\NewExtensiveProperty}
4474 % The command \cs{NewExtensiveProperty} declares macros for a total, molar, and
4475 % specific version of the symbol; for example, a second heat-like property
4476 % could be defined via
4477 % \begin{verbatim}
4478 % \NewExtensiveProperty{R}{\mathcal{Q}}
4479 %\end{verbatim}
4480 % \NewExtensiveProperty{R}{\mathcal{Q}}\relax
4481 % The command above would declare the macros \cs{Rt}, \cs{Rm}, and \cs{Rs}
4482 % that expand to $\Rt$, $\Rm$, and $\Rs$, respectively, using the default
4483 % package options.
4484 % \end{macro}
4485 %
4486 % \begin{macro}{\NewPartialMolarProperty}
4487 % The command \cs{NewPartialMolarProperty} declares a macro for the partial
4488 % molar quantity. For example,
4489 % \begin{verbatim}
4490 % \NewPartialMolarProperty{I}{\Psi}
4491 %\end{verbatim}
4492 % \NewPartialMolarProperty{I}{\Psi}\relax
4493 % would create the command \cs{Ipm}, which would typeset a partial molar
4494 % command with the base symbol $\Psi$, yielding $\Ipm{i}$.
4495 % \end{macro}
4496 %
4497 % \begin{macro}{\NewThermodynamicProperty}
4498 % Declaring a new potential is handled by the
4499 % \cs{NewThermodynamicProperty} macro, which takes two arguments. The first
4500 % is the base of the name, and the second is the base of the symbol. This
4501 % declares four new commands for the extensive, molar, specific, and partial
4502 % molar properties. These commands consist of the first argument followed by
4503 % \verb"t", \verb"m", \verb"s", and \verb"pm", respectively. For example, one
4504 % might define the entropy via
4505 % \begin{verbatim}
4506 % \NewThermodynamicProperty{S}{S}
4507 %\end{verbatim}
4508 % and it would define the macros \cs{St}, \cs{Sm}, \cs{Ss}, and \cs{Spm} that
4509 % yield, respectively, $\St$, S, $\hat S$, and $\Spm{i}$ (assuming the
4510 % subscript to the partial molar quantity was $i$).
4511 % It would also declare residual and excess properties for that base symbol.
4512 % Note that the actual definition of the entropy and the other standard
4513 % properties is slightly more complicated so as to allow for different symbols
4514 % to be used in different textbooks.
4515 % \begin{macrocode}
4516 \NewDocumentCommand{\NewThermodynamicProperty}{m m}
4517 {
4518 \NewExtensiveProperty{#1}{#2}
4519 \NewPartialMolarProperty{#1}{#2}
4520 \NewResidualProperty{#1}{#2}
4521 \NewExcessProperty{#1}{#2}
4522 }
4523 \ProvideDocumentCommand{\NewExtensiveProperty}{m m}
4524 {
4525 % Extensive property
4526 \exp_after:wN \NewDocumentCommand \exp_after:wN
4527 {\cs:w #1t\cs_end:}{}{\@@_extensive:n {#2}}
4528 % Molar property
4529 \exp_after:wN \NewDocumentCommand \exp_after:wN
4530 {\cs:w #1m\cs_end:}{}{\@@_intensive:n {#2}}
4531 % Specific property
4532 \exp_after:wN \NewDocumentCommand \exp_after:wN
4533 {\cs:w #1s\cs_end:}{}{\@@_specific:n {#2}}
4534 }
4535 \NewDocumentCommand{\NewPartialMolarProperty}{m m}
4536 {
4537 % Partial molar property
4538 \exp_after:wN \NewDocumentCommand \exp_after:wN
4539 {\cs:w #1pm\cs_end:}{}{\partialmolar{#2}}
4540 }
4541 \ProvideDocumentCommand{\NewExcessProperty}{m m}
4542 {
4543 \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
4544 {\cs:w #1 Et\cs_end:}{\@@_extensive:n{#2}}{\excess}
4545 \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
4546 {\cs:w #1 E\cs_end:}{\@@_intensive:n{#2}}{\excess}
4547 \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
4548 {\cs:w #1 Es\cs_end:}{\@@_specific:n{#2}}{\excess}
4549
4550 % Excess partial molar property
4551 \exp_after:wN \NewDocumentCommand \exp_after:wN
4552 {\cs:w #1Epm\cs_end:}{}{\partialmolar{#2}
4553 \c_math_superscript_token\excess}
4554 }
4555 \ProvideDocumentCommand{\NewResidualProperty}{m m}
4556 {
4557 \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
4558 {\cs:w #1 Rt\cs_end:}{\@@_extensive:n{#2}}{\residual}
4559 \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
4560 {\cs:w #1 R\cs_end:}{\@@_intensive:n{#2}}{\residual}
4561 \exp_after:wN \NewSuperscriptedSymbol \exp_after:wN
4562 {\cs:w #1 Rs\cs_end:}{\@@_specific:n{#2}}{\residual}
4563
4564 % Residual partial molar property
4565 \exp_after:wN \NewDocumentCommand \exp_after:wN
4566 {\cs:w #1Rpm\cs_end:}{}{\partialmolar{#2}
4567 \c_math_superscript_token\residual}
4568 }
4569 % \end{macrocode}
4570 % \end{macro}
4571 % \begin{macro}{\Nt,\Et,\Em,\Es,\Epm}
4572 % \penalty-600%
4573 % We define \cs{Nt} as the number of moles, as that changes between books a
4574 % lot, but it does not have extensive, molar, and specific equivalents.
4575 % Heat and work are defined, but lack partial molar properties. Area does not
4576 % have excess or residual properties.
4577 % \begin{macrocode}
4578 \NewDocumentCommand{\Nt}{}{\g_@@_mole_symbol}
4579 \NewThermodynamicProperty{E}{\g_@@_total_energy_symbol}
4580 \NewThermodynamicProperty{U}{\g_@@_internal_energy_symbol}
4581 \NewThermodynamicProperty{F}{\g_@@_Helmholtz_symbol}
4582 \NewThermodynamicProperty{G}{\g_@@_Gibbs_symbol}
4583 \NewThermodynamicProperty{H}{\g_@@_enthalpy_symbol}
4584 \NewThermodynamicProperty{L}{\g_@@_Landau_symbol}
4585 \NewThermodynamicProperty{V}{\g_@@_volume_symbol}
4586 \NewThermodynamicProperty{S}{\g_@@_entropy_symbol}
4587 \NewExtensiveProperty{A}{\g_@@_area_symbol}
4588 \NewPartialMolarProperty{A}{\g_@@_area_symbol}
4589 \NewExtensiveProperty{Q}{\g_@@_heat_symbol}
4590 \NewExtensiveProperty{W}{\g_@@_work_symbol}
4591 % \end{macrocode}
4592 % \end{macro}
4593 %
4594 % \begin{macro}{\cVpm,\cPpm}
4595 % Partial molar heat capacities are \emph{hard}, but the following
4596 % implementation seems to work flawlessly\dots so far.
4597 % \changes{v2.02}{2024/06/14}{Simplified implementations of partial molar
4598 % heat capacities that take advantage of \cs{NewPartialMolarProperty} and
4599 % \cs{NewSubscriptedProperty}. This fixes the issue of the subscripts being
4600 % ``persistent'' after \cs{cPpm} is used in a line. Also declared alternative
4601 % symbols for use with the \texttt{shortpm} option.}
4602 % \begin{macrocode}
4603 \NewPartialMolarProperty{cP}{\cP}
4604 \NewPartialMolarProperty{cV}{\cV}
4605 \NewSubscriptedSymbol{\cPpmshort}{\@@_overline_copy:n{\heatcapacitysymbol}}
4606 {\g_@@_pressure_symbol}
4607 \NewSubscriptedSymbol{\cVpmshort}{\@@_overline_copy:n{\heatcapacitysymbol}}
4608 {\g_@@_volume_symbol}
4609 % \end{macrocode}
4610 % \end{macro}
4611 %
4612 % \subsubsection{Electrochemistry}
4613 % \begin{macro}{\Epot}
4614 % \changes{v2.02}{2024/06/14}{Added \cs{Epot} to standardize the electric
4615 % potential across textbooks for electrochemistry.}
4616 % The \cs{Epot} command can be used for the electric potential.
4617 % \begin{macrocode}
4618 \NewExpandableDocumentCommand{\Epot}{}{E}
4619 % \end{macrocode}
4620 % \end{macro}
4621 %
4622 % \subsubsection{Residual and Excess Properties}
4623 % \begin{macro}{\residual,\excess}
4624 % Macros are defined for residual properties (departure from ideal gases)
4625 % and excess properties (departure from ideal solutions). We begin with two
4626 % macros to use for defining generic residual and excess properties that are
4627 % not already defined.
4628 % \begin{macrocode}
4629 \NewDocumentCommand{\residual}{}{R}
4630 \NewDocumentCommand{\excess}{}{E}
4631 % \end{macrocode}
4632 % \end{macro}
4633 %
4634 % \pagebreak[1]\relax
4635 % \begin{macro}{\prodall,\sumall,\summallbutlast}
4636 % The \cs{sumall} macro and its cousin, \cs{sumallbutlast}, simplify the
4637 % typesetting of commonly-used sums; the command \cs{prodall} does the same
4638 % thing for products, viz.,
4639 % \begin{verbatim}
4640 % \[ \sumall_i x_i = 1 \qquad \sumallbutlast_i x_i = 1 - x_\ncomponents
4641 % \qquad K = \exp\left(\frac{-\Deltarxn\Gm^\std}{RT}\right)
4642 % = \prodall_i a_i^{\nu_i} \]
4643 %\end{verbatim}
4644 % gives
4645 % \[ \sumall_i x_i = 1 \qquad \sumallbutlast_i x_i = 1 - x_\ncomponents
4646 % \qquad K = \exp\left(\frac{-\Deltarxn\Gm^\std}{RT}\right)
4647 % = \prodall_i a_i^{\nu_i} \]
4648 % \begin{macrocode}
4649 \NewDocumentCommand{\sumall}{m m}
4650 { \sum\c_math_subscript_token{#2=1}
4651 \c_math_superscript_token{\ncomponents} }
4652 \NewDocumentCommand{\sumallbutlast}{m m}
4653 { \sum\c_math_subscript_token{#2=1}
4654 \c_math_superscript_token{\ncomponents-1} }
4655 \NewDocumentCommand{\prodall}{m m}
4656 { \prod\c_math_subscript_token{#2=1}
4657 \c_math_superscript_token{\ncomponents} }
4658 % \end{macrocode}
4659 % \end{macro}
4660 %
4661 % \begin{macro}{\IG,\IGM,\IS}
4662 % The \cs{IG}, \cs{IGM}, and \cs{IS} macros (meaning ``ideal gas,'' ``ideal
4663 % gas mixture,'' and ``ideal solution,'' respectively) should be used to
4664 % make clean transitions between textbooks---some use ``IM'' or ``ID'' rather
4665 % than ``IS,'' for example.
4666 % \begin{macrocode}
4667 \NewDocumentCommand{\IG}{}{{\text{IG}}}
4668 \NewDocumentCommand{\IGM}{}{{\text{IGM}}}
4669 \NewDocumentCommand{\IS}{}{{\text{IS}}}
4670 % \end{macrocode}
4671 % \end{macro}
4672 %
4673 % \begin{macro}{\Henryrat,\Henrymol}
4674 % \subsubsection{Henry's Law Constants and Activity Coefficients}
4675 % The Henry's Law constants for the rational basis ($y_i P = x_i h_i$) and
4676 % the molal basis ($y_i P = C_i \mathcal{H}_i$) are given by the macros
4677 % \cs{Henryrat} and \cs{Henrymol}, respectively. Using them this way
4678 % consistently allows for easy switching back and forth.
4679 % \begin{macrocode}
4680 \NewDocumentCommand{\Henryrat}{}{h}
4681 \NewDocumentCommand{\Henrymol}{}{\mathcal{H}}
4682 % \end{macrocode}
4683 % \end{macro}
4684 %
4685 % \begin{macro}{\gammait,\muit}
4686 % \changes{v2.02}{2024/06/14}{Added \cs{muit} and \cs{gammait} to preserve
4687 % symbols in case the base macros are redefined by a package.}
4688 % \begin{macro}{\gammarat,\gammamol}
4689 % The ordinary activity coefficient is typically denoted $\gamma$ or
4690 % $\gammaup$, so the base symbol will still be \cs{gamma}. The macro
4691 % \cs{gammait} is defined just in case \cs{gamma} is redefined by a package
4692 % option. However, symbols for the Henry's Law activity coefficients are far
4693 % from universal, so I have defined macros to make their use consistent. The
4694 % defaults render \cs{gammarat} as $\gamma^\ast$ and \cs{gammamol} as
4695 % $\gamma^\square$. \cs{gammamol} will use \cs{square} from packages if it is
4696 % defined; if not, it ``fakes it'' with the definition below.
4697 % The symbol for the chemical potential is \cs{mu}, but \cs{muit} is defined
4698 % so the symbol is still available, should \cs{mu} be redefined later.
4699 %^^A Backup for \square adapted from amsthm.sty with tweaks to make it
4700 %^^A look reasonably similar to that from newpx (i.e., smaller than the
4701 %^^A amsfonts version)
4702 % \begin{macrocode}
4703 \cs_gset_eq:NN \gammait \gamma
4704 \cs_gset_eq:NN \muit \mu
4705 \AtBeginDocument{%
4706 \ProvideDocumentCommand{\square}{}{%
4707 \text{\leavevmode
4708 \hbox to.65em{%
4709 \hfil\vrule
4710 \vbox to.53em{\hrule width.45em\vfil\hrule}%
4711 \vrule\hfil}%
4712 }%
4713 }%
4714 }
4715 \NewDocumentCommand{\gammarat}{}{\gamma\c_math_superscript_token\ast}
4716 \NewDocumentCommand{\gammamol}{}{\gamma\c_math_superscript_token\square}
4717 % \end{macrocode}
4718 % \end{macro}
4719 % \end{macro}
4720 % \subsection{Jacobians}
4721 % \begin{environment}{thermovmatrix}
4722 % This is a non-user-interface wrapper environment used to detect, in
4723 % effect, whether \pkg{amsmath} has been loaded. If so, it uses its
4724 % \env{vmatrix} environment for Jacobians; if not, it fakes it with
4725 % \env{array} (which does not look nearly as good).
4726 % \begin{macrocode}
4727 \NewDocumentEnvironment{thermovmatrix}{}
4728 { \cs_if_exist:NTF \vmatrix
4729 { \begin{vmatrix} }
4730 { \left|\begin{array}{c c c c c c c c c c} }
4731 }
4732 { \cs_if_exist:NTF \endvmatrix
4733 { \end{vmatrix} }
4734 { \end{array}\right| }
4735 }
4736 % \end{macrocode}
4737 % \end{environment}
4738 % \begin{macro}{Jacobian}
4739 % The \cs{Jacobian} command typesets the Leibnitz notation for the Jacobian
4740 % determinant.\relax
4741 % \changes{v2.00}{2023/11/16}{Reimplemented \cs{Jacobian} to handle an
4742 % arbitary number of variables and implemented \cs{Jacobiandet} to
4743 % handle the matrix representation of the Jacobian.}
4744 % \begin{macrocode}
4745 \NewDocumentCommand{\Jacobian}{m m}
4746 {\@@_frac:nn{\partial(#1)}{\partial{(#2)}}}
4747 % \end{macrocode}
4748 % \end{macro}
4749 % \begin{macro}{Jacobiandet}
4750 % Similarly, the \cs{Jacobiandet} macro typesets the actual determinant that
4751 % the Jacobian notation represents.
4752 % \begin{macrocode}
4753 \NewDocumentCommand{\Jacobiandet}{O{} O{} m m}
4754 {
4755 \@@_Jacobian_set_ncomponents:nn {#3} {#4}
4756 \begin{thermovmatrix}
4757 \@@_Jacobianmatrix:nnnn {#1} {#2} {#3} {#4}
4758 \end{thermovmatrix}
4759 }
4760 \seq_new:N \l_@@_row_seq
4761 \seq_new:N \l_@@_matrix_seq
4762 \clist_new:N \l_@@_other_vars_clist
4763 \clist_new:N \l_@@_other_vars_copy_clist
4764 \tl_new:N \l_@@_Jacobian_x_tl
4765 \tl_new:N \l_@@_Jacobian_n_tl
4766 \tl_new:N \l_@@_Jacobian_temp_tl
4767 \bool_new:N \l_@@_found_dots_bool
4768 \cs_new:Nn \@@_Jacobian_set_ncomponents:nn
4769 {
4770 % If any entry is \dots, we assume the Jacobian is of the form
4771 % d(f_1,\dots,f_n)/d(x_1,\dots,x_n) where f is some function
4772 % (any symbol) and x is some variable (any symbol).
4773 \tl_if_in:nnTF {#1} {\dots}
4774 {% Has dots
4775 \bool_set_true:N \l_@@_found_dots_bool
4776 % look for what "x" is
4777 \tl_set:Nn \l_@@_Jacobian_x_tl {\tl_head:n {#2}}
4778 % look for what "n" is and set \ncomponents to it
4779 \tl_set:Nx \l_@@_Jacobian_n_tl {\tl_item:nn {#2} {-1}}
4780 \RenewExpandableDocumentCommand{\ncomponents}{}{\l_@@_Jacobian_n_tl}
4781 }
4782 {% Does not have dots; proceed accordingly
4783 \bool_set_false:N \l_@@_found_dots_bool
4784 }
4785 }
4786 \cs_new_protected:Nn \@@_Jacobianmatrix:nnnn
4787 {
4788 \seq_clear:N \l_@@_matrix_seq
4789 \clist_set:Nn \l_@@_other_vars_clist {#4}
4790 \clist_set_eq:NN \l_@@_other_vars_copy_clist \l_@@_other_vars_clist
4791
4792 \clist_map_inline:nn {#3}
4793 {
4794 \seq_clear:N \l_@@_row_seq
4795 \tl_if_in:nnTF {##1} {\dots}
4796 {% The current row has "dots" => row is \vdots && \vdots
4797 \seq_put_right:Nn \l_@@_matrix_seq
4798 { \vdots \c_alignment_token \c_alignment_token \vdots }
4799 }
4800 {% Ordinary row
4801 \clist_map_inline:nn {#4}
4802 {
4803 \tl_if_in:nnTF {####1} {\dots}
4804 {% this column has "dots" in it
4805 \seq_put_right:Nn \l_@@_row_seq \dots
4806 }
4807 {% Normal column
4808 \clist_set_eq:NN \l_@@_other_vars_clist
4809 \l_@@_other_vars_copy_clist
4810 \clist_remove_all:Nn \l_@@_other_vars_clist {####1}
4811 \bool_if:NTF \l_@@_found_dots_bool
4812 { \tl_set:Nn \l_@@_Jacobian_temp_tl {\tl_item:nn {####1} {-1}}
4813 \seq_put_right:Nx \l_@@_row_seq
4814 {
4815 #1\Partial{##1}{####1}
4816 {\allbut{\l_@@_Jacobian_temp_tl}{\l_@@_Jacobian_x_tl}}
4817 }
4818 }
4819 { \seq_put_right:Nx \l_@@_row_seq
4820 {
4821 #1\Partial{##1}{####1}
4822 {\clist_use:Nn \l_@@_other_vars_clist ,}
4823 }
4824 }
4825 }
4826 }
4827 \seq_put_right:Nx \l_@@_matrix_seq
4828 {
4829 \seq_use:Nn \l_@@_row_seq { \c_alignment_token }
4830 }
4831 }
4832 }
4833 \tl_if_empty:nTF {#2}
4834 {
4835 \tl_if_eq:nnTF {#1} {\displaystyle}
4836 { \seq_use:Nn \l_@@_matrix_seq { \\[2.75ex] } }
4837 { \seq_use:Nn \l_@@_matrix_seq { \\[1.25ex] } }
4838 }
4839 {
4840 \seq_use:Nn \l_@@_matrix_seq { \\[#2] }
4841 }
4842 }
4843 % \end{macrocode}
4844 % \end{macro}
4845 %^^X\end{implementation}
4846 %
4847 % \Finale
4848 % \iffalse
4849 %</package>
4850 %<*example>
4851 \documentclass{article}
4852 \usepackage[margin=1in]{geometry}
4853 \usepackage{amsmath,amssymb}
4854 \usepackage{thermodynamics}
4855 \title{Examples to Accompany the \textsf{thermodynamics} Package}
4856 \author{Karl D. Hammond}
4857 \date{}
4858 \begin{document}
4859 \NewThermodynamicProperty{B}{B}
4860 \maketitle\noindent
4861 The combined laws:
4862 \begin{align*}
4863 d\Et &= d\Ut + d\left(\frac12 m v^2\right) - d(m\phi) \\
4864 d\Ut &= \dbar\Qt + \dbar\Wt + \Um d\Nt
4865 = \dbar\Qt - P d\Vt + \Hm d\Nt
4866 \\ &= \Partial*{\Ut}{\St}{\Vt,\allNs} d\St
4867 + \Partial*{\Ut}{\Vt}{\St,\allNs} d\Vt
4868 + \sumall_i \Partial*{\Ut}{\Nt_i}{\Vt,\St,\allNsbut{i}} d\Nt_i
4869 \\ &= T d\St - P d\Vt + \sumall_i \mu_i d\Nt_i
4870 \end{align*}
4871 With surfaces present:
4872 \begin{gather*}
4873 d\Ut = T d\St - P d\Vt + \sigma d\At + \sumall_i \mu_i d\Nt_i \\
4874 d\Ht = T d\St + \Vt dP + \sigma d\At + \sumall_i \mu_i d\Nt_i \\
4875 d\Ft = -\St dT - P d\Vt + \sigma d\At + \sumall_i \mu_i d\Nt_i \\
4876 d\Gt = -\St dT + \Vt dP + \sigma d\At + \sumall_i \mu_i d\Nt_i \\
4877 d\Lt = -\St dT - P d\Vt + \sigma d\At - \sumall_i \Nt_i d\mu_i \\
4878 \Bt = \Ut + P\Vt - T\St - \sigma\At \\
4879 d\Bt = -\St dT + \Vt dP - \At d\sigma + \sumall_i \mu_i d\Nt_i \\
4880 \mu_i = \Bpm_i = \Gpm_i + \sigma \Apm_i
4881 \end{gather*}
4882 Some Maxwell reciprocity relations:
4883 \begin{gather*}
4884 \Partial*{\Vt}{T}{P,\allNs}
4885 = \PartialMixSecond*{\Gt}{T}{P}{\allNs}
4886 = \PartialMixSecond*{\Gt}{P}{T}{\allNs}
4887 = -\Partial{\St}{P}{T,\allNs}
4888 \\
4889 \Partial*{\Gpm_i}{T}{P,\allXs}
4890 = \PartialMixSecond*{\Gt}{T}{\Nt_i}{P,\allNsbut{i}}
4891 = \PartialMixSecond*{\Gt}{\Nt_i}{T}{P,\allNsbut{i}}
4892 = -\Partial*{\St}{\Nt_i}{T,P,\allNsbut{i}}
4893 = -\Spm_i
4894 \end{gather*}
4895 Temporary changes of derivative delimiters:
4896 \begin{gather*}
4897 \begin{thermobrackets}
4898 \Partial*{\Vt}{T}{P,\allNs}
4899 \end{thermobrackets}
4900 \begin{thermobar}
4901 = \PartialMixSecond*{\Gt}{T}{P}{\allNs}
4902 \end{thermobar}
4903 \begin{thermomolesrange}
4904 = \PartialMixSecond*{\Gt}{P}{T}{\allNs}
4905 \end{thermomolesrange}
4906 \begin{thermobraces}
4907 = -\Partial*{\St}{P}{T,\allNs}
4908 \begin{thermoNOsubscripts}
4909 \begin{thermomolesrange}
4910 = -\Partial{\St}{P}{T,\allNs}
4911 \end{thermomolesrange}
4912 \end{thermoNOsubscripts}
4913 \end{thermobraces}
4914 \end{gather*}
4915 Inline derivatives:
4916 \begin{gather*}
4917 \mu_i = \Partialinline{\Gt}{\Nt_i}{T,P,\allNsbut{i}}
4918 = \Partialinline{\Ft}{\Nt_i}{T,\Vt,\allNsbut{i}}
4919 = \Partialinline{\Ht}{\Nt_i}{\St,P,\allNsbut{i}}
4920 = \Partialinline{\Ut}{\Nt_i}{\St,\Vt,\allNsbut{i}}
4921 \end{gather*}
4922 The heat capacities:
4923 \begin{gather*}
4924 \cV = T \Partial*{\Sm}{T}{\Vm,\allXs} = \Partial*{\Um}{T}{\Vm,\allXs}
4925 = -T\PartialSecond{\Fm}{T}{\Vm,\allXs}
4926 \\
4927 \cP^\IGM = T \Partial*{\Sm^\IGM}{T}{P,\allYs}
4928 = \Partial*{\Hm^\IGM}{T}{P,\allYs}
4929 \begin{thermobrackets}
4930 = -T\PartialSecond{\Gm^\IGM}{T}{P,\allYs}
4931 \end{thermobrackets}
4932 \\
4933 \cVt = T \Partial*{\St}{T}{\Vt,\allNs} = \Partial*{\Ut}{T}{\Vt,\allNs}
4934 \begin{thermobraces}
4935 = -T\PartialSecond{\Ft}{T}{\Vm,\allNs}
4936 \end{thermobraces}
4937 \\
4938 \begin{thermobar}
4939 \cPt = T \Partial*{\St}{T}{P,\allNs} = \Partial*{\Ht}{T}{P,\allNs}
4940 = -T\PartialSecond{\Gt}{T}{P,\allNs}
4941 \end{thermobar}
4942 \\
4943 \cVs = T \Partial*{\Ss}{T}{\Vs,\allWs} = \Partial*{\Us}{T}{\Vs,\allWs}
4944 \begin{thermoplain}
4945 = -T\PartialSecond{\Fs}{T}{\Vs,\allWs}
4946 \end{thermoplain}
4947 \\
4948 \cPs = T \Partialbigg*{\Ss}{T}{P,\allWs} = \Partialbigg*{\Hs}{T}{P,\allWs}
4949 = -T\PartialSecondbigg{\Gs}{T}{P,\allWs}
4950 \\
4951 \begin{split}
4952 \cPpm_i &= \Partial*{\cPt}{\Nt_i}{T,P,\allNsbut{i}}
4953 = T \PartialMixSecond*{\St}{\Nt_i}{T}{P,\allNsbut{i}}
4954 = T \PartialMixSecond*{\St}{T}{\Nt_i}{P,\allNsbut{i}}
4955 \\ &= T \Partial*{\Spm_i}{T}{P,\allXs}
4956 = \Partial*{\Hpm_i}{T}{P,\allXs}
4957 = \PartialMixSecond*{\Ht}{T}{\Nt_i}{P,\allNsbut{i}}
4958 = \PartialMixSecond*{\Ht}{\Nt_i}{T}{P,\allNsbut{i}}
4959 \\ &= -T\PartialSecond*{\Gpm_i}{T}{P,\allXs}
4960 = -T\Partial{{}^3 \Gt}{T^2\partial \Nt_i}{P,\allNsbut{i}}
4961 \end{split}
4962 \end{gather*}
4963 Other measurable quantities:
4964 \begin{align*}
4965 \alphaS &= \frac{1}{\Vm} \Partial{\Vm}{T}{\Sm} &
4966 \alphaP &= \frac{1}{\Vm} \Partial{\Vm}{T}{P} \\
4967 \kappaS &= -\frac{1}{\Vm} \Partial{\Vm}{P}{\Sm} &
4968 \kappaT &= -\frac{1}{\Vm} \Partial{\Vm}{P}{T}
4969 \end{align*}
4970 The chemical potential, fugacity, and activity:
4971 \[ \mu_i = \Gpm_i = \Gm_i^\std + RT \ln a_i
4972 = \Gm_i^\std + RT\ln\left(\frac{\fmix_i}{\fstd_i}\right) \]
4973 Equilibrium in a chemical reaction:
4974 \[ \sumall_i \nu_i \mu_i = 0
4975 \Rightarrow
4976 \exp\left(\frac{-\Delta\Gm^\std}{RT}\right) = K = \prodall_i a_i^{\nu_i} \]
4977 Partial molar quantities:
4978 \begin{align*}
4979 \Hpm{i} &= \Partial*{\Ht}{\Nt_i}{T,P,\allNsbut{i}}
4980 = \Hm + \Nt \Partial*{\Hm}{\Nt_i}{T,P,\allNsbut{i}}
4981 \\ &= \Hm + \Partial*{\Hm}{x_i}{T,P,\allXsbut{i}}
4982 - \sumallbutlast_j x_j \Partial*{\Hm}{x_j}{T,P,\allXsbut{j}}
4983 = \Partial*{\Hm}{x_i}{T,P,\allXsbut{i}} + \Hpm_\ncomponents
4984 \end{align*}
4985 \[ \Vpm_i = \Partial{\Vt}{\Nt_i}{T,P,\allNsbut{i}} \]
4986 Fugacity and related properties:
4987 \begin{gather*}
4988 \Gpm_i = \mu_i
4989 = \Gm_i^\std(T) + RT\ln a_i
4990 = \Gm_i^\std(T) + RT\ln\left(\frac{\fmix_i}{\fstd_i}\right)
4991 \\
4992 a_i = \frac{\fmix_i}{\fstd_i}
4993 = x_i \gamma_i
4994 \exp\left(\frac{1}{RT} \int_{\Pstd}^P \Vm_i(T,p)\,dp\right)
4995 \approx x_i \gamma_i
4996 \\
4997 \begin{split}
4998 \fmix_i &= x_i \phimix_i P
4999 = x_i \gamma_i \fpure_i = x_i \gamma_i \phipure_i P
5000 = x_i \gammarat_i \Henryrat_i
5001 = C_i \gammamol_i \Henrymol_i
5002 = x_i \gamma_i \fsat_i
5003 \exp\left(\frac{1}{RT} \int_{\Psat_i}^P \Vm_i(T,p)\,dp\right)
5004 \\ &= x_i \gamma_i \Psat_i \phisat_i
5005 \exp\left(\frac{1}{RT} \int_{\Psat_i}^P \Vm_i(T,p)\,dp\right)
5006 \approx x_i \gamma_i \Psat_i
5007 \end{split}
5008 \end{gather*}
5009 Chemical Equilibria:
5010 \begin{gather*}
5011 \Deltarxn\Hm^\std = \sumall_i \nu_i \Deltaf\Hm_i^\std \\
5012 \Deltarxn\Gm^\std = \sumall_i \nu_i \Deltaf\Gm_i^\std
5013 = \sumall_i \nu_i \mu_i^\std \\
5014 \Deltarxn\cP^\std = \sumall_i \nu_i \cP_i^\std \\
5015 \mu_i = \mu_i^\std + RT\ln a_i \\
5016 a_i = \begin{cases}
5017 \displaystyle
5018 \frac{y_i \phimix_i P}{\Pstd} \approx \frac{y_i P}{\Pstd}
5019 & \text{(gases)} \\
5020 \rule{0pt}{5ex}%
5021 \displaystyle
5022 x_i \gamma_i \exp\left(\frac{1}{RT} \int_{\Pstd}^P \Vm_i(T,p)\,dp\right)
5023 \approx
5024 x_i \gamma_i \exp\left(\frac{\Vm_i(P-\Pstd)}{RT}\right)
5025 \approx x_i \gamma_i \approx 1
5026 & \text{(solids, solvents)} \\
5027 \displaystyle
5028 \rule{0pt}{5ex}%
5029 \frac{C_i \gammamol_i}{C_i^\std}
5030 \exp\left(\frac{1}{RT}
5031 \int_{\Pstd}^P \Vpm_i^\infty(T,p,\allXs)\,dp\right)
5032 \approx
5033 \frac{C_i \gammamol_i}{C_i^\std} \approx \frac{C_i}{C_i^\std}
5034 & \text{(solutes)}
5035 \end{cases}
5036 \end{gather*}
5037 Phase change properties:
5038 \begin{gather*}
5039 \Deltafus\Sm = \Sm^L - \Sm^S \\
5040 \Deltasub\Vm = \Vm^V - \Vm^S \\
5041 \Deltavap\Gm = \Gm^V - \Gm^L
5042 \end{gather*}
5043 Specific properties:
5044 \newcommand*{\Btilde}[2][]{\widetilde{B}_{#2}^{#1}}
5045 \[ \Btilde{j} \equiv \Partial{\Bt}{m_j}{T,\Vs,\allMsbut[i]{j}} \]
5046 and thus
5047 \[ \Btilde{i}
5048 = \frac{\Bpm{i}}{M_i}
5049 + \Biggl(\Vs - \frac{\Vpm_i}{M_i}\Biggr)
5050 \Partial*{\Bs}{\Vs}{T,\allMs}
5051 = \frac{\Bpm{i}}{M_i}
5052 + \Biggl(\Vs - \frac{\Vpm_i}{M_i}\Biggr)
5053 \Partial{\Bs}{\Vs}{T,m,\allWs} \]
5054 and
5055 \[ \Bs = \sumall_i w_i \Btilde{i}. \]
5056 Excess and Residual (Departure) Properties:
5057 \begin{align*}
5058 \HR &= \Hm - \Hm^\IG &
5059 \FR &= \Fm - \Fm^\IGM \\
5060 \SE &= \Sm - \Sm^\IS &
5061 \VRpm_k &= \Vpm_k - \Vpm_k^\IGM
5062 \end{align*}
5063 Jacobians:
5064 \begin{gather*}
5065 \Jacobian{\St,\Vt}{T,P} = \Jacobiandet{\St,\Vt}{T,P} \\
5066 \Jacobian{f,g,h}{x,y,z} = \Jacobiandet[\displaystyle]{f,g,h}{x,y,z} \\
5067 \Jacobian{h_1,\dots,h_k}{z_1,\dots,z_k} =
5068 \Jacobiandet{h_1,\dots,h_k}{z_1,\dots,z_k} \\
5069 \cP = T\Partial{\Sm}{T}{P}
5070 = T\Jacobian{\Sm,P}{T,P}
5071 = -T\Jacobian{\Sm,P}{T,\Vm} \Jacobian{T,\Vm}{T,P}
5072 = -T\Jacobian{P,\Sm}{\Vm,\Sm} \Jacobian{\Vm,\Sm}{T,\Vm}
5073 \Jacobian{T,\Vm}{T,P}
5074 = \gamma \cV
5075 \end{gather*}
5076 \end{document}
5077 %</example>
5078 % \fi
5079 %
5080 % \Finale
5081 \endinput