Wednesday, February 15, 2012

LaTeX: left-justify, center, right-justify on same line

Here's a quick LaTeX hack to left-justify, center, and right-justify text all on the same line:

\newcommand{\lrc}[3]{%
  \noindent%
  \makebox[0pt][l]{#1}%
  \hfill%
  \makebox[0pt][c]{#2}%
  \hfill%
  \makebox[0pt][r]{#3}%
}

Hej då!