1

I am trying to create a master list of equations (called 'Models'), which are then referenced in main text (the idea is that not all the equations in the master list appear in the main text). I would like it so the equation numbering is based upon the order in the master list.

This is set fine for equations using \begin{equation}, but when I use the \begin{align} it continues to number the equation in the main text, and gives the name of the referenced equation in brackets.

I would like help with being able to set the 'Utility of gamble' equation in the same way as a the 'Softmax' equation.

Thank you!

enter image description here

\documentclass[english,natbib]{report}
\usepackage{amssymb}                            
\usepackage{amsmath}                    
\newcommand{\eqname}[1]{\tag*{#1}}

\begin{document}

\begin{align}
&U_{gamble} = 0.5(V_{gain})^{again} - 0.5(-V{loss})^{aloss}\\ \nonumber
&U_{certain} = (V_{certain})^{again} & &if\ V_{certain}\geq 0\\ \nonumber
&U_{certain} = (-V_{certain})^{aloss} & &if\ V_{certain}>0 \\ \nonumber \tag{\ref{equation:decision_gambles}}
\end{align}

\begin{equation}
P_{gamble} = \frac{1}{1+e^{-\mu(U_{gamble}-U{certain})}}
\tag{\ref{equation:decision_softmax}}
\end{equation}    

\subsection{Models}

\begin{flalign}
&U_{gamble} = 0.5(V_{gain})^{again} - 0.5(-V{loss})^{aloss} \\ \nonumber
&U_{certain} = (V_{certain})^{again} & &if\ V_{certain}\geq 0 \\ \nonumber
&U_{certain} = (-V_{certain})^{aloss} & &if\ V_{certain}< 0 \\ \nonumber
\label{equation:decision_gambles} \\ \eqname{\textbf{Utility of Gambles}}
\end{flalign}

\begin{flalign}
P_{gamble} = \frac{1}{1+e^{-\mu(U_{gamble}-U{certain})}} &&
\label{equation:decision_softmax} \\ \eqname{\textbf{Softmax}}
\end{flalign}

\end{document}
6
  • Welcome to TeX.SX and well done for the MWE. Hoever, the options [english,natbib] are here use less, and a a4paper would be welcome.
    – Jhor
    Commented Jan 30, 2019 at 21:25
  • There are, for my opinion, several errors of typography. Fox example, why U_{gamble}-U{certain} and not U_{\text{gamble}}-U{\text{certain}}?
    – Sebastiano
    Commented Jan 30, 2019 at 21:30
  • I don't really understand what you are trying to do, and especially I don't see the need of switching from align in the definitions to flalign in the main text.\\ In any case, do not use so many nonumbers, the starred version so that fro free \begin{align} -> \begin{align*} ans so on.
    – Jhor
    Commented Jan 30, 2019 at 21:34
  • Thank you @Jhor . The reason for the align/falign switch was in the main text the equations look better centred (but aligned when in a block) and when they are all included together in the 'models' section it looks better aligning when all collectively. If there is a way to use align to align all individual equations to the left, I would be interested to hear it.
    – Rbedz
    Commented Jan 31, 2019 at 10:07
  • 1
    Thank you @Sebastiano, that very much improves the readability!
    – Rbedz
    Commented Jan 31, 2019 at 11:14

1 Answer 1

3

In my comment I had the impression that you would like to suppress the numbering, but in fact you want to repeat it, don't you ? Hence you can't use the stared version, an actually need the \nonumber on the lines that should not be numbered.

As far as I can understand your aim, this code does the job:

\documentclass[a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{amsmath}

\begin{document}

\begin{align}
&U_{gamble} = 0.5(V_{gain})^{again} - 0.5(-V{loss})^{aloss} \tag{\ref{equation:decision_gambles}}\\ 
&U_{certain} = (V_{certain})^{again} & &if\ V_{certain}\geq 0 \nonumber\\
&U_{certain} = (-V_{certain})^{aloss} & &if\ V_{certain}>0 \nonumber 
\end{align}


\begin{equation}
P_{gamble} = \frac{1}{1+e^{-\mu(U_{gamble}-U{certain})}}
\tag{\ref{equation:decision_softmax}}
\end{equation}
%%

\subsection{Models}

\begin{align}\label{equation:decision_gambles} 
&U_{gamble} = 0.5(V_{gain})^{again} - 0.5(-V{loss})^{aloss} \\
&U_{certain} = (V_{certain})^{again} & &if\ V_{certain}\geq 0 \nonumber\\
&U_{certain} = (-V_{certain})^{aloss} & &if\ V_{certain}< 0 \nonumber\\
\nonumber \\
&&&\tag*{\textbf{Utility of Gambles}}
\end{align}

\begin{align}\label{equation:decision_softmax}
P_{gamble} = \frac{1}{1+e^{-\mu(U_{gamble}-U{certain})}}& \\
  &\tag*{\textbf{Softmax}}
\end{align}
\end{document}
3
  • IIRC, one can use \tag with equation* etc. But moving the label was the right move. Commented Jan 30, 2019 at 22:02
  • @John Kormylo. Yes equation* is an option for use of \tag. But apparently the OP want the tag appearing below the equation. That is why a multiline display math is needed.
    – Jhor
    Commented Jan 31, 2019 at 7:38
  • Thank you @Jhor - this solution worked perfectly.
    – Rbedz
    Commented Jan 31, 2019 at 10:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .