4

I have

\usepackage{romannum}
\usepackage{amsmath}
\usepackage{mathtools}  

How is it possible to write enter image description here

using

\begin{subequations}
\begin{align}
...
\end{align}
\end{subequations}

The code is shown below:

\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}
Meva
  • 187

2 Answers2

5

Introduced a new command \romanbrace

enter image description here

\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}
Werner
  • 603,163
JPi
  • 13,595
  • 1
    I think you've solved the OP's first issue, viz., how to get the "label" below each underbrace to be incremented automatically and to be displayed in Roman numerals. I think the OP also wants to be able to cross-reference the braced items; can your approach accomplish this? (Incidentally, I've made your code a bit more "LaTeX-y"; feel free to revert.) – Mico Oct 02 '16 at 08:34
  • 2
    \romanbrace -- nice touch! :-) – Mico Oct 02 '16 at 14:51
2

Some suggestions

  • Get rid of as much visual clutter as possible. Omit unneeded parentheses, keep the size of various groups of parentheses consistent, and assure that the underbraces are all at the same depth. (In the code below, look for a couple of \vphantom statements.) Choose line breaks so that none of the equation material protrudes into the margin.

  • Don't load any given package more than once. Also, don't load packages in a redundant way: the amstext package is loaded automatically by the amsmath package which, in turn, is loaded automatically by the mathtools package.

  • Align the = symbols in rows 1 and 3 relative to each other, and indent the material on lines 2 and 4.

  • Use a dedicated counter -- called romcount in the code below -- and set its appearance to be uppercase-Roman. Then, set up a macro (called \romantag in the code below) increments and displays this counter; use this macro in the second argument of the various \underbrace statements.

enter image description here

\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}
Mico
  • 506,678