我有
\usepackage{romannum}
\usepackage{amsmath}
\usepackage{mathtools}
使用
\begin{subequations}
\begin{align}
...
\end{align}
\end{subequations}
代码如下所示:
\documentclass{article}
\usepackage{romannum}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{geometry}
\geometry{legalpaper, portrait, margin=1.3in}
\usepackage{anyfontsize}
\usepackage{svg}
\usepackage{t1enc}
\pagestyle{fancy}
\fancyhf{}
\usepackage{amsmath}
\lhead{Small time solution from (15a,b)}
\rfoot{Page \thepage}
\usepackage[titletoc,toc]{appendix}
\usepackage{graphicx,amssymb,amstext}
\usepackage{graphicx}
%\usepackage[]{mcode}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{cleveref}
\usepackage{nameref}
\usepackage{cite}
\usepackage{enumerate}
\usepackage{amssymb}
\usepackage{mathtools} % new commands %
\newcommand \bprime {\backprime\hspace{-.11em} } % backstroke
\newcommand \xprime {\prime\hspace{-.25em}\backprime} % cross
\showoutput
\showboxdepth3
\titleformat{\section}
{\normalfont\Large\bfseries} % The style of the section title
{} % a prefix
{0pt} % How much space exists between the prefix and the title
{Section \thesection:\quad} % How the section is represented
% Starred variant
\titleformat{name=\section,numberless}
{\normalfont\Large\bfseries}
{}
{0pt}
{}
\begin{document}
\begin{subequations}
\begin{align}
h^{''} = \frac{1}{2} - \underbrace{\frac{\Big(h(T) + (1-b) \theta (T) \Big)^2}{4 A \sqrt{A \kappa}}}_\text{\Romannum{1}} \Big\{ \underbrace{\frac{(1 - C) \sqrt{\frac{\kappa}{A}}}{(1+(1-C)^2 \frac{\kappa}{A})}}_\text{\Romannum{2}}+ \underbrace{ \frac{C \sqrt{\frac{\kappa}{A}}}{(1+ C^2 \frac{\kappa}{A})}}_\text{\Romannum{3}} + \underbrace{ \arctan \Big(\frac{\sqrt{\frac{\kappa}{A}}}{1 - C (1-C) \frac{\kappa}{A}}\Big)}_\text{\Romannum{4}} \Big\} - M \hat g,
\\
\Gamma \theta^{''} = \frac{1}{2} \bigg( \frac{1}{2} - b - \underbrace{\Big(h(T) + (1-b) \theta (T) \Big)^2}_\text{\Romannum{5}} \bigg\{ -\frac{1}{2A \kappa} \bigg( \underbrace{\frac{1}{(1+ (1-C)^2 \frac{\kappa}{A})}}_\text{\Romannum{6}} - \underbrace{\frac{1}{(1+C^2 \frac{\kappa}{A})}}_\text{\Romannum{7}}\bigg)
\\
+ \underbrace{ \frac{(C-b)}{2 A \sqrt{A\kappa}}}_\text{\Romannum{8}} \Big\{ \underbrace{ \frac{(1 - C) \sqrt{\frac{\kappa}{A}}}{(1+(1-C)^2 \frac{\kappa}{A})}}_\text{\Romannum{9}} + \underbrace{ \frac{C \sqrt{\frac{\kappa}{A}}}{(1+ C^2 \frac{\kappa}{A})}}_\text{\Romannum{10}} + \underbrace{ \arctan \Big(\frac{\sqrt{\frac{\kappa}{A}}}{1 - C (1-C) \frac{\kappa}{A}}\Big) }_\text{\Romannum{11}}\Big\} \bigg\} \bigg) .
\end{align}
\end{subequations}
\\
\end{document}
答案1
引入了新命令\romanbrace
\documentclass{article}
\usepackage{amsmath}
\newcounter{fudge}
\renewcommand\thefudge{\textnormal{\Roman{fudge}}}
\newcommand{\ouch}{\refstepcounter{fudge}\thefudge}
\newcommand{\romanbrace}[1]{\underbrace{#1}_{\ouch}}
\begin{document}
\begin{subequations}
\begin{align}
y&= t_hi_s + i_s + \romanbrace{c_r a_z y!} \\
z&= \romanbrace{s_tu_pi_d}
\end{align}
\end{subequations}
\end{document}
答案2
一些建议
尽可能消除视觉混乱。省略不需要的括号,保持各组括号的大小一致,并确保下括号的深度相同。(在下面的代码中,查找几个
\vphantom
语句。)选择换行符,使公式材料不会突出到边距中。不要多次加载任何给定的包。另外,不要以冗余的方式加载包:
amstext
包由包自动加载amsmath
,包又由mathtools
包自动加载。将
=
第 1 行和第 3 行的符号彼此对齐,并将第 2 行和第 4 行的材料缩进。使用专用计数器(
romcount
在下面的代码中调用)并将其外观设置为大写罗马字母。然后,设置一个宏(\romantag
在下面的代码中调用)以增加并显示此计数器;在各个语句的第二个参数中使用此宏\underbrace
。
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{geometry}
\geometry{legalpaper, portrait, margin=1.3in}
\usepackage{svg}
\usepackage{t1enc}
\pagestyle{fancy}
\fancyhf{}
\lhead{Small time solution from (15a,b)}
\rfoot{Page \thepage}
\usepackage[titletoc,toc]{appendix}
\usepackage{graphicx,amssymb}%%%,amstext}
%%%\usepackage{amsmath}
%%%\usepackage{graphicx}
%\usepackage[]{mcode}
\usepackage{xcolor}
\usepackage{titlesec}
%%%\usepackage{xcolor}
\usepackage{cite}
\usepackage{enumerate}
%%%\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[colorlinks]{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref}
\usepackage{nameref}
\titleformat{\section}
{\normalfont\Large\bfseries} % The style of the section title
{} % a prefix
{0pt} % How much space exists between the prefix and the title
{Section \thesection:\quad} % How the section is represented
% Starred variant
\titleformat{name=\section,numberless}
{\normalfont\Large\bfseries}
{}
{0pt}
{}
\newcounter{romcount}
\renewcommand\theromcount{\Roman{romcount}}
\newcommand\romantag{\stepcounter{romcount}\textnormal{\theromcount}}
\begin{document}
\begin{subequations}
\begin{align}
h'' &= \frac{1}{2} - M \hat g \notag\\
&\qquad-
\underbrace{\frac{\bigl(h(T) + (1-b) \theta (T) \bigr)^2}{4 A \sqrt{A \kappa}}}_{\romantag} \biggl\{
\underbrace{\frac{(1 - C) \sqrt{\frac{\kappa}{A}}}{1+(1-C)^2 \frac{\kappa}{A}}}_{\romantag}+
\underbrace{ \frac{C \sqrt{\frac{\kappa}{A}}}{1+ C^2 \frac{\kappa}{A}}}_{\romantag} +
\underbrace{ \arctan \frac{\sqrt{\frac{\kappa}{A}}}{1 - C (1-C) \frac{\kappa}{A}}}_{\romantag} \biggr\} \,, \label{eq:first}\\
\Gamma \theta'' &=
\frac{1}{2} \bigg[ \frac{1}{2} - b -
\underbrace{\bigl(h(T) + (1-b) \theta (T) \vphantom{\frac{1}{\frac{\kappa}{A}}}\bigr)^2}_{\romantag}
\biggl\{ -\frac{1}{2A \kappa} \bigg(
\underbrace{\frac{1}{1+ (1-C)^2 \frac{\kappa}{A}}}_{\romantag} -
\underbrace{\frac{1}{1+C^2 \frac{\kappa}{A}}}_{\romantag}\bigg) \notag \\
&\qquad+
\underbrace{ \frac{C-b}{2 A \sqrt{A\kappa}}\vphantom{\frac{1}{\frac{\kappa}{A}}}}_{\romantag} \biggl(
\underbrace{ \frac{(1 - C) \sqrt{\frac{\kappa}{A}}}{1+(1-C)^2 \frac{\kappa}{A}}}_{\romantag} +
\underbrace{ \frac{C \sqrt{\frac{\kappa}{A}}}{1+ C^2 \frac{\kappa}{A}}}_{\romantag} +
\underbrace{ \arctan \frac{\sqrt{\frac{\kappa}{A}}}{1 - C (1-C) \frac{\kappa}{A}} }_{\romantag}
\biggr) \biggr\} \bigg] \,. \label{eq:second}
\end{align}
\end{subequations}
\end{document}