Math & ScienceEquations on two columns

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Equations on two columns

Post by Cham »

Johannes_B wrote:But, one question i want you to ask yourself is: Why the hell am i the first one needing this? I think there is a much simpler thing going on, i.e. this is an xy-Problem. Wanting x but describing y.
Here's an example of what I currently have, for a typical page of the document I'm creating :
dbequs.jpg
dbequs.jpg (60.53 KiB) Viewed 7359 times
I'm using the align environment for these equations.

The equations distribution on that page is not elegant. If find the global result ugly!

Take note : the second line of equations (1.7.96) isn't pushed to the left by their equ. number, since I'm using a macro to force the equations to stay on their place, even if there's a large number to the right.

So if we forget the solutions that you gave above, what would you do in this case ?

Recommended reading 2024:

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

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Equations on two columns

Post by Johannes_B »

Mathtools provides the option showonlyrefs. I guess that would make your document a bit cleaner since i cannot imagine you are referring to all those equations in your document.
On the other hand, my mathematical background is a bit dusty and and my french quite as rusty. I really cannot judge or give any advice here for this short part.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Equations on two columns

Post by Cham »

Johannes_B wrote:Mathtools provides the option showonlyrefs. I guess that would make your document a bit cleaner since i cannot imagine you are referring to all those equations in your document.
On the other hand, my mathematical background is a bit dusty and and my french quite as rusty. I really cannot judge or give any advice here for this short part.
The French part isn't relevant. What is the showonlyrefs option ?

EDIT : Ah ! Ok, that option could be usefull ! Thanks !

http://tex.stackexchange.com/questions/ ... n-the-text


But then the original problem is still the same : double equations on same line are not well balanced across the page. What would be the best way to achieve a beautifull page, if there are several double equations lines ?
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Equations on two columns

Post by Cham »

I just found that the first solution doesn't allow removing the equation number. Using dblequation* gives many errors, and adding \nonumber gives an error too.

The second solution doesn't fix that. Adding * still gives compilation errors, and adding \nonumber doesn't change anything (the equ. number is still there). So what are the advantages of the second solution ? (labels are working with the first solution).

So my question to the problem shown above is still the same : What would you do if you have several double-equations showing on the same page, like on the picture above ? (see first picture on this page. French text is irrelevant here). Using the usual align environment frequently gives some ugly distributions of double equations.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Equations on two columns

Post by Johannes_B »

To be quite honest, nothing.
I have no great experience in mathematical typesetting, with maths at all to be quite honest. I want to have one label/reference for each unique equation. Having to equations on one line is confusing for me.

You have seen that aligning the stuff (also vertically) is pretty complicated. You have to do it manually by trial and error.

What happens if a line is longer than .5\textwidth?

Code: Select all

\documentclass[12pt,letterpaper]{book}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\usepackage{showframe}
\usepackage{tabularx}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}

\begin{document}
\begin{equation}
	\begin{array}{c@{\hspace{8em}}c}
		x = y^2 - c + d + z^3,
		& z = x^3 + x - y^2.
	\end{array}
\end{equation}
Just another small line of text :
        \begin{equation}
	\begin{array}{c@{\hspace{8em}}c}
                x -5 y + 3 = y^2,
                & y^2 = -\: x^2 + 4 - y^2 - x.
	\end{array}
        \end{equation}
Yet another line :
        \begin{equation}
	\begin{array}{c@{\hspace{8em}}c}
                A + B + E = b,
                & B - C = 0.
	\end{array}
        \end{equation}
The global distribution of these equations is ugly !
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Equations on two columns

Post by Cham »

Johannes_B wrote:
What happens if a line is longer than .5\textwidth?
Sorry, I don't understand this.

And from your last code above, the equations are still not centered at all.
I must admit I still don't understand well the array environment.

Of course, if the equations are too long, I wouldn't present them as a double equations line.
I'll stack them one on top of the other, using the gather or the align environment.

However, if the equations are small enough (like the equations shown on the picture above), it's frequently very convenient to present them on the same line. Especially to save some space.

So what you suggest is to "hack" the spacings, using all sorts of tricks like the usual commands \;, \quad, \hspace{} etc, until the equations appear to be well balanced after compilation ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10344
Joined: Mon Mar 10, 2008 9:44 pm

Re: Equations on two columns

Post by Stefan Kottwitz »

The solution is nice. I firstly though of using multicolumn or a tabular environment and putting the equations in columns, with a dedicated environment for it.

Just a personal opinion, I don't try to save space. Compressed texts are hard to read. I use space so text can easier be read or quickly be scanned with the eyes, such as when you search some equation.

If an institution would require a limited number of pages, I would rather reduce the content to focus on the most important things than explaining in too detailed steps. I guess a page limit is intended as a content limit and doesn't aim at authors compressing their texts.

Today we often produce PDF files. White space doesn't cost something then. :-) Easier reading on small displays is good, and more pages are not bad, just larger file size might be, but whitespace doesn't have such impact.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Equations on two columns

Post by Cham »

Stefan_K wrote:The solution is nice. I firstly though of using multicolumn or a tabular environment and putting the equations in columns, with a dedicated environment for it.

Just a personal opinion, I don't try to save space. Compressed texts are hard to read. I use space so text can easier be read or quickly be scanned with the eyes, such as when you search some equation.
Thanks for the reply, Stefan.

So two questions :

1. If you have (for any reason) to present several lines of double equations, what would you do (code wise) ? Just accept the ugly distribution ? Or try to fix it in some way ? If so how ? (ok, that is more than 2 questions !).

2. What exactly was your first though of using multicolumn or a tabular environment ?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Equations on two columns

Post by Johannes_B »

There was an alternative solution in chat yesterday posted between the two of egreg. It was using a tabular approach as well.

Above i meant to ask what happens if an equation is longer than half of the line. I am a bit in a hurry today, sorry.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Equations on two columns

Post by Cham »

Johannes_B wrote:There was an alternative solution in chat yesterday posted between the two of egreg. It was using a tabular approach as well.
I can't see it, in that very long discussion. Can you paste the code here ?

By the way, I'm very suprised that there is no special LaTeX package that could do what I need.
Or maybe is there one ?
Post Reply