我想将图中的公式编号排列起来。但是,我无法添加公式\circ
(1.5) 的唯一编号。有人能帮我吗?谢谢。
\documentclass[12pt,a4paper]{article}
\usepackage[version=4]{mhchem}
\usepackage{chemfig}
\usepackage{graphicx}
\graphicspath{{c:/university study/photos}}
\usepackage{amsmath}
\usepackage[fleqn]{mathtools}
\newtagform{Charles}{$($}{$)^{\circ}$}
\numberwithin{equation}{section}
\begin{document}
\title{Properties of Gas}
\maketitle
\newpage
\stepcounter{section}
\setcounter{equation}{0}
\section*{Summary of Equation}
\begin{align}
p &= f(T,V,n) \label{eq:one}\\
p &= \frac{F}{A} \label{eq:two}\\
p &= \frac{\rho Agh}{A}\nonumber\\
&= \rho gh \label{eq:three}\\
T/K &= \theta/^\circ C +273.15 \label{eq:four}
\end{align}
\begin{flushleft}
Boyle's law
\end{flushleft}
\begin{align}
\usetagform{Charles}
pV &= constant,\text{ }at\text{ }constant\text{ }n, T
\end{align}
\begin{align}
p_j &= x_j \cdot p\\
x_j &= \frac{n_j}{n_{total}}\\
p_a + p_b +\cdots &= (x_A+x_B+\cdots) = p
\end{align}
\begin{flushleft}
\end{flushleft}
\end{document}
答案1
以下代码 (a) 使用该mathtools
包定义一个新的方程标记形式,称为“Charles”,并且 (b) 创建两个宏,名为\PlainTag
和\CharlesTag
,分别实现当前方程的默认和“Charles”标记形式,无论\usetagform{Charles}
或\usetagform{default}
是否有效。(显然不能发出\usetagform
指令里面一群align
人。
\documentclass[12pt,a4paper]{article}
\counterwithin{equation}{section}
\usepackage[fleqn]{mathtools}
\newtagform{Charles}{$($}{$)^{\circ}$} % create a new 'global' tag form
% Create two "on the fly" tag forms:
\newcommand\PlainTag{\refstepcounter{equation}\tag*{(\theequation)}}
\newcommand\CharlesTag{\refstepcounter{equation}\tag*{(\theequation)$^{\circ}$}}
\begin{document}
\section{Summary of Equation}
\begin{align}
p &= f(T,V,n) \\
p &= \frac{F}{A} \\
p &= \frac{\rho Agh}{A} = \rho gh \\
T/K &= \theta/^{\circ} \mathrm{C} +273.15 \CharlesTag % (override "plain" tag form
\end{align}
\usetagform{Charles} % switch to "Charles" tag form
\paragraph{Boyle's law}
\begin{align}
pV &= \text{constant at constant $n$, $T$} \\
p_j &= x_j \cdot p \PlainTag \\ % override 'Charles' tag form
x_j &= \frac{n_j}{n_{\mathrm{total}}} \PlainTag \\ % override 'Charles' tag form
p_a + p_b +\cdots &= (x_A+x_B+\cdots) = p % no override, hence use 'Charles' tag form
\end{align}
\end{document}