1

I was wondering if it was possible to have two sections of text, on the same line be both left justified and right justified.

For example doing this:

{\itshape{\begin{flushleft}I'm on the left\end{flushleft}\begin{flushright}I'm on the right\end{flushright}}

Ends up looking like this:

I'm on the left
                                                                                  I'm on the right

How can I make it look like this?:

I'm on the left                                                                   I'm on the right
  • 5
    Just use \itshape{I'm on the left \hfill I'm on the right} – Guido Mar 24 '15 at 4:01
  • Or use minipages if you need more than that. – cfr Mar 24 '15 at 4:11
  • @Guido Unfortunately that did not work :/ it didn't change anything. I just found something and edited it to work though, I'll update the question now. – Alex Mar 24 '15 at 4:16
  • Perhaps the use of paracols package does help – user31729 Mar 24 '15 at 4:26
  • I'm surprised that Guido's suggestion does not work for you. This, for example, works as you wish: \documentclass{article}\begin{document}The left \hfill The right\end{document} – Franck Pastor Mar 24 '15 at 8:23
1

This ended up solving my problem :)

\newcommand{\restitle}[2]{%
  \par\medskip\noindent
  \makebox[0pt][l]{\itshape\normalsize{#1}}%
  \makebox[\textwidth][r]{\itshape\normalsize{#2}}}

Usage: \restitle{I'm on the left}{I'm on the right}

Output: I'm on the left I'm on the right

1

Just use a stretched box:

\documentclass{article}
\usepackage{showframe} % just for the example

\newcommand{\restitle}[2]{%
  \begin{flushleft}% makes for vertical spacing and kills indent
  \makebox[\textwidth][s]{#1\hfil#2}%
  \end{flushleft}
}

\begin{document}

\restitle{I'm on the left}{I'm on the right}

\restitle{Again left}{Again right}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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