Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
ghostanime2001
Posts: 402 Joined: Fri May 20, 2011 9:41 am
Post
by ghostanime2001 » Mon May 23, 2011 1:28 am
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 276 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
Frits
Posts: 169 Joined: Wed Feb 02, 2011 6:02 pm
Post
by Frits » Mon May 23, 2011 7:46 am
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*}
ghostanime2001
Posts: 402 Joined: Fri May 20, 2011 9:41 am
Post
by ghostanime2001 » Mon May 23, 2011 8:41 am
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.
Juanjo
Posts: 657 Joined: Sat Jan 27, 2007 12:46 am
Post
by Juanjo » Mon May 23, 2011 9:51 am
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}
ghostanime2001
Posts: 402 Joined: Fri May 20, 2011 9:41 am
Post
by ghostanime2001 » Mon May 23, 2011 11:07 am
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?
Juanjo
Posts: 657 Joined: Sat Jan 27, 2007 12:46 am
Post
by Juanjo » Mon May 23, 2011 11:34 am
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.
ghostanime2001
Posts: 402 Joined: Fri May 20, 2011 9:41 am
Post
by ghostanime2001 » Mon May 23, 2011 12:29 pm
What does [leftmargin=*] do? Also, Why can't I use fleqn environment?
svend_tveskaeg
Posts: 478 Joined: Sun Jul 12, 2009 5:31 am
Post
by svend_tveskaeg » Mon May 23, 2011 3:26 pm
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
Post
by ghostanime2001 » Tue May 24, 2011 10:32 pm
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?