Math & ScienceHow to number first line of an equation???

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

How to number first line of an equation???

Post by ghostanime2001 »

Let's say I have a block of equations as i am solving for a given unknown in a problem. How can I only label the first line of the equation with a number like I'm putting my answer sheet into a PDF format whilst still keeping all my equations on the left-hand side? My LaTeX file looks like this:

Code: Select all

\documentclass{report}
\usepackage{amsmath,fullpage,nccmath,graphicx,leqno}
\pagestyle{empty}
\begin{document}
\begin{fleqn}
\begin{align*}
T_{2}\cos\theta_{2}&=T_{1}\cos\theta_{1} \\ 
T_{2}&=\frac{T_{1}\cos\theta_{1}}{\cos\theta_{2}} \\
T_{1}\sin\theta_{1} + \left(\frac{T_{1}\cos\theta_{1}}{\cos\theta_{2}}\right)\sin\theta_{2}&=350 \\
T_{1}\sin\theta_{1} + \frac{T_{1}\cos\theta_{1}\sin\theta_{2}}{\cos\theta_{2}}&=350 \\
T_{1}\sin\theta_{1} + T_{1}\frac{\cos\theta_{1}\sin\theta_{2}}{\cos\theta_{2}}&=350 \\
T_{1}\left(\sin\theta_{1} + \frac{\cos\theta_{1}\sin\theta_{2}}{\cos\theta_{2}}\right)&=350 \\
T_{1}\left(\frac{\sin\theta_{1}\cos\theta_{2}+\cos\theta_{1}\sin\theta_{2}}{\cos\theta_{2}}\right)&=350 \\
T_{1}\left(\frac{\sin\left(\theta_{1}+\theta_{2})\right}{\cos\theta_{2}}\right)&=350 \\ 
T_{1}&=350 \left(\frac{\cos\theta_{2}}{\sin\left(\theta_{1}+\theta_{2})\right}\right) \\ 
T_{1}&=\frac{350\cos\theta_{2}}{\sin\left(\theta_{1}+\theta_{2})\right} \\
T_{1}&=\frac{350\cos23.8}{\sin\left(55.3+23.8)\right} \\
T_{1}&=\frac{350\cos23.8}{\sin79.1} \\
T_{1}&=\text{326.12 N} \\
\end{align*}

\begin{align*}
T_{1}\sin\theta_{1}&=350 - T_{2}\sin\theta_{2} \\
T_{1}&=\frac{350 - T_{2}\sin\theta_{2}}{\sin\theta_{1}} \\
-\left(\frac{350 - T_{2}\sin\theta_{2}}{\sin\theta_{1}}\right)\cos\theta_{1}+T_{2}\cos\theta_{2}&=0 \\
-\left(\frac{350\cos\theta_{1} - T_{2}\sin\theta_{2}\cos\theta_{1}}{\sin\theta_{1}}\right)+T_{2}\cos\theta_{2}&=0 \\
\frac{-350\cos\theta_{1} + T_{2}\sin\theta_{2}\cos\theta_{1}}{\sin\theta_{1}}+T_{2}\cos\theta_{2}&=0 \\
\frac{-350\cos\theta_{1}}{\sin\theta_{1}} + \frac{T_{2}\sin\theta_{2}\cos\theta_{1}}{\sin\theta_{1}}+T_{2}\cos\theta_{2}&=0 \\
\frac{-350\cos\theta_{1}}{\sin\theta_{1}} + T_{2}\left(\frac{\sin\theta_{2}\cos\theta_{1}}{\sin\theta_{1}}+\cos\theta_{2}\right)&=0 \\
T_{2}\left(\frac{\sin\theta_{2}\cos\theta_{1}}{\sin\theta_{1}}+\cos\theta_{2}\right)&=\frac{350\cos\theta_{1}}{\sin\theta_{1}} \\
T_{2}\left(\frac{\sin\theta_{2}\cos\theta_{1}+\cos\theta_{2}\sin\theta_{1}}{\sin\theta_{1}}\right)&=\frac{350\cos\theta_{1}}{\sin\theta_{1}} \\
T_{2}\left(\frac{\sin\left(\theta_{2}+\theta_{1}\right)}{\sin\theta_{1}}\right)&=\frac{350\cos\theta_{1}}{\sin\theta_{1}} \\
T_{2}&=\frac{350\cos\theta_{1}}{\sin\theta_{1}}\left(\frac{\sin\theta_{1}}{\sin\left(\theta_{2}+\theta_{1}\right)}\right) \\
T_{2}&=\frac{350\cos\theta_{1}}{\sin\left(\theta_{2}+\theta_{1}\right)} \\
T_{2}&=\frac{350\cos55.3}{\sin\left(23.8+55.3)\right} \\
T_{2}&=\text{203 N} \\
\end{align*}
\end{fleqn}
\end{document}
Attachments
Physics 1L03 Solutions.pdf
(49.25 KiB) Downloaded 275 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

How to number first line of an equation???

Post by Frits »

You can use the align command (not align*) and then add \nonumber to all lines that you don't want to number:

Code: Select all

\begin{align*}
T_{2}\cos\theta_{2}&=T_{1}\cos\theta_{1} \label{eq:test}\\ 
T_{2}&=\frac{T_{1}\cos\theta_{1}}{\cos\theta_{2}} \nonumber \\
...
T_{1}&=\text{326.12 N} \nonumber\\
\end{align*}
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: How to number first line of an equation???

Post by ghostanime2001 »

LOL that's not what I meant. I should rephrase what I really mean. I want to create a numbered list, except with a block of equations. And only the first line is numbered on the left side AND is INLINE with the number. For example, you know when you do physics problems in school? How you usually start out is on line paper and writing like this:

1. f(x) = 3x+2
.
.
.
T = 346 N

I want it to be like that above^. How can I make this kind of format and still keeping the entire "equation block" left-aligned on the page? (I think I have done this already with \begin{fleqn}...\end{fleqn} environment. But if I were to make the format above. I don't want my left alignment environment removed or changed. Thanks. I hope you know what i mean.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

How to number first line of an equation???

Post by Juanjo »

Perhaps you are looking for something like this:

Code: Select all

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\begin{document}

Solutions:
\begin{enumerate}
   \item $\begin{aligned}[t]
             \sin^2\alpha+\cos^2\alpha&=1 \\
             1+\tan^2\alpha&=\sec^2\alpha
          \end{aligned}$
   \item $\begin{aligned}[t]
             \sin2\alpha&=2\sin\alpha\cos\alpha \\
             \cos2\alpha&=\cos^2\alpha-\sin^2\alpha
          \end{aligned}$
\end{enumerate}

\end{document}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: How to number first line of an equation???

Post by ghostanime2001 »

hahaha!! my friend, you've made a miracle happen! (it's time to put this to the test) thanksssss!! but i gotta know is this left-aligned to the page margin?
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

How to number first line of an equation???

Post by Juanjo »

ghostanime2001 wrote:but i gotta know is this left-aligned to the page margin?
Load the enumitem package and change \begin{enumerate} by \begin{enumerate}[leftmargin=*]. Read the package manual for more information.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

How to number first line of an equation???

Post by ghostanime2001 »

What does [leftmargin=*] do? Also, Why can't I use fleqn environment?
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

How to number first line of an equation???

Post by svend_tveskaeg »

ghostanime2001 wrote:What does [leftmargin=*] do?
RTFM, as Juanjo has already mentioned! Take a look at p. 3 in the enumitem manual.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

How to number first line of an equation???

Post by ghostanime2001 »

Juanjo
I don't know what you mean.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: How to number first line of an equation???

Post by ghostanime2001 »

How do I make the first equation with the number not indented? What i mean is, how can I line it up with the true left margin of my page?
Post Reply