Author
Message
stevem
Navier-Stokes Equations
Offline Joined: 25 Apr 2004 Posts: 2201 Location: Dorset, UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
Metapost & eqnarray Articles in the latest PracTeX journal
The latest issue of The PracTeX Journal has a couple of articles that may be of interest to AoPS users:
Posted: Sat Dec 02, 2006 4:02 am
Ravi B
Navier-Stokes Equations
Offline Joined: 23 Jun 2003 Posts: 2464 Location: New York City
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
Thanks for the links to the articles (and for all your wonderful advice on LaTeX). From now on, I will replace eqnarray with align whenever I write a paper.
Is it possible to use the align environment on this forum? My attempts to gave me an "Unparseable or potentially dangerous latex formula".
Posted: Sat Dec 02, 2006 5:23 am
stevem
Navier-Stokes Equations
Offline Joined: 25 Apr 2004 Posts: 2201 Location: Dorset, UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
There seems to be a bug with the align environment on this forum. I'll ask Valentin if he would look into it.
Posted: Sat Dec 02, 2006 5:47 am
stevem
Navier-Stokes Equations
Offline Joined: 25 Apr 2004 Posts: 2201 Location: Dorset, UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
Align workaround
Until the align environment bug is fixed, a workaround is to add \par before \begin{align} or \begin{align*} to get:
or
Posted: Sat Dec 02, 2006 7:36 am
Ravi B
Navier-Stokes Equations
Offline Joined: 23 Jun 2003 Posts: 2464 Location: New York City
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
Thanks for the workaround.
Posted: Sat Dec 02, 2006 8:18 am
roadnottaken
Yang-Mills Theory
Offline Joined: 27 Nov 2006 Posts: 551 Location: I'm a figment of my own imagination.
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
Why does the "Math in " tutorial still list eqnarray rather than align?
_________________ Two roads diverged in a wood, and I-
I took the one less traveled by,
And that has made all the difference.
Posted: Tue Feb 06, 2007 9:50 am
beans
Hodge Conjecture
Offline Joined: 19 Feb 2007 Posts: 99 Location: UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
I don't really see what's wrong with eqnarray. I mean it does what you want it to do!
Posted: Sun Apr 15, 2007 8:22 am
Ravi B
Navier-Stokes Equations
Offline Joined: 23 Jun 2003 Posts: 2464 Location: New York City
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
Did you read the article that the first post links to? In eqnarray, the spacing is off, and the equation numbers are buggy.
Posted: Sun Apr 15, 2007 8:35 am
stevem
Navier-Stokes Equations
Offline Joined: 25 Apr 2004 Posts: 2201 Location: Dorset, UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
As Why not use eqnarray? says "The environment eqnarray is attractive for the occasional user of mathematics in LaTeX documents " but it then goes on to say "it makes a serious mess of spacing " as is shown in 2.1 of the Avoid eqnarray! article. That article shows that there are other problems too.
So why not use the grown-up method viz align which always works and which is "which is designed with the needs of mathematicians in mind (as opposed to the convenience of LaTeX programmers) "?
Posted: Sun Apr 15, 2007 8:41 am
beans
Hodge Conjecture
Offline Joined: 19 Feb 2007 Posts: 99 Location: UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
I skimmed through it But I don't need to number my equations. (This is my first time using eqnarray you see, so I suppose it's best that I stop right there!)
I have a question for align though. I'm confused with the {} symbols that were used. What do they do and are they really necessary?
EDIT: Can someone please tell me what's wrong with the following:
\begin{align*}
v\dfrac{dv}{dx}\underline{k} &= -g\underline{k} -\gamma v^2 \underline{k}
\end{align*}
It doesn't appear on the pdf file! Thanks.
Posted: Sun Apr 15, 2007 8:58 am
stevem
Navier-Stokes Equations
Offline Joined: 25 Apr 2004 Posts: 2201 Location: Dorset, UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
beans wrote:
I have a question for align though. I'm confused with the {} symbols that were used. What do they do and are they really necessary?
You can see the difference here:
With {}
without {}
beans wrote:
EDIT: Can someone please tell me what's wrong with the following:
\begin{align*}
v\dfrac{dv}{dx}\underline{k} &= -g\underline{k} -\gamma v^2 \underline{k}
\end{align*}
It doesn't appear on the pdf file! Thanks.
Have you looked at the error messages? Click on the ->! on the toolbar on the top right (keep pressing for more irrelevant messages) and it will tell you about a paragraph ending before \align* is complete which is LaTeX-speak for 'remove the blank line just before \end{align}'
Last edited by stevem on Sun Apr 15, 2007 9:34 am; edited 1 time in total
Posted: Sun Apr 15, 2007 9:17 am
beans
Hodge Conjecture
Offline Joined: 19 Feb 2007 Posts: 99 Location: UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
Best go and stick some {} into my document then!
stevem wrote:
Have you looked at the error messages? Click on the ->! on the toolbar on the top right (keep pressing for more irrelevant messages) and it will tell you about a paragraph ending before \align* is complete which is LaTeX-speak for 'remove the blank line just before \end{align}'
Thanks a lot! You see I have loads of error messages, warnings and bad boxes, so I just ignore them (they don't make much sense you see) but thanks a lot
Posted: Sun Apr 15, 2007 9:28 am
stevem
Navier-Stokes Equations
Offline Joined: 25 Apr 2004 Posts: 2201 Location: Dorset, UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
beans wrote:
Best go and stick some {} into my document then!
You won't need to do that unless you have something like that second line. Normally you get
which doesn't need {} and is fine.
beans wrote:
Thanks a lot! You see I have loads of error messages, warnings and bad boxes, so I just ignore them (they don't make much sense you see) but thanks a lot
Trying to get rid of those messages is the way to learn more about LaTeX, though I admit it takes time and I know you are short of that.
Posted: Sun Apr 15, 2007 9:38 am
beans
Hodge Conjecture
Offline Joined: 19 Feb 2007 Posts: 99 Location: UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
stevem wrote:
You won't need to do that unless you have something like that second line. Normally you get
which doesn't need {} and is fine.
Oh I see now. I was also(!) wondering about the spacing between the lines. You see I've got quite a few integral signs about and the document doesn't look neat because it seems that the line above is sitting on the line below! Is there anything that can be done about this?
stevem wrote:
Trying to get rid of those messages is the way to learn more about LaTeX, though I admit it takes time and I know you are short of that.
You got the time bit right. I did try to work through the errors on my first coursework, that's why it's still not complete! (and the fact that I need matlab ). I just want this done for tomorrow, and maybe later will try to get rid of the error messages.
Posted: Sun Apr 15, 2007 9:57 am
stevem
Navier-Stokes Equations
Offline Joined: 25 Apr 2004 Posts: 2201 Location: Dorset, UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
beans wrote:
I was also(!) wondering about the spacing between the lines. You see I've got quite a few integral signs about and the document doesn't look neat because it seems that the line above is sitting on the line below! Is there anything that can be done about this?
That shouldn't happen. Could you post a minimal document showing that problem? By that I mean everything including the preamble (ie before \begin{document}) but just including a few lines where the integrals look wrong.
Oh and if you include it on the forum inside [code ] ... [/code ] it won't misinterpret the dollar signs.
Posted: Sun Apr 15, 2007 10:07 am
beans
Hodge Conjecture
Offline Joined: 19 Feb 2007 Posts: 99 Location: UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
stevem wrote:
beans wrote:
I was also(!) wondering about the spacing between the lines. You see I've got quite a few integral signs about and the document doesn't look neat because it seems that the line above is sitting on the line below! Is there anything that can be done about this?
That shouldn't happen. Could you post a minimal document showing that problem? By that I mean everything including the preamble (ie before \begin{document}) but just including a few lines where the integrals look wrong.
Oh and if you include it on the forum inside [code ] ... [/code ] it won't misinterpret the dollar signs.
Well I might have slightly exageratted the thing- you see I like a lot of space it seems!
It's readable, but anyway heres what you asked for:
Code:
\documentclass[titlepage, a4paper]{article}
\oddsidemargin=0in
\usepackage{fancyhdr}
\usepackage{amssymb}
\usepackage{upquote}
\usepackage{amsmath}
\usepackage[top=3.5cm,bottom=2.7cm,text={6.5in,9in},centering]{geometry}
\usepackage[pdftex]{graphicx}
\pagestyle{fancy}
\rhead{} % My name
\lhead{Coursework}
\cfoot{\thepage}
\parindent=0in
\title{{\Huge } \\ {\Huge Coursework}}
\author{{\Large }} % Author
\date{}
\begin{document}
\begin{align*}
-\displaystyle\int \dfrac{v}{g+ \gamma v^2} \:dv \:\underline{k} \quad = & \quad \displaystyle\int \; dx :\underline{k}\\
\frac{-1}{2\gamma }\ln(g+\gamma v^2) \underline{k} \quad = & \quad x\underline{k} + C
\end{align*}\\
It's erm.. messy! The -1 seems to hang about the integral, but is that just me being fussy? :-0
Posted: Sun Apr 15, 2007 10:18 am
stevem
Navier-Stokes Equations
Offline Joined: 25 Apr 2004 Posts: 2201 Location: Dorset, UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
You can change the vertical spacing by replacing \\ between the 2 equations with \\*[2ex] which I agree looks better (2ex means twice the height of an x in the current font, of course you can change it to give as much space as you like).
By the way, you don't need \displaystyle here as the align environment does that for you automatically.
Posted: Sun Apr 15, 2007 10:31 am
beans
Hodge Conjecture
Offline Joined: 19 Feb 2007 Posts: 99 Location: UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
stevem wrote:
You can change the vertical spacing by replacing \\ between the 2 equations with \\*[2ex] which I agree looks better (2ex means twice the height of an x in the current font, of course you can change it to give as much space as you like).
By the way, you don't need \displaystyle here as the align environment does that for you automatically.
Thanks once again Steve. It worked a treat- looks pretty darn neat! And you saved me from a lot of typing as well. (I've been going through the errors, and it seems I have lots of extra { flying about, although I don't understand what bad boxes are!)
Posted: Sun Apr 15, 2007 2:12 pm
stevem
Navier-Stokes Equations
Offline Joined: 25 Apr 2004 Posts: 2201 Location: Dorset, UK
Not_yet_rated
Poor (Spam)
Poor (Spam)
Below average
Below average
Average
Average
Good
Good
Very good
Very good
Excellent
To rate posts you must be logged in
beans wrote:
although I don't understand what bad boxes are!)
They are the least important things to worry about which is why TeXniCenter relegates them to below Errors and Warnings.
In the example you gave you had
\end{align*}\\
The \\ isn't needed on the end and gives "underfull \hbox (badness 1000)". That means that LaTeX couldn't justify the line left and right properly, which isn't surprising because there isn't anything there. Badness is an estimate of how much stretching LaTeX had to do to fill the line, so the lower the better. Remove the \\ and the warning goes.
Sometimes LaTeX can't break a line in the right place eg due to a long formula or poor hyphenation so it will give a overfull \hbox warning. This will be much more obvious as you'll see text go into the margin - though if it's only by a tiny amount you might ignore it rather than having to make things look awkward.
Thus these bad boxes* are to alert you to possible problems, but if the page looks right then you can ignore them.
*LaTeX puts text into boxes behind the scenes so it can get the spacing right. Justification, for example, means tweaking things slightly with a bit of spacing. The methods it uses are complicated which is why it produces much better results than anything a word processor can achieve.
Posted: Sun Apr 15, 2007 2:43 pm
Display posts from previous: All Posts 1 Day 7 Days 2 Weeks 1 Month 3 Months 6 Months 1 Year Sort by: Post Time Post Subject Author Ascending Descending