2

enter image description here

In the figure above, the subequations part of numbering is alphabetical, but I want to customize both the equation and the subequation part to look like this: a-I, a-II, and a-III. Here is the source code:

\documentclass{book}

\usepackage{amsmath}
\usepackage{amssymb, amsfonts}

\usepackage{subfloat}


\begin{document}

\begin{subequations}

    \begin{align}
        I_{sc} & = I_{sc,ref} & \hspace{-30 mm} \bigg[  1 + \frac{\alpha}{100} (T_{op}-T_{ref}) \biggl]
        \vspace{2 mm}
        \label{eq:I_sc_trans_STC2}
        \\
        %
        V_{oc} & = V_{oc,ref} & \hspace{-30 mm} \bigg[  1 + \frac{\beta}{100} (T_{op}-T_{ref}) \biggl]
        \vspace{2 mm}
        \label{eq:V_oc_trans_STC}
        \\
        %
        P_{mp} & = P_{mp,ref} & \hspace{-30 mm} \bigg[  1 + \frac{\gamma}{100} (T_{op}-T_{ref}) \biggl]
        \label{eq:P_mp_trans_STC}
    \end{align}

\end{subequations}

\end{document}
  • The env is not customizable. But it is simple, find the code for it in amsmath.sty and make your own version in your preamble – daleif Jul 7 '17 at 5:37
  • I removed the cleverref tag because the problem does not seem to involve the cleverref package at all (it's not loaded in the MWE). Feel free to rollback the edit if I am mistaken. – Troy Jul 7 '17 at 6:24
2

You can put

\renewcommand{\theequation}{\alph{parentequation}--\Roman{equation}}

just after \begin{subequations}.

In the following MWE I've used alignat instead of align to avoid using text commands for horizontal space, and I've adjusted vertical space between equations using things like \\[2mm] instead of \vspace{2 mm}\\. Also text subscripts look better with \text.

\documentclass{book}

\usepackage{amsmath}
\usepackage{amssymb, amsfonts}

\begin{document}

\begin{subequations}
\renewcommand{\theequation}{\alph{parentequation}--\Roman{equation}}

    \begin{alignat}{2}
        I_{\text{sc}} & = I_{\text{sc},\text{ref}} & \bigg[  1 + \frac{\alpha}{100} (T_{\text{op}}-T_{\text{ref}}) \biggl]
        \label{eq:I_sc_trans_STC2}
        \\[2mm]
        %
        V_{\text{oc}} & = V_{\text{oc},\text{ref}} & \bigg[  1 + \frac{\beta}{100} (T_{\text{op}}-T_{\text{ref}}) \biggl]
        \label{eq:V_oc_trans_STC}
        \\[2mm]
        %
        P_{\text{mp}} & = P_{\text{mp},\text{ref}} & \bigg[  1 + \frac{\gamma}{100} (T_{\text{op}}-T_{\text{ref}}) \biggl]
        \label{eq:P_mp_trans_STC}
    \end{alignat}

\end{subequations}

\end{document} 

enter image description here


If you need this behavior globally, i.e. \alpha numbering for all equations and \Roman numbering for all subequations, add the following lines in your preamble:

\usepackage{etoolbox}
\patchcmd{\subequations}{\alph{equation}}{--\Roman{equation}}{}{}

\renewcommand{\theequation}{\alph{equation}}

instead of using

\renewcommand{\theequation}{\alph{parentequation}--\Roman{equation}}

each time.

| improve this answer | |
  • Sorry, for my typo in the question. I did not mean changing the numbering to a-I, b-II, and c-III, but rather to a-I, a-II, and a-III meaning that is a set of equations a and its subequations are given in roman letters – Al-Motasem Aldaoudeyeh Jul 7 '17 at 6:07
  • 1
    @Al-MotasemAldaoudeyeh Answer edited accordingly. – Arzigoglu Jul 7 '17 at 6:08
  • Thanks. The code now works as I want it to. I have edited the question to be more general. It is better to define a new command only once in the preamble and then use it later on instead of typing the full syntax over and over. – Al-Motasem Aldaoudeyeh Jul 7 '17 at 6:43
  • @Al-MotasemAldaoudeyeh I've rejected your edit because you've deleted some important improvements to the code (see \text). – Arzigoglu Jul 7 '17 at 6:47
  • 1
    @Al-MotasemAldaoudeyeh I've added a global solution. – Arzigoglu Jul 7 '17 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.