1

I'm trying to display some text left aligned and right aligned with:

\bf{Left Aligned} \hfill Right aligned \hfil 

But the right aligned section leaves a tab of empty whitespace before the end. If I use:

\bf{Left Aligned} \hfill Right aligned \hfil\break

The text is appropriately right aligned, but I don't want the extra break. Any help would be greatly appreciated.

1
  • Welcome to TeX SX! \textbf{Left aligned}\hfill Right aligned} and a blank line thereafter should be enough.
    – Bernard
    Aug 21, 2016 at 16:17

2 Answers 2

3

the following mechanism will produce a one-line paragraph that starts flush left and ends flush right.

\documentclass{article}

\begin{document}

{\parindent=0pt \parfillskip=0pt
 \textbf{Left Aligned} \hfill Right aligned\par
}

\end{document}

if the paragraph is more than one line long, but the flush-right material doesn't fit on what remains of the last line (although it is less than one line long), then the mechanism used for a qed box on a theorem proof, or for the signature on an epigraph, is more appropriate. some possibilities are described here: Moving an object to the right margin

0
1

I'm not sure what you're trying to do, but

\documentclass{article}



\begin{document}
    \textbf{Left Aligned} \hfill Right aligned \hfil

    \textbf{Left Aligned} \hfill Right aligned \hfil\break

    \textbf{Left Aligned} \hfill Right aligned \hfill 

    \textbf{Left Aligned} \hfill Right aligned \hfill\break

\end{document}

produces

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .