4

Good morning. I would like to understand how to write this equation and receive only one reference (example: equation 1.1) and not euqation 1.1 and 1.2 relative to the second line of the equation. This is my code:

\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{ {Figures/} }

\usepackage[%
style=apa, backend=biber
]{biblatex}
\addbibresource{references.bib}

\usepackage{float,lipsum,subfig}
\usepackage{adjustbox,tabularx,ragged2e}
\usepackage{amsmath,geometry,booktabs}
\usepackage{mathtools,array,dcolumn,longtable}
\usepackage[justification = centering]{caption}
\usepackage{titlesec}    
\usepackage{etoolbox}
\usepackage{siunitx}
\usepackage{xurl}
\usepackage{hyperref}

\begin{document}
\begin{align} 
\text{from}\quad r_i\geq20;\quad i= p+q \quad\text{where}\quad 
p= count[r_{j(i)}=0]\\ 
q=count[r_{j(i)}>10] 
\label{eq:eqr}
\end{align}

\end{document}

Thanks in advance!

1
  • Another approach is to use equation and alignat. Sep 11 '19 at 13:13
2

I suggest split:

\documentclass[11pt]{report}
\usepackage{amsmath}

\begin{document}
\begin{equation}\label{eq:eqr}
\begin{split}
\text{from}\quad r_i\geq20;\quad i= p+q \quad\text{where}\quad 
p &= \operatorname{count}[r_{j(i)}=0]\\ 
q &= \operatorname{count}[r_{j(i)}>10] 
\end{split}
\end{equation}

\end{document}

enter image description here

You could also vertically center the two conditions, but in this case a brace seems needed.

\documentclass[11pt]{report}
\usepackage{amsmath}

\begin{document}
\begin{equation}\label{eq:eqr}
\text{from}\quad r_i\geq20;\quad i= p+q \quad\text{where}\quad
\left\{\begin{aligned}
p &= \operatorname{count}[r_{j(i)}=0]\\ 
q &= \operatorname{count}[r_{j(i)}>10]
\end{aligned}
\right.
\end{equation}

\end{document}

enter image description here

5
  • perfect! and what about placing p and q a bit upper?
    – Elisa m
    Sep 11 '19 at 10:03
  • @Elisam For my humble opinion is perfect.
    – Sebastiano
    Sep 11 '19 at 21:25
  • @Elisam I added a possible alternative version; I'd avoid omitting the brace.
    – egreg
    Sep 11 '19 at 21:34
  • 1
    @Sebastiano thank you!
    – Elisa m
    Sep 12 '19 at 9:07
  • 1
    @egreg really thanks, i will consider both versions
    – Elisa m
    Sep 12 '19 at 9:08

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.