Go Back   Physics Help Forum > Physics Forums > LateX Help

LateX Help LateX Help - Test your LaTex skills and get help with using LaTex

Reply
 
LinkBack Thread Tools Display Modes
Old May 3rd 2011, 03:46 PM   #1
Forum Admin
 
topsquark's Avatar
 
Join Date: Apr 2008
Location: On the dance floor, baby!
Posts: 2,466
Posting more than one line in LaTeX

We have had an issue in some posts where we go over the 5 image limit. (I'd ask for this limit to be extended, but I don't want to waste my breath.)

Fortunately there is a solution thanks to Moo over on MHF.

The solution uses the "array" command:
\begin{array}{lll} x^2 + y^2 = r^2 \\ x = r~cos(\theta) \\ y = r~sin(\theta) \end{array}

The {lll} tells the complier to align each (of the three) line to the "left." You can also use a "c" to center a line.

This line gives:


If we use, say, the matrix command the lines are somewhat centered. Using this we can write multiple lines without using more than one image.

-Dan
__________________
Do not meddle in the affairs of dragons for you are crunchy and taste good with ketchup.

See the forum rules here.
topsquark is offline   Reply With Quote
Old May 4th 2011, 12:04 AM   #2
Physics Team
 
Unknown008's Avatar
 
Join Date: Jun 2010
Location: Mauritius
Posts: 609
Yes, I've thought about this some time ago too

And actually, having only 1 column would require only 1 l, unless it's different here, which I don't think is the case.

Anyway, in case you want your equations to be left aligned, you edit that like this:

\begin{array}{lcr}
Stuff in left column & Stuff in central column & Stuff in right column \\
\end{array}

This would give a table without any border, with 3 columns, the first column being left aligned, the central column being centre aligned and the right column being right aligned. Then the '&' tells the latex to move to the next column while the \\ tells the latex to switch row.



Otherwise, for a table with borders, you can do this:

\begin{array}{|l|c|r|} \hline
Stuff in left column & Stuff in central column & Stuff in right column \\ \hline
\end{array}

The modulus (|) creates vertical borders (in this example, they border all the columns), and the \headline creates a horizontal border above the current row.
__________________
Jerry (Got my results!)
It is easier to protect your feet with slippers than to cover the earth with carpet.
No one can go back and change a bad beginning; but anyone can start now and create a successful ending.

If a problem can be solved, no need to worry about it. If it cannot be solved what is the use of worrying?
Unknown008 is offline   Reply With Quote
Reply

  Physics Help Forum > Physics Forums > LateX Help

Tags
latex, line, posting



Thread Tools
Display Modes


Similar Physics Forum Discussions
Thread Thread Starter Forum Replies Last Post
The line formula philipishin Philosophy of Physics 2 Sep 28th 2016 12:32 AM
How does one use LaTeX? DrPhil LateX Help 7 Mar 4th 2013 03:41 PM
motion along a line centenial Kinematics and Dynamics 1 Sep 8th 2010 10:35 AM
Learning latex physicsquest LateX Help 7 May 26th 2009 09:41 AM
Velocity-time line/Acceleration-time line graph. ariol Kinematics and Dynamics 1 Jan 8th 2009 11:08 PM


Facebook Twitter Google+ RSS Feed