Text FormattingRight aligning a left-aligned block of text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Matt_Fl
Posts: 3
Joined: Thu May 27, 2010 4:40 pm

Right aligning a left-aligned block of text

Post by Matt_Fl »

I want to have a left aligned block of left aligned text on one side of the page and a right aligned block of left aligned text on the other. I have tried using a tabular environment, but I can't get exactly what I want without resorting to manually inputting column spacings (not ideal). Any ideas?

Thanks in Advance!!
Matt
Last edited by Matt_Fl on Thu May 27, 2010 9:34 pm, 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.

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

Re: Right aligning a left-aligned block of text

Post by frabjous »

I'd help but I don't really understand what it is you want to do. What is a "right aligned block of left aligned text"?

Is the entire document going to be like this, or just a small part? Does one part wrap around to the other? Do you know how large you want these blocks to be? Why can't you use a tabular environment and insert column spacings as a portion of \textwidth?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Right aligning a left-aligned block of text

Post by localghost »

Similar to frabjous I think that it would help if you describe what you are aiming at. There might be several solutions which can depend on the purpose.


Best regards and welcome to the board
Thorsten
Matt_Fl
Posts: 3
Joined: Thu May 27, 2010 4:40 pm

Re: Right aligning a left-aligned block of text

Post by Matt_Fl »

Sorry, I realize my explanation was a bit confusing. I want something to right align the block of text (which is left aligned within itself) to the right margin. And the same thing on the left margin (this is trivial to do). This is going to be used for only a small section of my document, but maybe a few times throughout. I played around with using an offset to \textwidth, but the only way I could figure out how to do it was to manually input the offset. Is there a way to automate that process?
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Right aligning a left-aligned block of text

Post by frabjous »

I still don't have a clear understanding of what you want to do. Is the left aligned box and right aligned box next to each other in the same vertical position? How large do you want these paragraph blocks to be?

Anyway, consider using, e.g., a \parbox with an \hfill to push it to the right:

Code: Select all

\documentclass{article}
\begin{document}
\noindent\parbox{0.4\textwidth}{\raggedright Here is the text that goes on the left and I'm just filling it out a little so that it will take up multiple lines.}\hfill%
\parbox{0.4\textwidth}{\raggedright Here is the text that goes on the right and I'm just filling it out a little so that it will take up multiple lines.}

\bigskip

Here is some normal paragraph text so you can see what the above looks like in comparison.

\end{document} 
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Right aligning a left-aligned block of text

Post by localghost »

I still have difficulties in getting involved with that because I can't figure out precisely how this is going to look like. So I can only suggest to take a look at the parallels or parcolumns package.
Matt_Fl
Posts: 3
Joined: Thu May 27, 2010 4:40 pm

Re: Right aligning a left-aligned block of text

Post by Matt_Fl »

The parbox with hfill does what I want at the moment. I will check out the two packages if I want to do something more sophisticated in the future. Thank you!
Post Reply