Page Layoutalign and columns

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Mini
Posts: 73
Joined: Thu Aug 06, 2009 12:46 pm

align and columns

Post by Mini »

Hello,

Please see my code here.

How can I make the align envrionment stay within the column?

Code: Select all

\documentclass[12pt, a4paper, fleqn, leqno, twocolumn]{article}
\setlength{\columnseprule}{0.5pt}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[lmargin=1cm, rmargin=1cm, tmargin=1cm, bmargin=1.2cm]{geometry}
\newcommand\thfore{\mathord{\therefore}\,}
\begin{document}

\begin{align*}
    \thfore \angle LMK &=180^{\circ}-125^{\circ} \text{ (Cointerior angles bounded by parallel lines are equal)}\\
    &=55^{\circ}
\end{align*}
    
\begin{align*}
u &= \arctan x & dv &= 1 \, dx
\\ du &= \frac{1}{1 + x^2} dx & v &= x.
\end{align*}

\end{document} 
Thanks
Last edited by Mini on Sat Jan 15, 2011 11:52 am, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

align and columns

Post by frabjous »

Don't use such a long \text{...} command where it doesn't fit, perhaps?

It's hard to give a better answer than that without knowing what you want to happen. The text comment on the first line obviously cannot fit there without wrapping. So one option would be to let it wrap by putting it in a parbox instead:

Code: Select all

\documentclass[12pt, a4paper, fleqn, leqno, twocolumn]{article}
\setlength{\columnseprule}{0.5pt}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[lmargin=1cm, rmargin=1cm, tmargin=1cm, bmargin=1.2cm]{geometry}
\newcommand\thfore{\mathord{\therefore}\,}
\begin{document}

\begin{align*}
    \thfore \angle LMK &=180^{\circ}-125^{\circ} \ \parbox[t]{4cm}{\raggedright (Cointerior angles bounded by parallel lines are equal)}\\
    &=55^{\circ}
\end{align*}
   
\begin{align*}
u &= \arctan x & dv &= 1 \, dx
\\ du &= \frac{1}{1 + x^2} dx & v &= x.
\end{align*}

\end{document} 
I guess the other option would be to move it, and e.g., use an \intertext command perhaps?

Code: Select all

\documentclass[12pt, a4paper, fleqn, leqno, twocolumn]{article}
\setlength{\columnseprule}{0.5pt}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[lmargin=1cm, rmargin=1cm, tmargin=1cm, bmargin=1.2cm]{geometry}
\newcommand\thfore{\mathord{\therefore}\,}
\begin{document}

\begin{align*}
    \thfore \angle LMK &=180^{\circ}-125^{\circ} \\ \intertext{(Cointerior angles bounded by parallel lines are equal)}
    &=55^{\circ}
\end{align*}
   
\begin{align*}
u &= \arctan x & dv &= 1 \, dx
\\ du &= \frac{1}{1 + x^2} dx & v &= x.
\end{align*}

\end{document} 
But what do you think should happen?
Mini
Posts: 73
Joined: Thu Aug 06, 2009 12:46 pm

Re: align and columns

Post by Mini »

OMG. Sir, you are a LEGEND!!! The first option was what I looking for.

Thank you soo much :D :D I feel like dancing :D
Post Reply