tex >> Labelling separate lines in flalign

by hwibbles@googlemail.com » Thu, 15 Mar 2007 02:20:56 GMT

I am using flalign since I want text flush with the left explaning
each lines ('from (x)', 'simplify') etc. Some of the lines - the more
important ones - i want numbered and some I do not. I understand I can
use flalign and then \nonumber after each line I do not want numbered.
I also understand I can write a single equation with the equation
environment, label it with my own reference, and use \ref elsewhere to
refer to the number Latex gave it. However how can I label chosen
lines that have been numbered within one flalign environment? Do I
have to keep switching environments?

Here is the code I have. I want the last two lines each with their
separate label so I can refer to them elsewhere. I could do it by
ending the flalign before these last two lines, then write 'using (x)'
and 'similarly' above two separate equation environments that I label,
but I am wondering if there is a neater way whereby I can retain the
text on the same line as the equations, and all in one environment.

\begin{flalign}
& & \text{Let }z & = \cos{\theta}+i\sin{\theta} &&
\nonumber \\
&\Rightarrow & \frac{1}{z} & = \frac{1}{\cos{\theta}+i\sin{\theta}}
\nonumber \\
&\text{Simplify} & & = \frac{1}{\cos{\theta}+i\sin{\theta}}
\times \frac{\cos{\theta}-i\sin{\theta}}{\cos{\theta}-i\sin{\theta}}
\nonumber \\
& & & = \frac{\cos{\theta}-i\sin{\theta}}{\cos^2{\theta}+
\sin^2{\theta}} \nonumber \\
& & & = \cos{\theta}-i\sin{\theta}\nonumber \\
&\Rightarrow &z+\frac{1}{z}& = 2\cos{\theta} \nonumber \\
&\text{and} &z-\frac{1}{z}& = 2i\sin{\theta} \nonumber \\
&\text{Using (\ref{moivre})} &z^n + \frac{1}{z^n}&\equiv 2\cos{n
\theta} \\
&\text{Similarly} &z^n - \frac{1}{z^n} &\equiv 2i\sin{n\theta}
\end{flalign}

Cheers!



tex >> Labelling separate lines in flalign

by Maarten Bergvelt » Thu, 15 Mar 2007 05:02:49 GMT



In article < XXXX@XXXXX.COM >,


Hm, why don't you put a label on the lines you want labeled?


Well, say \label{eq:1}, \label{eq:2} on the lines you want to refer
to? I am totally not getting what the problem is.

Another matter, nothing to do with labels:
Are you aware of the \intertext command, to enter text, while
continuing your alignment?

--
Maarten Bergvelt



tex >> Labelling separate lines in flalign

by hwibbles@googlemail.com » Thu, 15 Mar 2007 05:42:13 GMT





It's that simple? I'm sure when I tried it it didn't work last time.

Ok it works this time. Dunno what I did wrong but cheers.

The intertext command seems to put text on its own line and the
equation below. I prefer the text on the same line as the equation.
If you know of a neater way to do this than I have done then I would
be grateful!



Similar Threads

1. Separate columns in TOC with vertical line

2. Problem about one word separated in two lines?

Hi,

In my table of content, some words are separated into two lines. For
example

Chapter 1 this is chap-
       ter one....................2

How can I remove this separation,

Chapter 1 this is 
    chapter one................2

3. math, newbie. Eq. on separate lines

4. Separate bibliography and separate subdir

Hi all!

I have a little pb using latex, bitex and import. 

I have a main file main.tex and I wish to have the differents chapters
manages in different subdirectories.
So I have a structure (./ refer to my root directory for this
project):
./main.tex
./A_First_Chapter/a_first_chapter.tex
./A_Second_Chapter/a_second_chapter.tex

I use the package chapterbib to have bibliography at the end of each
chapter
It seems I have to use \include and not \input to have this to work. 
So main.tex is as follows :
main.tex : 
[...]
\usepackage{chapterbib}
[...]
\include{A_First_Chapter/a_first_chapter}
\include{A_Second_Chapter/a_second_chapter}
[...]

And if I place mybiblio.bib in ./ (and not in A_First_Chapter/ :-( ),
and if  A_First_Chapter/a_first_chapter.tex contain 
a_first_chapter.tex :
[...]
\cite{mon_test}
\bibliographystyle{mystyle}
\bibliography{mybiblio}

Then everything goes find : I compile by :
latex main.tex
bibtex A_First_Chapter/a_first_chapter
latex main.tex
latex main.tex

and I obtain what I want with the citation and the biblio at the end
of the first chapter.

But lets suppose I want to include a file (toto.tex) in
a_first_chapter.tex, and I want to place this file in A_First_Chapter/
(that's why I wanted to use subdirectories :-) ),
when using \include{toto} (or \input{toto}) in a_first_chapter.tex , I
have the following error :
! LaTeX Error: File `toto.tex' not found.

I have to declare \include{A_First_Chapter/toto} even if I am in
A_First_Chapter/a_first_chapter.tex !

I found that I can use the package import but It seems it doesn't
work.
I add \usepackage{import} and change
\include{A_First_Chapter/a_first_chapter} by
\import{A_First_Chapter/}{a_first_chapter.tex} in main.tex but the pb
remain. In addition, I'm not sure it will work with the bibliography
as I heard that it must use \incluse and I think import use \input.

Any hints???? May be someone still done a thesis or something like
that with this structure?

Best Regards

5. flalign with class options leqno and fleqn

6. flalign

A while back, someone explained how to put bits of intertext
on the same lines as equations, using flush-align to push the
text to the margin:

\begin{flalign*}
&              &   an & aligned equation          &&\\
&\text{Or }    &      & and another (well, half)  &&\\
&\text{Thus: } &  and & yet a third equation      &&
\end{flalign*}

Is there some way of getting the same effect on the text
while centering the math? Sort of a flush-gather:

                   a centered equation
Or                    and another
Thus:           and yet a third equation

"A man that would expect to train lobsters to fly in a year
 is called a lunatic; but a man that thinks men can be turned
 into angels by an election is a reformer and remains at large."

                                 -- Finley Peter Dunne




7. Counting or labelling pages with floats only

8. Automatic labelling

Say this counter:

\newcounter{compteur}
\setcounter{compteur}{0}

And a command "affichercompteur" to show it:

\newcommand{\affichercompteur}{
\stepcounter{compteur}
{\footnotesize\scshape{Encart\ \thecompteur\ }}\label{Encart???????}}

Now, i would like this counter to be automatically labelled in this 
fashion: Encart1, Encart2, Encart3...  I tried \label{Encart\thecounter}, 
but this is not working. Any idea?

Complete code:
**********************
\documentclass[10]{article}
\usepackage [ansinew]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{textcomp}

\newcounter{compteur}
\setcounter{compteur}{0}
\newcommand{\affichercompteur}{
\stepcounter{compteur}
{\footnotesize\scshape{Encart\ \thecompteur\ }}\label{Encart}}

\begin{document}
\affichercompteur\par
Text Text Text Text Text\par
\affichercompteur\par
Text Text Text Text Text\par

\end{document}
************************

Guy