Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I desire make a template as

line 1 I line a
line 2 I line b
Another text

The I are just column localization.

I found the multicol package but I have not had success using it.

    \hline line 1 line a\\
    \hline line 2 line b\\
Another text

How I put line a and b to right centralized?

share|improve this question
You don't need multicol for this. You can place the content in a tabular. If you provide some more context, in the form of a minimal example (that would include what you actually want as "line 1", "line 2", "line a" and "line b", then it would easy to provide an alternative. Also, what is the alignment requirements for "Another text"? –  Werner Feb 29 '12 at 17:17
I'm at work, so don't have the entire code. I will post later. Sorry. –  André Andrade Feb 29 '12 at 17:28

2 Answers 2

Here is a minimal example duplicating your output for a much larger portion of text (I defined \text to contain some Lorem Ipsum-style dummy text).

enter image description here


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.%

  \text & \text \text \\
  \text \text & \text \\


Two column types are created using array's \newcolumntype:

  • L: a \raggedleft paragraph column of width exactly .5\linewidth-\tabcolsep. This allows for the text to be spread of 50% of the text block while still taking care of the column separation inherent to tabulars; and
  • R: a \raggedright paragraph column that mimics L.

The tabular column separation is removed on the outer edges of both L and R using @{}. Other alignment options are also possible, together with vertical spacing between tabular and the rest of the document content.

Note that, since the content is placed inside a tabular, it will not break across page boundaries.

share|improve this answer

If all you need is to flush short lines to the sides and want to input them on a line-by-line basis, you don't require any environment whatsoever, because \hfill will suffice.

\documentclass[12pt, a4paper]{article}
\parbox{5cm}{ \parindent=.5cm % just for show

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

line 1 \hfill line a\\
line 2 \hfill line b\\
line 3 \hfill line c

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.


To keep the display small I have put everything in a narrow parbox. Here's the output: enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.