TransWikia.com

use eqref or ref for an equation inside flalign and aligned

TeX - LaTeX Asked by Hailey on December 6, 2020

I need to have an equation aligned on the left of my page and its tag on the right.
I managed to do it but when i want to call it with eqref or ref it doesn’t work.

documentclass[11pt]{article} 
usepackage[english]{babel} 

usepackage{mathtools}
usepackage{geometry}
usepackage{titlesec}
 geometry{
 a4paper,
 total={170mm,257mm},
 left=20mm,
 top=20mm,
 }

begin{document}

begin{flalign*}tag{1.8}
&begin{aligned}{}
label{eq:1.8}
x(t)=e^{-left|acdot tright|}  \
end{aligned}&&
end{flalign*}

noindent With the equation ref{eq:1.8} ...

end{document}

One Answer

You do not have any alignment here so I used equation and it is usually better to let latex number the equations automatically, so I specified numbering within sections:

enter image description here

documentclass[11pt]{article} 
usepackage[english]{babel} 

usepackage{mathtools}
usepackage{geometry}
usepackage{titlesec}
 geometry{
 a4paper,
 total={170mm,257mm},
 left=20mm,
 top=20mm,
 }

numberwithin{equation}{section}

begin{document}
section{Intro}

setcounter{equation}{7}% just in this example

Using equation
begin{equation}label{eq:xt}
x(t)=e^{-lvert acdot trvert} 
end{equation}
With the equation ref{eq:xt} (avoid numbers in labels)

end{document}

or left aligned

enter image description here

documentclass[11pt,fleqn]{article} 
usepackage[english]{babel} 

usepackage{mathtools}
setlengthmathindent{0pt}
usepackage{geometry}
usepackage{titlesec}
 geometry{
 a4paper,
 total={170mm,257mm},
 left=20mm,
 top=20mm,
 }

numberwithin{equation}{section}

begin{document}
section{Intro}

setcounter{equation}{7}% just in this example

Using equation
begin{equation}label{eq:xt}
x(t)=e^{-lvert acdot trvert} 
end{equation}
With the equation ref{eq:xt} (avoid numbers in labels)

end{document}

Answered by David Carlisle on December 6, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP