[Tex/LaTex] Aligning text in the multicols environment

alignhorizontal alignmentmulticol

Here's the minimal code:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{fullpage}
\usepackage{setspace}
\usepackage{multicol}
\onehalfspacing

\begin{document}

\begin{multicols}{2}
\noindent Author A \newline
Department Name, \newline
University Name, \newline
City, Country. \newline
Email: ABC@gmail.com

\columnbreak

\noindent Author B \newline
Department Name, \newline
University Name, \newline
City, Country. \newline
Email: XYZ@gmail.com
\end{multicols}

\end{document}

The output is as follows:

enter image description here

How can I make the right column right indented, just like the left column is left indented, to make sure the text in the right column is aligned with the little black line which is supposed to be the end of the page on the right hand side.

Best Answer

I'm not quite sure if I did understand the alignment you want to get. In case that the second author shouldn't be set flushright change the tabular column type from r to l.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{fullpage}
\usepackage{setspace}
\usepackage{lipsum}
\onehalfspacing

\begin{document}

\noindent\begin{tabular}[t]{@{}l}
Author A \\
Department Name, \\
University Name, \\
City, Country. \\
Email: ABC@gmail.com
\end{tabular}
\hfill
\begin{tabular}[t]{r@{}}
Author B \\
Department Name, \\
University Name, \\
City, Country. \\
Email: XYZ@gmail.com
\end{tabular}

\bigskip
\lipsum[1]
\end{document}

enter image description here

With \begin{tabular}[t]{l@{}} for the second author:

enter image description here

Related Question