5

I'm just wondering if there's a way to left-align for a part of my line, while to right-align the rest? Just like what people did in their resume, except I want to make sure that my x's are strictly right-aligned.

For example:

|ooooooooo _______________ xxxxxx|

Where the | is just indicating the margin of the page and the _ represents the space in between.

Werner
  • 603,163
Greenhill
  • 401

1 Answers1

5

Most likely what you're after is to insert a rubber length that stretches with your content. In LaTeX, this is provided by \hfill. You can insert it between two pieces of text, or any construct that sets in horizontal mode (like a tabular):

enter image description here

\documentclass{article}

\begin{document}

\noindent
Some content on the left \hfill% <----- rubber length
Some content on the right

\bigskip

\noindent
\begin{tabular}{@{} p{.4\linewidth} @{}}
  \raggedright
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
  Aenean orci odio, sollicitudin sed lectus et, accumsan porttitor erat. 
  Donec imperdiet rutrum nibh quis sodales. Nunc sagittis orci enim, 
  a egestas enim congue et.
\end{tabular}\hfill% <----- rubber length
\begin{tabular}{@{} p{.4\linewidth} @{}}
  \raggedleft
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
  Aenean orci odio, sollicitudin sed lectus et, accumsan porttitor erat. 
  Donec imperdiet rutrum nibh quis sodales. Nunc sagittis orci enim, 
  a egestas enim congue et.
\end{tabular}

\end{document}

If you want a rubber rule, use \hrulefill. If you want a rubber dot fill, use \dotfill. Alternatively, use a construction of some leader.

Werner
  • 603,163